An intelligent question matching method and device based on a structured intent library
Patent Information
- Application Number
- CN202611173942.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-04
- Publication Date
- 2026-10-30
AI Technical Summary
[0002]现有的智能问数方法在面对企业级复杂业务时存在明显局限
[0021]本发明在结构化意图库预置了与业务直接对应的SQL模板、图表规范及分析框架,可实现直接对接原始库表,并成功生成复杂查询,实现了对复杂业务数据的直接适配与深度分析能力的统一,显著提升了复杂业务场景的适应性。另外,本发明通过预置分级SQL模板与多模态回答要素,实现了从简单查询到宏观分析报告的直接生成。
Smart Images

Figure CN123011950A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data query technology, and more specifically, to an intelligent question matching method and apparatus based on a structured intent database. Background Technology
[0002] Existing intelligent data query methods have significant limitations when dealing with complex enterprise-level business scenarios. First, when facing multi-source, heterogeneous production databases with non-standard table structures, deep and costly data governance is required before implementation. Second, for macro-level complex problems, existing intelligent data query methods have a low success rate when constructing complex SQL statements involving multi-table joins and nested subqueries, often failing to provide in-depth analysis due to parsing failures or query simplification. Finally, their answer formats are rigid, unable to dynamically provide differentiated and multi-dimensional answers based on user roles or question intent. These shortcomings make it difficult for intelligent data query methods to support the entire complex business decision-making process. Summary of the Invention
[0003] The purpose of this invention is to provide an intelligent question matching method and apparatus based on a structured intent library to improve the aforementioned problems. To achieve the above objective, the technical solution adopted by this invention is as follows:
[0004] Firstly, this application provides an intelligent question-count matching method based on a structured intent library, including:
[0005] Multiple intent data points are collected, and a structured intent library is constructed from these multiple intent data points; each intent data point includes semantic elements for semantic matching and structured content elements for content generation.
[0006] Obtain a pre-trained language model, and train the pre-trained language model using a contrastive learning approach based on the semantic elements in the structured intent library to obtain a trained intent matching model;
[0007] Using the trained intent matching model, a corresponding semantic vector is generated for each intent data in the structured intent library, and the semantic vector is associated with the corresponding intent data and stored in the structured intent library;
[0008] Obtain the user's natural language question, generate a semantic vector of the natural language question using the trained intent matching model, and match at least one reference intent data from the structured intent library based on the semantic vector;
[0009] The final answer is generated based on the structured content elements in the natural language question and the matched reference intent data.
[0010] Secondly, this application also provides an intelligent question-number matching device based on a structured intent library, comprising:
[0011] The building module is used to collect multiple intent data points and construct a structured intent library from these data points; each intent data point includes semantic elements for semantic matching and structured content elements for content generation.
[0012] The training module is used to obtain a pre-trained language model, and based on the semantic elements in the structured intent library, to train the pre-trained language model using a contrastive learning approach to obtain a trained intent matching model.
[0013] The vectorization module is used to generate a corresponding semantic vector for each piece of intent data in the structured intent library using the trained intent matching model, and to associate the semantic vector with the corresponding intent data and store it in the structured intent library.
[0014] The matching module is used to obtain the user's natural language question, generate a semantic vector of the natural language question using the trained intent matching model, and match at least one reference intent data from the structured intent library based on the semantic vector.
[0015] The generation module is used to generate a final answer based on the natural language question and the structured content elements in the matched reference intent data.
[0016] Thirdly, this application also provides an intelligent question-number matching device based on a structured intent library, comprising:
[0017] Memory, used to store computer programs;
[0018] A processor is configured to implement the steps of the intelligent question matching method based on a structured intent library when executing the computer program.
[0019] Fourthly, this application also provides a readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the above-described intelligent question matching method based on a structured intent library.
[0020] The beneficial effects of this invention are as follows:
[0021] This invention pre-configures SQL templates, chart specifications, and analysis frameworks directly corresponding to business needs within a structured intent library. This allows for direct integration with original database tables and successful generation of complex queries, achieving a unified capability for direct adaptation to complex business data and in-depth analysis, significantly improving adaptability to complex business scenarios. Furthermore, by pre-configuring hierarchical SQL templates and multimodal response elements, this invention enables the direct generation of reports ranging from simple queries to macro-level analysis reports.
[0022] Other features and advantages of the invention will be set forth in the following description, and will be apparent in part from the description, or may be learned by practicing embodiments of the invention. The objects and other advantages of the invention may be realized and obtained by means of the structures particularly pointed out in the written description, claims, and drawings. Attached Figure Description
[0023] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of the present invention and should not be regarded as a limitation on the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0024] Figure 1 This is a schematic diagram of the intelligent question matching method based on a structured intent library as described in an embodiment of the present invention;
[0025] Figure 2 This is a schematic diagram of the intelligent question matching device based on a structured intent library as described in an embodiment of the present invention;
[0026] Figure 3 This is a schematic diagram of the intelligent question matching device based on a structured intent library as described in an embodiment of the present invention.
[0027] Marked in the image:
[0028] 800. Intelligent question matching device based on structured intent library; 801. Processor; 802. Memory; 803. Multimedia component; 804. I / O interface; 805. Communication component. Detailed Implementation
[0029] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. The components of the embodiments of the present invention described and shown in the accompanying drawings can generally be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the claimed invention, but merely to illustrate selected embodiments of the invention. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without inventive effort are within the scope of protection of the present invention.
[0030] It should be noted that similar reference numerals and letters in the following figures indicate similar items; therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures. Furthermore, in the description of this invention, terms such as "first," "second," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.
[0031] Example 1:
[0032] This embodiment provides an intelligent question matching method based on a structured intent library.
[0033] See Figure 1 The figure shows that this method includes:
[0034] S1. Collect multiple intent data points and construct a structured intent library from them; each intent data point includes semantic elements for semantic matching and structured content elements for content generation.
[0035] Specifically, step S1 includes:
[0036] S11. Configure multiple intent data based on domain expert knowledge to form an initial structured intent library;
[0037] Specifically, the data analysis requirements for the target business scenarios are identified, including "fire early warning analysis," "monthly accident statistics," and "equipment inspection completion rate trends" in the field of production safety. For each data analysis requirement, experts manually compile a complete intent data entry according to a predefined structured framework.
[0038] Manually configured intents are stored as seed data in the database to form an initial structured intent library.
[0039] S12. Define each intent data item as containing semantic elements and structured content elements; wherein, the semantic elements include two fields, namely the original question text and the question interpretation text; the structured content elements include three fields, namely the query logic example, the visualization requirement description, and the analysis framework template, as shown in Table 1:
[0040] Table 1
[0041]
[0042] S13. Add, modify, or delete intent data in the structured intent library to obtain the final structured intent library, which includes N intent data entries.
[0043] Based on the above embodiments, this method further includes:
[0044] S2. Obtain a pre-trained language model, and train the pre-trained language model using a contrastive learning approach based on the semantic elements in the structured intent library to obtain a trained intent matching model;
[0045] Specifically, step S2 includes:
[0046] S21. Extract the original question text and question interpretation text from the structured intent library;
[0047] Specifically, each intent data record is read sequentially. For each record, the original question text and the question interpretation text stored under the semantic element field are extracted.
[0048] S22. Construct a semantically related positive sample text pair by combining the original question text and the question interpretation text of the same intent data. For example, construct a positive sample text pair by combining "Analysis of production situation in the third quarter" and "Query the output, pass rate and defect rate of each production line in the third quarter of 2025".
[0049] S23. Construct semantically unrelated negative sample text pairs by combining the original question texts and question interpretation texts of different intent data;
[0050] Specifically, random sampling is used to randomly select two different intent data from the structured intent database, and the "original question text" of one of them is combined with the "question interpretation text" of the other to form a text pair. For example, "Third quarter production situation analysis" is paired with "Query this month's financial budget execution progress..." to construct a negative sample text pair.
[0051] S24. A sample set is constructed from several positive sample text pairs and negative sample text pairs. In this embodiment, samples are taken from all positive sample pairs and negative sample pairs according to the set batch size, and combined into a batch sample set for model training. Each batch contains both positive sample pairs and negative sample pairs. The positive sample pairs are labeled with similarity label 1, and the negative sample pairs are labeled with dissimilarity label 0.
[0052] S25. Using the pre-trained Chinese language model as the base network, the base network is trained through comparative learning using the sample set.
[0053] Specifically, step S25 includes:
[0054] S251. Select BERT-base as the base network. The BERT-base has a dimension of 768 and contains 12 Transformer encoder layers.
[0055] S252. Input the sample set into the base model, calculate the cosine similarity between each positive sample pair, and optimize the network parameters through the loss function to reduce the distance between positive sample pairs and increase the distance between negative sample pairs.
[0056] S253. During training, the batch size was set to 32, the initial learning rate was 2e-5, and a linear warm-up strategy was adopted with a weight decay coefficient of 0.01. A total of 10 training rounds were conducted.
[0057] S26. Solidify the network parameters obtained after training into the intent matching model.
[0058] Based on the above embodiments, this method further includes:
[0059] S3. Using the trained intent matching model, generate a corresponding semantic vector for each intent data in the structured intent library, and associate the semantic vector with the corresponding intent data and store it in the structured intent library;
[0060] Based on the above embodiments, this method further includes:
[0061] S4. Obtain the user's natural language question, generate a semantic vector of the natural language question using the trained intent matching model, and match at least one reference intent data from the structured intent library based on the semantic vector;
[0062] Specifically, step S4 includes:
[0063] S41. Input the natural language question into the intent matching model to generate a first semantic vector;
[0064] S42. Calculate the similarity between the first semantic vector and all semantic vectors in the structured intent library to obtain the initial matching score for each candidate intent data:
[0065] ;
[0066] In the formula, Represents the first semantic vector and the second semantic vector. The similarity between semantic vectors and the initial assigned score;
[0067] S43. Extract keywords from the natural language question and use the keywords to calculate the keyword weight adjustment coefficient for each candidate intent data;
[0068] Specifically, step S43 includes:
[0069] S431. Perform word segmentation and domain entity recognition on the natural language problem to extract the keyword set K;
[0070] S432. Compare the semantic elements of the current candidate intent data with the keyword set to obtain matching keywords;
[0071] In this embodiment, the original question text and the question interpretation text in the candidate intent data are merged into a text to be compared;
[0072] Each keyword in keyword K is matched with the current candidate text using fuzzy synonym matching to obtain the current candidate text. Matching keywords .
[0073] S433. Query the preset domain terminology weight dictionary, sum the weight values corresponding to the matching keywords, and obtain the keyword weight adjustment coefficient of the current candidate intent.
[0074] Specifically, the domain terminology weight dictionary is stored in key-value pair format, where the key is a domain keyword and the value is a preset weight; preferably, the preset weight is set by domain experts based on business importance, for example:
[0075] ;
[0076] For matching keywords For each keyword in the keyword list, query the domain terminology weight dictionary to obtain the weight value corresponding to each keyword. Sum the weights of all keywords to obtain the keyword weight adjustment coefficient for the current candidate intent. :
[0077] ,in, ;
[0078] In the formula, Indicates the first One keyword, Indicates the first The weight value of each keyword.
[0079] S44. Construct a context graph between the natural language question and each candidate intent data, and calculate the context relevance score of each candidate intent data based on the context graph;
[0080] Specifically, step S44 includes:
[0081] S441. Extract the user question entity from the semantic elements of the natural language question and candidate intent data. and candidate intent entities and user problem relationship set Relationship set with candidate intent ;
[0082] S442. Construct a context graph using the extracted entities as nodes and relationships as edges;
[0083] Specifically, with As a node, with Construct a context graph with edges ;
[0084] S443. Based on the topological structure of the context graph, calculate the correlation between the natural language question and the candidate intent data, and use this as the context correlation score. :
[0085] ;
[0086] In the formula, A function representing the number of nodes in a subgraph; This represents the extracted relational subgraph.
[0087] S45. Based on the initial matching score, keyword weight adjustment coefficient, and contextual relevance score, obtain the final matching score for each candidate intent data:
[0088] ;
[0089] In the formula, The preset weighting coefficients, This indicates the final match score.
[0090] S46. Based on the final matching score, select at least one intent data from the candidate intent data as reference intent data;
[0091] Specifically, the final matching scores of the candidate intent data are sorted in descending order, and the three candidate intent data with the highest final matching scores are used as reference intent data.
[0092] Preferably, step S46 includes:
[0093] S461. Obtain the dynamic similarity threshold and select the highest matching score. With the dynamic similarity threshold Comparison:
[0094] Specifically, the dynamic similarity threshold is calculated in real time based on the difference between the feature distribution of the current user's question and the historical baseline distribution. The calculation formula is as follows:
[0095] ;
[0096] In the formula, Indicates the dynamic similarity threshold. Indicates the drift coefficient. It serves as an indicator of group stability.
[0097] when When, the automatic matching result is used. If this occurs, manual intervention will be triggered.
[0098] S462. When the highest matching score is lower than the dynamic similarity threshold, a manual intervention process is triggered, and the matching context information containing the natural language question, word segmentation results and candidate intent data is submitted to the expert review platform;
[0099] S463. Receive the calibration results from the expert review platform and determine the intent data corresponding to the calibration results as reference intent data.
[0100] Based on the above embodiments, this method further includes:
[0101] S5. Generate a final answer based on the structured content elements in the natural language question and the matched reference intent data;
[0102] Specifically, step S5 includes:
[0103] S51. Generate a structured query description for the current question based on the question interpretation text in natural language question and reference intent data;
[0104] S52. Based on the query logic examples in the query description and reference intent data, and combined with real-time database metadata, generate an executable SQL statement;
[0105] S53. Execute SQL statements to generate data results. Based on the data results and the visualization requirements described in the reference intent data, generate front-end visualization code and text analysis reports to form the final answer.
[0106] Example 2:
[0107] like Figure 2 As shown, this embodiment provides an intelligent question matching device based on a structured intent library. The device includes:
[0108] The building module is used to collect multiple intent data points and construct a structured intent library from these data points; each intent data point includes semantic elements for semantic matching and structured content elements for content generation.
[0109] The training module is used to obtain a pre-trained language model, and based on the semantic elements in the structured intent library, to train the pre-trained language model using a contrastive learning approach to obtain a trained intent matching model.
[0110] The vectorization module is used to generate a corresponding semantic vector for each piece of intent data in the structured intent library using the trained intent matching model, and to associate the semantic vector with the corresponding intent data and store it in the structured intent library.
[0111] The matching module is used to obtain the user's natural language question, generate a semantic vector of the natural language question using the trained intent matching model, and match at least one reference intent data from the structured intent library based on the semantic vector.
[0112] The generation module is used to generate a final answer based on the natural language question and the structured content elements in the matched reference intent data.
[0113] Based on the above embodiments, the construction module includes:
[0114] The initialization unit is used to configure multiple intent data based on domain expert knowledge to form an initial structured intent library;
[0115] The definition unit is used to define that each piece of intent data contains semantic elements and structured content elements; wherein, the semantic elements include two fields, namely the original question text and the question interpretation text; the structured content elements include three fields, namely the query logic example, the visualization requirement description, and the analysis framework template;
[0116] The maintenance unit is used to add, modify, or delete intent data in the structured intent library to obtain the final structured intent library.
[0117] Based on the above embodiments, the training module includes:
[0118] The extraction unit is used to extract the original question text and the question interpretation text from the structured intent library;
[0119] Positive sample construction unit is used to construct semantically related positive sample text pairs from the original question text and the question interpretation text of the same intent data;
[0120] The negative sample construction unit is used to construct semantically unrelated negative sample text pairs from the original question text and question interpretation text of different intent data.
[0121] A sample set construction unit, used to construct a sample set from several positive sample text pairs and negative sample text pairs;
[0122] The network training unit is used to use a pre-trained Chinese language model as a base network and to perform comparative learning training on the base network using the sample set.
[0123] The model solidification unit is used to solidify the network parameters obtained after training into the intent matching model.
[0124] Based on the above embodiments, the matching module includes:
[0125] A vector generation unit is used to input the natural language question into the intent matching model and generate a first semantic vector.
[0126] The similarity calculation unit is used to calculate the similarity between the first semantic vector and all semantic vectors in the structured intent library, and to obtain the initial matching score of each candidate intent data.
[0127] The keyword enhancement unit is used to extract keywords from the natural language question and use the keywords to calculate the keyword weight adjustment coefficient for each candidate intent data.
[0128] The context enhancement unit is used to construct a context graph between the natural language question and each candidate intent data, and to calculate the context relevance score of each candidate intent data based on the context graph;
[0129] The score fusion unit is used to obtain the final matching score of each candidate intent data based on the initial matching score, keyword weight adjustment coefficient and context relevance score;
[0130] The selection unit is used to select at least one intent data as reference intent data from the candidate intent data based on the final matching score.
[0131] Based on the above embodiments, the keyword enhancement unit includes:
[0132] The word segmentation and entity recognition subunit is used to perform word segmentation and domain entity recognition on the natural language problem and extract a set of keywords.
[0133] The keyword matching subunit is used to compare the semantic elements of the current candidate intent data with the keyword set to obtain matching keywords;
[0134] The coefficient calculation subunit is used to query a preset domain term weight dictionary, sum the weight values corresponding to the matching keywords, and obtain the keyword weight adjustment coefficient of the current candidate intent.
[0135] Based on the above embodiments, the context enhancement unit includes:
[0136] The knowledge extraction subunit is used to extract entities and relationships between entities from the semantic elements of the natural language questions and candidate intent data;
[0137] The graph construction subunit is used to construct a context graph using the extracted entities as nodes and relationships as edges.
[0138] The relevance calculation subunit is used to calculate the relevance between the natural language question and the candidate intent data based on the topology of the context graph, as a context relevance score.
[0139] Based on the above embodiments, the selection unit further includes:
[0140] The threshold comparison subunit is used to obtain the dynamic similarity threshold and compare the highest matching score with the dynamic similarity threshold.
[0141] The manual intervention triggering subunit is used to trigger the manual intervention process when the highest matching score is lower than the dynamic similarity threshold, and submit the matching context information containing the natural language question, word segmentation results and candidate intent data to the expert review platform.
[0142] The result calibration subunit is used to receive calibration results from the expert review platform and determine the intent data corresponding to the calibration results as reference intent data.
[0143] It should be noted that the specific manner in which each module performs its operation in the apparatus described in the above embodiments has been described in detail in the embodiments of the method, and will not be elaborated here.
[0144] Example 3:
[0145] Corresponding to the above method embodiments, this embodiment also provides an intelligent question-and-answer matching device based on a structured intent library. The intelligent question-and-answer matching device based on a structured intent library described below and the intelligent question-and-answer matching method based on a structured intent library described above can be referred to in correspondence.
[0146] Figure 3 This is a block diagram illustrating an intelligent question matching device 800 based on a structured intent library, according to an exemplary embodiment. Figure 3 As shown, the intelligent question-and-answer matching device 800 based on a structured intent library may include: a processor 801 and a memory 802. The intelligent question-and-answer matching device 800 may also include one or more of a multimedia component 803, an I / O interface 804, and a communication component 805.
[0147] The processor 801 controls the overall operation of the intelligent question-and-response matching device 800 based on a structured intent library to complete all or part of the steps in the aforementioned intelligent question-and-response matching method based on a structured intent library. The memory 802 stores various types of data to support the operation of the intelligent question-and-response matching device 800. This data may include, for example, instructions for any application or method operating on the intelligent question-and-response matching device 800, as well as application-related data such as contact data, sent and received messages, images, audio, video, etc. The memory 802 can be implemented using any type of volatile or non-volatile storage device or a combination thereof, such as Static Random Access Memory (SRAM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Erasable Programmable Read-Only Memory (EPROM), Programmable Read-Only Memory (PROM), Read-Only Memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk. The multimedia component 803 may include a screen and an audio component. The screen may be, for example, a touchscreen, and the audio component is used to output and / or input audio signals. For example, the audio component may include a microphone for receiving external audio signals. The received audio signals may be further stored in the memory 802 or transmitted via the communication component 805. The audio component also includes at least one speaker for outputting audio signals. I / O interface 804 provides an interface between processor 801 and other interface modules, such as keyboards, mice, and buttons. These buttons can be virtual or physical. Communication component 805 is used for wired or wireless communication between the intelligent question-and-answer matching device 800 based on a structured intent library and other devices. Wireless communication includes, for example, Wi-Fi, Bluetooth, Near Field Communication (NFC), 2G, 3G, or 4G, or a combination thereof. Therefore, the corresponding communication component 805 may include a Wi-Fi module, a Bluetooth module, or an NFC module.
[0148] In an exemplary embodiment, the intelligent question-and-answer matching device 800 based on a structured intent library may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the aforementioned intelligent question-and-answer matching method based on a structured intent library.
[0149] In another exemplary embodiment, a computer-readable storage medium including program instructions is also provided. When executed by a processor, these program instructions implement the steps of the intelligent question-and-answer matching method based on a structured intent library described above. For example, the computer-readable storage medium may be the memory 802 including the program instructions described above. These program instructions may be executed by the processor 801 of the intelligent question-and-answer matching device 800 based on a structured intent library to complete the intelligent question-and-answer matching method based on a structured intent library described above.
[0150] Example 4:
[0151] Corresponding to the above method embodiments, this embodiment also provides a readable storage medium. The readable storage medium described below can be referred to in conjunction with the intelligent question matching method based on a structured intent library described above.
[0152] A readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the intelligent question matching method based on a structured intent library as described in the above method embodiments.
[0153] Specifically, the readable storage medium can be a USB flash drive, a portable hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, or any other readable storage medium capable of storing program code.
[0154] The above description is merely a preferred embodiment of the present invention and is not intended to limit the invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
[0155] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.
Claims
1. A method for intelligent question matching based on a structured intent library, characterized in that, include: Multiple intent data points are collected, and a structured intent library is constructed from these multiple intent data points; each intent data point includes semantic elements for semantic matching and structured content elements for content generation. Obtain a pre-trained language model, and train the pre-trained language model using a contrastive learning approach based on the semantic elements in the structured intent library to obtain a trained intent matching model; Using the trained intent matching model, a corresponding semantic vector is generated for each intent data in the structured intent library, and the semantic vector is associated with the corresponding intent data and stored in the structured intent library; Obtain the user's natural language question, generate a semantic vector of the natural language question using the trained intent matching model, and match at least one reference intent data from the structured intent library based on the semantic vector; The final answer is generated based on the structured content elements in the natural language question and the matched reference intent data.
2. The intelligent question matching method based on a structured intent library according to claim 1, characterized in that, Multiple intent data points are collected, and a structured intent library is constructed from these data points. Each intent data point includes semantic elements for semantic matching and structured content elements for content generation, including: Multiple intent data are configured based on domain expert knowledge to form an initial structured intent library; Each piece of intent data is defined to include semantic elements and structured content elements; wherein, the semantic elements include two fields, namely the original question text and the question interpretation text; the structured content elements include three fields, namely the query logic example, the visualization requirement description, and the analysis framework template; The intent data in the structured intent library is added to, modified, or deleted to obtain the final structured intent library.
3. The intelligent question matching method based on a structured intent library according to claim 1, characterized in that, Based on the semantic elements in the structured intent library, the pre-trained language model is trained using a contrastive learning approach, including: Extract the original question text and question interpretation text from the structured intent library; The original question text and the question interpretation text of the same intent data are constructed into a semantically related positive sample text pair; The original question text and the question interpretation text of different intention data are used to construct semantically unrelated negative sample text pairs; A sample set is constructed from several positive sample text pairs and negative sample text pairs; The pre-trained Chinese language model is used as the base network, and the base network is trained by comparative learning using the sample set. The network parameters obtained after training are solidified into the intent matching model.
4. The intelligent question matching method based on a structured intent library according to claim 1, characterized in that, The trained intent matching model generates a semantic vector for the natural language question. Based on the semantic vector, at least one reference intent data is matched from a structured intent database, including: The natural language question is input into the intent matching model to generate a first semantic vector; Calculate the similarity between the first semantic vector and all semantic vectors in the structured intent library to obtain the initial matching score for each candidate intent data; Extract keywords from the natural language question, and use the keywords to calculate the keyword weight adjustment coefficient for each candidate intent data; Construct a context graph between the natural language question and each candidate intent data, and calculate the context relevance score of each candidate intent data based on the context graph; Based on the initial matching score, keyword weight adjustment coefficient, and contextual relevance score, the final matching score of each candidate intent data is obtained; Based on the final matching score, at least one intent data is selected from the candidate intent data as reference intent data.
5. The intelligent question matching method based on a structured intent library according to claim 4, characterized in that, Extract keywords from the natural language question, and use the keywords to calculate the keyword weight adjustment coefficient for each candidate intent data, including: The natural language problem is segmented and domain entity recognition is performed to extract a set of keywords; The semantic elements of the current candidate intent data are compared with the keyword set to obtain matching keywords; The preset domain terminology weight dictionary is queried, and the weight values corresponding to the matching keywords are summed to obtain the keyword weight adjustment coefficient for the current candidate intent.
6. An intelligent question matching device based on a structured intent library, characterized in that, include: The building module is used to collect multiple intent data points and construct a structured intent library from these data points; each intent data point includes semantic elements for semantic matching and structured content elements for content generation. The training module is used to obtain a pre-trained language model, and based on the semantic elements in the structured intent library, to train the pre-trained language model using a contrastive learning approach to obtain a trained intent matching model. The vectorization module is used to generate a corresponding semantic vector for each piece of intent data in the structured intent library using the trained intent matching model, and to associate the semantic vector with the corresponding intent data and store it in the structured intent library. The matching module is used to obtain the user's natural language question, generate a semantic vector of the natural language question using the trained intent matching model, and match at least one reference intent data from the structured intent library based on the semantic vector. The generation module is used to generate a final answer based on the natural language question and the structured content elements in the matched reference intent data.
7. The intelligent question matching device based on a structured intent library according to claim 6, characterized in that, The building module includes: The initialization unit is used to configure multiple intent data based on domain expert knowledge to form an initial structured intent library; The definition unit is used to define that each piece of intent data contains semantic elements and structured content elements; wherein, the semantic elements include two fields, namely the original question text and the question interpretation text; the structured content elements include three fields, namely the query logic example, the visualization requirement description, and the analysis framework template; The maintenance unit is used to add, modify, or delete intent data in the structured intent library to obtain the final structured intent library.
8. The intelligent question matching device based on a structured intent library according to claim 6, characterized in that, The training module includes: The extraction unit is used to extract the original question text and the question interpretation text from the structured intent library; Positive sample construction unit is used to construct semantically related positive sample text pairs from the original question text and the question interpretation text of the same intent data; The negative sample construction unit is used to construct semantically unrelated negative sample text pairs from the original question text and question interpretation text of different intent data. A sample set construction unit, used to construct a sample set from several positive sample text pairs and negative sample text pairs; The network training unit is used to use a pre-trained Chinese language model as a base network and to perform comparative learning training on the base network using the sample set. The model solidification unit is used to solidify the network parameters obtained after training into the intent matching model.
9. The intelligent question matching device based on a structured intent library according to claim 6, characterized in that, The matching module includes: A vector generation unit is used to input the natural language question into the intent matching model and generate a first semantic vector. The similarity calculation unit is used to calculate the similarity between the first semantic vector and all semantic vectors in the structured intent library, and to obtain the initial matching score of each candidate intent data. The keyword enhancement unit is used to extract keywords from the natural language question and use the keywords to calculate the keyword weight adjustment coefficient for each candidate intent data. The context enhancement unit is used to construct a context graph between the natural language question and each candidate intent data, and to calculate the context relevance score of each candidate intent data based on the context graph; The score fusion unit is used to obtain the final matching score of each candidate intent data based on the initial matching score, keyword weight adjustment coefficient and context relevance score; The selection unit is used to select at least one intent data as reference intent data from the candidate intent data based on the final matching score.
10. The intelligent question matching device based on a structured intent library according to claim 9, characterized in that, The keyword enhancement unit includes: The word segmentation and entity recognition subunit is used to perform word segmentation and domain entity recognition on the natural language problem and extract a set of keywords. The keyword matching subunit is used to compare the semantic elements of the current candidate intent data with the keyword set to obtain matching keywords; The coefficient calculation subunit is used to query a preset domain term weight dictionary, sum the weight values corresponding to the matching keywords, and obtain the keyword weight adjustment coefficient of the current candidate intent.
