Knowledge question and answer method and system, electronic equipment and computer program product

By receiving user input information, extracting features, matching intention tags in the mental health knowledge Q&A system, and performing Q&A output rewrite processing, the problems of high computing cost and inference delay of chat agents in the existing technology are solved, efficient and low-latency Q&A output is achieved, and the anthropomorphism of chat agents is improved.

CN119831047APending Publication Date: 2025-04-15SAIKAI ARTIFICIAL INTELLIGENCE TECHNOLOGY (SHANGHAI) CO LTD
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202411951625.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-27
Publication Date
2025-04-15

AI Technical Summary

Technical Problem

In the open chat scenario in the field of mental health knowledge Q&A, the existing RAG-based open chat chat agents have very expensive calculation costs when frequently conducting real-time online inference, and there is also the problem of reasoning delay, and users have a deep customization of the anthropomorphism of chat agents.

Method used

By receiving user input information, feature extraction is performed, user intention tags matching with users are obtained, and intention matching is performed in combination with target agents and personification instructions. Finally, the Q&A output results are rewritten through the base model inference module to improve the anthropomorphic nature of Q&A output.

Benefits of technology

It reduces the cost of real-time reasoning, reduces the reasoning delay, and significantly improves the anthropomorphism of Q&A output results, meeting users' deep customization needs for the anthropomorphism of chat agents.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119831047A_ABST
    Figure CN119831047A_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field of artificial intelligence, and aims to provide a knowledge question answering method and system, electronic equipment and a computer program product. The method comprises the following steps: receiving user input information of a target user, and sequentially performing feature extraction processing and intention retrieval processing on the user input information to obtain a user intention tag; obtaining a target agent matched with the target user and an anthropomorphic instruction, carrying out intention matching processing on the user intention label and the target agent by adopting a preset routing module, and if the user intention label hits skilled intention information of the target agent, carrying out question-answer matching processing on the user intention label and pre-stored question-answer template data, and target answer data is obtained, the target answer data and the personification instruction are sent to a preset base large model reasoning module for rewriting processing, and a question and answer output result is obtained. According to the method, the real-time reasoning cost can be reduced, the reasoning delay is reduced, and the anthropomorphism of the question and answer output result can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of artificial intelligence technology, and specifically relates to a knowledge question answering method, system, electronic equipment and computer program product. Background Art

[0002] With the development of artificial intelligence technology, RAG (Retrieval-Augmented Generation) technology has emerged. It is an artificial intelligence technology that combines information retrieval and language generation models. The core idea is that when the language model generates answers or texts in the process of knowledge question and answer, it can dynamically retrieve relevant information from the external knowledge base to improve the accuracy, reliability and transparency of the generated content.

[0003] On the technical application side, especially in the scenario of mental health knowledge question and answer, RAG-based chat agents have emerged one after another. These chat agents are committed to simulating human conversation methods and communicating with users in real time to provide users with emotional support, psychological counseling, psychological intervention and other services.

[0004] At present, there are mainly two types of chat agents in the field of mental health knowledge Q&A, one is a goal-oriented functional task type, and the other is a companionship-oriented open chat type.

[0005] Among them, most functional task-based chat agents are based on rule matching or small machine learning models. Such chat agents usually lack accuracy when performing natural language processing. For example, people in different regions have different accents and dialects, the interference of environmental noise, and the ambiguity and ambiguity of language may affect the recognition and understanding capabilities of functional task-based chat agents; in addition, functional task-based chat agents usually lack the depth of semantic understanding. Although they can handle some basic conversations, they still have limitations in understanding complex semantics and contexts. For example, expressions such as metaphors, humor, and sarcasm are often difficult for such chat robots to accurately understand; secondly, the answers of functional task-based chat agents are usually based on template synthesis, which often appear mechanical and stiff, and lack natural fluency. In the field of mental health knowledge questions and answers, this unnatural way of answering may make users feel uncomfortable or misunderstood; in addition, the lack of basic emotional empathy is also a significant defect of functional task-based chat agents.

[0006] Compared with functional task-based chat agents, open chat agents are mostly based on large language models with autoregressive structures, which can effectively improve the above problems of functional task-based chat agents, but at the same time they also lack task-oriented capabilities and become relatively uncontrollable. For this reason, in vertical fields, related applications of open chat agents based on RAG have emerged, which use the flexible and controllable characteristics of information retrieval to enable open chat agents to have task-oriented capabilities.

[0007] However, in the process of using the prior art, the inventor found that the prior art has at least the following problems: In the open chat scenario in the field of mental health knowledge question and answer, the existing RAG-based open chat-type chat agents have very expensive computational costs when frequently performing real-time online reasoning, and there is also the problem of reasoning delay; in addition, in the field of mental health knowledge question and answer, users have a deep customization demand for the anthropomorphism of the chat agent. Summary of the invention

[0008] The present invention aims to solve the above technical problems at least to a certain extent. The present invention provides a knowledge question answering method, system, electronic device and computer program product.

[0009] In order to achieve the above object, the present invention adopts the following technical solutions: In a first aspect, the present invention provides a knowledge question answering method, comprising: Receiving user input information of a target user, and performing feature extraction processing on the user input information to obtain input feature data; Performing intent retrieval processing on the input feature data and the pre-stored structured memory block to obtain a user intent label that matches the user input information; Obtain a target agent and anthropomorphic instructions that match the target user, and use a preset routing module to perform intent matching processing on the user intention label and the target agent. If the user intention label matches the target agent's proficiency intention information, proceed to the next step; The user intention label is matched with the pre-stored question and answer template data to obtain the target answer data, and the target answer data and the anthropomorphic instruction are sent to the preset base large model inference module for rewriting to obtain the question and answer output result, which is then pushed to the target user.

[0010] In a possible design, the input feature data includes a dense vector representation and a sparse vector representation; correspondingly, feature extraction processing is performed on the user input information to obtain input feature data, including: Obtaining a dense vector representation of the user input information based on a preset vector representation model; The user input information is segmented to obtain segmentation data of the user input information, and then the segmentation data is processed using a BM25 algorithm to obtain a sparse vector representation of the user input information.

[0011] In a possible design, the input feature data is subjected to intent retrieval processing with a pre-stored structured memory block to obtain a user intent label matching the user input information, including: Using a cosine similarity method, a K-nearest neighbor algorithm, and a label retrieval method, the input feature data and the pre-stored structured memory blocks are subjected to a memory block similarity retrieval process to obtain three groups of memory block lists, wherein the three groups of memory block lists respectively include correlation ranking results corresponding to the cosine similarity method, the K-nearest neighbor algorithm, and the label retrieval method; The RRF hybrid sorting method is used to weight the relevance sorting results in the three memory block lists to obtain the final memory block list; A user intention label matching the user input information is obtained according to the final memory block list.

[0012] In a possible design, obtaining a target agent and an anthropomorphic instruction matching the target user includes: Obtaining a user profile that matches the target user; Using a preset psychological expert module to obtain a target intelligent agent matching the target user according to the user portrait; Generate anthropomorphic instructions adapted to the base large model reasoning module according to the target intelligent agent.

[0013] In one possible design, after receiving the user input information of the target user, the method further includes: A preset first firewall module is used to perform security filtering on the user input information. If the user input information is hit by the preset rules of the first firewall module, the user input information is subjected to security correction processing through a preset base large model inference module, so that a security correction feedback result matching the user input information is output through the base large model inference module. Otherwise, feature extraction processing is performed on the user input information.

[0014] In a possible design, after obtaining the question-answering output result output by the base large model reasoning module, the method further includes: A preset second firewall module is used to perform security filtering on the question and answer output result. If the question and answer output result is hit by the preset rule of the second firewall module, the question and answer output result is subjected to security correction processing by the base large model reasoning module, so as to output a final question and answer output result matching the question and answer output result through the base large model reasoning module, and then the final question and answer output result is pushed to the target user. Otherwise, the question and answer output result is directly pushed to the target user as the final question and answer output result matching the question and answer output result.

[0015] In a possible design, after obtaining the final question-answer output result, the method further includes: A preset strong intervention strategy is used to perform sensitive word filtering processing on the final question and answer output result to obtain a result after strong intervention processing, and the result after strong intervention processing is pushed to the target user.

[0016] In a second aspect, the present invention provides a knowledge question answering system, which is used to implement a knowledge question answering method as described in any one of the above; the knowledge question answering system comprises: A feature extraction module is used to receive user input information of a target user and perform feature extraction processing on the user input information to obtain input feature data; An intention retrieval module, which is in communication with the feature extraction module and is used to perform intention retrieval processing on the input feature data and the pre-stored structured memory block to obtain a user intention label that matches the user input information; An intention matching module is connected to the intention retrieval module for obtaining a target agent and an anthropomorphic instruction that matches the target user, and uses a preset routing module to perform intention matching processing on the user intention tag and the target agent. If the user intention tag matches the target agent's proficiency intention information, the next step is entered; The question and answer output module is communicatively connected to the intention matching module, and is used to perform question and answer matching processing on the user intention label and the pre-stored question and answer template data to obtain the target answer data, and send the target answer data and the anthropomorphic instruction to the base large model inference module for rewriting processing to obtain the question and answer output result, and then push the question and answer output result to the target user.

[0017] In a third aspect, the present invention provides an electronic device, comprising: a memory for storing computer program instructions; and, A processor is used to execute the computer program instructions to complete the operation of a knowledge question and answer method as described in any one of the above.

[0018] In a fourth aspect, the present invention provides a computer program product, including a computer program or instructions, which, when executed by a computer, implements a knowledge question and answer method as described in any one of the above.

[0019] The beneficial effects of the present invention are: The present invention discloses a knowledge question-answering method, system, electronic device and computer program product, which can reduce the cost of real-time reasoning, reduce reasoning delay, and improve the anthropomorphism of question-answering output results. Specifically, in the implementation process of the present invention, first, user input information of a target user is received, and feature extraction processing is performed on the user input information to obtain input feature data; then, the input feature data is subjected to intention retrieval processing with a pre-stored structured memory block to obtain a user intention label matching the user input information; then, a target intelligent agent and anthropomorphic instruction matching the target user are obtained, and a preset routing module is used to perform intention matching processing on the user intention label and the target intelligent agent. If the user intention label hits the good intention information of the target intelligent agent, the user intention label is subjected to question-answering matching processing with the pre-stored question-answering template data to obtain target answer data, and the target answer data and the anthropomorphic instruction are sent to the base large model reasoning module for rewriting processing to obtain a question-answering output result, and then the question-answering output result is pushed to the target user. During the implementation of the present invention, a user intention label matching the user input information is obtained in advance through feature extraction processing and intent retrieval processing, and then a target intelligent agent and anthropomorphic instructions matching the target user are obtained, so as to further obtain target answer data matching the user input information of the target user. In this process, the present invention can realize intent understanding and filtering based on the front-end routing module, reduce subsequent unnecessary calculations, reduce the cost of real-time reasoning, and reduce reasoning delays. In addition, after obtaining the target answer data, the present invention further rewrites the target answer data according to the anthropomorphic instructions, thereby significantly improving the anthropomorphism of the chat agent.

[0020] Other beneficial effects of the present invention will be further described in the specific embodiments. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] Figure 1 is a flow chart of the knowledge question answering method in the embodiment; Figure 2 is a module block diagram of the knowledge question answering system in the embodiment; Figure 3 is a module block diagram of the electronic device in the embodiment. DETAILED DESCRIPTION

[0022] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the present invention will be briefly introduced below in combination with the drawings and the description of the embodiments or the prior art. Obviously, the following description of the structure of the drawings is only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. It should be noted that the description of these embodiments is used to help understand the present invention, but does not constitute a limitation of the present invention.

[0023] Embodiment 1: This embodiment discloses a knowledge question answering method, which can be executed by, but is not limited to, a computer device or a virtual machine with certain computing resources, such as a personal computer, a smart phone, a personal digital assistant, or a wearable device, or by a virtual machine.

[0024] like Figure 1 As shown, a knowledge question answering method may include but is not limited to the following steps: S1. Receive user input information of the target user, and perform feature extraction processing on the user input information to obtain input feature data; it should be noted that, in this embodiment, feature extraction processing is performed on the user input information, that is, the user input information is converted into numerical feature vectors, and these feature vectors can capture the intrinsic structure and semantic information of the user input information.

[0025] It should be understood that in this embodiment, after receiving the user input information, it is pre-processed by regularization processing, punctuation correction processing and other pre-processing, and then the pre-processed information is subjected to subsequent operations, which can help improve the efficiency and accuracy of subsequent data processing.

[0026] With the promotion and application of AI (artificial intelligence) technology, there are generally higher requirements for the security of chat agents. To this end, this embodiment further makes the following improvements: after receiving the user input information of the target user, the method also includes: The preset first firewall module is used to perform security filtering on the user input information. If the user input information is hit by the preset rules of the first firewall module, the user input information is subjected to security correction processing through the preset base large model reasoning module, so that the base large model reasoning module outputs a security correction feedback result that matches the user input information, otherwise the user input information is subjected to feature extraction processing. That is, in this embodiment, if the user input information is hit by the preset rules of the first firewall module, the user input information is input into the base large model reasoning module for subsequent processing, and a security correction feedback result is obtained. If it is released by the first firewall module, the user input information will continue to undergo subsequent feature extraction processing. It should also be noted that in this embodiment, the first firewall module can also preliminarily filter out non-compliant information such as political, terrorist, and pornographic information in the user input information.

[0027] In step S1 of this embodiment, the input feature data includes dense vector representation and sparse vector representation; correspondingly, in step S1, feature extraction processing is performed on the user input information to obtain input feature data, including: S101. Based on a preset vector representation model, a dense vector representation of the user input information is obtained; based on this, the semantic information of the user input information can be captured, so that texts with similar meanings are closer in the vector space. In this embodiment, the vector representation model is implemented based on the BGE embeeding model of the Zhiyuan Research Institute, which can effectively capture cross-language semantic information and perform well in processing cross-language NLP tasks.

[0028] Specifically, in this embodiment, combined with the historical memory data stored in the storage module, a 768-dimensional vector representation model is trained according to the SimCSE (Simple Contrastive Learning of Sentence Embeddings) method. The vector representation model provides an embedding reasoning interface service, which can be used to encode input text and memory blocks into a 768-dimensional dense tensor.

[0029] S102. Perform word segmentation processing on the user input information to obtain the word segmentation data of the user input information, and then process the word segmentation data using the BM25 algorithm to obtain a sparse vector representation of the user input information. Specifically, in this embodiment, the word segmentation of the user input information is realized by the jieba (a Chinese word segmentation tool) word segmentation based on the hidden Markov model and the Viterbi algorithm. In this process, the preset PsychAI psychological expert vocabulary is used to assist in word segmentation, and the obtained segmentation data is to cut the text in the user input information into phrases connected by spaces. In this embodiment, the BM25 algorithm is a method for evaluating the correlation between queries and documents in information retrieval, which is based on the classic TF-IDF (Term Frequency-Inverse Document Frequency) method, but introduces word frequency saturation and document length normalization. In this embodiment, the BM25 algorithm is combined with the word segmentation method to encode the user input information into a low-dimensional sparse tensor containing word frequency statistics.

[0030] It should be understood that in this embodiment, in step S101, a dense vector representation of the user input information is obtained, and in step S102, a sparse vector representation of the user input information is obtained, and both are parallel feature representation steps.

[0031] S2. Perform intent retrieval processing on the input feature data and the pre-stored structured memory block to obtain a user intent label that matches the user input information; specifically, in this embodiment, the user intent label includes but is not limited to weather, region, and user depth preference information, etc., which are not limited here, and accurate response to the user input information can be achieved based on the user intent label.

[0032] Specifically, a storage module for storing structured memory blocks is preset in this embodiment. During the implementation of this embodiment, historical memory data after privacy encryption is extracted in advance from the Nephola applet independently developed by PsychAI (this is a brand of the applicant in this case) (the first psychological companionship AI application product under PsychAI, with the intelligent body technology structure independently developed by PsychAI as the core technology, which can provide users with a variety of psychological, emotional companionship and emotional values, and can warn users of potential mental health problems), and then the historical memory data is refined and filtered in combination with PsychAI's unique psychological expert data, and then targeted data slicing is performed on it based on the preset special data, and finally structured memory blocks are processed; the structured memory blocks in this embodiment include but are not limited to transcribed memory dialogue blocks, associated memory knowledge blocks, user portraits, and simulated dialogue blocks that integrate the concepts of psychological experts, etc. These structured memory blocks are written into the storage module periodically or in real time, and the storage module provides interface services for other modules to call data.

[0033] It should be noted that, in this embodiment, storing short-term memory data and long-term memory data through the storage module can meet the more complex modeling requirements of this embodiment for memory ability, rather than simply remembering the multiple rounds of conversations above. This enables this embodiment to have greater depth and breadth of memory and stronger memory ability in the mental health knowledge question and answer scenario.

[0034] In step S2, the input feature data and the pre-stored structured memory block are subjected to intention retrieval processing to obtain a user intention label matching the user input information, including: S201. Use the cosine similarity method, K-nearest neighbors (KNN) algorithm and label retrieval method to perform memory block similarity retrieval processing on the input feature data and the pre-stored structured memory blocks, and obtain three groups of memory block lists, and the three groups of memory block lists respectively include correlation sorting results corresponding to the cosine similarity method, K-nearest neighbors algorithm and label retrieval method.

[0035] It should be noted that the cosine similarity method is a commonly used method for measuring the cosine angle between two non-zero tensor directions as similarity. In this embodiment, the correlation ranking result between the input feature data and multiple memory blocks in the pre-stored structured memory block is calculated based on the cosine similarity method; The K nearest neighbor algorithm is used to find the other data points closest to the new data point in the feature space. In this embodiment, it is used to calculate the spatial distance between the input feature data and multiple memory blocks in the pre-stored structured memory blocks, and recall the K nearest memory blocks to obtain the second relevance ranking result; In this embodiment, corresponding vocabulary tags are defined in advance for a plurality of memory blocks in the pre-stored structured memory blocks, and then the input feature data is matched and recalled with the word frequencies in the plurality of memory blocks, so as to obtain a third memory block list.

[0036] S202. Use the RRF (reciprocal ranking fusion) hybrid sorting method to perform weighted processing on the relevance sorting results in the three memory block lists to obtain a final memory block list; specifically, in this embodiment, the final memory block list includes multiple memory blocks related to the input feature data, which constitute a memory document block set.

[0037] Specifically, in this embodiment, the reciprocals of the scores of each memory block in the three memory block lists obtained based on the cosine similarity method, the K nearest neighbor algorithm and the label retrieval method are weightedly accumulated, and the memory blocks are reordered according to the accumulated sum, so as to obtain the final memory block list.

[0038] S203. Obtain a user intention label that matches the user input information according to the final memory block list. It should be noted that, in this embodiment, the user intention label is the intention label of multiple memory blocks sorted by relevance that match the user input information, based on which subsequent intention matching processing of the user input information can be implemented.

[0039] S3. Obtain the target agent and anthropomorphic instructions that match the target user, and use a preset routing module to perform intent matching processing on the user intention label and the target agent. If the user intention label hits the target agent's proficiency intention information, proceed to the next step; otherwise, input the user intention label and the anthropomorphic instructions into the preset base large model inference module for rewriting processing to obtain intent feedback information, and then push the intent feedback information to the target user; specifically, in this embodiment, if the user intention label does not hit the target agent's proficiency intention information, the preset standard reply template is used to rewrite the user intention label so that the user can enter supplementary information.

[0040] In this embodiment, the routing module can be implemented using a machine learning model, which is not limited here.

[0041] In step S3, a target agent and anthropomorphic instructions matching the target user are obtained, including: S301. Obtain a user portrait that matches the target user; specifically, in this embodiment, a user portrait that matches the target user is calculated based on the basic user information entered by the target user during registration and the historical interaction information of the target user during historical interactions. Specifically, the basic user information such as region, gender, age and the target user's tendency to choose a specified test is not limited here.

[0042] S302. Using a preset psychological expert module to obtain a target intelligent entity matching the target user according to the user portrait; Specifically, in this embodiment, the psychological expert module is based on preset psychological expert data, and pre-defines multiple different types of intelligent entities according to different personal information such as personality and hobbies, and multiple intelligent entities are bound to corresponding portrait information such as name, gender, age and biography. They can also be further bound to behavioral guidance information such as the six major personalities, background stories, topics of expertise, interests and hobbies, communication styles and anthropomorphism requirements, so as to improve the anthropomorphism of question and answer output results during the interaction with users, thereby effectively improving the user experience.

[0043] S303. Generate an anthropomorphic instruction adapted to the base large model reasoning module according to the target agent. It should be noted that the anthropomorphic instruction adapted to the base large model reasoning module is an instruction whose format is adapted to the base large model reasoning module and can instruct the base large model reasoning module to perform anthropomorphic processing on input data.

[0044] S4. Perform question-and-answer matching processing on the user intention label and the pre-stored question-and-answer template data to obtain target answer data, and send the target answer data and the anthropomorphic instruction to the base large model inference module for rewriting processing to obtain a question-and-answer output result, and then push the question-and-answer output result to the target user.

[0045] Specifically, in this embodiment, the question and answer template data includes multiple question and answer data such as user frequently used memory question and answer data and simulated question and answer data integrating the concepts of psychological experts, which are stored in the storage module. In the implementation process of this embodiment, the user intention label is funnel matched with multiple different types of question and answer template data to improve the overall efficiency of question and answer matching.

[0046] It should also be noted that, in this embodiment, the base large model inference module can realize the rewriting processing of the received data, which is used to make the data pushed to the target user more in line with the personality characteristics of the target intelligent body, thereby improving the user experience.

[0047] In this embodiment, the base large model reasoning module can be but not limited to using large language models such as DeepSeek-Chat, ChatGPT and Tongyi Qianwenda, which are not limited in this embodiment. Specifically, in this embodiment, the base large model reasoning module uses the open source DeepSeek v2.5 large model of DeepSeek Artificial Intelligence Basic Technology Research Co., Ltd., which has the general capabilities of language models.

[0048] In this embodiment, after obtaining the question-answering output result output by the base large model reasoning module, the method further includes: A preset second firewall module is used to perform security filtering on the question and answer output result. If the question and answer output result is hit by the preset rules of the second firewall module, the question and answer output result is subjected to security correction processing through the base large model reasoning module, so that the final question and answer output result matching the question and answer output result is output through the base large model reasoning module, and then the final question and answer output result is pushed to the target user, otherwise the question and answer output result is directly pushed to the target user as the final question and answer output result matching the question and answer output result. Specifically, in this embodiment, if the question and answer output result is hit by the preset rules of the second firewall module, the second firewall module will synchronously output the hit reason and correction instructions to the base large model reasoning module, so that the base large model reasoning module can perform security correction processing on the question and answer output result.

[0049] In addition, during the implementation of this embodiment, in order to further ensure the security of the output, after the question and answer output result is hit by the preset rules of the second firewall module and the question and answer output result is subjected to security correction processing by the base large model reasoning module, the output data of the large model reasoning module will be transmitted to the second firewall module again for security filtering until the number of filtering times reaches the maximum number of cycles (such as twice), and then the output data of the large model reasoning module will be directly output through the second firewall module.

[0050] In this embodiment, both the first firewall module and the second firewall module are implemented using natural language processing (NLP) technology, and are preset with filtering rules and conditions, etc., so as to realize the information filtering function.

[0051] This embodiment sets the first firewall module and the second firewall module, so that this embodiment has stronger security and stability than other RAG systems during the interaction with users, and can also ensure the lower limit of output content.

[0052] In this embodiment, after obtaining the final question-answer output result, the method further includes: A preset strong intervention strategy is used to filter sensitive words on the final question and answer output result, a result after strong intervention is obtained, and the result after strong intervention is pushed to the target user. Specifically, in this embodiment, the strong intervention strategy refers to a strategy that uses a preset bottom-line rule to filter the final question and answer output result, so as to filter sensitive words, abnormal punctuation marks, abnormal garbled characters and other data in the final question and answer output result, so as to prevent the problem of sensitive words from appearing in the final question and answer output result.

[0053] This embodiment can reduce the cost of real-time reasoning, reduce reasoning delay, and improve the anthropomorphism of question-answering output results. Specifically, during the implementation of this embodiment, first, the user input information of the target user is received, and the user input information is subjected to feature extraction processing to obtain input feature data; then, the input feature data is subjected to intent retrieval processing with the pre-stored structured memory block to obtain a user intent label matching the user input information; then, the target intelligent agent and anthropomorphic instruction matching the target user are obtained, and the user intent label and the target intelligent agent are subjected to intent matching processing using a preset routing module. If the user intent label hits the target intelligent agent's proficiency intention information, the user intent label is subjected to question-answer matching processing with the pre-stored question-answering template data to obtain target answer data, and the target answer data and the anthropomorphic instruction are sent to the base large model reasoning module for rewriting processing to obtain the question-answering output result, and then the question-answering output result is pushed to the target user. During the implementation of this embodiment, a user intention label matching the user input information is obtained in advance through feature extraction processing and intent retrieval processing, and then a target agent and anthropomorphic instructions matching the target user are obtained, so as to further obtain target answer data matching the user input information of the target user. In this process, this embodiment can realize intent understanding and filtering based on the front-end routing module, thereby reducing subsequent unnecessary calculations, reducing the cost of real-time reasoning, and reducing reasoning delays. In addition, after obtaining the target answer data, this embodiment further rewrites the target answer data according to the anthropomorphic instructions, thereby significantly improving the anthropomorphism of the chat agent.

[0054] Embodiment 2: This embodiment discloses a knowledge question answering system for implementing the knowledge question answering method in Embodiment 1; Figure 2 As shown, the knowledge question answering system includes: A feature extraction module is used to receive user input information of a target user and perform feature extraction processing on the user input information to obtain input feature data; An intention retrieval module, which is in communication with the feature extraction module and is used to perform intention retrieval processing on the input feature data and the pre-stored structured memory block to obtain a user intention label that matches the user input information; An intention matching module is connected to the intention retrieval module for obtaining a target agent and an anthropomorphic instruction that matches the target user, and uses a preset routing module to perform intention matching processing on the user intention tag and the target agent. If the user intention tag matches the target agent's proficiency intention information, the next step is entered; The question and answer output module is communicatively connected to the intention matching module, and is used to perform question and answer matching processing on the user intention label and the pre-stored question and answer template data to obtain the target answer data, and send the target answer data and the anthropomorphic instruction to the base large model inference module for rewriting processing to obtain the question and answer output result, and then push the question and answer output result to the target user.

[0055] It should be noted that the working process, working details and technical effects of the knowledge question and answer system provided in this embodiment 2 can be found in embodiment 1 and will not be described in detail here.

[0056] Embodiment 3: Based on Embodiment 1 or 2, this embodiment discloses an electronic device, which may be a smart phone, a tablet computer, a laptop computer, or a desktop computer. The electronic device may be referred to as a user terminal, a portable terminal, a desktop terminal, etc. Figure 3 As shown, the electronic equipment includes: a memory for storing computer program instructions; and, A processor is used to execute the computer program instructions to complete the operation of a knowledge question and answer method as described in any one of Example 1.

[0057] Specifically, the processor 301 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 301 may be implemented in at least one hardware form of DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array). The processor 301 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a CPU (Central Processing Unit); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 301 may be integrated with a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the display screen.

[0058] The memory 302 may include one or more computer-readable storage media, which may be non-transitory. The memory 302 may also include a high-speed random access memory, and a non-volatile memory, such as one or more disk storage devices, flash memory storage devices. In some embodiments, the non-transitory computer-readable storage medium in the memory 302 is used to store at least one instruction, which is used to be executed by the processor 301 to implement the knowledge question answering method provided in Example 1 of the present application.

[0059] In some embodiments, the terminal may further optionally include: a communication interface 303 and at least one peripheral device. The processor 301, the memory 302 and the communication interface 303 may be connected via a bus or a signal line. Each peripheral device may be connected to the communication interface 303 via a bus, a signal line or a circuit board. Specifically, the peripheral device includes: at least one of a radio frequency circuit 304, a display screen 305 and a power supply 306.

[0060] The communication interface 303 may be used to connect at least one peripheral device related to I / O (Input / Output) to the processor 301 and the memory 302. In some embodiments, the processor 301, the memory 302, and the communication interface 303 are integrated on the same chip or circuit board; in some other embodiments, any one or two of the processor 301, the memory 302, and the communication interface 303 may be implemented on a separate chip or circuit board, which is not limited in this embodiment.

[0061] The radio frequency circuit 304 is used to receive and transmit RF (Radio Frequency) signals, also known as electromagnetic signals. The radio frequency circuit 304 communicates with a communication network and other communication devices through electromagnetic signals.

[0062] The display screen 305 is used to display a UI (User Interface). The UI may include any combination of graphics, text, icons, and videos.

[0063] The power supply 306 is used to supply power to various components in the electronic device.

[0064] Embodiment 4: Based on any one of Embodiments 1 to 3, this embodiment discloses a computer program product, including a computer program or instructions, which, when executed by a computer, implements a knowledge question answering method as described in any one of Embodiments 1. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices.

[0065] Obviously, those skilled in the art should understand that the above modules or steps of the present invention can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, and optionally, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present invention is not limited to any specific combination of hardware and software.

[0066] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit them; although the present invention has been described in detail with reference to the above embodiments, a person skilled in the art should understand that the technical solutions described in the above embodiments can still be modified, or some of the technical features can be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A knowledge question answering method, characterized in that: include: Receiving user input information of a target user, and performing feature extraction processing on the user input information to obtain input feature data; Performing intent retrieval processing on the input feature data and the pre-stored structured memory block to obtain a user intent label that matches the user input information; Obtain a target agent and anthropomorphic instructions that match the target user, and use a preset routing module to perform intent matching processing on the user intention label and the target agent. If the user intention label matches the target agent's proficiency intention information, proceed to the next step; The user intention label is matched with the pre-stored question and answer template data to obtain the target answer data, and the target answer data and the anthropomorphic instruction are sent to the preset base large model inference module for rewriting to obtain the question and answer output result, which is then pushed to the target user.

2. A knowledge question answering method according to claim 1, characterized in that: The input feature data includes dense vector representation and sparse vector representation; Correspondingly, feature extraction processing is performed on the user input information to obtain input feature data, including: Obtaining a dense vector representation of the user input information based on a preset vector representation model; The user input information is segmented to obtain segmentation data of the user input information, and then the segmentation data is processed using a BM25 algorithm to obtain a sparse vector representation of the user input information.

3. A knowledge question answering method according to claim 1, characterized in that: Performing intention retrieval processing on the input feature data and the pre-stored structured memory block to obtain a user intention label matching the user input information includes: Using a cosine similarity method, a K-nearest neighbor algorithm, and a label retrieval method, the input feature data and the pre-stored structured memory blocks are subjected to a memory block similarity retrieval process to obtain three groups of memory block lists, wherein the three groups of memory block lists respectively include correlation ranking results corresponding to the cosine similarity method, the K-nearest neighbor algorithm, and the label retrieval method; The RRF hybrid sorting method is used to weight the relevance sorting results in the three memory block lists to obtain the final memory block list; A user intention label matching the user input information is obtained according to the final memory block list.

4. A knowledge question answering method according to claim 1, characterized in that: Obtaining a target agent and anthropomorphic instructions matching the target user, including: Obtaining a user profile that matches the target user; Using a preset psychological expert module to obtain a target intelligent agent matching the target user according to the user portrait; Generate anthropomorphic instructions adapted to the base large model reasoning module according to the target intelligent agent.

5. A knowledge question answering method according to claim 1, characterized in that: After receiving the user input information of the target user, the method further includes: A preset first firewall module is used to perform security filtering on the user input information. If the user input information is hit by the preset rules of the first firewall module, the user input information is subjected to security correction processing through a preset base large model inference module, so that a security correction feedback result matching the user input information is output through the base large model inference module. Otherwise, feature extraction processing is performed on the user input information.

6. A knowledge question answering method according to claim 1, characterized in that: After obtaining the question-answering output result output by the base large model reasoning module, the method further includes: A preset second firewall module is used to perform security filtering on the question and answer output result. If the question and answer output result is hit by the preset rule of the second firewall module, the question and answer output result is subjected to security correction processing by the base large model reasoning module, so as to output a final question and answer output result matching the question and answer output result through the base large model reasoning module, and then the final question and answer output result is pushed to the target user. Otherwise, the question and answer output result is directly pushed to the target user as the final question and answer output result matching the question and answer output result.

7. A knowledge question answering method according to claim 6, characterized in that: After obtaining the final question-answer output result, the method further includes: A preset strong intervention strategy is used to perform sensitive word filtering processing on the final question and answer output result to obtain a result after strong intervention processing, and the result after strong intervention processing is pushed to the target user.

8. A knowledge question answering system, characterized in that: Used to implement a knowledge question answering method as claimed in any one of claims 1 to 7; the knowledge question answering system comprises: A feature extraction module is used to receive user input information of a target user and perform feature extraction processing on the user input information to obtain input feature data; An intention retrieval module, which is in communication with the feature extraction module and is used to perform intention retrieval processing on the input feature data and the pre-stored structured memory block to obtain a user intention label that matches the user input information; An intention matching module is connected to the intention retrieval module for obtaining a target agent and an anthropomorphic instruction that matches the target user, and uses a preset routing module to perform intention matching processing on the user intention tag and the target agent. If the user intention tag matches the target agent's proficiency intention information, the next step is entered; The question and answer output module is communicatively connected to the intention matching module, and is used to perform question and answer matching processing on the user intention label and the pre-stored question and answer template data to obtain the target answer data, and send the target answer data and the anthropomorphic instruction to the base large model inference module for rewriting processing to obtain the question and answer output result, and then push the question and answer output result to the target user.

9. An electronic device, characterized in that: include: a memory for storing computer program instructions; as well as, A processor, configured to execute the computer program instructions to complete the operation of a knowledge question answering method as described in any one of claims 1 to 7.

10. A computer program product comprising a computer program or instructions, characterized in that When the computer program or the instruction is executed by a computer, the computer program or the instruction implements a knowledge question answering method as described in any one of claims 1 to 7.

Citation Information

Cited By

  • AI question and answer method and system based on user intention recognition and multi-module collaboration

    CN121327099A

  • Multi-agent collaboratively-driven power marketing question and answer method

    CN121390283A