Question and answer information processing method and device based on intelligent knowledge base and electronic equipment
By constructing an intelligent knowledge base and combining native vectors and a distributed search database, the system identifies question keywords and retrieves and splices question fragments, thus solving the problems of semantic ambiguity and insufficient large language model capabilities in user question answering and achieving more accurate responses.
Patent Information
- Application Number
- CN202510342887.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-21
- Publication Date
- 2025-11-11
- Estimated Expiration
- 2045-03-21
AI Technical Summary
In existing technologies, the questions and answers raised by users fail to incorporate historical inquiries, resulting in semantic ambiguity and insufficient natural language processing capabilities of large language models, leading to inaccurate responses.
By constructing an intelligent knowledge base, including a native vector database and a distributed search database, the system identifies question keywords and queries corresponding candidate question fragment sequences to determine the question type. It then retrieves and splices question fragments to generate response information and uses a pre-trained intelligent question-answering model to provide the response.
It improves the accuracy and intelligence of question-and-answer information by combining fragment retrieval from an intelligent knowledge base with a large model to ensure the precision and relevance of responses.
Smart Images

Figure CN120123484B_ABST
Abstract
Description
Technical Field
[0001] The embodiments disclosed herein relate to the field of computer technology, and more specifically to a question-and-answer information processing method, apparatus, and electronic device based on an intelligent knowledge base. Background Technology
[0002] Currently, with the advent of the artificial intelligence era, the application of intelligent question answering is becoming increasingly widespread in people's daily lives. Currently, the common approach to processing user-submitted questions and answers is for users to directly input their questions into a large language model, which then outputs the corresponding response.
[0003] However, the above approach often presents the following technical problems: it does not incorporate answers to historical inquiries, the user's input may be semantically ambiguous, or the natural language processing capabilities of the large language model may be poor, making it difficult for the large language model to accurately answer the questions.
[0004] The information disclosed in this background section is only intended to enhance the understanding of the background of the inventive concept, and therefore may contain information that does not constitute prior art known to those skilled in the art. Summary of the Invention
[0005] The summary portion of this disclosure is intended to provide a brief overview of the concepts, which will be described in detail in the detailed description portion. This summary portion is not intended to identify key or essential features of the claimed technical solutions, nor is it intended to limit the scope of the claimed technical solutions.
[0006] Some embodiments of this disclosure propose a question-and-answer information processing method, apparatus, electronic device, and computer-readable medium based on an intelligent knowledge base to solve one or more of the technical problems mentioned in the background section above.
[0007] In a first aspect, some embodiments of this disclosure provide a question-and-answer information processing method based on an intelligent knowledge base, applied to an intelligent customer service assistant. The method includes: in response to receiving initial question information sent by a target user, identifying various question keywords in the initial question information as question information; and querying a first candidate question fragment sequence and a second candidate question fragment sequence corresponding to the question information from a pre-built intelligent knowledge base, wherein the intelligent knowledge base includes: a native vector database and a distributed search database, the first candidate question fragment sequence corresponding to the native vector database, and the second candidate question fragment sequence corresponding to the distributed search database; determining whether the question type corresponding to the second candidate question fragment sequence is a preset question type; and in response to determining the first... The question types corresponding to the two candidate question fragment sequences are not preset question types. It is determined whether the first candidate question fragment sequence contains a corresponding question answer document that meets the target matching conditions. In response to determining that the first candidate question fragment sequence contains a corresponding question answer document, a target number of third candidate question fragments are retrieved from the distributed search database based on the question answer document and the question information. The target number of third candidate question fragments are then concatenated to obtain concatenated question fragment information. This concatenated question fragment information and the question information are input into a pre-trained intelligent question-answering model to generate question answer information corresponding to the question information. Finally, the question answer information is sent to the user terminal corresponding to the target user.
[0008] Secondly, some embodiments of this disclosure provide a question-and-answer information processing apparatus based on an intelligent knowledge base. The apparatus includes: a query unit configured to, in response to receiving initial question information sent by a target user, identify various question keywords in the initial question information as question information, and query a first candidate question fragment sequence and a second candidate question fragment sequence corresponding to the question information from a pre-built intelligent knowledge base, wherein the intelligent knowledge base includes: a native vector database and a distributed search database, the first candidate question fragment sequence corresponding to the native vector database, and the second candidate question fragment sequence corresponding to the distributed search database; a first determining unit configured to determine whether the question type corresponding to the second candidate question fragment sequence is a preset question type; and a second determining unit configured to, in response to determining... The question types corresponding to the second candidate question fragment sequence are all not preset question types. It is determined whether the first candidate question fragment sequence contains a corresponding question answer document that meets the target matching conditions. The retrieval unit is configured to, in response to determining that the first candidate question fragment sequence contains a corresponding question answer document, retrieve a target number of third candidate question fragments from the distributed search database based on the question answer document and the question information. The input unit is configured to concatenate the target number of third candidate question fragments to obtain concatenated question fragment information, and input the concatenated question fragment information and the question information into a pre-trained intelligent question-answering model to generate question answer information corresponding to the question information, and send the question answer information to the user terminal corresponding to the target user.
[0009] Thirdly, some embodiments of this disclosure provide an electronic device, including: one or more processors; and a storage device having one or more programs stored thereon, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the method described in any implementation of the first aspect above.
[0010] Fourthly, some embodiments of this disclosure provide a computer-readable medium having a computer program stored thereon, wherein the program, when executed by a processor, implements the method described in any of the implementations of the first aspect above.
[0011] The above embodiments of this disclosure have the following beneficial effects: Through the question-and-answer information processing method based on an intelligent knowledge base according to some embodiments of this disclosure, fragment retrieval of question information is performed using a pre-established intelligent knowledge base; thereby, it can be determined whether the question information is a familiar question type. Then, the retrieved question fragments are used to perform intelligent question answering through a large model, improving the accuracy of intelligent questions. First, in response to receiving question information sent by a target user, each question keyword in the initial question information is identified as question information, and a first candidate question fragment sequence and a second candidate question fragment sequence corresponding to the question information are retrieved from the pre-built intelligent knowledge base. The intelligent knowledge base includes a native vector database and a distributed search database, with the first candidate question fragment sequence corresponding to the native vector database and the second candidate question fragment sequence corresponding to the distributed search database. This allows for the identification of different question fragments corresponding to the question information. Next, it is determined whether the question type corresponding to the first and second candidate question fragment sequences is a preset question type. This allows for the determination of whether the question information is a regular question, facilitating the determination of the question-and-answer method. Then, in response to determining that neither the first nor the second candidate question fragment sequence corresponds to a preset question type, it is determined whether the first candidate question fragment sequence contains a corresponding question answer document that meets the target matching conditions. Thus, it can be determined whether a question answer document containing question fragments exists. Finally, in response to determining that the first candidate question fragment sequence contains a corresponding question answer document, a target number of question fragments are retrieved from the distributed search database based on the question answer document and the question information. These target number of question fragments are then input into a pre-trained intelligent question-answering model to generate question answer information corresponding to the question information, and the question answer information is sent to the user terminal corresponding to the target user. Thus, by using a pre-established intelligent knowledge base to retrieve question information fragments, it is possible to determine whether the question information is a familiar question type. The retrieved question fragments are then used to perform intelligent question answering through the large model, improving the accuracy of intelligent question answering. Attached Figure Description
[0012] The above and other features, advantages, and aspects of the embodiments of this disclosure will become more apparent from the accompanying drawings and the following detailed description. Throughout the drawings, the same or similar reference numerals denote the same or similar elements. It should be understood that the drawings are schematic, and elements are not necessarily drawn to scale.
[0013] Figure 1 This is a flowchart of some embodiments of the question-and-answer information processing method based on an intelligent knowledge base according to the present disclosure;
[0014] Figure 2This is a schematic diagram of the structure of some embodiments of the question-and-answer information processing device based on the intelligent knowledge base according to the present disclosure;
[0015] Figure 3 This is a schematic diagram of the structure of an electronic device suitable for implementing some embodiments of the present disclosure;
[0016] Figure 4 This is a schematic diagram of a customer service assistant replying to question information in the question-and-answer information processing method based on an intelligent knowledge base disclosed herein. Detailed Implementation
[0017] Embodiments of this disclosure will now be described in more detail with reference to the accompanying drawings. While some embodiments of this disclosure are shown in the drawings, it should be understood that this disclosure can be implemented in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of this disclosure. It should be understood that the accompanying drawings and embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of protection of this disclosure.
[0018] It should also be noted that, for ease of description, only the parts relevant to the invention are shown in the accompanying drawings. Unless otherwise specified, the embodiments and features described in this disclosure can be combined with each other.
[0019] It should be noted that the concepts of "first" and "second" mentioned in this disclosure are used only to distinguish different devices, modules or units, and are not used to limit the order of functions performed by these devices, modules or units or their interdependencies.
[0020] It should be noted that the terms "a" and "a plurality of" used in this disclosure are illustrative rather than restrictive, and those skilled in the art should understand that, unless otherwise expressly indicated in the context, they should be understood as "one or more".
[0021] The names of messages or information exchanged between multiple devices in the embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of such messages or information.
[0022] This disclosure will now be described in detail with reference to the accompanying drawings and embodiments.
[0023] Figure 1 A flow 100 of some embodiments of the question-and-answer information processing method based on an intelligent knowledge base according to this disclosure is shown. This question-and-answer information processing method based on an intelligent knowledge base, applied to an intelligent customer service assistant, includes the following steps:
[0024] Step 101: In response to receiving the initial question information sent by the target user, identify each question keyword in the initial question information as question information, and query the first and second candidate question fragment sequences corresponding to the question information from the pre-built intelligent knowledge base.
[0025] In some embodiments, the execution entity (e.g., a computing device) of the question-answering information processing method based on an intelligent knowledge base can, in response to receiving initial question information sent by a target user, identify various question keywords in the initial question information as question information, and query a first candidate question fragment sequence and a second candidate question fragment sequence corresponding to the question information from a pre-built intelligent knowledge base. The intelligent knowledge base includes a native vector database and a distributed search database, with the first candidate question fragment sequence corresponding to the native vector database and the second candidate question fragment sequence corresponding to the distributed search database. The question information can represent voice or text consultation information submitted by the target user. The intelligent knowledge base can be a pre-built question-answering knowledge base storing various questions, combining technologies such as full-text retrieval, vector models, and AIGC large models. For example, the intelligent knowledge base can store questions about securities, insurance, etc. The native vector database can refer to the Milvus vector database. The distributed search database can refer to the Electric Search vector database. For example, firstly, the question information is converted into word vectors; then, the top N question fragments with the highest similarity can be retrieved from the native vector database as the first candidate question fragment sequence. The system can retrieve the top N most similar question fragments from a distributed search database, serving as a second sequence of candidate question fragments. A question fragment can refer to a segmented version of a specific question. Multiple question fragments form a complete question. Initial question information may include the question asked by the target user and tags. Tags can indicate the question type. Each question type corresponds to a question document type. The intelligent customer service assistant can refer to an intelligent agent.
[0026] For example, individual question keywords in the initial question information can be identified and used as question information. For example, the initial question information can be sliced, and the corresponding question keywords can be found from the resulting word groups. Another example is the use of a pre-trained question keyword recognition model to identify individual question keywords in the initial question information. For example, the question keyword recognition model could be a recurrent neural network (RNN), a convolutional neural network (CNN), a Transformer, a generative adversarial network (GAN), or a long short-term memory network (LSTM).
[0027] In practice, the aforementioned implementing entity can retrieve the first and second candidate question fragment sequences corresponding to the aforementioned question information from a pre-built intelligent knowledge base through the following steps:
[0028] The first step is to retrieve an initial set of native candidate documents from the aforementioned native vector database based on the tags included in the question information. For example, each native candidate document corresponding to a given tag can be retrieved from the native vector database to form the initial set of native candidate documents. Each native candidate document corresponds to a question document type.
[0029] The second step involves performing the following processing steps for each initial native candidate document in the initial native candidate document set:
[0030] 1. Retrieve the first initial problem fragment corresponding to the above problem information from the above initial original candidate documents.
[0031] 2. Merge the context fragment of the first initial question fragment with the first initial question fragment to obtain the first alternative question fragment. For example, the question fragment preceding the first initial question fragment, the first initial question fragment and the question fragment following the first initial question fragment can be merged to obtain the first alternative question fragment.
[0032] The third step is to determine the obtained first candidate problem fragments as the first candidate problem fragment sequence.
[0033] The fourth step involves retrieving an initial distributed candidate document set from the distributed search database based on the tags included in the question information. For example, each distributed candidate document corresponding to a given tag can be retrieved from the distributed search database to form the initial distributed candidate document set. Each distributed candidate document corresponds to a question document type.
[0034] Fifth, for each initial distributed candidate document in the above initial distributed candidate document set, perform the following processing steps:
[0035] 1. Retrieve the second initial problem fragment corresponding to the above problem information from the above initial distributed alternative documents.
[0036] 2. Merge the context fragment of the second initial question fragment with the second initial question fragment to obtain the second alternative question fragment. For example, the question fragment preceding the second initial question fragment, the second initial question fragment and the question fragment following the second initial question fragment can be merged to obtain the second alternative question fragment.
[0037] 3. Determine each of the obtained second alternative problem fragments as the second alternative problem fragment sequence.
[0038] Alternatively, the intelligent knowledge base can be constructed through the following steps:
[0039] The first step is to obtain a collection of historical question and answer documents. These documents can be previously used files containing both questions and answers.
[0040] The second step is to convert the format of each historical question and answer document in the historical question and answer document set to generate converted historical question and answer documents, thus obtaining the converted historical question and answer document set. For example, the historical question and answer documents can be converted to a fixed format. For example, the fixed format can be a document format (PDF).
[0041] The third step is to slice each historical question and answer document in the historical question and answer document set to generate question fragment groups, thus obtaining a question fragment group set. For example, first, after converting the document to text format, slice it by line breaks, ignoring blank lines by default; second, prioritize slicing by two or more line breaks, defining them as paragraphs, and checking paragraph length: ① Too long: exceeding 1000 characters, then slice by one line break; ② Too short: less than 5 characters, then concatenate the segment with the following segment until it exceeds 200 characters; next, if slicing by one line break still exceeds 1000 characters, slice by symbols, prioritizing periods: ① Too long: exceeding 1000 characters, then slice by semicolons; ② Too short: less than 5 characters, then concatenate the sentence with the next sentence until it exceeds 200 characters (if the result of slicing by one symbol still exceeds 1000 characters, then slice by the next symbol according to priority); finally, if slicing by all symbols still exceeds 1000 characters, then slice the segment according to the rule (number of characters / 1000+1).
[0042] The fourth step involves storing the question fragment set and the corresponding historical question and answer document set in the native vector database and the distributed search database, respectively, according to preset formats. Here, the preset format can be vector format, image format, or text format; it can be set according to requirements.
[0043] Step 102: Determine whether the question type corresponding to the above-mentioned second alternative question segment sequence is a preset question type.
[0044] In some embodiments, the executing entity may determine whether the question type corresponding to the second candidate question segment sequence is a preset question type. The preset question type may refer to FAQ (frequently-asked questions) types. Here, the FAQ types can be pre-defined question types. For example, question types may include: type A, type B, type C, type D, and type E. Type A and type D can be set as FAQ types. It should be noted that each question segment corresponds to one question type. The question types corresponding to each question segment may be the same or different.
[0045] Step 103: In response to determining that none of the question types corresponding to the second candidate question fragment sequence are preset question types, determine whether the first candidate question fragment sequence has a corresponding question answer document that meets the target matching conditions.
[0046] In some embodiments, the execution entity may, in response to determining that none of the question types corresponding to the second candidate question fragment sequence are preset question types, determine whether the first candidate question fragment sequence contains a corresponding question answer document that satisfies the target matching condition. The target matching condition may be: there exists only one question answer document in the native vector database containing the most first candidate question fragments. For example, the first candidate question fragment sequence includes: question fragment A, question fragment B, question fragment C, and question fragment D; wherein, the native vector database contains question answer document A containing "question fragment A, question fragment B, and question fragment C"; the native vector database contains question answer document B containing "question fragment A and question fragment B"; and the native vector database contains question answer document C containing "question fragment A and question fragment D". Then, question answer document A satisfies the target matching condition.
[0047] For example, if the native vector database contains a question and answer document A containing "Question fragment A, Question fragment B, Question fragment C"; a question and answer document B containing "Question fragment A, Question fragment B, Question fragment D"; and a question and answer document C containing "Question fragment A, Question fragment D", and the number of question and answer documents A and B is greater than or equal to two, then the above first candidate question fragment sequence does not contain a question and answer document that meets the target matching condition.
[0048] Step 104: In response to determining that there are corresponding question answer documents for the first candidate question fragment sequence, retrieve the target number of third candidate question fragments in the distributed search database based on the question answer documents and the question information.
[0049] In some embodiments, the executing entity may, in response to determining that a corresponding question answer document exists in the first candidate question fragment sequence, retrieve a target number of third candidate question fragments from the distributed search database based on the question answer document and the question information. For example, a target number of third candidate question fragments associated with both the question answer document and the question information can be retrieved from the distributed search database. Here, the target number of third candidate question fragments correspond to both the question answer document and the question information. For example, a target number of third candidate question fragments with the highest simultaneous similarity to both the question answer document and the question information can be retrieved from the distributed search database.
[0050] In practice, the aforementioned implementing entity can retrieve the target number of third alternative question fragments from the aforementioned distributed search database through the following steps:
[0051] The first step is to retrieve the target number of third initial question fragments from the question-and-answer documents using the aforementioned distributed search database.
[0052] The second step is to merge the context fragment of the aforementioned third initial question fragment with the third initial question fragment to obtain the third alternative question fragment.
[0053] Step 105: The above-mentioned target number of third candidate question fragments are spliced together to obtain spliced question fragment information. The spliced question fragment information and the above-mentioned question information are then input into a pre-trained intelligent question-answering model to generate question answer information corresponding to the above-mentioned question information. The question answer information is then sent to the user terminal corresponding to the above-mentioned target user.
[0054] In some embodiments, the execution entity may concatenate the target number of third candidate question fragments to obtain concatenated question fragment information, and input the concatenated question fragment information and the question information into a pre-trained intelligent question-answering model to generate question-answer information corresponding to the question information, and send the question-answer information to the user terminal corresponding to the target user. The intelligent question-answering model may be a pre-trained large language model that takes question information as input and question-answer information as output. For example, the intelligent question-answering model may be a recurrent neural network (RNN), a long short-term memory network (LSTM), a gated recurrent unit (GRU), or a generative adversarial network (GAN). For example, question information can be input into the pre-trained intelligent question-answering model to obtain question-answer information corresponding to the question information. The user terminal may refer to the target user's mobile phone terminal / computing terminal.
[0055] For example, the target number of third candidate question fragments can be sequentially concatenated into a concatenated question fragment information. Then, this concatenated question fragment information, along with the aforementioned question information, is input into a pre-trained intelligent question-answering model to generate corresponding question-answer information.
[0056] In practice, the aforementioned implementing entities can generate corresponding question and answer information based on the above-mentioned question information through the following steps:
[0057] The first step involves generating question-related information corresponding to the aforementioned question information using the first question-answering network model group within the intelligent question-answering large model. Each first question-answering network model in this group can be a large language model with different model structures and strengths in different question types. The question-related information can be information related to the semantic content of the question information. For example, it can include: questions similar to the question information, answers to similar questions, and domain-specific queries related to the question information. For instance, firstly, the executing entity can generate related prompt information corresponding to the aforementioned question information. Then, the related prompt information is input into each first question-answering network model in the first question-answering network model group to obtain various output information. Finally, the information from each output information is summarized to obtain the question-related information. The related prompt information can be a prompt word representing the generation of question information related to the question information. The first question-answering network model can be a trained large language model.
[0058] The second step involves generating question prompts based on the aforementioned question information and its associations, using the first question-answering network model group. These prompts can be suggestive words representing the content of the answer to the question. For example, firstly, prompts are generated based on the question information and its associations. Then, a first question-answering network model is randomly selected from the first question-answering network model group as the target model. Finally, the prompts are input into the target model to obtain the question prompts. These prompts can also be based on the question associations to generate prompts for answering the question.
[0059] The second step mentioned above may include:
[0060] The first sub-step involves determining the question intent information corresponding to the aforementioned question information. This question intent information can be the content intent of the main query content corresponding to the question information. For example, firstly, the executing entity can perform text preprocessing on the question information to obtain the preprocessed result. This text preprocessing can include: word segmentation, stop word removal, and stemming. Then, the preprocessed result is input into a word vector conversion model (Word2Vec model, BERT model) to obtain text vectors. Finally, the text vectors are input into an intent classification model to obtain the question intent information. For example, the intent classification model could be a Support Vector Machine (SVM) or a Random Forest model.
[0061] The second sub-step, in response to the determination that the confidence level corresponding to the aforementioned question intent information is greater than a preset confidence level, generates question prompt information corresponding to the aforementioned question information using the aforementioned first question-answering network model group, based on the aforementioned question information, the aforementioned question intent information, and the aforementioned question association information. The confidence level corresponding to the question intent information can characterize the accuracy of the generated question intent information. That is, the higher the confidence level value, the more accurate the characterization of the question intent information. The confidence level can be generated together with the question intent information by the intent classification model. The question prompt information corresponding to the question information can be prompt words representing the response to the question. For example, firstly, the aforementioned executing entity can generate prompt information based on the aforementioned question information, the aforementioned question intent information, and the aforementioned question association information to generate prompt words. Then, the prompt information is input into any of the first question-answering network models in the first question-answering network model group to obtain the question prompt information corresponding to the question information.
[0062] The third sub-step involves determining the intent description information of the question's intent based on a confidence level less than or equal to a preset confidence level, using the first question-answering network model group to determine the intent description information of the question's answer corresponding to the question's intent information. For example, the executing entity can first randomly select a first question-answering network model from the first question-answering network model group. Then, using the first question-answering network model, it generates supplementary intent information that represents the description of the question's intent information. Next, the supplementary intent information is displayed on the interactive interface corresponding to the first question-answering network model, allowing the target user to supplement the intent information and obtain the intent description information.
[0063] The fourth sub-step involves adjusting the aforementioned question intent information based on the intent description information to generate adjusted question intent information. This adjusted question intent information can be a question intent with higher precision and richer content than the corresponding question intent information. For example, the executing entity can merge the intent description information and the question intent information to generate adjusted question intent information.
[0064] The fifth sub-step, in response to determining that the confidence level corresponding to the adjusted question intent information is greater than the preset confidence level, generates question prompt information corresponding to the question information based on the question information, the question intent information, and the question association information, using the first question-answering network model group.
[0065] The third step involves generating the corresponding question answer information using the second question answering network model group included in the intelligent question answering large model. Each second question answering network model in the second question answering network model group can be a large language model with a different model structure and strength in different question types. For example, firstly, a second question answering network model is randomly selected from the second question answering network model group. Then, the aforementioned question prompt information is input into the second question answering network model to obtain the question answer information. The second initial question answering network model can be a trained large language model with a different model structure and strength in different question types.
[0066] Therefore, by using the first question-answering network model group, supplementary information related to the question (i.e., question association information) and high-quality question prompt information are generated, thereby accurately identifying the question semantics corresponding to the question information and accurately generating question answer information.
[0067] Optionally, in response to determining that there is no corresponding question answer document in the first candidate question segment sequence, question answer information corresponding to the question information is generated based on the pre-trained intelligent question answering model, and the question answer information is sent to the user terminal corresponding to the target user.
[0068] In some embodiments, the execution entity may, in response to determining that there is no corresponding question answer document in the first candidate question fragment sequence, generate question answer information corresponding to the question information according to a pre-trained intelligent question answering model, and send the question answer information to the user terminal corresponding to the target user.
[0069] In practice, the aforementioned implementing entities can generate the corresponding question and answer information through the following steps:
[0070] The first step is to reconstruct the above question information to obtain reconstructed question information. For example, a preset prompt template can be combined with the above question information to obtain the reconstructed question information. The prompt template can be a pre-defined text template used to guide the model in generating its question answer output.
[0071] The second step involves enhancing the reconstructed question information according to the target domain, resulting in enhanced question information. For example, the executing entity can search for text information matching the reconstructed question information from the intelligent knowledge base. Here, matching can be defined as a text similarity greater than or equal to a preset threshold. Then, the searched text information can be concatenated with the reconstructed question information to obtain the enhanced question information. The intelligent knowledge base can also store question-and-answer text pairs. These pairs can include both the question text and the answer text. The text information can include either question-and-answer text pairs or the answer text.
[0072] The third step is to input the enhanced question information into the intelligent question-answering model to obtain the corresponding question answer information.
[0073] The above-mentioned problem information is reconstructed to obtain reconstructed problem information, including:
[0074] 1. Determine the type of problem corresponding to the above problem information.
[0075] 2. Generate reconstructed problem information based on pre-stored prompt templates corresponding to the above problem types. For example, the problem information can be concatenated with the prompt templates to obtain reconstructed problem information.
[0076] Specifically, the reconstructed problem information is enhanced by performing corresponding target domain enhancement processing to obtain enhanced problem information, including:
[0077] 1. Input the reconstructed question information into a pre-trained question retrieval enhancement model to obtain the question retrieval results. The question retrieval enhancement model corresponds to the knowledge base of the target domain. This model can be a hybrid model that takes question information as input and generates question retrieval results as output. It can also be a hybrid model combining retrieval and generation. The retrieval scope of the model can be the aforementioned intelligent knowledge base. The question retrieval results generated by the model can include: the response text corresponding to the question information and the background knowledge text corresponding to the question information. For example, the model could be a Retrieval Enhancement Generation (RAG) model. RAG addresses these limitations by integrating retrieval mechanisms, allowing LLMs to dynamically access and integrate external data sources. RAGs improve the accuracy, relevance, and timeliness of generated responses, making LLMs more powerful and applicable to a wider range of scenarios.
[0078] 2. The above-mentioned problem retrieval results and the above-mentioned reconstructed problem information are combined to obtain enhanced problem information. For example, the above-mentioned executing entity can combine the above-mentioned problem retrieval results and the above-mentioned reconstructed problem information to obtain enhanced problem information.
[0079] This improves the adaptability of the large model, which is adjusted based on the target domain, to the target domain and enhances the matching between the generated answers and user questions.
[0080] Alternatively, the intelligent question-answering model can be trained through the following steps:
[0081] The first step is to obtain a dataset of user questions for the corresponding target domain. The target domain can represent fields such as securities, e-commerce, and insurance.
[0082] The second step involves training the first initial intelligent question-answering model (LIB) based on the aforementioned user question dataset to obtain the second initial LIB. The first initial LIB can be an incompletely trained Large Language Model (LLM). The second initial LIB can be a LLM trained on the user question dataset, possessing more domain knowledge within the target domain. The first initial LIB can include a first initial question-answering network model group and a second initial question-answering network model group. The first initial question-answering network model can be an incompletely trained LLM. For example, the first initial question-answering network model could be a Recurrent Neural Network (RNN), Long Short-Term Memory (LSTM), Gated Recurrent Unit (GRU), or Generative Adversarial Network (GAN), used to generate question prompts corresponding to the question information. The second initial question-answering network model can be an incompletely trained LLM with different model structures and strengths in different question types. For example, the second initial question-answering network model could be a Recurrent Neural Network (RNN), Long Short-Term Memory (LSTM), Gated Recurrent Unit (GRU), or Generative Adversarial Network (GAN), used for question answering.
[0083] For example, the aforementioned execution entity can use the acquired user question dataset for the target domain and model training methods (e.g., backpropagation) to train a first initial intelligent question answering model for question completion, thereby obtaining a second initial intelligent question answering model.
[0084] The third step involves training the second initial intelligent question-answering model based on a pre-defined set of question enhancement tags, resulting in the third initial intelligent question-answering model. The question enhancement tags include: question completion feature information corresponding to each user question. These question completion feature information can be feature content corresponding to specific question completion features. Question completion features can be features related to the question completion operation. For example, question completion features could be: question time, question prefix, a list of question completions corresponding to the question prefix, or a list of associated question completions corresponding to the question prefix. The question enhancement tags can also be in the form of prompts used to enhance the model's question completion capabilities.
[0085] The fourth step involves determining that the training effect of the third initial intelligent question-answering model has reached the target training effect, thus classifying the third initial intelligent question-answering model as the fully trained intelligent question-answering model. The target training effect can be a pre-set expectation representing the accuracy and efficiency of the third initial intelligent question-answering model's auto-completion. For example, the target training effect could be that the accuracy of the third initial intelligent question-answering model's auto-completion is higher than 70%. The model training effect can be the result of testing the prediction performance of the third initial intelligent question-answering model.
[0086] Therefore, through multiple model training sessions, the model can learn more knowledge corpora in the target domain, and can also combine more question completion features to predict more accurate question answers. Furthermore, through multiple model tests and adaptive training, the model can learn from multiple samples, resulting in a large-scale intelligent question answering model that outputs more accurate intelligent question answering.
[0087] The reason for using two vector databases here is to increase fault tolerance. Both have similar functions and can both "find the best matching document based on the score given by 'aaa' -> use 'bbb' to find N best matching segments in the document". Choosing the Milvus vector database to find matching documents, and then using the Electric Search vector database to find matching segments in the document, can optimize the question information to ensure the accuracy of intelligent question answering.
[0088] Optionally, in response to determining that the question types corresponding to the first candidate question fragment sequence and the second candidate question fragment sequence are both preset question types, question answer information corresponding to the above question information is generated.
[0089] In some embodiments, the execution entity may generate question answer information corresponding to the question information in response to determining that the question types corresponding to the first candidate question fragment sequence and the second candidate question fragment sequence are both preset question types. For example, the same question answer document corresponding to the first candidate question fragment sequence and the second candidate question fragment sequence can be used as the question answer information corresponding to the question information. As another example, the question answer document that contains both the first and second candidate question fragments and has the most fragment data can be retrieved from the intelligent knowledge base and used as the question answer information.
[0090] like Figure 4The example demonstrates an intelligent response page from a smart customer service assistant to a question entered by a target user. For instance, the question might be "When will the Major Illness Management Service upgrade plan be available?"; the response could be, "Hello, based on the information you provided, I have compiled the following information for you: 1. Notification of the Major Illness Management Service upgrade plan from the marketing channel's big data platform; 2. Specific details of the Major Illness Management Service upgrade plan, including: service time, product scope, service standards and content..." Furthermore, the intelligent response page can also include a "push answer" control and "helpful" and "useless" answer feedback controls.
[0091] Further reference Figure 2 As an implementation of the methods shown in the above figures, this disclosure provides some embodiments of a question-and-answer information processing device based on an intelligent knowledge base. These embodiments of the question-and-answer information processing device based on an intelligent knowledge base are similar to... Figure 1 Corresponding to the method embodiments shown, this question-and-answer information processing device based on an intelligent knowledge base can be specifically applied to various electronic devices.
[0092] like Figure 2 As shown, some embodiments of the question-and-answer information processing device 200 based on an intelligent knowledge base include: a query unit 201, a first determination unit 202, a second determination unit 203, and a generation unit 204. The query unit 201 is configured to, in response to receiving question information sent by a target user, query a first candidate question fragment sequence and a second candidate question fragment sequence corresponding to the question information from a pre-built intelligent knowledge base. The intelligent knowledge base includes a native vector database and a distributed search database, with the first candidate question fragment sequence corresponding to the native vector database and the second candidate question fragment sequence corresponding to the distributed search database. The first determining unit 202 is configured to determine whether the question types corresponding to the first and second candidate question fragment sequences are preset question types. The second determining unit 203 is configured to, in response to determining that neither the first nor the second candidate question fragment sequence corresponds to a preset question type, determine whether the first candidate question fragment sequence contains a corresponding question answer document that meets the target matching conditions. The generation unit 204 is configured to, in response to determining that the first candidate question fragment sequence does not contain a corresponding question answer document, generate question answer information corresponding to the question information based on a pre-trained intelligent question-answering model, and send the question answer information to the user terminal corresponding to the target user.
[0093] It is understandable that the units recorded in the question-and-answer information processing device 200 based on the intelligent knowledge base are related to the reference. Figure 1The steps described in the method correspond to each other. Therefore, the operations, features, and beneficial effects described above for the method also apply to the question-answering information processing device 200 based on the intelligent knowledge base and the units contained therein, and will not be repeated here.
[0094] The following is for reference. Figure 3 It shows a schematic diagram of the structure of an electronic device 300 (e.g., a computing device) suitable for implementing some embodiments of the present disclosure. Figure 3 The electronic device shown is merely an example and should not be construed as limiting the functionality and scope of the embodiments of this disclosure.
[0095] like Figure 3 As shown, the electronic device 300 may include a processing unit 301 (e.g., a central processing unit, a graphics processor, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 302 or a program loaded from a storage device 308 into a random access memory (RAM) 303. The RAM 303 also stores various programs and data required for the operation of the electronic device 300. The processing unit 301, ROM 302, and RAM 303 are interconnected via a bus 304. An input / output (I / O) interface 305 is also connected to the bus 304.
[0096] Typically, the following devices can be connected to I / O interface 305: input devices 306 including, for example, touchscreens, touchpads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; output devices 307 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 308 including, for example, magnetic tapes, hard disks, etc.; and communication devices 309. Communication device 309 allows electronic device 300 to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 3 An electronic device 300 with various devices is shown; however, it should be understood that it is not required to implement or possess all of the devices shown. More or fewer devices may be implemented or possessed alternatively. Figure 3 Each box shown can represent a device or multiple devices as needed.
[0097] In particular, according to some embodiments of this disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, some embodiments of this disclosure include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication device 309, or installed from storage device 308, or installed from ROM 302. When the computer program is executed by processing device 301, it performs the functions defined in the methods of some embodiments of this disclosure.
[0098] It should be noted that, in some embodiments of this disclosure, the computer-readable medium may be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium may be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In some embodiments of this disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In some embodiments of this disclosure, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium can be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wires, optical fibers, RF (radio frequency), etc., or any suitable combination thereof.
[0099] In some implementations, clients and servers can communicate using any currently known or future-developed network protocol such as HTTP (Hypertext Transfer Protocol) and can interconnect with digital data communication (e.g., communication networks) of any form or medium. Examples of communication networks include local area networks (“LANs”), wide area networks (“WANs”), the Internet (e.g., the Internet of Things), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future-developed networks.
[0100] The aforementioned computer-readable medium may be included in the aforementioned electronic device; or it may exist independently and not assembled into the electronic device. The aforementioned computer-readable medium carries one or more programs, which, when executed by the electronic device, cause the electronic device to: in response to receiving question information sent by a target user, query a pre-built intelligent knowledge base to retrieve a first candidate question fragment sequence and a second candidate question fragment sequence corresponding to the question information, wherein the intelligent knowledge base includes: a native vector database and a distributed search database, the first candidate question fragment sequence corresponding to the native vector database, and the second candidate question fragment sequence corresponding to the distributed search database; determine whether the question types corresponding to the first and second candidate question fragment sequences are preset question types; in response to determining that the question types corresponding to both the first and second candidate question fragment sequences are not preset question types, determine whether the first candidate question fragment sequence contains a corresponding question answer document that meets the target matching conditions; in response to determining that the first candidate question fragment sequence does not contain a corresponding question answer document, generate question answer information corresponding to the aforementioned question information based on a pre-trained intelligent question-answering model, and send the question answer information to the user terminal corresponding to the target user.
[0101] Computer program code for performing operations of some embodiments of this disclosure can be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, and C++, and conventional procedural programming languages such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0102] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0103] The units described in some embodiments of this disclosure can be implemented in software or hardware. The described units can also be housed in a processor; for example, a processor can be described as including a query unit, a first determining unit, a second determining unit, and a generating unit. The names of these units do not necessarily limit the specific unit itself. For example, the generating unit can also be described as "a unit that, in response to determining that the first candidate question fragment sequence does not have a corresponding question answer document, generates question answer information corresponding to the question information based on a pre-trained intelligent question answering model, and sends the question answer information to the user terminal corresponding to the target user."
[0104] The functions described above in this document can be performed, at least in part, by one or more hardware logic components. For example, exemplary types of hardware logic components that can be used, without limitation, include: Field Programmable Gate Arrays (FPGAs), Application-Specific Integrated Circuits (ASICs), Application Standard Products (ASSPs), System-on-Chip (SoCs), Complex Programmable Logic Devices (CPLDs), and so on.
[0105] Some embodiments of this disclosure also provide a computer program product, including a computer program that, when executed by a processor, implements any of the above-described question-and-answer information processing methods based on an intelligent knowledge base.
[0106] The above description is merely a selection of preferred embodiments of this disclosure and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of the invention involved in the embodiments of this disclosure is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the above-described inventive concept. For example, technical solutions formed by substituting the above-described features with (but not limited to) technical features with similar functions disclosed in the embodiments of this disclosure.
Claims
1. A question-and-answer information processing method based on an intelligent knowledge base, applied to an intelligent customer service assistant, comprising: In response to receiving initial question information sent by a target user, the system identifies each question keyword in the initial question information as question information, and queries a first candidate question fragment sequence and a second candidate question fragment sequence corresponding to the question information from a pre-built intelligent knowledge base. The intelligent knowledge base includes a native vector database and a distributed search database, the first candidate question fragment sequence corresponds to the native vector database, and the second candidate question fragment sequence corresponds to the distributed search database. Determine whether the question type corresponding to the second candidate question segment sequence is a preset question type; In response to determining that none of the question types corresponding to the second candidate question segment sequence are preset question types, determine whether the first candidate question segment sequence has a corresponding question answer document that meets the target matching conditions; In response to determining that there is a corresponding question answer document for the first candidate question fragment sequence, a target number of third candidate question fragments are retrieved from the distributed search database based on the question answer document and the question information; The target number of third candidate question fragments are spliced together to obtain spliced question fragment information. The spliced question fragment information and the question information are then input into a pre-trained intelligent question-answering model to generate question answer information corresponding to the question information. Finally, the question answer information is sent to the user terminal corresponding to the target user.
2. The method according to claim 1, wherein, The step of retrieving a target number of third candidate question fragments from the distributed search database based on the question answer document and the question information includes: Using the distributed search database, a target number of third initial question fragments are retrieved from the question-and-answer document; For each of the target number of third initial question fragments, the context fragment of the third initial question fragment is merged with the third initial question fragment to obtain a third alternative question fragment.
3. The method according to claim 1, wherein, The method further includes: In response to determining that there is no corresponding question answer document in the first candidate question fragment sequence, question answer information corresponding to the question information is generated based on the pre-trained intelligent question answering model, and the question answer information is sent to the user terminal corresponding to the target user.
4. The method according to claim 1, wherein, The method further includes: In response to determining that the question types corresponding to the first candidate question segment sequence and the second candidate question segment sequence are both preset question types, question answer information corresponding to the question information is generated.
5. The method according to claim 3, wherein, Before generating the question-answer information corresponding to the question information based on the pre-trained intelligent question-answering model, the method further includes: Obtain the user question dataset for the corresponding target domain; Based on the user question dataset, the first initial intelligent question answering model for question completion is trained to obtain the second initial intelligent question answering model. Based on a pre-defined set of question enhancement labels, the second initial intelligent question answering model is trained to obtain a third initial intelligent question answering model. The question enhancement labels include: question completion feature information corresponding to each user question. In response to the determination that the model training effect corresponding to the third initial intelligent question answering large model has reached the target training effect, the third initial intelligent question answering large model is determined as the intelligent question answering large model that has been trained.
6. The method according to claim 5, wherein, The step of generating question-answer information corresponding to the question information based on a pre-trained intelligent question-answering model includes: The problem information is reconstructed to obtain reconstructed problem information; The reconstructed problem information is enhanced by performing corresponding target domain enhancement processing to obtain enhanced problem information; The enhanced question information is input into the intelligent question-answering model to obtain the question answer information corresponding to the question information. The process of reconstructing the problem information to obtain reconstructed problem information includes: Determine the problem type corresponding to the problem information; Based on the pre-stored prompt template corresponding to the aforementioned problem type, generate reconstructed problem information; Specifically, the reconstructed problem information is enhanced by performing corresponding target domain enhancement processing to obtain enhanced problem information, including: The reconstructed question information is input into a pre-trained question retrieval enhancement model to obtain question retrieval results, wherein the question retrieval enhancement model corresponds to the knowledge base of the target domain; The problem retrieval results and the reconstructed problem information are combined to obtain enhanced problem information.
7. A question-and-answer information processing device based on an intelligent knowledge base, applied to an intelligent customer service assistant, comprising: The query unit is configured to, in response to receiving initial question information sent by a target user, identify each question keyword in the initial question information as question information, and query a first candidate question fragment sequence and a second candidate question fragment sequence corresponding to the question information from a pre-built intelligent knowledge base, wherein the intelligent knowledge base includes: a native vector database and a distributed search database, the first candidate question fragment sequence corresponds to the native vector database, and the second candidate question fragment sequence corresponds to the distributed search database; The first determining unit is configured to determine whether the question type corresponding to the second candidate question segment sequence is a preset question type; The second determining unit is configured to determine whether the first candidate question segment sequence has a corresponding question answer document that meets the target matching condition in response to determining that none of the question types corresponding to the second candidate question segment sequence are preset question types; The retrieval unit is configured to, in response to determining that a corresponding question answer document exists in the first candidate question fragment sequence, retrieve a target number of third candidate question fragments in the distributed search database based on the question answer document and the question information; The input unit is configured to concatenate the target number of third candidate question fragments to obtain concatenated question fragment information, and input the concatenated question fragment information and the question information into a pre-trained intelligent question-answering model to generate question answer information corresponding to the question information, and send the question answer information to the user terminal corresponding to the target user.
8. An electronic device, comprising: One or more processors; Storage device, on which one or more programs are stored, When the one or more programs are executed by the one or more processors, the one or more processors implement the method as described in any one of claims 1-6.
9. A computer-readable medium having a computer program stored thereon, wherein, When the computer program is executed by a processor, it implements the method as described in any one of claims 1-6.
Citation Information
Patent Citations
Information generation method, device and system, electronic equipment and storage medium
CN119226467A
Intelligent question and answer method and related device
CN119577095A