Question answering method based on intention recognition, electronic equipment and storage medium

By introducing intent recognition and a multi-level large language model into the question-answering system, the problems of computational complexity and slow response in existing technologies are solved, and fast and efficient question-answering processing and model optimization are achieved.

CN121542398APending Publication Date: 2026-02-17MOBILE TECH COMPANY CHINA TRAVELSKY HLDG
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202610077893.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-01-21
Publication Date
2026-02-17

AI Technical Summary

Technical Problem

Existing question-and-answer systems are computationally complex and have long response times when processing user inquiries, especially due to the high computational resource consumption and low efficiency caused by highly repetitive inquiries.

Method used

The intent recognition method first matches the question text in the intent database. If the match is successful, the standard answer is sent directly. Otherwise, the answer is generated by the first large language model with a small number of parameters. If the accuracy is not enough, the answer is generated by the second or third large language model with a large number of parameters. The decision is made based on the accuracy to store the answer in the database or to build training samples to optimize the model.

Benefits of technology

By generating answers through direct matching and small-parameter models, computational resource consumption is reduced, response time is shortened, and efficiency is improved. Furthermore, the accuracy and reliability of the answers are enhanced through continuous model optimization.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121542398A_ABST
    Figure CN121542398A_ABST
Patent Text Reader

Abstract

The invention provides a question answering method based on intention recognition, electronic equipment and a storage medium, and relates to the technical field of intention recognition, the method comprises the following steps: preferentially matching a target question text with a preset question text, and then generating a first answer text by adopting a first large language model with small parameter quantity; obtaining an answer text corresponding to the target question text; if the accuracy score corresponding to the first answer text obtained based on the second large language model is not less than a preset score, storing the target question text and the first answer text into an intention database; otherwise, performing intention recognition on the target question text through a third large language model to obtain a second answer text, and if an accuracy score corresponding to the second answer text obtained based on the second large language model is not less than a preset score, obtaining a training sample and adding the training sample into a training sample set for performing instruction fine tuning on the first large language model; and the question and answer processing speed, efficiency and resource utilization rate are obviously improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of intent recognition technology, and in particular to a question-and-answer method, electronic device, and storage medium based on intent recognition. Background Technology

[0002] With the widespread adoption of digital service systems, various organizations face a large number of inquiries from internal users. For example, in daily operations, users frequently raise questions about human resources policies, information system operations, and compliance processes. Existing technologies typically employ retrieval-enhanced generative architectures to respond to user inquiries. These systems first semantically match the user-input question text with unstructured or structured data in a knowledge base to retrieve relevant contextual information. Then, this contextual information, along with the question text, is input into a large language model with numerous parameters. This model then generates and outputs the natural language answer corresponding to the question text.

[0003] However, the above method also has the following technical problems: The above method requires obtaining the semantic feature vector of the user-input question text during semantic matching, and calculating the similarity between this semantic feature vector and the semantic feature vectors of unstructured or structured data in the knowledge base to retrieve relevant contextual information. Subsequently, the relevant contextual information and the question text are input into a large language model with a large number of parameters to obtain a natural language answer. This involves multi-stage vector calculation and large-scale model inference, making the overall process complex and computationally expensive. Furthermore, since internal consultation requests within an organization are highly repetitive, the above method performs a complete retrieval and generation process for each question-and-answer request, resulting in a long end-to-end response time, slow speed in obtaining natural language answers, and low efficiency. Summary of the Invention

[0004] To address the aforementioned technical problems, the technical solution adopted by this invention is as follows: According to a first aspect of the present invention, a question-answering method based on intent recognition is provided, the method comprising the following steps: S1. Match the target question text A corresponding to the target user with the preset question text in the intent database.

[0005] S2. If the match is successful, the standard answer text corresponding to the preset question text that matched A will be sent to the target user as the answer text corresponding to A. If the match fails, the first answer text W will be obtained by performing intent recognition on A through the first language model. The first language model has 7 billion trainable parameters.

[0006] S3. Send W as the answer text corresponding to A to the target user, and input A and W into the second language model to obtain the accuracy score corresponding to W; the second language model has 32 billion trainable parameters.

[0007] S4. If the accuracy score corresponding to W is not less than the preset score, then A is used as the preset question text and W is used as the standard answer text corresponding to A, and A and the corresponding standard answer text W are stored in the intent database; otherwise, the intent recognition of A is performed through the third language model to obtain the second answer text C; the third language model has 32 billion trainable parameters.

[0008] S5. If the accuracy score corresponding to C obtained based on the second language model is not less than the preset score, then obtain the training samples and insert the training samples into the training sample set; the question text in the training samples is A, and the standard answer text corresponding to the question text in the training samples is C; the training sample set is used to fine-tune the first language model.

[0009] According to a second aspect of the present invention, a non-transitory computer-readable storage medium is provided, wherein a computer program is stored in the storage medium, and the computer program is loaded and executed by a processor to implement the aforementioned method.

[0010] According to a third aspect of the present invention, an electronic device is provided, comprising: a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the aforementioned method.

[0011] The present invention has at least the following beneficial effects: This invention provides a question-answering method, electronic device, and storage medium based on intent recognition. The method matches the target question text corresponding to the target user with preset question texts in an intent database. If a match is successful, the standard answer text corresponding to the preset question text that matched the target question text is sent to the target user as the answer text corresponding to the target question text. Otherwise, intent recognition is performed on the target question text using a first large language model to obtain a first answer text, which is then sent to the target user as the answer text corresponding to the target question text. Firstly, by directly matching the target question text with preset question texts to obtain the answer text corresponding to the target question text, vector calculation and large-scale model inference are eliminated, reducing computational resource consumption. Secondly, the use of a small-parameter first large language model to generate the answer text corresponding to the target question text effectively shortens the end-to-end response time, enabling rapid acquisition of the answer text corresponding to the target question text and improving efficiency. Simultaneously, based on the second language model, the accuracy score corresponding to the first answer text is obtained. If this accuracy score is not less than a preset score, the target question text and the first answer text are stored in the intent database to support direct matching and reuse of the same question in the future. Otherwise, the third language model is used to perform intent recognition on the target question text to obtain the second answer text. If the accuracy score corresponding to the second answer text obtained based on the second language model is not less than a preset score, training samples are obtained and inserted into the training sample set. The training sample set is used to fine-tune the first language model, thereby achieving continuous optimization of the first language model. It can be seen that this invention significantly improves the speed, efficiency, and resource utilization of question-answering processing. Attached Figure Description

[0012] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0013] Figure 1 This is a flowchart of a question-answering method based on intent recognition provided in an embodiment of the present invention. Detailed Implementation

[0014] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0015] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar tasks and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or server that comprises a series of steps or units is not necessarily limited to those explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or devices.

[0016] Embodiments of the present invention provide a question-answering method based on intent recognition, the method comprising the following steps, such as... Figure 1 As shown: S1. Match the target question text A corresponding to the target user with the preset question text in the intent database.

[0017] Specifically, the target user can be understood as a user who uses the intent-based question-and-answer method.

[0018] Furthermore, the target question text corresponding to the target user can be understood as the question statement asked by the target user.

[0019] Specifically, the intent database includes a hot database and a cold database. Both the hot database and the cold database contain several preset question combinations. Each preset question combination includes a preset question text and the standard answer text corresponding to that preset question text.

[0020] Optionally, the hot database is Redis.

[0021] Optionally, the cold database can be HBase or MySQL.

[0022] S2. If the match is successful, the standard answer text corresponding to the preset question text that matched A will be sent to the target user as the answer text corresponding to A. If the match fails, the first answer text W will be obtained by performing intent recognition on A through the first language model. The first language model has 7 billion trainable parameters.

[0023] Specifically, in this embodiment, a successful match indicates that there is a preset question text identical to A in either the hot database or the cold database; a failed match indicates that there is no preset question text identical to A in either the hot database or the cold database.

[0024] Specifically, the first large language model can be understood as the 7B large language model, where 7B stands for 7Billion, indicating that the large language model has 7 billion trainable parameters.

[0025] Specifically, the first answer text is the answer text generated by the largest language model.

[0026] Specifically, the process of using the first language model to perform intent recognition on A to obtain the first answer text can be understood as follows: A and the preset prompt words corresponding to the intent recognition task are input into the first language model, which then recognizes the intent of A and generates the corresponding answer text based on the intent of A.

[0027] Specifically, the preset prompts for the intent recognition task are used to guide the large language model to recognize the intent of the question text and generate the corresponding answer text based on the intent of the question text.

[0028] S3. Send W as the answer text corresponding to A to the target user, and input A and W into the second language model to obtain the accuracy score corresponding to W; the second language model has 32 billion trainable parameters.

[0029] Specifically, the second largest language model can be understood as the 32B large language model, where 32B stands for 32Billion, indicating that the large language model has 32 billion trainable parameters.

[0030] Specifically, the accuracy score is generated by the second largest language model.

[0031] Specifically, while inputting A and W into the second language model, the preset prompt words corresponding to the accuracy score generation task are also input into the second language model.

[0032] Specifically, the preset prompts for the accuracy score generation task are used to guide the large language model to evaluate the accuracy of the answer text relative to the question text and generate an accuracy score between 0 and 1 to represent the degree of accuracy.

[0033] Through the above steps, the system first obtains the answer text corresponding to the target question text by directly matching the target question text with the preset question text, eliminating the need for vector calculations and large-scale model inference, thus reducing computational resource consumption. Secondly, a small-parameter first-large language model generates the answer text corresponding to the target question text, effectively shortening the end-to-end response time and enabling rapid acquisition of the answer text, thereby improving efficiency. Simultaneously, a larger-parameter second-large language model obtains the accuracy score corresponding to the first answer text. A higher accuracy score indicates a higher degree of accuracy of the first answer text relative to the target question text, enabling a quantitative evaluation of the quality of the generated answers. This allows for the selection of highly reliable question-answer combinations for updating the intent database and provides a basis for determining whether to trigger a larger-parameter third-large language model to generate the answer text corresponding to the target question text and whether to construct new training samples.

[0034] S4. If the accuracy score corresponding to W is not less than the preset score, then A is used as the preset question text and W is used as the standard answer text corresponding to A, and A and the corresponding standard answer text W are stored in the intent database; otherwise, the intent recognition of A is performed through the third language model to obtain the second answer text C; the third language model has 32 billion trainable parameters.

[0035] Specifically, in step S4, A and the corresponding standard answer text W are stored as a preset question combination in the cold database of the intent database.

[0036] In one specific embodiment, the second and third large language models are the same large language model, and the second and third are only used to distinguish the logical roles of the large language model in different tasks.

[0037] In one specific embodiment, the second and third large language models are different large language models.

[0038] Specifically, the second answer text is the answer text generated by the third language model.

[0039] Specifically, the third language model is used to perform intent recognition on A to obtain the second answer text. This can be understood as follows: A and the preset prompt words corresponding to the intent recognition task are input into the third language model, which then recognizes A's intent and generates the corresponding answer text based on A's intent.

[0040] Through the above steps, when the accuracy score corresponding to the first answer text is not less than the preset score, it indicates that the first answer text is accurate for the target question text. In this case, the target answer text is used as the preset question text, and the first answer text is stored in the intent database as the standard answer text corresponding to the preset question text. This allows for updating the intent database, forming reusable knowledge, supporting direct matching and reuse of the same questions in the future, avoiding repeated generation, reducing computational resource consumption, and improving the speed, efficiency, and resource utilization of question-answering processing. Otherwise, it indicates that the first answer text is inaccurate for the target question text. In this case, the third language model with a larger number of parameters is used to perform intent recognition on the target question text to obtain the second answer text. Training samples are constructed based on the target question text and the second answer text and added to the training sample set. By continuously introducing high-quality training samples, the generation capability of the first language model is iteratively optimized, gradually improving the accuracy and reliability of the generated and output answers.

[0041] S5. If the accuracy score corresponding to C obtained based on the second language model is not less than the preset score, then obtain training samples and insert the training samples into the training sample set; the question text in the training samples is A, and the standard answer text corresponding to the question text in the training samples is C; the training sample set is used to fine-tune the first language model.

[0042] If the accuracy score of the second answer text is not less than the preset score after the above steps, it indicates that the second answer text is accurate for the target question text. At this time, training samples are constructed based on the target question text and the second answer text and added to the training sample set. By continuously introducing high-quality training samples, the generation capability of the first language model is iteratively optimized, and the accuracy and reliability of the generated and output answers are gradually improved.

[0043] Specifically, in step S5, A and C are input into the second language model to obtain the accuracy score corresponding to C.

[0044] Specifically, while inputting A and C into the second language model, the preset prompt words corresponding to the accuracy score generation task are also input into the second language model.

[0045] Specifically, the training sample set includes several training samples, each of which includes a question text and the corresponding standard answer text.

[0046] Specifically, the accuracy score should be no less than 0 and no greater than 1.

[0047] Specifically, the preset score is 0.9.

[0048] Through the above steps, the target question text corresponding to the target user is matched with the preset question text in the intent database. If the match is successful, the standard answer text corresponding to the preset question text that matched the target question text is sent to the target user as the answer text corresponding to the target question text. Otherwise, the first large language model is used to perform intent recognition on the target question text to obtain the first answer text, which is then sent to the target user as the answer text corresponding to the target question text. First, by performing a direct match between the target question text and the preset question text to obtain the answer text corresponding to the target question text, no vector calculation or large-scale model inference is required, reducing the consumption of computing resources. Second, the use of a small number of parameters in the first large language model to generate the answer text corresponding to the target question text effectively shortens the end-to-end response time and can quickly obtain the answer text corresponding to the target question text, thus improving efficiency. Simultaneously, based on the second language model, the accuracy score corresponding to the first answer text is obtained. If the accuracy score is not less than a preset score, the target question text and the first answer text are stored in the intent database to support direct matching and reuse of the same question in the future. Otherwise, the third language model is used to perform intent recognition on the target question text to obtain the second answer text. If the accuracy score corresponding to the second answer text obtained based on the second language model is not less than a preset score, training samples are obtained and inserted into the training sample set. The training sample set is used to fine-tune the first language model, thereby achieving continuous optimization of the first language model and significantly improving the speed, efficiency, and resource utilization of question-answering processing.

[0049] Specifically, step S1 includes the following sub-steps: S11. Traverse the hot database and compare A with the preset question text in the hot database character by character.

[0050] S12. If every character of A is exactly the same as a preset question text in the hot database, then the preset question text that is exactly the same as A is taken as the preset question text that is successfully matched with A, and the match is confirmed to be successful; otherwise, traverse the cold database and compare A with the preset question text in the cold database character by character.

[0051] S13. If every character of A is exactly the same as a preset question text in the cold database, then the preset question text that is exactly the same as A is taken as the preset question text that is successfully matched with A, and the match is determined to be successful; otherwise, the match is determined to be unsuccessful.

[0052] Through the above steps, the hot database is first traversed, and the target question text is compared character by character with the preset question texts in the hot database. If every character of the target question text is exactly the same as a preset question text in the hot database, then the preset question text that is exactly the same as the target question text is considered a successful match, and the match is confirmed. Otherwise, the cold database is traversed, and the target question text is compared character by character with the preset question texts in the cold database. If every character of the target question text is exactly the same as a preset question text in the cold database, then the preset question text that is exactly the same as the target question text is considered a successful match, and the match is confirmed. Otherwise, the match is confirmed to have failed. By using a hot and cold database separation and character matching method, frequently accessed preset question texts are placed in the hot database for priority matching, while infrequently accessed or newly entered preset question texts are placed in the cold database for backup. This allows most common questions to be responded to quickly and accurately through high-speed matching, and character matching does not require vector calculation and large-scale model inference, which significantly reduces computational overhead and response latency, and improves the speed, efficiency and resource utilization of question-and-answer processing.

[0053] In one specific embodiment, the method further includes the following steps: S01. When a new training sample is inserted into the training sample set, let count = count + 1; count is the number of times the training sample set is updated, and count is initially 0.

[0054] S02. When count=G, based on the current training sample set, the LoRA method is used to fine-tune the first language model and count=0; where G is the preset number of updates, which is determined by those skilled in the art according to actual needs, such as 800, 1000, 1500, 3000, which will not be elaborated here.

[0055] In one specific embodiment, at each first preset fixed time interval, the first large language model is fine-tuned using the LoRA method based on the current training sample set; the first preset fixed time interval is a time interval preset by those skilled in the art according to actual needs, such as 7 days, 14 days, 21 days, 28 days, which will not be elaborated here.

[0056] Through the above steps, after the training sample set has been updated a certain number of times, or at a first preset fixed interval, the LoRA method is used to fine-tune the first language model based on the current training sample set, so as to achieve continuous optimization of the first language model. Since LoRA only needs to train the low-rank adaptation parameters, rather than the entire model parameters, it significantly reduces the computational resource requirements and memory usage during the fine-tuning process, improving fine-tuning efficiency and deployment feasibility while ensuring model performance. Furthermore, using the LoRA method to fine-tune the first language model reduces storage costs and computational complexity, while enabling the first language model to quickly adapt to high-quality question-answering experience, continuously improving the accuracy and reliability of the generated answers.

[0057] In one specific embodiment, the method further includes the following steps: S10. At each second preset fixed time interval, obtain the number of times the standard answer text corresponding to each preset question text is recalled within the historical time period corresponding to the current time point.

[0058] Specifically, the end time of the historical time period corresponding to the current time point is the current time point, and the duration of the historical time period is the second preset fixed duration.

[0059] Specifically, the second preset fixed duration is a duration preset by those skilled in the art according to actual needs, such as 10 days, 20 days, or 30 days, which will not be elaborated here.

[0060] Specifically, the recall count of a standard answer text can be understood as the number of times a standard answer text is used as the answer text corresponding to a target question text. For example, if a standard answer text is used as the answer text corresponding to 10 target question texts within the historical time period corresponding to the current time point, then the recall count of that standard answer text is 10.

[0061] S20. For each preset question text, if the preset question text is currently in the hot database and the recall number of the standard answer text corresponding to the preset question text is less than the preset recall number, then the preset question combination corresponding to the preset question text is migrated to the cold database; if the preset question text is currently in the cold database and the recall number of the standard answer text corresponding to the preset question text is not less than the preset recall number, then the preset question combination corresponding to the preset question text is migrated to the hot database.

[0062] Specifically, the preset recall number is the number of recalls pre-set by those skilled in the art according to actual needs, such as 5, 10, or 15, which will not be elaborated here.

[0063] Through the above steps, at each second preset fixed time interval, the storage location of the preset question combination corresponding to the preset question text is dynamically adjusted based on the comparison result of the recall number of the standard answer text corresponding to each preset question text and the preset recall number. This ensures that the hot database always stores the preset question text that is accessed frequently, while the cold database always stores the preset question text that is accessed infrequently or newly entered. This is beneficial to improving the matching hit rate and response speed between the target question text and the preset question text.

[0064] In one specific embodiment, the method further includes the following steps: S100. When the number of preset question combinations in the hot database reaches the first preset number threshold, a preset clustering algorithm is used to cluster the first fuzzy hash values ​​corresponding to all preset question texts in the hot database to obtain several clusters.

[0065] Specifically, each cluster includes several first fuzzy hash values.

[0066] Specifically, the first preset quantity threshold is a value preset by those skilled in the art according to actual needs, such as 500, 800, 1000, which will not be elaborated here.

[0067] Specifically, the preset clustering algorithm is one that does not require presetting the number of clusters, such as DBSCAN, which will not be elaborated on here.

[0068] Specifically, the preset question text is processed based on a preset fuzzy hash algorithm to obtain the first fuzzy hash value corresponding to the preset question text.

[0069] Specifically, before processing the preset question text based on the preset fuzzy hash algorithm to obtain the first fuzzy hash value corresponding to the preset question text, the preset question text is cleaned.

[0070] Specifically, the preset fuzzy hash algorithm is a fuzzy hash algorithm pre-selected by those skilled in the art based on actual needs, such as TLSH, which will not be elaborated here.

[0071] S200. Obtain the key fuzzy hash value corresponding to each cluster; the key fuzzy hash value is the first fuzzy hash value in the cluster that is closest to the cluster center.

[0072] Optionally, the Hamming distance between the first fuzzy hash value in the cluster and the fuzzy hash value corresponding to the cluster center of the cluster can be used as the distance between the first fuzzy hash value and the cluster center of the cluster.

[0073] Specifically, the fuzzy hash value corresponding to the cluster center of a cluster is obtained by averaging all the first fuzzy hash values ​​within that cluster.

[0074] S300. For each cluster, delete the preset question combinations corresponding to the preset question texts of all first fuzzy hash values ​​in the cluster, except for the key fuzzy hash value, from the hot database so as to update the hot database.

[0075] Specifically, when the number of preset problem combinations in the cold database reaches the second preset threshold, the cold database is updated; wherein, the cold data is updated in the same way as the hot database is updated in steps S100-S300.

[0076] Specifically, the second preset quantity threshold is a value that is greater than the first preset quantity threshold, which is preset by those skilled in the art according to actual needs, such as 2000, 3000, 4000, and will not be elaborated here.

[0077] Through the above steps, when the number of preset question combinations in the hot database reaches a first preset threshold, a preset clustering algorithm is used to cluster the first fuzzy hash values ​​corresponding to all preset question texts in the hot database to obtain several clusters. The preset question texts corresponding to the first fuzzy hash values ​​within the same cluster are semantically similar. The key fuzzy hash value corresponding to each cluster is obtained; the key fuzzy hash value is the first fuzzy hash value closest to the cluster center. For each cluster, all preset question combinations corresponding to the preset question texts corresponding to the first fuzzy hash values ​​(excluding the key fuzzy hash value) in the cluster are deleted from the hot database to update the hot database. The most representative preset question text corresponding to each cluster, i.e., the preset question combination corresponding to the preset question text corresponding to the key fuzzy hash value, is retained, and all preset question combinations corresponding to the preset question texts corresponding to the first fuzzy hash values ​​(excluding the key fuzzy hash value) in the cluster are deleted. This effectively controls the hot data. The number of preset question combinations in the database is controlled to prevent several preset question combinations with the same semantics but different characters from existing ones from existing ones in the hot database. Similarly, when the number of preset question combinations in the cold database reaches a second preset threshold, the cold database is updated in the same way as the hot database. This effectively controls the number of preset question combinations in the cold database and prevents several preset question combinations with the same semantics but different characters from existing ones from existing ones. Therefore, through the above steps, the expansion of the intent database caused by the accumulation of question expression variations can be prevented, redundant storage can be reduced, matching traversal time can be reduced, and matching efficiency can be improved.

[0078] The present invention also provides a specific embodiment, which differs from the above embodiment in that the preset question combination also includes a first fuzzy hash value of the preset question text.

[0079] Specifically, step S1 includes the following sub-steps: S101. Process A based on a preset fuzzy hash algorithm to obtain the second fuzzy hash value corresponding to A.

[0080] S102. Traverse the hot database and compare the second fuzzy hash value corresponding to A with the first fuzzy hash value in the hot database. S103. If the second fuzzy hash value corresponding to A is the same as a first fuzzy hash value in the hot database, then the preset question text corresponding to the first fuzzy hash value that is the same as the second fuzzy hash value corresponding to A is taken as the preset question text that is successfully matched with A and the match is confirmed to be successful; otherwise, traverse the cold database and compare the second fuzzy hash value corresponding to A with the first fuzzy hash value in the cold database. S104. If the second fuzzy hash value corresponding to A is the same as a first fuzzy hash value in the cold database, then the preset question text corresponding to the first fuzzy hash value that is the same as the second fuzzy hash value corresponding to A is taken as the preset question text that successfully matches A and the match is confirmed to be successful; otherwise, the match is confirmed to be unsuccessful.

[0081] Specifically, in this embodiment, a successful match indicates that there is a preset question text in the hot database or cold database, whose corresponding first fuzzy hash value is the same as the second fuzzy hash value corresponding to A; a failed match indicates that there is no preset question text in either the hot database or the cold database whose corresponding first fuzzy hash value is the same as the second fuzzy hash value corresponding to A.

[0082] Through the above steps, the target question text is first processed using a preset fuzzy hash algorithm to obtain a second fuzzy hash value. Then, the hot database and cold database are traversed sequentially, and the second fuzzy hash value is compared with the first fuzzy hash value corresponding to each preset question text. If a first fuzzy hash value that is the same as the second fuzzy hash value exists, the match is considered successful, and the corresponding standard answer text is returned; otherwise, the match is considered unsuccessful. Matching based on fuzzy hash values ​​achieves automatic identification and matching of semantically similar questions without relying on large language models or vector calculations, effectively improving the hit rate of high-frequency variant questions, while maintaining low computational overhead and high processing efficiency.

[0083] Embodiments of the present invention also provide a non-transitory computer-readable storage medium that can be disposed in an electronic device to store a computer program related to implementing a method in the method embodiments, the computer program being loaded and executed by the processor to implement the method provided in the above embodiments.

[0084] Embodiments of the present invention also provide an electronic device, including: a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the method provided in the above embodiments.

[0085] Embodiments of the present invention also provide a computer program product including program code, which, when the program product is run on an electronic device, causes the electronic device to perform the steps of the methods described above in various exemplary embodiments of the present invention.

[0086] This invention provides a question-answering method, electronic device, and storage medium based on intent recognition. The method matches the target question text corresponding to the target user with preset question texts in an intent database. If a match is successful, the standard answer text corresponding to the preset question text that matched the target question text is sent to the target user as the answer text corresponding to the target question text. Otherwise, intent recognition is performed on the target question text using a first large language model to obtain a first answer text, which is then sent to the target user as the answer text corresponding to the target question text. Firstly, by directly matching the target question text with preset question texts to obtain the answer text corresponding to the target question text, vector calculation and large-scale model inference are eliminated, reducing computational resource consumption. Secondly, the use of a small-parameter first large language model to generate the answer text corresponding to the target question text effectively shortens the end-to-end response time, enabling rapid acquisition of the answer text corresponding to the target question text and improving efficiency. Simultaneously, based on the second language model, the accuracy score corresponding to the first answer text is obtained. If this accuracy score is not less than a preset score, the target question text and the first answer text are stored in the intent database to support direct matching and reuse of the same question in the future. Otherwise, the third language model is used to perform intent recognition on the target question text to obtain the second answer text. If the accuracy score corresponding to the second answer text obtained based on the second language model is not less than a preset score, training samples are obtained and inserted into the training sample set. The training sample set is used to fine-tune the first language model, thereby achieving continuous optimization of the first language model. It can be seen that this invention significantly improves the speed, efficiency, and resource utilization of question-answering processing.

[0087] While specific embodiments of the invention have been described in detail by way of examples, those skilled in the art should understand that the examples are for illustrative purposes only and are not intended to limit the scope of the invention. Those skilled in the art should also understand that various modifications can be made to the embodiments without departing from the scope and spirit of the invention.

Claims

1. A question-answering method based on intent recognition, characterized in that, The method includes the following steps: S1. Match the target question text A corresponding to the target user with the preset question text in the intent database; S2. If the match is successful, the standard answer text corresponding to the preset question text that matched A will be sent to the target user as the answer text corresponding to A. If the match fails, the first answer text W will be obtained by performing intent recognition on A through the first language model. The first language model has 7 billion trainable parameters. S3. Send W as the answer text corresponding to A to the target user, and input A and W into the second language model to obtain the accuracy score corresponding to W; the second language model has 32 billion trainable parameters; S4. If the accuracy score corresponding to W is not less than the preset score, then A is used as the preset question text and W is used as the standard answer text corresponding to A, and A and the corresponding standard answer text W are stored in the intent database; otherwise, the intent recognition of A is performed through the third language model to obtain the second answer text C; the third language model has 32 billion trainable parameters. S5. If the accuracy score corresponding to C obtained based on the second language model is not less than the preset score, then obtain training samples and insert the training samples into the training sample set; the question text in the training samples is A, and the standard answer text corresponding to the question text in the training samples is C; the training sample set is used to fine-tune the first language model.

2. The question-answering method based on intent recognition according to claim 1, characterized in that, The intent database includes a hot database and a cold database. Both the hot database and the cold database contain several preset question combinations. Each preset question combination includes a preset question text and the standard answer text corresponding to that preset question text.

3. The question-answering method based on intent recognition according to claim 2, characterized in that, Step S1 includes the following sub-steps: S11. Traverse the hot database and compare A with the preset question text in the hot database character by character. S12. If every character of A is exactly the same as a preset question text in the hot database, then the preset question text that is exactly the same as A is taken as the preset question text that is successfully matched with A, and the match is confirmed to be successful; otherwise, traverse the cold database and compare A with the preset question text in the cold database character by character. S13. If every character of A is exactly the same as a preset question text in the cold database, then the preset question text that is exactly the same as A is taken as the preset question text that is successfully matched with A, and the match is determined to be successful; otherwise, the match is determined to be unsuccessful.

4. The question-answering method based on intent recognition according to claim 2, characterized in that, In step S4, A and the corresponding standard answer text W are stored as a preset question combination in the cold database of the intent database.

5. The question-answering method based on intent recognition according to claim 1, characterized in that, In step S5, A and C are input into the second language model to obtain the accuracy score corresponding to C.

6. The question-answering method based on intent recognition according to claim 1, characterized in that, The training sample set includes several training samples, each of which includes a question text and the corresponding standard answer text.

7. The question-answering method based on intent recognition according to claim 1, characterized in that, The accuracy score is no less than 0 and no greater than 1.

8. The question-answering method based on intent recognition according to claim 1, characterized in that, The default score is 0.

9.

9. A non-transitory computer-readable storage medium, characterized in that, The storage medium stores a computer program, which is loaded and executed by a processor to implement the intent-based question-answering method as described in any one of claims 1-8.

10. An electronic device, comprising: A processor, a memory, and a computer program stored in the memory and executable on the processor, characterized in that, when the processor executes the computer program, it implements the intent-based question-answering method as described in any one of claims 1-8.

Citation Information

Patent Citations

  • Model deployment method, end side equipment and storage medium

    CN118135377A

  • Automatic question answering method and device, electronic equipment and storage medium

    CN119088931A

  • Large model optimization method, related device and storage medium

    CN119129643A

  • Image deduplication method and device, electronic equipment and storage medium

    CN120431355A

  • Question answering method and language model training method, apparatus, device, and storage medium

    US20210191962A1