Question semantic analysis method and device

By introducing a two-way information interaction mechanism in the semantic analysis system, the problem of low entity recognition accuracy has not been seen in the prior art, which significantly improves the overall accuracy of semantic analysis and system response speed.

CN119903925APending Publication Date: 2025-04-29GRG INTELLIGENT TECH SOLUTION CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411993973.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-31
Publication Date
2025-04-29

AI Technical Summary

Technical Problem

The existing semantic analytical system has low recognition accuracy when facing entities that have not been seen in user input and relies on domain dictionaries, which limits the generalization ability of the model.

Method used

The results of the slot filling task are reversely passed to the intent recognition task, and the results of the intent recognition task are fed back to the slot filling task, realizing two-way information interaction and enhancing the interaction between slot filling and intent recognition.

Benefits of technology

It significantly improves the overall accuracy of semantic analysis, improves the accuracy of entity recognition, slot filling and intention recognition, reduces the misunderstanding of user requests, improves the system's response speed and accuracy, and improves the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119903925A_ABST
    Figure CN119903925A_ABST
Patent Text Reader

Abstract

The invention discloses an inquiry semantic analysis method and device, and belongs to the technical field of computers. The query semantic analysis method comprises the following steps: performing feature extraction on a target statement to obtain a first feature; based on the first feature and a last second feature, obtaining a current slot filling result; performing feature extraction on the current slot filling result to obtain a current second feature; and obtaining an intention recognition result of the target statement based on the current second feature. According to the query semantic analysis method and device, the result of the slot filling task is reversely transmitted to the intention recognition task, the result of the intention recognition task is reversely fed back to the slot filling task, bidirectional information interaction is achieved, the slot filling task and the intention recognition task can be mutually enhanced, and the query semantic analysis efficiency is improved. The risk of error propagation can be reduced, the accuracy of entity recognition, slot filling and intention recognition can be improved, and the overall accuracy of semantic analysis can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of computer technology, and in particular, relates to a method and device for query semantic parsing. Background Art

[0002] In projects that require natural language processing (NLP), such as inquiry systems, intelligent question-answering systems, or voice assistants, semantic analysis of user input voice or text is required to identify intent. Existing semantic analysis systems are usually implemented through independent intent recognition models and entity recognition models. The system relies on pre-trained entity recognition models (such as BERT, etc.) to extract text features, and then combines domain dictionaries to identify and match specific entities. Based on the identified entities, the system identifies intent through the intent recognition model. However, the accuracy of existing semantic analysis systems is low when there are unseen entities in the user input voice or text. Summary of the invention

[0003] The present application aims to solve at least one of the technical problems existing in the prior art. To this end, the present application proposes a query semantic parsing method and device, which can improve the accuracy when there are unseen entities in the voice or text input by the user.

[0004] In a first aspect, the present application provides a method for query semantic parsing, the method comprising:

[0005] Extract features of the target sentence to obtain the first feature;

[0006] Based on the first feature and the second feature of the previous time, obtain the slot filling result of this time;

[0007] Perform feature extraction on the slot filling result of this time to obtain the second feature of this time;

[0008] Based on the second feature of this time, an intent recognition result of the target sentence is obtained.

[0009] According to the query semantic parsing method of the present application, the result of the slot filling task is passed back to the intent recognition task, and the result of the intent recognition task is fed back to the slot filling task, so as to realize two-way information interaction, so that slot filling and intent recognition are no longer isolated tasks, but can enhance each other through the slot filling task and the intent recognition task, overcome the problem of error propagation in the traditional pipeline model, reduce the risk of error propagation, significantly improve the overall semantic parsing effect, improve the accuracy of entity recognition, slot filling and intent recognition, and improve the overall accuracy of semantic parsing. In addition, by improving the accuracy of intent recognition and slot filling, the situation of misunderstanding user requests can be greatly reduced, the response speed and accuracy of the system can be improved, and the user experience can be improved. Especially in scenarios such as subway inquiries, fast and accurate responses are crucial to improving user satisfaction.

[0010] According to an embodiment of the present application, obtaining the intention recognition result of the target sentence based on the second feature of this time includes:

[0011] Based on the second feature of this time, perform intent recognition on the target sentence to obtain the original result of this time;

[0012] When the original result of this time is the same as the original result of the previous time, the original result of this time or the original result of the previous time is determined as the intention recognition result.

[0013] According to an embodiment of the present application, after performing intent recognition on the target sentence based on the second feature of this time and obtaining the original result of this time, the method further includes:

[0014] When the original result of this time is different from the original result of the previous time, the target sentence is subjected to the next slot filling and the next intent recognition.

[0015] According to an embodiment of the present application, the step of extracting features from the slot filling result to obtain the second feature includes:

[0016] Based on the entity category of each slot in the slot filling result, the slot is replaced with semantic type information corresponding to the entity category to obtain an abstract statement;

[0017] Perform feature extraction on the abstract sentence to obtain the second feature of this time.

[0018] According to an embodiment of the present application, the obtaining the current slot filling result based on the first feature and the previous second feature includes:

[0019] Performing feature fusion on the first feature and the second feature of the previous time to obtain a third feature;

[0020] Based on the third feature, the target sentence is slot-filled to obtain the slot-filling result.

[0021] According to an embodiment of the present application, the step of fusing the first feature with the previous second feature to obtain a third feature includes:

[0022] For each first element in the first feature, the second element corresponding to the first element in the previous second feature is merged with the first element to obtain the third feature; the number of first elements included in the first feature and the number of second elements included in the second feature are the same, and the first elements correspond to the second elements one-to-one.

[0023] In a second aspect, the present application provides a query semantic parsing device, the device comprising:

[0024] A first feature extraction module, used to extract features from the target sentence to obtain a first feature;

[0025] A first acquisition module, used for acquiring a slot filling result of this time based on the first feature and the second feature of the previous time;

[0026] A second feature extraction module is used to extract features from the slot filling result to obtain the second feature;

[0027] The second acquisition module is used to obtain the intention recognition result of the target sentence based on the second feature of this time.

[0028] According to the query semantic parsing device of the present application, the result of the slot filling task is passed back to the intent recognition task, and the result of the intent recognition task is fed back to the slot filling task, so as to realize two-way information interaction, so that slot filling and intent recognition are no longer isolated tasks, but can enhance each other through the slot filling task and the intent recognition task, overcome the problem of error propagation in the traditional pipeline model, reduce the risk of error propagation, significantly improve the overall semantic parsing effect, improve the accuracy of entity recognition, slot filling and intent recognition, and improve the overall accuracy of semantic parsing. In addition, by improving the accuracy of intent recognition and slot filling, the situation of misunderstanding of user requests can be greatly reduced, the response speed and accuracy of the system can be improved, and the user experience can be improved. Especially in scenarios such as subway inquiries, fast and accurate responses are crucial to improving user satisfaction.

[0029] In a third aspect, the present application provides an electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the query semantic parsing method as described in the first aspect above is implemented.

[0030] In a fourth aspect, the present application provides a non-transitory computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the query semantic parsing method as described in the first aspect above.

[0031] In a fifth aspect, the present application provides a chip, comprising a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run a program or instruction to implement the query semantic parsing method as described in the first aspect.

[0032] In a sixth aspect, the present application provides a computer program product, including a computer program, which, when executed by a processor, implements the query semantic parsing method as described in the first aspect above.

[0033] Additional aspects and advantages of the present application will be given in part in the description below, and in part will become apparent from the description below, or will be learned through the practice of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0034] The above and / or additional aspects and advantages of the present application will become apparent and easily understood from the description of the embodiments in conjunction with the following drawings, in which:

[0035] Figure 1 This is one of the flowcharts of the query semantic parsing method provided in the embodiment of the present application;

[0036] Figure 2 is a schematic diagram of a class abstraction mechanism provided in an embodiment of the present application;

[0037] Figure 3 It is a schematic diagram of the framework of the semantic parsing model provided in the embodiment of the present application;

[0038] Figure 4 This is the second flow chart of the query semantic parsing method provided in the embodiment of the present application;

[0039] Figure 5 is a structural diagram of a query semantic parsing device provided in an embodiment of the present application;

[0040] Figure 6 It is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0041] The following will be combined with the drawings in the embodiments of the present application to clearly describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments in the present application belong to the scope of protection of this application.

[0042] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described here, and the objects distinguished by "first", "second", etc. are generally of one type, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.

[0043] In the related art, the specific process of semantic parsing by the semantic parsing system generally includes two aspects: on the one hand, the features of the voice or text input by the user are analyzed through a pre-trained intent recognition model, and the voice or text input by the user is mapped to a predefined intent type to determine the task the user wants to perform (such as querying tickets or planning routes, etc.); on the other hand, the entities (such as place, time or fare, etc.) in the voice or text input by the user are extracted through a pre-trained entity recognition and slot filling model, and the above entities are filled into the corresponding slots (such as departure place, destination point or time, etc.), and the entities are accurately matched and corrected in combination with the domain dictionary.

[0044] Although the semantic parsing system in the related art relies on pre-trained models and domain dictionaries to improve recognition accuracy, it still has the following shortcomings.

[0045] First, the ability to handle new or unseen entities is limited. The relevant technology has poor adaptability to unseen entities, cannot cope with this situation flexibly, and is prone to errors. Suppose the user inputs: "How much is the ticket from Diejiao to Huangcun?". If "Diejiao" is a newly added subway station, and the entity recognition and slot filling model has never seen this station name during the training process, the semantic parsing system may not be able to recognize that "Diejiao" is a place entity. The entity recognition and slot filling model will mislabel "Diejiao" as other entities (such as facilities or commodities), which will affect the judgment of the overall intent, causing the system to fail to recognize that this is a ticket query question, resulting in intent recognition errors.

[0046] The second is reliance on domain dictionaries. The semantic parsing system over-relies on domain dictionaries for entity matching and correction, which limits the generalization ability of the model. If the domain dictionary is not updated in a timely manner, newly added entities or colloquial words cannot be processed correctly, making it difficult for the semantic parsing system to identify the user's actual intentions and prone to errors.

[0047] The third is the independence of intent recognition and entity recognition. The semantic parsing system performs intent recognition and entity recognition tasks by two independent models, lacking information interaction between them. If the entity recognition is wrong, the intent recognition model cannot correct the judgment based on the feedback of entity recognition, and vice versa. This model makes it easier for errors to propagate in different steps, accumulate and affect the overall semantic parsing results.

[0048] The following, in conjunction with the accompanying drawings, describes in detail the query semantic parsing method, query semantic parsing device, electronic device and readable storage medium provided in the embodiments of the present application through specific embodiments and their application scenarios.

[0049] The query semantic parsing method may be applied to a terminal, and may be specifically executed by hardware or software in the terminal.

[0050] The terminal includes, but is not limited to, a portable communication device such as a mobile phone or tablet computer with a touch-sensitive surface (e.g., a touch screen display and / or a touch pad). It should also be understood that in some embodiments, the terminal may not be a portable communication device, but a desktop computer with a touch-sensitive surface (e.g., a touch screen display and / or a touch pad).

[0051] In the following various embodiments, a terminal including a display and a touch-sensitive surface is described. However, it should be understood that the terminal may include one or more other physical user interface devices such as a physical keyboard, a mouse and a joystick.

[0052] The query semantic parsing method provided in the embodiment of the present application may be executed by an electronic device or a functional module or functional entity in the electronic device that can implement the query semantic parsing method. The electronic devices mentioned in the embodiment of the present application include but are not limited to mobile phones, tablet computers, computers, cameras, wearable devices, etc. The query semantic parsing method provided in the embodiment of the present application is described below using an electronic device as an example of the execution subject.

[0053] like Figure 1 As shown, the query semantic parsing method includes: step 110, step 120, step 130 and step 140.

[0054] Step 110: extract features from the target sentence to obtain a first feature.

[0055] In actual implementation, the query semantic parsing method provided in the embodiment of the present application can be applied to scenarios such as query systems, intelligent question-answering systems or voice assistants, and is particularly suitable for the parsing of query semantics in rail transit (such as subway or train operating systems, etc.).

[0056] The target sentence may be a sentence in speech or text input by the user.

[0057] In some embodiments, step 110 may be performed based on a common entity recognition and slot filling model. The target sentence may be subjected to feature extraction through the common entity recognition and slot filling model to extract global context features, thereby obtaining the first feature.

[0058] In some embodiments, the first feature refers to an initial encoding feature of the target sentence, which can generally be generated by a pre-trained language model (such as BERT) or other feature extraction methods.

[0059] In some embodiments, the first feature may be a model for performing a slot filling task, based on features extracted from the target sentence.

[0060] Step 120: Based on the first feature and the second feature of the previous time, obtain the current slot filling result.

[0061] In actual execution, the slot filling task (SF) and the intent detection (ID) task can be combined based on an iterative mechanism.

[0062] The slot filling task and the intent recognition task are combined. Specifically, during the slot filling task, the entity and slot information in the target sentence are extracted based on the first feature and the second feature obtained during the last intent recognition task (i.e., "the second feature of the last time"), and the extracted entities are filled into the corresponding slots to obtain the slot filling result of this time.

[0063] It should be noted that the basic process of implementing step 120 is similar to the basic process of performing slot filling tasks in related technologies. Entity and slot information can be extracted through entity recognition and slot filling models. The difference is that in the embodiment of the present application, the first feature and the previous second feature are combined to extract entity and slot information.

[0064] It is understandable that the slot filling result needs to comply with a predefined slot label set.

[0065] It should be noted that the second feature may be a new feature extracted based on the result of the slot filling task. In the case of combining the type abstraction mechanism, the second feature may be the encoded representation of the target sentence after the type abstraction mechanism.

[0066] In some embodiments, the first feature may be a model for performing an intent recognition task, a feature extracted based on a slot filling result.

[0067] The first feature processes the original sentence, while the second feature is the sentence representation after type abstraction, and the interaction effect between the two can be continuously optimized through an iterative mechanism.

[0068] Step 130: extract features from the current slot filling result to obtain the second feature of this time.

[0069] In actual implementation, step 130 may be performed based on a common intent recognition model. The common intent recognition model may be used to extract features from the slot filling result, thereby obtaining the second feature of this time.

[0070] In some embodiments, the second feature may include at least one of the following types of features: slot category features, slot context features, and global semantic features. The number of slot category features, slot context features, and global semantic features can be at least one. The slot category feature can be an abstract representation of the slot label; the slot context feature is used to describe the association information between the slot vocabulary and the context; the global semantic feature is used to describe the overall sentence semantics based on the slot abstract result.

[0071] Step 140: Based on the second feature of this time, obtain the intention recognition result of the target sentence.

[0072] In actual execution, the intent recognition model can be used to recognize the intent of the target sentence based on the second feature, thereby obtaining the intent recognition result of the target sentence.

[0073] In some embodiments, the second feature may include at least one of a slot category feature, a slot context feature, and a global semantic feature. The number of slot category features, slot context features, and global semantic features can be at least one. The slot category feature is an abstract representation of the slot label, which can be used to indicate the features of the slot category; the slot context feature can be used to indicate the features of the association information between the slot vocabulary and the context; the global semantic feature can be used to indicate the features of the overall sentence semantics based on the slot abstract result.

[0074] It should be noted that a two-way information interaction mechanism is adopted in the embodiment of the present application, including a slot filling to intent detection (S2I) mechanism and an intent detection to slot filling (I2S) mechanism.

[0075] The slot-to-intent mechanism refers to the process of identifying specific slots by annotating the input target sentence at the word level during the execution of the slot filling task. For example, for the target sentence "How do I get from Gangding to Huangcun?", the slot filling model can identify the entity "Gangding" and mark it as the starting point (startLoc), and identify the entity "Huangcun" and mark it as the destination point (endLoc). The slot filling results can include the annotation of specific entity types (such as "starting point" and "destination point"). The slot filling results can be passed to the intent recognition model through the feature fusion mechanism as an important context clue.

[0076] It should be noted that for slot labels that have appeared in the training data, the model can accurately identify them through the learned semantic representation and contextual rules; for slot labels that have not been seen during training, the model cannot directly identify them because it lacks learning experience about these labels.

[0077] The intention-to-slot mechanism refers to the process of inferring the user's overall intention and generating the intention recognition result by summarizing the global context information of the target sentence (which can be represented by the second feature) during the execution of the intention recognition task. The second feature extracted by the intention recognition process can also be passed back to the slot filling model through the feature fusion mechanism. The second feature extracted by the intention recognition process can help the slot filling task to more accurately judge certain uncertain slots. For example, the intention recognition task has clearly determined that the user's query is related to "fare inquiry", so when the slot filling model marks information such as location or price, it can correct the ambiguous slots according to this global intent (which can be reflected by the second feature), thereby improving the accuracy of slot filling.

[0078] It should be noted that the confidence of a slot identified by the slot filling model may not be high, but the second feature extracted by the intent recognition based on the slot recognition result with low confidence will be fused with the first feature extracted by the slot filling model in the next iteration to obtain the third feature; in the next iteration, slot recognition will be performed again based on the third feature, and the integration of the second feature will help improve the confidence of the slot recognition. Through multiple iterations, the confidence of the slot filling model in the slot recognition result can be improved, and the recognition result can be more accurate.

[0079] Entity recognition is the recognition of entities in natural semantics, such as nouns and verbs, which have definite practical meanings and are generally entities. Entity recognition refers to identifying which entities are in a sentence, while intent recognition refers to the intent of the sentence, such as querying routes or asking for prices.

[0080] The core idea of ​​this mechanism of two-way information interaction is to enhance the interaction between the intent recognition task and the slot filling task through two-way information flow, so that they are not only independent tasks, but also can support and optimize each other, thereby improving the accuracy of the overall semantic parsing.

[0081] It should be noted that the embodiments of the present application can mainly solve the recognition errors that occur in the intention recognition and entity recognition when facing new entities during the semantic parsing process of the intelligent question and answer system (especially the rail transit inquiry system). In the case where there are new entities (such as newly opened subway stations or facilities) in the sentence input by the user, it is difficult for the above-mentioned system to accurately identify the above-mentioned new entities because it has not learned the relevant data, resulting in errors in semantic parsing. The processing capacity of the related technology for the above-mentioned new entities is insufficient, especially when the subway stations or lines are updated. The embodiments of the present application introduce a two-way interaction mechanism, which can improve the adaptability to unknown entities such as new sites, reduce dependence on domain dictionaries, and enhance generalization and error correction capabilities. The inquiry semantic parsing method provided in the embodiments of the present application can be applied to projects that require natural language processing, such as subway inquiry systems, intelligent question and answer systems, or voice assistants. Among them, the new entities can be entities that have not been learned by the above-mentioned system, that is, entities that are not included in the training data used in the training process of the system.

[0082] According to the query semantic parsing method provided in the embodiment of the present application, by transferring the result of the slot filling task back to the intent recognition task, and the result of the intent recognition task back to the slot filling task, two-way information interaction is achieved, so that slot filling and intent recognition are no longer isolated tasks, but can enhance each other through the slot filling task and the intent recognition task, which can overcome the problem of error propagation in the traditional pipeline model, reduce the risk of error propagation, significantly improve the overall semantic parsing effect, improve the accuracy of entity recognition, slot filling and intent recognition, and improve the overall accuracy of semantic parsing. In addition, by improving the accuracy of intent recognition and slot filling, the situation of misunderstanding user requests can be greatly reduced, the response speed and accuracy of the system can be improved, and the user experience can be improved. Especially in scenarios such as subway inquiries, fast and accurate responses are crucial to improving user satisfaction.

[0083] In some embodiments, based on the second feature of this time, the intention recognition result of the target sentence is obtained, including: based on the second feature of this time, the intention of the target sentence is recognized to obtain the original result of this time.

[0084] In actual execution, the intent recognition model can be used to recognize the intent of the target sentence based on the second feature of this time, and a result can be obtained first. The result can be the original result of this time.

[0085] When the original result of this time is the same as the original result of the previous time, the original result of this time or the original result of the previous time is determined as the intention recognition result.

[0086] In actual execution, after obtaining the original result of this time, the original result of this time may not be directly used as the final intention recognition result, but the original result of this time is compared with the original result of the previous time, and the subsequent processing steps are determined according to the comparison result.

[0087] If the original result this time is the same as the original result last time, it can be considered that there is no error in the execution results of the slot filling task and the intent recognition task, and the original result this time can be determined as the final intent recognition result, or the original result last time can be determined as the final intent recognition result.

[0088] According to the query semantic parsing method provided in the embodiment of the present application, through multiple rounds of iterative correction, when an error occurs in the initial intent recognition or slot filling, it can be corrected through subsequent iterations, which can avoid the error propagation and accumulation caused by the initial error, so that the results can be gradually optimized until the results of intent recognition tend to be consistent and the results of slot labeling tend to be consistent, thereby improving the reliability of entity recognition, slot filling and intent recognition, and improving the overall reliability of semantic parsing. In addition, by improving the reliability of intent recognition and slot filling, the situation of misunderstanding user requests can be greatly reduced, the response speed and accuracy of the system can be improved, and the user experience can be improved. Especially in scenarios such as subway inquiries, fast and accurate responses are crucial to improving user satisfaction.

[0089] In some embodiments, after performing intent recognition on the target sentence based on the second feature of this time and obtaining the original result of this time, the method also includes: when the original result of this time is different from the original result of the previous time, performing the next slot filling and the next intent recognition on the target sentence.

[0090] In actual execution, if the original result this time is the same as the original result last time, it can be regarded that there is an error in the execution result of the slot filling task and / or the intent recognition task. The final intent recognition result can be temporarily uncertain and the next iteration is performed, that is, the next slot filling and the next intent recognition are performed on the target sentence.

[0091] It should be noted that the next slot filling and the next intent recognition are performed on the target sentence, that is, steps 110 to 140 are re-executed or steps 120 to 140 are re-executed. In the process of re-executing step 120, the next slot filling result can be obtained based on the first feature and the second feature of this time.

[0092] In the case where the original result of this time is different from the original result of the previous time, the next slot filling and the next intent recognition of the target statement adopt an iterative correction method. The iterative correction method aims to continuously optimize the results of intent recognition and slot filling through multiple rounds of iteration, and avoid error propagation caused by incorrect initial recognition.

[0093] It can be understood that for the first execution of step 120, the second feature of the previous time can be regarded as empty or other fixed values. In some embodiments, for the first execution of step 120, the second feature of the previous time can be a randomly initialized vector, or a fixed initial value (such as a vector of all zeros) is used, etc.

[0094] It should be noted that at the beginning of the iteration (i.e., the first iteration), since there is no historical "second feature", initialization can be performed. In some embodiments, the "second feature" of the first time can use a randomly initialized vector, or a fixed initial value (such as a vector of all zeros). The above initialization method will not affect the effect of the entire process, because in subsequent iterations, through the slot filling result and new feature extraction, the vectors representing the first feature and the second feature of the previous time will gradually tend to be stable and truly reflect the context information of slot filling.

[0095] Based on the iterative correction mechanism, through multiple rounds of analysis, the errors in the initial recognition can be continuously optimized. For example, during the initial slot filling, "Diejiao" may be mislabeled as other entities (such as facilities or commodities, etc.). However, through iterative correction, in combination with the context of the entire sentence, it can be realized in the next iteration that "Diejiao" appears in the "from X to Y" structure and should be the "starting station" or "terminal station", thereby correcting the initial error and finally correctly identifying the user's intent as ticket query.

[0096] According to the inquiry semantic parsing method provided by the embodiments of the present application, through multiple rounds of iterative correction, when an error occurs in the initial intent recognition or slot filling, it can be corrected through subsequent iterations, which can avoid error propagation and accumulation caused by initial errors, and thus can gradually optimize the results until the results of intent recognition tend to be consistent and the results of slot annotation tend to be consistent, thereby improving the reliability of entity recognition, slot filling and intent recognition, and improving the overall reliability of semantic parsing. Moreover, by improving the reliability of intent recognition and slot filling, the situation of misunderstanding user requests can be greatly reduced, the response speed and accuracy of the system can be improved, and thus the user experience can be improved. Especially in scenarios such as subway inquiries, fast and accurate responses are crucial for improving user satisfaction.

[0097] In some embodiments, feature extraction is performed on the slot filling result to obtain the second feature, including: based on the entity category of each slot in the slot filling result, the slot is replaced with semantic type information corresponding to the entity category to obtain an abstract statement.

[0098] In actual execution, the trained entity recognition and slot filling model can be used to perform entity recognition and slot filling based on the first feature and the second feature of the previous time, identify all entities and all slots in the target sentence, and obtain the slot filling result of this time. The slot filling result of this time may include information of all entities and all slots in the target sentence.

[0099] After obtaining all entities and all slots in the target sentence, type abstraction processing can be performed to replace each entity with the semantic type of the entity, and fill the semantic type of the entity into the corresponding slot to obtain an abstract sentence. The semantic type of the entity can be general semantic type information.

[0100] For example, the target sentence input by the user is "How do I get from Gangding to Huangcun?"; the entity recognition and slot filling model is used to perform feature extraction, entity recognition and slot filling on the target sentence, and the slot words "Gangding" and "Huangcun" in the target sentence can be marked as type words "departure place" and "destination"; then, by using the type abstraction mechanism, the specific slot words "Gangding" and "Huangcun" are abstracted into place types to form an abstract sentence; the abstract sentence is used as the input of the intent recognition model and the user intent recognition task, which can reduce the interference of specific words on intent recognition.

[0101] Perform feature extraction on the abstract sentence to obtain the second feature of this time.

[0102] In actual execution, after obtaining the abstract sentence, the abstract sentence instead of the target sentence can be used as the input of the intent recognition model. The intent recognition model can extract features from the abstract sentence to obtain the second feature of this time.

[0103] It should be noted that, by adopting the type abstraction mechanism for type abstraction processing, a specific entity (such as the specific station name "Diejiao") can be abstracted into a general type, such as "starting station" or "terminal station". Figure 2The type abstraction mechanism is shown. After type abstraction processing, even if the intent recognition model has never seen the specific word "Diejiao", it can infer from the context that "Diejiao" is a location. For example, for the target sentence "How much is the ticket from Diejiao to Huangcun?", after type abstraction processing, it can be independent of the specific station names "Diejiao" and "Huangcun", and can infer that "Diejiao" and "Huangcun" are locations only based on the grammatical structure of the sentence and the pattern of "from X to Y", so as to correctly understand the user's intent as "query".

[0104] It should be noted that the role of the type abstraction mechanism is to replace the specific slot words in the target sentence with abstract type words through the results of slot filling (for example, the specific slot words "Diejiao" and "Huangcun" are correspondingly replaced with the abstract type words "starting station" and "terminal station"), so as to reduce the interference of redundant information in the slot on the intent recognition task.

[0105] In some embodiments, the implementation process of combining the type abstraction mechanism and the iterative correction method may include: an initial iteration step, a type abstraction step, an intent recognition step, and a correction step.

[0106] The initial iteration step may include: using the BERT (Bidirectional Encoder Representations from Transformers) model to encode the input target sentence, obtaining the hidden layer representation, and completing the initial slot filling task through feature fusion.

[0107] The type abstraction step may include: performing type abstraction on the target sentence according to the slot filling result to obtain a new abstract sentence.

[0108] The intent recognition step may include: using the type-abstracted sentence for intent recognition to generate the original result of this intent recognition.

[0109] The correction step may include: comparing the results of slot filling and intent recognition obtained in this iteration with the results obtained in the previous iteration. If they are the same, stop the iteration; if they are different, perform the next iteration until the results are stable or the maximum number of iterations is reached. The specific value of the maximum number of iterations is not limited in the embodiments of the present application.

[0110] According to the query semantic parsing method provided by the embodiment of the present application, by combining the semantic parsing model of the type abstraction mechanism and the iterative correction method, by abstracting the specific entities into general semantic types, not only can the dependence on specific entities be reduced, but also the model can be able to show better generalization ability when dealing with changes such as new subway stations or facility names, thereby improving the accuracy of semantic parsing. In addition, the type abstraction mechanism can also effectively handle spelling errors or colloquial expressions, further improving the fault tolerance of the system. Moreover, through the type abstraction mechanism, the dependence on the domain dictionary can be reduced. Traditional systems need to frequently update the domain dictionary to include the names of newly added sites or facilities, while the embodiment of the present application can process new entities without updating the domain dictionary through generalization processing and contextual reasoning, thereby greatly reducing the maintenance cost of the system and improving the adaptability to new scenarios. In addition, by introducing a type abstraction mechanism, an iterative correction method, and a two-way interaction mechanism, the system can improve its adaptability to new sites and unknown entities, reduce its reliance on domain dictionaries, enhance the system's generalization and error correction capabilities, improve the accuracy of intent recognition and slot filling, greatly reduce misunderstandings of user requests, and improve the system's response speed and accuracy, thereby improving user experience. Especially in scenarios such as subway inquiries, fast and accurate responses are crucial to improving user satisfaction.

[0111] In some embodiments, based on the first feature and the second feature of the previous time, the slot filling result of this time is obtained, including: performing feature fusion on the first feature and the second feature of the previous time to obtain a third feature.

[0112] In actual execution, the first feature and the previous second feature may be subjected to feature fusion processing, and the first feature and the previous second feature may be fused to obtain the third feature.

[0113] The embodiment of the present application does not limit the specific feature fusion processing method. For example, at least one of the feature fusion processing methods such as concatenation and corresponding element addition or multiplication can be used.

[0114] Based on the third feature, the slots of the target sentence are filled to obtain the slot filling result.

[0115] In actual execution, through the entity recognition and slot filling model, the entity can be recognized based on the third feature, and then the recognized entity is filled into the corresponding slot, so as to obtain the slot filling result of this time.

[0116] It can be understood that the third feature is characterized by including both the first feature extracted for slot filling and the second feature extracted for intent recognition.

[0117] According to the query semantic parsing method provided in the embodiment of the present application, by transferring the result of the slot filling task back to the intent recognition task, and the result of the intent recognition task back to the slot filling task, two-way information interaction is achieved, so that slot filling and intent recognition are no longer isolated tasks, but can enhance each other through the slot filling task and the intent recognition task, which can overcome the problem of error propagation in the traditional pipeline model, reduce the risk of error propagation, significantly improve the overall semantic parsing effect, improve the accuracy of entity recognition, slot filling and intent recognition, and improve the overall accuracy of semantic parsing. In addition, by improving the accuracy of intent recognition and slot filling, the situation of misunderstanding user requests can be greatly reduced, the response speed and accuracy of the system can be improved, and the user experience can be improved. Especially in scenarios such as subway inquiries, fast and accurate responses are crucial to improving user satisfaction.

[0118] In some embodiments, a first feature and a previous second feature are feature fused to obtain a third feature, including: for each first element in the first feature, a second element in the previous second feature corresponding to the first element is fused with the first element to obtain the third feature; the first feature includes the same number of first elements as the second feature includes, and the first elements correspond to the second elements one-to-one.

[0119] In actual implementation, the number of first elements included in the first feature and the number of second elements included in the second feature are the same. Each first element in the first feature corresponds to a unique second element in the second feature, and each second element in the second feature corresponds to a unique first element in the first feature. Any two first elements correspond to different second elements, and any two second elements correspond to different first elements.

[0120] Each first element in the first feature can be fused with its corresponding second element in the previous second feature to obtain each element in the third feature, thereby obtaining the third feature.

[0121] In some embodiments, the input may include a first feature, namely an initial encoded representation H of the target sentence X (which may be extracted by BERT or other encoders), and a second feature from the last iteration, namely an encoded representation H′ of the slot abstraction result.

[0122] Feature fusion includes concatenating or fusing the first feature H and the second feature H′ from the previous iteration to form a new feature vector, namely the third feature Hs. This fusion operation enables the current slot filling task to simultaneously refer to the basic features (H) of the target sentence and the abstract slot information (H′) obtained from the previous iteration.

[0123] Slot filling prediction can be performed based on the third feature Hs, and the fused feature Hs is input into the slot filling module to generate the slot filling result this time.

[0124] According to the query semantic parsing method provided in the embodiment of the present application, by transferring the result of the slot filling task back to the intent recognition task, and the result of the intent recognition task back to the slot filling task, two-way information interaction is achieved, so that slot filling and intent recognition are no longer isolated tasks, but can enhance each other through the slot filling task and the intent recognition task, which can overcome the problem of error propagation in the traditional pipeline model, reduce the risk of error propagation, significantly improve the overall semantic parsing effect, improve the accuracy of entity recognition, slot filling and intent recognition, and improve the overall accuracy of semantic parsing. In addition, by improving the accuracy of intent recognition and slot filling, the situation of misunderstanding user requests can be greatly reduced, the response speed and accuracy of the system can be improved, and the user experience can be improved. Especially in scenarios such as subway inquiries, fast and accurate responses are crucial to improving user satisfaction.

[0125] Combine the following Figure 3 , the framework of the semantic parsing model provided in the embodiment of the present application is explained. The query semantic parsing method provided in the embodiment of the present application uses an overall model that combines the entity recognition and slot filling model with the intent recognition model. It can be understood that the overall model is a semantic parsing model, which can include two sub-models: an entity recognition and slot filling model, and an intent recognition model.

[0126] Take the target sentence "How much does it cost to get from Diejiao to Huangcun?" as an example. The entity recognition and slot filling model can identify the entity "Diejiao" and mark it as the departure location (startLoc), and identify the entity "Huangcun" and mark it as the destination point (endLoc).

[0127] After the target sentence is processed by the encoder of the entity recognition and slot filling model, a corresponding hidden layer representation can be generated for each word in the target sentence to obtain the first feature (h1, etc. represents each first element); the first feature is fused with the second feature of the previous time (h1 ’ etc. represent the second elements, h1 and h1 ’ Corresponding, and so on), the third feature is obtained; then the slot filling prediction is performed based on the third feature through the Softmax layer of the entity recognition and slot filling model. The slot filling results can be marked with specific entity types (such as "departure point" and "destination point").

[0128] Then, the overall model can further abstract the above specific slots into more general semantic type information (such as "starting station" or "end station", etc.) through the type abstraction mechanism. Through the feature fusion mechanism, the abstracted type information is carried by the abstract sentence and passed to the intent recognition model as an important context clue.

[0129] After the abstract sentence is processed by the encoder of the intent recognition model, the hidden layer representation of each word in the abstract sentence (i.e., the second feature) is input into the Pooling and Softmax layers of the intent recognition model to generate the intent recognition result. This intent recognition result is also passed back to the slot filling model through the feature fusion mechanism (specifically, it can be achieved by passing the second feature this time). The intent recognition result can help the slot filling task to more accurately judge certain uncertain slots.

[0130] Combine the following Figure 4 , the implementation process of the query semantic parsing method provided in the embodiment of the present application is described. In some embodiments, a query semantic parsing method may include the following steps.

[0131] Step 410: Respond to the text input by the user.

[0132] The user can input the target sentence in text form.

[0133] Step 420: Encode the input text through the pre-trained BERT model to extract global context features.

[0134] The input text (i.e., the target sentence) can be encoded through the pre-trained BERT model to extract the global context feature, thereby obtaining the first feature.

[0135] Step 430: extract slot information from the text through a slot filling module.

[0136] The slot filling module may extract slot information in the target sentence based on the first feature to obtain a first slot filling result.

[0137] Step 440: Feedback the slot information to the intent recognition module using an iterative mechanism.

[0138] The first slot filling result can be transferred to the intention recognition module by using an iterative mechanism. It should be noted that the recognition result of the intention recognition module can be fed back to the slot filling module for the next slot filling.

[0139] Step 450: The intent recognition module performs classification based on the fused features and outputs the final intent.

[0140] The intent recognition module can classify according to the fusion features, and obtain the final intent, that is, the final intent recognition result, when conditions are met (for example, the results of two consecutive iterations are the same or the iterations reach the maximum number).

[0141] The present invention mainly solves the problem of recognition errors in intent recognition and entity recognition when facing new entities during semantic parsing in intelligent question and answer systems, especially subway inquiry systems. New entities (such as newly opened subway stations or facilities) are difficult to accurately identify because the system has not seen relevant data, resulting in errors in semantic parsing. The existing system has insufficient processing capabilities for these new entities, especially when subway stations or lines are updated. The present invention introduces a type abstraction mechanism, an iterative correction method, and combines a two-way interaction mechanism to improve the adaptability to new sites and unknown entities, reduce dependence on domain dictionaries, and enhance the system's generalization and error correction capabilities. This technology can be applied to subway inquiry systems, intelligent question and answer systems, voice assistants, and other projects that require natural language processing.

[0142] The query semantic parsing method provided in the embodiment of the present application can be executed by a query semantic parsing device. In the embodiment of the present application, the query semantic parsing device executing the query semantic parsing method is taken as an example to illustrate the query semantic parsing device provided in the embodiment of the present application.

[0143] The present application also provides a query semantic analysis device. Figure 5 As shown, the query semantic parsing device includes:

[0144] A first feature extraction module 510 is used to extract features from the target sentence to obtain a first feature;

[0145] A first acquisition module 520, configured to acquire a slot filling result based on the first feature and the second feature of the previous time;

[0146] The second feature extraction module 530 is used to extract features from the slot filling result to obtain the second feature.

[0147] The second acquisition module 540 is used to obtain the intention recognition result of the target sentence based on the second feature of this time.

[0148] According to the query semantic parsing device provided by the embodiment of the present application, the result of the slot filling task is reversely transmitted to the intent recognition task, and the result of the intent recognition task is reversely fed back to the slot filling task, so as to realize two-way information interaction, so that slot filling and intent recognition are no longer isolated tasks, but can enhance each other through the slot filling task and the intent recognition task, overcome the problem of error propagation in the traditional pipeline model, reduce the risk of error propagation, significantly improve the overall semantic parsing effect, improve the accuracy of entity recognition, slot filling and intent recognition, and improve the overall accuracy of semantic parsing. In addition, by improving the accuracy of intent recognition and slot filling, the situation of misunderstanding user requests can be greatly reduced, the response speed and accuracy of the system can be improved, and the user experience can be improved. Especially in scenarios such as subway inquiries, fast and accurate responses are crucial to improving user satisfaction.

[0149] In some embodiments, the second acquisition module 540 may include:

[0150] A first acquisition unit is used to perform intent recognition on the target sentence based on the second feature of this time, and obtain the original result of this time;

[0151] The determination unit is used to determine the current original result or the previous original result as the intention recognition result when the current original result is the same as the previous original result.

[0152] In some embodiments, the query semantic parsing device is also used to perform next slot filling and next intent recognition on the target sentence when the original result this time is different from the original result last time.

[0153] In some embodiments, the second feature extraction module 530 may be specifically used to:

[0154] Based on the entity category of each slot in the slot filling result, the slot is replaced with the semantic type information corresponding to the entity category to obtain the abstract sentence;

[0155] Perform feature extraction on the abstract sentence to obtain the second feature of this time.

[0156] In some embodiments, the first acquisition module 520 may include:

[0157] A feature fusion unit, used for fusing the first feature with the second feature of the previous time to obtain a third feature;

[0158] The second acquisition unit is used to fill the slots of the target sentence based on the third feature and obtain the slot filling result.

[0159] In some embodiments, the feature fusion unit may be specifically used for:

[0160] For each first element in the first feature, the second element corresponding to the first element in the previous second feature is merged with the first element to obtain the third feature; the number of first elements included in the first feature and the number of second elements included in the second feature are the same, and the first elements correspond to the second elements one by one.

[0161] The query semantic parsing device in the embodiment of the present application can be an electronic device, or a component in an electronic device, such as an integrated circuit or a chip. The electronic device can be a terminal, or it can be other devices other than a terminal. Exemplarily, the electronic device can be a mobile phone, a tablet computer, a laptop computer, a PDA, a car-mounted electronic device, a mobile Internet device (Mobile Internet Device, MID), an augmented reality (augmented reality, AR) / virtual reality (virtual reality, VR) device, a robot, a wearable device, an ultra-mobile personal computer (ultra-mobile personal computer, UMPC), a netbook or a personal digital assistant (personal digital assistant, PDA), etc., and can also be a server, a network attached storage (Network Attached Storage, NAS), a personal computer (personal computer, PC), a television (television, TV), a teller machine or a self-service machine, etc., which is not specifically limited in the embodiment of the present application.

[0162] The query semantic parsing device in the embodiment of the present application may be a device having an operating system. The operating system may be an Android operating system, an iOS operating system, or other possible operating systems, which are not specifically limited in the embodiment of the present application.

[0163] The query semantic parsing device provided in the embodiment of the present application can achieve Figures 1 to 4 To avoid repetition, the various processes implemented by the method embodiment are not described here.

[0164] In some embodiments, Figure 6 As shown, an embodiment of the present application also provides an electronic device 600, including a processor 610, a memory 620, and a computer program stored in the memory 620 and executable on the processor 610. When the program is executed by the processor 610, each process of the above-mentioned query semantic parsing method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be described here.

[0165] It should be noted that the electronic devices in the embodiments of the present application include the mobile electronic devices and non-mobile electronic devices mentioned above.

[0166] An embodiment of the present application also provides a non-transitory computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the various processes of the above-mentioned query semantic parsing method embodiment are implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.

[0167] The processor is the processor in the electronic device described in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a computer read-only memory ROM, a random access memory RAM, a magnetic disk or an optical disk.

[0168] An embodiment of the present application also provides a computer program product, including a computer program, which implements the above-mentioned query semantic parsing method when executed by a processor.

[0169] The processor is the processor in the electronic device described in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a computer read-only memory ROM, a random access memory RAM, a magnetic disk or an optical disk.

[0170] An embodiment of the present application further provides a chip, which includes a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run programs or instructions to implement the various processes of the above-mentioned query semantic parsing method embodiment, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.

[0171] It should be understood that the chip mentioned in the embodiments of the present application can also be called a system-level chip, a system chip, a chip system or a system-on-chip chip, etc.

[0172] It should be noted that, in this article, the terms "comprise", "include" or any other variant thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise one..." do not exclude the presence of other identical elements in the process, method, article or device including the element. In addition, it should be pointed out that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in reverse order according to the functions involved, for example, the described method may be performed in an order different from that described, and various steps may also be added, omitted, or combined. In addition, the features described with reference to certain examples may be combined in other examples.

[0173] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a computer software product, which is stored in a storage medium (such as ROM / RAM, a disk, or an optical disk), and includes a number of instructions for a terminal (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present application.

[0174] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.

[0175] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "illustrative embodiments", "examples", "specific examples", or "some examples" means that the specific features, structures, materials, or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials, or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.

[0176] Although the embodiments of the present application have been shown and described, those skilled in the art will appreciate that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present application, and that the scope of the present application is defined by the claims and their equivalents.

Claims

1. A query semantic parsing method, characterized in that: include: Extract features of the target sentence to obtain the first feature; Based on the first feature and the second feature of the previous time, obtain the slot filling result of this time; Perform feature extraction on the slot filling result of this time to obtain the second feature of this time; Based on the second feature of this time, an intent recognition result of the target sentence is obtained.

2. The query semantic parsing method according to claim 1, characterized in that: The obtaining of the intention recognition result of the target sentence based on the second feature includes: Based on the second feature of this time, perform intent recognition on the target sentence to obtain the original result of this time; When the original result of this time is the same as the original result of the previous time, the original result of this time or the original result of the previous time is determined as the intention recognition result.

3. The query semantic parsing method according to claim 2, characterized in that: After performing intent recognition on the target sentence based on the second feature of this time and obtaining the original result of this time, the method further includes: When the original result this time is different from the original result last time, the target sentence is subjected to the next slot filling and next intent recognition.

4. The query semantic parsing method according to claim 1, characterized in that: The extracting features of the slot filling result to obtain the second feature includes: Based on the entity category of each slot in the slot filling result, the slot is replaced with semantic type information corresponding to the entity category to obtain an abstract statement; Feature extraction is performed on the abstract sentence to obtain the second feature of this time.

5. The query semantic parsing method according to any one of claims 1 to 4, characterized in that: The obtaining the slot filling result based on the first feature and the second feature of the previous time includes: Performing feature fusion on the first feature and the second feature of the previous time to obtain a third feature; Based on the third feature, the target sentence is slot-filled to obtain the slot-filling result.

6. The query semantic parsing method according to claim 5, characterized in that: The step of fusing the first feature with the previous second feature to obtain a third feature includes: For each first element in the first feature, the second element corresponding to the first element in the previous second feature is merged with the first element to obtain the third feature; the number of first elements included in the first feature and the number of second elements included in the second feature are the same, and the first elements correspond to the second elements one-to-one.

7. A query semantic analysis device, characterized in that: include: A first feature extraction module, used to extract features from the target sentence to obtain a first feature; A first acquisition module, used for acquiring the current slot filling result based on the first feature and the previous second feature; A second feature extraction module is used to extract features from the slot filling result to obtain the second feature; The second acquisition module is used to obtain the intention recognition result of the target sentence based on the second feature of this time.

8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the query semantic parsing method according to any one of claims 1 to 6 is implemented.

9. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the query semantic parsing method as described in any one of claims 1 to 6 is implemented.

10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the query semantic parsing method according to any one of claims 1 to 6 is implemented.