CN108563790B - Semantic understanding method and device, equipment and computer readable medium - Google Patents

Semantic understanding method and device, equipment and computer readable medium Download PDF

Info

Publication number
CN108563790B
CN108563790B CN201810401066.XA CN201810401066A CN108563790B CN 108563790 B CN108563790 B CN 108563790B CN 201810401066 A CN201810401066 A CN 201810401066A CN 108563790 B CN108563790 B CN 108563790B
Authority
CN
China
Prior art keywords
word
domain
intention
classification
clause
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.)
Active
Application number
CN201810401066.XA
Other languages
Chinese (zh)
Other versions
CN108563790A (en
Inventor
王兴宝
蒋亚冲
雷琴辉
黄倪莎
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
iFlytek Co Ltd
Original Assignee
iFlytek Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by iFlytek Co Ltd filed Critical iFlytek Co Ltd
Priority to CN201810401066.XA priority Critical patent/CN108563790B/en
Publication of CN108563790A publication Critical patent/CN108563790A/en
Application granted granted Critical
Publication of CN108563790B publication Critical patent/CN108563790B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/30Semantic analysis
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/279Recognition of textual entities
    • G06F40/289Phrasal analysis, e.g. finite state techniques or chunking

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Computational Linguistics (AREA)
  • General Health & Medical Sciences (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Machine Translation (AREA)

Abstract

The application provides a semantic understanding method, a semantic understanding device and equipment, wherein sentences to be understood are divided into first-class clauses according to preset domain classification, then the first-class clauses are divided into second-class clauses according to preset intention classification, and finally slot information is extracted from each second-class clause, wherein each first-class clause belongs to one of the domain classification, and each second-class clause belongs to one of the intention classification.

Description

Semantic understanding method and device, equipment and computer readable medium
Technical Field
The present application relates to the field of electronic information, and in particular, to a semantic understanding method, apparatus, device, and computer-readable medium.
Background
With the continuous breakthrough of artificial intelligence technology and the increasing popularization of various intelligent terminal devices, the frequency of human-computer interaction in daily work and life of people is higher and higher. Voice interaction has become an important means of human-computer interaction as one of the most convenient interaction modes. The man-machine interaction dialog system is applied to various intelligent terminal devices, such as: televisions, mobile phones, vehicles, smart homes, robots and the like. And how to understand the user's intention is the most critical technology in the human-computer interaction dialog system.
Because human languages have diversity, complexity and ambiguity, a sentence can often express multiple intentions, but current human-computer interaction dialog systems can only give one semantic understanding result, and for speech related to multiple intentions (multiple intentions can be understood as at least two events, such as "turn on air conditioner, turn off radio"), problems of no result or only one semantic understanding result occur, such as: "turn on the air conditioner first and then turn off the radio", there may be no output result, or output result: "turn on air conditioning", again for example: "navigate to Wanda Square and choose a non-blocked route" may output the result: "navigate an unobstructed route".
Therefore, the existing semantic understanding method is not accurate enough for understanding the multi-purpose sentences.
Disclosure of Invention
The application provides a semantic understanding method, a semantic understanding device, semantic understanding equipment and a computer readable medium, and aims to solve the problem that the understanding of multi-intention sentences is not accurate enough.
In order to achieve the above object, the present application provides the following technical solutions:
a method of semantic understanding, comprising:
dividing a sentence to be understood into first-class clauses according to preset domain classification, wherein each first-class clause belongs to one of the domain classifications;
dividing each first-type clause into second-type clauses according to preset intention classification, wherein each second-type clause belongs to one of the intention classifications;
slot information is extracted from each of the second type clauses.
Optionally, the dividing the sentence to be understood into the first type of clauses according to the preset domain classification includes:
taking each word in the sentence to be understood as an input, and obtaining a domain label of each word in the sentence to be understood by using a domain discrimination model, wherein the domain label of any word in the sentence to be understood comprises: the method comprises the following steps of obtaining the name of a domain classification to which a word belongs and first position information, wherein the first position information is the position information of the word in all words meeting a first condition, the first condition is that the word in the sentence to be understood belongs to the same domain classification as the word, and the position comprises a start, a middle and an end.
Optionally, the training process of the domain discriminant model includes:
respectively collecting a first preset number of sentences aiming at each of the preset domain classifications, and labeling the collected sentences with the domain labels;
collecting a second preset number of sentences which do not belong to any one of the preset domain classifications, and labeling labels which do not belong to the preset domain classifications;
and training a target function of the first sequencing annotation model by using the annotated sentences to obtain the domain discrimination model.
Optionally, the classifying according to the preset intention, the dividing each first-type clause into second-type clauses includes:
taking each word in the first clause with the same domain classification name as input, and obtaining an intention label of each word in the first clause by using an intention distinguishing module corresponding to the domain classification to which the first clause belongs, wherein the intention label of any word in the first clause comprises: the second position information is the position information of the word in all words meeting a second condition, the second condition is that the words in the first-class clause belong to the same field classification and the same intention classification as the word, and the positions comprise a start, a middle and an end, wherein each field classification corresponds to one intention distinguishing module, and the intention distinguishing modules corresponding to different field classifications are different.
Optionally, the method for training the intention judging module corresponding to any one of the domain classifications includes:
collecting a third preset number of sentences belonging to the field classification, and labeling the intention label on each collected sentence;
collecting a fourth preset number of sentences which do not belong to any one of preset intention classifications, and labeling labels which do not belong to the preset intention classifications;
and training a target function of the second sequencing labeling model by using the labeled sentences to obtain the intention judging module corresponding to the field classification.
Optionally, the extracting slot information from each of the second clauses includes:
taking each word in a second type clause and an intention vector of the second type clause as input, and obtaining a slot information label of each word in the second type clause by using a slot information distinguishing module corresponding to a domain classification to which the second type clause belongs, wherein the slot information label of any word in the second type clause comprises: the name of the slot information to which the word belongs and third position information, wherein the third position information is the position information of the word in all words meeting a third condition, and the third condition is that the words in the second type clause belong to the same field classification, the same intention classification and have the same slot information as the word;
each field classification corresponds to one groove information distinguishing module, and the groove information distinguishing modules corresponding to different field classifications are different.
Optionally, the training method of the slot information discrimination module corresponding to any one of the domain classifications includes:
collecting a fifth preset number of sentences belonging to the field classification, and labeling the collected sentences with slot information labels;
collecting sentences of which the sixth preset number does not belong to any one piece of preset slot information, and labeling labels not belonging to the preset slot information;
and training a target function of a third sequencing labeling model by using the labeled sentences to obtain the slot information discrimination module corresponding to the field classification.
Optionally, after the extracting slot information from each of the second type clauses, the method further includes:
taking the word segmentation result of the to-be-understood sentence, the slot information candidate path and the intention vector of the second type of clause in the to-be-understood sentence as input, and using a preset model to score the slot information candidate path, wherein the slot information candidate path is formed by at least one slot information combination extracted from each second type of clause;
and determining a slot information extraction result according to the score.
A semantic understanding apparatus, comprising:
the system comprises a first dividing module, a second dividing module and a third dividing module, wherein the first dividing module is used for dividing a sentence to be understood into first-class clauses according to preset domain classification, and each first-class clause belongs to one of the domain classification;
the second dividing module is used for dividing each first-type clause into second-type clauses according to preset intention classification, wherein each second-type clause belongs to one of the intention classifications;
and the extracting module is used for extracting the slot information from each second type clause.
Optionally, the first dividing module is configured to divide the sentence to be understood into the first type of clauses according to a preset domain classification, where the dividing includes:
the first dividing module is specifically configured to use each word in the sentence to be understood as an input, obtain a domain label of each word in the sentence to be understood using a domain discriminant model, where the domain label of any word in the sentence to be understood includes: the method comprises the following steps of obtaining the name of a domain classification to which a word belongs and first position information, wherein the first position information is the position information of the word in all words meeting a first condition, the first condition is that the word in the sentence to be understood belongs to the same domain classification as the word, and the position comprises a start, a middle and an end.
Optionally, the first partitioning module is further configured to train the domain discriminant model by using the following method:
respectively collecting a first preset number of sentences aiming at each of the preset domain classifications, and labeling the collected sentences with the domain labels;
collecting a second preset number of sentences which do not belong to any one of the preset domain classifications, and labeling labels which do not belong to the preset domain classifications;
and training a target function of the first sequencing annotation model by using the annotated sentences to obtain the domain discrimination model.
Optionally, the second dividing module is configured to divide each first-type clause into second-type clauses according to a preset intention, and the dividing includes:
the second dividing module is specifically configured to, using each word in the first-class clause with the same domain classification name as an input, obtain an intention tag of each word in the first-class clause by using an intention determining module corresponding to the domain classification to which the first-class clause belongs, where the intention tag of any word in the first-class clause includes: the second position information is the position information of the word in all words meeting a second condition, the second condition is that the words in the first-class clause belong to the same field classification and the same intention classification as the word, and the positions comprise a start, a middle and an end, wherein each field classification corresponds to one intention distinguishing module, and the intention distinguishing modules corresponding to different field classifications are different.
Optionally, the second dividing module is further configured to train the intention judging module corresponding to any one of the domain classifications according to the following method:
collecting a third preset number of sentences belonging to the field classification, and labeling the intention label on each collected sentence;
collecting a fourth preset number of sentences which do not belong to any one of preset intention classifications, and labeling labels which do not belong to the preset intention classifications;
and training a target function of the second sequencing labeling model by using the labeled sentences to obtain the intention judging module corresponding to the field classification.
Optionally, the extracting module is configured to extract slot information from each of the second type clauses, where the extracting module is configured to:
the extraction module is specifically configured to use each word in a second type of clause and an intention vector of the second type of clause as input, and use a slot information discrimination module corresponding to a domain classification to which the second type of clause belongs to obtain a slot information label of each word in the second type of clause, where the slot information label of any word in the second type of clause includes: the name of the slot information to which the word belongs and third position information, wherein the third position information is the position information of the word in all words meeting a third condition, and the third condition is that the words in the second type clause belong to the same field classification, the same intention classification and have the same slot information as the word;
each field classification corresponds to one groove information distinguishing module, and the groove information distinguishing modules corresponding to different field classifications are different.
Optionally, the extracting module is further configured to train the slot information distinguishing module corresponding to any one of the domain classifications according to the following method:
collecting a fifth preset number of sentences belonging to the field classification, and labeling the collected sentences with slot information labels;
collecting sentences of which the sixth preset number does not belong to any one piece of preset slot information, and labeling labels not belonging to the preset slot information;
and training a target function of a third sequencing labeling model by using the labeled sentences to obtain the slot information discrimination module corresponding to the field classification.
Optionally, the method further includes:
the screening module is used for taking the word segmentation result of the sentence to be understood, the slot information candidate path and the intention vector of the second type clause in the sentence to be understood as input after the extraction module extracts slot information from each second type clause, and scoring the slot information candidate path by using a preset model, wherein the slot information candidate path is formed by combining at least one slot information extracted from each second type clause; and determining a slot information extraction result according to the score.
A semantic understanding apparatus comprising:
a memory and a processor;
the memory is used for storing one or more programs;
the processor is configured to execute the one or more programs to cause the semantic understanding apparatus to implement the semantic understanding method described above.
A computer-readable storage medium having stored therein instructions which, when run on a computer, cause the computer to perform the semantic understanding method described above.
The semantic understanding method, the semantic understanding device and the semantic understanding equipment divide sentences to be understood into first-class clauses according to preset field classification, divide each first-class clause into second-class clauses according to preset intention classification, and finally extract slot information from each second-class clause, wherein each first-class clause belongs to one of the field classification, and each second-class clause belongs to one of the intention classification.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a flowchart of a semantic understanding method disclosed in an embodiment of the present application;
FIG. 2 is a flowchart of a specific implementation process of a semantic understanding method disclosed in an embodiment of the present application;
fig. 3 is a flowchart illustrating selecting a path from a plurality of slot information candidate paths in the semantic understanding method disclosed in the embodiment of the present application;
fig. 4 is a schematic structural diagram of a semantic understanding apparatus disclosed in an embodiment of the present application.
Detailed Description
The embodiment of the application discloses a semantic understanding method and a semantic understanding device, which can be applied to electronic equipment with a human-computer interaction function, such as televisions, mobile phones, vehicles, smart homes, robots and other equipment.
The following will clearly and completely describe the technical solutions in the embodiments of the present application by taking an intelligent vehicle-mounted system as an example with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
Fig. 1 is a semantic understanding method disclosed in an embodiment of the present application, including the following steps:
s101: the method comprises the steps of dividing a sentence to be understood into clauses according to preset domain classification, wherein each clause belongs to one domain classification. For convenience of subsequent description, the clauses divided in this step are referred to as first-type clauses.
The sentence to be understood may be a sentence recognized according to the collected voice of the user.
Table 1 shows an example of a vehicle-mounted system, and the preset domain classifications include: maps, telephone, radio, weather and command controls.
TABLE 1
Figure GDA0003011437100000081
By way of example, the statements to be understood are: "turn on air conditioner and play Anhui traffic broadcast", the first clauses divided are "turn on air conditioner" (belonging to the field of command control in Table 1) and "play Anhui traffic broadcast" (belonging to the field of radio in Table 1).
As another example, the statements to be understood are: "navigate to the fastest route of Wanda square selection", the clause of the first kind divided out is still the original sentence: "navigate to the Wanda Square to select the fastest route" (belongs to the map field in Table 1).
S102: and dividing each first-type clause into second-type clauses according to preset intention classification, wherein each second-type clause belongs to one intention classification.
Table 2 shows, for example, the intention classifications under each of the domain classifications shown in table 1, including, for example, under the command control domain classification: open, close, and return.
TABLE 2
Figure GDA0003011437100000091
In the above example, the statements to be understood are: the first type of clauses divided from 'turn on air conditioner to play Anhui traffic broadcast' are 'turn on air conditioner' and 'play Anhui traffic broadcast'. The second type of clause divided by the clause "turn on air conditioner" is still "turn on air conditioner" (belongs to the opening intention in the command control field in table 2), and the second type of clause divided by the clause "play Anhui traffic broadcast" is still "play Anhui traffic broadcast" (belongs to the playing intention in the radio field in table 2).
As another example, the statements to be understood are: "navigate to the fastest route of Wanda square selection", the first kind of clause that is divided is: "navigate to the universa plaza to select the fastest route", the second type of clauses divided are "navigate to the universa plaza" (belonging to the navigation intention under the map field in table 2) and "select the fastest route" (belonging to the route intention under the map field in table 2).
S103: slot information is extracted from each of the second type clauses.
Wherein the slot information can be understood as a key.
Table 3 is an example of slot information under the domain classification and the intention classification shown in table 2.
TABLE 3
Figure GDA0003011437100000101
For example, the slot information extracted by the second type clause "navigate to the Wanda Square" is "Wanda Square" (endLoc). It should be noted that the slot information extracted with each intent may be a part of the predefined slot information, but not all of the predefined slot information, for example, the slot information extracted with the "navigate to the universe" is "universe" (endLoc), but not all of startLoc \ endLoc \ landmark \ distance.
It should be noted that the table shown in this embodiment is only an example for an intelligent vehicle-mounted system, and in practice, different domain classifications, intention classifications and slot information may be formulated according to different product requirements.
As can be seen from the process shown in fig. 1, in the semantic understanding method according to this embodiment, the sentence to be understood is divided into the first-class clauses from the dimension of the domain classification, then each first-class clause is divided into the second-class clauses from the dimension of the intention classification, and finally the slot information of each second-class clause is extracted, so that different domain classifications and slot information under different intention classifications included in the sentence to be understood can be obtained, that is, the result of semantic understanding includes recognition results under different intentions in different domains, and therefore, for the sentence to be recognized with multiple intentions, multiple intentions can be completely understood, and the accuracy of understanding is improved.
In addition, the applicant finds that the existing semantic understanding method cannot understand a plurality of intentions because the algorithm for understanding the plurality of intentions is difficult to execute if the existing semantic understanding algorithm is adopted: although theoretically, the method can be extended from a method of understanding one intention to a method of understanding a plurality of intentions, in practice, an algorithm for understanding a plurality of intentions is difficult to be executed in consideration of the complexity of the algorithm, the support degree of hardware, and the like. The semantic understanding method shown in fig. 1 splits clauses step by step, and each clause split at the previous stage is used as an object split at the next stage, and this way of splitting step by step and understanding step by step has higher performability.
The steps in fig. 1 can be implemented by using a trained model, and how to train the model and implement the steps shown in fig. 1 by using the trained model will be described in detail below.
Fig. 2 is a specific implementation flow of the steps shown in fig. 1, which includes the following steps:
s201: and obtaining the domain label of each word in the sentence to be understood by using the domain discrimination model.
Namely, the sentence to be understood is used as the input of the domain discrimination model, and the domain discrimination model outputs the domain label of each word in the sentence to be understood.
The domain label of any word in the sentence to be understood includes: the method comprises the following steps of obtaining the name of a domain classification to which a word belongs and first position information, wherein the first position information is the position information of the word in all words meeting a first condition, and the first condition is the word belonging to the same domain classification as the word in a statement to be understood. Specifically, the position includes a start (e.g., the start information is denoted by b), a middle (e.g., the middle information is denoted by m), and an end (e.g., the end information is denoted by e). It should be noted that if a word does not belong to any of the preset domain classifications, a specific identifier capable of distinguishing the word from a preset domain label name is output, for example, the specific identifier is s. It should be noted that, the word with the domain classification mark s may not be used for subsequent intention and slot information identification, so as to save resources.
Table 4 shows an example of a domain label for each word output after the sentence to be understood is input to the domain discrimination model. In the present embodiment, the domain classification, the intention classification, and the slot information illustrated in table 3 are used as examples.
Table 4 example 1: turning on air conditioner to play Anhui traffic broadcast
Figure GDA0003011437100000121
Example 2: navigation to the Wanda Square to select the fastest route
Figure GDA0003011437100000122
Example 3: inquire about the price of No. 92 gasoline
Figure GDA0003011437100000123
Figure GDA0003011437100000131
Taking example 1 as an example, "hit" the corresponding domain label cmd _ b, cmd represents the name of the domain classification: and b represents that the position occupied by the command to the all the words belonging to the cmd field is taken as a starting position, namely the command to the first word belonging to the cmd field is taken.
In example 3, the domain classification of each word is not determined, and thus, the output is s.
Based on the first position information, it can be seen that after the domain label of each word is obtained, the first type clause is divided.
In this embodiment, each word may be input as a vector to the domain discriminant model, and the length of the vector may be 100.
In the tables of the above respective examples, POS represents a separator.
In this embodiment, the domain discriminant model is a neural network model (any other ranking labeling model) including, but not limited to, "word embedding + two-way long-and-short-term memory model lstm + conditional random field crf". The training method of the domain discrimination model comprises the following steps: for each of the preset domain classifications, a first preset number, e.g., 10 thousands of sentences, each labeled with a domain label, are collected. A second predetermined number, e.g., 20 ten thousand, of sentences not belonging to any of the predetermined domain classifications is collected and the domain label of each sentence is labeled as s. Training an objective function of the neural network model by using the collected corpus data with the labels:
Figure GDA0003011437100000132
wherein the content of the first and second substances,
Figure GDA0003011437100000133
is the probability value of the predicted domain label. The specific training algorithm can be found in the prior art, and is not described in detail here.
S202: and obtaining the intention label of each word by using an intention distinguishing module corresponding to the field classification to which the first type clause belongs. Wherein the domain classification to which the first-type clause belongs is represented by the domain label obtained in S201.
In this embodiment, each of the preset domain classifications corresponds to an intention determining module. And taking each word with the same domain classification name in the first clause as the input of the corresponding intention judging module, and outputting the intention label of each word by the intention judging module.
The intention label of any word in the first type clause includes: the name of the intention classification to which the word belongs and second position information, wherein the second position information is the position information of the word in all words meeting a second condition, and the second condition is that the word in the first-class clause belongs to the same field classification and the same intention classification as the word. Specifically, the position includes a start (e.g., the start information is denoted by b), a middle (e.g., the middle information is denoted by m), and an end (e.g., the end information is denoted by e). If a word does not belong to any of the preset intent classifications, a specific identifier, e.g., s, is output.
Table 5 shows an example of an intention label for each word output after the words belonging to the command control and map domain classification are input to the corresponding intention discriminating modules, respectively.
Table 5 example 1: turning on air conditioner to play Anhui traffic broadcast
Figure GDA0003011437100000141
Example 2: navigation to the Wanda Square to select the fastest route
Figure GDA0003011437100000142
In the intention label open _ b in example 1 in table 5, "open" indicates an opening intention in the field of command control, and "open" indicates a start position in a word belonging to the same intention category as that in the clause "open air conditioner" belonging to command control.
Based on the second position information, it can be seen that after the intention label of each word is obtained, a second type of clause is divided.
In this embodiment, each word can be input to the intention determining module as a vector, and the length of the vector can be 100.
In this embodiment, the intention judging module adopts, but is not limited to, an "embedding + bidirectional lstm + crf" neural network model (any other ranking labeling model may be used). Each domain classification corresponds to an intention discrimination module. The training method of the intention judging module corresponding to any one field classification comprises the following steps: a third preset number, e.g., 10 thousand sentences, belonging to the domain category, are collected, each labeled with an intent tag. A fourth predetermined number, e.g., 20 ten thousand, of sentences not belonging to any of the predetermined intent classifications is collected and the intent label of each sentence is labeled as s. Training an objective function of the neural network model by using the collected corpus data with the labels:
Figure GDA0003011437100000151
wherein the content of the first and second substances,
Figure GDA0003011437100000152
is the probability value of the predicted intent tag. The specific training algorithm can be found in the prior art, and is not described in detail here.
S203: for each word having a domain label and an intent label (i.e., words in clauses of the second type), a slot information label is determined.
The slot information tag of any word in the second type clause includes: the name of the slot information to which the word belongs (for example, as shown in table 3) and third position information, the third position information being position information of the word among all words satisfying a third condition, the third condition being a word belonging to the same domain classification, the same intention classification, and having the same slot information as the word in the second-type clause. Specifically, the position includes a start (e.g., the start information is denoted by b), a middle (e.g., the middle information is denoted by m), and an end (e.g., the end information is denoted by e).
Because different types of slot information have characteristics of themselves, therefore, in order to extract the slot information better, in this embodiment, different extraction methods are adopted:
1. and the grammar rule mode is suitable for extracting the slot information which is not enumerated but has strong regularity. Such as time, amount, etc., the extraction slot information is analyzed using the following abnf grammar, i.e., regular expression:
$digital=0|1|2|3|4|5|6|7|8|9;
$ date ═ digital <2,4> year $ digital <1-2> month $ digital <1-2> day;
$ money $ digital <0, - > [ hundred | ten | thousand | ten ] elements.
2. Dictionary style, which is suitable for the extraction of enumerable slot information. The city name is used as an example, and the dictionary is list (city) ═ beijing, shanghai, guangzhou, shenzhen, and hangzhou … }. And extracting the slot information by adopting a dictionary matching mode.
The specific implementation of the above two modes can be referred to in the prior art, and is not described herein again.
3. For non-enumeratable and not-regular slot information, in this embodiment, a slot information discrimination module is used to extract:
the input of the slot information judging module is each character in the clauses of the second type and the intention vector of the clauses of the second type. Examples of the intention vector of any one of the second clauses are as follows: the length of the intention vector is the total number of intention classifications under a field classification, the intention classifications under the field classification correspond to one element in the vector one by one, the element corresponding to the intention classification of the word is 1, and other elements are all 0.
Each word may be treated as a vector, which may be 100 in length.
Table 6 is an example of slot information of clauses under the map domain navigation intention:
TABLE 6
Figure GDA0003011437100000161
In this embodiment, the slot information determination module adopts, but is not limited to, an "embedding + bidirectional lstm + crf" neural network model (any other sorting labeling model may be used). Each domain classification corresponds to one slot information discrimination module. The training method of the slot information discrimination module corresponding to any one field classification comprises the following steps: a fifth predetermined number, e.g., 10 thousand sentences, belonging to the domain category, each labeled with a slot information label, are collected. A sixth preset number, for example, 20 ten thousand sentences not belonging to any one of the preset slot information are collected, and the slot information label of each sentence is labeled as s. Training an objective function of the neural network model by using the collected corpus data with the labels:
Figure GDA0003011437100000162
wherein the content of the first and second substances,
Figure GDA0003011437100000163
is the predicted probability value of the slot information label. The specific training algorithm can be found in the prior art, and is not described in detail here.
It should be noted that the above three slot information extraction manners may be used in parallel, that is, the above three manners are performed for each word, in practical applications, there may be some manners without output results, there may also be a plurality of manners with which results are output, that is, different slot information is extracted, or one manner with which a plurality of slot information are output, and the selection of the final result of the slot information will be described later.
Of course, a slot information determination module may also be trained for each intent classification, and the present disclosure is not limited herein. In the case where each intention classification corresponds to one slot information determination module, the intention vector of the clause of the second type may not be included in the input data of the slot information determination module.
Up to this point, the domain classification, the intention classification, and the slot information of each word in the sentence to be understood are respectively determined, and thus, understanding of the sentence to be understood is completed.
Based on the mode of gradually understanding the domain classification, the intention classification and the slot information, the corresponding model is respectively trained for each step, so the model training has high performability. And for different domain classifications, different intention judging modules and slot information judging modules are used, so that the accuracy of the understanding result of multiple intentions is higher.
It should be noted that the manner of determining by using the model shown in fig. 2 is only an example of one specific implementation manner of fig. 1, and other manners, such as determining according to a preset corresponding relationship, may be used besides using the model, and are not described herein again.
As described above, there may be multiple sets of slot information extracted finally, or one set of slot information may include multiple sets of slot information, and multiple sets of slot information may constitute different slot information paths, for example, slot information path 1(path1) ═ slot _ a, slot _ b, slot _ c >, path2 ═ slot _ a, slot _ d >. That is, the slot information a, b, and c constitute one type of slot information candidate path, and the slot information a and d constitute another type of slot information candidate path. In this embodiment, the slot information candidate path is formed by combining at least one slot information extracted from the second clause, and in order to improve the selection efficiency, optionally, different slot information candidate paths at least have one piece of different slot information.
Therefore, the method described in the present application may further select a path from the plurality of slot information candidate paths. The specific process is shown in fig. 3, and comprises the following steps:
s301: and performing word segmentation processing on the sentence to be understood to obtain a word segmentation result.
S302: and determining the score of each slot information candidate path by using a sorting model and taking the word segmentation result, the slot information candidate path and the intention vector of the second-class clause as input.
The word segmentation result may be a vector formed by each word in the word segmentation result, and the length of the vector may be m × 100, where m is the number of the words.
The slot information candidate path may be a vector formed by each slot information candidate path and each participle, the length of the vector may be n × 100, and n is the number of participles of the candidate path.
The intention vectors of the clauses of the second type are as described above and will not be described further here.
It should be noted that, the above three vectors are not necessarily all used as inputs, and at least one of the vectors may be selected as an input of the ranking model, but the more vectors are used as inputs, the more accurate the output result is.
In this embodiment, the ranking model is, but not limited to, a CNN model (any other ranking model). The same ranking module may be used for different domain classifications. The training mode of the sequencing model is as follows: and multiplexing the training sentences of the domain discrimination model, marking a correct path pathT for each sentence, forging an error path pathF through a program, and finally forming a pair < pathT, pathF > by the correct path and the error path. Using the collected corpus data with the labels, training an objective function of the CNN model:
Figure GDA0003011437100000181
S(θ)>thre
wherein, PT (theta)iIndicating the correct path score, PF (θ)iIndicating a false path score, the final score S (θ) is greater than the threshold thre.
S303: and determining a final slot information path according to the score of each slot information candidate path.
In general, the highest-scoring slot information path is taken as the final slot information path.
For example, the slot information candidate path extracted by the clause "navigate to 3 km of ten temple streets" includes:
path1 $ endLoc to navigate to $ distance
Path2 $ distance temple street navigating to $ distance
The scores obtained after performing the process shown in fig. 3 are respectively: path1, 0.95. path2, 0.2. Therefore, the path1 is defined as the final slot information path, and the slot information in this path is the finally determined slot information.
Fig. 4 is a semantic understanding apparatus disclosed in an embodiment of the present application, including: the device comprises a first dividing module, a second dividing module and an extracting module, and optionally, the device also comprises a screening module.
The first division module is used for dividing the sentences to be understood into first-class clauses according to preset domain classification. The second division module is used for dividing each first-type clause into second-type clauses according to preset intention classification. And the extraction module is used for extracting the slot information from each second type clause. And the screening module is used for scoring the slot information candidate paths after the extracting module extracts the slot information from each second type clause, and determining a slot information extracting result according to the score.
For specific implementation processes of the functions of the modules, reference may be made to the above method part, which is not described herein again.
The semantic understanding apparatus shown in fig. 3 can obtain the slot information in the multi-domain and multi-intent in a manner of dividing the clauses in stages by using different division dimensions (i.e., the domain, the intent, and the slot information), and therefore, it is possible to obtain a highly accurate multi-intent understanding result for the multi-intent sentence.
The embodiment of the application also discloses semantic understanding equipment and a computer readable medium.
Specifically, the semantic understanding apparatus includes a memory and a processor. The memory is used to store one or more programs. The processor is used for executing the one or more programs to enable the semantic understanding device to realize the semantic understanding function of the following functional previous embodiment.
The computer-readable storage medium has stored therein instructions that, when executed on a computer, cause the computer to perform the semantic understanding function described in the foregoing embodiments.
The functions described in the method of the embodiment of the present application, if implemented in the form of software functional units and sold or used as independent products, may be stored in a storage medium readable by a computing device. Based on such understanding, part of the contribution to the prior art of the embodiments of the present application or part of the technical solution may be embodied in the form of a software product stored in a storage medium and including several instructions for causing a computing device (which may be a personal computer, a server, a mobile computing device or a network device) to execute all or part of the steps of the method described in the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
The embodiments are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same or similar parts among the embodiments are referred to each other.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the application. Thus, the present application is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (11)

1. A method of semantic understanding, comprising:
determining a domain label of each word in a sentence to be understood according to a preset domain classification, and dividing the sentence to be understood into first-class clauses according to the domain label of each word, wherein each first-class clause belongs to one of the domain classifications; the domain label of any word in the sentence to be understood comprises: the name of the domain classification to which the word belongs and first position information;
determining an intention label of each word in the first type clauses according to preset intention classification, and dividing each first type clause into second type clauses according to the intention label of each word, wherein each second type clause belongs to one of the intention classifications; the intention label of any word in the first type clause includes: the name of the intention classification to which the word belongs and second position information;
extracting a slot information label of each character from each second type clause; the slot information tag of any word in the second type clause comprises: the name of the slot information to which the word belongs, and the third position information.
2. The method of claim 1, wherein the determining a domain label of each word in the sentence to be understood according to the preset domain classification, and the dividing the sentence to be understood into the first type of clauses according to the domain label of each word comprises:
taking each word in the sentence to be understood as input, and obtaining a domain label of each word in the sentence to be understood by using a domain discrimination model, wherein the first position information is the position information of the word in all words meeting a first condition, the first condition is a word belonging to the same domain classification as the word in the sentence to be understood, and the position comprises a start, a middle and an end;
and dividing the sentence to be understood into a first type of clause based on the name of the domain classification to which each word belongs and the first position information.
3. The method of claim 2, wherein the training process of the domain discriminant model comprises:
respectively collecting a first preset number of sentences aiming at each of the preset domain classifications, and labeling the collected sentences with the domain labels;
collecting a second preset number of sentences which do not belong to any one of the preset domain classifications, and labeling labels which do not belong to the preset domain classifications;
and training a target function of the first sequencing annotation model by using the annotated sentences to obtain the domain discrimination model.
4. The method of claim 1, wherein the determining the intention label of each word in the first clauses according to the predetermined intention classification, and the dividing each first clause into second clauses according to the intention label of each word comprises:
taking each word in the first-class clauses with the same domain classification name as input, and obtaining an intention label of each word in the first-class clauses by using an intention judging module corresponding to the domain classification to which the first-class clauses belong, wherein the second position information is position information of the word in all words meeting a second condition, the second condition is that the word in the first-class clauses belongs to the same domain classification and the same intention classification, and the positions comprise a start, a middle and an end, wherein each domain classification corresponds to one intention judging module, and the intention judging modules corresponding to different domain classifications are different;
and dividing each first-type clause into second-type clauses based on the name of the intention classification to which each word belongs and second position information.
5. The method according to claim 4, wherein the training method of the intention judging module corresponding to any one of the domain classifications comprises:
collecting a third preset number of sentences belonging to the field classification, and labeling the intention label on each collected sentence;
collecting a fourth preset number of sentences which do not belong to any one of preset intention classifications, and labeling labels which do not belong to the preset intention classifications;
and training a target function of the second sequencing labeling model by using the labeled sentences to obtain the intention judging module corresponding to the field classification.
6. The method of claim 1, wherein said extracting slot information tags for respective words from each of said second type clauses comprises:
taking each word in the second type clause and an intention vector of the second type clause as input, and obtaining a slot information label of each word in the second type clause by using a slot information distinguishing module corresponding to the field classification to which the second type clause belongs, wherein the third position information is position information of the word in all words meeting a third condition, and the third condition is that the word in the second type clause belongs to the same field classification, the same intention classification and the same slot information as the word;
each field classification corresponds to one groove information distinguishing module, and the groove information distinguishing modules corresponding to different field classifications are different.
7. The method according to claim 6, wherein the training method of the slot information discrimination module corresponding to any one of the domain classifications comprises:
collecting a fifth preset number of sentences belonging to the field classification, and labeling the collected sentences with slot information labels;
collecting sentences of which the sixth preset number does not belong to any one piece of preset slot information, and labeling labels not belonging to the preset slot information;
and training a target function of a third sequencing labeling model by using the labeled sentences to obtain the slot information discrimination module corresponding to the field classification.
8. The method of any of claims 1-7, further comprising, after said extracting the slot information tag of the respective word from each of said second-type clauses:
taking the word segmentation result of the to-be-understood sentence, a slot information candidate path and an intention vector of the second type of clause in the to-be-understood sentence as input, and using a preset model to score the slot information candidate path, wherein the slot information candidate path is formed by at least one slot information combination extracted from each second type of clause;
and determining a slot information extraction result according to the score.
9. A semantic understanding apparatus, comprising:
the first division module is used for determining a domain label of each word in the sentence to be understood according to a preset domain classification, and dividing the sentence to be understood into first-class clauses according to the domain label of each word, wherein each first-class clause belongs to one of the domain classifications; the domain label of any word in the sentence to be understood comprises: the name of the domain classification to which the word belongs and first position information;
the second dividing module is used for determining the intention label of each word in the first type clauses according to preset intention classification, and dividing each first type clause into second type clauses according to the intention label of each word, wherein each second type clause belongs to one of the intention classifications; the intention label of any word in the first type clause includes: the name of the intention classification to which the word belongs and second position information;
the extraction module is used for extracting the slot information label of each character from each second type clause; the slot information tag of any word in the second type clause comprises: the name of the slot information to which the word belongs, and the third position information.
10. A semantic understanding apparatus, characterized by comprising:
a memory and a processor;
the memory is used for storing one or more programs;
the processor is configured to execute the one or more programs to cause the semantic understanding apparatus to implement the semantic understanding method of any one of claims 1-8.
11. A computer-readable storage medium having stored therein instructions which, when run on a computer, cause the computer to perform the semantic understanding method of any one of claims 1-8.
CN201810401066.XA 2018-04-28 2018-04-28 Semantic understanding method and device, equipment and computer readable medium Active CN108563790B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810401066.XA CN108563790B (en) 2018-04-28 2018-04-28 Semantic understanding method and device, equipment and computer readable medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810401066.XA CN108563790B (en) 2018-04-28 2018-04-28 Semantic understanding method and device, equipment and computer readable medium

Publications (2)

Publication Number Publication Date
CN108563790A CN108563790A (en) 2018-09-21
CN108563790B true CN108563790B (en) 2021-10-08

Family

ID=63537574

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810401066.XA Active CN108563790B (en) 2018-04-28 2018-04-28 Semantic understanding method and device, equipment and computer readable medium

Country Status (1)

Country Link
CN (1) CN108563790B (en)

Families Citing this family (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111078844B (en) * 2018-10-18 2023-03-14 上海交通大学 Task-based dialog system and method for software crowdsourcing
CN111292751B (en) * 2018-11-21 2023-02-28 北京嘀嘀无限科技发展有限公司 Semantic analysis method and device, voice interaction method and device, and electronic equipment
CN109783801B (en) * 2018-12-14 2023-08-25 厦门快商通信息技术有限公司 Electronic device, multi-label classification method and storage medium
CN111339760A (en) * 2018-12-18 2020-06-26 北京京东尚科信息技术有限公司 Method and device for training lexical analysis model, electronic equipment and storage medium
CN109753565A (en) * 2018-12-27 2019-05-14 厦门智融合科技有限公司 Intellectual Property intelligent service method and system
CN111462738B (en) * 2019-01-18 2024-05-03 阿里巴巴集团控股有限公司 Speech recognition method and device
CN109783819B (en) * 2019-01-18 2023-10-20 广东小天才科技有限公司 Regular expression generation method and system
CN111611793B (en) * 2019-02-22 2023-06-13 北京猎户星空科技有限公司 Data processing method, device, equipment and storage medium
CN110008325B (en) * 2019-03-29 2020-02-07 海南中智信信息技术有限公司 Spoken language understanding and rewriting method based on commercial conversation system
CN110111766A (en) * 2019-04-22 2019-08-09 南京硅基智能科技有限公司 A kind of multi-field Task conversational system and terminal
CN110837547A (en) * 2019-10-16 2020-02-25 云知声智能科技股份有限公司 Method and device for understanding multi-intention text in man-machine interaction
CN110866090A (en) 2019-11-14 2020-03-06 百度在线网络技术(北京)有限公司 Method, apparatus, electronic device and computer storage medium for voice interaction
CN111625634B (en) * 2020-05-25 2023-08-22 泰康保险集团股份有限公司 Word slot recognition method and device, computer readable storage medium and electronic equipment
CN111639160A (en) * 2020-05-29 2020-09-08 达闼机器人有限公司 Domain identification method, interaction method, electronic device and storage medium
CN112597310A (en) * 2020-12-25 2021-04-02 深圳市声希科技有限公司 Domain and intention hierarchical joint classification method, device, equipment and storage medium
CN115440200B (en) * 2021-06-02 2024-03-12 上海擎感智能科技有限公司 Control method and control system of vehicle-mounted system
CN113779964A (en) * 2021-09-02 2021-12-10 中联国智科技管理(北京)有限公司 Statement segmentation method and device

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR102106797B1 (en) * 2013-10-11 2020-05-06 에스케이텔레콤 주식회사 Apparatus for analyzing complex sentence, and recording medium therefor
WO2016120904A1 (en) * 2015-01-28 2016-08-04 三菱電機株式会社 Intent deduction device and intent deduction method
US9792281B2 (en) * 2015-06-15 2017-10-17 Microsoft Technology Licensing, Llc Contextual language generation by leveraging language understanding
US11250218B2 (en) * 2015-12-11 2022-02-15 Microsoft Technology Licensing, Llc Personalizing natural language understanding systems
US20170249309A1 (en) * 2016-02-29 2017-08-31 Microsoft Technology Licensing, Llc Interpreting and Resolving Conditional Natural Language Queries
CN107665188B (en) * 2016-07-27 2021-01-29 科大讯飞股份有限公司 Semantic understanding method and device
CN107315737B (en) * 2017-07-04 2021-03-23 北京奇艺世纪科技有限公司 Semantic logic processing method and system
CN107885874B (en) * 2017-11-28 2020-09-29 上海智臻智能网络科技股份有限公司 Data query method and device, computer equipment and computer readable storage medium

Also Published As

Publication number Publication date
CN108563790A (en) 2018-09-21

Similar Documents

Publication Publication Date Title
CN108563790B (en) Semantic understanding method and device, equipment and computer readable medium
CN109918673B (en) Semantic arbitration method and device, electronic equipment and computer-readable storage medium
CN107436864B (en) Chinese question-answer semantic similarity calculation method based on Word2Vec
CN107291783B (en) Semantic matching method and intelligent equipment
CN106649818B (en) Application search intention identification method and device, application search method and server
CN102262634B (en) Automatic questioning and answering method and system
CN107590172B (en) Core content mining method and device for large-scale voice data
CN108763510A (en) Intension recognizing method, device, equipment and storage medium
CN108304373B (en) Semantic dictionary construction method and device, storage medium and electronic device
CN109871543B (en) Intention acquisition method and system
US20140032207A1 (en) Information Classification Based on Product Recognition
CN112101027A (en) Chinese named entity recognition method based on reading understanding
CN113033438B (en) Data feature learning method for modal imperfect alignment
CN112256845A (en) Intention recognition method, device, electronic equipment and computer readable storage medium
CN112836487B (en) Automatic comment method and device, computer equipment and storage medium
CN102929861A (en) Method and system for calculating text emotion index
CN112463944B (en) Search type intelligent question-answering method and device based on multi-model fusion
CN110956044A (en) Attention mechanism-based case input recognition and classification method for judicial scenes
CN108304411B (en) Semantic recognition method and device for geographical position statement
CN110717041A (en) Case retrieval method and system
CN103853746A (en) Word bank generation method and system, input method and input system
CN112434164A (en) Network public opinion analysis method and system considering topic discovery and emotion analysis
CN114860942B (en) Text intention classification method, device, equipment and storage medium
CN113282754A (en) Public opinion detection method, device, equipment and storage medium for news events
Tüselmann et al. Are end-to-end systems really necessary for NER on handwritten document images?

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