CN111709250A - Method, apparatus, electronic device, and storage medium for information processing - Google Patents
Method, apparatus, electronic device, and storage medium for information processing Download PDFInfo
- Publication number
- CN111709250A CN111709250A CN202010531452.8A CN202010531452A CN111709250A CN 111709250 A CN111709250 A CN 111709250A CN 202010531452 A CN202010531452 A CN 202010531452A CN 111709250 A CN111709250 A CN 111709250A
- Authority
- CN
- China
- Prior art keywords
- tree node
- semantic representation
- knowledge base
- neural network
- network model
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
- 230000010365 information processing Effects 0.000 title claims abstract description 54
- 238000000034 method Methods 0.000 title claims abstract description 50
- 238000003062 neural network model Methods 0.000 claims abstract description 55
- 238000003058 natural language processing Methods 0.000 abstract description 2
- 238000013135 deep learning Methods 0.000 abstract 1
- 238000013507 mapping Methods 0.000 abstract 1
- 238000010586 diagram Methods 0.000 description 22
- 238000012545 processing Methods 0.000 description 16
- 230000008569 process Effects 0.000 description 14
- 230000006870 function Effects 0.000 description 12
- 238000004590 computer program Methods 0.000 description 10
- 238000013528 artificial neural network Methods 0.000 description 6
- 238000004458 analytical method Methods 0.000 description 4
- 230000005540 biological transmission Effects 0.000 description 4
- 238000004891 communication Methods 0.000 description 4
- 230000003287 optical effect Effects 0.000 description 3
- 238000013459 approach Methods 0.000 description 2
- 239000000835 fiber Substances 0.000 description 2
- 238000001914 filtration Methods 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 230000001902 propagating effect Effects 0.000 description 2
- 238000012216 screening Methods 0.000 description 2
- 238000012549 training Methods 0.000 description 2
- 238000012935 Averaging Methods 0.000 description 1
- RYGMFSIKBFXOCR-UHFFFAOYSA-N Copper Chemical compound [Cu] RYGMFSIKBFXOCR-UHFFFAOYSA-N 0.000 description 1
- 238000010276 construction Methods 0.000 description 1
- 229910052802 copper Inorganic materials 0.000 description 1
- 239000010949 copper Substances 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 239000004519 grease Substances 0.000 description 1
- 238000004519 manufacturing process Methods 0.000 description 1
- 238000012913 prioritisation Methods 0.000 description 1
- 238000003672 processing method Methods 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
- 230000003068 static effect Effects 0.000 description 1
- 238000012546 transfer Methods 0.000 description 1
- 230000007704 transition Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F40/00—Handling natural language data
- G06F40/30—Semantic analysis
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/30—Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
- G06F16/33—Querying
- G06F16/332—Query formulation
- G06F16/3329—Natural language query formulation or dialogue systems
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/30—Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
- G06F16/36—Creation of semantic tools, e.g. ontology or thesauri
- G06F16/367—Ontology
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/04—Architecture, e.g. interconnection topology
- G06N3/045—Combinations of networks
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/08—Learning methods
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- Computational Linguistics (AREA)
- General Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- Artificial Intelligence (AREA)
- Mathematical Physics (AREA)
- Data Mining & Analysis (AREA)
- Health & Medical Sciences (AREA)
- Life Sciences & Earth Sciences (AREA)
- General Health & Medical Sciences (AREA)
- Computing Systems (AREA)
- Molecular Biology (AREA)
- Evolutionary Computation (AREA)
- Biophysics (AREA)
- Software Systems (AREA)
- Biomedical Technology (AREA)
- Databases & Information Systems (AREA)
- Human Computer Interaction (AREA)
- Animal Behavior & Ethology (AREA)
- Audiology, Speech & Language Pathology (AREA)
- Machine Translation (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
Embodiments of the present disclosure relate to methods, apparatuses, electronic devices, and computer storage media for information processing, and relate to the fields of knowledge-mapping, deep learning, and natural language processing. According to the method, a semantic representation is obtained from a natural language problem to be processed, a first operation related to the semantic representation is determined from a plurality of operations associated with a knowledge base as a first tree node based on a neural network model, and a second tree node is generated based on the semantic representation, the first operation, input parameters of the first operation, and the neural network model, the second tree node being a child node of the first tree node. Thus, a tree structure having operations associated with the knowledge base as tree nodes can be generated based on the natural language question, and the query sentence can be converted easily and efficiently.
Description
Technical Field
Embodiments of the present disclosure relate generally to the field of natural language processing, and more particularly, to a method, apparatus, electronic device, and computer storage medium for information processing.
Background
In the question and answer scenario, no matter the question and answer is a general question and answer or a question and answer in the industry field, firstly, semantic analysis is needed, then, the analysis result of the question is converted into a query statement, and finally, the query statement is searched in a knowledge base. Traditionally, the problem is resolved using rule matching or neural networks. And constructing a matching mode through manual marking based on the scheme of rule matching, and acquiring the analysis information of the problem according to the mode. This approach requires a lot of time and labor to label the fixed matching patterns and has poor generalization ability. The neural network based scheme determines semantic components through the neural network and determines relationships between the respective semantics. The semantic tree obtained by the analysis of the scheme only represents the relationship between different semantic elements and cannot be directly converted into a query statement.
Disclosure of Invention
A method, an apparatus, an electronic device, and a computer storage medium for information processing are provided.
According to a first aspect of the present disclosure, a method for information processing is provided. The method comprises the following steps: the method includes obtaining a semantic representation from a natural language problem to be processed, determining a first operation related to the semantic representation from a plurality of operations associated with a knowledge base as a first tree node based on a neural network model, and generating a second tree node based on the semantic representation, the first operation, input parameters of the first operation, and the neural network model, the second tree node being a child node of the first tree node.
According to a second aspect of the present disclosure, there is provided an apparatus for information processing. The device includes: a semantic representation acquisition module configured to acquire a semantic representation from a natural language question to be processed; a first operation determination module configured to determine a first operation related to the semantic representation from a plurality of operations associated with the knowledge base as a first tree node based on the neural network model; and a tree node generation module configured to generate a second tree node based on the semantic representation, the first operation, the input parameters of the first operation, and the neural network model, the second tree node being a child node of the first tree node.
According to a third aspect of the present disclosure, an electronic device is provided. The electronic device includes: at least one processor, and a memory communicatively connected to the at least one processor, wherein the memory stores instructions executable by the at least one processor, the instructions being executable by the at least one processor to enable the at least one processor to perform the method according to the first aspect.
In a fourth aspect of the present disclosure, a computer-readable storage medium is provided, on which a computer program is stored which, when executed by a processor, implements a method according to the first aspect of the present disclosure.
According to the technology disclosed by the invention, the tree structure with the operation associated with the knowledge base as the tree node can be generated based on the natural language problem, the query statement can be simply and efficiently converted, and the problems that the efficiency of pattern matching is low and the query statement cannot be directly converted based on the semantic tree of the neural network are effectively solved.
It should be understood that the statements in this section do not necessarily identify key or critical features of the embodiments of the present disclosure, nor do they limit the scope of the present disclosure. Other features of the present disclosure will become apparent from the following description.
Drawings
The above and other features, advantages and aspects of various embodiments of the present disclosure will become more apparent by referring to the following detailed description when taken in conjunction with the accompanying drawings. In the drawings, like or similar reference characters designate like or similar elements, and wherein:
FIG. 1 is a schematic diagram of an information handling environment 100 according to an embodiment of the present disclosure;
FIG. 2 is a schematic diagram of a method 200 for information processing, according to an embodiment of the present disclosure;
FIG. 3 is a schematic diagram of a method 300 for obtaining a semantic representation from a natural language question, according to an embodiment of the present disclosure;
FIG. 4 is a schematic diagram of a process 400 of generating tags corresponding to word sequences of an example natural language question, according to an embodiment of the present disclosure;
FIG. 5 is a schematic diagram of a process 500 of generating an example tree structure, according to an embodiment of the present disclosure;
FIG. 6 is a schematic diagram of an apparatus 600 for information processing, according to an embodiment of the present disclosure; and
fig. 7 is a block diagram of an electronic device for an information processing method used to implement an embodiment of the present disclosure.
Detailed Description
Exemplary embodiments of the present disclosure are described below with reference to the accompanying drawings, in which various details of the embodiments of the disclosure are included to assist understanding, and which are to be considered as merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the present disclosure. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
The term "include" and variations thereof as used herein is meant to be inclusive in an open-ended manner, i.e., "including but not limited to". Unless specifically stated otherwise, the term "or" means "and/or". The term "based on" means "based at least in part on". The terms "one example embodiment" and "one embodiment" mean "at least one example embodiment". The term "another embodiment" means "at least one additional embodiment". The terms "first," "second," and the like may refer to different or the same object. Other explicit and implicit definitions are also possible below.
As described above, the pattern matching scheme is inefficient because a lot of time and labor are required to label the fixed matching pattern, and the semantic tree generated by the neural network scheme cannot be directly converted into the query statement. In addition, the neural network scheme has no logical constraint information in the process of generating the semantic tree, so that the generated result is easy to be out of logical.
To address, at least in part, one or more of the above issues and other potential issues, an example embodiment of the present disclosure proposes a scheme for information processing. In the approach, a semantic representation is obtained from a natural language problem to be processed, a first operation related to the semantic representation is determined from a plurality of operations associated with a knowledge base as a first tree node based on a neural network model, and a second tree node is generated based on the semantic representation, the first operation, input parameters of the first operation, and the neural network model, the second tree node being a child node of the first tree node.
Thus, a tree structure having tree nodes of operations associated with the knowledge base can be generated based on the semantic representation of the natural language question, and the query sentence can be converted easily and efficiently.
Hereinafter, specific examples of the present scheme will be described in more detail with reference to the accompanying drawings.
FIG. 1 shows a schematic diagram of an example of an information processing environment 100, according to an embodiment of the present disclosure. The information processing environment 100 may include an information processing device 110, a natural language question 120 to be processed, a knowledge base 130, and a tree 140 including at least a first tree node 140-1 and a second tree node 140-2.
The information processing device 110 includes, for example, but is not limited to, a personal computer, a server computer, a multiprocessor system, a mainframe computer, a distributed computing environment including any of the above systems or devices, and the like. In some embodiments, the emulation device 110 can have one or more processing units, including special purpose processing units such as an image processing unit GPU, a field programmable gate array FPGA, and an application specific integrated circuit ASIC, and general purpose processing units such as a central processing unit CPU. The information processing device 110 may access the knowledge base 130.
The knowledge base 130 may include a plurality of elements. Elements are for example, but not limited to, an object S, a property P, a property value O, a category C, a relationship R, and an operation F. An object may be implemented, for example, as a node in a knowledge graph, or as the name of a record in a structured database. Attributes may be implemented, for example, as edges in a knowledge graph, or as the content of a cell in structured data. The attribute values may be implemented, for example, as attribute values in a knowledge graph, or as the contents of a cell in structured data. The categories may be implemented, for example, as categories in a knowledge graph, or table names in a structured database. Relationships may represent relationships between attributes and attribute values, such as filtering. An operation may refer to a function having a specific function.
The information processing apparatus 110 is configured to obtain a semantic representation from the natural language question 120 to be processed, determine a first operation related to the semantic representation from a plurality of operations associated with the knowledge base 130 as a first tree node 140-1 based on the neural network model, and generate a second tree node 140-2 based on at least input parameters of the first operation, the second tree node 140-2 being a child node of the first tree node 140-1.
Thereby, a tree structure with operations associated with the knowledge base as tree nodes can be generated based on the semantic representation of the natural language question, which can be converted into query statements in a simple and efficient manner.
Fig. 2 shows a flow diagram of a method 200 for information processing according to an embodiment of the present disclosure. For example, the method 200 may be performed by the information processing device 110 as shown in FIG. 1. It should be understood that method 200 may also include additional blocks not shown and/or may omit blocks shown, as the scope of the present disclosure is not limited in this respect.
At block 202, the information processing device 110 obtains a semantic representation from the natural language question 120 to be processed. For example, a neural network model, such as an encoder, may be utilized to obtain a semantic representation from a natural language problem to be processed. The encoder may, for example, employ various pre-training models, such as BERT, ERNIE, to enhance effectiveness.
At block 204, the information processing device 110 determines a first operation related to the semantic representation from a plurality of operations associated with the knowledge base 130 as a first tree node based on the neural network model.
The plurality of operations associated with the knowledge base 130 may be, for example, Function (para1, para2, …), where "Function" is the name of the operation and the parenthetical content "para 1, para2, …" is the input parameter of the operation. By way of example only, some operations are shown below.
filter (S _ LIST, P, O, R or func) that screens out the subset that meets the requirements according to the attributes. The input parameter S _ LIST represents a set of candidates S; the input parameter P represents an attribute for filtering; the input parameter O represents a reference value of the attribute; and the input parameter R indicates conditions for screening for determining the screening relationship between P and O.
get _ P (S _ LIST, P), which obtains the value of some attribute of all objects in the collection. Input parameter S _ LIST: representing a set of S; the input parameter P represents an attribute to be acquired.
jump (S _ LIST, P), edge jump operation, which jumps from one entity to another. The input parameter S _ LIST represents the S set; the input parameter P represents the attribute to be acquired, which in the knowledge graph corresponds to node hopping and in SQL corresponds to linking with a table.
argsort (S _ LIST, P), which selects the most valued object according to some attribute. The input parameter S _ LIST represents the S set; the input parameter P represents an attribute for sorting, and may include two operations, argmax and argmin.
multi _ compute (O _ LIST), multivariate computational operation. The input parameter O _ LIST represents a set of attribute values, the length of O _ LIST being variable. The multi _ computer may include: max, min, count, avg, sum.
binary _ compute (O1, O2), binary computation operation. The input parameter O1 represents a first attribute value of the operation; the input parameter O2 represents a second attribute value of the operation. The binary _ computer includes, for example, sub.
logic _ func/relation (O1, O2), logical operation, which returns True or False. The input parameter O1 represents a first attribute value of the operation; the input parameter O2 represents a second attribute value of the operation. logic _ func/relation includes, for example: is _ equivalent, is _ grease _ this, is _ less _ this, etc.
In some embodiments, the neural network model may be trained based on reference semantic representations obtained from reference natural language questions and reference operations associated with the knowledge base 130. Thus, the neural network model may determine, in an accurate and efficient manner, from a plurality of operations, an operation that is related to a semantic representation obtained from a natural language question to be processed.
For example, if the natural language question to be processed is "average height of stars that is the same as Liu De height," then the neural network model may determine, from the plurality of operations, that the first operation associated with the semantic representation of the question is the averaging operation avg (O _ LIST).
At block 206, the information processing device 110 generates a second tree node based on the semantic representation, the first operation, the input parameters of the first operation, and the neural network model, the second tree node being a child node of the first tree node. For example, the second tree node may be generated based on which element in the knowledge base 130 the input parameter is. The input parameters may include objects, attributes, attribute values, categories, relationships, and/or operations in the knowledge base 130. Thus, the spanning tree may be simply translated into a query for elements in the knowledge base.
Thereby, a tree structure with operations associated with the knowledge base as tree nodes can be generated based on the semantic representation of the natural language question, which can be converted into query statements in a simple and efficient manner.
Alternatively or additionally, in some embodiments, the information processing device 110 may determine whether the input parameter of the first operation is an object in the knowledge base 130. The objects here may be singular S or plural, e.g. a LIST of objects S _ LIST. If the information processing apparatus 110 determines that the input parameter is an object in the knowledge base 130, a second operation related to the semantic representation may be determined from a first set of operations corresponding to the object among the plurality of operations as a second tree node based on the first operation and the neural network model.
For example, the first set of operations corresponding to an object may include all, filter, jump, argmax, argmin, where all represents the get corpus. This set of operations can be used to replace objects or can be a branch constraint. In the case where it is determined that the input parameter is an object in the knowledge base 130, the information processing apparatus may determine, as the second tree node, a second operation related to the semantic representation, for example, a filter, from the above-described first group of operations all, filter, jump, argmax, argmin, based on the first operation and the neural network model.
Therefore, the transfer constraint related to the object can be introduced in the process of generating the tree structure, so that the generated tree structure is more logical.
Alternatively or additionally, in some embodiments, the information processing device 110 may determine whether the first operational input parameter is an attribute value in the knowledge base 130. The attribute value here may be singular O or plural, such as an attribute value LIST O _ LIST. If the information processing apparatus 110 determines that the input parameter is an attribute value in the knowledge base 130, a third operation related to the semantic representation may be determined as a second tree node from a second group of operations corresponding to the attribute value among the plurality of operations based on the first operation and the neural network model.
For example, the second set of operations corresponding to the attribute value may include object, get _ p, sub, multi _ computer, binary _ computer, where object represents obtaining the attribute value. This set of operations may be used to replace property values or may be a branch constraint. In the case where it is determined that the input parameter is an attribute value in the knowledge base 130, the information processing apparatus may determine, as the second tree node, a third operation related to the semantic representation, for example, get _ p, from the above-described second group of operations object, get _ p, sub, multi _ computer, binary _ computer, based on the first operation and the neural network model.
Therefore, the transition constraint related to the attribute value can be introduced in the process of generating the tree structure, so that the generated tree structure is more logical.
Alternatively or additionally, in some embodiments, the information processing device 110 may determine whether the first operational input parameter is a category in the knowledge base 130. In some embodiments, categories may be considered special attributes. If the information processing apparatus 110 determines that the input parameter is a category in the knowledge base 130, a first category instance related to the semantic representation may be determined as the second tree node from category instances in the knowledge base 130 corresponding to the category based on the first operation and the neural network model. Examples of categories include, for example, but are not limited to, "professional," "industry," and the like.
Therefore, the constraint related to the category can be introduced in the process of generating the tree structure, so that the generated tree structure is more logical.
Alternatively or additionally, in some embodiments, the information processing device 110 may determine the input parameter of the first operation as an attribute in the knowledge base 130. If the information processing apparatus 110 determines that the input parameter is an attribute in the knowledge base 130, a first attribute instance related to the semantic representation is determined as a second tree node from among attribute instances corresponding to the attribute in the knowledge base 130 based on the first operation and the neural network model. Examples of attributes include, but are not limited to, "name," "height," "weight," and the like.
Therefore, the constraint related to the attribute can be introduced in the process of generating the tree structure, so that the generated tree structure is more logical.
Alternatively or additionally, in some embodiments, the information processing device 110 may determine whether the input parameter of the first operation is a relationship. If the information processing apparatus 110 determines that the input parameter is a relationship, a first relational operation relating to the semantic representation is determined as a second tree node from among relational operations corresponding to the relationship based on the first operation and the neural network model. Relational operations include, for example, but are not limited to, greater than, equal to, less than, and the like.
Therefore, the constraint related to the relation can be introduced in the process of generating the tree structure, so that the generated tree structure is more logical.
Alternatively or additionally, in some embodiments, the information processing device 110 may determine whether the input parameter of the first operation is an operation. If the input parameter is determined to be an operation, a fourth operation related to the semantic representation is determined from a plurality of operations associated with the knowledge base as a second tree node based on the first operation and the neural network model.
Therefore, operation-related constraints can be introduced in the process of generating the tree structure, so that the generated tree structure is more logical.
The following description is continued with reference to the example employed in the embodiment of fig. 2 above and fig. 5. For example, in a case where the first operation is determined as avg (O _ LIST), the input parameter O _ LIST thereof is an attribute value LIST, the information processing apparatus 110 may determine, based on the first operation avg (O _ LIST) and the neural network model, an operation related to the semantic representation as get _ P (S _ LIST, P) from among the second group of operations object, get _ P, sub, multi _ computer, and binary _ computer corresponding to the attribute values, and take the get _ P (S _ LIST, P) as the second tree node.
For the second tree node get _ P (S _ LIST, P) whose first input parameter S _ LIST represents the object LIST, the information processing apparatus 110 may determine, based on the operation get _ P (S _ LIST, P) and the neural network model, an operation related to semantic representation as a filter (S _ LIST, P, O, R) from among the first group of operations all, filter, jump, argmax, argmin corresponding to the object, and take the filter (S _ LIST, P, O, R) as a third tree node which is a child node of the second tree node. The second input parameter P of the second tree node represents an attribute, the information processing apparatus 110 may acquire a second instance, such as "height", in the knowledge base 130 that matches the sequence of words of the natural language question and is associated with the attribute as a fourth tree node, which is a child node of the second tree node.
For the third tree node filter (S _ LIST, P, O, R), the first input parameter S _ LIST of which represents the object LIST, the information processing apparatus 110 determines the operation related to the semantic representation as filter (S _ LIST, P, O, R) as a fifth tree node which is a child node of the third tree node based on the operation filter (S _ LIST, P, O, R) and the neural network model.
Then, the second input parameter P represents an attribute, the information processing apparatus 110 may acquire an instance in the knowledge base 130 that matches the word sequence of the natural language question and is associated with the attribute, for example, an instance of the attribute "type", as a sixth tree node that is a child node of the third tree node.
Subsequently, the third input parameter O represents an attribute value, the information processing apparatus 110 may determine an operation related to semantic representation from among the second group of operations object, get _ P, sub, multi _ computer, and binary _ computer corresponding to the attribute value based on the filter (S _ LIST, P, O, R) and the neural network model, and acquire the attribute value operation object so as to have, for example, the attribute value "star" as a seventh tree node, which is a child node of the third tree node.
Finally, the fourth input parameter R represents a relationship, the information processing apparatus 110 may determine a first relational operation, e.g., is _ equivalent, related to the semantic representation from among the relational operations corresponding to the relationship as an eighth tree node which is a child node of the third tree node based on the filter (S _ LIST, P, O, R) and the neural network model.
The sixth, seventh and eighth tree nodes no longer have child nodes generated.
For the fifth tree node filter (S _ LIST, P, O, R), the child node generation process is similar to the above, and the child nodes are the corpus operation all, the attribute instance "height" in the knowledge base, get _ P (S _ LIST, P), and the relationship operation is _ equal, respectively. Wherein the full set operation all, the attribute instance "height" in the knowledge base, and the relationship operation is _ equal no longer have child nodes expanded. For the child node get _ P (S _ LIST, P) of the fifth tree node, its child nodes are respectively filter (S _ LIST, P, O, R) and attribute instance "height" in the knowledge base. For the filter (S _ LIST, P, O, R), its child nodes are respectively the corpus operation all, the attribute instance "name" in the knowledge base, the attribute value "liudelwa" in the knowledge base, and the relationship operation is _ equivalent, these child nodes are no longer extended with child nodes, the tree generation is completed, and the problem resolution is completed. Thereafter, the tree may be able to be directly translated into a query statement for querying in the knowledge base.
In some embodiments, child nodes may be generated in a depth-first manner until the generated nodes no longer have child nodes expanded.
FIG. 3 illustrates a flow diagram of a method 300 for obtaining a semantic representation from a natural language question in accordance with an embodiment of the present disclosure. For example, the method 300 may be performed by the information processing device 110 as shown in FIG. 1. It should be understood that method 300 may also include additional blocks not shown and/or may omit blocks shown, as the scope of the disclosure is not limited in this respect.
At block 302, the information processing device 110 determines a first element in the knowledge base 130 that matches a sequence of words in the natural language question.
Continuing with the example employed in connection with the embodiment of FIG. 2, for the question "average height of stars that is the same as Liu De height," the element that matches the word sequence "Liu De Hua" can be determined as the object, the element that matches the word sequence "height" as the attribute, the element that matches the word sequence "same" as the relationship, the element that matches the word sequence "stars" as the category, and the relationship that matches the word sequence "average" as the operation. Further, for "and", the elements matched thereto may be determined to be other.
In some embodiments, the information processing device 110 may determine a plurality of elements in the knowledge base 130 that match a plurality of word sequences in the natural language question. For example, the word sequences "Liude" and "Liudebua" may match two objects.
Subsequently, the information processing apparatus 110 may determine whether the lengths of the plurality of word sequences are the same. If the information processing apparatus 110 determines that the lengths of the plurality of word sequences are the same, the element with the highest priority among the plurality of elements is determined as the first element. The prioritization of elements may be as follows: category > operation > relationship > object > attribute value.
If the information processing apparatus 110 determines that the lengths of the plurality of word sequences are different, an element that matches the longest word sequence of the plurality of word sequences is determined as the first element. For example, for the word sequences "Liu De" and "Liu De Hua," the length of the word sequence "Liu De Hua" is the longest, and the object that matches "Liu De Hua" is determined to be the first element.
Thus, when the word sequence matches a plurality of elements, the best matching first element can be determined in an accurate manner, and matching accuracy is improved.
At block 304, the information processing device 110 generates a first tag corresponding to the sequence of words based on the first element. The elements may have corresponding labels as shown in table 1 below.
TABLE 1
Element(s) | Object | Properties | Attribute value | Relationships between | Categories | Operation of | Others |
Label (R) | s | p | o | r | c | f | e |
The word sequence matching the first element may be labeled based on a label corresponding to the first element, generating a first label corresponding to the word sequence. The correspondence of the word sequence to the first tag may be as shown in fig. 4.
At block 306, the information processing device 110 obtains a semantic representation based on the sequence of words, the first tag, and the encoder model. As shown in fig. 4, a word sequence of a natural language question and a corresponding first tag are input into an encoder model, and a semantic representation is output. The encoder model may employ various pre-training models, such as BERT, ERNIE, and the like.
Therefore, the semantic representation is acquired after the word sequence of the natural language problem is labeled based on the knowledge base, so that more semantic information can be introduced, and the problem can be more accurately understood.
Fig. 6 is a schematic block diagram of an apparatus 600 for information processing according to an embodiment of the present disclosure. As shown in fig. 6, the apparatus 600 includes: a semantic representation obtaining module 601 configured to obtain a semantic representation from a natural language question to be processed; a first operation determination module 602 configured to determine a first operation related to the semantic representation from a plurality of operations associated with the knowledge base as a first tree node based on the neural network model; and a tree node generating module 603 configured to generate a second tree node based on the semantic representation, the first operation, the input parameters of the first operation, and the neural network model, the second tree node being a child node of the first tree node.
Alternatively or additionally, in some embodiments, the tree node generation module 603 comprises: a second operation determination module configured to determine, based on the first operation and the neural network model, a second operation related to the semantic representation from a first set of operations corresponding to the object among the plurality of operations as a second tree node if the input parameter is determined to be the object in the knowledge base 130; and a third operation determination module configured to determine, based on the first operation and the neural network model, a third operation related to the semantic representation from a second set of operations corresponding to the attribute value among the plurality of operations as a second tree node if the input parameter is determined to be the attribute value in the knowledge base.
Alternatively or additionally, in some embodiments, the tree node generation module 603 comprises: a first class instance determination module configured to determine, if the input parameter is determined to be a class in the knowledge base, a first class instance related to the semantic representation from class instances corresponding to the class in the knowledge base 130 as a second tree node based on the first operation and the neural network model; and a first attribute instance determination module configured to determine, if the input parameter is determined to be an attribute in the knowledge base 130, a first attribute instance related to the semantic representation from attribute instances corresponding to the attribute in the knowledge base 130 as a second tree node based on the first operation and the neural network model.
Alternatively or additionally, in some embodiments, the tree node generation module 603 comprises: a first relational operation determination module configured to determine, if the input parameter is determined to be a relation, a first relational operation related to the semantic representation from among relational operations corresponding to the relation as a second tree node based on the first operation and the neural network model; and a fourth operation determination module configured to determine a fourth operation related to the semantic representation from the plurality of operations as a second tree node based on the first operation and the neural network model if the input parameter is determined to be an operation.
Alternatively or additionally, in some embodiments, the semantic representation acquisition module 601 includes: a first element determination module configured to determine a first element in the knowledge base 130 that matches a sequence of words in the natural language question; a first tag generation module configured to generate a first tag corresponding to the sequence of words based on the first element; and an acquisition module configured to acquire the semantic representation based on the sequence of words, the first tag, and the encoder model.
Alternatively or additionally, in some embodiments, the first element determination module comprises: a plurality of element determination modules configured to determine a plurality of elements in the knowledge base 130 that match a plurality of word sequences in the natural language question; a priority element determination module configured to determine an element having a highest priority among the plurality of elements as a first element if it is determined that the lengths of the plurality of word sequences are the same, and a longest element determination module configured to determine an element matching a longest word sequence among the plurality of word sequences as the first element if it is determined that the lengths of the plurality of word sequences are different.
Alternatively or additionally, in some embodiments, the input parameters comprise at least one of: objects, attributes, attribute values, categories, relationships, and operations in the knowledge base 130.
Alternatively or additionally, in some embodiments, the neural network model is trained based on a reference semantic representation obtained from a reference natural language question and a reference operation associated with the knowledge base 130.
Fig. 7 illustrates a schematic block diagram of an example device 700 that may be used to implement embodiments of the present disclosure. For example, the information processing apparatus 110 shown in fig. 1 may be implemented by the apparatus 700. As shown, device 700 includes a Central Processing Unit (CPU)701 that may perform various appropriate actions and processes in accordance with computer program instructions stored in a Read Only Memory (ROM)702 or computer program instructions loaded from a storage unit 708 into a Random Access Memory (RAM) 703. In the RAM703, various programs and data required for the operation of the device 700 can also be stored. The CPU701, the ROM 702, and the RAM703 are connected to each other via a bus 704. An input/output (I/O) interface 705 is also connected to bus 704.
Various components in the device 700 are connected to the I/O interface 705, including: an input unit 706 such as a keyboard, a mouse, a microphone, and the like; an output unit 707 such as various types of displays, speakers, and the like; a storage unit 708 such as a magnetic disk, optical disk, or the like; and a communication unit 709 such as a network card, modem, wireless communication transceiver, etc. The communication unit 709 allows the device 700 to exchange information/data with other devices via a computer network, such as the internet, and/or various telecommunication networks.
The various processes and processes described above, such as the method 200-300, may be performed by the processing unit 701. For example, in some embodiments, the method 200-300 may be implemented as a computer software program tangibly embodied in a machine-readable medium, such as the storage unit 708. In some embodiments, part or all of a computer program may be loaded onto and/or installed onto device 700 via ROM 702 and/or communications unit 709. When the computer program is loaded into the RAM703 and executed by the CPU701, one or more acts of the method 200-300 described above may be performed.
The present disclosure relates to methods, apparatuses, systems, electronic devices, computer-readable storage media and/or computer program products. The computer program product may include computer-readable program instructions for performing various aspects of the present disclosure.
The computer readable storage medium may be a tangible device that can hold and store the instructions for use by the instruction execution device. The computer readable storage medium may be, for example, but not limited to, an electronic memory device, a magnetic memory device, an optical memory device, an electromagnetic memory device, a semiconductor memory device, or any suitable combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a Static Random Access Memory (SRAM), a portable compact disc read-only memory (CD-ROM), a Digital Versatile Disc (DVD), a memory stick, a floppy disk, a mechanical coding device, such as punch cards or in-groove projection structures having instructions stored thereon, and any suitable combination of the foregoing. Computer-readable storage media as used herein is not to be construed as transitory signals per se, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through a waveguide or other transmission medium (e.g., optical pulses through a fiber optic cable), or electrical signals transmitted through electrical wires.
The computer-readable program instructions described herein may be downloaded from a computer-readable storage medium to a respective computing/processing device, or to an external computer or external storage device via a network, such as the internet, a local area network, a wide area network, and/or a wireless network. The network may include copper transmission cables, fiber optic transmission, wireless transmission, routers, firewalls, switches, gateway computers and/or edge servers. The network adapter card or network interface in each computing/processing device receives computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in a computer-readable storage medium in the respective computing/processing device.
The computer program instructions for carrying out operations of the present disclosure may be assembler instructions, Instruction Set Architecture (ISA) instructions, machine-related instructions, microcode, firmware instructions, state setting data, or source or object code written in any combination of one or more programming languages, including an object oriented programming language such as Smalltalk, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The computer-readable program instructions may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider). In some embodiments, the electronic circuitry that can execute the computer-readable program instructions implements aspects of the present disclosure by utilizing the state information of the computer-readable program instructions to personalize the electronic circuitry, such as a programmable logic circuit, a Field Programmable Gate Array (FPGA), or a Programmable Logic Array (PLA).
Various aspects of the present disclosure are described herein with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the disclosure. It will be understood that each block of the flowchart illustrations and/or block diagrams, and combinations of blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer-readable program instructions.
These computer-readable program instructions may be provided to a processing unit of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processing unit of the computer or other programmable data processing apparatus, create means for implementing the functions/acts specified in the flowchart and/or block diagram block or blocks. These computer-readable program instructions may also be stored in a computer-readable storage medium that can direct a computer, programmable data processing apparatus, and/or other devices to function in a particular manner, such that the computer-readable medium storing the instructions comprises an article of manufacture including instructions which implement the function/act specified in the flowchart and/or block diagram block or blocks.
The computer readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other devices to cause a series of operational steps to be performed on the computer, other programmable apparatus or other devices to produce a computer implemented process such that the instructions which execute on the computer, other programmable apparatus or other devices implement the functions/acts specified in the flowchart and/or block diagram block or blocks.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of instructions, which comprises one or more executable instructions for implementing the specified logical function(s). In some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
Having described embodiments of the present disclosure, the foregoing description is intended to be exemplary, not exhaustive, and not limited to the disclosed embodiments. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The terms used herein were chosen in order to best explain the principles of the embodiments, the practical application, or technical improvements to the techniques in the marketplace, or to enable others of ordinary skill in the art to understand the embodiments disclosed herein.
Claims (18)
1. A method for information processing, comprising:
obtaining semantic representation from a natural language problem to be processed;
determining, based on a neural network model, a first operation from a plurality of operations associated with a knowledge base that is related to the semantic representation as a first tree node; and
generating a second tree node based on the semantic representation, the first operation, the input parameters of the first operation, and the neural network model, the second tree node being a child node of the first tree node.
2. The method of claim 1, wherein generating the second tree node comprises:
determining a second operation related to the semantic representation from a first set of operations of the plurality of operations corresponding to the object as the second tree node based on the first operation and the neural network model if the input parameter is determined to be an object in the knowledge base; and
determining a third operation related to the semantic representation from a second set of operations of the plurality of operations corresponding to the attribute value as the second tree node based on the first operation and the neural network model if the input parameter is determined to be the attribute value in the knowledge base.
3. The method of claim 1, wherein generating the second tree node comprises:
if the input parameter is determined to be a category in the knowledge base, determining a first category instance related to the semantic representation from category instances corresponding to the category in the knowledge base as the second tree node based on the first operation and the neural network model; and
if the input parameter is determined to be an attribute in the knowledge base, determining a first attribute instance related to the semantic representation from attribute instances corresponding to the attribute in the knowledge base as the second tree node based on the first operation and the neural network model.
4. The method of claim 1, wherein generating the second tree node comprises:
determining a first relational operation related to the semantic representation from among relational operations corresponding to the relations as the second tree node based on the first operation and the neural network model if the input parameter is determined to be a relation; and
determining a fourth operation from the plurality of operations that is related to the semantic representation as the second tree node based on the first operation and the neural network model if the input parameter is determined to be an operation.
5. The method of claim 1, wherein obtaining the semantic representation from the natural language question comprises:
determining a first element in the knowledge base that matches a sequence of words in the natural language question;
generating a first tag corresponding to the sequence of words based on the first element; and
obtaining the semantic representation based on the word sequence, the first tag, and an encoder model.
6. The method of claim 5, wherein determining the first element comprises:
determining, in the knowledge base, a plurality of elements that match a plurality of word sequences in the natural language question;
determining an element with a highest priority among the plurality of elements as the first element if it is determined that the lengths of the plurality of word sequences are the same, an
And if the lengths of the word sequences are determined to be different, determining an element matched with the longest word sequence in the word sequences as the first element.
7. The method of claim 1, wherein the input parameters comprise at least one of:
objects, attributes, attribute values, categories, relationships, and operations in the knowledge base.
8. The method of claim 1, wherein the neural network model is trained based on a reference semantic representation obtained from a reference natural language problem and a reference operation associated with the knowledge base.
9. An apparatus for information processing, comprising:
a semantic representation acquisition module configured to acquire a semantic representation from a natural language question to be processed;
a first operation determination module configured to determine a first operation related to the semantic representation from a plurality of operations associated with a knowledge base as a first tree node based on a neural network model; and
a tree node generation module configured to generate a second tree node based on the semantic representation, the first operation, the input parameters of the first operation, and the neural network model, the second tree node being a child node of the first tree node.
10. The apparatus of claim 9, wherein the tree node generation module comprises:
a second operation determination module configured to determine, based on the first operation and the neural network model, a second operation related to the semantic representation from a first set of operations of the plurality of operations corresponding to the object as the second tree node if the input parameter is determined to be an object in the knowledge base; and
a third operation determination module configured to determine, based on the first operation and the neural network model, a third operation related to the semantic representation as the second tree node from a second set of operations of the plurality of operations corresponding to the attribute value if the input parameter is determined to be the attribute value in the knowledge base.
11. The apparatus of claim 9, wherein the tree node generation module comprises:
a first class instance determination module configured to determine, if the input parameter is determined to be a class in the knowledge base, a first class instance related to the semantic representation from class instances corresponding to the class in the knowledge base as the second tree node based on the first operation and the neural network model; and
a first attribute instance determination module configured to determine, if the input parameter is determined to be an attribute in the knowledge base, a first attribute instance related to the semantic representation from among attribute instances corresponding to the attribute in the knowledge base as the second tree node based on the first operation and the neural network model.
12. The apparatus of claim 9, wherein the tree node generation module comprises:
a first relation operation determination module configured to determine, if the input parameter is determined to be a relation, a first relation operation related to the semantic representation as the second tree node from among relation operations corresponding to the relation based on the first operation and the neural network model; and
a fourth operation determination module configured to determine a fourth operation related to the semantic representation from the plurality of operations as the second tree node based on the first operation and the neural network model if the input parameter is determined to be an operation.
13. The apparatus of claim 9, wherein the semantic representation acquisition module comprises:
a first element determination module configured to determine a first element in the knowledge base that matches a sequence of words in the natural language question;
a first tag generation module configured to generate a first tag corresponding to the sequence of words based on the first element; and
an obtaining module configured to obtain the semantic representation based on the sequence of words, the first tag, and an encoder model.
14. The apparatus of claim 13, wherein the first element determination module comprises:
a plurality of element determination modules configured to determine a plurality of elements in the knowledge base that match a plurality of word sequences in the natural language question;
a priority element determination module configured to determine, as the first element, an element having a highest priority among the plurality of elements if it is determined that the lengths of the plurality of word sequences are the same, and
a longest element determination module configured to determine an element matching a longest word sequence of the plurality of word sequences as the first element if it is determined that the lengths of the plurality of word sequences are different.
15. The apparatus of claim 9, wherein the input parameters comprise at least one of:
objects, attributes, attribute values, categories, relationships, and operations in the knowledge base.
16. The apparatus of claim 9, wherein the neural network model is trained based on a reference semantic representation obtained from a reference natural language problem and a reference operation associated with the knowledge base.
17. An electronic device, comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-8.
18. A non-transitory computer readable storage medium having stored thereon computer instructions for causing the computer to perform the method of any one of claims 1-8.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010531452.8A CN111709250B (en) | 2020-06-11 | 2020-06-11 | Method, apparatus, electronic device, and storage medium for information processing |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010531452.8A CN111709250B (en) | 2020-06-11 | 2020-06-11 | Method, apparatus, electronic device, and storage medium for information processing |
Publications (2)
Publication Number | Publication Date |
---|---|
CN111709250A true CN111709250A (en) | 2020-09-25 |
CN111709250B CN111709250B (en) | 2022-05-06 |
Family
ID=72539670
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010531452.8A Active CN111709250B (en) | 2020-06-11 | 2020-06-11 | Method, apparatus, electronic device, and storage medium for information processing |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111709250B (en) |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20090077113A1 (en) * | 2005-05-12 | 2009-03-19 | Kabire Fidaali | Device and method for semantic analysis of documents by construction of n-ary semantic trees |
CN101630314A (en) * | 2008-07-16 | 2010-01-20 | 中国科学院自动化研究所 | Semantic query expansion method based on domain knowledge |
CN105701253A (en) * | 2016-03-04 | 2016-06-22 | 南京大学 | Chinese natural language interrogative sentence semantization knowledge base automatic question-answering method |
CN106919655A (en) * | 2017-01-24 | 2017-07-04 | 网易(杭州)网络有限公司 | A kind of answer provides method and apparatus |
CN109977370A (en) * | 2019-03-19 | 2019-07-05 | 河海大学常州校区 | It is a kind of based on the question and answer of document collection partition to method for auto constructing |
CN110766055A (en) * | 2019-09-23 | 2020-02-07 | 西安交通大学 | Intelligent assembly process design method based on morpheme division and artificial neural network |
-
2020
- 2020-06-11 CN CN202010531452.8A patent/CN111709250B/en active Active
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20090077113A1 (en) * | 2005-05-12 | 2009-03-19 | Kabire Fidaali | Device and method for semantic analysis of documents by construction of n-ary semantic trees |
CN101630314A (en) * | 2008-07-16 | 2010-01-20 | 中国科学院自动化研究所 | Semantic query expansion method based on domain knowledge |
CN105701253A (en) * | 2016-03-04 | 2016-06-22 | 南京大学 | Chinese natural language interrogative sentence semantization knowledge base automatic question-answering method |
CN106919655A (en) * | 2017-01-24 | 2017-07-04 | 网易(杭州)网络有限公司 | A kind of answer provides method and apparatus |
CN109977370A (en) * | 2019-03-19 | 2019-07-05 | 河海大学常州校区 | It is a kind of based on the question and answer of document collection partition to method for auto constructing |
CN110766055A (en) * | 2019-09-23 | 2020-02-07 | 西安交通大学 | Intelligent assembly process design method based on morpheme division and artificial neural network |
Non-Patent Citations (1)
Title |
---|
施琦: "面向知识库的知识问答技术研究", 《中国优秀博硕士学位论文全文数据库(硕士) 信息科技辑》 * |
Also Published As
Publication number | Publication date |
---|---|
CN111709250B (en) | 2022-05-06 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109343857B (en) | Method, apparatus and storage medium for deploying machine learning model on line | |
US10545999B2 (en) | Building features and indexing for knowledge-based matching | |
US9875098B2 (en) | System and method for extracting a business rule embedded in an application source code | |
US20160162467A1 (en) | Methods and systems for language-agnostic machine learning in natural language processing using feature extraction | |
CN113051285B (en) | SQL sentence conversion method, system, equipment and storage medium | |
CN112860866B (en) | Semantic retrieval method, device, equipment and storage medium | |
US20240029086A1 (en) | Discovery of new business openings using web content analysis | |
CN111090417B (en) | Binary file analysis method, binary file analysis device, binary file analysis equipment and binary file analysis medium | |
CN111325022B (en) | Method and device for identifying hierarchical address | |
CN112580357A (en) | Semantic parsing of natural language queries | |
CN111159220A (en) | Method and apparatus for outputting structured query statement | |
CN113268560A (en) | Method and device for text matching | |
CN113641805A (en) | Acquisition method of structured question-answering model, question-answering method and corresponding device | |
CN116955561A (en) | Question answering method, question answering device, electronic equipment and storage medium | |
CN113609100B (en) | Data storage method, data query device and electronic equipment | |
CN110717025A (en) | Question answering method and device, electronic equipment and storage medium | |
CN113420542B (en) | Dialogue generation method, device, electronic equipment and storage medium | |
CN103473243A (en) | Method and device for generating semantic network service document | |
KR20220068462A (en) | Method and apparatus for generating knowledge graph | |
CN111709250B (en) | Method, apparatus, electronic device, and storage medium for information processing | |
US20170228439A1 (en) | Automatic natural language processing based data extraction | |
CN112883735B (en) | Method, device, equipment and storage medium for structured processing of form image | |
CN115146070A (en) | Key value generation method, knowledge graph generation method, device, equipment and medium | |
CN113255355A (en) | Entity identification method and device in text information, electronic equipment and storage medium | |
Falkenstine et al. | Natural Language Processing for Autonomous Identification of Impactful Changes to Specification Documents |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |