A knowledge question answering method, device, equipment and storage medium
By using the Embedding splicing and similarity screening technology of keywords and entities in the LLM+ knowledge base method, the problem of irrelevant vector retrieval in vertical fields is solved, and the recall accuracy and domain expertise of knowledge question and answer are improved.
Patent Information
- Application Number
- CN202311265151.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-27
- Publication Date
- 2024-10-01
- Estimated Expiration
- 2043-09-27
AI Technical Summary
In vertical fields, the existing LLM+ knowledge base method simply uses vector retrieval, resulting in irrelevant retrieval results and low recall accuracy, making it difficult to accurately answer questions in professional fields.
By obtaining the keywords and entities of the target question, combined with the vector model for Embedding splicing, the semantics and domain business are enhanced, thereby improving the accuracy of recall. Similarity thresholds are used to screen similar knowledge sentences and input into the large language model to obtain reply content.
It significantly improves the recall accuracy of knowledge question and answer, avoids the omission problem caused by simple literal retrieval, and enhances the model's ability to answer questions in vertical fields.
Smart Images

Figure CN117312516B_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present invention relate to the field of computer technology, and in particular, to a knowledge question answering method, apparatus, device, and storage medium. Background Art
[0002] With the popularity of ChatGPT, the development of the entire LLM direction has been directly driven. Now the big model has demonstrated its powerful capabilities, but it is still unable to cope with problems in professional fields. For example, when facing professional problems such as medical, legal, financial or manufacturing, the answers given by these models are undoubtedly scratching the surface. Enterprises are very eager to have a similar professional "know-it-all" within the enterprise, which can not only accurately understand the user's intentions, but also give responses and suggestions that are in line with the actual situation of the industry and the enterprise. Therefore, the demand for "vertical field big language model" was born. Vertical field big language model refers to a large language model that has been trained and optimized in a specific field or industry. Compared with the general language model, the vertical field big model is more focused on the knowledge and skills of a specific field, and has higher field professionalism and practicality. However, training a vertical field big model requires some necessary conditions, such as computing power conditions, instruction data conditions, landing conditions, etc. Since many vertical fields lack structured training corpus, it is often unrealistic to directly fine-tune a vertical field big model. Therefore, it is possible to combine LLM with an external knowledge base. LLM+knowledge base is currently the simplest method. It builds a domain knowledge base and uses the In Context Learning capability of the big model to enhance the context of the model input in question and answer through retrieval and set appropriate prompts so that the big model can accurately answer questions in specific fields and companies. However, this method has high requirements for accurate retrieval capabilities. In addition, if the model itself does not have domain knowledge, it is difficult to give the correct answer even with accurate context.
[0003] At present, the LLM+knowledge base approach usually uses a combination based on LangChain+LLM. LangChain is an open source framework that allows AI developers to combine large language models (LLM) like GPT-4 with external data. Langchain first uses the document loader and text splitter in the index module to load and process unstructured data, and then uses the prompt module to find the content. This process uses vector similarity to calculate recall.
[0004] The combination of LangChain+LLM is a simple and crude recall method that directly uses vector retrieval. This simple use of vector retrieval will recall a lot of noisy redundant information, that is, the results of the retrieval are irrelevant. In the scenario of multi-knowledge point aggregation processing, the embedding recall accuracy will become even lower. This result will directly lead to the model's inability to accurately answer questions. Summary of the invention
[0005] The embodiments of the present invention provide a knowledge question answering method, apparatus, device and storage medium to improve the accuracy of recall; greatly alleviate the problem of irrelevant retrieval results caused by simply using vector retrieval; combine keywords and entity words for Embedding splicing, enhance the semantics and domain business of the Embedding feature dimension, thereby avoiding the omission problem caused by simply using literal retrieval.
[0006] According to one aspect of the present invention, a knowledge question answering method is provided, comprising:
[0007] Obtain the target knowledge sentence set corresponding to the target question;
[0008] Perform keyword extraction and entity extraction on the target question and the knowledge sentences in the target knowledge sentence set to obtain a business subject vocabulary set corresponding to the target question and a business subject vocabulary set corresponding to the knowledge sentences;
[0009] Inputting the business subject vocabulary set corresponding to the target question and the business subject vocabulary set corresponding to the knowledge sentence into the vector model respectively, obtaining the business subject fusion vector corresponding to the target question and the business subject fusion vector corresponding to the knowledge sentence;
[0010] Determine a set of similar knowledge sentences according to the similarity between the business topic fusion vector corresponding to the target question and the business topic fusion vector corresponding to each knowledge sentence;
[0011] Similar knowledge sentences in the similar knowledge sentence set whose similarity to the target question is greater than a set threshold and the target question are input into the large language model to obtain the response content corresponding to the target question.
[0012] According to another aspect of the present invention, a knowledge question answering device is provided, the knowledge question answering device comprising:
[0013] A target knowledge sentence set acquisition module is used to acquire a target knowledge sentence set corresponding to a target question;
[0014] A keyword and entity extraction module, used to perform keyword extraction and entity extraction on the target question and the knowledge sentences in the target knowledge sentence set, to obtain a business subject vocabulary set corresponding to the target question and a business subject vocabulary set corresponding to the knowledge sentences;
[0015] A module for determining a business theme fusion vector corresponding to a target question and a business theme fusion vector corresponding to a knowledge sentence, for inputting the business theme vocabulary set corresponding to the target question and the business theme vocabulary set corresponding to the knowledge sentence into a vector model respectively, to obtain a business theme fusion vector corresponding to the target question and a business theme fusion vector corresponding to the knowledge sentence;
[0016] A similar knowledge sentence set determination module is used to determine a similar knowledge sentence set according to the similarity between the business subject fusion vector corresponding to the target question and the business subject fusion vector corresponding to each knowledge sentence;
[0017] The module for determining the reply content corresponding to the target question is used to input similar sentences in the similar knowledge sentence set whose similarity with the target question is greater than a set threshold and the target question into the large language model to obtain the reply content corresponding to the target question.
[0018] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:
[0019] at least one processor; and
[0020] a memory communicatively connected to the at least one processor; wherein,
[0021] The memory stores a computer program that can be executed by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the knowledge question and answer method described in any embodiment of the present invention.
[0022] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the knowledge question and answer method described in any embodiment of the present invention when executed.
[0023] The embodiment of the present invention obtains a target knowledge sentence set corresponding to a target question; performs keyword extraction and entity extraction on the target question and the knowledge sentences in the target knowledge sentence set to obtain a business theme vocabulary set corresponding to the target question and a business theme vocabulary set corresponding to the knowledge sentences; respectively inputs the business theme vocabulary set corresponding to the target question and the business theme vocabulary set corresponding to the knowledge sentences into a vector model to obtain a business theme fusion vector corresponding to the target question and a business theme fusion vector corresponding to the knowledge sentences; determines a similar knowledge sentence set according to the similarity between the business theme fusion vector corresponding to the target question and the business theme fusion vector corresponding to each knowledge sentence; inputs similar knowledge sentences in the similar knowledge sentence set whose similarity to the target question is greater than a set threshold and the target question into a large language model to obtain the reply content corresponding to the target question, thereby improving the recall accuracy; greatly alleviates the problem of irrelevant retrieval results caused by the simple use of vector retrieval; combines keywords and entity vocabulary for Embedding splicing, thereby enhancing the semantics and domain business of the Embedding feature dimension, thereby avoiding the omission problem caused by the simple use of literal retrieval.
[0024] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments are briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without creative work.
[0026] Figure 1 is a flow chart of a knowledge question answering method in an embodiment of the present invention;
[0027] Figure 2 is a flowchart of the refined sorting and recalling based on the LSI latent semantic model in an embodiment of the present invention;
[0028] Figure 3 is a flow chart of knowledge base document refinement and segmentation in an embodiment of the present invention;
[0029] Figure 4 is a flow chart of business subject vocabulary extraction in an embodiment of the present invention;
[0030] Figure 5 is a flow chart of vector recall based on fusion keywords and general entities in an embodiment of the present invention;
[0031] Figure 6 is a flow chart of another knowledge question answering method in an embodiment of the present invention;
[0032] Figure 7 is a schematic diagram of the structure of a knowledge question-answering device in an embodiment of the present invention;
[0033] Figure 8 It is a structural schematic diagram of an electronic device in an embodiment of the present invention. DETAILED DESCRIPTION
[0034] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0035] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0036] It is understandable that before using the technical solutions disclosed in the embodiments of the present disclosure, the types, scope of use, usage scenarios, etc. of the personal information involved in the present disclosure should be informed to the user and the user's authorization should be obtained in an appropriate manner in accordance with relevant laws and regulations.
[0037] Embodiment 1
[0038] Figure 1 This is a flow chart of a knowledge question answering method provided by an embodiment of the present invention. This embodiment is applicable to the situation of knowledge question answering. The method can be executed by the knowledge question answering device in the embodiment of the present invention. The device can be implemented in software and / or hardware. Figure 1 As shown, the method specifically comprises the following steps:
[0039] S110, obtaining a target knowledge sentence set corresponding to the target question.
[0040] The target knowledge sentence set includes: knowledge sentences and file names corresponding to the knowledge sentences; or, the target knowledge sentence set includes: knowledge sentences, file names corresponding to the knowledge sentences and paragraph titles corresponding to the knowledge sentences.
[0041] Specifically, a method for obtaining a target knowledge sentence set corresponding to a target question may be: obtaining a target knowledge base document corresponding to the target question, segmenting the target knowledge base document, and obtaining a target knowledge sentence set.
[0042] S120, performing keyword extraction and entity extraction on the target question and the knowledge sentences in the target knowledge sentence set to obtain a business subject vocabulary set corresponding to the target question and a business subject vocabulary set corresponding to the knowledge sentences.
[0043] The entities may be time, place, task, organization and other entities.
[0044] Specifically, the method of performing keyword extraction and entity extraction on the target question and the knowledge sentences in the target knowledge sentence set to obtain the business subject vocabulary set corresponding to the target question and the business subject vocabulary set corresponding to the knowledge sentences can be: performing keyword extraction on the target question to obtain the keywords corresponding to the target question; performing keyword extraction on the knowledge sentences in the knowledge sentence set to obtain the keywords corresponding to the knowledge sentences; performing entity extraction on the target question to obtain the entities corresponding to the target question; performing entity extraction on the knowledge sentences in the knowledge sentence set to obtain the entities corresponding to the knowledge sentences; determining the business subject vocabulary set corresponding to the target question based on the keywords corresponding to the target question and the entities corresponding to the target question; and determining the business subject vocabulary set corresponding to the knowledge sentences based on the keywords corresponding to the knowledge sentences and the entities corresponding to the knowledge sentences.
[0045] S130, inputting the business subject vocabulary set corresponding to the target question and the business subject vocabulary set corresponding to the knowledge sentence into a vector model respectively, to obtain a business subject fusion vector corresponding to the target question and a business subject fusion vector corresponding to the knowledge sentence.
[0046] The vector model is used to embed the business subject vocabulary set.
[0047] Specifically, the business theme vocabulary set corresponding to the target question and the business theme vocabulary set corresponding to the knowledge sentence are respectively input into the vector model to obtain the business theme fusion vector corresponding to the target question and the business theme fusion vector corresponding to the knowledge sentence. The business theme vocabulary set corresponding to the target question and the business theme vocabulary set corresponding to the knowledge sentence are respectively input into the vector model to obtain the business theme fusion vector corresponding to the target question and the business theme fusion vector corresponding to the knowledge sentence. The business theme vocabulary set corresponding to the target question and the business theme vocabulary set corresponding to the knowledge sentence are respectively input into the vector model to obtain the business theme fusion vector corresponding to the target question and the business theme fusion vector corresponding to the knowledge sentence. The business theme vocabulary set corresponding to the target question and the business theme vocabulary set corresponding to the knowledge sentence are respectively input into the vector model to obtain the vector corresponding to each business theme vocabulary in the business theme vocabulary set corresponding to the target question, and the vectors corresponding to each business theme vocabulary in the business theme vocabulary set corresponding to the target question are spliced to obtain the business theme fusion vector corresponding to the target question; the business theme vocabulary set corresponding to the knowledge sentence is input into the vector model to obtain the vector corresponding to each business theme vocabulary in the business theme vocabulary set corresponding to the knowledge sentence, and the vectors corresponding to each business theme vocabulary in the business theme vocabulary set corresponding to the knowledge sentence are spliced to obtain the business theme fusion vector corresponding to the knowledge sentence.
[0048] S140, determining a set of similar knowledge sentences according to the similarity between the business subject fusion vector corresponding to the target question and the business subject fusion vector corresponding to each knowledge sentence.
[0049] Wherein, the similar knowledge sentence set includes: at least two similar knowledge sentences.
[0050] Specifically, the method for determining the set of similar knowledge sentences based on the similarity between the business theme fusion vector corresponding to the target question and the business theme fusion vector corresponding to each knowledge sentence can be: obtain the similarity between the business theme fusion vector corresponding to the target question and the business theme fusion vector corresponding to each knowledge sentence, and determine the set of similar knowledge sentences based on the knowledge sentences with a similarity ranking of TOPX with the target question, where X is a positive integer. The method for determining the set of similar knowledge sentences based on the similarity between the business theme fusion vector corresponding to the target question and the business theme fusion vector corresponding to each knowledge sentence can also be: obtain the similarity between the business theme fusion vector corresponding to the target question and the business theme fusion vector corresponding to each knowledge sentence, and determine the set of similar knowledge sentences based on the knowledge sentences whose similarity with the target question is greater than a similarity threshold.
[0051] S150, inputting similar knowledge sentences in the similar knowledge sentence set whose similarity to the target question is greater than a set threshold and the target question into the large language model to obtain a reply content corresponding to the target question.
[0052] Specifically, the similar knowledge sentences in the similar knowledge sentence set whose similarity with the target question is greater than a set threshold and the target question are input into the large language model to obtain the response content corresponding to the target question, which can be: training the initial LSI latent semantic model according to the similar knowledge sentence set to obtain the target LSI latent semantic model; inputting the target question into the target LSI latent semantic model to obtain the similarity between the target question and each similar knowledge sentence in the similar knowledge sentence set; obtaining similar knowledge sentences whose similarity with the target question is greater than a set threshold; inputting the similar knowledge sentences in the similar knowledge sentence set whose similarity with the target question is greater than a set threshold and the target question into the large language model to obtain the response content corresponding to the target question. The similar knowledge sentences in the similar knowledge sentence set whose similarity with the target question is greater than a set threshold and the target question are input into the large language model to obtain the response content corresponding to the target question can also be: obtaining a prompt template, filling the target question and the similar knowledge sentences in the similar knowledge sentence set whose similarity with the target question is greater than a set threshold into the prompt template, and inputting the large speech model to obtain the response content corresponding to the target question.
[0053] Optionally, before inputting similar sentences in the similar knowledge sentence set whose similarity to the target question is greater than a set threshold and the target question into the large language model to obtain the reply content corresponding to the target question, the method further includes:
[0054] The initial LSI latent semantic model is trained according to the similar knowledge sentence set to obtain the target LSI latent semantic model;
[0055] Inputting the target question into the target LSI latent semantic model to obtain the similarity between the target question and each similar knowledge sentence in the similar knowledge sentence set;
[0056] Get similar sentences whose similarity with the target question is greater than the set threshold.
[0057] The set threshold is a preset value.
[0058] In a specific example, Figure 2 As shown in the figure, the refined recall process based on the LSI latent semantic model includes the following steps:
[0059] Step 1: Obtain a set of similar knowledge sentences (the set of knowledge sentences retrieved for the first time), and proceed to step 2;
[0060] Step 2: Train the LSI latent semantic model based on the similar knowledge sentence set obtained in step 1, save and wait for prediction, and proceed to step 3;
[0061] Step 3: Input the target question, call the target LSI latent semantic model trained in step 2, obtain the similarity between each knowledge sentence and the target question, and proceed to step 4;
[0062] Step 4: Sort the knowledge sentences according to the similarity between each knowledge sentence and the target question in step 3, select the top 3, and proceed to step 5;
[0063] Step 5: The knowledge sentences obtained in step 4 are the knowledge sentences that are closest to the target question. They are combined into the final knowledge sentences for LLM to answer the target question based on the knowledge sentences.
[0064] The embodiment of the present invention uses the LSI latent semantic model to accurately sort the relevant knowledge, so as to find the knowledge corresponding to the target problem more accurately.
[0065] Optionally, obtain the target knowledge sentence set corresponding to the target question, including:
[0066] Obtain the target knowledge base document corresponding to the target question;
[0067] If the target knowledge base document is a structured document, segment the target knowledge base document into structured paragraphs to obtain a knowledge paragraph set;
[0068] Slice each knowledge paragraph in the knowledge paragraph set according to the target length to obtain the knowledge sentence set corresponding to each knowledge paragraph;
[0069] The target knowledge sentence set corresponding to the target question is determined according to the knowledge sentence set corresponding to each knowledge paragraph, each knowledge paragraph identifier and the file name corresponding to the target knowledge base document.
[0070] If the target knowledge base document is a structured document, it means that the target knowledge base document contains structured paragraphs. The target length can be determined according to the input size of the large language model.
[0071] It should be noted that since the input of the large language model is limited, it is necessary to further refine the segmentation of the knowledge document after segmentation. That is, the paragraphs are further sliced according to the specified token length range to form a knowledge sentence set. In order to better assist the recall effect, the file name and paragraph title are added to the knowledge sentence after refinement and slicing.
[0072] Specifically, each knowledge paragraph in the knowledge paragraph set is sliced according to the target length to obtain the knowledge sentence set corresponding to each knowledge paragraph. The knowledge paragraph is sliced according to the target delimiter in each knowledge paragraph to obtain a knowledge sentence list. The knowledge sentences in the knowledge sentence list are reorganized according to the order of the knowledge sentences in the knowledge sentence list, the length of each knowledge sentence and the target length to obtain the knowledge sentence set corresponding to each knowledge paragraph set.
[0073] Optionally, obtain the target knowledge sentence set corresponding to the target question, including:
[0074] Obtain the target knowledge base document corresponding to the target question;
[0075] If the target knowledge base document is an unstructured document, slicing the target knowledge base document according to a target length to obtain a knowledge sentence set;
[0076] The target knowledge sentence set corresponding to the target question is determined according to the file names corresponding to the knowledge sentence set and the target knowledge base document.
[0077] If the target knowledge base document is an unstructured document, it means that the target knowledge base document does not contain a structured paragraph.
[0078] Specifically, if the target knowledge base document is an unstructured document, the target knowledge base document is sliced according to the target length, and the method for obtaining the knowledge sentence set can be: if the target knowledge base document is an unstructured document, the target knowledge base document is sliced according to the target separator in the target knowledge base document to obtain a knowledge sentence list; the knowledge sentences in the knowledge sentence list are reorganized according to the order of the knowledge sentences in the knowledge sentence list, the length of each knowledge sentence and the target length to obtain a knowledge sentence set.
[0079] Optionally, the target knowledge base document is sliced according to a target length to obtain a knowledge sentence set, including:
[0080] Segment the target knowledge base document according to the target separator in the target knowledge base document to obtain an initial knowledge sentence list;
[0081] The knowledge sentences in the knowledge sentence list are reorganized according to the order of the knowledge sentences in the initial knowledge sentence list, the length of each knowledge sentence and the target length to obtain a knowledge sentence set.
[0082] The target separator may include: “.”, “!” and “?”, etc.
[0083] Specifically, the target knowledge base document is segmented according to the target separator in the target knowledge base document to obtain the initial knowledge sentence list. The target separator in the target knowledge base document is determined as a segmentation point, and the target knowledge base document is segmented according to the segmentation point to obtain the initial knowledge sentence list.
[0084] Specifically, the knowledge sentences in the knowledge sentence list are reorganized according to the order of the knowledge sentences in the initial knowledge sentence list, the length of each knowledge sentence and the target length, and the method for obtaining the knowledge sentence set can be: the knowledge sentences in the initial knowledge sentence list are spliced and superimposed in order, if the length of the knowledge sentence subset spliced and superimposed N times is less than the target length, and the length of the knowledge sentence subset spliced and superimposed N+1 times is greater than the target length, then the knowledge sentence subset spliced and superimposed N times is determined as one knowledge sentence. The knowledge sentences in the knowledge sentence list are traversed according to the above rules to obtain the knowledge sentence set.
[0085] In a specific example, the knowledge document paragraphs are further segmented after cutting, that is, the paragraphs are further sliced according to the specified token length range to form a target knowledge sentence set. In order to better assist the recall effect, the file name and paragraph title are added to the knowledge sentences after the segmentation to clarify the general outline of each knowledge sentence. The specific steps of knowledge base document segmentation are as follows: Figure 3 As shown:
[0086] Step 1: Input the target knowledge base document corresponding to the target question, and then determine whether the input target knowledge base document contains a structured paragraph. If so, proceed to step 2, otherwise proceed to step 3;
[0087] Step 2: Call the paragraph segmentation function to perform paragraph structured segmentation on the target knowledge base document and proceed to step 3;
[0088] Step 3: Convert the target knowledge base document into text, slice the text according to the target length, and form a new knowledge sentence set. The specific slicing steps are as follows:
[0089] Step 1: Use the target separator to segment the text content into a list of knowledge sentences;
[0090] Step 2: Count the length of each knowledge sentence in the knowledge sentence list in Step 1 in order;
[0091] Step 3: splice and stack the knowledge sentences in the knowledge sentence list in order. If the length of the superimposed knowledge sentence subset is less than the target length, continue to stack; if the length of the superimposed knowledge sentence subset is greater than the target length, start splicing and stacking in order again;
[0092] Step 4: Repeat Step 3 until all the knowledge sentences in the knowledge sentence list are traversed, and the maximum knowledge sentence subset whose length is within the target length of the knowledge sentence subsets superimposed in Step 3 is combined into a new knowledge sentence.
[0093] Step 4: further refine the new knowledge sentence formed in step 2. If the knowledge document contains structured paragraphs, add the file name and paragraph title before the new knowledge sentence; if the knowledge document does not contain structured paragraphs, add the file name before the new knowledge sentence;
[0094] Step 5: Build a multi-level index for the knowledge sentence set refined in step 3 and store it in the database.
[0095] Optionally, keyword extraction and entity extraction are performed on the target question and the knowledge sentences in the target knowledge sentence set to obtain a business subject vocabulary set corresponding to the target question and a business subject vocabulary set corresponding to the knowledge sentences, including:
[0096] Perform keyword extraction on the target question and the knowledge sentences in the target knowledge sentence set to obtain keywords corresponding to the target question and keywords corresponding to the knowledge sentences in the target knowledge sentence set;
[0097] Obtaining the part of speech of the keyword corresponding to the target question and the part of speech of the keyword corresponding to the knowledge sentence in the target knowledge sentence set;
[0098] The keywords corresponding to the target question and the keywords corresponding to the knowledge sentences in the target knowledge sentence set are screened according to the parts of speech of the keywords to obtain the subject keywords corresponding to the target question and the subject keywords corresponding to the knowledge sentences in the target knowledge sentence set;
[0099] Performing entity extraction on the target question and the knowledge sentences in the target knowledge sentence set to obtain entities corresponding to the target question and entities corresponding to the knowledge sentences in the target knowledge sentence set;
[0100] Generate a business subject vocabulary set corresponding to the target question according to the subject keywords corresponding to the target question and the entities corresponding to the target question;
[0101] A business subject vocabulary set corresponding to the knowledge sentence is generated according to the subject key corresponding to the knowledge sentence in the target knowledge sentence set and the entity corresponding to the knowledge sentence in the target knowledge sentence set.
[0102] Specifically, the method of performing keyword extraction on the target question and the knowledge sentences in the target knowledge sentence set to obtain the keywords corresponding to the target question and the keywords corresponding to the knowledge sentences in the target knowledge sentence set may be: performing keyword extraction on the target question through the TFIDF algorithm to obtain the keywords corresponding to the target question, and performing keyword extraction on the knowledge sentences in the target knowledge sentence set through the TFIDF algorithm to obtain the keywords corresponding to the knowledge sentences in the target knowledge sentence set. The method of performing keyword extraction on the target question and the knowledge sentences in the target knowledge sentence set to obtain the keywords corresponding to the target question and the keywords corresponding to the knowledge sentences in the target knowledge sentence set may also be: if the keyword extraction on the target question is performed through the TFIDF algorithm and no keywords are extracted, then the keyword extraction on the target question is performed by calling the KeyBert model to obtain the keywords corresponding to the target question, and if the keyword extraction on the knowledge sentences is performed through the TFIDF algorithm and no keywords are extracted, then the keyword extraction on the knowledge sentences is performed by calling the KeyBert model to obtain the keywords corresponding to the knowledge sentences.
[0103] Specifically, the keywords corresponding to the target question and the keywords corresponding to the knowledge sentences in the target knowledge sentence set are screened according to the parts of speech of the keywords to obtain the subject keywords corresponding to the target question and the subject keywords corresponding to the knowledge sentences in the target knowledge sentence set. The method can be: filtering the non-noun keywords among the keywords corresponding to the target question to obtain the subject keywords corresponding to the target question; filtering the non-noun keywords among the keywords corresponding to the knowledge sentences in the target knowledge sentence set to obtain the subject keywords corresponding to the knowledge sentences in the target knowledge sentence set.
[0104] Specifically, the method of performing entity extraction on the target question and the knowledge sentences in the target knowledge sentence set to obtain the entity corresponding to the target question and the entity corresponding to the knowledge sentences in the target knowledge sentence set can be: calling the entity recognition model to perform entity extraction on the target question and the knowledge sentences in the target knowledge sentence set to obtain the entity corresponding to the target question and the entity corresponding to the knowledge sentences in the target knowledge sentence set.
[0105] In a specific example, the business topic vocabulary extraction process is as follows Figure 4 As shown:
[0106] Step 1: First, extract keywords from the target question and the knowledge sentences in the target knowledge sentence set respectively using the TFIDF algorithm, and then determine whether keywords are extracted. If keywords are extracted, proceed to step 3; if keywords are not extracted, proceed to step 2;
[0107] Step 2: extract keywords from the target question and the knowledge sentences in the target knowledge sentence set by calling the KeyBert model, and then proceed to step 3;
[0108] Step 3: Perform part-of-speech tagging on the keywords corresponding to the extracted target questions and the keywords corresponding to the knowledge sentences in the target knowledge sentence set, give the part-of-speech of the keywords, and proceed to step 4;
[0109] Step 4: Filter the non-noun keywords among the keywords corresponding to the target question, and select the top 5 as the topic keywords corresponding to the target question; Filter the non-noun keywords among the keywords corresponding to the knowledge sentences in the target knowledge sentence set, and select the top 5 as the topic keywords corresponding to the knowledge sentences in the target knowledge sentence set, and proceed to step 6;
[0110] Step 5: Call the entity recognition model to extract entities from the target question and the knowledge sentences in the target knowledge sentence set, extract entities such as time, place, task, and organization, and proceed to step 6;
[0111] Step 6: Determine the business subject vocabulary set corresponding to the target question based on the subject keywords corresponding to the target question extracted in step 4 and the entities corresponding to the target question extracted in step 5; generate the business subject vocabulary set corresponding to the knowledge sentences based on the subject keywords corresponding to the knowledge sentences in the target knowledge sentence set extracted in step 4 and the entities corresponding to the knowledge sentences in the target knowledge sentence set extracted in step 5.
[0112] Optionally, the business subject vocabulary set corresponding to the target question and the business subject vocabulary set corresponding to the knowledge sentence are respectively input into the vector model to obtain the business subject fusion vector corresponding to the target question and the business subject fusion vector corresponding to the knowledge sentence, including:
[0113] Input each business subject word in the business subject word set corresponding to the target question into the vector model in sequence to obtain a business subject word vector list corresponding to the target question;
[0114] Input each business subject word in the business subject word set corresponding to the knowledge sentence into the vector model in sequence to obtain a business subject word vector list corresponding to the knowledge sentence;
[0115] Calculate the average of the business topic vocabulary vector list corresponding to the target question by column to obtain the business topic fusion vector corresponding to the target question;
[0116] The business theme vocabulary vector list corresponding to the knowledge sentence is averaged by column to obtain the business theme fusion vector corresponding to the knowledge sentence.
[0117] In a specific example, the vector recall process based on the fusion of keywords and common entities is as follows: Figure 5 As shown:
[0118] Step 1: Call the vector model to embed the business subject words in the business subject word set corresponding to the target question, and obtain the business subject word vector list corresponding to the target question. Call the vector model to embed the business subject words in the business subject word set corresponding to the knowledge sentence, and obtain the business subject word vector list corresponding to the knowledge sentence, and then proceed to step 2;
[0119] Step 2: Average the business topic vocabulary vector list corresponding to the target question by column to obtain the business topic fusion vector corresponding to the target question; average the business topic vocabulary vector list corresponding to the knowledge sentence by column to obtain the business topic fusion vector corresponding to the knowledge sentence;
[0120] Step 3: Build a multi-level index and store the knowledge sentence text, the business subject vocabulary set corresponding to the knowledge sentence, and the business subject fusion vector corresponding to the knowledge sentence into the vector database.
[0121] Step 4: Obtain the similarity between the business topic fusion vector corresponding to the target question and the business topic fusion vector corresponding to each knowledge sentence, and sort them according to the similarity to obtain the top 10 knowledge sentences with similarity to the target question; determine the similar knowledge sentence set based on the top 10 knowledge sentences with similarity to the target question, which is the initial retrieval result.
[0122] The embodiments of the present invention can more accurately retrieve knowledge content related to the target question by integrating keywords; integrating entity extraction technology can alleviate the omission problem caused by using keyword retrieval alone; vectorizing keywords and entity vocabulary for retrieval can improve the recall rate; and by training the LSI semantic implicit model to further accurately sort the knowledge sentence set, the answer corresponding to the target question can be more effectively retained, thereby improving the recall accuracy.
[0123] In another specific example, a knowledge question answering method process is as follows Figure 6As shown: text mining is performed on the target question to obtain the business theme vocabulary set corresponding to the target question, and text mining is performed on the target knowledge sentence set to obtain the business theme vocabulary set corresponding to each knowledge sentence in the target knowledge sentence set; the business theme vocabulary set corresponding to the target question is input into the vector model to obtain the business theme fusion vector corresponding to the target question, and the business theme vocabulary set corresponding to each knowledge sentence in the target knowledge sentence set is input into the vector model to obtain the business theme fusion vector corresponding to each knowledge sentence. A similar knowledge sentence set is determined according to the similarity between the business theme fusion vector corresponding to the target question and the business theme fusion vector corresponding to each knowledge sentence, and the initial LSI latent semantic model is trained based on the similar knowledge sentence set to obtain the target LSI latent semantic model. The target question is input into the target LSI latent semantic model to obtain the similarity between the target question and each similar knowledge sentence in the similar knowledge sentence set. The similar knowledge sentences whose similarity with the target question is greater than the set threshold are determined as the final retrieval results; the similar knowledge sentences whose similarity with the target question in the similar knowledge sentence set is greater than the set threshold and the target question are input into the large language model to obtain the reply content corresponding to the target question.
[0124] The technical solution of this embodiment is to obtain a target knowledge sentence set corresponding to a target question; perform keyword extraction and entity extraction on the target question and the knowledge sentences in the target knowledge sentence set to obtain a business theme vocabulary set corresponding to the target question and a business theme vocabulary set corresponding to the knowledge sentences; input the business theme vocabulary set corresponding to the target question and the business theme vocabulary set corresponding to the knowledge sentences into a vector model respectively to obtain a business theme fusion vector corresponding to the target question and a business theme fusion vector corresponding to the knowledge sentences; determine a similar knowledge sentence set based on the similarity between the business theme fusion vector corresponding to the target question and the business theme fusion vector corresponding to each knowledge sentence; input similar knowledge sentences in the similar knowledge sentence set whose similarity to the target question is greater than a set threshold and the target question into a large language model to obtain the reply content corresponding to the target question, thereby improving the recall accuracy; greatly alleviating the problem of irrelevant retrieval results caused by the simple use of vector retrieval; combining keywords and entity vocabulary for Embedding splicing enhances the semantics and domain business of the Embedding feature dimension, thereby avoiding the omission problem caused by the simple use of literal retrieval.
[0125] Embodiment 2
[0126] Figure 7 This is a schematic diagram of the structure of a knowledge question answering device provided by an embodiment of the present invention. This embodiment can be applied to the situation of knowledge question answering. The device can be implemented in software and / or hardware. The device can be integrated in any device that provides knowledge question answering function, such as Figure 7As shown, the knowledge question and answer device specifically includes: a target knowledge sentence set acquisition module 710, a keyword and entity extraction module 720, a business topic fusion vector corresponding to the target question and a business topic fusion vector corresponding to the knowledge sentence determination module 730, a similar knowledge sentence set determination module 740 and a reply content determination module 750 corresponding to the target question.
[0127] Among them, the target knowledge sentence set acquisition module is used to obtain the target knowledge sentence set corresponding to the target question;
[0128] A keyword and entity extraction module, used to perform keyword extraction and entity extraction on the target question and the knowledge sentences in the target knowledge sentence set, to obtain a business subject vocabulary set corresponding to the target question and a business subject vocabulary set corresponding to the knowledge sentences;
[0129] A module for determining a business theme fusion vector corresponding to a target question and a business theme fusion vector corresponding to a knowledge sentence, for inputting the business theme vocabulary set corresponding to the target question and the business theme vocabulary set corresponding to the knowledge sentence into a vector model respectively, to obtain a business theme fusion vector corresponding to the target question and a business theme fusion vector corresponding to the knowledge sentence;
[0130] A similar knowledge sentence set determination module is used to determine a similar knowledge sentence set according to the similarity between the business subject fusion vector corresponding to the target question and the business subject fusion vector corresponding to each knowledge sentence;
[0131] The module for determining the reply content corresponding to the target question is used to input similar sentences in the similar knowledge sentence set whose similarity with the target question is greater than a set threshold and the target question into the large language model to obtain the reply content corresponding to the target question.
[0132] The above-mentioned product can execute the method provided by any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.
[0133] Embodiment 3
[0134] Figure 8 A schematic diagram of the structure of an electronic device 10 that can be used to implement an embodiment of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.
[0135] like Figure 8 As shown, the electronic device 10 includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0136] A number of components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0137] The processor 11 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 executes the various methods and processes described above, such as the knowledge question answering method.
[0138] In some embodiments, the knowledge question answering method may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the knowledge question answering method described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to perform the knowledge question answering method in any other appropriate manner (e.g., by means of firmware).
[0139] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0140] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0141] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in combination with an instruction execution system, device or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0142] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).
[0143] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.
[0144] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.
[0145] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.
[0146] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A knowledge question answering method, characterized in that: include: Obtain the target knowledge sentence set corresponding to the target question; The target knowledge sentence set includes: knowledge sentences, file names corresponding to the knowledge sentences, and paragraph titles corresponding to the knowledge sentences; Perform keyword extraction and entity extraction on the target question and the knowledge sentences in the target knowledge sentence set to obtain a business subject vocabulary set corresponding to the target question and a business subject vocabulary set corresponding to the knowledge sentences; Inputting the business subject vocabulary set corresponding to the target question and the business subject vocabulary set corresponding to the knowledge sentence into the vector model respectively, obtaining the business subject fusion vector corresponding to the target question and the business subject fusion vector corresponding to the knowledge sentence; Determine a set of similar knowledge sentences according to the similarity between the business topic fusion vector corresponding to the target question and the business topic fusion vector corresponding to each knowledge sentence; Inputting similar knowledge sentences in the similar knowledge sentence set whose similarity to the target question is greater than a set threshold and the target question into the large language model to obtain the response content corresponding to the target question; The keyword extraction and entity extraction of the target question and the knowledge sentences in the target knowledge sentence set to obtain the business subject vocabulary set corresponding to the target question and the business subject vocabulary set corresponding to the knowledge sentences include: Perform keyword extraction on the target question and the knowledge sentences in the target knowledge sentence set to obtain keywords corresponding to the target question and keywords corresponding to the knowledge sentences in the target knowledge sentence set; Obtaining the part of speech of the keyword corresponding to the target question and the part of speech of the keyword corresponding to the knowledge sentence in the target knowledge sentence set; The keywords corresponding to the target question and the keywords corresponding to the knowledge sentences in the target knowledge sentence set are screened according to the parts of speech of the keywords to obtain the subject keywords corresponding to the target question and the subject keywords corresponding to the knowledge sentences in the target knowledge sentence set; Performing entity extraction on the target question and the knowledge sentences in the target knowledge sentence set to obtain entities corresponding to the target question and entities corresponding to the knowledge sentences in the target knowledge sentence set; Generate a business subject vocabulary set corresponding to the target question according to the subject keywords corresponding to the target question and the entities corresponding to the target question; A business subject vocabulary set corresponding to the knowledge sentence is generated according to the subject key corresponding to the knowledge sentence in the target knowledge sentence set and the entity corresponding to the knowledge sentence in the target knowledge sentence set.
2. The method according to claim 1, characterized in that Before inputting similar knowledge sentences in the similar knowledge sentence set whose similarity to the target question is greater than a set threshold and the target question into the large language model to obtain the response content corresponding to the target question, the method further includes: The initial LSI latent semantic model is trained according to the similar knowledge sentence set to obtain the target LSI latent semantic model; Inputting the target question into the target LSI latent semantic model to obtain the similarity between the target question and each similar knowledge sentence in the similar knowledge sentence set; Obtain similar knowledge sentences whose similarity with the target question is greater than the set threshold.
3. The method according to claim 1, characterized in that Get the target knowledge sentence set corresponding to the target question, including: Obtain the target knowledge base document corresponding to the target question; If the target knowledge base document is a structured document, segment the target knowledge base document into structured paragraphs to obtain a knowledge paragraph set; Slice each knowledge paragraph in the knowledge paragraph set according to the target length to obtain the knowledge sentence set corresponding to each knowledge paragraph; The target knowledge sentence set corresponding to the target question is determined according to the knowledge sentence set corresponding to each knowledge paragraph, each knowledge paragraph identifier and the file name corresponding to the target knowledge base document.
4. The method according to claim 1, characterized in that: Get the target knowledge sentence set corresponding to the target question, including: Obtain the target knowledge base document corresponding to the target question; If the target knowledge base document is an unstructured document, slicing the target knowledge base document according to a target length to obtain a knowledge sentence set; The target knowledge sentence set corresponding to the target question is determined according to the file names corresponding to the knowledge sentence set and the target knowledge base document.
5. The method according to claim 4, characterized in that The target knowledge base document is sliced according to the target length to obtain a knowledge sentence set, including: Segment the target knowledge base document according to the target separator in the target knowledge base document to obtain an initial knowledge sentence list; The knowledge sentences in the knowledge sentence list are reorganized according to the order of the knowledge sentences in the initial knowledge sentence list, the length of each knowledge sentence and the target length to obtain a knowledge sentence set.
6. The method according to claim 1, characterized in that The business subject vocabulary set corresponding to the target question and the business subject vocabulary set corresponding to the knowledge sentence are respectively input into the vector model to obtain the business subject fusion vector corresponding to the target question and the business subject fusion vector corresponding to the knowledge sentence, including: Input each business subject word in the business subject word set corresponding to the target question into the vector model in sequence to obtain a business subject word vector list corresponding to the target question; Input each business subject word in the business subject word set corresponding to the knowledge sentence into the vector model in sequence to obtain a business subject word vector list corresponding to the knowledge sentence; Calculate the average of the business topic vocabulary vector list corresponding to the target question by column to obtain the business topic fusion vector corresponding to the target question; The business theme vocabulary vector list corresponding to the knowledge sentence is averaged by column to obtain the business theme fusion vector corresponding to the knowledge sentence.
7. A knowledge question-answering device, characterized in that: include: A target knowledge sentence set acquisition module is used to acquire a target knowledge sentence set corresponding to a target question; The target knowledge sentence set includes: knowledge sentences, file names corresponding to the knowledge sentences, and paragraph titles corresponding to the knowledge sentences; A keyword and entity extraction module, used to perform keyword extraction and entity extraction on the target question and the knowledge sentences in the target knowledge sentence set, to obtain a business subject vocabulary set corresponding to the target question and a business subject vocabulary set corresponding to the knowledge sentences; A module for determining a business theme fusion vector corresponding to a target question and a business theme fusion vector corresponding to a knowledge sentence, for inputting the business theme vocabulary set corresponding to the target question and the business theme vocabulary set corresponding to the knowledge sentence into a vector model respectively, to obtain a business theme fusion vector corresponding to the target question and a business theme fusion vector corresponding to the knowledge sentence; A similar knowledge sentence set determination module is used to determine a similar knowledge sentence set according to the similarity between the business subject fusion vector corresponding to the target question and the business subject fusion vector corresponding to each knowledge sentence; A module for determining the reply content corresponding to the target question, which is used to input similar sentences in the similar knowledge sentence set whose similarity with the target question is greater than a set threshold and the target question into the large language model to obtain the reply content corresponding to the target question; The keyword extraction and entity extraction of the target question and the knowledge sentences in the target knowledge sentence set to obtain the business subject vocabulary set corresponding to the target question and the business subject vocabulary set corresponding to the knowledge sentences include: Perform keyword extraction on the target question and the knowledge sentences in the target knowledge sentence set to obtain keywords corresponding to the target question and keywords corresponding to the knowledge sentences in the target knowledge sentence set; Obtaining the part of speech of the keyword corresponding to the target question and the part of speech of the keyword corresponding to the knowledge sentence in the target knowledge sentence set; The keywords corresponding to the target question and the keywords corresponding to the knowledge sentences in the target knowledge sentence set are screened according to the parts of speech of the keywords to obtain the subject keywords corresponding to the target question and the subject keywords corresponding to the knowledge sentences in the target knowledge sentence set; Performing entity extraction on the target question and the knowledge sentences in the target knowledge sentence set to obtain entities corresponding to the target question and entities corresponding to the knowledge sentences in the target knowledge sentence set; Generate a business subject vocabulary set corresponding to the target question according to the subject keywords corresponding to the target question and the entities corresponding to the target question; A business subject vocabulary set corresponding to the knowledge sentence is generated according to the subject key corresponding to the knowledge sentence in the target knowledge sentence set and the entity corresponding to the knowledge sentence in the target knowledge sentence set.
8. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the knowledge question and answer method according to any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the knowledge question answering method according to any one of claims 1 to 6 when executed.
