A semantic parsing method and related devices
By dividing user command text into node text and constructing a semantic representation graph, the problems of data redundancy and memory consumption in intelligent dialogue systems are solved, the accuracy and robustness of semantic understanding are improved, and the system cost is reduced.
Patent Information
- Application Number
- CN202110333989.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-03-29
- Publication Date
- 2025-12-16
- Estimated Expiration
- 2041-03-29
AI Technical Summary
In the existing technology, existing intelligent dialogue systems suffer from data redundancy and memory consumption issues when processing voice understanding of trigger-based commands, leading to increased system construction and operation costs. In particular, when dealing with complex logical relationships, it is difficult to effectively represent and parse the semantic relationships between triggering conditions and actions.
By dividing user command text into node text, extracting semantic information from each node, and constructing a semantic representation graph, the algorithm utilizes the edge direction constraints of the semantic representation graph to trigger conditions and action relationships, thereby reducing reliance on statement templates, lowering system memory usage, and improving the accuracy of semantic parsing.
It reduces system data redundancy and memory usage, lowers the cost of intelligent dialogue systems, and improves the accuracy and robustness of semantic understanding, effectively handling complex triggering conditions and action logic relationships.
Smart Images

Figure CN115146645B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] Embodiments of the present application relate to the field of artificial intelligence, and in particular to a semantic parsing method and related equipment. BACKGROUND
[0002] An intelligent dialogue system based on artificial intelligence technology can understand natural language, that is, understand the semantics expressed by a user instruction and complete the task indicated in the semantics of the user instruction. A user instruction is divided into a conditional instruction and a trigger instruction. The semantics expressed by the conditional instruction is to immediately execute a task, and the semantics expressed by the trigger instruction is to execute a task when a trigger condition is met in the future.
[0003] A semantic parsing method for a trigger instruction is to abstract a type of trigger instruction text similar in execution task to an intent, which represents that a certain type of task is executed when a certain type of trigger condition is met. Then, the semantics of the trigger instruction text is parsed based on a sentence template configured in advance for the intent.
[0004] However, the parameters of the intent include a trigger condition and an action. When either the trigger condition or the action needs to be changed or expanded, or when a more complex logical relationship needs to be supported in parsing, a large number of sentence templates need to be added to the original intent or a large number of new intents need to be configured, which greatly increases the memory occupation of the system and the construction and operation cost of the intelligent dialogue system. SUMMARY
[0005] Embodiments of the present application provide a semantic parsing method and related equipment, which can reduce data redundancy and memory occupation in the semantic parsing process of a trigger instruction and improve the accuracy of natural language understanding.
[0006] A first aspect of embodiments of the present application provides a semantic parsing method:
[0007] An intelligent dialogue system receives a voice instruction sent by a user and converts the voice instruction of the user into a user instruction text in a text form. The intelligent dialogue system will intelligently remove noise when converting the voice into the text, and the user instruction text obtained is a text with real meaning.
[0008] The intelligent dialogue system divides the user instruction text according to words, and obtains a word sequence containing M words. The arrangement order of the M words in the word sequence is the same as the arrangement order of the M words in the user instruction text.
[0009] The intelligent dialogue system obtains at least one node text in the word sequence according to the word sequence obtained by dividing the user instruction text. Each node text in the at least one node text is a part of the user instruction text and does not overlap with each other, and represents a trigger condition or an action.
[0010] The intelligent dialogue system determines each node text in the at least one node text, and obtains semantic information corresponding to each node text in the user instruction text. The intelligent dialogue system determines a target semantic of the whole sentence of the user instruction text according to the semantic information of each node text in the user instruction text.
[0011] It can be understood that when one of the trigger condition node text or the action node text in the user instruction text changes, the target semantic of the user instruction text can be obtained through recombination of the original trigger condition node semantic and the action node semantic, without the need to reconfigure the sentence template corresponding to the user instruction text, thereby greatly reducing the memory occupation of the system, reducing the redundancy of data, and reducing the cost of the intelligent dialogue system. In addition, the node semantic of the node text can form a reference and constraint on the semantic of the node text in the user instruction text, thereby enhancing the accuracy of semantic analysis of the user instruction text, improving the robustness of semantic analysis, and improving the semantic understanding ability of the intelligent dialogue system.
[0012] Based on the first aspect, the embodiments of the present application provide a first implementation of the first aspect:
[0013] The at least one node text can include a first node text and a second node text that are associated with each other, where the first node text is a text representing a trigger condition, and the second node text is a text representing an action. The intelligent dialogue system obtains first semantic information of the first node text and second semantic information of the second node text, and determines a target semantic of the user instruction text according to the first semantic information and the second semantic information.
[0014] Based on the first aspect or the first implementation of the first aspect, the embodiments of the present application provide a second implementation of the first aspect:
[0015] The target semantic of the user instruction text can have various forms of representation. The target semantic can be represented in the form of a word sequence plus a special symbol, or can be represented in the form of a semantic representation graph. When the target semantic is in the form of a semantic representation graph, the intelligent dialogue system obtains an edge in the semantic representation graph, where the edge is from the first semantic information representing the trigger condition to the second semantic information representing the action, and cannot be from the second semantic information representing the action to the first semantic information representing the trigger condition. The edge from the trigger condition to the action represents a "trigger" constraint, that is, the system should execute the action when the trigger condition is met.
[0016] The intelligent dialogue system obtains target semantics of the user instruction text in the form of a semantic representation graph according to the first semantic information of the first node text, the second semantic information of the second node text, and the edge from the first semantic information to the second semantic information.
[0017] It can be understood that the direction of the edge in the semantic representation graph can only be from the trigger condition to the action, and cannot be from the action to the trigger condition, thereby saving the judgment of the semantic relationship between texts in the semantic analysis process and improving the accuracy of semantic analysis.
[0018] Based on any one of the first aspect to the second implementation manner of the first aspect, the third implementation manner of the first aspect is provided.
[0019] The at least one node text can include a first node text, a second node text, and a third node text that are associated with each other, wherein the first node text and the third node text are texts representing trigger conditions, and the second node text is a text representing an action. The intelligent dialogue system obtains first semantic information of the first node text, second semantic information of the second node text, and third semantic information of the third node text, and determines target semantics of the user instruction text according to the first semantic information, the second semantic information, and the third semantic information.
[0020] Based on any one of the first aspect to the third implementation manner of the first aspect, the fourth implementation manner of the first aspect is provided.
[0021] The intelligent dialogue system obtains an edge from the first semantic information to the second semantic information in the semantic representation graph on the basis of obtaining the first semantic information of the first node text, the second semantic information of the second node text, and the third semantic information of the third node text. The direction of the edge can only be from the first semantic information representing a trigger condition to the second semantic information representing an action, and cannot be from the second semantic information representing an action to the first semantic information representing a trigger condition. Then, an edge between the first semantic information and the third semantic information is obtained, and the edge between the trigger conditions represents a logical AND relationship.
[0022] The intelligent dialogue system obtains target semantics of the user instruction text in the form of a semantic representation graph according to the first semantic information of the first node text, the second semantic information of the second node text, the third semantic information of the third node text, the edge from the first semantic information to the second semantic information, and the edge between the first semantic information and the third semantic information.
[0023] It can be understood that the edge between multiple trigger conditions in the semantic representation graph can hierarchically express the logical relationship between multiple complex trigger conditions, represent semantic relationships such as combination, comparison, and logical operation in the trigger conditions, more finely represent the semantics of the trigger-type task instruction, and strengthen the semantic analysis capability.
[0024] According to any one of the first aspect to the fourth implementation of the first aspect, the embodiments of the present application provide a fifth implementation of the first aspect:
[0025] The specific implementation can be realized by writing a program with a response function, or by a trained neural network model. In the syntactic analysis model, a transition-based syntactic analysis model can be used. The user instruction text is input, and at least one node text output can be obtained.
[0026] According to any one of the first aspect to the fifth implementation of the first aspect, the embodiments of the present application provide a sixth implementation of the first aspect:
[0027] The specific implementation can be realized by writing a program with a response function, or by a trained neural network model. In the syntactic analysis model, a transition-based syntactic analysis model can be used. The user instruction text is input, and at least one node text output can be obtained.
[0028] According to any one of the first aspect to the sixth implementation of the first aspect, the embodiments of the present application provide a seventh implementation of the first aspect:
[0029] According to any one of the first aspect to the sixth implementation of the first aspect, the embodiments of the present application provide a seventh implementation of the first aspect:
[0030] The second aspect of the embodiments of the present application provides an intelligent dialogue system, which has the functions of the intelligent dialogue system in the first aspect described above. The functions can be realized by hardware, or by hardware executing corresponding software. The hardware or software includes one or more modules corresponding to the above functions.
[0031] The processor, the memory, the input and output device are connected with the bus;
[0032] The processor is used to execute the method described in any one of the first aspect.
[0033] The fourth aspect of the embodiments of the present application provides a computer storage medium, and the computer readable storage medium stores a program. When the computer executes the program, the method in any one of the first aspect is executed.
[0034] The fifth aspect of the embodiments of the present application provides a computer program product. When the computer program product is executed on a computer, the computer executes the method in any one of the first aspect.
[0035] The sixth aspect of the embodiments of the present application provides an intelligent terminal device. The intelligent terminal device includes the intelligent dialogue system in any one of the second aspect or the third aspect.
[0036] From the above technical solutions, the embodiments of the present application have the following advantages: obtaining a user instruction text, determining at least one node text from the user instruction text, each node text in the at least one node text being a text representing an action or a trigger condition in the user instruction text, determining semantic information of each node text in the at least one node text, and determining a target semantic of the user instruction text according to the semantic information of each node text. When one of the trigger condition node text or the action node text in the user instruction text changes, the target semantic of the user instruction text can be determined by recombining the original trigger condition node semantic and the action node semantic, without the need to reconfigure the semantic template corresponding to the user instruction text, thereby greatly reducing the memory occupation of the system, reducing the redundancy of data, reducing the cost of the intelligent dialogue system, and improving the semantic understanding ability of the intelligent dialogue system. BRIEF DESCRIPTION OF DRAWINGS
[0037] Figure 1 A structural schematic diagram of an artificial intelligence main body framework;
[0038] Figure 2 A structural schematic diagram of an intelligent dialogue system in the embodiments of the present application;
[0039] Figure 3 An implementation form of a product of the embodiments of the present application;
[0040] Figure 4 Another implementation form of a product of the embodiments of the present application;
[0041] Figure 5 A flowchart of a semantic analysis method in the embodiments of the present application;
[0042] Figure 6 A structural schematic diagram of a semantic representation graph in the embodiments of the present application;
[0043] Figure 7 A structural schematic diagram of a neural network model of a syntax analysis model in the embodiments of the present application;
[0044] Figure 8 An architecture schematic diagram of a stack encoder in an embodiment of the present application;
[0045] Figure 9 An architecture schematic diagram of a neural network model of a semantic representation decoding model in an embodiment of the present application;
[0046] Figure 10 A training architecture schematic diagram of a joint model in an embodiment of the present application;
[0047] Figure 11 A system architecture of model training in an embodiment of the present application;
[0048] Figure 12 A structure schematic diagram of an execution device in an embodiment of the present application;
[0049] Figure 13 Another structure schematic diagram of an execution device in an embodiment of the present application. DETAILED DESCRIPTION
[0050] The embodiment of the present application provides a semantic parsing method, which is applied to the field of artificial intelligence and the subfield of semantic parsing, and is used for reducing data redundancy and memory occupation in a trigger type instruction semantic parsing process and improving the accuracy of natural language understanding.
[0051] In people's life and work, more and more affairs need to be completed by people and machines cooperating, which requires good interaction between people and machines to complete the task. The traditional human-machine interaction (HMI) mode includes interaction with a personal computer (PC) through a keyboard and a mouse and interaction with a smart phone through a touch screen.
[0052] The development of artificial intelligence (AI) technology has profoundly changed the way people interact with machines, from interaction with a PC through a keyboard and a mouse and interaction with a smart phone through a touch screen to voice interaction represented by an intelligent dialogue system.
[0053] The voice dialogue system, as a new interactive way, connects users and services and is regarded as an entrance of mobile internet services. At present, various internet companies at home and abroad actively layout the voice dialogue system, and representative products thereof include various voice assistants such as Siri of Apple, Alexa of Amazon, Google Assistant of Google, Cortana of Microsoft, Xiaoice and the like, and smart terminal devices carrying the voice assistants such as a mobile phone, a tablet, a sound box, a wearable device, a television and a vehicle-mounted device.
[0054] A voice dialogue system first converts the voice received by a microphone into text through an automatic speech recognition (ASR) module, and then analyzes the semantics of the text of the user instruction converted into text through a natural language understanding (NLU) module, that is, what operation the user wants the machine to perform and the parameters associated with the operation. The semantic understanding capability of the NLU includes two parts: (1) representing natural language text in a form understandable by a machine, that is, designing a semantic representation; and (2) converting natural language text into the form of the semantic representation, that is, designing a parsing algorithm matching the semantic representation.
[0055] The current mainstream way in the industry is to use a DIS framework (Domain, Intent, Slot) semantic representation and a DIS framework-based parsing algorithm to perform semantic understanding on the text of a user instruction. Among them, the domain is generally divided based on business scenarios, such as music, audio, encyclopedia, smart home, etc.; the intent is abstracted from the core predicate of a sentence, such as playing, pausing playing, increasing volume, etc., representing the action that the user wants the machine to perform; and the slot is abstracted from the argument of the predicate, such as the name of the song to be played, the numerical value of the volume to be increased, etc., representing the parameters required to perform the operation. Taking “turn on the light in the living room” as an example, the domain is “home control”, the intent is “turn on the device”, and the slot is {room: living room, device: light}.
[0056] In the actual application of an intelligent dialogue system, the voice instructions given by a user to the machine can be divided into two categories, one is to immediately perform a task (unconditional instruction), and the other is to perform a task at a future time or when a certain trigger condition is met (trigger-type task instruction). For simple conditional instructions (such as time conditions), the DIS semantic representation can cover them by adding corresponding slots and intents, such as adding slots “start time” and “end time”, and adding intents “play music / control device at a certain time”. However, as the trigger conditions become more diverse, a large number of slots need to be added under the DIS framework to represent different types of trigger conditions, and a large number of intents and their sentence templates also need to be added, which is too costly and causes a lot of redundancy. Further, for the comparison, combination, and logical operation semantics implied in the trigger conditions, the flat slot structure of the DIS cannot represent them. Therefore, it is urgently needed to construct a semantic representation and a parsing algorithm corresponding to the semantic representation for trigger-type task instructions, for representing and parsing the trigger conditions, execution actions, and rich semantic relationships implied therein in the instructions, and for improving the natural language understanding capability of the dialogue system.
[0057] Figure 1An artificial intelligence subject framework is shown, which describes the overall workflow of an artificial intelligence system and is applicable to general artificial intelligence field requirements.
[0058] The above artificial intelligence subject framework is described below from two dimensions of "intelligent information chain" (horizontal axis) and "IT value chain" (vertical axis).
[0059] The "intelligent information chain" reflects a series of processes from data acquisition to processing. For example, it can be a general process of intelligent information perception, intelligent information representation and formation, intelligent reasoning, intelligent decision-making, intelligent execution and output. In this process, data undergoes a condensation process of "data-information-knowledge-wisdom".
[0060] The "IT value chain" is the industrial ecological process from the underlying infrastructure of artificial intelligence, information (provision and processing technology implementation) to the system, reflecting the value brought by artificial intelligence to the information technology industry.
[0061] (1) Infrastructure.
[0062] The infrastructure provides computing power support for the artificial intelligence system, realizes communication with the external world, and realizes support through the underlying platform. Communication with the outside world through sensors; computing power is provided by intelligent chips, including central processing unit (CPU), embedded neural network processing unit (NPU), graphics processing unit (GPU), application specific integrated circuit (ASIC), or field programmable gate array (FPGA) and other hardware acceleration chips; the underlying platform includes distributed computing framework and related platform support and support for networking, which can include cloud storage and computing, interconnection networks, etc. For example, sensors and external communication acquire data, which are provided to intelligent chips in the distributed computing system provided by the underlying platform for computing.
[0063] (2) Data.
[0064] The data above the infrastructure layer is used to represent the data source in the field of artificial intelligence. Data involves graphics, images, speech, text, and also involves Internet of Things data of traditional devices, including business data of existing systems and sensing data such as force, displacement, liquid level, temperature, and humidity.
[0065] (3) Data processing.
[0066] Data processing generally includes data training, machine learning, deep learning, search, reasoning, decision, etc.
[0067] Among them, machine learning and deep learning can model, extract, preprocess, train, etc. of the symbolic and formalized intelligent information of the data.
[0068] Reasoning refers to the process of simulating human intelligent reasoning methods in a computer or intelligent system, using formalized information to solve problems according to reasoning control strategies, and the typical function is search and matching.
[0069] Decision refers to the process of decision-making after intelligent information is reasoned, and usually provides functions such as classification, sorting, and prediction.
[0070] (4) General capabilities.
[0071] After the data is processed as mentioned above, some general capabilities can be formed based on the results of data processing, such as algorithms or a general system, for example, translation, text analysis, computer vision processing, speech recognition, image recognition, etc.
[0072] (5) Intelligent products and industry applications.
[0073] Intelligent products and industry applications refer to products and applications of artificial intelligence systems in various fields, which are encapsulations of overall solutions of artificial intelligence, and realize the application of intelligent information decision-making products. The application fields mainly include intelligent manufacturing, intelligent transportation, smart home, intelligent medical care, intelligent security, autonomous driving, safe city, intelligent terminal, etc.
[0074] The embodiments of the present application can be applied to the intelligent dialogue system architecture as shown in Figure 2
[0075] The intelligent dialogue system as shown in Figure 2 includes an offline training framework and an online prediction framework.
[0076] In the offline training framework, according to the semantic representation definition proposed in the embodiments of the present application, the text frequently used in daily use is annotated with the semantic representation definition corresponding to the text, the text annotated with the semantic representation definition is used as training corpus, and more training corpus is generated based on the annotated training corpus.
[0077] The obtained training corpus is used for model training, so that the model learns the syntax structure of the text and the semantic representation structure of the text. The learning of the syntax structure and the semantic representation structure is not carried out independently, and the model also needs to jointly learn the corresponding relationship between the syntax structure and the semantic representation structure of the text, so that the text syntax structure learned by the model will form a constraint on the text semantic representation structure.
[0078] After training the model, a context alignment perception parsing model is obtained, which can determine the syntactic structure of the text, the semantic representation structure of the text, and the alignment relationship between the syntactic structure and the semantic representation structure.
[0079] In the online prediction framework, the user issues a voice input, and an ASR module is used to parse the voice input of the user into text. The online prediction framework receives the push of the context alignment perception parsing model trained by the offline training framework, takes the user instruction text obtained after the ASR module parses the user voice as the input of the context alignment perception parsing model, and obtains the text semantics represented in the semantic representation definition form proposed in the embodiment of the present application after semantic parsing of the model, so that the dialogue management module updates the dialogue state based on the semantic representation output by the semantic parsing module, calls the skill interface, and mounts the trigger condition and the execution action in the semantic representation.
[0080] After the reply generation module generates a reply according to the current dialogue state, the text reply is converted into speech by a text to speech (TTS) module, and is broadcast to the user.
[0081] In combination with the above introduction, the product implementation form of the semantic parsing method in the embodiment of the present application is introduced below. One implementation form of the product of the embodiment of the present application can be an intelligent speaker as shown in Figure 3 .
[0082] The ASR module in the intelligent speaker converts the voice input by the user into text, and inputs the text into a central controller. The central controller classifies the text in different fields, and distributes the text in different fields. The user instruction text distributed by the central controller is subjected to semantic parsing by an NLU module in the intelligent speaker based on the semantic parsing model obtained by offline training. The NLU module transmits the parsed result back to the central controller. Subsequently, the central controller decides an optimal one from the candidate semantic representations, maps it to a machine instruction, and distributes the semantic representation and the machine instruction to a dialogue manager. The dialogue manager updates the dialogue state based on the semantic representation, calls a skill service interface based on the machine instruction to mount a trigger condition and a planned task, and generates a reply. The skill service includes a music service, a weather service, or a news service. The central controller updates the global state, and transmits the reply to a TTS module. The TTS module converts the reply text into speech and broadcasts it to the user.
[0083] In combination with the above introduction, another implementation form of the product in the embodiment of the present application is introduced below. Please refer to Figure 4 .
[0084] Another product form of the semantic parsing method in the embodiment of the present application is an NLU device in an intelligent speaker.
[0085] The training corpus required for model training can be obtained in two ways. One way is that an operator can write a template of a trigger task instruction on an operation platform, and generate a training corpus based on the nested template. The other way is that an annotator annotates the semantic representation definition and the alignment relationship between nodes and instruction subtexts of high-frequency texts in daily use on an annotation platform, to obtain a training corpus annotated.
[0086] The semantic parsing model with context alignment perception is trained according to the training corpus.
[0087] The NLU service performs semantic parsing on the user instruction text recognized by the ASR based on the semantic parsing model trained in the previous step, and outputs a semantic representation. The semantic representation is transmitted to a dialogue manager, a skill service, etc. to obtain a reply returned to the user, and is recorded to a log server and pushed to an offline log analysis module.
[0088] The offline log analysis module collects user instructions that are not correctly parsed in the log, and pushes them to an annotator for annotation and iterative optimization.
[0089] In combination with the above description, the semantic parsing method in the embodiments of the present application is described as follows:
[0090] Referring to Figure 5 In the embodiments, the intelligent dialogue system obtains a user instruction text, divides the user instruction text into a word segmentation sequence, determines node text representing an action or a trigger condition based on a syntax parsing model according to the word segmentation sequence, obtains node semantics based on a semantic representation decoding model according to the node text, obtains a semantic representation graph according to the node semantics, and further obtains target semantics of the user instruction text.
[0091] 501. The intelligent dialogue system obtains a user instruction text.
[0092] A microphone in the intelligent dialogue system picks up a voice instruction issued by a user, and an ASR module in the intelligent dialogue system converts the user voice received by the microphone into text to obtain the user instruction text.
[0093] 502. The intelligent dialogue system obtains a word segmentation sequence according to the user instruction text.
[0094] A word segmentation preprocessing module in the intelligent dialogue system divides the user instruction text to obtain a word segmentation sequence including N words. The N words in the word segmentation sequence are arranged in the order of the user instruction text.
[0095] 503. The intelligent dialogue system determines node text based on a syntax parsing model according to the word segmentation sequence.
[0096] The syntax analysis model in the embodiments of the present application is a transition-based constituent parser, which maintains a stack S and a queue B, the initial value of the stack S is an empty stack, and the initial value of the queue B is the segmented word sequence obtained by segmenting the user instruction text. The model iterates step by step, traverses the sentence from left to right, and decides the operation to be taken on the stack S and the queue B at each step. After the segmented word sequence of the user instruction text is parsed, the operation sequence taken on the stack S and the queue B forms a segmentation of the segmented word sequence of the user instruction text, and the segmentation is used to obtain the node text in the user instruction.
[0097] 504. The intelligent dialogue system determines the node semantics based on the semantic representation decoding model according to the node text.
[0098] The semantic representation decoding model is trained in an offline state and then pushed to the NLU module. When the syntax analysis model obtains a node text, the semantic representation decoding model is used to obtain the semantics of each node text by taking the node text as input, and the output of the node semantics corresponding to each node text is obtained.
[0099] 505. The intelligent dialogue system determines the semantic representation graph of the user instruction text according to the node semantics.
[0100] The node semantics include action node semantics and trigger condition node semantics. After the intelligent dialogue system obtains the node semantics corresponding to the node text, the semantics of all nodes are taken as input of the semantic representation decoding model, and the edge structure between the semantic nodes (including the edges from the trigger condition nodes to the action nodes and the edges between the trigger condition node semantics) is obtained. The edges between the semantic nodes represent a certain semantic relationship between the semantic nodes. After the intelligent dialogue system determines the node semantics corresponding to the node text, the edges between the node semantics are determined, and the semantic representation graph including all node semantics in the user instruction text is obtained.
[0101] 506. The intelligent dialogue system obtains the target semantics of the user instruction text according to the semantic representation graph.
[0102] The edges of the semantic representation graph represent different semantics in different cases, wherein the edges from the trigger condition nodes to the trigger condition nodes represent the logical "and" relationship, the edges from the trigger condition nodes to the action nodes represent the "trigger" relationship, and there is an "or" relationship between different paths from the trigger condition nodes to the action nodes in the semantic representation graph. After the semantics of the edges in the semantic representation graph are determined, the semantic representation graph is converted into a more intuitive sequence representation form, and the target semantics expressed in the sequence form is obtained.
[0103] In combination with the above description, the following will be described. Figure 5The model framework of the syntax analysis model in the illustrated embodiment is introduced as follows:
[0104] In the embodiment of the present application, the input of the syntax analysis model is the segmented sequence of the user instruction text, and the output is all the node texts in the user instruction text. The input data structure of the syntax analysis model includes a stack and a queue. The segmented sequence of the user instruction text is read into the syntax analysis model in the data structure of the queue, and the model determines the operation to be taken according to the state of the stack and the queue at each step until all the segments in the queue are pushed into the stack and the operation according to the state of the stack is completed, then the parsing is completed. The operations that can be taken at each step are shown in Table 1 as follows:
[0105] Table 1
[0106]
[0107] In combination with the introduction of the model framework of the syntax analysis model in the embodiment of the present application above, the model framework of the syntax analysis model in the embodiment of the present application is introduced in more detail below with the user instruction text as an example, i.e., “I will turn on the air conditioner if the temperature exceeds 30 degrees or the humidity is higher than 50% after I get home”, as shown in Table 2:
[0108] Table 2
[0109] Stack S Queue B Expected operation [] [I, go home, later,...] Add(T) [T] [I, go home, later,...] Shift*3 [T, I, go home, later] [If, temperature, exceeds,...] Reduce [T(I go home later)] [If, temperature, exceeds,...] Shift [T(I go home later), if] [Temperature, exceeds, 30, degrees,...] Add(T) [T(I go home later), if, T] [Temperature, exceeds, 30, degrees,...] Shift*4 [T(I go home later), if, T, temperature, exceeds, 30, degrees] [Or, humidity,...] Reduce [T(I go home later), if, T(temperature exceeds 30 degrees)] [Or, humidity,...] Shift [T(I go home later), if, T(temperature exceeds 30 degrees), or] [Humidity, is, higher, than, 50%,...] Add(T) [..., T(temperature exceeds 30 degrees), or, T] [Humidity, is, higher, than, 50%,...] Shift*3 [..., T(temperature exceeds 30 degrees), or, T, humidity, is, higher, than, 50%] [Just, turn, on, air conditioner] Reduce [..., T(temperature exceeds 30 degrees), or, T(humidity is higher than 50%)] [Just, turn, on, air conditioner] Shift [..., T(humidity is higher than 50%), just] [Turn, on, air conditioner] Add(A) [..., T(humidity is higher than 50%), just, A] [Turn, on, air conditioner] Shift*2 [..., T(humidity is higher than 50%), just, A, turn, on, air conditioner] [] Reduce [..., T(humidity is higher than 50%), just, A(turn air conditioner)] []
[0110] Through the operation at each step, the node texts “I will get home”, “the temperature exceeds 30 degrees”, “the humidity is higher than 50%” and “turn on the air conditioner” are obtained.
[0111] The continuous N-step Shift is simply denoted as Shift*N, indicating that the operations from the current step to the Nth step are all Shift (i.e., pushing the N words at the head of the current queue B into the stack S one by one).
[0112] In combination with the above introduction, the semantic representation decoding model in the embodiment of the present application is introduced as follows:
[0113] The semantic representation decoding model in the embodiment of the present application has two functions: (1) taking the node text as the input to determine the node semantics of the node text; and (2) after determining the node semantics of all the node texts included in the user instruction text, obtaining the semantic representation graph of the whole sentence of the user instruction text.
[0114] In combination with the above example of the user instruction text as “I will turn on the air conditioner if the temperature exceeds 30 degrees or the humidity is higher than 50% after I get home”, the semantic representation graph of the semantic representation decoding model in the embodiment of the present application is introduced in detail as follows:
[0115] The syntax analysis model has obtained the node texts "after I get home", "temperature exceeds 30 degrees", "humidity is higher than 50%", and "turn on the air conditioner". After the semantic analysis model obtains the node semantics of the node texts, the relationship between the node semantics is analyzed, and the semantic representation graph as shown in Figure 6 is obtained.
[0116] Figure 6 The semantic representation graph as shown in the figure includes trigger condition node one 601, trigger condition node two 602, trigger condition node three 603, and action node 604, wherein the text of trigger condition node one 601 is "after I get home", the text of trigger condition node two 602 is "temperature exceeds 30 degrees", the text of trigger condition node three 603 is "humidity is higher than 50%", and the text of action node 604 is "turn on the air conditioner".
[0117] Figure 5 The semantic representation graph as shown in the figure includes two paths, namely 601-602-604 and 601-603-604, and the two paths have an "or" relationship. The edge from trigger condition node one 601 to trigger condition node two 602 represents an "and" relationship, and the edge from trigger condition node one 601 to trigger condition node three 603 represents an "and" relationship.
[0118] In combination with the above introduction, an application scenario of the semantic analysis method in the embodiments of the present application is introduced as follows:
[0119] After obtaining the target semantics of the user instruction text according to the semantic analysis method in the embodiments of the present application, task triggering can be performed according to the target semantics. The task triggering is a task triggering based on graph reasoning: if the states of all trigger conditions on a certain path from a trigger condition node without incoming edges to a certain action node are true, the action node is executed. The manner of task triggering is introduced taking the semantic representation graph in Figure 6 as an example: (1) when the states of trigger condition node one 601 and trigger condition node two 602 in the path 601-602-604 are true, the action node 604 is executed; (2) when the states of trigger condition node one 601 and trigger condition node three 603 in the path 601-603-604 are true, the action node 604 is executed.
[0120] The trigger condition Trigger includes but is not limited to the following types: a variable V changes; a variable V has a directional change (increases / decreases); two variables V1 and V2 have a binary relationship (equal / not equal / greater than / less than / greater than or equal to / less than or equal to / contains / contained in / ...); and the like. The execution action Action includes an action name and an action parameter.
[0121] In combination with the above introduction, the semantic analysis method in the embodiments of the present application is described as follows: Figure 5The target semantics expressed in sequence form in the illustrated embodiment is introduced as follows:
[0122] The semantic representation graph is converted into sequence form based on predefined rules, and the rules are defined as shown in Table 3:
[0123] Table 3
[0124]
[0125] The T_BEG and T_END symbols respectively represent the start and end markers of the trigger, the A_BEG and A_END symbols respectively represent the start and end markers of the action, and the OR_BEG and OR_END symbols represent the start and end markers of the "or" operation. Based on the above rules, the semantic representation graph of Figure 5 can be converted into the following target semantic sequence:
[0126]
[0127] The specific implementation of the syntax analysis model framework in the embodiments of the present application depends on the neural network model. The neural network model of the syntax analysis model in the embodiments of the present application will be described in detail below. Please refer to Figure 7 :
[0128] The neural network model of the syntax analysis model in the embodiments of the present application includes a stack encoder 701, a queue encoder 702, an operation sequence encoder 703, a fusion full connection neural network 704, and a prediction full connection neural network 705.
[0129] The stack encoder 701 can be a recurrent neural network (RNN), or other types of artificial neural networks, such as a long short-term memory (LSTM) artificial neural network. The specific implementation is not limited here. As shown in the model framework of the syntax analysis model in Table 2, the state of each step of the stack after operation is taken as the stack state sequence as the input data of the stack encoder 701, and the vector of the current stack S t is obtained.
[0130] The queue encoder 702 can be an RNN, or other types of artificial neural networks, such as an LSTM. The specific implementation is not limited here. As shown in the model framework of the syntax analysis model in Table 2, the state of each step of the queue after operation is taken as the queue state sequence as the input data of the queue encoder 702, and the vector of the current queue B t is obtained.
[0131] The operation sequence encoder 703 can be a recurrent neural network (RNN) or other types of artificial neural networks, such as a long short-term memory (LSTM) artificial neural network; the specific type is not limited here. As shown in Table 2, in the model framework of the syntactic parsing model, the operation sequence composed of each step's operations is used as the input data for the operation sequence encoder 703 to obtain the vector of the current data operation sequence O.
[0132] The fully connected neural network 704 is integrated into a multi-layer perceptron (MLP) to process the vector of the current stack St. The vector of the current queue Bt and the vector of the current data operation sequence O As input, the vector r is obtained after being fused by a fully connected circuit. t .
[0133] Predicting a fully connected neural network 705 as an MLP, used to fuse the vector r output by a fully connected neural network 704. t As input, we obtain the probability distribution of the next operation:
[0134]
[0135]
[0136]
[0137]
[0138] P(o t |S t B t {o1, ...,o} t-1})=f P (r t ;Θ P );o t ∈{Shift,Reduce,Add(A),Add(T)}
[0139] in, These represent the network functions of the stack encoder, queue encoder, operation sequence encoder, fused MLP1, and prediction MLP, respectively. The parameter is . The resulting prediction operation is one of the four operations shown in Table 1.
[0140] In combination with the above Figure 7 The following is a detailed description of the architecture of the stack encoder in the embodiments of this application. Please refer to the following examples. Figure 8 :
[0141] The stack encoder includes two subtext encoders, one of which is a node subtext encoder and the other of which is an integrated text encoder.
[0142] The node subtext encoder is a bidirectional LSTM, which is used to encode the reduced text segment corresponding to a node in the stack S into a reduction vector.
[0143] The integrated text encoder 7 is a bidirectional LSTM, which is used to encode the reduction vectors of the nodes output by the node subtext encoder together with the whole text that has not been reduced into an embedding vector, thereby obtaining an encoding vector of the stack S.
[0144] The specific form of the node subtext encoder is as follows:
[0145]
[0146]
[0147]
[0148] wherein, represents the hidden state vectors of the forward and backward LSTMs; d is the dimension of the hidden vectors; is a forward LSTM, and is a parameter thereof; is a backward LSTM, and is a parameter thereof; and constitute the parameters Θ of the subtext encoder sub ; tok i is the ith word unit (non-terminal or text word), and e(tok i ) represents the embedding vector of tok i ; L is the number of word units (including non-terminals) input into the encoder. The output vectors of the last steps of the forward and backward LSTMs are spliced to obtain the output vector of the subtext encoder. The bidirectional LSTM of the integrated text encoder is of the same form as the above formula, only the parameters are different.
[0149] Similarly, the queue encoder and the operation sequence encoder also adopt the form of bidirectional LSTM, which is of the same form as the above formula, only the parameters are different. The stack encoding vector The queue encoding vector The operation sequence encoding vector After that, the fusion vector r is obtained through the following fully connected network. t :
[0150]
[0151] wherein, is a parameter to be learned.
[0152] In combination Figure 5 In combination with the introduction of the semantic representation decoding model in the embodiments shown below, the neural network model of the semantic representation decoding model in the embodiments of the present application is introduced in detail, please refer to Figure 9 :
[0153] Figure 9 The semantic representation decoding model shown is based on Figure 7 The syntax analysis model, when the reduced node subtext is obtained, takes the node subtext as input, and uses the semantic representation decoding model to obtain the node subtext corresponding to the reduced node subtext.
[0154] The syntax analysis model and the semantic representation decoding model in the embodiments of the present application can be constructed into a joint model for training, please refer to Figure 10 :
[0155] The present scheme trains a context alignment aware semantic parsing model based on annotated corpus. It is a joint model, including a transition-based syntax analysis model and a semantic representation decoding model. The training framework of the model is shown in Figure 10 The form of the training data (green box) is user text instruction Q, semantic representation graph G=(V, E) of Q, and alignment relationship between node set V and subtext in Q (i.e. which segment of subtext in Q each node corresponds to).
[0156] In combination with the above introduction, the training architecture of the joint model composed of the neural network model of the syntax analysis model as shown in Figure 6 and the neural network model of the semantic representation decoding model as shown in Figure 9 is introduced below, please refer to Figure 10 :
[0157] The form of the training data is user text instruction Q, semantic representation graph G=(V, E) of Q, and alignment relationship between node set V and subtext in Q (i.e. which segment of subtext in Q each node corresponds to).
[0158] (1) The operator writes a template of trigger type task instruction, and generates training corpus based on the nested template. The template and its semantic representation conversion rule are shown in Table 4:
[0159] Table 4
[0160]
[0161] The specific Trigger and Action can be generated based on the above-mentioned template nesting, and the alignment relationship between each Trigger and Action node and the subtext of the instruction is obtained naturally. For example, the instruction "I will turn on the air conditioner if the temperature exceeds 30 degrees or the humidity is higher than 50% after I come home" in Table 2 can be generated based on the above-mentioned template, wherein the Trigger node T1 corresponds to the subtext "I will come home", the Trigger node T2 corresponds to the subtext "the temperature exceeds 30 degrees", the Trigger node T3 corresponds to the subtext "the humidity is higher than 50%", and the Action node A corresponds to the subtext "turn on the air conditioner".
[0162] (2) The annotator selects high-frequency trigger task instructions from the log, annotates the semantic representation and the alignment relationship between the nodes and the instruction subtext as training corpus.
[0163] According to the training corpus, a joint model including a syntax analysis model and a semantic representation decoding model is trained.
[0164] According to the above Figure 10 According to the above Figure 10 According to the above Figure 11 :
[0165] The embodiment of the present application provides a system architecture 1100. The data acquisition device 1160 is used to obtain sample data and store loss values generated by training into the database 1130, and the training device 1120 generates a target model / rule 1101 based on the sample data maintained in the database 1130 and the loss values generated by training. How the training device 1120 obtains the target model / rule 1101 based on the sample data and the loss values generated by training will be described in detail below. The target model / rule 1101 can adaptively adjust the weight parameters corresponding to the loss values, and simultaneously explore the effectiveness of the weights and inherit excellent network parameters and weights in the training process by using the parallel computing advantage, so as to obtain the optimal training model in a training time.
[0166] The work of each layer in a deep neural network can be described mathematically. From a physical perspective, each layer of a deep neural network can be understood as transforming the input space (the set of input vectors) to the output space (i.e., from the row space to the column space of a matrix) through five operations on the input space. These five operations are: 1. Dimensionality increase / decrease; 2. Magnification / reduction; 3. Rotation; 4. Translation; 5. "Bending". Operations 1, 2, and 3 are performed by [the implementation company], operation 4 by [the implementation company], and operation 5 by [the implementation company]. The term "space" is used here because the objects being classified are not individual things, but a class of things, and space refers to the set of all individuals of this class of things. [The implementation company] is a weight vector, where each value represents the weight value of a neuron in that layer of the neural network. This vector determines the spatial transformation from the input space to the output space mentioned above; that is, the weights of each layer control how the space is transformed. The purpose of training a deep neural network is to ultimately obtain the weight matrix of all layers of the trained neural network (a weight matrix formed by vectors from many layers). Therefore, the training process of a neural network is essentially learning how to control spatial transformation, more specifically, learning the weight matrix.
[0167] Because the goal is for the output of a deep neural network to be as close as possible to the actual predicted value, we can compare the current network's prediction with the desired target value and update the weight vector of each layer based on the difference. (Of course, there's usually an initialization process before the first update, where parameters are pre-configured for each layer in the deep neural network). For example, if the network's prediction is too high, the weight vector is adjusted to predict a lower value. This adjustment continues until the neural network can predict the actual target value. Therefore, it's necessary to predefine "how to compare the difference between the predicted and target values," which is the loss function or objective function. These are important equations used to measure the difference between the predicted and target values. Taking the loss function as an example, a higher output value (loss) indicates a greater difference, so training a deep neural network becomes a process of minimizing this loss as much as possible.
[0168] The target model / rules obtained from training device 1120 can be applied to different systems or devices. (See attached...) Figure 11 In the process, the execution device 1110 is equipped with an I / O interface 1112 for data interaction with external devices. The "user" can input data to the I / O interface 1112 through the client device 1140.
[0169] The execution device 1110 can call data, code, etc. in the data storage system 1150, and can also store data, instructions, etc. in the data storage system 1150.
[0170] The calculation module 1111 uses the target model / rule 1101 to process the input data, parses the syntax and semantics of the user command text, and obtains the sub-semantics of each node in the user command text and the semantic representation graph of the user command text.
[0171] The associated function module 1113 specifically associates the syntax of the user command text with the sub-semantics of the node text.
[0172] The association function module 1114 specifically associates the sub-semantics of the node text of the user instruction text with the semantic representation graph of the user instruction text.
[0173] Finally, I / O interface 1112 returns the processing result to client device 1140 for use by the user.
[0174] At a deeper level, the training device 1120 can generate corresponding target models / rules 1101 based on different data for different objectives, in order to provide users with better results.
[0175] In the appendix Figure 11 In the illustrated scenario, the user can manually specify the data input to execution device 1110, for example, by operating through the interface provided by I / O interface 1112. Alternatively, client device 1140 can automatically input data to I / O interface 1112 and obtain results. If client device 1140 requires user authorization to automatically input data, the user can set appropriate permissions within client device 1140. The user can view the output results of execution device 1110 on client device 1140, which can be presented through display, sound, or actions. Client device 1140 can also act as a data acquisition terminal, storing the collected training data into database 1130.
[0176] It is worth noting that, attached Figure 11 This is merely a schematic diagram of a system architecture provided by an embodiment of the present invention. The positional relationships between the devices, components, modules, etc. shown in the diagram do not constitute any limitation. For example, in the attached diagram... Figure 11 In this context, the data storage system 1150 is an external memory relative to the execution device 1110. In other cases, the data storage system 1150 may also be placed within the execution device 1110.
[0177] Based on the above description of the semantic parsing method in the embodiments of this application, the structure of the execution device on which the intelligent dialogue system implementing the semantic parsing method in the embodiments of this application is based will be described below:
[0178] Please see Figure 12 In the embodiments of this application Figure 12The illustrated execution device includes an acquisition unit 1201 and a processing unit 1202.
[0179] The acquisition unit 1201 is configured to acquire a user instruction text.
[0180] The processing unit 1202 is configured to determine at least one node text from the user instruction text, each node text in the at least one node text being text representing an action or a trigger condition in the user instruction text.
[0181] The processing unit 1202 is configured to determine semantic information of each node text in the at least one node text.
[0182] The processing unit 1202 is further configured to determine a target semantics of the user instruction text according to the semantic information of each node text.
[0183] The processing unit 1202 is further configured to, when the at least one node text includes a first node text and a second node text that are associated with each other, the first node text being text representing a trigger condition, and the second node text being text representing an action,
[0184] determine the target semantics of the user instruction text according to first semantic information of the first node text and second semantic information of the second node text.
[0185] The processing unit 1202 is further configured to, when the target semantics of the user instruction text is a semantic representation graph, determine the target semantics of the user instruction text according to the first semantic information, the second semantic information, and an edge of the first semantic information pointing to the second semantic information.
[0186] The processing unit 1202 is further configured to, when the at least one node text includes a third node text, the third node text being text representing a trigger condition, determine the target semantics of the user instruction text according to the first node text, the second node text, and the third node text.
[0187] The processing unit 1202 is further configured to determine the target semantics of the user instruction text according to the first semantic information, the second semantic information, the edge of the first semantic information pointing to the second semantic information, and third semantic information and an edge of the first semantic information pointing to the third semantic information.
[0188] The processing unit 1202 is further configured to obtain, according to a transition-based syntax parsing model, an output of the at least one node text with the user instruction text as an input.
[0189] The processing unit 1202 is further configured to obtain, according to a semantic representation decoding model, the semantic information of each node text with the at least one node text as an input.
[0190] The processing unit 1202 is further configured to decode the model according to the semantic representation, to obtain, as an output, a target semantic of the user instruction text, with the semantic information of each node text as an input.
[0191] The execution device provided in the embodiments of the present application can be a chip, which includes a processing unit, for example, a processor, and a communication unit, for example, an input / output interface, a pin, or a circuit, etc. The processing unit can execute computer execution instructions stored in a storage unit, so that the chip in the execution device performs the semantic parsing method described in the embodiments. Figure 5 Optionally, the storage unit is a storage unit in the chip, such as a register or a cache, and the storage unit can also be a storage unit outside the chip in the wireless access device, such as a read-only memory (ROM) or other types of static storage devices that can store static information and instructions, a random access memory (RAM), etc.
[0192] Specifically, refer to Figure 13 , Figure 13 is an embodiment of the chip in the present application, which can be a neural network processor 1300. The neural network processor 1300 is mounted as a coprocessor on a host CPU and is assigned tasks by the host CPU. The core part of the neural network processor 1300 is an operation circuit 1303, and a controller 1304 can control the operation circuit 1303 to extract data in a weight storage 1302 or an input storage 1301 and perform operations.
[0193] In some implementations, the operation circuit 1303 includes a plurality of processing units (PEs) inside. In some implementations, the operation circuit 1303 can be a two-dimensional systolic array. The operation circuit 1303 can also be a one-dimensional systolic array or other electronic circuits capable of performing mathematical operations such as multiplication and addition. In some implementations, the operation circuit 1303 is a general matrix processor.
[0194] For example, assuming there are an input matrix A, a weight matrix B, and an output matrix C. The operation circuit takes the corresponding data of the matrix B from the weight storage 1302 and caches it on each PE in the operation circuit. The operation circuit takes the matrix A data from the input storage 1301 and performs matrix operations with the matrix B to obtain a partial result or a final result of the matrix, which is saved in an accumulator 1308.
[0195] The unified memory 1306 is used to store input data and output data. The weight data is transferred to the weight memory 1302 through a direct memory access controller (DMAC) 1305. The input data is also transferred to the unified memory 1306 through the DMAC.
[0196] The bus interface unit 1310 (BIU) is used to realize the interaction of the main CPU, the DMAC and the instruction fetch buffer (IFB) 1309 through a bus. The instruction fetch buffer 1309 is used to store the instructions used by the controller 1304.
[0197] The vector calculation unit 1307 includes a plurality of operation processing units, and further processes the output of the operation circuit as needed, such as vector multiplication, vector addition, exponential operation, logarithmic operation, size comparison, etc. It is mainly used for non-convolutional / full connection layer network calculation in neural networks, such as pixel-level summation, feature plane up-sampling, etc.
[0198] In the corresponding embodiment, the operations of each layer in the neural network shown in the embodiment can be performed by the operation circuit 1303 or the vector calculation unit 1307. Figure 4 to Figure 9
[0199] Any of the above-mentioned processors can be a central processing unit, a microprocessor, or one or more integrated circuits for controlling the execution of the programs of the above-mentioned first aspect method.
[0200] It should be further noted that the above-described device embodiments are only schematic, and the units described as separate components can or can not be physically separated, and the components shown as units can or can not be physical units, i.e. they can be located in one place or distributed on multiple network units. Part or all of the modules can be selected according to actual needs to achieve the purpose of the embodiment. In addition, the connection relationship between the modules in the device embodiment provided in the present application indicates that there is a communication connection between them, which can be realized as one or more communication buses or signal lines.
[0201] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the above-described system, device and unit can refer to the corresponding process in the foregoing method embodiments, which will not be described here.
[0202] In several embodiments provided in the present application, it should be understood that the disclosed system, device and method can be implemented in other manners. For example, the described device embodiments are merely schematic. The division of the units is merely a logical function division. There can be another division manner for the actual implementation, for example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the displayed or discussed mutual couplings or direct couplings or communication connections between the units can be indirect couplings or communication connections through some interfaces, devices or units, and can be electrical, mechanical or in other forms.
[0203] The units described as separate components can or can not be physically separate, and the components shown as units can or can not be physical units, i.e., can be located in one place or distributed on multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the embodiment.
[0204] In addition, each functional unit in the various embodiments of the present application can be integrated into a processing unit, or each unit can be a physically independent unit, or two or more units can be integrated into a unit. The integrated unit can be implemented in the form of hardware or in the form of a software functional unit.
[0205] The integrated unit, if implemented in the form of a software functional unit and sold or used as an independent product, can be stored in a computer readable storage medium. Based on this understanding, the technical solutions of the present application, essentially or the part that makes a contribution to the prior art, or the whole or part of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium, and includes a number of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present application. The foregoing storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM, read-only memory), a random access memory (RAM, random access memory), a magnetic disk or an optical disk, and various program codes that can be stored in the medium.
Claims
1. A method of semantic parsing, the method comprising: The method comprises: obtaining user instruction text; determining at least one node text from the user instruction text, each of the at least one node text being text representing an action or a trigger condition in the user instruction text; determining semantic information of each of the at least one node text; the at least one node text comprises a first node text and a second node text that are associated with each other, the first node text being text representing a trigger condition, and the second node text being text representing a trigger condition or an action; determining a target semantic of the user instruction text according to the semantic information of each of the node text, the target semantic of the user instruction text being a semantic representation graph, the semantic representation graph being determined based on first semantic information of the first node text, second semantic information of the second node text, and an edge of the first semantic information pointing to the second semantic information, wherein, in the case that the second node text is text representing a trigger condition, the edge of the first semantic information pointing to the second semantic information represents a logical and relationship; and in the case that the second node text is text representing an action, the edge of the first semantic information pointing to the second semantic information represents a trigger relationship.
2. The semantic analysis method of claim 1, wherein: the determining of the target semantic of the user instruction text according to the semantic information of each of the node text comprises: determining the target semantic of the user instruction text according to the first semantic information of the first node text and the second semantic information of the second node text.
3. The semantic parsing method of claim 2, wherein, the determining of the target semantic of the user instruction text according to the first semantic information of the first node text and the second semantic information of the second node text comprises: determining the target semantic of the user instruction text according to the first semantic information, the second semantic information, and the edge of the first semantic information pointing to the second semantic information.
4. The semantic parsing method of claim 1 or 2, wherein, the at least one node text comprises a third node text, the third node text being text representing a trigger condition; the determining of the target semantic of the user instruction text according to the semantic information of each of the node text comprises: determining the target semantic of the user instruction text according to the first node text, the second node text, and the third node text.
5. The semantic parsing method of claim 4, wherein, the determining of the target semantic of the user instruction text according to the first node text, the second node text, and the third node text comprises: determining the target semantic of the user instruction text according to the first semantic information, the second semantic information, the edge of the first semantic information pointing to the second semantic information, and third semantic information and an edge of the first semantic information pointing to the third semantic information.
6. The semantic parsing method of claim 5, wherein, the determining of the at least one node text from the user instruction text comprises: obtaining, according to a transition-based syntax analysis model, an output of the at least one node text by taking the user instruction text as an input.
7. The semantic parsing method of claim 6, wherein, the determining of the semantic information of each of the at least one node text comprises: According to the semantic representation decoding model, the at least one node text is input to obtain semantic information of each node text as output.
8. The semantic parsing method of claim 7, wherein, The target semantics of the user instruction text is determined according to the semantic information of each node text. According to the semantic representation decoding model, the at least one node text is input to obtain semantic information of each node text as output.
9. An intelligent dialog system, characterized in that Comprising: An acquisition unit is configured to acquire a user instruction text. A processing unit is configured to determine at least one node text from the user instruction text, each node text in the at least one node text being text representing an action or a trigger condition in the user instruction text. The processing unit is configured to determine semantic information of each node text in the at least one node text, the at least one node text comprising a first node text and a second node text that are associated with each other, the first node text being text representing a trigger condition, and the second node text being text representing a trigger condition or an action. The processing unit is configured to determine target semantics of the user instruction text according to the semantic information of each node text, the target semantics of the user instruction text being a semantic representation graph, the semantic representation graph being determined based on first semantic information of the first node text, second semantic information of the second node text, and an edge from the first semantic information to the second semantic information; wherein, in the case that the second node text is text representing a trigger condition, the edge from the first semantic information to the second semantic information represents a logical AND relationship; and in the case that the second node text is text representing an action, the edge from the first semantic information to the second semantic information represents a trigger relationship.
10. The intelligent dialog system of claim 9, wherein, Comprising: The processing unit is configured to determine the target semantics of the user instruction text according to the first semantic information of the first node text and the second semantic information of the second node text. 11.The intelligent dialog system of claim 10, wherein, Comprising: The processing unit is configured to determine the target semantics of the user instruction text according to the first semantic information, the second semantic information, and an edge from the first semantic information to the second semantic information. 12.The intelligent dialog system of claim 9 or 10, wherein, Comprising: The processing unit is configured to determine the target semantics of the user instruction text according to the first node text, the second node text, and a third node text when the at least one node text comprises the third node text, the third node text being text representing a trigger condition.
13. The intelligent dialog system of claim 12, wherein, Comprising: The processing unit is configured to determine the target semantics of the user instruction text according to the first semantic information, the second semantic information, an edge from the first semantic information to the second semantic information, and third semantic information and an edge from the first semantic information to the third semantic information.
14. The intelligent dialog system of claim 13, wherein, Comprising: The processing unit is configured to obtain the at least one node text according to the syntax parsing model based on transition.
15. The intelligent dialog system of claim 14, wherein, Comprising: The processing unit is configured to obtain semantic information of each node text as output according to the semantic representation decoding model, the at least one node text being input.
16. The intelligent dialog system of claim 15, wherein, Comprising: The processing unit is configured to decode a model according to the semantic representation, and obtain an output of a target semantic of the user instruction text by taking semantic information of each node text as input.
17. A computer-readable storage medium, characterized in that, The computer readable storage medium stores a program, and when the computer executes the program, the method in any one of claims 1 to 8 is executed.
18. A computer program product, characterised in that, When the computer program product is executed on the computer, the computer executes the method in any one of claims 1 to 8.
19. An intelligent terminal device, characterized by The intelligent terminal device comprises the intelligent conversation system in any one of claims 9 to 16.
Citation Information
Patent Citations
Intelligent terminal control method based on semantic analysis, system and intelligent terminal
CN105446146A
Semantic feature generation method and device, model training method and device, equipment and medium
CN112560501A