Question and answer method, device, system and equipment
By acquiring user roles and question types, matching question handling strategies, and generating personalized answers, the problem of existing question-and-answer systems being unable to provide personalized answers is solved, improving the applicability and accuracy of the question-and-answer system and meeting the needs of different users.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-02-28
- Publication Date
- 2026-04-03
AI Technical Summary
Existing question-answering systems cannot provide personalized answers with different levels and details based on user roles and scenarios, resulting in low applicability. Furthermore, the knowledge base update mechanism is lagging behind, and the answers may be outdated or incorrect.
By acquiring user role information and question type, problem-solving strategies are matched. Based on user role information, original knowledge text, and problem-solving strategies, personalized answers are generated. Combining vector retrieval and keyword retrieval, artificial intelligence (AI) models are used to generate answers, and the knowledge base is updated based on user feedback.
It has implemented role-adaptive question-and-answer functionality, which improves the applicability of the question-and-answer system and the accuracy of the answers, meets the real needs of different users, reduces information redundancy or insufficiency, and enhances user satisfaction and work efficiency.
Smart Images

Figure CN121786170A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of intelligent question answering technology, and in particular to a question answering method, apparatus, system and device. Background Technology
[0002] A question-answering system is an intelligent system that can receive questions posed by users in natural language, automatically understand the intent of the questions, retrieve, reason, and generate information from sources such as knowledge bases, documents, databases, or the Internet, and finally return accurate answers.
[0003] In related technologies, question-answering systems typically use a single semantic similarity to match query questions and answers, providing the same standardized answers to all users without differentiation.
[0004] However, in real-world problems, different people have completely different focuses and required levels of knowledge when addressing the same issue. Existing question-and-answer systems cannot provide personalized answers at different levels and with varying levels of detail, resulting in low applicability. Summary of the Invention
[0005] The purpose of this application is to provide a question-and-answer method, apparatus, system, and device that can provide different and targeted answer information for queries raised by different users, realize role-adaptive question-and-answer function, and improve the applicability of the question-and-answer system.
[0006] To achieve the above objectives, this application adopts the following technical solution: Firstly, this application provides a question-and-answer method, which includes: The process involves: obtaining the user role information of the user initiating the session, where the user role information indicates the user's identity category; identifying the question type based on the query question entered by the user in the session; retrieving the knowledge base based on the query question to obtain the original knowledge text associated with the query question, where the original knowledge text indicates the unmodified knowledge fragment related to the query question; matching the question processing strategy based on the user role information and the question type to obtain a question processing strategy suitable for the user, where the question processing strategy indicates the processing rules for the retrieved original knowledge text; and obtaining the answer information corresponding to the query question based on the user role information, the original knowledge text, and the question processing strategy.
[0007] The technical solution provided in this application matches question-handling strategies based on user role information and question type to obtain a question-handling strategy suitable for the user. Then, based on user role information, original knowledge text, and question-handling strategy, the answer information corresponding to the query question is obtained. It can personalize the original knowledge text related to the query question retrieved from the knowledge base according to the question-handling strategies corresponding to different user role information and question types, accurately generate answer information suitable for different users, and thus realize role-adaptive question-and-answer function, improving the applicability of the question-and-answer system.
[0008] In some embodiments, based on the query question, a retrieval is performed in the knowledge base to obtain the original knowledge text associated with the query question. Specifically, this can be implemented by performing vector retrieval and / or keyword retrieval in the knowledge base based on the query question to obtain the original knowledge text associated with the query question.
[0009] In some embodiments, based on the query question, vector retrieval is performed in the knowledge base to obtain the original knowledge text associated with the query question. Specifically, this can be implemented by: vectorizing the query question to obtain a query vector; calculating the cosine similarity value between the query vector and the corresponding vectors of the original knowledge text recorded in the knowledge base to obtain the original knowledge text associated with the query question.
[0010] In some embodiments, based on the query question, a keyword search is performed in the knowledge base to obtain the original knowledge text associated with the query question. Specifically, this can be implemented by: obtaining keywords from the query question; and then performing a keyword search in the knowledge base based on those keywords to obtain the original knowledge text associated with the query question.
[0011] In some embodiments, based on the query question, vector retrieval and keyword retrieval are performed in the knowledge base to obtain the original knowledge text associated with the query question. Specifically, this can be implemented as follows: the query question is vectorized to obtain a query vector; the cosine similarity value between the query vector and the corresponding vectors of the original knowledge text recorded in the knowledge base is calculated to obtain the first original knowledge text; keywords in the query question are obtained; based on the keywords, keyword retrieval is performed in the knowledge base to obtain the second original knowledge text; the first and second original knowledge texts are sorted, and the original knowledge text associated with the query question is selected.
[0012] In some embodiments, the answer information corresponding to the query question is obtained based on user role information, original knowledge text, and question processing strategy. Specifically, this can be implemented by: generating query suggestions based on user role information, original knowledge text, and question processing strategy, wherein the query suggestions indicate the process of generating the answer information; and then invoking an artificial intelligence (AI) model to generate the answer information based on the query suggestions.
[0013] In some embodiments, query suggestions are generated based on user role information, original knowledge text, and problem handling strategies. Specifically, this can be achieved by: obtaining a query suggestion template; filling the query suggestion template with user role information, original knowledge text, and problem handling strategies; and generating query suggestions.
[0014] In some embodiments, the question-answering method provided in this application further includes: obtaining user feedback information, wherein the user feedback information is used to describe the user's feedback on the answer information corresponding to the query question; and updating the knowledge base based on the user feedback information.
[0015] Secondly, a question-answering device is provided, which includes: an acquisition module, a classification module, a retrieval module, a matching module, and a generation module.
[0016] The aforementioned acquisition module is used to acquire the user role information of the user who initiated the session, wherein the user role information is used to indicate the user's identity category.
[0017] The aforementioned classification module is used to identify the question type of a query based on the query question entered by the user in the session.
[0018] The aforementioned retrieval module is used to search the knowledge base based on the query question to obtain the original knowledge text associated with the query question. The original knowledge text is used to indicate the unmodified knowledge fragments related to the query question.
[0019] The matching module described above is used to match problem-handling strategies based on user role information and problem type to obtain problem-handling strategies suitable for the user. The problem-handling strategy is used to indicate the processing rules for the retrieved knowledge text.
[0020] The aforementioned generation module is used to obtain the answer information corresponding to the query question based on user role information, original knowledge text, and question processing strategy.
[0021] In some embodiments, the retrieval module described above is further configured to: perform vector retrieval and / or keyword retrieval in the knowledge base based on the query question to obtain the original knowledge text associated with the query question.
[0022] In some embodiments, the retrieval module is further configured to: vectorize the query question to obtain a query vector; calculate the cosine similarity value between the query vector and the vector corresponding to the original knowledge text recorded in the knowledge base to obtain the original knowledge text associated with the query question.
[0023] In some embodiments, the retrieval module described above is further configured to: obtain keywords from the query question; and perform a keyword search in the knowledge base based on the keywords to obtain the original knowledge text associated with the query question.
[0024] In some embodiments, the retrieval module is further configured to: vectorize the query question to obtain a query vector; calculate the cosine similarity value between the query vector and the vector corresponding to the original knowledge text recorded in the knowledge base to obtain the first original knowledge text; obtain keywords from the query question; and perform keyword retrieval in the knowledge base based on the keywords to obtain the second original knowledge text; and sort the first and second original knowledge texts to filter out the original knowledge texts associated with the query question.
[0025] In some embodiments, the generation module is further configured to: generate query suggestions based on user role information, original knowledge text, and question processing strategy, wherein the query suggestions are used to indicate the process of generating answer information; and invoke an artificial intelligence (AI) model to generate answer information based on the query suggestions, thereby obtaining the answer information.
[0026] In some embodiments, the above-described generation module is further configured to: obtain a query suggestion template; fill in user role information, original knowledge text, and problem handling strategy into the query suggestion template to generate query suggestions.
[0027] In some embodiments, the question-answering device provided in this application further includes an update module, which is configured to: obtain user feedback information, wherein the user feedback information describes the user's feedback on the answer information corresponding to the query question; and update the knowledge base based on the user feedback information.
[0028] The technical effects of any implementation method in the second aspect can be found in the technical effects of any implementation method in the first aspect mentioned above, and will not be repeated here.
[0029] Thirdly, a question-and-answer system is provided, which includes multiple modules that work together to implement the question-and-answer method described above.
[0030] Fourthly, a computer device is provided, comprising: a processor and a memory, wherein the memory stores at least one computer program, and the at least one computer program is loaded and executed by the processor to implement the question-and-answer method described above.
[0031] The solutions provided in the third and fourth aspects above are used to implement the method provided in the first aspect above, and their specific implementations will not be described in detail here. The technical effects corresponding to any implementation method of the solutions provided in the third and fourth aspects above can be found in the technical effects corresponding to any implementation method in the first aspect above, and will not be described in detail here.
[0032] It should be noted that any of the possible implementations of any of the above aspects can be combined, provided that the solutions do not contradict each other. Attached Figure Description
[0033] To more clearly illustrate the technical solutions of the embodiments of this application, the drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0034] Figure 1 A schematic diagram of a system architecture for a question-answering method provided as an exemplary embodiment; Figure 2 A flowchart illustrating a question-and-answer method provided as an exemplary embodiment; Figure 3 A flowchart illustrating another question-answering method provided for an exemplary embodiment; Figure 4 A schematic diagram of the structure of a question-answering system provided as an exemplary embodiment; Figure 5 A schematic diagram of the structure of a question-and-answer device is provided for an exemplary embodiment; Figure 6 A schematic diagram of the structure of a computer device provided for an exemplary embodiment. Detailed Implementation
[0035] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0036] In the description of this application, it should be understood that the terms "upper," "lower," "left," "right," "front," "rear," "inner," and "outer," etc., indicate the orientation or positional relationship based on the orientation or relative positional relationship shown in the accompanying drawings. They are used only for the convenience of describing this application and for simplification, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on this application. Unless otherwise specified, the above-mentioned orientational descriptions can be flexibly set in practical applications, provided that the relative positional relationships shown in the accompanying drawings are satisfied.
[0037] The terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of this application, unless otherwise stated, "a plurality of" means two or more.
[0038] In the description of this application, it should be noted that, unless otherwise expressly specified and limited, the terms "installation," "connection," "linking," and "communication" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection. They can refer to a direct connection or an indirect connection through an intermediate medium, or a connection within two components. Those skilled in the art can understand the specific meaning of the above terms in this application according to the specific circumstances.
[0039] In embodiments of this application, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, article, or apparatus that includes that element.
[0040] In the embodiments of this application, the terms "exemplary" or "for example" are used to indicate that something is an example, illustration, or description. Any embodiment or design that is described as "exemplary" or "for example" in the embodiments of this application should not be construed as being more preferred or advantageous than other embodiments or design. Specifically, the use of the terms "exemplary" or "for example" is intended to present the relevant concepts in a specific manner.
[0041] In the embodiments of this application, at least one can also be described as one or more, and multiple can be two, three, four or more, and this application does not impose any restrictions.
[0042] In the description of this specification, specific features, structures, materials, or characteristics may be combined in any suitable manner in one or more embodiments or examples.
[0043] To facilitate understanding, the terms used in the embodiments of this application will be explained first.
[0044] Large Language Models (LLMs): These are the core engine technologies of modern question-answering systems. Represented by Generative Pre-trained Transformers (GPT) and Bidirectional Encoder Representations from Transformers (BERT), large language models, through learning from massive amounts of text data, possess powerful natural language understanding and text generation capabilities. They can parse the intent of the user's input question and organize it into logically and grammatically correct answers.
[0045] Retrieval-Augmented Generation (RAG) architecture: To address the issues of stale knowledge and potential "illusions" (i.e., fabricated facts) in large language models, RAG has become a well-known and mature technical framework. This architecture divides the question-answering process into two steps by attaching a real-time updated knowledge base to the large language model: First, the most relevant knowledge fragments are precisely retrieved from the knowledge base based on the user's question; then, these retrieved, reliable knowledge fragments, along with the original question, are provided to the large language model, instructing it to generate the final answer based on these "reference materials." This ensures the accuracy and timeliness of the answer.
[0046] The concept of Artificial Intelligence Agent (AI-Agent) technology: AI-Agent is a more advanced intelligent system design concept that transcends simple question-and-answer models. It transforms the AI model from a passive "responder" into an "executor" capable of autonomously planning, decomposing tasks, and invoking tools. An agent can intelligently determine the type of query received based on preset goals and autonomously choose the optimal processing path—for example, whether to directly query the database, provide a simplified explanation, or transfer the question to a human for processing.
[0047] Natural Language Processing (NLP) is an important research direction in the field of artificial intelligence. It integrates knowledge from multiple disciplines such as linguistics, computer science, machine learning, mathematics, and cognitive psychology. It is an interdisciplinary field that combines computer science, artificial intelligence, and linguistics, encompassing two main aspects: natural language understanding and natural language generation. Its research content includes multiple levels such as characters, words, phrases, sentences, paragraphs, and texts, serving as a bridge between machine language and human language. Its aim is to enable machines to understand, interpret, and generate human language, achieving effective communication between humans and machines, and enabling computers to perform tasks such as language translation, sentiment analysis, and text summarization.
[0048] It should be noted that all information (including but not limited to device information, personal information of the subject), data (including but not limited to data used for analysis, stored data, and displayed data), and signals involved in this application have been authorized by the subject or by all parties in full, and the collection, use, and processing of related data must comply with relevant laws, regulations, and standards. For example, user identity information and original knowledge texts in the knowledge base involved in this application were obtained with full authorization.
[0049] Industry-standard question-answering methods primarily involve performing semantic similarity searches on the user's input query, then integrating the retrieved content to generate answer information. The following is a brief explanation of these industry-standard question-answering methods.
[0050] For example, after a user inputs a question into the question-answering system, the system parses the user's input question, identifies the keywords in the question, and then uses retrieval and matching algorithms based on the keywords to find the most relevant answer to the user's input question. Finally, it generates an easy-to-understand answer text based on the context of the user's input question.
[0051] However, the aforementioned keyword-based search solutions provide standardized, undifferentiated answers to all users. In reality, department staff, technical personnel, and management have completely different focuses and knowledge requirements for the same question. Existing question-and-answer systems cannot provide personalized answers at different levels and with varying levels of detail based on user roles and scenarios. This leads to a serious disconnect between the answers and users' actual needs. For some users, the answers are redundant and difficult to understand, while for others, the answers are insufficient and lack guidance. For example, the question-and-answer system cannot distinguish whether the questioner is "management" requiring macro-level decision-making or "technical personnel" needing specific operational guidance; it can only output a standardized, undifferentiated answer that is the same for all users, resulting in low usability of the question-and-answer system.
[0052] On the other hand, the knowledge base update mechanism of industry-standard question-answering systems (especially those based on general large models) is essentially passive, relying on one-time construction or manual periodic maintenance. Understandably, the update frequency and coverage of the knowledge base inevitably lag behind the frequent revisions and publications of metrology standards, regulations, and operating procedures. Therefore, when metrology standards, procedures, or specifications change, the question-answering system cannot acquire the latest knowledge, leading to the risk of outdated or even erroneous answers. In metrology operations with extremely high requirements for accuracy and compliance, operating based on outdated information will directly cause work quality problems and even serious business compliance risks.
[0053] Based on this, this application provides a question-answering method that matches question-handling strategies based on user role information and question type to obtain a question-handling strategy suitable for the user. Then, based on user role information, original knowledge text, and question-handling strategy, the answer information corresponding to the query question is obtained. This method can personalize the original knowledge text retrieved from the knowledge base that is related to the query question according to different user role information and question-handling strategies corresponding to different question types, accurately generating answer information suitable for different users, thereby achieving role-adaptive question-answering functionality and improving the applicability of the question-answering system.
[0054] Figure 1 A schematic diagram of a system architecture for a question-answering method provided as an exemplary embodiment, such as... Figure 1 As shown, the system includes: a computer device 101, which can be implemented as a terminal or a server. Figure 1 The diagram shows the case where computer device 101 is a terminal (computer).
[0055] When the computer device 101 is implemented as a server, the computer device 101 can be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms.
[0056] When the computer device 101 is implemented as a terminal, the computer device 101 can be a smartphone, tablet computer, laptop computer, desktop computer, etc.
[0057] Optionally, the system described above includes one or more computer devices 101. This application embodiment does not limit the number of computer devices 101.
[0058] Specifically, users can input query questions through the interface provided by the computer device. After receiving the query questions input by the user, the computer device generates answer information corresponding to the query questions and presents the answer information to the user through the interface.
[0059] Question answering in computer devices (101) can typically be achieved using artificial intelligence (AI). AI is the theory, methods, technology, and application systems that use digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use that knowledge to achieve optimal results. In other words, AI is a comprehensive technology within computer science that attempts to understand the essence of intelligence and produce a new kind of intelligent machine that can react in a way similar to human intelligence. AI studies the design principles and implementation methods of various intelligent machines, enabling them to possess perception, reasoning, and decision-making capabilities.
[0060] Artificial intelligence (AI) is a comprehensive discipline encompassing a wide range of fields, including both hardware and software technologies. Fundamental AI technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing, operating / interactive systems, and mechatronics. AI software technologies primarily include computer vision, speech processing, natural language processing, and machine learning / deep learning.
[0061] Figure 2 This is a flowchart illustrating a question-answering method as provided in an exemplary embodiment. The method can be applied to a question-answering system installed in a computer device, which can be... Figure 1 Computer equipment 101 in the middle.
[0062] like Figure 2 As shown, the question-and-answer method provided in this application embodiment may include: Step S201: The computer device obtains the user role information of the user who initiated the session.
[0063] A session refers to a dialogue established between a user and a computer device, where the user initiates a session to obtain answers to questions.
[0064] Optionally, the computer device allows users to directly type or voice input questions through web input boxes or mobile app input interfaces.
[0065] In one possible implementation, the computer device can obtain user role information before or after a user initiates a session, in order to generate accurate answers for users with different identities. For example, after a user initiates a session, natural language processing technology can be used to dynamically analyze the questions raised by the user in the current or historical sessions to determine the user role information; or, before a user initiates a session, user role information can be obtained based on the role tags of the user or user account pre-configured in the computer device.
[0066] User role information is used to indicate the user's identity category. For example, user role information can be management, technical personnel, or junior staff.
[0067] For example, a computer device may obtain user role information of the user initiating the session in any of the following ways, but is not limited to these.
[0068] Method 1: When the computer device has user login functionality, pre-configure role tags for each user account. After a user logs in, their role information is obtained by reading their role tag. For example, a user account's role tag could include "Management," "Technical Staff," or "Junior Staff." When the computer device reads the role tag of the currently logged-in user account as "Management," the user's role information is "Management"; when the computer device reads the role tag of the currently logged-in user account as "Technical Staff," the user's role information is "Technical Staff"; and when the computer device reads the role tag of the currently logged-in user account as "Junior Staff," the user's role information is "Junior Staff."
[0069] Method 2: When a user is not logged in or their role is not pre-defined, natural language processing technology can be used to dynamically analyze the questions asked by the user in the current or past sessions. For example, by using a pre-defined keyword library (such as "compliance," "risk," and "strategy" corresponding to "management"; "calibration steps," "technical parameters," and "error" corresponding to "technical personnel") and syntactic analysis, the user's intent can be modeled to infer their role and thus obtain user role information.
[0070] Method 3: Set a drop-down menu in the session window to obtain user role information selected directly by the user. For example, the drop-down menu may include options such as "I am a manager" or "I am a technician".
[0071] Method 4: Obtain user identity information by connecting to the company's internal systems. For example, the computer device can be directly connected to the company's human resources (HR) and other office systems. When a user logs into the question-and-answer system on the computer device through the office system, the computer device can directly obtain the user's job information and thus determine the user's role information.
[0072] Method 5: After a user initiates a conversation, AI can directly ask questions related to the user's role information. For example, AI can directly ask the user who initiated the conversation questions related to their role information, such as: "Do you want to understand the key management points or the specific operation steps?"
[0073] Step S202: The computer device identifies the question type of the query question based on the query question entered by the user in the session.
[0074] In this context, a query question refers to a natural language question entered by the user seeking an answer. Identifying the question type helps to better understand the user's query needs, facilitating subsequent personalized processing of the query question based on the user's role. Specifically, multiple question types can be preset. After obtaining the query question entered by the user in the conversation, the intent of the query question is identified, and a classifier automatically categorizes it into the preset question type.
[0075] Natural language can be understood as the language humans use in daily life, such as Chinese and English, for exchanging ideas and transmitting information.
[0076] For example, a text classification model fine-tuned on a quantitative business corpus, such as a classifier based on a Bidirectional Encoder Representations from Transformers (BERT) architecture, can be used to identify the question type of the query question.
[0077] Among them, the business corpus of measurement is a professional dataset used in the field of measurement for training natural language processing (NLP) or large language model (LLM).
[0078] Text classification is one of the most fundamental and important tasks in natural language processing. The goal of text classification is to automatically categorize a given text document into one or more predefined categories.
[0079] Optionally, question types include, but are not limited to, standard clauses, explanations, and operational procedures.
[0080] The Standard Clause Class indicates the category of a query question that is being queried from a standard clause. For example, when a user enters the query question "Query the content of clause 5.1 of JJF 1001-2011?" in a session, the question type is the Standard Clause Class.
[0081] The Explanation / Explanation category indicates that the query question is a query for the explanation of a technical term. For example, when a user enters the query question "Please explain what 'maximum permissible error' is?" in a session, the question type is Explanation / Explanation.
[0082] The "Operation Procedure" category indicates that the query question is for a detailed explanation of the operation sequence, tool usage methods, precautions, etc. of a certain operation task. For example, when a user enters a query question in the session such as "What is the specific verification procedure for a pressure gauge?" or "How to perform the calibration procedure for XX equipment?", the question type is "Operation Procedure".
[0083] Step S203: The computer device searches the knowledge base based on the query question to obtain the original knowledge text associated with the query question.
[0084] The knowledge base refers to a database that stores a large number of standards, procedures, and management documents related to metrology operations. Retrieval can be understood as searching for and retrieving content relevant to the query question from the knowledge base. Original knowledge text indicates unmodified knowledge fragments related to the query question.
[0085] Specifically, based on the query question, vector retrieval and / or keyword retrieval are performed in the knowledge base to obtain the original knowledge text associated with the query question.
[0086] For example, the implementation of vector retrieval and / or keyword retrieval in the knowledge base based on the query question to obtain the original knowledge text associated with the query question can be any of the following, but is not limited to these.
[0087] Method 1: Vectorize the query question to obtain a query vector. Calculate the cosine similarity between the query vector and the corresponding vector of the original knowledge text recorded in the knowledge base to obtain the original knowledge text associated with the query question.
[0088] Vectorization refers to transforming the query question into a vector.
[0089] For example, before the user enters a query question, all documents and terms in the knowledge base are segmented to obtain knowledge fragments. The segmented knowledge fragments are then converted into high-dimensional vectors using a text embedding model (such as Sentence-BERT), and a vector index is built and stored in a vector database (such as FAISS or Milvus) to obtain the vector corresponding to the original knowledge text recorded in the knowledge base.
[0090] High-dimensional vectors refer to vectors with higher dimensions. Vector indexes are a special data structure designed for high-dimensional vector data, used for efficient storage, retrieval, and comparison of vectors.
[0091] Specifically, after obtaining the user's query question entered in the session, the query question is converted into a vector to obtain the query vector. Then, the cosine similarity value between the query vector and the vector corresponding to the original knowledge text recorded in the knowledge base is calculated. The calculated cosine similarity values are sorted from largest to smallest, and the top n vectors with the largest cosine similarity values are selected from the sorted results to obtain the original knowledge text corresponding to the top n vectors. Here, n can be set according to the actual situation and is not specifically limited here. For example, the top 10 knowledge fragments with the largest cosine similarity values are selected as the original knowledge text, or the top 50 knowledge fragments with the largest cosine similarity values are selected as the original knowledge text associated with the query question.
[0092] Cosine similarity is a metric that assesses the similarity between two vectors by calculating the cosine of the angle between them. It is widely used in data analysis and machine learning.
[0093] Cosine similarity measures the similarity between two non-zero vectors by calculating the cosine of the angle between them. Its value ranges from -1 to 1. A cosine similarity of 1 indicates that the two vectors are completely identical, meaning the original text and the query question have the highest similarity. A cosine similarity of 0 indicates that the two vectors are orthogonal, meaning there is no similarity between the original text and the query question. In text vectors, a cosine similarity of -1 is rare.
[0094] Method 2: Obtain keywords from the query question. Based on the keywords, perform a keyword search in the knowledge base to obtain the original knowledge text related to the query question.
[0095] Keywords can be understood as nouns or phrases in the user's input that represent the core of the query question, such as specific standard numbers, proper nouns (e.g., "JJF 1001-2011"), etc.
[0096] Specifically, the keywords in the query question are obtained. Based on the obtained keywords, a traditional keyword search engine (such as Elasticsearch) is used to perform keyword retrieval to obtain relevant content containing the corresponding keywords, that is, the original knowledge text associated with the query question.
[0097] A keyword search engine is an information retrieval system based on text keyword matching. By indexing text data, it can quickly search and return relevant content containing the corresponding keywords from massive amounts of data based on the keywords entered by the user.
[0098] Method 3: Vectorize the query question to obtain a query vector. Calculate the cosine similarity between the query vector and the corresponding vector of the original knowledge text recorded in the knowledge base to obtain the first original knowledge text. Extract keywords from the query question and perform a keyword search in the knowledge base based on these keywords to obtain the second original knowledge text. Sort the first and second original knowledge texts and filter to obtain the original knowledge texts that are relevant to the query question.
[0099] The process involves vectorizing the query question to obtain a query vector. The cosine similarity value between the query vector and the corresponding vector of the original knowledge text recorded in the knowledge base is calculated to obtain the first original knowledge text. This method is the same as the method for obtaining the original knowledge text associated with the query question in Method 1, and will not be elaborated here. Keywords from the query question are then extracted, and a keyword search is performed in the knowledge base based on these keywords to obtain the second original knowledge text. This method is the same as the method for obtaining the original knowledge text associated with the query question in Method 2, and will not be elaborated here.
[0100] In Method 3, after obtaining the first knowledge text obtained through vector retrieval and the second knowledge text obtained through keyword retrieval, the two texts are input into a lightweight cross-encoder model. This model sorts the first and second knowledge texts based on their relevance to the query question. Following this sorting from highest to lowest relevance, the first one or more relevant knowledge texts are selected as the most relevant to the query result. This model can more precisely determine the relevance between the query question and the retrieved knowledge texts, thus filtering out the most accurate list of knowledge fragments. The multi-dimensional hybrid retrieval strategy in Method 3 improves both the comprehensiveness and accuracy of the retrieval.
[0101] The cross-encoder model takes the query question and the original knowledge text recorded in the knowledge base as a whole input model, calculates and outputs a relevance score between the two. The closer the score is to 1, the higher the relevance; the closer it is to 0, the lower the relevance.
[0102] Step S204: The computer device performs problem handling strategy matching based on user role information and problem type to obtain a problem handling strategy suitable for the user.
[0103] Among them, the problem handling strategy is used to indicate the rules for processing the retrieved knowledge text.
[0104] For example, a "role-rule base" is pre-built. This base stores, in a structured manner, the correspondence rules between question-handling strategies and user role information and question types. It clearly defines how the question-answering system should process and present the retrieved knowledge text when users with different role information input different types of query questions. After obtaining the user role information and question type, the system queries this base based on these information to find the unique question-handling strategy corresponding to the current user role information and question type.
[0105] In addition to matching the correspondence between problem handling strategies and user role information and problem types in the strategy library in the form of "IF-THEN", and querying the strategy library based on user role information and problem types after obtaining them to obtain the problem handling strategies corresponding to the user role information and problem types to generate answer information, different answer information generation strategies can also be matched for different user role information in the following ways.
[0106] Alternatively, a dedicated AI mini-model can be trained, inputting user role information and question type into it. The mini-model can then intelligently determine which style of answer to provide to the current user. Alternatively, multiple dedicated AI models can be prepared in advance, such as "management expert AI" and "technician expert AI." After obtaining the user role information, the query is then passed to the corresponding "expert" for answering.
[0107] For example, the following is a rule example that matches the correspondence between issue handling policies and user role information and issue types in the form of "IF-THEN".
[0108] For example, IF User Role Information = 'Management' AND Issue Type = 'Operational Process' THEN Issue Handling Strategy = 'Extract the core steps of the process to generate a summary list, highlighting the compliance requirements and potential risks'.
[0109] IF User Role Information = 'Technician' AND Problem Type = 'Operational Procedure' THEN Problem Handling Strategy = 'Return the complete Standard Operating Procedure (SOP) containing all technical parameters and precautions, and explicitly cite the relevant standard text'.
[0110] IF User Role Information = 'Junior Staff' AND Problem Type = 'Explanation' THEN Problem Handling Strategy = 'When quoting the original text, you must use easy-to-understand language to explain it, and you may use metaphors or examples appropriately'.
[0111] Step S205: The computer device obtains the answer information corresponding to the query question based on the user role information, the original knowledge text, and the question processing strategy.
[0112] The answer information refers to the response information given in response to the query question.
[0113] In some embodiments, query suggestions are generated based on user role information, original knowledge text, and question handling strategies. Then, an artificial intelligence (AI) model is invoked to generate answer information based on the query suggestions, thus obtaining the answer.
[0114] Query prompts are used to indicate the process of generating answer information.
[0115] Specifically, query suggestions can be generated as follows: First, obtain a query suggestion template, then fill in the user role information, original knowledge text, and problem handling strategy into the query suggestion template to generate query suggestions. The query suggestion template refers to a predefined format, structure, or framework used to generate query suggestions. Query suggestions can include role settings, task instructions, content processing instructions, relevant original knowledge text, and output format requirements.
[0116] For example, here is a sample query suggestion template.
[0117] Role setting: You are a professional metrology expert, and your current communication partner is a [Insert user role information here (e.g., a technician)].
[0118] Task instructions: Please strictly follow the following [content processing instructions] and answer the user's questions based on the [relevant knowledge text] I have provided.
[0119] Content processing instructions: [Insert problem handling strategy here].
[0120] Related knowledge text: [Insert relevant knowledge text related to the query question here].
[0121] Output format requirements: Please answer in a structured format that includes sections such as "Core Abstract", "Standard Text Citation", and "Detailed Interpretation".
[0122] Artificial intelligence (AI) models are models that generate answer information based on query prompts. AI models can be large language models (LLMs, such as the GPT series models).
[0123] Specifically, by calling upon an artificial intelligence (AI) model and inputting query suggestions into it, the AI model generates answer information under the guidance of the query suggestions. This ensures that the output answer information fully meets the needs of the specific user role and is highly compatible with the user's comprehension and application scenario. This transforms the question-and-answer system from a simple query tool into a truly problem-solving "intelligent work partner," thereby improving the usability of the question-and-answer system in business scenarios and ultimately enhancing user satisfaction and stickiness.
[0124] In addition to generating answer information using query suggestions, answer information can also be generated in the following ways.
[0125] Optionally, for content with a fixed format, a template corresponding to that format can be obtained, key information can be filled in according to the template, and then the content with the filled key information can be input into an AI model. The AI model will then generate answer information, making the expression in the answer information more fluent and more in line with the user's language habits. In addition to presenting answer information in text form, the AI model can also automatically generate other forms of answer information. For example, a flowchart can be generated for users whose user role is technical, or a data summary table can be generated for users whose user role is management.
[0126] Based on user role information, original knowledge text, and question processing strategies, the system obtains answers to queries, dynamically adjusting and generating personalized answers with varying depth, detail, and style according to the different knowledge backgrounds and work needs of users with different roles. For example, for users with management roles, the provided answers tend to be concise core summaries; for users with technical roles, the provided answers tend to be detailed operational steps. Therefore, users no longer need to manually sift through complex and generic information. This precise push technology will significantly reduce the time users spend obtaining effective information, thereby improving their work efficiency.
[0127] In summary, the technical solution provided in this application obtains a problem-handling strategy suitable for the user by matching the problem-handling strategy based on user role information and problem type. Then, based on the user role information, knowledge text, and problem-handling strategy, the answer information corresponding to the query question is obtained. It can personalize the knowledge text related to the query question retrieved from the knowledge base according to the problem-handling strategy corresponding to different user role information and question type, accurately generate answer information suitable for different users, and thus realize role-adaptive question-and-answer function, improving the applicability of the question-and-answer system.
[0128] Furthermore, after providing users with the answers to their queries, the computer device can also collect user feedback and update the knowledge base (see [link to relevant documentation]). Figure 3 Steps S206 and S207 in the process.
[0129] Figure 3 This is a flowchart illustrating another question-answering method provided as an exemplary embodiment. The method can be executed by a computer device.
[0130] Step S206: The computer device obtains user feedback information.
[0131] The user feedback information describes how users respond to the answers to their queries.
[0132] For example, user feedback can be a binary evaluation of the answer information (satisfied / unsatisfied), a quantitative evaluation of the answer information (such as a rating of 1-5 stars), or a text comment such as the user's specific opinions on the answer information (e.g., "content correction" for a certain detail).
[0133] Specifically, by providing users with feedback buttons such as "Satisfied", "Dissatisfied", and "Content Correction" on the interface, users can select the corresponding button or fill in content correction information to obtain user feedback.
[0134] Step S207: The computer device updates the knowledge base based on user feedback.
[0135] Specifically, after obtaining user feedback information, the user feedback information is stored in the backend, and the user feedback information stored in the backend can be used to update the knowledge base.
[0136] Specifically, it obtains the knowledge base administrator's review status of user feedback information and updates the knowledge base based on the review status.
[0137] For example, when the user feedback is "unsatisfactory", the knowledge base administrator reviews the content of the provided answer. If the review finds that there is no problem with the content of the answer, no further processing is required. If the review finds that the answer contains incorrect or outdated information, the administrator can search for the latest information on the Internet and update the corresponding content in the knowledge base to ensure the accuracy and timeliness of the information source in the answer.
[0138] For example, when the user feedback information is content correction information, the knowledge base administrator reviews the content of the content correction information. If the content correction information provided by the user is true and reasonable after review, the corresponding content in the knowledge base will be modified according to the content correction information. If the content correction information provided by the user is not true or reasonable after review, the content in the knowledge base will not be modified, and the review result may be fed back to the user as needed.
[0139] Furthermore, high-quality user feedback stored in the backend can be used to fine-tune the AI model in the question-and-answer system in the future, thus forming a closed loop of continuous optimization.
[0140] By updating the knowledge base based on user feedback, the content of the answers is kept up-to-date with the latest industry standards and operating procedures, fundamentally solving the problem of information lag and the operational errors that may be caused by information lag. It also addresses compliance risks in related technologies, providing a solid technical guarantee for the rigor of metrology operations.
[0141] In summary, the technical solution provided in this application obtains a problem-solving strategy suitable for the user by matching problem-solving strategies based on user role information and question type. Then, based on user role information, original knowledge text, and problem-solving strategies, it obtains the answer information corresponding to the query question. It can personalize the original knowledge text retrieved from the knowledge base that is related to the query question according to different user role information and problem-solving strategies corresponding to different question types, accurately generating answer information suitable for different users, thereby realizing role-adaptive question-and-answer functionality and improving the applicability of the question-and-answer system. Furthermore, by updating the knowledge base based on user feedback, it ensures the accuracy and timeliness of the answer information.
[0142] The above embodiments describe the question-answering method provided in this application. The following is a detailed description of a question-answering system in which this question-answering method is applied.
[0143] Figure 4 A schematic diagram of the structure of a question-answering system is provided for an exemplary embodiment, such as... Figure 4 As shown, the question-answering system includes: a user role identification module 401, a question classification and processing module 402, a knowledge retrieval and matching module 403, a knowledge interpretation and simplified expression module 404, an answer generation and output module 405, a knowledge base 406, and a knowledge feedback and optimization module 407.
[0144] The question-answering system provided by this invention is typically implemented on one or more servers. These servers include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU) or a dedicated AI chip for accelerating AI model computation, random access memory (RAM), and a hard disk for storing the knowledge base and algorithm models.
[0145] At the software level, an operating system runs on the server, and a database system is deployed for implementation. Figure 4The knowledge base 406, Web service applications, and those implemented through program code, such as Figure 4 The module shown includes user role identification module 401, question classification and processing module 402, knowledge retrieval and matching module 403, knowledge interpretation and simplified expression module 404, answer generation and output module 405, and knowledge feedback and optimization module 407. These modules can be implemented as tightly coupled software processes or as independent microservices, communicating efficiently through application programming interfaces (APIs) and collaborating to accomplish tasks such as... Figure 2 and Figure 3 The question-and-answer method shown.
[0146] The user role identification module 401 is used to identify the current user's role and obtain user role information before or after the user enters a query question. For example, when the user enters the query question "XX equipment calibration process", the user role identification module 401 can determine the user's role information as "technician" by analyzing the content of the query question.
[0147] The problem classification and processing module 402 is used to perform semantic understanding and intent classification on the query questions and identify the question type. For example, when the user enters the query question "XX equipment calibration process", the problem classification and processing module 402 will identify the question type as "operation process".
[0148] The knowledge retrieval and matching module 403 is used to quickly and accurately locate and query knowledge fragments related to the query question from the massive amount of professional knowledge in the knowledge base, and obtain the original knowledge text associated with the query question.
[0149] For example, after receiving the query question "XX equipment calibration process" and the question type "operation process type", a mixed search of vector and keyword is performed in the knowledge base, and after reordering, the standard operating procedure (SOP) document fragment most relevant to "XX equipment calibration process" is finally located.
[0150] The knowledge interpretation and simplified expression module 404 receives three inputs: user role information, question type, and original knowledge text. At the same time, it queries the internal "role-rule" strategy library based on the user role information and question type to accurately match the question handling strategy. The question handling strategy and the original knowledge text are then output to the answer generation and output module 405.
[0151] For example, after receiving the following three inputs: {User role information: technical personnel, Problem type: operation process type, Knowledge text: [SOP document fragment]}, the knowledge interpretation and simplified expression module 404 immediately queries the internal "role-rule" strategy library to accurately match the problem handling strategy: "Return the complete standard operating procedure (SOP) containing all technical parameters and precautions, and explicitly cite the relevant standard text", and then outputs the problem handling strategy to the answer generation and output module 405.
[0152] The answer generation and output module 405 is used to receive the retrieved original knowledge text and question processing strategy related to the query question, integrate the original knowledge text into answer information suitable for the user's role information according to the question processing strategy, and present the answer information to the user.
[0153] Specifically, a query suggestion containing detailed instructions is constructed and submitted to a large language model. The model then generates a comprehensive answer that includes technical parameters and references the original SOP document fragment. This personalized answer is presented to the user through an interface. Feedback buttons such as "Satisfied," "Dissatisfied," and "Report Error" are also provided on the interface.
[0154] Knowledge Base 406 is used to store all standards, procedures and management documents related to metering operations, and is the knowledge foundation of the entire question and answer system.
[0155] The knowledge feedback and optimization module 407 is used to obtain user feedback information, update the knowledge base based on the user feedback information, form a closed loop, and realize the continuous learning and self-improvement of the question-and-answer system.
[0156] First, the user role identification module 401 identifies user role information. Next, the question classification and processing module 402 and the knowledge retrieval and matching module 403 accurately understand the query question and search for the most relevant original knowledge in the knowledge base 406, while also identifying the question type. Then, the knowledge interpretation and simplified expression module 404 matches a preset question processing strategy based on the user role information and question type. Finally, the answer generation and output module 405 strictly follows this question processing strategy, calling a large language model to generate a structured, appropriately detailed, and linguistically tailored answer that perfectly matches the user's needs. Furthermore, the knowledge feedback and optimization module 407 collects user feedback information and updates the knowledge base 406 based on this feedback.
[0157] The foregoing mainly describes the solution provided in this application. Accordingly, this application also provides a question-and-answer device for implementing the above-described method embodiments.
[0158] Figure 5 A schematic diagram of the structure of a question-and-answer device is provided for an exemplary embodiment, as shown below. Figure 5 As shown, the question-and-answer device may include an acquisition module 501, a classification module 502, a retrieval module 503, a matching module 504, and a generation module 505.
[0159] The acquisition module 501 is used to execute Figure 2 and Figure 3 The illustrated method includes step S201; the classification module 502 is used to perform this operation. Figure 2 and Figure 3 The illustrated method includes step S202; the retrieval module 503 is used to execute... Figure 2 and Figure 3 The illustrated method includes step S203; the matching module 504 is used to perform... Figure 2 and Figure 3 The illustrated method includes step S204; the generation module 505 is used to execute... Figure 2 and Figure 3 The illustrated method includes step S205.
[0160] In some embodiments, the question-answering device includes hardware structures and / or software modules corresponding to the execution of each function in order to achieve the above-described functions. Those skilled in the art will readily recognize that, based on the units and algorithm steps of the examples described in conjunction with the embodiments disclosed herein, this application can be implemented in hardware or a combination of hardware and computer software. Whether a function is executed in hardware or by computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0161] This application embodiment can divide the question-and-answer device into functional modules according to the above method embodiment. For example, each function can be divided into a separate functional module, or two or more functions can be integrated into one question-and-answer module. The integrated module can be implemented in hardware or as a software functional module. It should be noted that the module division in this application embodiment is illustrative and only represents one logical functional division. In actual implementation, there may be other division methods.
[0162] like Figure 6 As shown, the computer device provided in this application embodiment may include a processor 601, a bus 602, a communication interface 603, and a memory 604. The processor 601, memory 604, and communication interface 603 communicate with each other via the bus 602. It should be understood that this application does not limit the number of processors and memories in the network device.
[0163] Bus 602 can be a PCI bus, an Extended Industry Standard Architecture (EISA) bus, or a UB bus, etc. Buses can be divided into address buses, data buses, control buses, etc. For ease of representation, Figure 6 The bus 602 may be represented by a single line, but this does not mean that there is only one bus or one type of bus. The bus 602 may include a path for transmitting information between various components of the network device (e.g., memory 604, processor 601, communication interface 603).
[0164] Processor 601 may include any one or more processors such as CPU, graphics processing unit (GPU), microprocessor (MP), or digital signal processor (DSP).
[0165] Memory 604 may include volatile memory, such as random access memory (RAM). Processor 601 may also include non-volatile memory, such as read-only memory (ROM), flash memory, hard disk drive (HDD), or solid state drive (SSD).
[0166] The communication interface 603 uses transceiver modules, such as, but not limited to, network interface cards and transceivers, to enable communication between network devices and other devices or communication networks.
[0167] The memory 604 stores executable program code, which the processor 601 executes to implement the functions of the aforementioned method embodiments. That is, the memory 604 stores instructions for executing the aforementioned question-and-answer method.
[0168] On the other hand, a question-and-answer system is provided, which includes multiple modules that work together to implement the question-and-answer method described above.
[0169] In another aspect, a computer-readable storage medium is provided, wherein at least one computer program is stored in the computer-readable storage medium, and the at least one computer program is loaded and executed by a processor to implement the question-and-answer method as provided in the above-described method embodiments.
[0170] In another aspect, a computer program product is provided, which includes a computer program or instructions that, when executed by a processor, implement the question-and-answer method provided in the above-described method embodiments.
[0171] Through the above description of the implementation methods, those skilled in the art will clearly understand that, for the sake of convenience and brevity, only the division of the above functional modules is used as an example. In practical applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the module can be divided into different functional modules to complete all or part of the functions described above. The specific working process of the system, modules, and units described above can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0172] Since the question-and-answer module, computer-readable storage medium, and computer program product in the embodiments of the present invention can be applied to the above methods, the technical effects they can achieve can also be referred to the above method embodiments. The embodiments of the present invention will not be repeated here.
[0173] The method steps in this embodiment can be implemented in hardware or by a processor executing software instructions. The software instructions can consist of corresponding software modules, which can be stored in random access memory (RAM), flash memory, read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), registers, hard disks, portable hard disks, CD-ROMs, or any other form of storage medium known in the art. An exemplary storage medium is coupled to the processor, enabling the processor to read information from and write information to the storage medium. Of course, the storage medium can also be a component of the processor. The processor and storage medium can reside in an ASIC. Alternatively, the ASIC can reside in a network device. Of course, the processor and storage medium can also exist as discrete components in the network device.
[0174] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented, in whole or in part, as a computer program product. A computer program product includes one or more computer programs or instructions. When a computer program or instruction is loaded and executed on a computer, the processes or functions of the embodiments of this application are performed, in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, a network device, a user equipment, or other programmable module. The computer program or instructions can be stored in a computer-readable storage medium or transferred from one computer-readable storage medium to another. For example, a computer program or instructions can be transferred from one website, computer, server, or data center to another website, computer, server, or data center via wired or wireless means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium, such as a floppy disk, hard disk, or magnetic tape; it can also be an optical medium, such as a digital video disc (DVD); or it can be a semiconductor medium, such as a solid-state drive (SSD).
[0175] The above are merely specific embodiments of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A question-and-answer method, characterized in that, The method includes: Obtain the user role information of the user who initiated the session, wherein the user role information is used to indicate the user's identity category; Based on the query question entered by the user in the session, identify the question type of the query question; Based on the query question, a search is performed in the knowledge base to obtain the original knowledge text associated with the query question. The original knowledge text is used to indicate the unmodified knowledge fragments related to the query question. Based on the user role information and the question type, a question processing strategy is matched to obtain a question processing strategy suitable for the user. The question processing strategy is used to indicate the processing rules for the retrieved knowledge text. Based on the user role information, the original knowledge text, and the question processing strategy, the answer information corresponding to the query question is obtained.
2. The method according to claim 1, characterized in that, The step of retrieving knowledge text associated with the query question from the knowledge base includes: Based on the query question, vector retrieval and / or keyword retrieval are performed in the knowledge base to obtain the original knowledge text associated with the query question.
3. The method according to claim 2, characterized in that, The step of performing vector retrieval in the knowledge base based on the query question to obtain the original knowledge text associated with the query question includes: The query problem is vectorized to obtain a query vector; Calculate the cosine similarity value between the query vector and the vector corresponding to the original knowledge text recorded in the knowledge base to obtain the original knowledge text associated with the query question.
4. The method according to claim 2, characterized in that, Based on the query question, keyword retrieval is performed in the knowledge base to obtain the original knowledge text associated with the query question, including: Retrieve the keywords from the query question; Based on the keywords, a keyword search is performed in the knowledge base to obtain the original knowledge text associated with the query question.
5. The method according to claim 2, characterized in that, Based on the query question, vector retrieval and keyword retrieval are performed in the knowledge base to obtain the original knowledge text associated with the query question, including: The query question is vectorized to obtain a query vector; the cosine similarity value between the query vector and the vector corresponding to the original knowledge text recorded in the knowledge base is calculated to obtain the first original knowledge text. Obtain the keywords from the query question; based on the keywords, perform a keyword search in the knowledge base to obtain the second knowledge text. The first and second knowledge texts are sorted and filtered to obtain the knowledge texts associated with the query question.
6. The method according to claim 1, characterized in that, The process of obtaining the answer information corresponding to the query question based on the user role information, the original knowledge text, and the question processing strategy includes: Based on the user role information, the original knowledge text, and the question processing strategy, query prompts are generated, which are used to indicate the process of generating answer information. An artificial intelligence (AI) model is invoked, which generates answer information based on the query prompts, thereby obtaining the answer information.
7. The method according to any one of claims 1 to 6, characterized in that, The method further includes: Obtain user feedback information, which describes the user's feedback on the answer information corresponding to the query question; The knowledge base is updated based on the user feedback information.
8. A question-and-answer device, characterized in that, The device includes: The acquisition module is used to acquire the user role information of the user who initiated the session, wherein the user role information is used to indicate the user's identity category; A classification module is used to identify the question type of the query question based on the query question entered by the user in the session; The retrieval module is used to perform a retrieval in the knowledge base based on the query question to obtain the original knowledge text associated with the query question. The original knowledge text is used to indicate unmodified knowledge fragments related to the query question. The matching module is used to match problem handling strategies based on the user role information and the problem type to obtain a problem handling strategy suitable for the user. The problem handling strategy is used to indicate the processing rules for the retrieved knowledge text. The generation module is used to obtain the answer information corresponding to the query question based on the user role information, the original knowledge text, and the question processing strategy.
9. A question-and-answer system, characterized in that, The system includes multiple modules that cooperate with each other to implement the question-and-answer method as described in any one of claims 1 to 7.
10. A computer device, characterized in that, The computer device includes a processor and a memory, wherein the memory stores at least one computer program, and the at least one computer program is loaded and executed by the processor to implement the question-and-answer method as described in any one of claims 1 to 7.