Intelligent question and answer method and device

By converting knowledge fragments, user query questions and knowledge conjunctions into vectorized representations, and using the enhanced understanding matching algorithm to generate question answers, the existing intelligent question-and-answer methods are solved with high complexity and inflexible responses, and efficient and accurate intelligent question-and-answer services are achieved.

CN119829702APending Publication Date: 2025-04-15CHINA TELECOM CLOUD TECH CO LTD
View PDF 0 Cites 3 Cited by

Patent Information

Application Number
CN202411725841.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-28
Publication Date
2025-04-15

AI Technical Summary

Technical Problem

The existing intelligent question-and-answer methods are difficult to meet the needs of real scenarios when the knowledge base is huge and the answers are professional. The methods are complex and the replies are inflexible. The generic methods based on large models have problems such as inaccurate replies and difficult to update knowledge.

Method used

Using a knowledge base intelligent question-and-answer method based on reinforced understanding matching, the knowledge fragments, user query questions and knowledge conjunctions are converted into vectorized representations by obtaining unstructured knowledge base files, and the problem answers are generated in combination with the reinforced understanding matching algorithm.

Benefits of technology

It improves the speed and accuracy of generating answers to questions based on the knowledge base, reduces the complexity of the system, realizes rapid knowledge updates, and provides anthropomorphic and flexible responses.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119829702A_ABST
    Figure CN119829702A_ABST
Patent Text Reader

Abstract

Embodiments of the invention provide an intelligent question and answer method and apparatus. The method comprises the steps of obtaining an unstructured knowledge base file of an intelligent question and answer knowledge base; the unstructured knowledge base file comprises at least one knowledge fragment; converting the knowledge fragments into knowledge fragment vectorization representation; when a user query problem is obtained, converting the user query problem into user query problem vectorization representation; obtaining knowledge associated words associated with the user query question, and converting the knowledge associated words into knowledge associated word vectorization representation; and according to the user query question vectorization representation, the knowledge associated word vectorization representation and the knowledge fragment vectorization representation, generating a question answer corresponding to the user query question. According to the embodiment of the invention, the speed of generating the answer to the question based on the knowledge base can be improved, and the accuracy of the generated answer to the question is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Embodiments of the present invention relate to the field of computer technology, and in particular, to an intelligent question-answering method, an intelligent question-answering device, an electronic device, and a computer-readable storage medium. Background Art

[0002] The purpose of intelligent question and answer is to automatically answer questions raised by users and help users quickly obtain the information they need. It is widely used in search engines, intelligent conversation assistants, online customer service and other scenarios in e-commerce, government affairs, finance, education, media and other fields.

[0003] Intelligent question answering requires the retrieval and intelligent response of large-scale knowledge in rich and complex customer questions, so this task is very challenging. Especially when the knowledge base of intelligent question answering is huge and the answers require a high level of professionalism, current methods and systems are difficult to meet the needs of real-world scenarios. Summary of the invention

[0004] In view of the above problems, an intelligent question answering method and device are proposed to overcome the above problems or at least partially solve the above problems. The specific technical solution is as follows:

[0005] In a first aspect of the present invention, an intelligent question-answering method is first provided, the method comprising:

[0006] Acquire an unstructured knowledge base file of a knowledge base of intelligent question and answer; the unstructured knowledge base file includes at least one knowledge fragment;

[0007] Converting the knowledge fragment into a vectorized representation of the knowledge fragment;

[0008] When obtaining a user query question, converting the user query question into a vectorized representation of the user query question;

[0009] Acquire knowledge-related words associated with the user query question, and convert the knowledge-related words into vectorized representations of the knowledge-related words;

[0010] An answer to a question corresponding to the user query question is generated based on the vectorized representation of the user query question, the vectorized representation of the knowledge-related words, and the vectorized representation of the knowledge fragment.

[0011] In one embodiment of the present invention, generating an answer to the user query question according to the vectorized representation of the user query question, the vectorized representation of the knowledge-related words, and the vectorized representation of the knowledge fragment includes:

[0012] According to the vectorized representation of the user query question, the vectorized representation of the knowledge-related words and the vectorized representation of the knowledge fragment, determining a target knowledge fragment vectorized representation from the knowledge fragment vectorized representation;

[0013] Obtain a knowledge fragment corresponding to the vectorized representation of the target knowledge fragment as the target knowledge fragment;

[0014] The target knowledge fragment and the user query question are input into a preset language processing model to obtain the answer to the user query question.

[0015] In one embodiment of the present invention, before obtaining the unstructured knowledge base file of the knowledge base of the intelligent question and answer, the method further includes:

[0016] Access customer data;

[0017] Sampling the customer data to obtain original files associated with intelligent question and answer;

[0018] Preprocessing the original file to obtain a knowledge base file;

[0019] The knowledge base file is stored in the knowledge base of the intelligent question and answer system; the knowledge base file includes an unstructured knowledge base file and a structured knowledge base file.

[0020] In an embodiment of the present invention, the preprocessing includes at least removing special symbols, pictures, tables, privacy information and sensitive words.

[0021] In one embodiment of the present invention, according to the vectorized representation of the user query question, the vectorized representation of the knowledge-related words and the vectorized representation of the knowledge fragment, determining the target knowledge fragment vectorized representation from the knowledge fragment vectorized representation includes:

[0022] Calculating a first similarity between the vectorized representation of the user query question and the vectorized representation of the knowledge fragment;

[0023] Calculating a second similarity between the vectorized representation of the knowledge-associated word and the vectorized representation of the knowledge fragment;

[0024] Determine the total similarity of the vectorized representation of the knowledge fragments according to the first similarity and the second similarity;

[0025] A target knowledge fragment vectorized representation is determined from the knowledge fragment vectorized representation according to the total similarity.

[0026] In one embodiment of the present invention, determining a target knowledge fragment vectorized representation from the knowledge fragment vectorized representation according to the total similarity includes:

[0027] The vectorized representation of the knowledge fragment corresponding to the total similarity ranked before the preset number of digits of the total similarity is used as the vectorized representation of the target knowledge fragment.

[0028] In one embodiment of the present invention, the language processing model includes at least a generative language model, and the generative language model includes at least a T5 model and a GPT model.

[0029] The embodiment of the present invention further provides an intelligent question-answering device, the device comprising:

[0030] An intelligent question and answer data acquisition module, used to acquire an unstructured knowledge base file of the intelligent question and answer knowledge base; the unstructured knowledge base file includes at least one knowledge fragment;

[0031] A knowledge fragment conversion module, used to convert the knowledge fragment into a vectorized representation of the knowledge fragment;

[0032] A user query question conversion module is used to convert the user query question into a vectorized representation of the user query question when the user query question is obtained;

[0033] A knowledge-related word conversion module, used to obtain knowledge-related words associated with the user query question and convert the knowledge-related words into vectorized representations of the knowledge-related words;

[0034] The question answer generation module is used to generate a question answer corresponding to the user query question based on the vectorized representation of the user query question, the vectorized representation of the knowledge-related words and the vectorized representation of the knowledge fragment.

[0035] In another aspect of the present invention, a computer-readable storage medium is provided, wherein instructions are stored in the computer-readable storage medium, and when the computer-readable storage medium is run on a computer, the computer executes any of the intelligent question-answering methods described above.

[0036] In another aspect of the present invention, a computer program product comprising instructions is provided, which, when executed on a computer, enables the computer to execute any of the intelligent question-answering methods described above.

[0037] Compared with the related art, the embodiments of the present invention have at least the following advantages:

[0038] In an embodiment of the present invention, an unstructured knowledge base file of a knowledge base for intelligent question and answer is obtained, the unstructured knowledge base file includes at least one knowledge fragment, the knowledge fragment is converted into a knowledge fragment vectorized representation, when a user query question is obtained, the user query question is converted into a user query question vectorized representation, knowledge-related words associated with the user query question are obtained, and the knowledge-related words are converted into knowledge-related words vectorized representations, and a question answer corresponding to the user query question is generated based on the user query question vectorized representation, the knowledge-related words vectorized representation and the knowledge fragment vectorized representation. The embodiment of the present invention converts knowledge fragments, user query questions and knowledge-related words into vectorized representations, and the vectorized representation can capture the semantic information of the text. Therefore, the combination of the user query question vectorized representation, the knowledge-related words vectorized representation and the knowledge fragment vectorized representation to generate the question answer corresponding to the user query question can not only improve the speed of generating question answers based on the knowledge base, but also improve the accuracy of the generated question answers. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art.

[0040] Figure 1 A flowchart of the steps of an intelligent question-answering method provided in an embodiment of the present invention;

[0041] Figure 2 It is an overall flow chart of a knowledge base intelligent question answering method and system based on enhanced understanding matching provided in an embodiment of the present invention;

[0042] Figure 3 A network structure diagram of a knowledge base intelligent question answering method and system based on enhanced understanding matching provided in an embodiment of the present invention;

[0043] Figure 4 is a structural block diagram of an intelligent question-answering device provided in an embodiment of the present invention;

[0044] Figure 5 The present invention is a block diagram of an electronic device provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0045] The technical solutions in the embodiments of the present invention will be described below in conjunction with the accompanying drawings in the embodiments of the present invention.

[0046] At present, the main intelligent question-answering methods include knowledge-based chatbot methods and large-model-based generative methods. Among them, the knowledge-based chatbot method includes operations such as intent analysis, query, slot filling, and reply to input questions. On the one hand, the method is highly complex and requires knowledge to be structured in advance. On the other hand, it can only provide similar fixed answers to customers' questions that exist in the knowledge base, and cannot achieve anthropomorphic and flexible replies. The generative method based on a large model has problems such as inaccurate and fabricated replies, and the high cost of large model training leads to high knowledge update costs for the system.

[0047] In response to the above problems, an embodiment of the present invention implements a knowledge base intelligent question and answer method based on enhanced understanding matching, which can answer customer questions in combination with an unstructured knowledge base and provide humanized and highly flexible replies, effectively reducing the complexity of the intelligent question and answer system, improving the accuracy of replies, and realizing rapid updating of knowledge.

[0048] Reference Figure 1 , is a flowchart of the steps of an intelligent question-answering method provided in an embodiment of the present invention, such as Figure 1 As shown, the method may specifically include the following steps:

[0049] Step 101: Obtain an unstructured knowledge base file of a knowledge base of intelligent question and answer; the unstructured knowledge base file includes at least one knowledge fragment;

[0050] In the specific implementation, the knowledge base of intelligent question and answer is a data system that stores a large amount of structured or unstructured data. The data stored in the knowledge base can be used in intelligent question and answer systems, such as chat robots, virtual assistants, question and answer platforms, and other intelligent question and answer systems to realize intelligent question and answer.

[0051] In some examples, the knowledge base may include multiple types of knowledge fragments to generate answers to user query questions, such as medicine, film, business, news, history, statistics, etc. For example, the knowledge base may include the historical knowledge fragment "The First World War (July 28, 1914 - November 11, 1918), referred to as "World War I", was a world-class imperialist war caused by the imbalance of political and economic development during the transition from capitalist countries to imperialism in the early 20th century, which led to the imperialist powers' struggle to redivide the world and compete for global hegemony. ..."

[0052] Among them, structured data refers to data stored in a predefined format and structure, usually stored in a database, with clear fields and data types; unstructured data refers to data without a fixed format and structure, usually in the form of text, images, audio, video, etc. In an embodiment of the present invention, an unstructured knowledge base file (unstructured data) of a knowledge base for intelligent question and answer can be obtained, wherein, if there is structured data in the knowledge base, the structured data can be converted into unstructured data, and then knowledge fragments can be extracted from the unstructured knowledge base file. The embodiment of the present invention does not need to structure the data in the knowledge base, does not rely on traditional knowledge bases such as knowledge graphs, can save a lot of data preprocessing and structuring operations, and has low-cost characteristics.

[0053] Step 102: convert the knowledge fragment into a vectorized representation of the knowledge fragment;

[0054] In an embodiment of the present invention, after obtaining the knowledge fragments, the text vectorization model can be used to process the knowledge fragments to obtain the knowledge fragment vectorization representation (vector) of multiple knowledge fragments of the unstructured knowledge base file. Among them, the text vectorization model is a model that converts natural language text (such as knowledge fragments) into a vectorized representation. The vectorized representation enables the computer to understand and process text data, so as to be applied to various natural language processing tasks, such as intelligent question and answer, text classification, sentiment analysis, machine translation, information retrieval, etc. Exemplarily, the text vector model can be a BERT (Bidirectional Encoder Representations from Transformers) model.

[0055] Step 103: when obtaining a user query question, convert the user query question into a vectorized representation of the user query question;

[0056] In an embodiment of the present invention, when a user query question is obtained, such as the user query question "Please summarize major events in modern history" or "What should I pay attention to when I have a cold", a text vectorization model can be used to process the user query question to obtain a vectorized representation of the user query question corresponding to the user query question.

[0057] Step 104: Acquire knowledge-related words associated with the user query question, and convert the knowledge-related words into vectorized representations of the knowledge-related words;

[0058] In an embodiment of the present invention, for user query questions, a knowledge association model can be further used to process the user query questions to obtain several knowledge association words of the user query questions. The knowledge association words refer to keywords or phrases related to the user query questions extracted by the intelligent question-answering system when processing the user query questions. These keywords or phrases related to the user query questions can help understand the intention of the user query. For example, assuming that the user query question is "please summarize major events in modern history", the knowledge association words can be "World War I", "modern history", "Industrial Revolution", "Steam Age", "Major Events", etc. Then, the text vectorization model can be used to process the knowledge association words to obtain the knowledge association word vectorization representation of the knowledge association words. Among them, the knowledge association model is a technology for processing and understanding user query questions, which aims to extract keywords or phrases related to the query questions (i.e., knowledge association words), and then the knowledge association words can be used to match the relevant knowledge fragments in the knowledge base and then used to generate the answer to the question, which can improve the query efficiency and answer accuracy of the intelligent question-answering system.

[0059] Step 105: Generate an answer to the user query question based on the vectorized representation of the user query question, the vectorized representation of the knowledge-related words, and the vectorized representation of the knowledge fragment.

[0060] In an embodiment of the present invention, an enhanced understanding matching algorithm can be used in combination with a vectorized representation of a user query question, a vectorized representation of knowledge-related words, and a vectorized representation of knowledge fragments to generate an answer to a question corresponding to the user query question. The enhanced understanding matching algorithm is an advanced algorithm that can be used to generate an answer to a user query question. It combines the vectorized representation of the user query question, knowledge-related words, and knowledge fragments, and can generate accurate and relevant answers to the user query question through multi-level matching and reasoning.

[0061] It should be noted that the embodiments of the present invention may involve the use of user data. In actual applications, user-specific personal data can be used in the scheme described herein within the scope permitted by applicable laws and regulations, subject to the requirements of applicable laws and regulations of the country where the user is located (for example, with the user's explicit consent, effective notification to the user, etc.).

[0062] In the above-mentioned intelligent question-answering method, an unstructured knowledge base file of the knowledge base of the intelligent question-answering is obtained, the unstructured knowledge base file includes at least one knowledge fragment, the knowledge fragment is converted into a knowledge fragment vectorized representation, when a user query question is obtained, the user query question is converted into a user query question vectorized representation, knowledge-related words associated with the user query question are obtained, and the knowledge-related words are converted into knowledge-related words vectorized representations, and the question answer corresponding to the user query question is generated according to the user query question vectorized representation, the knowledge-related words vectorized representation and the knowledge fragment vectorized representation. The embodiment of the present invention converts the knowledge fragment, the user query question and the knowledge-related words into a vectorized representation, and the vectorized representation can capture the semantic information of the text. Therefore, the combination of the user query question vectorized representation, the knowledge-related words vectorized representation and the knowledge fragment vectorized representation to generate the question answer corresponding to the user query question can not only improve the speed of generating the question answer based on the knowledge base, but also improve the accuracy of the generated question answer.

[0063] In one embodiment of the present invention, generating an answer to the user query question according to the vectorized representation of the user query question, the vectorized representation of the knowledge-related words, and the vectorized representation of the knowledge fragment includes:

[0064] According to the vectorized representation of the user query question, the vectorized representation of the knowledge-related words and the vectorized representation of the knowledge fragment, determining a target knowledge fragment vectorized representation from the knowledge fragment vectorized representation;

[0065] Obtain the knowledge fragment corresponding to the vectorized representation of the target knowledge fragment as the target knowledge fragment;

[0066] The target knowledge fragment and the user query question are input into a preset language processing model to obtain the answer to the user query question.

[0067] Among them, the language processing model can also be called a language big model or a big model. The language processing model is a deep learning model trained with a large amount of text data, which can generate natural language text or understand the meaning of language text. Exemplarily, the language processing model can at least include a generative language model, and the generative language model can at least include models such as a T5 model and a GPT model (ChatGPT model).

[0068] In an embodiment of the present invention, an enhanced understanding matching algorithm can be used in combination with a vectorized representation of a user query question, a vectorized representation of knowledge-related words, and a vectorized representation of a knowledge fragment, to determine a target knowledge fragment vectorized representation from the knowledge fragment vectorized representation, and then the target knowledge fragment vectorized representation corresponding to the knowledge fragment in the knowledge base is used as the target knowledge fragment, and then the target knowledge fragment and the user query question can be used as context information and question input into a language processing model in intelligent question answering, respectively, and the language processing model can generate a text corresponding to the user query question as an answer to the question. In the above embodiment, there is no need to perform operations such as semantic parsing and slot filling, and there is no need to preset and match the question library, and the question answer generated based on the combination of the user query question and the target knowledge fragment input into the language processing model is highly readable and semantically fluent.

[0069] In an embodiment of the present invention, before obtaining the unstructured knowledge base file of the knowledge base of the intelligent question and answer, the method may further include:

[0070] Access customer data;

[0071] Sampling the customer data to obtain original files associated with intelligent question and answer;

[0072] Preprocessing the original file to obtain a knowledge base file;

[0073] The knowledge base file is stored in the knowledge base of the intelligent question and answer system; the knowledge base file includes an unstructured knowledge base file and a structured knowledge base file.

[0074] Among them, preprocessing may at least include removing special symbols, pictures, tables, privacy information and sensitive words.

[0075] In an embodiment of the present invention, a large amount of customer data can be obtained, wherein the customer data can be text data provided by the customer. By sampling the customer data, files related to intelligent question and answer can be collected, such as files in .txt, .doc, .pdf and other formats, that is, original files. The original files can then be preprocessed, such as removing special symbols, pictures, and tables in the original files, and eliminating privacy information, sensitive words, etc. in the original files. Then, they can be stored in the knowledge base of intelligent question and answer as knowledge base files, and used for subsequent generation of answers to user query questions.

[0076] In one embodiment of the present invention, according to the vectorized representation of the user query question, the vectorized representation of the knowledge-related words and the vectorized representation of the knowledge fragment, determining the target knowledge fragment vectorized representation from the knowledge fragment vectorized representation includes:

[0077] Calculating a first similarity between the vectorized representation of the user query question and the vectorized representation of the knowledge fragment;

[0078] Calculating a second similarity between the vectorized representation of the knowledge-associated word and the vectorized representation of the knowledge fragment;

[0079] Determine the total similarity of the vectorized representation of the knowledge fragments according to the first similarity and the second similarity;

[0080] A target knowledge fragment vectorized representation is determined from the knowledge fragment vectorized representation according to the total similarity.

[0081] In an embodiment of the present invention, first, the first similarity (score) between the vectorized representation of the user query question and the vectorized representation of the knowledge fragment can be calculated, and then the second similarity between the vectorized representation of the knowledge-related words and the vectorized representation of the knowledge fragment can be calculated, and then the total similarity of the vectorized representation of the corresponding knowledge fragment can be calculated based on the first similarity and the second similarity, and then the target knowledge fragment in the vectorized representation of multiple knowledge fragments can be vectorized according to the total similarity of the vectorized representation of the knowledge fragment, and then the target knowledge fragment corresponding to the vectorized representation of the target knowledge fragment can be input into the language processing model to generate the answer to the question corresponding to the user query question. Since the target knowledge fragment is the knowledge fragment with the highest or higher correlation with the user query question and the knowledge-related words, generating the answer to the question corresponding to the user query question based on the target knowledge fragment can improve the accuracy of generating the answer to the question, thereby providing users with better question-answering services.

[0082] In summary, the embodiments of the present invention provide a knowledge base intelligent question and answer method based on enhanced understanding matching for application scenarios such as dialogue assistants and intelligent customer service in various fields, which can solve the problems of high complexity and reliance on structured knowledge in current mainstream intelligent customer question and answer methods; solve the problem of inflexible reply content of existing intelligent customer question and answer methods; solve the problem of inaccurate reply content and difficulty in updating knowledge of generative methods based on large models, thereby providing users with high-quality question and answer services.

[0083] In one embodiment of the present invention, determining a target knowledge fragment vectorized representation from the knowledge fragment vectorized representation according to the total similarity includes:

[0084] The vectorized representation of the knowledge fragment corresponding to the total similarity ranked before the preset number of digits of the total similarity is used as the vectorized representation of the target knowledge fragment.

[0085] In an embodiment of the present invention, specifically, an enhanced understanding matching algorithm may be used to process the vectorized representation of user query questions, the vectorized representation of knowledge-related words, and the vectorized representation of the knowledge base (the vectorized representation of knowledge fragments), and obtain the knowledge fragments corresponding to the vectorized representations of the K knowledge fragments with the highest total similarity, and use these knowledge fragments as target knowledge fragments.

[0086] In one example of the present invention, the enhanced understanding matching algorithm can be expressed as:

[0087] (1) The unstructured knowledge base file is represented by L, where l i ∈L represents the i-th knowledge fragment in the unstructured knowledge base file, and let M be the total number of knowledge fragments.

[0088] (2) Initialize the score (total similarity) of the unstructured knowledge base document to S, where s i ∈S represents the scores corresponding to i knowledge fragments, all of which are initialized to 0 and then obtained by inputting the user query question into the BERT model. The number of elements in the score S is M.

[0089] (3)W represents the set of N knowledge-related word vectors obtained by the knowledge association model based on the user query question, where w i Represents the vectorized representation of the i-th knowledge-related word.

[0090] (4) The allocation weight of s is initialized as α.

[0091] (5) For each i among the N knowledge-related words (i represents the index of the knowledge-related word), v i Represents the knowledge-based word vector w i The weighted vector of knowledge-related words generated with the knowledge fragment score s, where for each j in the M knowledge fragments (j represents the index of the knowledge fragment), s i ←s j +cossim(v i ,l j ), s i represents the score (total similarity) of the i-th knowledge fragment, s j represents the score of the jth knowledge fragment, cossim(v i ,l j ) indicates v i and l i The cosine similarity between .

[0092] For example, it can be expressed as the following pseudo code:

[0093]

[0094] (6) Return TopK(S); this means selecting the top K highest scores s from the score set S. i fragments of knowledge.

[0095] Among them, cossim() in the above pseudo code refers to the cosine similarity algorithm, and the cosine similarity algorithm is a measurement method for measuring the similarity between two vectors. Of course, the embodiment of the present invention can also use other similarity algorithms besides the cosine similarity algorithm, and the embodiment of the present invention does not need to be limited to this.

[0096] In order to enable those skilled in the art to better understand, the present invention is further described below by way of examples in conjunction with the accompanying drawings, but the scope of the present invention is not limited in any way. Figure 2 , is a general flow chart of a knowledge base intelligent question answering method and system based on enhanced understanding matching provided in an embodiment of the present invention. The method and system take text data as input and specifically include the following steps:

[0097] Step 1: Data sampling S1, sampling customer data (text data) to obtain unstructured original files, and then preprocessing to obtain unstructured knowledge base files for intelligent question answering;

[0098] Step 2: Vectorization model processing S2, using the text vectorization model to process the unstructured knowledge base file and user query questions, respectively obtaining the vectorized representation of the knowledge base (the vectorized representation of the knowledge fragment) and the vectorized representation of the user query question, as well as the vectorized representation of several knowledge-related words;

[0099] Step 3: Enhanced understanding matching S3, using the enhanced understanding matching algorithm to process the vectorized representation of the user query question, the vectorized representation of the knowledge-related words, and the vectorized representation of the knowledge base, obtain the vectorized representation fragments of the K knowledge bases with the highest similarity, and obtain the K knowledge base text contents corresponding to these fragments (target knowledge fragments);

[0100] Step 4: Big model processing S4, inputs the user query question and the knowledge base text content into the generative language big model as the question and context information in the intelligent question and answer respectively, and obtains the generated text of the generative language big model as the answer to the intelligent question and answer.

[0101] Reference Figure 3, is a network structure diagram of a knowledge base intelligent question answering method and system based on enhanced understanding matching provided in an embodiment of the present invention, which clarifies the data input and output of each step of the operation, as shown below: S1: Input a document of several text data, which is specifically embodied in files in the formats of .txt, .doc, .pdf, etc.; After preprocessing, P unstructured knowledge base files are obtained; S2: The text vectorization model processes the P unstructured knowledge base files, which are divided into M knowledge fragments, and M text vectorization representation fragments (knowledge fragment vectorization representation) are obtained accordingly. The text vectorization model processes the user query question, and a text vectorization representation is obtained; S3: The vectorization representation of the user query question, the vectorization representation of the knowledge associated words and the vectorization representation of the knowledge base are processed using the enhanced understanding matching algorithm to obtain the vectorization representation fragments of the K knowledge bases with the highest similarity, and obtain the K knowledge base text contents corresponding to these fragments; S4: The user query question and the K knowledge base text contents are respectively input into the generative language model as the question and context information in the intelligent question answering, and the generated text of the generative language model is obtained as the answer to the intelligent question answering.

[0102] In summary, the knowledge base intelligent question-answering method and system based on enhanced understanding and matching provided by the present invention have the following advantages and beneficial effects: 1. Compared with the traditional intelligent question-answering method, the present invention does not require operations such as question semantic analysis and slot filling, does not require pre-setting and matching of question bases, and the generated answers are highly readable and semantically fluent; 2. Compared with large models such as ChatGPT, the present invention realizes intelligent question-answering based on knowledge content, and the generated answers are explainable and reliable, and have the characteristics of safe and controllable content; 3. The present invention does not need to structure the knowledge, does not rely on traditional knowledge bases such as knowledge graphs, can save a lot of data preprocessing and structured operations, and has low-cost characteristics; 4. The present invention is highly flexible, can access unstructured knowledge of different scenarios and customers, meet the business needs of different scenarios, and has strong scalability.

[0103] It should be noted that, for the sake of simplicity, the method embodiments are described as a series of action combinations, but those skilled in the art should be aware that the embodiments of the present invention are not limited by the order of the actions described, because according to the embodiments of the present invention, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily required by the embodiments of the present invention.

[0104] Reference Figure 4 , is a structural block diagram of an intelligent question-answering device provided in an embodiment of the present invention, such as Figure 4 As shown, the device may specifically include the following modules:

[0105] The intelligent question and answer data acquisition module 401 is used to acquire an unstructured knowledge base file of the knowledge base of the intelligent question and answer; the unstructured knowledge base file includes at least one knowledge fragment;

[0106] A knowledge fragment conversion module 402, used to convert the knowledge fragment into a knowledge fragment vectorized representation;

[0107] A user query question conversion module 403 is used to convert the user query question into a vectorized representation of the user query question when the user query question is obtained;

[0108] A knowledge-related word conversion module 404 is used to obtain knowledge-related words associated with the user query question and convert the knowledge-related words into vectorized representations of the knowledge-related words;

[0109] The question answer generation module 405 is used to generate a question answer corresponding to the user query question based on the vectorized representation of the user query question, the vectorized representation of the knowledge-related words and the vectorized representation of the knowledge fragments.

[0110] In one embodiment of the present invention, generating an answer to the user query question according to the vectorized representation of the user query question, the vectorized representation of the knowledge-related words, and the vectorized representation of the knowledge fragment includes:

[0111] According to the vectorized representation of the user query question, the vectorized representation of the knowledge-related words and the vectorized representation of the knowledge fragment, determining a target knowledge fragment vectorized representation from the knowledge fragment vectorized representation;

[0112] Obtain the knowledge fragment corresponding to the vectorized representation of the target knowledge fragment as the target knowledge fragment;

[0113] The target knowledge fragment and the user query question are input into a preset language processing model to obtain the answer to the user query question.

[0114] In one embodiment of the present invention, before obtaining the unstructured knowledge base file of the knowledge base of the intelligent question and answer, the method further includes:

[0115] Access customer data;

[0116] Sampling the customer data to obtain original files associated with intelligent question and answer;

[0117] Preprocessing the original file to obtain a knowledge base file;

[0118] The knowledge base file is stored in the knowledge base of the intelligent question and answer system; the knowledge base file includes an unstructured knowledge base file and a structured knowledge base file.

[0119] In an embodiment of the present invention, the preprocessing includes at least removing special symbols, pictures, tables, privacy information and sensitive words.

[0120] In one embodiment of the present invention, according to the vectorized representation of the user query question, the vectorized representation of the knowledge-related words and the vectorized representation of the knowledge fragment, determining the target knowledge fragment vectorized representation from the knowledge fragment vectorized representation includes:

[0121] Calculating a first similarity between the vectorized representation of the user query question and the vectorized representation of the knowledge fragment;

[0122] Calculating a second similarity between the vectorized representation of the knowledge-associated word and the vectorized representation of the knowledge fragment;

[0123] Determine the total similarity of the vectorized representation of the knowledge fragments according to the first similarity and the second similarity;

[0124] A target knowledge fragment vectorized representation is determined from the knowledge fragment vectorized representation according to the total similarity.

[0125] In one embodiment of the present invention, determining a target knowledge fragment vectorized representation from the knowledge fragment vectorized representation according to the total similarity includes:

[0126] The vectorized representation of the knowledge fragment corresponding to the total similarity ranked before the preset number of digits of the total similarity is used as the vectorized representation of the target knowledge fragment.

[0127] In one embodiment of the present invention, the language processing model includes at least a generative language model, and the generative language model includes at least a T5 model and a GPT model.

[0128] In an embodiment of the present invention, an unstructured knowledge base file of a knowledge base for intelligent question and answer is obtained, the unstructured knowledge base file includes at least one knowledge fragment, the knowledge fragment is converted into a knowledge fragment vectorized representation, when a user query question is obtained, the user query question is converted into a user query question vectorized representation, knowledge-related words associated with the user query question are obtained, and the knowledge-related words are converted into knowledge-related words vectorized representations, and a question answer corresponding to the user query question is generated based on the user query question vectorized representation, the knowledge-related words vectorized representation and the knowledge fragment vectorized representation. The embodiment of the present invention converts knowledge fragments, user query questions and knowledge-related words into vectorized representations, and the vectorized representation can capture the semantic information of the text. Therefore, the combination of the user query question vectorized representation, the knowledge-related words vectorized representation and the knowledge fragment vectorized representation to generate the question answer corresponding to the user query question can not only improve the speed of generating question answers based on the knowledge base, but also improve the accuracy of the generated question answers.

[0129] As for the above-mentioned device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0130] The embodiment of the present invention further provides an electronic device, such as Figure 5 As shown, it includes a processor 501, a communication interface 502, a memory 503 and a communication bus 504, wherein the processor 501, the communication interface 502, and the memory 503 communicate with each other through the communication bus 504.

[0131] Memory 503, used for storing computer programs;

[0132] The processor 501 is used to implement any of the intelligent question-answering methods described in the above embodiments when executing the program stored in the memory 503.

[0133] The communication bus mentioned in the above terminal can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.

[0134] The communication interface is used for communication between the above terminal and other devices.

[0135] The memory may include a random access memory (RAM) or a non-volatile memory, such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.

[0136] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.

[0137] In another embodiment provided by the present invention, a computer-readable storage medium is also provided, in which instructions are stored. When the computer-readable storage medium is run on a computer, the computer executes the intelligent question-answering method described in any of the above embodiments.

[0138] In another embodiment provided by the present invention, a computer program product including instructions is also provided, which, when executed on a computer, enables the computer to execute the intelligent question-answering method described in any one of the above embodiments.

[0139] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented by software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present invention is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from one website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or data center that includes one or more available media integrated. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state hard disk Solid State Disk (SSD)), etc.

[0140] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or still includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "including one..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

[0141] Each embodiment in this specification is described in a related manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0142] The above description is only a preferred embodiment of the present invention and is not intended to limit the protection scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention are included in the protection scope of the present invention.

Claims

1. An intelligent question-answering method, characterized in that: The method comprises: Acquire an unstructured knowledge base file of a knowledge base of intelligent question and answer; the unstructured knowledge base file includes at least one knowledge fragment; Converting the knowledge fragment into a vectorized representation of the knowledge fragment; When obtaining a user query question, converting the user query question into a vectorized representation of the user query question; Acquire knowledge-related words associated with the user query question, and convert the knowledge-related words into vectorized representations of the knowledge-related words; An answer to a question corresponding to the user query question is generated based on the vectorized representation of the user query question, the vectorized representation of the knowledge-related words, and the vectorized representation of the knowledge fragment.

2. The method according to claim 1, characterized in that Generating an answer to the user query question according to the vectorized representation of the user query question, the vectorized representation of the knowledge-related words, and the vectorized representation of the knowledge fragment, including: According to the vectorized representation of the user query question, the vectorized representation of the knowledge-related words and the vectorized representation of the knowledge fragment, determining a target knowledge fragment vectorized representation from the knowledge fragment vectorized representation; Obtain the knowledge fragment corresponding to the vectorized representation of the target knowledge fragment as the target knowledge fragment; The target knowledge fragment and the user query question are input into a preset language processing model to obtain the answer to the user query question.

3. The method according to claim 1, characterized in that Before obtaining the unstructured knowledge base file of the knowledge base of the intelligent question and answer, the method further includes: Access customer data; Sampling the customer data to obtain original files associated with intelligent question and answer; Preprocessing the original file to obtain a knowledge base file; The knowledge base file is stored in the knowledge base of the intelligent question and answer system; the knowledge base file includes an unstructured knowledge base file and a structured knowledge base file.

4. The method according to claim 3, characterized in that The preprocessing includes at least removing special symbols, pictures, tables, privacy information and sensitive words.

5. The method according to claim 2, characterized in that: According to the vectorized representation of the user query question, the vectorized representation of the knowledge-related words, and the vectorized representation of the knowledge fragment, determining a target knowledge fragment vectorized representation from the knowledge fragment vectorized representation includes: Calculating a first similarity between the vectorized representation of the user query question and the vectorized representation of the knowledge fragment; Calculating a second similarity between the vectorized representation of the knowledge-associated word and the vectorized representation of the knowledge fragment; Determine the total similarity of the vectorized representation of the knowledge fragments according to the first similarity and the second similarity; A target knowledge fragment vectorized representation is determined from the knowledge fragment vectorized representation according to the total similarity.

6. The method according to claim 5, characterized in that Determining a target knowledge fragment vectorized representation from the knowledge fragment vectorized representation according to the total similarity includes: The vectorized representation of the knowledge fragment corresponding to the total similarity ranked before the preset number of digits of the total similarity is used as the vectorized representation of the target knowledge fragment.

7. The method according to claim 2, characterized in that: The language processing model includes at least a generative language model, and the generative language model includes at least a T5 model and a GPT model.

8. An intelligent question-answering device, characterized in that: The device comprises: An intelligent question and answer data acquisition module, used to acquire an unstructured knowledge base file of the intelligent question and answer knowledge base; the unstructured knowledge base file includes at least one knowledge fragment; A knowledge fragment conversion module, used to convert the knowledge fragment into a vectorized representation of the knowledge fragment; A user query question conversion module is used to convert the user query question into a vectorized representation of the user query question when the user query question is obtained; A knowledge-related word conversion module, used to obtain knowledge-related words associated with the user query question and convert the knowledge-related words into vectorized representations of the knowledge-related words; The question answer generation module is used to generate a question answer corresponding to the user query question based on the vectorized representation of the user query question, the vectorized representation of the knowledge-related words and the vectorized representation of the knowledge fragment.

9. An electronic device, characterized in that: It includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus; Memory, used to store computer programs; A processor, for implementing the method steps described in any one of claims 1 to 7 when executing a program stored in a memory.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.

Citation Information

Cited By

  • Children education knowledge boundary management method, system and equipment based on large model

    CN120277199A

  • Children's education knowledge boundary management method, system and equipment based on large model

    CN120277199B

  • Information processing method, electronic device and computer program product

    CN121542391A