Intention recognition and slot filling method and device based on cross-library multi-table association query
By combining deep classification and graph neural networks with keyword clustering, the problems of intent recognition and slot filling in multi-table join queries are solved, improving the accuracy of intent recognition and entity extraction and enhancing the stability of database queries.
Patent Information
- Application Number
- CN202210855453.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-07-08
- Publication Date
- 2026-01-23
- Estimated Expiration
- 2042-07-08
AI Technical Summary
Existing intent recognition models struggle to dynamically adjust when dealing with multi-table relationships across different databases and tables, leading to difficulties in data association and reduced accuracy in search queries.
A deep classification model is used for primary domain classification, a threshold is set for credibility judgment, a graph neural network is used for domain inference, and keyword clustering and similarity matching are used for secondary domain classification and data table association to identify user intent and fill slots.
It improves the accuracy of intent recognition and entity extraction, enhances the accuracy of database queries, and reduces sensitivity to data changes.
Smart Images

Figure CN115114383B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of natural language processing and search technology, and in particular to a method and apparatus for intent recognition and slot filling based on cross-database multi-table association queries. Background Technology
[0002] Intent recognition models are one of the most commonly used AI technologies in modern enterprise products. They are frequently used in human-computer interaction to identify users' true intentions and search for and recommend corresponding responses and strategies based on those intentions. Currently, the intentions in commonly used intent recognition models are usually set initially for specific business scenarios and are difficult to change afterward. Furthermore, as data increases, it is often stored in different databases and tables, making standardization and unification difficult. This increases the difficulty of data association and dynamic slot filling, reducing the accuracy of search queries. Summary of the Invention
[0003] To address the aforementioned technical problems, the present invention aims to provide a method and apparatus for intent recognition and slot filling based on cross-database multi-table association queries. This method can, to a certain extent, reduce the strong dependence of training on data, extract user intent and entity information, and perform intent recognition and slot filling based on the association information of databases, data tables, and fields, thereby improving the accuracy and reliability of intelligent search.
[0004] The objective of this invention is achieved through the following technical solution:
[0005] An intent recognition and slot filling method based on cross-database multi-table join queries includes:
[0006] Step 101 uses a deep classification model to perform primary domain classification;
[0007] Step 102 sets a threshold and uses the set threshold to determine the credibility of the first-level domain;
[0008] Step 103: When the maximum domain probability value in the first-level domain classification is less than the threshold, the above information kernel-based graph neural network prediction strategy is used for domain inference.
[0009] Step 104 maps and associates the domain with its corresponding system to obtain the database system corresponding to the user intent;
[0010] Step 105 uses keyword clustering to classify the topics of the data table, i.e., secondary domain classification;
[0011] Step 106 performs keyword similarity determination and secondary neighborhood threshold determination on the categories obtained through clustering;
[0012] Step 107 uses a keyword proportion strategy to reason, and when the number of matching keywords is the same, selects the area with fewer keywords as the prediction area;
[0013] Step 108 links the secondary domains to the table names in the database;
[0014] Step 109 identifies the user's true intent and classifies the intent categories using similarity matching;
[0015] Step 110 involves associating the identified intent with the data table fields and obtaining the aggregation method;
[0016] Step 111: Dynamically extract field information from the topic table and related tables, that is, extract entity information from the question text and associate the entity information with the data table fields;
[0017] Step 112 involves verifying and correcting the extracted fields against the entities in the database, i.e., entity linking; and
[0018] Step 113: Fill the extracted information and the obtained aggregation method into the corresponding slots.
[0019] An intent recognition and slot filling device based on cross-database multi-table join queries, comprising:
[0020] The primary domain classification module uses a deep learning model to classify primary domains.
[0021] The first-level threshold determination module sets a threshold and uses the set threshold to determine the credibility of the domain.
[0022] The first-level domain reasoning module is used to perform domain reasoning by adopting a strategy based on graph neural network prediction using the above information kernel when the maximum domain probability value of the first-level domain module is less than the threshold.
[0023] The system association module is used to map and associate primary domains with their corresponding systems to obtain the data system corresponding to the user's intent;
[0024] The secondary domain classification module uses keyword clustering to classify the topics of the data table;
[0025] The secondary threshold determination module performs keyword similarity determination on the categories obtained through clustering. When the similarity reaches the threshold, the clustering result is valid.
[0026] The secondary domain reasoning module uses a keyword proportion strategy for reasoning, and when the number of matching keywords is the same, it selects the domain with fewer of its own keywords as the prediction domain;
[0027] The data table association module is used to link secondary domains with table names in the database;
[0028] The intent recognition module is used to identify the user's true intent and classify the intent categories using similarity matching.
[0029] The field association module is used to associate the identified intent with data table fields and obtain the aggregation method;
[0030] The field information dynamic extraction module dynamically extracts field information from the topic table and related tables, extracts entity information from the question text, and associates the entity information with the data table fields;
[0031] The entity linking module is used to verify and correct the extracted fields against the entities in the database;
[0032] The slot filling module is used to fill the extracted information and the obtained aggregation method into the corresponding slots.
[0033] Compared with the prior art, one or more embodiments of the present invention may have the following advantages:
[0034] It solves the problems of dynamic data changes, domain overlap, and text non-standardization in the process of text-to-multi-database and multi-table association queries, which lead to inaccurate intent recognition, entity extraction, and incomplete information, thereby improving the accuracy of intent recognition, entity recognition, and database query. Attached Figure Description
[0035] Figure 1 This is a flowchart of an embodiment of an intent recognition and slot filling method based on cross-database multi-table join queries;
[0036] Figure 2 This is a flowchart of an intent to identify an embodiment;
[0037] Figure 3 This is a flowchart illustrating an example of dynamic extraction of field information;
[0038] Figure 4 This is a flowchart of an example of entity linking. Detailed Implementation
[0039] To make the objectives, technical solutions, and advantages of the present invention clearer, the present invention will be described in further detail below with reference to the embodiments and accompanying drawings.
[0040] like Figure 1 The diagram shows a flowchart of an embodiment of an intent recognition and slot filling method based on cross-database multi-table join queries, including:
[0041] Step 101: Primary Domain Classification. Primary domain classification is performed through system registration, dividing the domains into 30 categories, including project investment, public resource transactions, social affairs, environmental protection, social assistance / minimum living allowance, and finance. The classification model is trained using log text annotation and neighborhood question answering. The primary domain classification module in this project uses a BERT-based classification model, fine-tuned using the training set to achieve the desired classification results. The primary domain classification model is not limited to a specific model; this module can employ supervised models such as machine learning and deep learning, and can also use clustering for classification.
[0042] When new data is registered in a primary domain, there is no need to retrain the model; domain identification can be performed directly. In a production environment, it is only necessary to register the corresponding system in the corresponding domain for classification, thereby avoiding model retraining.
[0043] Steps 102-103: Threshold Determination and Domain Inference. This module mainly supplements the domain determination in Step 101. Incomplete user input, insufficient available information, or even small differences within the domain can lead to incorrect domain determination. To avoid these problems, a threshold is manually set to judge domain credibility. When the maximum domain probability value of the first-level domain module is less than the threshold, domain inference is performed.
[0044] Neighborhood inference employs a strategy combining contextual information and graph neural network (GNN) prediction. First, it retrieves contextual domain information for a specified number of rounds from historical records. If all domain information is consistent, the current round is considered to be within the same domain. This module uses a round count of 5 for contextual domain inference. When contextual domain information is inconsistent, a GNN-based domain prediction strategy is employed. The model constructs a graph network with domains as nodes and uses the GNN and textual information to predict the domain for the next time step. Model training consists of two stages: training and fine-tuning. During training, a graph is constructed using people and time as dimensions for prediction of the next time step. During fine-tuning, a context window of length of 3 is used. Therefore, a window of length of 3 is used for neighborhood prediction during production prediction.
[0045] Step 104: System Association. Map and associate the domain with its corresponding systems, i.e., obtain the database system corresponding to the user's intent. To avoid the need for real-time model training when the database is expanded, the system is registered under its corresponding domain. Once the problem domain is determined, the corresponding system information within that domain can be obtained.
[0046] Step 105: Second-level domain classification. Second-level domains are sub-domains within a single system, and these sub-domains can overlap across different systems. For example, the legal entity database system includes sub-domains such as "Number of Enterprises," "Registered Capital of Enterprises," "Number of Individual Business Operators," and "Number of Public Institutions," and these sub-domains can dynamically increase as the data grows. Therefore, the second-level domain classification model uses keyword clustering for classification.
[0047] The second-level domains are thematic classifications of the data tables, meaning that the same data table within the same system can contain multiple themes. To avoid real-time training of the classification model when adding data tables, the second-level domain classification model uses keyword clustering for classification.
[0048] First, the question text and the topics of each domain are represented by word vectors, and then clustered using clustering methods to determine the topic information of the current question.
[0049] Steps 106-107: Threshold Determination and Domain Inference. The categories obtained through clustering are used to determine keyword similarity. When the similarity reaches a threshold, the clustering result remains valid. Otherwise, further inference is performed to determine the secondary domain. The similarity determination model uses the sentence-transformer model, which calculates semantic similarity to determine the degree of similarity between the clustered categories and the keywords in the question text. The similarity calculation model is not a fixed model; similarity calculation effects can be achieved using similar similarity models of the same type.
[0050] The inference strategy employs a keyword proportion strategy, meaning the domain with more matching keywords in the question but fewer keywords in the secondary domains is selected as the current question domain. For example, the keyword matching "number of male recipients of minimum living allowance in a certain province" in the secondary domains "Information Table of Recipients of Minimum Living Allowance" and "Income Information Table of Recipients of Minimum Living Allowance in 2020" is "recipients of minimum living allowance." However, the keywords for the secondary domain "Information Table of Recipients of Minimum Living Allowance" itself are "recipients of minimum living allowance" and "information table," while the keywords for "Income Information Table of Recipients of Minimum Living Allowance in 2020" are "recipients of minimum living allowance," "information table," "income," and "2020." Therefore, when the number of matching keywords is the same, the domain with fewer matching keywords is selected as the prediction domain.
[0051] Step 108: Data Table Linking. The second-level domains are linked to table names in the database, with a 1:n relationship. For example, the second-level domains "Enterprise Registered Capital" and "Number of Enterprises" both correspond to the table "Enterprise Main Table_View". Different data tables can be divided into multiple domains, and domain names can be repeated across different systems. In production use, simply register the domain name with the second-level domain, and the model can directly call it, thus avoiding secondary training of the model.
[0052] Step 109: Intent Recognition. Intent recognition identifies the user's true intent, where the intent category is dynamically changing. Therefore, the intent category sources include secondary domain labels, the clustering method of secondary domain labels, the various fields corresponding to all data tables under the secondary domain, the clustering method of the various fields corresponding to all data tables under the secondary domain, and other user intents in the question text. For example, the intent corresponding to the total amount of registered capital of all legal entities in the legal entity database is the SUM clustering of the amount field. The intent recognition model uses similarity matching for classification, and the category with the highest score reaching a specified threshold is the designated category. When there is no specific intent, the model uses rule templates and syntactic analysis to extract the user intent.
[0053] like Figure 2 As shown, when a user inputs text, the intent recognition module first performs template matching. Template matching can quickly and accurately identify simple, general user intents. When template matching fails to identify the user intent, the model proceeds to the similarity calculation module. The text is segmented using a sliding window, and the similarity is calculated between each segment and a dynamic intent lexicon. When the similarity reaches a specified threshold, the user's true intent is obtained. Intent extraction based on a sliding window and a dynamic lexicon avoids the need for secondary model training when dynamically adding data. The similarity calculation model uses a sentence-transformer model, trained on a general dataset, and then applied to downstream similarity calculations. When the similarity fails to reach the threshold, the model uses syntactic analysis to extract the user intent.
[0054] Step 110: Associate the intent with the data table fields. Associate the identified intent with the table field information and obtain the aggregation method. Simultaneously, based on the field association information, further verify the system and data table information. Since intent recognition serves the search query engine, when the intent recognition result cannot be associated with the data table, the intent recognition lacks its true intent. Therefore, data tables where no matching fields can be found are discarded.
[0055] Step 111: Dynamic Extraction of Field Information from the Main Table and Related Tables. Dynamic extraction of field information from the main table and related tables involves extracting entity information from the question text and associating this entity information with data table fields. Information extraction mainly includes the extraction of basic entities and the dynamic extraction of data table fields. Basic entity extraction uses a pre-trained entity recognition model. This model can identify common entity information in the question, such as people, time, location, organization, quantity, etc. Extraction of field information from the main table and related tables involves extracting information from each field in the data table. Specifically, it involves obtaining the field names to be extracted from the main table and related tables, and then extracting information using the corresponding extraction strategies for each field. For example, the field "Disability" extracts the disability level "Level 1 Disability" according to a pre-set rule template or model, and the field "Gender" extracts gender features according to a pre-set rule template or model.
[0056] like Figure 3 As shown, the user text input model for the main table and related table field information dynamic extraction first performs entity recognition. This entity recognition model can identify common entity types. It is a general-purpose model, meaning that the trained model does not need to be retrained for new data, reducing recognition errors caused by data changes in a production environment. The entity recognition model uses a BERT+CRF neural network model, and the entity categories include 20 types such as people, time, location, organization, and quantity. However, the entity recognition model is not limited to BERT+CRF; any entity recognition model can achieve the same effect. Finally, the entity types identified by the entity recognition model are matched with the data table fields to complete the association between entities and fields.
[0057] Retrieve the field names and data types corresponding to the main data table. Extract entities from special fields based on a predefined template. For example, the enterprise field is "Registered?", and its data type is boolean, so matching based on the template is necessary. For enterprise IDs, entity recognition and similarity calculations are difficult to use for extraction, so regular expression matching is used.
[0058] When entity recognition and regular expression matching fail to extract feature information, the model uses similarity matching. The model constructs a BK Tree data structure and uses a sliding window to perform similarity matching, thereby extracting the corresponding entity information.
[0059] Step 112: Entity Linking. Entity linking involves verifying and correcting the extracted fields against the entities in the database. For example, if the extracted field for "gender" is "male" and the database stores "male", the model will change the entity information from "male" to "male". Similarly, if the extracted field for "disability" is "level one disability" and the database stores "yes", the extracted field will be changed to "yes".
[0060] like Figure 4 As shown, the data types are first determined based on the data table and field names. For special field information, data type mapping is required. For example, if the field name is "Disability Status", and the identified entity is "Level 2 Disability", and the database stores the data as a boolean type, the extracted entity needs to be converted. For non-string entity links, data type determination is required. For example, if the field name is "Amount", and the data type is float, and the identified data is also float within a specified range, only data type matching is needed. For string entities, similarity calculation is required. When the similarity reaches a specified threshold, the entity is considered a linked entity of the extracted entity.
[0061] Step 113: Slot Filling. Slot filling involves filling the extracted system information, table information, field information, intent information, aggregation methods, etc., into the corresponding slots to further provide information support for retrieval queries.
[0062] This embodiment also provides an intent recognition and slot filling device based on cross-database multi-table association queries, including: a first-level domain classification module, which performs first-level domain classification using a deep learning model; a first-level threshold determination module, which sets a threshold and determines the domain credibility based on the set threshold; a first-level domain inference module, which performs domain inference using a strategy based on graph neural network prediction with the above information kernel when the maximum domain probability value of the first-level domain module is less than the threshold; a system association module, which maps and associates the domain with its corresponding system to obtain the data system corresponding to the user intent; a second-level domain classification module, which classifies the data table topics using keyword clustering; a second-level threshold determination module, which determines the keyword similarity of the categories obtained through clustering, and the clustering result is valid when the similarity reaches the threshold; and a second-level domain inference module. The module employs a keyword proportion strategy for inference, and when the number of matching keywords is the same, it selects the domain with fewer of its own keywords as the prediction domain; the data table association module links secondary domains with table names in the database; the intent recognition module identifies the user's true intent and classifies the intent category using similarity matching; the field association module associates the identified intent with data table fields and obtains the aggregation method; the field information dynamic extraction module dynamically extracts field information from the topic table and association table, extracts entity information from the question text, and associates the entity information with data table fields; the entity linking module verifies and corrects the extracted fields with entities in the database; and the slot filling module fills the extracted information and obtained aggregation methods into the corresponding slots.
[0063] In the above embodiment, the intent recognition and slot filling device based on cross-database multi-table relational queries performs the following steps: First-level domain classification divides the domains and determines accuracy using thresholds; if the score fails to meet the threshold, domain inference is performed using an inference strategy; the acquired domains are then associated with the database system to obtain database information. Second-level domain classification further categorizes the domains within the system and confirms data categories using thresholds and domain inference; the acquired data categories are mapped to data tables to obtain data table information; the user's true intent is obtained using a specified intent category and intent recognition strategy, and the user's intent is associated with database field information. Simultaneously, database and data table corrections are performed on data that cannot be associated; fields are extracted from the acquired main table and related tables using a specified extraction strategy and model, and field values are checked and corrected through entity links; finally, the acquired system information, data table information, intent information, and field information are used to fill slots, providing data support for search queries.
[0064] The above-mentioned methods and apparatus can solve the problems of dynamic data changes, domain overlap, and text non-standardization leading to inaccurate intent recognition, entity extraction, and incomplete information in the process of text-to-multi-database and multi-table association query, thereby improving the accuracy of intent recognition, entity recognition, and database query.
[0065] While the embodiments disclosed in this invention are as described above, the content is merely for the purpose of facilitating understanding of the invention and is not intended to limit the invention. Any person skilled in the art to which this invention pertains may make any modifications and variations in form and detail of the implementation without departing from the spirit and scope disclosed herein; however, the scope of patent protection for this invention shall still be determined by the scope defined in the appended claims.
Claims
1. A method for intent recognition and slot filling based on cross-database multi-table join queries, characterized in that, Includes the following steps: Step 101 uses a deep classification model to perform first-level domain classification on the text input by the user; Step 102 sets a threshold and uses the set threshold to determine the credibility of the first-level domain; Step 103: When the maximum domain probability value in the first-level domain classification is less than the threshold, the above information kernel-based graph neural network prediction strategy is used for domain inference. Step 104 maps and associates the domain with its corresponding system to obtain the database system corresponding to the user intent; Step 105 uses keyword clustering to classify the topics of the data table, i.e., secondary domain classification; Step 106 performs keyword similarity determination on the categories obtained through clustering and then performs secondary domain threshold determination. Step 107 uses a keyword proportion strategy to reason, and when the number of matching keywords is the same, selects the area with fewer keywords as the prediction area; Step 108 links the secondary domains to the table names in the database; Step 109 identifies the user's true intent and classifies the intent categories using similarity matching; Step 110 involves associating the identified intent with the data table fields and obtaining the aggregation method; Step 111: Dynamically extract field information from the topic table and related tables, that is, extract entity information from the question text and associate the entity information with the data table fields; Step 112 involves verifying and correcting the extracted fields against the entities in the database, i.e., entity linking. as well as Step 113: Fill the extracted information and the obtained aggregation method into the corresponding slots.
2. The intent recognition and slot filling method based on cross-database multi-table join query as described in claim 1, characterized in that, In step 101, the primary domains are divided into project investment, public resource transactions, social affairs, environmental protection, social assistance / minimum living allowance, and finance, and the classification model is trained through log text annotation and domain question answering. The classification of the primary domain adopts a BERT-based classification model, which is fine-tuned using a training set to achieve classification.
3. The intent recognition and slot filling method based on cross-database multi-table join query as described in claim 1, characterized in that, The domain reasoning in step 103 specifically includes obtaining the preceding domain information of a specified round through historical records. When all domain information is consistent, the current round is considered to be a problem in the same domain. When the preceding domain information is inconsistent, a graph neural network domain prediction strategy is implemented.
4. The intent recognition and slot filling method based on cross-database multi-table join query as described in claim 1, characterized in that, In step 105, the keyword clustering method is used to classify the topics of the data table. This involves representing the question text and the topics of each domain with word vectors, and then clustering them using a clustering method to determine the topic information of the current question.
5. The intent recognition and slot filling method based on cross-database multi-table join query as described in claim 1, characterized in that, In step 106, when the keyword similarity reaches the threshold, the clustering result remains valid; the keyword similarity judgment adopts the sentence-transformer model, and the similarity between the clustered categories and the keywords of the question text is judged by semantic similarity calculation. In step 107, the keyword ratio strategy is to define the current question domain as the domain with the most matching keywords in the question but fewer keywords in the secondary domain.
6. The intent recognition and slot filling method based on cross-database multi-table join query as described in claim 1, characterized in that, The intent identification in step 109 specifically includes: Perform rule template matching based on the text entered by the user; When template matching fails to match the user intent, the text is segmented using a sliding window, and the similarity is calculated with the dynamic intent lexicon. When the similarity reaches a specified threshold, the user's true intent is obtained.
7. The intent recognition and slot filling method based on cross-database multi-table join query as described in claim 1, characterized in that, The dynamic extraction of field information in step 111 specifically includes: Perform entity recognition on the text entered by the user; The entity recognition model identifies the field name and data type using a BERT+CRF neural network model. The identified entity types are matched with the data table fields to complete the association between entities and fields.
8. The intent recognition and slot filling method based on cross-database multi-table join query as described in claim 1, characterized in that, The entity linking in step 112 specifically includes: Retrieve data type based on data table and field names; Data type mapping for special field information; For non-string entity links, the data type is determined and matched; for string entities, similarity is calculated, and when the similarity reaches a specified threshold, the entity is considered a link entity for the extracted entity.
9. An intent recognition and slot filling device based on cross-database multi-table join queries, characterized in that, include: The primary domain classification module uses a deep learning model to classify the text input by the user into a primary domain. The first-level threshold determination module sets a threshold and uses the set threshold to determine the credibility of the domain. The first-level domain reasoning module is used to perform domain reasoning by adopting a strategy based on graph neural network prediction using the above information kernel when the maximum domain probability value of the first-level domain module is less than the threshold. The system association module is used to map and associate primary domains with their corresponding systems to obtain the data system corresponding to the user's intent; The secondary domain classification module uses keyword clustering to classify the topics of the data table; The secondary threshold determination module performs keyword similarity determination on the categories obtained through clustering. When the similarity reaches the threshold, the clustering result is valid. The secondary domain reasoning module uses a keyword proportion strategy for reasoning, and when the number of matching keywords is the same, it selects the domain with fewer of its own keywords as the prediction domain; The data table association module is used to link secondary domains with table names in the database; The intent recognition module is used to identify the user's true intent and classify the intent categories using similarity matching. The field association module is used to associate the identified intent with data table fields and obtain the aggregation method; The field information dynamic extraction module dynamically extracts field information from the topic table and related tables, extracts entity information from the question text, and associates the entity information with the data table fields; The entity linking module is used to verify and correct the extracted fields against the entities in the database; The slot filling module is used to fill the extracted information and the obtained aggregation method into the corresponding slots.
10. The intent recognition and slot filling device based on cross-database multi-table association query as described in claim 9, characterized in that, In the first-level domain reasoning module, the intention recognition and slot filling model constructs a sub-model of the reasoning module, namely a graph network, with domain nodes, and uses the graph neural network and text information to predict the domain at the next moment. The inference module sub-model training uses two nodes: training and fine-tuning. During training, a graph is constructed using people and time as dimensions to predict the next moment. When fine-tuning, the context window length is 3. Therefore, when making production predictions, a window length of 3 is used for neighborhood predictions.
Citation Information
Patent Citations
Legal consultation system based on legal semantic parts and document big data statistical analysis
CN110059193A
Intelligent information query method and device based on intention recognition, equipment and medium
CN113761206A