An intelligent question and answer matching method, device, equipment, medium and product
By replacing placeholders and generating semantic variants in user questions, combined with a semantic ranking model, the problem of low question-answer matching efficiency in existing intelligent question-answering systems is solved, achieving fast and accurate question-answer matching.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- CHINA UNITED NETWORK COMM GRP CO LTD
- Filing Date
- 2026-02-13
- Publication Date
- 2026-06-05
AI Technical Summary
Existing intelligent question-answering systems struggle to quickly focus on the core intent when faced with user questions containing ambiguous entities, vague expressions, and diverse semantic information. This results in extensive searching and comparison across massive amounts of data, leading to low question-answer matching efficiency and failing to meet the demand for high-efficiency services.
Standardized questions are generated by replacing placeholders in user queries. Named entity recognition and decomposition are performed to generate semantic variants of non-overlapping entity combinations. Then, a semantic ranking model is used to re-rank the queries and output the target query with the highest matching degree.
It shortens the time spent filtering candidate results, improves the overall efficiency of question-and-answer matching, reduces invalid searches, enhances the targeting of searches and the efficiency of result filtering, and solves the problem of low efficiency in question-and-answer matching in existing technologies.
Smart Images

Figure CN122152849A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of natural language processing, and in particular to an intelligent question-answering matching method, apparatus, device, medium, and product. Background Technology
[0002] With the rapid development of natural language processing technology, intelligent question-answering systems have become a tool for users to quickly obtain accurate information through natural language. Users ask various natural language questions containing diverse information, expecting the system to efficiently match corresponding answers from massive data sources. Intelligent question-answering matching methods are a key technology in intelligent question-answering systems. Therefore, building scientific and efficient intelligent question-answering matching methods is crucial for promoting the application of intelligent question-answering systems in various fields and improving system service capabilities and user experience.
[0003] In existing technologies, a common intelligent question-answering matching method is to first build a knowledge base containing common questions and their corresponding standard answers. When a user asks a question, the system searches the knowledge base for questions that are similar to the user's question in literal or superficial semantics, and directly returns the preset answer associated with that question.
[0004] However, existing technologies suffer from low question-answering matching efficiency. Especially when faced with scenarios where user questions contain ambiguous entities, vague expressions, and diverse semantic information, it is difficult to quickly focus on the core intent. Extensive searching and comparison of massive amounts of data is required, resulting in time-consuming candidate result selection. The overall response speed and processing efficiency of question-answering matching cannot meet the high-efficiency service requirements of practical applications. Summary of the Invention
[0005] This application provides an intelligent question-and-answer matching method, apparatus, device, medium, and product to solve the problem of low question-and-answer matching efficiency in the prior art.
[0006] In a first aspect, embodiments of this application provide an intelligent question-answering matching method, including:
[0007] Get user questions;
[0008] The user question is processed by placeholder replacement to generate a standardized question containing placeholders; wherein, the placeholder replacement process is used to replace the specific entities in the user question with abstract placeholders, and the standardized question is a standardized question text generated after the placeholder replacement process, in which the specific entities are replaced by placeholders.
[0009] The standardized question is subjected to named entity recognition and decomposition to generate semantic variants of non-overlapping entity combinations; wherein, the semantic variants are a set of questions generated based on the standardized question through entity decomposition and combination;
[0010] The semantic variants are input into a preset semantic ranking model for reordering, and the target query question with the highest matching degree is output. The target query question is a preset standard question in the knowledge base that is selected after semantic reordering and has the highest matching degree with the user's question intent. The target query question is used as the retrieval basis to retrieve the standard answer bound to the target query question from the knowledge base. The standard answer is the reply to the user's question.
[0011] In one possible design, the step of reordering the semantic variants by inputting them into a preset semantic ranking model and outputting the target query question with the highest matching degree includes:
[0012] The semantic variant is converted into a query vector, and multiple initial candidate questions are retrieved from a preset vector database based on the query vector; wherein, the multiple initial candidate questions refer to questions in the vector database whose vector similarity to the query vector is greater than a preset similarity threshold;
[0013] The multiple initial candidate questions are input into multiple preset semantic ranking models to obtain a re-ranking list output by each semantic ranking model; wherein, the re-ranking list is a list obtained by each semantic ranking model after calculating the matching score and ranking the multiple initial candidate questions, and the matching score is used to represent the semantic matching degree between the initial candidate questions and the user's question;
[0014] Based on preset evaluation metrics, the target semantic ranking model with the best ranking effect is selected from the re-ranking list output by each semantic ranking model; wherein, the ranking effect is obtained by evaluating the re-ranking list output by each semantic ranking model using the evaluation metrics.
[0015] The initial candidate questions whose scores are greater than a preset score threshold in the reordering list output by the target semantic ranking model are determined as the target query questions.
[0016] In one possible design, converting the semantic variant into a query vector includes:
[0017] The semantic variant is encoded to obtain a text vector; wherein the text vector is used to represent the text information in the semantic variant other than geographical features and time features;
[0018] Geographic entities and time entities are extracted from the semantic variant, and the geographic entities are converted into geographic coordinate vectors and the time entities are converted into time period vectors; wherein, the geographic entities are used to represent the geographic features in the semantic variant, and the time entities are used to represent the time features in the semantic variant;
[0019] The query vector is obtained by weighting and fusing the text vector, the geographic coordinate vector, and the time period vector.
[0020] In one possible design, the process of replacing placeholders in the user's question to generate a standardized question containing placeholders includes:
[0021] Retrieve multiple entity fields from the user's question;
[0022] Each entity field is matched with a plurality of preset placeholders to obtain placeholders corresponding to each entity field;
[0023] Each entity field is replaced with a placeholder corresponding to each entity field to obtain the standardized question containing the placeholder.
[0024] In one possible design, before performing placeholder replacement processing on the user's question to generate a standardized question containing placeholders, the process further includes:
[0025] The business domain to which the user's question belongs is obtained, and multiple preset initial placeholders are adjusted according to the business domain to obtain the multiple placeholders; wherein, the adjustment is used to make the multiple initial placeholders adapt to the business domain.
[0026] In one possible design, the process of performing named entity recognition and decomposition on the standardized query to generate semantic variants of non-overlapping entity combinations includes:
[0027] Identify multiple named entities in the standardized question, and perform non-overlapping combination of the multiple named entities to generate at least one entity combination; wherein, the multiple named entities are entity words with specific semantic orientations identified from the standardized question, and the entity combination is an entity subset formed by arranging and combining the multiple named entities;
[0028] The semantic variant is constructed based on the at least one combination of entities.
[0029] In one possible design, after reordering the semantic variants by inputting them into a preset semantic ranking model and outputting the target query question with the highest matching degree, the method further includes:
[0030] The target query question is input into the knowledge base for retrieval, and a standard answer associated with the target query question is obtained.
[0031] Obtain user feedback data on the standard answer, and iteratively update the model parameters of the semantic ranking model based on the feedback data.
[0032] In one possible design, the iterative update of the model parameters of the semantic ranking model based on the feedback data includes:
[0033] The system acquires the user's interaction sequence with the standard answer, and generates an instant feedback signal when a preset error correction mode is detected in the interaction sequence; wherein, the error correction mode includes the user ignoring multiple standard answers and re-entering the question in the same session.
[0034] A training dataset is constructed based on the real-time feedback signals, the initial candidate questions corresponding to the multiple ignored standard answers, and the re-entered questions;
[0035] Using the training dataset as training samples, the semantic ranking model is subjected to online incremental learning to iteratively update the model parameters.
[0036] Secondly, embodiments of this application provide an intelligent question-and-answer matching device, comprising:
[0037] The first acquisition module is used to acquire user questions;
[0038] The replacement module is used to perform placeholder replacement processing on the user's question to generate a standardized question containing placeholders; wherein, the placeholder replacement processing is used to replace the specific entities in the user's question with abstract placeholders, and the standardized question is a standardized question text generated after the placeholder replacement processing, in which the specific entities are replaced by placeholders.
[0039] The decomposition module is used to perform named entity recognition and decomposition on the standardized question to generate semantic variants of non-overlapping entity combinations; wherein, the semantic variants are a set of questions generated based on the standardized question through entity decomposition and combination;
[0040] The sorting module is used to input the semantic variants into a preset semantic sorting model for reordering and output the target query question with the highest matching degree. The target query question is a preset standard question in the knowledge base that has been filtered after semantic reordering and has the highest matching degree with the user's question intent. The target query question is used as the retrieval basis to retrieve the standard answer bound to the target query question from the knowledge base. The standard answer is the reply to the user's question.
[0041] In one possible design, the sorting module includes:
[0042] A conversion unit is used to convert the semantic variant into a query vector and retrieve multiple initial candidate questions from a preset vector database based on the query vector; wherein, the multiple initial candidate questions refer to questions in the vector database whose vector similarity to the query vector is greater than a preset similarity threshold;
[0043] The input unit is used to input the plurality of initial candidate questions into a plurality of preset semantic ranking models to obtain a re-ranking list output by each semantic ranking model; wherein, the re-ranking list is a list obtained by each semantic ranking model after calculating a matching score and ranking the plurality of initial candidate questions, and the matching score is used to represent the semantic matching degree between the initial candidate questions and the user's question.
[0044] The filtering unit is used to filter the target semantic ranking model with the best ranking effect from the re-ranking list output by each semantic ranking model based on a preset evaluation index; wherein the ranking effect is obtained by evaluating the re-ranking list output by each semantic ranking model through the evaluation index.
[0045] The determining unit is used to determine the initial candidate questions whose matching scores are greater than a preset score threshold in the reordering list output by the target semantic ranking model as the target query question.
[0046] In one possible design, the conversion unit includes:
[0047] An encoding component is used to encode the semantic variant to obtain a text vector; wherein the text vector is used to represent text information in the semantic variant other than geographical features and time features;
[0048] An extraction component is used to extract geographic entities and time entities from the semantic variant, and convert the geographic entities into geographic coordinate vectors and the time entities into time period vectors; wherein the geographic entities are used to represent geographic features in the semantic variant, and the time entities are used to represent time features in the semantic variant;
[0049] A fusion component is used to perform weighted fusion of the text vector, the geographic coordinate vector, and the time period vector to obtain the query vector.
[0050] In one possible design, the replacement module includes:
[0051] The first acquisition unit is used to acquire multiple entity fields from the user's question;
[0052] The matching unit is used to match each of the entity fields with a plurality of preset placeholders to obtain placeholders corresponding to each of the entity fields;
[0053] The replacement unit is used to replace each of the entity fields with a placeholder corresponding to each of the entity fields to obtain the standardized question containing the placeholder.
[0054] In one possible design, the intelligent question-answering matching device further includes:
[0055] The second acquisition module is used to acquire the business domain to which the user's question belongs, and adjust a plurality of preset initial placeholders according to the business domain to obtain the plurality of placeholders; wherein, the adjustment is used to adapt the plurality of initial placeholders to the business domain.
[0056] In one possible design, the disassembly module includes:
[0057] The identification unit is used to identify multiple named entities in the standardized question and to perform non-overlapping combination of the multiple named entities to generate at least one entity combination; wherein, the multiple named entities are entity words with specific semantic orientations identified from the standardized question, and the entity combination is an entity subset formed by arranging and combining the multiple named entities;
[0058] The first building unit is used to build the semantic variant based on the at least one combination of entities.
[0059] In one possible design, the intelligent question-answering matching device further includes:
[0060] The retrieval module is used to input the target query question into the knowledge base for retrieval and obtain the standard answer bound to the target query question;
[0061] The update module is used to obtain user feedback data on the standard answer and iteratively update the model parameters of the semantic ranking model based on the feedback data.
[0062] In one possible design, the update module includes:
[0063] A signal generation unit is used to acquire the user's interaction sequence with the standard answer, and generate an instant feedback signal when a preset error correction mode is detected in the interaction sequence; wherein, the error correction mode includes the user ignoring multiple standard answers and re-entering the question in the same session;
[0064] The second construction unit is used to construct a training dataset based on the instantaneous feedback signal, the initial candidate questions corresponding to the multiple ignored standard answers, and the re-entered questions;
[0065] The learning unit is used to perform online incremental learning on the semantic ranking model using the training dataset as training samples, so as to iteratively update the model parameters of the semantic ranking model.
[0066] Thirdly, embodiments of this application provide an electronic device, including: a processor, and a memory communicatively connected to the processor;
[0067] The memory stores computer-executed instructions;
[0068] When the processor executes the computer execution instructions stored in the memory, it is used to implement the intelligent question-answering matching method as described in any of the first aspects.
[0069] Fourthly, embodiments of this application provide a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, are used to implement the intelligent question-answering matching method as described in any of the first aspects.
[0070] Fifthly, embodiments of this application provide a computer program product, including a computer program, which, when executed by a processor, is used to implement the intelligent question-answering matching method as described in any of the first aspects.
[0071] This application provides an intelligent question-and-answer matching method, apparatus, device, medium, and product. By replacing placeholders in user questions to generate standardized questions, it can quickly extract specific entity information and directly focus on the core semantics of the question, narrowing the search scope from the source. This avoids the inefficient operation of indiscriminate large-scale searching and comparison in massive amounts of data. At the same time, it generates a set of semantic variant questions with non-overlapping entity combinations based on standardized questions, which can accurately cover various expressions of the core semantics of user questions, reducing invalid searches caused by differences in semantic expression, and making subsequent searches more targeted. After re-sorting the semantic variants through a semantic ranking model, it directly outputs the target query question with the highest matching degree, which can quickly lock in the standard question that best matches the user's question intent, shorten the time spent on candidate result screening, and eliminate the need to rely on shallow literal or semantic comparison methods for repeated screening. It improves the overall matching efficiency from three dimensions: search scope, search targeting, and result screening efficiency, solving the problem of low question-and-answer matching efficiency in the prior art. Attached Figure Description
[0072] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0073] Figure 1 This is a schematic diagram illustrating an application scenario of the intelligent question-answering matching method provided in the embodiments of this application;
[0074] Figure 2 A flowchart illustrating the intelligent question-answering matching method provided in the embodiments of this application. Figure 1 ;
[0075] Figure 3 A flowchart illustrating the intelligent question-answering matching method provided in the embodiments of this application. Figure 2 ;
[0076] Figure 4 A flowchart illustrating the intelligent question-answering matching method provided in the embodiments of this application. Figure 3 ;
[0077] Figure 5 Histogram of score distribution for the bge-large-zh-v1.5 model provided in this application embodiment;
[0078] Figure 6 Histogram of score distribution for the ernie-3.0-base-zh model provided in this embodiment of the application;
[0079] Figure 7 Histogram of score distribution for the gte-large-zh model provided in this application embodiment;
[0080] Figure 8 Histogram of score distribution for the k50_rerank_bge_large-zh-v1.5 model provided in this embodiment of the application;
[0081] Figure 9 Histogram of score distribution for the k50_rerank_gte-large-zh model provided in this application embodiment;
[0082] Figure 10 Histogram of score distribution for the rerank_bge_large-zh-v1.5 model provided in this application embodiment;
[0083] Figure 11 Histogram of score distribution for the text2vec-base-chinese-sentence model provided in this application embodiment;
[0084] Figure 12 Histogram of score distribution for the text2vec-base-chinese model provided in this application embodiment;
[0085] Figure 13 Histogram of score distribution for the text2vec-large-chinese model provided in this application embodiment;
[0086] Figure 14 A comparison chart of the quantitative evaluation of model performance provided in the embodiments of this application;
[0087] Figure 15 This is a terminal output log diagram provided in an embodiment of this application;
[0088] Figure 16 This is a terminal output log diagram of the model batch processing task provided in the embodiments of this application;
[0089] Figure 17 A business process diagram for Chinese text semantic matching and retrieval provided in the embodiments of this application;
[0090] Figure 18 This is a schematic diagram of the intelligent question-answering matching device provided in the embodiments of this application;
[0091] Figure 19 This is a schematic diagram of the hardware structure of the electronic device provided in the embodiments of this application.
[0092] The accompanying drawings illustrate specific embodiments of this application, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the concept in any way, but rather to illustrate the concepts of this application to those skilled in the art through reference to particular embodiments. Detailed Implementation
[0093] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.
[0094] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, use and processing of the relevant data must comply with relevant laws, regulations and standards, and corresponding operation entry points are provided for users to choose to authorize or refuse.
[0095] In the embodiments of this application, the terms "first" and "second" are used to distinguish identical or similar items with substantially the same function and effect. Those skilled in the art will understand that the terms "first" and "second" do not limit the quantity or execution order, and that "first" and "second" do not necessarily imply difference. It should be noted that in the embodiments of this application, words such as "exemplary" or "for example" are used to indicate examples, illustrations, or explanations. Any embodiment or design scheme described as "exemplary" or "for example" in this application should not be construed as being more preferred or advantageous than other embodiments or design schemes. Specifically, the use of words such as "exemplary" or "for example" is intended to present the relevant concepts in a concrete manner. In the embodiments of this application, "at least one" refers to one or more, and "more than one" refers to two or more.
[0096] It should be noted that the phrase "at...time" in the embodiments of this application can refer to the instant at which a certain situation occurs, or to a period of time after the occurrence of a certain situation; the embodiments of this application do not specifically limit this. Furthermore, the intelligent question-answering matching method, apparatus, device, medium, and product provided in the embodiments of this application are merely examples; an intelligent question-answering matching method, apparatus, device, medium, and product may also include more or less content.
[0097] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numerals in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present invention. Rather, they are merely examples of apparatuses and methods consistent with some aspects of the invention as detailed in the appended claims.
[0098] The technical solution of the present invention will be described in detail below with reference to specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments. The embodiments of the present invention will now be described with reference to the accompanying drawings.
[0099] To clearly understand the technical solution of this application, we will first provide a detailed introduction to the solutions of existing technologies. In the current era of rapid development in natural language processing technology, intelligent question-answering systems have become tools for users to quickly obtain accurate information through natural language. Users will ask various natural language questions containing diverse information, expecting the system to efficiently match corresponding answers from massive data sources. Intelligent question-answering matching methods are a key technology of intelligent question-answering systems. Therefore, constructing scientific and efficient intelligent question-answering matching methods is crucial for promoting the application of intelligent question-answering systems in various fields and improving system service capabilities and user experience.
[0100] In existing technologies, common intelligent question-answering matching methods first construct a knowledge base containing common questions and their corresponding standard answers. When a user asks a question, the system searches the knowledge base for pre-defined questions that are most similar to the user's question in literal or shallow semantics using keyword matching, bag-of-words models, or basic text similarity algorithms, and directly returns the pre-defined answer associated with that question. Especially when faced with scenarios where user questions contain ambiguous entities, vague expressions, and diverse semantic information, it is difficult to quickly focus on the core intent, requiring extensive searching and comparison across massive amounts of data. This results in time-consuming candidate result selection, and the overall response speed and processing efficiency of question-answering matching cannot meet the high-efficiency service requirements of practical applications. Therefore, existing technologies suffer from low question-answering matching efficiency.
[0101] Therefore, addressing the low efficiency of question-and-answer matching in existing technologies, this research found that to solve this problem, user questions can be abstracted and semantic variants generated to focus on core intent and reduce the search scope, achieving fast and accurate matching: ① Specific entity information in the question can be abstracted and transformed, stripping away non-core concrete information interference, directly focusing on the core semantic logic of the user question, reducing the information dimensions that need to be compared in subsequent retrieval processes, narrowing the data processing scope from the source of retrieval, reducing indiscriminate large-scale retrieval operations, and improving the efficiency of early-stage question-and-answer matching. ② Based on the core semantic features of the user question, multi-dimensional semantic expression forms can be expanded to generate various semantic variants covering the core semantics, allowing similar questions with different expressions to match the corresponding core semantic pointers, avoiding invalid searches due to differences in user expressions, improving the coverage of core intent during the retrieval process, and reducing the time spent on invalid search comparisons. ③ An intelligent semantic ranking model can be introduced to replace the traditional shallow literal or basic semantic comparison method. The semantic features of the user's question are input into the model for accurate matching degree ranking, and the standard questions with the highest matching degree with the user's core intent are selected. This simplifies the candidate result screening process, shortens the result screening processing time, and quickly locks in the target matching result.
[0102] Specifically, user questions can first be processed by separating the core semantics from the specific entities to extract standardized question formats. Then, based on the standardized questions, multi-dimensional semantic variants can be generated to cover various expressions of the core intent. Finally, the semantic variants can be accurately sorted and filtered through an intelligent semantic model. In this way, the retrieval matching logic can be optimized in all aspects, including retrieval scope, retrieval targeting, and result filtering, thereby improving the overall processing efficiency of question-and-answer matching.
[0103] This application discloses an intelligent question-and-answer matching method, apparatus, device, medium, and product. By replacing placeholders in user questions to generate standardized questions, it can quickly extract specific entity information and directly focus on the core semantics of the question, narrowing the search scope from the source. This avoids the inefficient operation of indiscriminate large-scale searching and comparison in massive amounts of data. At the same time, it generates a set of semantic variant questions with non-overlapping entity combinations based on standardized questions, which can accurately cover various expressions of the core semantics of user questions, reducing invalid searches caused by differences in semantic expression, and making subsequent searches more targeted. After re-sorting the semantic variants through a semantic ranking model, it directly outputs the target query question with the highest matching degree, which can quickly lock in the standard question that best matches the user's question intent, shorten the time spent on candidate result screening, and eliminate the need to rely on shallow literal or semantic comparison methods for repeated screening. It improves the overall matching efficiency from three dimensions: search scope, search targeting, and result screening efficiency, solving the problem of low question-and-answer matching efficiency in the prior art.
[0104] Based on the above-mentioned inventive discovery, the technical solution of this application is proposed.
[0105] The following describes the application scenarios of the intelligent question-answering matching method provided in the embodiments of the present invention. Figure 1 This is a schematic diagram illustrating an application scenario of the intelligent question-answering matching method provided in the embodiments of this application. For example... Figure 1 As shown, this application scenario includes a user terminal 101 and a server 102. The user terminal 101 collects user questions and sends them to the server 102. The server 102 performs placeholder replacement processing on the user questions to generate standardized questions containing placeholders. The server 102 performs named entity recognition and decomposition on the standardized questions to generate semantic variants of non-overlapping entity combinations. The server 102 inputs the semantic variants into a preset semantic ranking model for reordering and outputs the target query question with the highest matching degree.
[0106] The embodiments of the present invention will now be described with reference to the accompanying drawings.
[0107] Figure 2 A flowchart illustrating the intelligent question-answering matching method provided in the embodiments of this application. Figure 1 .like Figure 2 As shown, in this embodiment, the execution entity of this invention is a server. The intelligent question-answering matching method provided in this embodiment includes the following steps:
[0108] S201. Obtain user questions.
[0109] Specifically, by calling the terminal input acquisition application programming interface (API), the web page input box detection interface, and the intelligent speech-to-text tool, the system can collect users' text questions from client input boxes and web page interactive interfaces, as well as users' voice questions, and convert them into text format. The text-based question data collected from multiple channels is then normalized and integrated into structured text data to complete the acquisition of user questions. This step provides the original question data foundation for the subsequent intelligent question-answering matching process, ensuring that subsequent standardization processing, semantic variant generation, and semantic sorting operations all have clear and unified processing objects.
[0110] S202. Perform placeholder replacement processing on user questions to generate standardized questions containing placeholders; wherein, the placeholder replacement processing is used to replace the specific entities in the user questions with abstract placeholders, and the standardized questions are standardized question texts generated after the placeholder replacement processing, in which placeholders replace specific entities.
[0111] Specifically, the entity recognition API can be called to parse the user's question text word by word, extract the specific entities in the text and complete the entity type labeling. Then, based on the preset mapping table between entity types and abstract placeholders, the labeled specific entities are replaced one by one with the corresponding type of abstract placeholder. During the replacement process, the original sentence structure and core semantic expression of the user's question are preserved. Finally, a standardized question containing abstract placeholders is generated. This step is used to transform the concrete entity information in the user's question into an abstract expression, stripping away non-core specific entity information, allowing the question text to focus on the core semantic logic and question framework, forming a standardized question text with a unified format. This provides a standardized and unified processing base for the subsequent generation of semantic variants, and at the same time, it transforms questions with different specific entities but the same core semantics into the same standardized expression form.
[0112] Placeholders are abstract identifiers used to replace specific entities in user questions. These identifiers are set according to the type of the entity being replaced, reflecting only the category attributes of the entity without containing any concrete entity information. They can achieve the abstract replacement of specific entities while preserving the original sentence structure and core semantics of the user question, and are an important element in the formation of standardized questions.
[0113] Specific entities are concrete information with clear direction mentioned by users during the questioning process. They can be clearly identified and defined, including concrete nouns such as people, places, times, and items, as well as specific numerical values, numbers, names, and other proprietary information. They are non-core semantic elements in user questions that can be abstracted and replaced.
[0114] Standardized questions are standardized question texts generated by replacing placeholders in the original user questions. This text replaces all concrete entities in the original question with abstract placeholders, fully preserving the sentence structure, grammatical logic, and core semantic expression of the original user question. It eliminates the interference of different concrete entities on the core intent of the question, forming a standardized question expression form with a unified format and a focus on core semantics.
[0115] S203. Perform named entity recognition and decomposition on standardized questions to generate semantic variants of non-overlapping entity combinations; wherein, the semantic variants are a set of questions generated based on standardized questions through entity decomposition and combination.
[0116] Specifically, a word segmentation tool can be used to accurately segment standardized questions. Then, a named entity recognition tool can be used to extract all entity elements corresponding to the abstract placeholders in the standardized questions. The extracted entity elements are then split and combined without repetition. Following the original sentence structure of the standardized questions, the non-overlapping entity elements after different splitting and combination are re-embedded into the corresponding positions of the standardized questions, generating multiple semantic variants with standardized sentence structure and consistent core semantics. At the same time, the generated semantic variants are deduplicated and duplicated semantic variants are removed, ultimately forming a set of semantic variants of non-overlapping entity combinations. This step is used to expand various entity combination expressions that cover the core intent based on the core semantics of the standardized questions. This allows the core semantics of the standardized questions to be presented through different entity combination methods, forming a complete set of semantic variant questions. This provides rich and comprehensive matching samples for subsequent semantic ranking, ensuring that various entity combination expressions of the core semantics can be covered in the subsequent matching process, and avoiding omissions in core intent matching due to differences in entity combination forms.
[0117] Among them, semantic variants are based on standardized questions. They are generated by non-overlapping decomposition and recombination of the entity elements corresponding to the abstract placeholders in the standardized questions, and then re-embedding the combined entity elements according to the original sentence structure logic of the standardized questions. Each question in this set is consistent with the core semantics of the original standardized questions, and only differs in the form of entity combination. There are no duplicate question contents in the set.
[0118] S204. Input the semantic variants into the preset semantic ranking model for reordering and output the target query question with the highest matching degree. The target query question is a preset standard question in the knowledge base that is selected after semantic reordering and has the highest matching degree with the user's question intent. The target query question is used as the basis for retrieving the standard answer bound to the target query question from the knowledge base. The standard answer is the reply to the user's question.
[0119] Specifically, the generated set of semantic variants of non-overlapping entity combinations can be used as input data to call a semantic ranking model built on a Transformer-based bidirectional encoder representation architecture. This model consists of three components: a semantic encoding layer, a feature fusion layer, and a matching degree calculation layer. The semantic encoding layer performs vectorization encoding on each input semantic variant text and the standard question text in the knowledge base, outputting the semantic feature vectors corresponding to each text. The feature fusion layer receives the semantic feature vectors output by the semantic encoding layer and performs dimension-wise fusion calculation on the feature vectors of the semantic variants and the standard questions, outputting the fused feature matrix. The matching degree calculation layer receives the feature matrix output by the feature fusion layer and calculates the matching degree value between each semantic variant and each standard question using the cosine similarity algorithm. The model sorts all the matching degree values in descending order, selects the standard question in the knowledge base corresponding to the result with the highest matching degree value, and finally outputs the target query question with the highest matching degree. This step is used to perform accurate semantic-level matching degree calculation and ranking on various semantic variants covering the core semantics, selecting the result with the best matching degree with the standard question in the knowledge base from the set of semantic variants, directly locking the target query question that matches the core intent of the user's question, and providing accurate retrieval basis for retrieving the standard answer from the knowledge base.
[0120] The semantic ranking model is an intelligent model used to calculate the semantic matching degree between semantic variants and standard questions in a knowledge base, and to rank the matching results. This model can perform matching degree analysis based on the deep semantics of the text, rather than simply relying on literal information comparison. The model can collect a large number of various question texts as training datasets, and after semantically labeling and matching degree labeling of the datasets, the labeled datasets are input into the basic model built on the Transformer architecture for iterative training. During the training process, the semantic encoding and matching degree calculation capabilities of the model are continuously optimized. After multiple training and verifications until the semantic matching accuracy and ranking stability of the model reach the preset requirements, the semantic ranking model can be obtained.
[0121] The intelligent question-and-answer matching method can be applied to scenarios such as government service consultation, educational Q&A and tutoring, and enterprise intelligent operation and maintenance, while also being adapted to supplementary scenarios such as cultural and tourism information inquiry. In the government service consultation scenario, it can support the public to consult online and offline on matters such as social security application procedures, certificate application materials, and detailed rules interpretation, meeting the government service's need for efficient response and accurate answers. In the educational Q&A and tutoring scenario, it can provide students and teachers with services such as answering questions about subject knowledge points, consulting on campus affairs, and retrieving learning materials, adapting to diverse scenarios such as classroom assistance and self-study. In the enterprise intelligent operation and maintenance scenario, it can help technical personnel quickly find system fault troubleshooting solutions, equipment parameter configuration instructions, and office system operation guides, while also providing internal knowledge consultation services such as administrative procedures for enterprise employees. These scenarios typically involve users asking questions in a variety of flexible formats, some containing ambiguous expressions, polysemous entities, or multiple semantic information, and corresponding to questions with massive amounts of knowledge base data. Traditional question-answering matching methods rely on keyword matching and basic text similarity algorithms, which struggle to quickly focus on the core intent. They require extensive searching and comparison within massive amounts of data, resulting in time-consuming candidate result selection, slow response speeds, and a high likelihood of matching bias and invalid searches. These methods fail to meet the actual needs of these scenarios for efficient and accurate question-answering services. This intelligent question-answering matching method can specifically address these issues, improving the processing efficiency and matching accuracy of question-answering services.
[0122] This embodiment provides an intelligent question-and-answer matching method that generates standardized questions by replacing placeholders in user questions. This quickly extracts specific entity information and focuses on the core semantics of the question, narrowing the search scope from the source. This avoids the inefficient operation of indiscriminately searching and comparing a wide range of massive amounts of data. Simultaneously, it generates a set of semantic variant questions based on standardized questions, which are non-overlapping entity combinations. This accurately covers various expressions of the core semantics of the user question, reducing invalid searches caused by differences in semantic expression and making subsequent searches more targeted. Then, after re-sorting the semantic variants using a semantic ranking model, it directly outputs the target query question with the highest matching degree. This quickly identifies the standard question that best matches the user's question intent, shortening the time spent filtering candidate results. It eliminates the need for repeated filtering based on shallow literal or semantic comparisons. This improves the overall matching efficiency from three dimensions: search scope, search targeting, and result filtering efficiency, solving the problem of low question-and-answer matching efficiency in existing technologies.
[0123] In one possible design, S204, the semantic variants are input into a preset semantic ranking model for reordering, and the target query question with the highest matching degree is output, including:
[0124] S2041. Convert the semantic variant into a query vector, and retrieve multiple initial candidate questions from a preset vector database based on the query vector; wherein, multiple initial candidate questions refer to questions in the vector database whose vector similarity to the query vector is greater than a preset similarity threshold.
[0125] Specifically, a Transformer-based text vector encoding model can be used to vectorize semantic variants. This model consists of three parts: a text preprocessing layer, a feature encoding layer, and a vector output layer. The text preprocessing layer receives the semantic variant text data, performs preprocessing operations such as word segmentation, stop word removal, and text format normalization, and outputs a normalized text sequence. The feature encoding layer receives the normalized text sequence, captures the semantic relationships of the text context through a self-attention mechanism, extracts multi-dimensional semantic features, and outputs a high-dimensional semantic feature matrix. The vector output layer receives the high-dimensional semantic feature matrix, compresses and maps it into a fixed-dimensional dense vector, i.e., the query vector, and then calls the nearest neighbor retrieval function of the vector database. The algorithm uses cosine similarity to calculate the similarity between the query vector and all standard question vectors in the vector database. Standard questions with similarity values greater than a preset similarity threshold are selected and identified as multiple initial candidate questions. This step converts unstructured semantic variant text into structured numerical query vectors. By leveraging the efficient retrieval capabilities of the vector database, the range of candidate questions is quickly narrowed down. Initial candidate questions with basic semantic similarity to semantic variants are selected from a massive number of standard questions. This provides a controllable number of candidate samples with basic matching degree for subsequent multi-model re-ranking, avoiding the waste of computational resources and excessive processing time caused by directly re-ranking all standard questions using multiple models.
[0126] S2042. Input multiple initial candidate questions into multiple preset semantic ranking models to obtain a re-ranking list output by each semantic ranking model; wherein, the re-ranking list is a list obtained by each semantic ranking model after calculating the matching score and ranking the multiple initial candidate questions, and the matching score is used to represent the semantic matching degree between the initial candidate questions and the user's question.
[0127] Specifically, multiple initial candidate questions and the original user question text can be used as input data and fed in parallel into multiple pre-defined semantic ranking models. Each semantic ranking model consists of three components: a text encoding layer, a feature interaction layer, and a matching score calculation layer. The text encoding layer vectorizes the input initial candidate question text and the original user question text, outputting the corresponding semantic feature vectors. The feature interaction layer receives the two sets of semantic feature vectors, calculates the semantic correlation between the vectors through a cross-attention mechanism, and outputs a fused interaction feature matrix. The matching score calculation layer receives the interaction feature matrix and uses a fully connected neural network to map the feature matrix into a matching score in the 0-1 range. This score represents the semantic matching degree between the initial candidate questions and the user question. Each model sorts all initial candidate questions in descending order based on the matching score, generating its own corresponding re-ranking list. This step is used to evaluate and rank the initial candidate questions from different semantic understanding dimensions through parallel computation of multiple models, obtaining multiple sets of differentiated re-ranking results. This provides rich comparison samples for subsequent selection of the optimal ranking model and avoids the problem of inaccurate ranking results caused by the semantic understanding bias of a single model.
[0128] S2043. Based on preset evaluation indicators, select the target semantic ranking model with the best ranking effect from the re-ranking list output by each semantic ranking model; wherein, the ranking effect is obtained by evaluating the re-ranking list output by each semantic ranking model through evaluation indicators.
[0129] Specifically, the indicator calculation tool can be used to extract core data such as the ranking position and matching score of candidate questions in the re-ranking list output by each semantic ranking model. Based on the calculation logic corresponding to the preset evaluation indicators (including three core indicators: average reciprocal ranking, normalized loss cumulative gain, and hit rate), the indicator calculation tool performs numerical calculations of the three types of indicators for each re-ranking list, obtaining the three indicator values corresponding to each semantic ranking model. Then, the weighted fusion tool is called to perform weighted summation of the three indicator values of each model according to the preset weight allocation rules, obtaining the comprehensive score of each model. The semantic ranking model with the highest comprehensive score is determined as the target semantic ranking model with the best ranking effect. This step is used to judge the ranking results of different semantic ranking models through multi-dimensional quantitative indicators, select the model with a suitable semantic matching ranking effect for the current user's question, avoid the model selection bias caused by single-dimensional evaluation, and provide accurate model support for subsequent determination of target query questions.
[0130] S2044. The initial candidate questions whose matching scores are greater than a preset score threshold in the reordering list output by the target semantic ranking model are determined as the target query questions.
[0131] Specifically, data extraction tools can be used to perform structured parsing of the reordered list output by the target semantic ranking model, extracting the matching score and question text information corresponding to each initial candidate question in the list. The extracted matching scores are compared one by one with a preset score threshold, and all initial candidate questions with matching scores greater than the threshold are selected. Then, the selected candidate question texts are sorted a second time according to the matching score from high to low using a result integration tool. Finally, the set of candidate questions after the second sorting is determined as the target query question. This step is used to select candidate questions that meet the semantic matching degree of the user's question from the ranking results of the target semantic ranking model, and to remove low matching degree questions that do not meet the matching score, forming a set of target query questions that meet the semantic matching requirements, providing accurate and effective retrieval objects for retrieving the corresponding standard answers from the knowledge base.
[0132] The technical effect of this solution in this embodiment is as follows: by converting semantic variants into query vectors and retrieving initial candidate questions from the vector database, it is possible to quickly and accurately screen candidate questions based on vector similarity, compressing the candidate range that needs to be sorted subsequently. At the same time, multiple semantic ranking models are used to re-rank the initial candidate questions in parallel and generate a re-ranked list. Combined with preset evaluation indicators, the target semantic ranking model with the best ranking effect is selected. The accuracy of semantic matching can be improved by relying on the comprehensive judgment of multiple models, avoiding the ranking bias of a single model. The target query question is further screened and determined by the score threshold. Based on efficient screening, the standard question that highly matches the user's question intent can be accurately locked. This not only improves the processing efficiency in the retrieval and ranking process, but also strengthens the accuracy of semantic matching through multi-model selection and threshold screening. It solves the problems that single ranking models are prone to matching bias and that it is difficult to balance matching efficiency and accuracy after only one retrieval and ranking.
[0133] In one possible design, S2041 converts the semantic variant into a query vector, including:
[0134] S20411. Encode the semantic variant to obtain a text vector; wherein the text vector is used to represent the text information in the semantic variant other than geographical features and time features.
[0135] Specifically, a text encoding model based on the RoBERTa architecture can be used to encode semantic variants. This model consists of three parts: a text cleaning layer, a feature extraction layer, and a vector generation layer. The text cleaning layer receives the semantic variant text data, first removes geographical and temporal entity-related characters from the text, retaining only the pure text semantic content, and then performs word segmentation and stop word removal before outputting a pure text sequence. The feature extraction layer receives the pure text sequence and captures the semantic relationships of the text context through a multi-layer bidirectional Transformer encoder, extracting multi-dimensional text semantic features other than geographical and temporal features, and outputting a high-dimensional text feature matrix. The vector generation layer receives the high-dimensional text feature matrix and compresses and maps it into a fixed-dimensional dense vector, that is, a text vector that only represents the pure text information of the semantic variant. This step is used to convert the core text information in the semantic variant after removing geographical and temporal features into a structured numerical vector, retaining the core semantic features of the text, and providing a standardized text feature carrier for subsequent fusion with geographical coordinate vectors and time period vectors, ensuring that the generated query vector contains both the core text semantics and can accurately connect with the feature information of geographical and temporal dimensions.
[0136] S20412. Extract geographic entities and time entities from semantic variants, and convert geographic entities into geographic coordinate vectors and time entities into time period vectors; wherein, geographic entities are used to represent geographic features in semantic variants, and time entities are used to represent time features in semantic variants.
[0137] Specifically, a named entity recognition tool can be used to parse semantically variant text word by word, accurately locating and extracting geographic entities such as cities, regions, and addresses, as well as time entities such as dates, time periods, and cycles. Then, a geocoding interface is used to map the extracted geographic entities into latitude and longitude coordinate data. A coordinate vectorization tool converts the latitude and longitude data into fixed-dimensional geographic coordinate vectors. Simultaneously, a time parsing tool is used to convert time entities into timestamps or time interval values. A time vectorization tool then maps these values into fixed-dimensional time period vectors. The geocoding interface includes an address parsing module, a coordinate matching module, and a vector generation module. The address parsing module receives geographic entity text and breaks it down into province, city, district, and other hierarchical information. The coordinate matching module interfaces with geographic information... The database matches hierarchical geographic information to corresponding latitude and longitude. The vector generation module converts latitude and longitude into geographic coordinate vectors. The time parsing tool includes a time format normalization module, a numerical conversion module, and a vector generation module. The time format normalization module unifies time entities of different formats into a standard time format. The numerical conversion module converts the standard time format into timestamp values. The vector generation module converts timestamp values into time period vectors. This step is used to extract and quantify geographic and temporal features from semantic variants, converting unstructured geographic and temporal entities into structured numerical vectors, retaining the core feature information of geographic and temporal dimensions in semantic variants, and providing a standardized geographic and temporal feature carrier for the subsequent weighted fusion of text vectors, geographic coordinate vectors, and time period vectors.
[0138] S20413. Weighted fusion of text vector, geographic coordinate vector and time period vector to obtain query vector.
[0139] Specifically, a vector fusion model can be invoked to perform weighted fusion processing on text vectors, geographic coordinate vectors, and time period vectors. This model consists of three components: a vector dimension alignment layer, a weight allocation layer, and a vector fusion layer. The vector dimension alignment layer receives vector data from three different dimensions and uses a dimension mapping algorithm to convert geographic coordinate vectors and time period vectors into vectors with the same dimensions as the text vectors, outputting text vectors, geographic coordinate vectors, and time period vectors with consistent dimensions. The weight allocation layer receives the three sets of vectors after dimension alignment and assigns corresponding weight coefficients to each set of vectors according to preset weight rules, such as setting the weight of text vectors to 0.6, geographic coordinate vectors to 0.25, and time period vectors to 0.15, outputting three sets of vectors with weight coefficients. The vector fusion layer receives the three sets of vectors with weight coefficients and performs fusion calculation on the three sets of vectors by weighted summation of each dimension, obtaining a query vector containing multi-dimensional features of text, geography, and time. This step is used to fuse the split, extracted, and quantified text, geography, and time features to generate a query vector that can fully represent all the core features of semantic variants, avoiding retrieval bias caused by a single-dimensional vector only representing part of the features.
[0140] The technical effect of this solution in this embodiment is as follows: by splitting and encoding semantic variants to obtain plain text vectors, and then separately extracting geographical and temporal entities to convert them into dedicated structured vectors and performing weighted fusion to generate query vectors, the query vectors can accurately represent both the core semantics of the text and the geographical and temporal specific features. This makes the semantic matching at the vector level more in line with the actual intent of the user's question. Relying on the query vector fusion of multi-dimensional features to retrieve initial candidate questions can improve the feature matching degree between candidate questions and user questions, reduce the cost of invalid retrieval and low-matching candidate questions caused by missing feature dimensions, and provide an accurate feature foundation for subsequent semantic ranking. This solves the problem that a single text vector cannot fully represent the geographical and temporal features of the user's question, resulting in missing feature dimensions and insufficient accuracy of candidate question matching in vector retrieval.
[0141] In one possible design, S202, the user's question is processed by replacing placeholders to generate a standardized question containing placeholders, including:
[0142] S2021. Retrieve multiple entity fields from user questions.
[0143] Specifically, an entity recognition model based on a conditional random field architecture can be invoked to extract entity fields from user query text. This model consists of three components: a text preprocessing layer, a feature encoding layer, and an entity annotation layer. The text preprocessing layer receives the raw text data of the user query, performs preprocessing operations such as word segmentation, part-of-speech tagging, and text formatting, and outputs a structured text sequence. The feature encoding layer receives the structured text sequence, generates feature vectors by extracting character features and contextual semantic features, and outputs a high-dimensional feature matrix. The entity annotation layer receives the high-dimensional feature matrix and, according to preset entity annotation rules, such as entity categories like people, places, time, and items, labels each character in the text sequence with an entity category, filtering multiple entity fields in the user query. This step is used to accurately identify and extract all concrete and directional entity information from the raw text of the user query, providing processing objects for subsequent matching and replacement operations of entity fields and placeholders.
[0144] Among them, entity fields are information units extracted from the original text of user questions that have clear concrete references and exclusive category attributes. They are key contents that constitute non-core semantics in user questions but have specific referents. They can be single concrete words or concrete phrases composed of multiple words, covering a variety of categories such as geography, time, objects, people, organizations, numbers, and numbers. These information units can be accurately identified, classified, and matched and replaced with preset placeholders, and the replacement will not change the core semantic framework and sentence structure of the user question.
[0145] S2022. Match each entity field with multiple preset placeholders to obtain the placeholders corresponding to each entity field.
[0146] Specifically, an entity-placeholder matching model can be invoked to match the extracted entity fields with preset placeholders. This model consists of three parts: an entity classification layer, a placeholder retrieval layer, and a matching result output layer. The entity classification layer receives each entity field and, based on a preset entity category system, such as geographic, time, item, or person categories, determines the category of each entity field and outputs the entity field labeled with category information. The placeholder retrieval layer receives the entity fields labeled with category information and connects to a preset placeholder library. The library stores exclusive placeholders corresponding to different entity categories, such as [geographic entity] for geographic category and [time entity] for time category. It retrieves the placeholders that match the category of each entity field and outputs the correspondence between entity fields and placeholders. The matching result output layer receives this correspondence, formats it, and outputs the exclusive placeholder corresponding to each entity field. This step is used to match each extracted entity field with a standardized placeholder that matches its category, establishing a precise correspondence between entity fields and placeholders, providing a clear basis for subsequent replacement of entity fields with placeholders.
[0147] S2023. Replace each entity field with a placeholder corresponding to each entity field to obtain a standardized question containing placeholders.
[0148] Specifically, a text replacement tool can be invoked to access the original text of the user's question. Simultaneously, a matching table of entity fields and corresponding placeholders can be imported. The tool's text positioning module accurately identifies the character position range of each entity field in the original text based on the content of the entity fields in the matching table. Then, the tool's replacement execution module directly replaces the content of the corresponding entity fields in the original text with the matching placeholder characters according to the position range and the matching relationship. After the replacement is completed, the tool's content verification module performs a full scan of the text to confirm that no entity fields are missing and no placeholder replacement errors occur. It then directly outputs a standardized question containing placeholders. This step replaces all concrete entity fields in the user's question with standardized placeholders, stripping away the concrete information in the original text while fully preserving the original sentence structure, grammatical logic, and core semantic expression of the user's question, forming a standardized question text with a unified format.
[0149] The technical effect of this solution in this embodiment is as follows: by extracting entity fields from user queries, accurately matching and replacing these entity fields with preset placeholders to generate standardized queries, the replacement process of entity placeholders becomes more targeted. While accurately stripping away various specific entity information, it stably focuses on the core semantics of user queries, making the generation of standardized queries more efficient. This makes subsequent steps such as entity decomposition and semantic variant generation based on standardized queries more directional, reducing subsequent processing deviations caused by non-standard entity replacement. It solves the problem that the lack of unified standards in the entity replacement process leads to inaccurate standardized query generation, which in turn affects the efficiency and effectiveness of subsequent semantic processing steps.
[0150] In one possible design, S203, named entity recognition and decomposition are performed on the standardized query to generate semantic variants of non-overlapping entity combinations, including:
[0151] S2031. Identify multiple named entities in a standardized query and perform non-overlapping combinations of the multiple named entities to generate at least one entity combination; wherein, the multiple named entities are entity words with specific semantic orientations identified from the standardized query, and the entity combination is a subset of entities formed by arranging and combining the multiple named entities.
[0152] Specifically, a named entity recognition tool can be used to perform a full-domain scan of the standardized question text. Based on the tool's built-in entity recognition rules, all named entities with specific semantic meanings in the text can be located and extracted. Then, a combination generation tool can be used to import all the extracted named entities. The tool's non-overlapping combination algorithm is used to generate subsets of the named entities, ensuring that the named entities in each generated entity combination are independent and non-overlapping, and covering different combination forms of single entities and multiple entities. Finally, at least one set of entity combinations that meet the non-overlapping requirements is output. This step is used to accurately extract the core named entities from the standardized question and complete the standardized non-overlapping combination. This provides rich and compliant entity combination materials for subsequent semantic variants built based on entity combinations, ensuring that the generated semantic variants can be expanded in multiple dimensions around the core semantics of the standardized question, and that there will be no semantic redundancy due to entity overlap.
[0153] Named entities are core words identified from standardized questions that have specific semantic orientations and clear category attributes. They are the key concrete units that constitute the semantics of standardized questions and cover various entity types such as geography, time, items, and institutions that are adapted to the business domain. Entity combinations are subsets of entities formed by arranging and combining multiple named entities of this type through non-overlapping rules. They can be single-element combinations composed of a single named entity or multi-element combinations composed of multiple independent and non-overlapping named entities. Each entity combination can be used in a way that fits the semantic framework of standardized questions.
[0154] S2032. Construct semantic variants based on at least one set of entity combinations.
[0155] Specifically, a text construction tool can be used to access the basic text of a standardized question and at least one extracted set of non-overlapping entity combinations. The tool's text embedding module precisely embeds each entity combination into the corresponding placeholder positions in the basic text according to the sentence logic and semantic framework of the standardized question. Then, the tool's text regularization module performs sentence fluency verification and format standardization on the embedded text, correcting inappropriate expressions in sentence connection to ensure that the text is semantically complete and conforms to the logic of language expression. Each entity combination generates a semantically complete text content. Finally, all generated text content is integrated into a semantic variant set. This step is used to combine non-overlapping entity combinations with the core semantic framework of the standardized question to generate multiple semantic variants with different expressions around the core semantics. This allows subsequent semantic matching to conduct searches based on multi-dimensional semantic expressions, covering more semantic scenarios that match the core intent of the user's question, and providing rich text search basis for accurate retrieval.
[0156] The technical effect of this solution in this embodiment is as follows: by first identifying named entities in standardized questions and generating entity combinations through non-overlapping combinations, and then constructing semantic variants based on the entity combinations, the generation process of semantic variants can be made more targeted, accurately and comprehensively deriving various question expressions that fit the core semantics. This allows the semantic variants to cover the core intent of the user's question more completely, providing accurate matching basis for subsequent semantic ranking, reducing the loss or redundancy of semantic variants caused by non-standard entity combinations, improving the matching targeting and processing efficiency of subsequent semantic ranking, and solving the problem that the lack of standardized entity combination logic in semantic variant generation leads to incomplete coverage of the core intent of the user's question and affects the accuracy of subsequent semantic matching.
[0157] Figure 3 A flowchart illustrating the intelligent question-answering matching method provided in the embodiments of this application. Figure 2 In this embodiment, in Figure 2 Based on the provided embodiments, the intelligent question-answering matching method is further explained. The intelligent question-answering matching method includes:
[0158] S301. Obtain user questions.
[0159] S301 is similar to S201, and will not be described again in this embodiment.
[0160] S302. Obtain the business domain to which the user's question belongs, and adjust multiple preset initial placeholders according to the business domain to obtain multiple placeholders; wherein, the adjustment is used to make the multiple initial placeholders adapt to the business domain.
[0161] Specifically, a text domain recognition tool can be invoked to receive the original text of user queries. Relying on the tool's built-in feature word libraries for various business domains, feature word matching and retrieval are performed on the text. Based on the domain of the matched feature words, the business domain corresponding to the user's query is determined. Then, a pre-set initial placeholder library is retrieved. Combining the specific terminology and entity type characteristics of this business domain, the initial placeholder library is modified by adding, deleting, and adjusting names. Placeholders specific to this domain are added, placeholders unrelated to this domain are deleted, and general placeholder names are adjusted to fit the domain description. After adjustment, multiple placeholders adapted to this business domain are generated. This step is used to accurately determine the business domain attributes of the user's query, ensuring that the placeholder system matches the entity types and terminology habits of the specific business domain. This avoids insufficient adaptability of general placeholders in specific domains, ensuring that subsequent matching and replacement of entity fields and placeholders are more aligned with the actual application scenarios of the domain.
[0162] S303. Perform placeholder replacement processing on user questions to generate standardized questions containing placeholders; wherein, the placeholder replacement processing is used to replace the specific entities in the user questions with abstract placeholders, and the standardized questions are standardized question text generated after the placeholder replacement processing, in which placeholders replace specific entities.
[0163] S304. Perform named entity recognition and decomposition on standardized questions to generate semantic variants of non-overlapping entity combinations; wherein, the semantic variants are a set of questions generated based on standardized questions through entity decomposition and combination.
[0164] S305. Input the semantic variants into the preset semantic ranking model for reordering and output the target query question with the highest matching degree. The target query question is a preset standard question in the knowledge base that is selected after semantic reordering and has the highest matching degree with the user's question intent. The target query question is used as the basis for retrieving the standard answer bound to the target query question from the knowledge base. The standard answer is the reply to the user's question.
[0165] S303-S305 are similar to S202-S204, and will not be described again in this embodiment.
[0166] The technical effect of this solution in this embodiment is as follows: By first obtaining the business domain to which the user's question belongs and adjusting the preset initial placeholder accordingly, the placeholder system is adapted to the entity representation features of the specific business domain. Then, based on the adapted placeholders, the entity replacement of the user's question and the generation of standardized questions are completed. This allows the matching and replacement of entity placeholders to better fit the actual semantic needs of the business scenario, and makes subsequent steps such as entity decomposition and semantic variant generation better fit the retrieval needs of the business scenario. It reduces invalid processing caused by cross-domain placeholder incompatibility and solves the problem that the general placeholder system cannot adapt to the entity representation features of different business domains, resulting in insufficient accuracy of entity replacement and inconsistency between standardized questions and the semantic needs of the business scenario.
[0167] Figure 4 A flowchart illustrating the intelligent question-answering matching method provided in the embodiments of this application. Figure 3 In this embodiment, in Figure 2 Based on the provided embodiments, the intelligent question-answering matching method is further explained. The intelligent question-answering matching method includes:
[0168] S401. Obtain user questions.
[0169] S402. Perform placeholder replacement processing on user questions to generate standardized questions containing placeholders; wherein, the placeholder replacement processing is used to replace the specific entities in the user questions with abstract placeholders, and the standardized questions are standardized question text generated after the placeholder replacement processing, in which placeholders replace specific entities.
[0170] S403. Perform named entity recognition and decomposition on standardized questions to generate semantic variants of non-overlapping entity combinations; wherein, the semantic variants are a set of questions generated based on standardized questions through entity decomposition and combination.
[0171] S404. Input the semantic variants into the preset semantic ranking model for reordering and output the target query question with the highest matching degree. The target query question is a preset standard question in the knowledge base that is selected after semantic reordering and has the highest matching degree with the user's question intent. The target query question is used as the basis for retrieving the standard answer bound to the target query question from the knowledge base. The standard answer is the reply to the user's question.
[0172] S401-S404 are similar to S201-S204, and will not be described again in this embodiment.
[0173] S405. Input the target query question into the knowledge base for retrieval and obtain the standard answer that is bound to the target query question.
[0174] Specifically, a knowledge base retrieval tool can be invoked to access the target query question text. The tool's text indexing module performs a dual keyword and semantic search on the structured question-answer binding data already stored in the knowledge base. This quickly locates question entries in the knowledge base that perfectly match or are highly semantically compatible with the target query question. Then, the tool's answer retrieval module extracts the pre-bound standardized answer content from the matched question entries. After the tool's format adaptation module adjusts the standard answer to a display format suitable for the user's question scenario, the standard answer corresponding to the target query question is output. This step is used to accurately retrieve standardized answers that match the target query question from the structured knowledge base, providing users with direct and accurate solutions.
[0175] S406. Obtain user feedback data on the standard answer, and iteratively update the model parameters of the semantic ranking model based on the feedback data.
[0176] Specifically, a feedback interaction entry can be set up on the standard answer display interface to receive valid feedback operations triggered by users and extract the corresponding feedback data. The feedback data includes positive and negative indicators of answer matching degree and semantic description information supplemented by users. Then, the model parameter update tool is called to access the feedback data and the original parameters of the semantic ranking model. The tool's feedback data parsing module performs structured processing on the feedback data, extracts the semantic features and matching degree indicators, and converts them into numerical update signals that the model can recognize. The tool's parameter tuning module receives the numerical update signal and makes local corrections to the core parameters of the semantic ranking model, such as network layer weights and biases, according to the gradient descent adjustment rules. After the correction is completed, the tool's parameter verification module loads the updated parameters into the model and completes basic testing. After confirming that the parameters are effective, the parameters of the semantic ranking model are iteratively updated. This step is used to collect users' actual usage feedback on the standard answers, transforming users' real usage experience into the basis for adjusting model parameters, continuously optimizing the semantic matching capability of the semantic ranking model, and ensuring that the model's ranking results continuously meet the actual questioning needs of users.
[0177] The technical effect of this solution in this embodiment is as follows: by retrieving the corresponding standard answer from the knowledge base and obtaining user feedback data on the standard answer, and then iteratively updating the model parameters of the semantic ranking model based on the feedback data, the semantic ranking model can continuously absorb user feedback information in actual applications, continuously optimize the semantic matching judgment logic of the model, and make the model's ranking results more in line with the user's actual question intent. At the same time, it forms a closed-loop optimization mechanism for the entire intelligent question answering matching process, improves the adaptability and accuracy of semantic matching in different scenarios, reduces the problem of lagging matching effect in long-term use due to fixed model parameters, and solves the problem that the semantic ranking model parameters are fixed and cannot be iteratively optimized, making it difficult to adapt to changes in user question intent and gradually reducing matching accuracy in long-term use.
[0178] In one possible design, S406 obtains user feedback data on the standard answer and iteratively updates the model parameters of the semantic ranking model based on the feedback data, including:
[0179] S4061. Obtain the user's interaction sequence with the standard answer. When a preset error correction mode is detected in the interaction sequence, generate an instant feedback signal. The error correction mode includes the user ignoring multiple standard answers and re-entering the question in the same session.
[0180] Specifically, a conversation interaction recording tool can be used to collect full-process logs of the user's interaction with the question-and-answer system. This allows for real-time acquisition of user questioning actions, the display status of standard answers, user clicks, skips, or re-questions, and other interactive behavior data. These data are then integrated into a structured sequence of user interactions with standard answers in chronological order. The tool's pattern detection module then uses preset error correction pattern judgment rules to analyze the interaction sequence frame by frame. When the sequence detects a user's behavior of continuously ignoring multiple standard answers and re-entering the question in the same conversation, the module automatically triggers a signal generation command, outputting an instant feedback signal containing the interactive behavior characteristics and information about the ignored standard answers. This step is used to capture negative feedback behaviors of users in question-and-answer interactions in real time, providing direct behavioral evidence for the subsequent construction of targeted training datasets. This ensures that the iterative updates of model parameters can accurately meet the user's actual error correction needs.
[0181] S4062. Construct a training dataset based on the immediate feedback signals, the initial candidate questions corresponding to the multiple ignored standard answers, and the re-entered questions.
[0182] Specifically, the data integration tool can be invoked to retrieve real-time feedback signals, initial candidate questions corresponding to multiple ignored standard answers, and user-re-entered questions. The tool's information extraction module parses interactive behavior features and time-series information of ignored behaviors from the real-time feedback signals. The re-entered questions are used as core sample text, and the corresponding ignored initial candidate questions are labeled as negative samples. The tool's sample labeling module adds low-matching labels to this group of samples, while supplementing related feature information such as conversation scenarios and business domains. The tool's dataset construction module integrates the labeled sample text, negative samples, and various feature information according to a preset structured data format to generate a single training sample containing sample input, label annotation, and related features. Multiple groups of such samples are summarized to form a complete training dataset. This step is used to transform the user's error-correcting interaction behavior into structured, labeled model training samples, so that the training dataset can accurately reflect the semantic matching deviation problem in actual use, providing training materials that fit the actual application scenario for subsequent online incremental learning of the semantic ranking model.
[0183] S4063. Using the training dataset as training samples, perform online incremental learning on the semantic ranking model to iteratively update the model parameters of the semantic ranking model.
[0184] Specifically, online learning tools can be used to connect the constructed training dataset to the semantic ranking model. The tool first splits the samples in the training dataset into batches and converts them into a numerical input format recognizable by the model. Then, using a mini-batch gradient descent learning method, the batch samples are input into the feature encoding layer of the semantic ranking model to complete semantic feature extraction. The extracted features are then processed by the model's matching layer to perform similarity calculations and output prediction results. The prediction results are compared with the true labels of the samples, and the deviation value is calculated. Based on this deviation value, the model is backpropagated to each network layer to refine the weights, biases, and other parameters of the feature encoding layer and the matching layer. The process involves fine-tuning and verifying the model's matching accuracy after each batch of samples has been trained. Once all training samples have been trained and the accuracy meets the target, the updated model parameters are saved and loaded into the online semantic ranking model. This completes the model's online incremental learning and parameter iterative updates. This step transforms training samples that fit real-world interaction scenarios into the model's learning basis. Through incremental learning, while preserving the model's original matching capabilities, it specifically corrects semantic matching deviations that occur in real-world applications. This allows the model's parameter updates to better align with users' actual questioning habits and error correction needs, continuously improving the model's semantic ranking accuracy in real-world scenarios.
[0185] The technical effect of this solution in this embodiment is as follows: by acquiring the user's interaction sequence with the standard answer and detecting the preset error correction mode to generate an instant feedback signal, and then combining the relevant initial candidate questions with the re-entered questions to construct a training dataset, the semantic ranking model is subjected to online incremental learning based on this dataset to iteratively update the model parameters. This can accurately capture the user's actual error correction intention, making the iterative update of the model parameters fit the needs of real question-and-answer matching scenarios, realizing real-time online optimization of the model, quickly correcting the semantic matching judgment bias of the model, and making the subsequent ranking results of the model more consistent with the user's real questioning intention. This solves the problem that the parameter update of the semantic ranking model lacks immediacy and pertinence, and cannot quickly correct the semantic judgment bias that occurs in the actual matching process.
[0186] Intelligent question-answering matching methods may also include the following steps:
[0187] 1. Signaling data query question generation, for example: user visit table, Table 1 is the user visit table:
[0188] Table 1 User Visit Table
[0189]
[0190] The user visit table shows the time and location of a person's visit to a province, city, or district. A lot of information can be obtained from this table, such as how many people visited a certain province and how many people visited a certain province on holidays.
[0191] Multiple questions were identified from the user visit log. Each question was then expanded based on its similarity, and the LLAMA2 model was used to transform each question into a similar but different wording. For example, "How many people arrived in a certain province?" could be expanded to:
[0192] 1. How many people have visited a certain province?
[0193] 2. How many people have visited a certain province?
[0194] 3. How many people arrived in a certain province during the Spring Festival?
[0195] 4. How many people visit a certain city on weekends?
[0196] The similarity of vector search can be increased by extending the same problem with similar approaches.
[0197] 2. Determine whether the keywords in the sentence are present in the expanded sentence.
[0198] Before vectorization, to prevent missing key information during sentence expansion, it is necessary to ensure that the keywords in the original sentence are present in the expanded sentence.
[0199] For example: "How many people have visited a certain province?" This sentence corresponds to a user visit table. This table contains multiple fields such as province, city, district, time, and address. The sentence is split into parts-of-speech tags using Named Entity Recognition (NER), and the words in the split sentence are matched with fields in the data table using embeddings. NER part-of-speech analysis is used to match the table fields, such as: "How many people have visited a certain province?" (Word splitting...) ,How many ,people ,arrive ,Pass a certain province The similarity score between [] and the field ["Provinces in China"] is as follows:
[0200] The scores [[0.4850267], [0.5446918], [0.524318], [0.5093343], [0.5192839], [0.6363366]] indicate the match. Higher scores indicate a higher degree of matching. By observing the gradient points, scores greater than or equal to 0.6 are considered to indicate the presence of keywords. Otherwise, the sentence is expanded again.
[0201] 3. Make the keywords in the question vague.
[0202] Fuzzy processing has two functions:
[0203] 1. Blur out multiple ways of writing keywords in a sentence, such as: a certain province, a certain region.
[0204] 2. Facilitates matching between questions and sentences in the knowledge base, as fuzzy processing is applied to all sentences, thus improving similarity matching. Fuzzy processing is configured with fuzzy conditions:
[0205] 1. For sentences containing keywords such as province, city, district / county, etc., perform fuzzy word processing. For example, "How many people reached a certain province?" can be fuzzed into "How many people reached..." "
[0206] 2. Blur the sentences containing date-related keywords. For example: How many people spend the Spring Festival in a certain province? Blur the sentence to... l to How many people celebrate the Lunar New Year?
[0207] 4. Based on the embedding model, the data problem is vectorized and written into Faiss. Faiss is a vector similarity retrieval library used to solve the problem of fast retrieval and matching of large-scale high-dimensional vectors. It can accurately find the result with the highest similarity to the target vector from millions or even hundreds of millions of high-dimensional vector data with extremely low time cost.
[0208] The bge-large-zh-v1.5 model was used to vectorize all the expanded sentences that had been blurred, and the vectorized results were stored in Faiss.
[0209] 5. Rerank the search results in Faiss by matching sentences with higher similarity. Reranking is a common secondary refinement step in information retrieval and search systems. It refers to applying a more accurate but potentially more computationally expensive model or rule to re-score and rank the results in this candidate list after the first stage of rapid recall has obtained a large list of potentially relevant candidate results.
[0210] Re-sort the Faiss results, bringing up the hidden results with higher matching scores. For example, given the question: "How many people are employed in a certain industrial park?", the Faiss database contains two matching sentences: "How many people are employed in a certain city?" and "How many people are employed within a certain area?". When matching sentences, "How many people are employed in a certain city?" has a higher matching score, but "within a certain area" is closer to "a certain industrial park". Therefore, the Faiss search results need to be sorted.
[0211] 1. Selecting the rerank model: The applicability of the model is determined by the number of sentences that receive a boost. Best_hit_score: Faiss search results; second_score: Faiss results re-ranked using the rerank model.
[0212] Figure 5 This is a histogram showing the score distribution of the bge-large-zh-v1.5 model provided in this application embodiment. The horizontal axis represents the similarity score interval, and the vertical axis represents the number of results for the corresponding score interval. The blue bars represent the best_hit_score distribution obtained from the initial Faiss retrieval, and the orange bars represent the second_score distribution obtained after re-ranking. This visually presents the score distribution characteristics after initial matching and re-ranking under this model. bge-large-zh-v1.5 is a large-scale Chinese language model that transforms Chinese text into high-dimensional semantic vectors. It performs exceptionally well in scenarios such as text similarity matching and retrieval re-ranking, adapting to the semantic understanding needs of Chinese natural language processing tasks, and is one of the commonly used text embedding models in the current Chinese language field.
[0213] Figure 6 This is a histogram showing the score distribution of the ernie-3.0-base-zh model provided in this embodiment. The horizontal axis represents the similarity score interval, and the vertical axis represents the number of results for the corresponding score interval. The blue bars represent the best_hit_score distribution obtained from the initial Faiss search, and the orange bars represent the second_score distribution calculated after re-ranking. This visually presents the distribution characteristics of the number of scores after initial matching and re-ranking under this model. ernie-3.0-base-zh is a pre-trained Chinese language model that enhances Chinese semantic understanding capabilities by incorporating knowledge augmentation techniques. It supports tasks such as text classification, semantic matching, and vector generation, and is one of the classic foundational models in the field of Chinese natural language processing.
[0214] Figure 7 This is a histogram showing the score distribution of the gte-large-zh model provided in this application embodiment. The horizontal axis represents the similarity score interval, and the vertical axis represents the number of results for the corresponding score interval. The blue bars represent the best_hit_score distribution obtained from the initial Faiss retrieval, and the orange bars represent the second_score distribution obtained after re-ranking. This visually presents the score distribution characteristics after initial matching and re-ranking under this model. gte-large-zh is a Chinese text embedding model that focuses on generating semantic vectors for Chinese text. It possesses strong semantic representation capabilities in scenarios such as text retrieval and similarity matching, and is suitable for the vectorization and retrieval needs of large-scale Chinese text.
[0215] Figure 8This is a histogram showing the score distribution of the k50_rerank_bge_large-zh-v1.5 model provided in this embodiment. The horizontal axis represents the similarity score interval, and the vertical axis represents the number of results in the corresponding score interval. The blue bars represent the best_hit_score distribution obtained from the initial Faiss retrieval, and the orange bars represent the second_score distribution obtained after re-ranking. This visually presents the distribution characteristics of the number of scores after initial matching and re-ranking under this model. k50_rerank_bge_large-zh-v1.5 is a re-ranking model optimized based on the bge-large-zh-v1.5 model. "k50" indicates that this model is adapted to the scenario of "taking the top 50 search results". Its core function is to perform refined semantic re-ranking of the top 50 results obtained from the initial retrieval. By enhancing the accuracy of semantic matching, it improves the ranking of highly relevant content in the search results, adapting to the result optimization needs after large-scale text retrieval.
[0216] Figure 9 This is a histogram showing the score distribution of the k50_rerank_gte-large-zh model provided in this embodiment. The horizontal axis represents the similarity score interval, and the vertical axis represents the number of results in the corresponding score interval. The blue bars represent the best_hit_score distribution obtained from the initial Faiss search, and the orange bars represent the second_score distribution obtained after re-ranking. This visually presents the distribution characteristics of the number of scores after initial matching and re-ranking under this model. k50_rerank_gte-large-zh is a re-ranking model optimized based on the gte-large-zh model. "k50" corresponds to the application scenario of "taking the top 50 search results". Its core function is to semantically re-rank the top 50 results of the initial search. Relying on the semantic representation capabilities of gte-large-zh, it corrects the matching deviation of the initial search, allowing results that are more in line with the query intent to rank higher, thus adapting to the result optimization task of Chinese text retrieval.
[0217] Figure 10This is a histogram showing the score distribution of the rerank_bge_large-zh-v1.5 model provided in this embodiment. The horizontal axis represents the similarity score interval, and the vertical axis represents the number of results in the corresponding score interval. The blue bars represent the best_hit_score distribution obtained from the initial Faiss retrieval, and the orange bars represent the second_score distribution obtained after re-ranking. This visually presents the distribution characteristics of the number of scores after initial matching and re-ranking under this model. rerank_bge_large-zh-v1.5 is a re-ranking model developed based on the bge-large-zh-v1.5 model. Its core function is to perform a semantic-level secondary ranking of the initial results of text retrieval. By strengthening the semantic matching ability of bge-large-zh-v1.5, it improves the fit between the retrieval results and the query intent, adapting to the scenario of optimizing results after Chinese text retrieval.
[0218] Figure 11 This is a histogram showing the score distribution of the text2vec-base-chinese-sentence model provided in this embodiment. The horizontal axis represents the similarity score interval, and the vertical axis represents the number of results for the corresponding score interval. The blue bars represent the best_hit_score distribution obtained from the initial Faiss retrieval, and the orange bars represent the second_score distribution calculated after re-ranking. This visually presents the distribution characteristics of the number of scores after initial matching and re-ranking under this model. text2vec-base-chinese-sentence is a Chinese sentence-level text vector model developed based on an open-source text embedding framework. It belongs to the basic version of the "text2vec" series, focusing on the semantic vector generation of Chinese sentences. It is suitable for scenarios such as similarity matching and retrieval of short sentence texts and is one of the commonly used lightweight Chinese sentence vector generation models.
[0219] Figure 12 This is a histogram showing the score distribution of the text2vec-base-chinese model provided in this application embodiment. The horizontal axis represents the similarity score interval, and the vertical axis represents the number of results for the corresponding score interval. The blue bars represent the best_hit_score distribution obtained from the initial Faiss retrieval, and the orange bars represent the second_score distribution calculated after re-ranking. This visually presents the score distribution characteristics after initial matching and re-ranking under this model. text2vec-base-chinese is the basic version of the "text2vec" series of Chinese text vector models. It supports the generation of semantic vectors for Chinese text (including sentences and paragraphs), and is lightweight and efficient. It is suitable for vectorization and similarity matching tasks of small to medium-sized Chinese texts, and is one of the commonly used lightweight models in the field of Chinese natural language processing.
[0220] Figure 13 This is a histogram showing the score distribution of the text2vec-large-chinese model provided in this application embodiment. The horizontal axis represents the similarity score interval, and the vertical axis represents the number of results for the corresponding score interval. The blue bars represent the best_hit_score distribution obtained from the initial Faiss retrieval, and the orange bars represent the second_score distribution calculated after re-ranking. This visually presents the distribution characteristics of the number of scores after initial matching and re-ranking under this model. text2vec-large-chinese is a large-scale version of the "text2vec" series of Chinese text vector models. Compared to the basic version, it enhances semantic representation capabilities, supports the generation of vectors for longer texts and more complex semantics, and is suitable for large-scale, highly complex Chinese text similarity matching and retrieval tasks. It is one of the high-performance models in Chinese text vectorization scenarios.
[0221] Figures 5 to 13 In the results, the greater the difference in second_score, the more significant the effect of rerank; among them, k50_rerank_bge_large_zh-v1.5, k50_rerank_bge_large_zh-v1.5 and rerank_bge_large_zh-v1.5 show a more obvious distribution of second_score. Figure 14 The model performance quantitative evaluation comparison chart provided in the embodiments of this application is as follows: Figure 14 As shown, margin_rate (Mean Absolute Deviation to Standard Deviation Ratio) reflects the average deviation of each data point in the dataset from the mean. A larger value indicates a greater average deviation of the data points from the mean, suggesting more dispersed data. The more pronounced the reranking effect, the better. Among k50_rerank_bge_large_zh-v1.5, k50_rerank_bge_large_zh-v1.5, and rerank_bge_large_zh-v1.5 second_score, k50_rerank_bge_large_zh-v1.5 shows the most significant effect, and it was chosen as our reranking model.
[0222] 6. Select an appropriate similarity threshold from the rerank results to obtain the most similar sentences.
[0223] Given the input question sentence, Faiss calculates the distance between all vectors based on its own linear scan index to find the Top-50 most similar to the question sentence. Based on the most suitable rerank model, the Top-50 search results are reranked, and the top-20 are extracted as the final rerank result. At the same time, a lower limit of the similarity threshold (score>=-0.2) is set for the Top-20 to filter out the most matching search results.
[0224] Figure 15 The terminal output log diagram provided in the embodiments of this application is as follows: Figure 15 As shown, the Chinese question-and-answer samples, such as "How many people have arrived in a certain province?", and the training metrics such as loss and prompt and output information output by the model when processing these samples, intuitively reflect the real-time running status of the model when batch processing Chinese text matching or generation tasks.
[0225] 7. Obtain the maximum combination of tokens with no overlap in named entities through NER.
[0226] The NER model is used to identify and annotate all named entities in a sentence, such as location, date, place name, and organization. Then, we need to ensure that there is no overlap between the selected named entities. If two or more named entities partially share the same text location, only one can be selected. Finally, the goal is to select the combination containing the most tokens (i.e., words or sub-words) from all possible non-overlapping entity combinations. In other words, we need to find a way to select entities that do not overlap but cover as much of the original text as possible.
[0227] For example: How many people work in a certain city but live in a certain province?
[0228] If the NER model identifies the following entities:
[0229] "A certain province" (place name).
[0230] "A certain city" (place name).
[0231] Word boundary information (start and end indexes).
[0232] A certain city: [1, 3].
[0233] A certain province: [9, 11].
[0234] The final maximum non-overlapping token combination: ["City", "Province"].
[0235] Additional considerations:
[0236] Person: Although "person" is part of a sentence, it is not a named entity but a common noun.
[0237] How many: Similarly, "how many" is not a named entity but a quantifier used for asking questions.
[0238] Go to work, live: These two verbs describe the activity states of people, but they are not named entities.
[0239] Of, at, but: These are all function words or punctuation marks and are usually not regarded as entities in NER.
[0240] Sentence combinations that retain the information of the original sentence and ensure that the entities in these new sentences do not overlap:
[0241] "How many people go to work in a certain city but live in a certain province".
[0242] "How many people work in a certain city and live in a certain province".
[0243] Take multiple groups of combined sentences as question sentences, put them into step 6 for execution and return the results. Determine which group of question sentences has the closest answer according to the maximum value of the comparison score.
[0244] Figure 16 This is the terminal output log diagram for the model batch processing task provided by the embodiment of the present application. As Figure 16 shown, the input-output structure, training monitoring metrics such as loss, and task-related fields such as prompt and intent during model processing intuitively reflect the real-time running status and data flow details of the model when performing batch tasks of Chinese text matching or semantic understanding.
[0245] Figure 17 This is the business flow diagram for Chinese text semantic matching and retrieval provided by the embodiment of the present application. As Figure 17 shown, first, perform synonymous expansion on the initial question, then identify and verify the keywords in the question. If the keywords do not meet the requirements, re-expand the question. After that, perform fuzzy word processing on the sentences that meet the requirements, then vectorize the processed questions and store them in the Faiss vector library, re-rank the retrieval results through the rerank model to optimize the matching degree, and finally extract key entity combinations with the help of NER technology to complete the entire question matching and retrieval task.
[0246] Figure 18 This is the structural schematic diagram of the intelligent question-answering matching device provided by the embodiment of the present application. As Figure 18 shown, the intelligent question-answering matching device includes:
[0247] The first acquisition module 1801 is used to acquire user questions.
[0248] The replacement module 1802 is used to perform placeholder replacement processing on user questions to generate standardized questions containing placeholders. The placeholder replacement processing is used to replace the specific entities in the user questions with abstract placeholders. The standardized questions are standardized question texts generated after the placeholder replacement processing, in which placeholders replace specific entities.
[0249] The decomposition module 1803 is used to perform named entity recognition and decomposition on standardized questions to generate semantic variants of non-overlapping entity combinations; wherein, the semantic variants are a set of questions generated based on standardized questions through entity decomposition and combination.
[0250] The sorting module 1804 is used to reorder the semantic variants input into a preset semantic sorting model and output the target query question with the highest matching degree. The target query question is a preset standard question in the knowledge base that is selected after semantic reordering and has the highest matching degree with the user's question intent. The target query question is used as the retrieval basis to retrieve the standard answer bound to the target query question from the knowledge base. The standard answer is the reply to the user's question.
[0251] In one possible design, the sorting module 1804 includes:
[0252] The transformation unit is used to convert semantic variants into query vectors and retrieve multiple initial candidate questions from a preset vector database based on the query vectors; wherein, multiple initial candidate questions refer to questions in the vector database whose vector similarity to the query vector is greater than a preset similarity threshold.
[0253] The input unit is used to input multiple initial candidate questions into multiple preset semantic ranking models to obtain a re-ranking list output by each semantic ranking model. The re-ranking list is a list obtained by each semantic ranking model after calculating the matching score and ranking the multiple initial candidate questions. The matching score is used to represent the semantic matching degree between the initial candidate questions and the user's question.
[0254] The filtering unit is used to select the target semantic ranking model with the best ranking effect from the re-ranking list output by each semantic ranking model based on a preset evaluation index; wherein, the ranking effect is obtained by evaluating the re-ranking list output by each semantic ranking model through the evaluation index.
[0255] The determination unit is used to identify initial candidate questions whose matching scores are greater than a preset score threshold in the reordering list output by the target semantic ranking model as the target query question.
[0256] In one possible design, the conversion unit includes:
[0257] The encoding component is used to encode semantic variants to obtain text vectors; where the text vectors are used to represent text information in the semantic variants other than geographical and temporal features.
[0258] The extraction component is used to extract geographic entities and time entities from semantic variants, and convert geographic entities into geographic coordinate vectors and time entities into time period vectors; where geographic entities are used to represent geographic features in semantic variants, and time entities are used to represent time features in semantic variants.
[0259] The fusion component is used to perform weighted fusion of text vectors, geographic coordinate vectors, and time period vectors to obtain a query vector.
[0260] In one possible design, the replacement module 1802 includes:
[0261] The first acquisition unit is used to acquire multiple entity fields from the user's question.
[0262] The matching unit is used to match each entity field with multiple preset placeholders to obtain the placeholders corresponding to each entity field.
[0263] The replacement unit is used to replace each entity field with a placeholder corresponding to that entity field, resulting in a standardized query that includes the placeholder.
[0264] In one possible design, the intelligent question-answering matching device also includes:
[0265] The second acquisition module is used to acquire the business domain to which the user's question belongs, and adjust multiple preset initial placeholders according to the business domain to obtain multiple placeholders; wherein, the adjustment is used to make the multiple initial placeholders adapt to the business domain.
[0266] In one possible design, disassembling module 1803 includes:
[0267] The identification unit is used to identify multiple named entities in a standardized question and to perform non-overlapping combinations of the multiple named entities to generate at least one entity combination; wherein, the multiple named entities are entity words with specific semantic orientations identified from the standardized question, and the entity combination is a subset of entities formed by arranging and combining the multiple named entities.
[0268] The first building unit is used to construct semantic variants based on at least one combination of entities.
[0269] In one possible design, the intelligent question-answering matching device also includes:
[0270] The retrieval module is used to input the target query question into the knowledge base for retrieval and obtain the standard answer that is associated with the target query question.
[0271] The update module is used to obtain user feedback data on the standard answer and iteratively update the model parameters of the semantic ranking model based on the feedback data.
[0272] In one possible design, the update module includes:
[0273] The signal generation unit is used to acquire the user's interaction sequence with the standard answer. When a preset error correction mode is detected in the interaction sequence, an instant feedback signal is generated. The error correction mode includes the user ignoring multiple standard answers and re-entering the question in the same session.
[0274] The second building unit is used to construct the training dataset based on the immediate feedback signals, the initial candidate questions corresponding to multiple ignored standard answers, and the re-entered questions.
[0275] The learning unit is used to perform online incremental learning on the semantic ranking model using the training dataset as training samples, so as to iteratively update the model parameters of the semantic ranking model.
[0276] The intelligent question-and-answer matching device provided in this embodiment can perform... Figures 2 to 4 The technical solution of the intelligent question-answering matching method embodiment shown herein, its implementation principle and technical effect are similar to Figures 2 to 4 The embodiment of the intelligent question-answering matching method shown is similar and will not be described in detail here.
[0277] Figure 19 This is a schematic diagram of the hardware structure of the electronic device provided in an embodiment of this application. Figure 19 As shown, the electronic device 190 includes at least one processor 1901 and a memory 1902. The electronic device 190 also includes a communication component 1903. The processor 1901, memory 1902, and communication component 1903 are connected via a bus 1904.
[0278] In a specific implementation, at least one processor 1901 executes computer execution instructions stored in memory 1902, causing at least one processor 1901 to implement an intelligent question-answering matching method of the above embodiment.
[0279] The specific implementation process of processor 1901 can be found in the above method embodiments, and its implementation principle and technical effect are similar, so it will not be repeated here.
[0280] In the above embodiments, it should be understood that the processor 1901 can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), etc. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in this invention can be directly implemented by a hardware processor, or implemented by a combination of hardware and software modules within the processor.
[0281] The memory 1902 may include high-speed RAM memory, and may also include non-volatile memory NVM, such as at least one disk storage.
[0282] Bus 1904 can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. Bus 1904 can be divided into address bus, data bus, control bus, etc. For ease of illustration, the bus 1904 in the accompanying drawings of this application is not limited to only one bus or one type of bus.
[0283] The above description of the functions implemented by electronic devices and main control devices has introduced the solutions provided by the embodiments of the present invention. It is understood that, in order to implement the above functions, the electronic device or main control device includes hardware structures and / or software modules corresponding to the execution of each function. By combining the units and algorithm steps of the various examples described in the embodiments of the present invention, the embodiments of the present invention can be implemented in hardware or a combination of hardware and computer software. Whether a function is executed by hardware or by computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the technical solutions of the embodiments of the present invention.
[0284] This application also provides a computer-readable storage medium storing computer-executable instructions. When executed by a processor, these instructions are used to implement the intelligent question-answering matching method described in the above embodiments. In the specific implementation of the aforementioned intelligent question-answering matching method, each module can be implemented as a processor.
[0285] The aforementioned readable storage medium can be implemented by 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 readable storage medium can be any available medium accessible to a general-purpose or special-purpose computer.
[0286] An exemplary readable storage medium is coupled to a processor, enabling the processor to read information from and write information to the readable storage medium. Of course, the readable storage medium can also be a component of the processor. The processor and the readable storage medium can reside in application-specific integrated circuits (ASICs). Alternatively, the processor and the readable storage medium can exist as discrete components in an electronic device or a host device.
[0287] This application also provides a computer program product, including a computer program, which, when executed by a processor, is used to implement an intelligent question-answering matching method as described in the above embodiments.
[0288] The computer program is stored in a readable storage medium, and at least one processor can read the computer program from the readable storage medium and execute the computer program to perform the scheme provided in any of the above embodiments.
[0289] Those skilled in the art will understand that all or part of the steps of the above method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it performs the steps of the above method embodiments; and the aforementioned storage medium includes various media capable of storing program code, such as ROM, RAM, magnetic disk, or optical disk.
[0290] The technical solutions of this application have been described above with reference to the preferred embodiments shown in the accompanying drawings. However, it is readily understood by those skilled in the art that the scope of protection of this application is obviously not limited to these specific embodiments. The above embodiments are only used to illustrate the technical solutions of this application and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features therein. These modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this application.
Claims
1. An intelligent question-answering matching method, characterized in that, include: Get user questions; The user question is processed by placeholder replacement to generate a standardized question containing placeholders; wherein, the placeholder replacement process is used to replace the specific entities in the user question with abstract placeholders, and the standardized question is a standardized question text generated after the placeholder replacement process, in which the specific entities are replaced by placeholders. The standardized question is subjected to named entity recognition and decomposition to generate semantic variants of non-overlapping entity combinations; wherein, the semantic variants are a set of questions generated based on the standardized question through entity decomposition and combination; The semantic variants are input into a preset semantic ranking model for reordering, and the target query question with the highest matching degree is output. The target query question is a preset standard question in the knowledge base that is selected after semantic reordering and has the highest matching degree with the user's question intent. The target query question is used as the retrieval basis to retrieve the standard answer bound to the target query question from the knowledge base. The standard answer is the reply to the user's question.
2. The intelligent question-answering matching method according to claim 1, characterized in that, The step of inputting the semantic variants into a preset semantic ranking model for reordering and outputting the target query question with the highest matching degree includes: The semantic variant is converted into a query vector, and multiple initial candidate questions are retrieved from a preset vector database based on the query vector; wherein, the multiple initial candidate questions refer to questions in the vector database whose vector similarity to the query vector is greater than a preset similarity threshold; The multiple initial candidate questions are input into multiple preset semantic ranking models to obtain a re-ranking list output by each semantic ranking model; wherein, the re-ranking list is a list obtained by each semantic ranking model after calculating the matching score and ranking the multiple initial candidate questions, and the matching score is used to represent the semantic matching degree between the initial candidate questions and the user's question; Based on preset evaluation metrics, the target semantic ranking model with the best ranking effect is selected from the re-ranking list output by each semantic ranking model; wherein, the ranking effect is obtained by evaluating the re-ranking list output by each semantic ranking model using the evaluation metrics. The initial candidate questions whose scores are greater than a preset score threshold in the reordering list output by the target semantic ranking model are determined as the target query questions.
3. The intelligent question-answering matching method according to claim 2, characterized in that, The step of converting the semantic variant into a query vector includes: The semantic variant is encoded to obtain a text vector; wherein the text vector is used to represent the text information in the semantic variant other than geographical features and time features; Geographic entities and time entities are extracted from the semantic variant, and the geographic entities are converted into geographic coordinate vectors and the time entities are converted into time period vectors; wherein, the geographic entities are used to represent the geographic features in the semantic variant, and the time entities are used to represent the time features in the semantic variant; The query vector is obtained by weighting and fusing the text vector, the geographic coordinate vector, and the time period vector.
4. The intelligent question-answering matching method according to claim 1, characterized in that, The step of replacing placeholders in the user's question to generate a standardized question containing placeholders includes: Retrieve multiple entity fields from the user's question; Each entity field is matched with a plurality of preset placeholders to obtain placeholders corresponding to each entity field; Each entity field is replaced with a placeholder corresponding to each entity field to obtain the standardized question containing the placeholder.
5. The intelligent question-answering matching method according to claim 4, characterized in that, Before performing placeholder replacement processing on the user's question to generate a standardized question containing placeholders, the process further includes: The business domain to which the user's question belongs is obtained, and multiple preset initial placeholders are adjusted according to the business domain to obtain the multiple placeholders; wherein, the adjustment is used to make the multiple initial placeholders adapt to the business domain.
6. The intelligent question-answering matching method according to claim 1, characterized in that, The step of performing named entity recognition and decomposition on the standardized query to generate semantic variants of non-overlapping entity combinations includes: Identify multiple named entities in the standardized question, and perform non-overlapping combination of the multiple named entities to generate at least one entity combination; wherein, the multiple named entities are entity words with specific semantic orientations identified from the standardized question, and the entity combination is an entity subset formed by arranging and combining the multiple named entities; The semantic variant is constructed based on the at least one combination of entities.
7. The intelligent question-answering matching method according to claim 1, characterized in that, After reordering the semantic variants by inputting them into a preset semantic ranking model and outputting the target query question with the highest matching degree, the method further includes: The target query question is input into the knowledge base for retrieval, and a standard answer associated with the target query question is obtained. Obtain user feedback data on the standard answer, and iteratively update the model parameters of the semantic ranking model based on the feedback data.
8. The intelligent question-answering matching method according to claim 7, characterized in that, The iterative update of the model parameters of the semantic ranking model based on the feedback data includes: The system acquires the user's interaction sequence with the standard answer, and generates an instant feedback signal when a preset error correction mode is detected in the interaction sequence; wherein, the error correction mode includes the user ignoring multiple standard answers and re-entering the question in the same session. A training dataset is constructed based on the real-time feedback signals, the initial candidate questions corresponding to the multiple ignored standard answers, and the re-entered questions; Using the training dataset as training samples, the semantic ranking model is subjected to online incremental learning to iteratively update the model parameters.
9. An intelligent question-and-answer matching device, characterized in that, include: The first acquisition module is used to acquire user questions; The replacement module is used to perform placeholder replacement processing on the user's question to generate a standardized question containing placeholders; wherein, the placeholder replacement processing is used to replace the specific entities in the user's question with abstract placeholders, and the standardized question is a standardized question text generated after the placeholder replacement processing, in which the specific entities are replaced by placeholders. The decomposition module is used to perform named entity recognition and decomposition on the standardized question to generate semantic variants of non-overlapping entity combinations; wherein, the semantic variants are a set of questions generated based on the standardized question through entity decomposition and combination; The sorting module is used to input the semantic variants into a preset semantic sorting model for reordering and output the target query question with the highest matching degree. The target query question is a preset standard question in the knowledge base that has been filtered after semantic reordering and has the highest matching degree with the user's question intent. The target query question is used as the retrieval basis to retrieve the standard answer bound to the target query question from the knowledge base. The standard answer is the reply to the user's question.
10. An electronic device, characterized in that, include: A processor, and a memory communicatively connected to the processor; The memory stores computer-executed instructions; When the processor executes the computer execution instructions stored in the memory, it is used to implement the intelligent question-answering matching method as described in any one of claims 1 to 8.
11. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the intelligent question-answering matching method as described in any one of claims 1 to 8.
12. A computer program product, characterized in that, It includes a computer program, which, when executed by a processor, is used to implement the intelligent question-answering matching method as described in any one of claims 1 to 8.