Knowledge question and answer method and device, readable medium, electronic equipment and program product

The problem of user input is retrieved and organized in the knowledge base through machine learning models, and the problem of low efficiency in business knowledge retrieval in the existing technology is solved, and the rapid and accurate answer acquisition is achieved, which improves the efficiency of users to understand knowledge in specific fields.

CN118964694APending Publication Date: 2024-11-15BEIJING YOUZHUJU NETWORK TECH CO LTD
View PDF 0 Cites 5 Cited by

Patent Information

Application Number
CN202411206272.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-29
Publication Date
2024-11-15

AI Technical Summary

Technical Problem

When users understand business knowledge in a specific field, the existing technology needs to retrieve and read documents one by one, which is inefficient and easy to miss relevant knowledge.

Method used

Obtain users' natural language input problems through machine learning models, search in the knowledge base, automatically find and organize relevant documents, and directly show the answers to users.

Benefits of technology

It improves the search accuracy and search efficiency of knowledge documents in specific fields, directly obtains answers to questions, and improves the efficiency of users to understand business knowledge.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118964694A_ABST
    Figure CN118964694A_ABST
Patent Text Reader

Abstract

The invention relates to a knowledge question answering method and device, a readable medium, electronic equipment and a program product. The method comprises the steps of obtaining a target question input by a user in a natural language; searching in a knowledge base according to the target question through a machine learning model to obtain a target knowledge document used for answering the target question, and determining a target answer for the target question based on the target knowledge document, the knowledge base being used for storing a business knowledge document; and displaying the target answer to the user. Therefore, the question input by the user can be understood through the machine learning model, the knowledge document is automatically searched and sorted based on the question input by the user, and the answer to the question is directly displayed to the user. According to the method, the accuracy and searching efficiency of searching the knowledge document in the specific field by the user can be improved, the answer of the question can be directly obtained, and the efficiency of understanding business knowledge in the specific field by the user is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer technology, and in particular, to a knowledge question answering method, device, readable medium, electronic device, and program product. Background Art

[0002] When users want to learn about business knowledge in a specific field, they usually search for relevant documents on various document retrieval platforms, and then click on the documents one by one to read them to see if there is any business knowledge related to their needs. Summary of the invention

[0003] This summary is provided to introduce concepts in a brief form that will be described in detail in the detailed description below. This summary is not intended to identify key features or essential features of the claimed technical solution, nor is it intended to limit the scope of the claimed technical solution.

[0004] In a first aspect, the present disclosure provides a knowledge question answering method, comprising: Obtain the target question input by the user in natural language; Searching a knowledge base according to the target question through a machine learning model to obtain a target knowledge document for answering the target question, and determining a target answer to the target question based on the target knowledge document, wherein the knowledge base is used to store business knowledge documents; The target answer is displayed to the user.

[0005] In a second aspect, the present disclosure provides a knowledge question answering device, comprising: An acquisition module, used to acquire a target question input by a user in natural language; a determination module, configured to search a knowledge base according to the target question through a machine learning model to obtain a target knowledge document for answering the target question, and determine a target answer to the target question based on the target knowledge document, wherein the knowledge base is used to store business knowledge documents; A display module is used to display the target answer to the user.

[0006] In a third aspect, the present disclosure provides a computer-readable medium having a computer program stored thereon, which, when executed by a processing device, implements the steps of any one of the methods described in the first aspect.

[0007] In a fourth aspect, the present disclosure provides an electronic device, including: a storage device having a computer program stored thereon; A processing device is used to execute the computer program in the storage device to implement the steps of any one of the methods in the first aspect.

[0008] In a fifth aspect, the present disclosure provides a computer program product, comprising a computer program, which implements the steps of any one of the methods described in the first aspect when executed by a processor.

[0009] Through the above technical solution, the machine learning model can first be used to search the knowledge base according to the target question input by the user to obtain the target knowledge document, and then the machine learning model can be used to determine the target answer to the target question based on the target knowledge document and display it to the user. In this way, the machine learning model can understand the question input by the user, and automatically search and organize the knowledge documents based on the question input by the user, and directly display the answer to the question to the user. Not only can the accuracy and search efficiency of the user's retrieval of knowledge documents in a specific field be improved, but the answer to the question can also be obtained directly, which improves the efficiency of the user's understanding of business knowledge in a specific field.

[0010] Other features and advantages of the present disclosure will be described in detail in the following detailed description. BRIEF DESCRIPTION OF THE DRAWINGS

[0011] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and the originals and elements are not necessarily drawn to scale. In the drawings: Figure 1 is a flow chart of a knowledge question answering method according to an exemplary embodiment of the present disclosure; Figure 2 is a flowchart of constructing a smart object page according to an exemplary embodiment of the present disclosure; Figure 3 is a flow chart of another knowledge question answering method according to an exemplary embodiment of the present disclosure; Figure 4 is a schematic diagram of a process of building a knowledge base according to an exemplary embodiment of the present disclosure; Figure 5 is a block diagram of a knowledge question answering device according to an exemplary embodiment of the present disclosure; Figure 6 It is a schematic structural diagram of an electronic device according to an exemplary embodiment of the present disclosure. DETAILED DESCRIPTION

[0012] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments described herein, which are instead provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not intended to limit the scope of protection of the present disclosure.

[0013] It should be understood that the various steps described in the method embodiments of the present disclosure may be performed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this respect.

[0014] The term "including" and its variations used herein are open inclusions, i.e., "including but not limited to". The term "based on" means "based at least in part on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". The relevant definitions of other terms will be given in the following description.

[0015] It should be noted that the concepts such as "first" and "second" mentioned in the present disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.

[0016] It should be noted that the modifications of "one" and "plurality" mentioned in the present disclosure are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, it should be understood as "one or more".

[0017] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.

[0018] 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.

[0019] For example, in response to receiving an active request from a user, a prompt message is sent to the user to clearly prompt the user that the operation requested to be performed will require obtaining and using the user's personal information. Thus, the user can autonomously choose whether to provide personal information to software or hardware such as an electronic device, application, server, or storage medium that performs the operation of the technical solution of the present disclosure according to the prompt message.

[0020] As an optional but non-limiting implementation, in response to receiving an active request from the user, the prompt information may be sent to the user in the form of a pop-up window, in which the prompt information may be presented in text form. In addition, the pop-up window may also carry a selection control for the user to choose "agree" or "disagree" to provide personal information to the electronic device.

[0021] It is understandable that the above notification and the process of obtaining user authorization are merely illustrative and do not constitute a limitation on the implementation of the present disclosure. Other methods that meet the relevant laws and regulations may also be applied to the implementation of the present disclosure.

[0022] At the same time, it is understandable that the data involved in this technical solution (including but not limited to the data itself, the acquisition or use of the data) shall comply with the requirements of relevant laws, regulations and relevant provisions.

[0023] As mentioned in the background technology, when users want to learn business knowledge in a specific field, they generally search for relevant documents on various document retrieval platforms, and then click on the documents one by one to read them to see if there is business knowledge related to their needs.

[0024] For example, business knowledge in different specific fields has certain thresholds and domain barriers. For example, the same word may have different meanings in different fields. When a user wants to know the meaning of a certain word in a specific field, he needs to enter the word to search for related knowledge documents, and then click on the documents one by one to read them to see if there is relevant content explaining the word in the knowledge document. Not only is the efficiency of acquiring knowledge low, but it is also easy to miss relevant business knowledge.

[0025] In view of this, the present disclosure provides a knowledge question answering method, device, readable medium, electronic device and program product to solve the above technical problems.

[0026] The embodiments of the present disclosure are further explained below with reference to the accompanying drawings.

[0027] Figure 1 is a flowchart of a knowledge question answering method according to an exemplary embodiment of the present disclosure, referring to Figure 1 , the method may include the following steps: S101: Obtain a target question input by a user in natural language.

[0028] For example, for business platforms in different fields, a search box can be displayed on the platform page. When the user performs an input operation in the search box, the target question entered by the user in natural language is obtained. Alternatively, a smart object can be displayed on the platform page. By clicking on the smart object, the platform page displays a Figure 2The smart object page shown, when the user performs an input operation on the smart object page, obtains the target question input by the user in natural language.

[0029] S102: Searching the knowledge base according to the target question through the machine learning model to obtain a target knowledge document for answering the target question, and determining a target answer to the target question based on the target knowledge document, wherein the knowledge base is used to store business knowledge documents.

[0030] For example, after obtaining the target question input by the user, the target question can be input into a pre-trained machine learning model, and the machine learning model can be used to retrieve relevant knowledge documents in the knowledge base based on the target question, and then the answer to the question is obtained based on the knowledge documents.

[0031] In this embodiment, the business knowledge documents stored in the knowledge base can be determined according to actual conditions, and the present disclosure embodiment does not impose any restrictions on this. For example, corresponding knowledge bases can be built based on different fields, and business knowledge documents can include structured data documents or unstructured data documents, and the present disclosure embodiment does not impose any restrictions on this.

[0032] S103: Display the target answer to the user.

[0033] In this embodiment, the display method of displaying the target answer to the user can be set according to actual conditions, and the embodiment of the present disclosure does not impose any restrictions on this.

[0034] Through the above technical solution, the machine learning model can first be used to search the knowledge base according to the target question input by the user to obtain the target knowledge document, and then the machine learning model can be used to determine the target answer to the target question based on the target knowledge document and display it to the user. In this way, the machine learning model can understand the question input by the user, and automatically search and organize the knowledge documents based on the question input by the user, and directly display the answer to the question to the user. Not only can the accuracy and search efficiency of the user's retrieval of knowledge documents in a specific field be improved, but the answer to the question can also be obtained directly, which improves the efficiency of the user's understanding of business knowledge in a specific field.

[0035] To facilitate understanding of the present solution, possible implementation methods of the present disclosure are described below.

[0036] In a possible manner, there are multiple target knowledge documents, and based on the target knowledge documents, a target answer to a target question is determined, including: determining the content relevance between the target question and each target knowledge document; based on the content relevance, determining a preset number of knowledge documents from the multiple target knowledge documents, wherein the content relevance corresponding to the preset number of knowledge documents is greater than that of knowledge documents in the multiple target knowledge documents other than the preset number of knowledge documents; and determining the target answer to the target question based on the preset number of knowledge documents.

[0037] For example, Figure 3 As shown, when there are multiple target knowledge documents, for each target knowledge document, the content relevance between the target question and the target knowledge document is determined, and then the multiple target knowledge documents are sorted based on the content relevance, and the knowledge documents with greater content relevance are selected, and then the target answer to the target question is determined based on the knowledge documents with greater content relevance.

[0038] In this embodiment, a preset number of knowledge documents with relatively high content relevance may be selected, and knowledge documents with relevance greater than a preset threshold may also be selected, wherein the preset number and the preset threshold may be determined based on actual conditions, and the embodiment of the present disclosure does not impose any restrictions on this.

[0039] For example, the preset number can be set to 10, and the first 10 knowledge documents with greater content relevance are selected from multiple target knowledge documents. For another example, the preset threshold can be set to 80%, and knowledge documents with content relevance greater than 80% are selected from multiple target knowledge documents. In this way, knowledge documents with higher relevance to the target question can be further screened out, thereby improving the accuracy of the target answer.

[0040] In a possible manner, determining the content relevance between a target question and each target knowledge document includes: inputting the target question and multiple target knowledge documents into a relevance model to obtain the content relevance between the target question and each target knowledge document, wherein the relevance model is used to output the content relevance between the question and the knowledge document based on the input question and knowledge document.

[0041] For example, the content relevance between the target question and each target knowledge document can be determined based on a pre-trained relevance model. The relevance model can be an existing relevance model in the relevant technology, or a relevance model that is improved from an existing relevance model in the relevant technology. In addition, the relevance model can be a separate model or a sub-model in a machine learning model. The embodiments of the present disclosure do not impose any restrictions on this.

[0042] In a possible manner, a target answer to a target question is determined based on a target knowledge document, including: generating a target prompt word based on the target knowledge document, the target question and a preset prompt word template, wherein the target prompt word is used to instruct a machine learning model to determine a target answer to the target question based on the target knowledge document; and inputting the target prompt word into the machine learning model to obtain a target answer to the target question.

[0043] In this embodiment, the prompt word template can be set according to actual conditions, and the embodiment of the present disclosure does not impose any restrictions on this. For example, the prompt word template can be set to: please generate a structured answer for extracting the corresponding question in the knowledge document corresponding to the document identifier based on "query question: XXXX and document identifier: XXXX".

[0044] In this embodiment, by pre-setting the prompt word template, after obtaining the query question and the document identification of the target knowledge document, the query question and the document identification can be directly filled into the corresponding positions of the prompt word template, thereby quickly generating the target prompt text, thereby increasing the speed of generating structured answers and improving the user experience.

[0045] In this embodiment, Figure 2 As shown, the target answer can be displayed on the display page, and a secondary generation control "Regenerate" can be displayed next to the target answer. By clicking "Regenerate", the knowledge document can be retrieved and the target answer can be generated again based on the target question.

[0046] Through the above method, while displaying the target answer to the user, an interactive control for the user to trigger the regeneration of the answer corresponding to the target question can be displayed, thereby regenerating the answer based on the target answer and the user's actual needs, further improving the accuracy of the target answer.

[0047] In a possible manner, a target knowledge document for answering the target question is obtained by searching in a knowledge base according to a target question through a machine learning model, including: extracting key fields in the target question through a machine learning model; performing semantic recall in the knowledge base at least according to the key fields to obtain a first knowledge document, wherein the semantic recall is used to query the knowledge base for knowledge documents including a first similar field, and the semantic similarity between the first similar field and the key field is greater than a preset threshold; performing matching retrieval in the knowledge base at least according to the key field to obtain a second knowledge document, wherein the matching retrieval is used to query the knowledge base for knowledge documents including the key field; accordingly, the target knowledge document includes the first knowledge document and the second knowledge document.

[0048] For example, semantic recall is used to query knowledge documents that include similar fields in the knowledge base. For example, the field similarity can be calculated by cosine similarity, and then the knowledge document containing the similar field whose similarity is greater than a preset threshold is used as the first knowledge document. Matching retrieval is used to retrieve knowledge documents that include key fields in the knowledge base. For example, the number of key fields in each knowledge document that includes the key fields can be counted, and then the knowledge document with a large number of key fields can be selected as the second knowledge document. Scores can also be set in advance for different intervals of the same number of fields, and then the corresponding scores are determined according to the number of key fields, and then the knowledge document with a high score is selected as the second knowledge document. The specific requirements can be determined, and the embodiments of the present disclosure do not impose any restrictions on this.

[0049] For example, the knowledge fragments in the knowledge base can be stored in the form of embedding vectors, so Figure 3 As shown, the key fields can be input into the pre-trained vectorization model to obtain the corresponding target embedding vector. After obtaining the target embedding vector, semantic recall or matching retrieval is performed in the knowledge base based on the target embedding vector.

[0050] It should be noted that the knowledge base can also pre-store the correspondence between document identifiers and knowledge fragment vectors, so that after determining the knowledge fragment vector corresponding to the key field, the corresponding document identifier is determined based on the correspondence, and then the target knowledge document corresponding to the document identifier is obtained.

[0051] It should be understood that this is only an illustrative description and does not constitute a limitation of the solution. In a possible manner, the machine learning model for extracting the key fields of the target problem and the machine learning model for vectorizing the key fields can be the same machine learning model.

[0052] Through the above methods, documents can be searched in the knowledge base based on semantic recall and matching retrieval. Since semantic recall is used to query similar fields in the knowledge base whose semantic similarity with the key field is greater than a preset threshold, knowledge documents containing fields that are semantically similar to the key field can be found, thereby increasing the breadth of recall. Matching retrieval can quickly locate knowledge documents containing key fields, thereby achieving more accurate and efficient data retrieval.

[0053] In this embodiment, Figure 3 As shown, the intent and key fields of the target question can be identified based on the first machine learning model, and keyword expansion can also be performed based on the first machine learning model. The embodiments of the present disclosure do not impose any restrictions on this.

[0054] In a possible manner, the method further includes: determining an expansion word with the same semantics as the key field. At least based on the key field, semantic recall is performed in the knowledge base, including: based on the key field and the expansion word, semantic recall is performed in the knowledge base, wherein the semantic recall is used to query the knowledge base for knowledge documents including a second similar field, and the semantic similarity between the second similar field and the key field or the expansion word is greater than a preset threshold. At least based on the key field, matching retrieval is performed in the knowledge base, including: based on the key field and the expansion word, matching retrieval is performed in the knowledge base, wherein the matching retrieval is used to retrieve knowledge documents including the key field or the expansion word in the knowledge base.

[0055] For example, the key field is "consumption", and the expansion word with the same semantics as "consumption" determined in the preset word library is "cost". Therefore, matching retrieval can be performed in the knowledge base based on "consumption" and "cost". If knowledge document A is matched in the knowledge base based on "consumption", and knowledge document B is matched in the knowledge base based on "cost", the target knowledge document is obtained.

[0056] For example, the key field is "consumption", and the expansion word with the same semantics as "consumption" determined in the preset word library is "cost". Therefore, semantic recall can be performed in the knowledge base based on the semantics of "consumption" and "cost". If knowledge document C is obtained by recalling in the knowledge base based on the semantics of "consumption", and knowledge document D is obtained by recalling in the knowledge base based on the semantics of "cost", the target knowledge document is obtained.

[0057] For example, the key field is "consumption", and the expansion word with the same semantics as "consumption" determined in the preset word library is "cost". Therefore, matching retrieval and semantic recall can be performed in the knowledge base based on "consumption" and "cost". If knowledge document A is matched in the knowledge base based on "consumption", and knowledge document B is matched in the knowledge base based on "cost", knowledge document C is recalled in the knowledge base based on the semantics of "consumption", and knowledge document D is recalled in the knowledge base based on "cost", the target knowledge document is obtained.

[0058] In this way, the extended words with the same semantics as the key field can be obtained, so as to search in the knowledge base based on the key field and the extended words. Since the semantics of the extended words are the same as the semantics of the key field, the relevance and accuracy of the search results can be improved.

[0059] The implementation of the scheme of this embodiment can refer to the above description of semantic recall and matching retrieval in the knowledge base based on key fields, which will not be repeated here. And the target knowledge document can refer to the entire knowledge document or a knowledge document fragment, and the embodiment of the disclosure does not impose any restrictions on this.

[0060] It should be understood that the method of searching in the knowledge base according to the key fields and the expansion words in this embodiment is only for illustrative purposes and does not constitute a limitation on the solution. When the knowledge fragments in the knowledge base are stored in the form of embedded vectors, in a possible manner, after determining the embedded vectors corresponding to the key fields and the expansion words, matching retrieval can be performed in the knowledge base according to the embedded vectors corresponding to the key fields and the expansion words. And / or, semantic recall can be performed in the knowledge base according to the embedded vectors corresponding to the key fields and the expansion words.

[0061] In a possible way, the business knowledge documents in the knowledge base are stored in the following way: multiple business knowledge documents are obtained through different channels; each business knowledge document is split and processed to obtain business knowledge fragments; the business knowledge fragments are vectorized to obtain knowledge fragment vectors; and the knowledge fragment vectors are stored in the knowledge base.

[0062] For example, Figure 4 As shown, documents uploaded by users in the business platform, entry contents defined by the platform, platform knowledge base generated based on documents in the platform, external help documents of the platform, oncall sites, i.e., manually maintained question and answer contents, documents automatically generated based on multiple documents, etc. can be obtained. The specific contents can be determined according to the actual business scenario, and the embodiments of the present disclosure do not impose any restrictions on this. Furthermore, the obtained business knowledge documents can be split and processed to obtain business knowledge fragments.

[0063] In this embodiment, corresponding knowledge bases can be constructed for different fields, such as the e-commerce field, etc., and the embodiments of the present disclosure do not impose any restrictions on this. Business knowledge documents can be stored in the knowledge base in the form of natural language, or in the form of embedded vectors, and the embodiments of the present disclosure do not impose any restrictions on this. If stored in the form of natural language, the business knowledge fragments are stored in the knowledge base after they are obtained. If stored in the form of embedded vectors, the business knowledge fragments can be vectorized by a vectorization model, and the obtained knowledge fragment vectors can be stored.

[0064] In a possible manner, a machine learning model is used to search in a knowledge base according to a target question to obtain a target knowledge document for answering the target question, and based on the target knowledge document, a target answer to the target question is determined, including: searching in a knowledge base according to the target question through a first machine learning model to obtain a target knowledge document for answering the target question; and determining the target answer to the target question based on the target knowledge document through a second machine learning model.

[0065] In this embodiment, Figure 3As shown, the first machine learning model and the second machine learning model can be different models, or different sub-models in the same machine learning model, and the present disclosure does not limit this. Accordingly, the vectorization model disclosed in the embodiments of the present disclosure can be another model different from the machine learning model, or a sub-model integrated in the machine learning model, such as Figure 4 The vectorized model and the first machine learning model are different sub-models of the same machine learning model, or the same machine learning model integrates Figure 3 and Figure 4 The vectorized model, the first machine learning model, and the second machine learning model shown are not limited in any way in the embodiments of the present disclosure.

[0066] Among them, the first machine learning model can be an existing machine learning model in the relevant technology, or it can be a machine learning model that is improved from the existing machine learning model in the relevant technology. The embodiments of the present disclosure do not impose any restrictions on this. For example, the first machine learning model can be a Transforme model in the relevant technology, whereby the Transforme model can be trained by constructing training samples, so that the Transforme model can accurately extract knowledge documents based on the target problem.

[0067] For example, sample sentences annotated with labels and used to query knowledge documents can be obtained, where the labels are used to indicate the key fields of the sample sentences. The sample sentences are input into the Transforme model to obtain predicted key fields, the loss function values ​​of the real key fields and the predicted key fields are calculated, and the parameter values ​​of the Transforme model are adjusted based on the loss function values ​​until the Transforme model converges.

[0068] Among them, the second machine learning model can be an existing machine learning model in the relevant technology, or it can be a machine learning model that is improved from the existing machine learning model in the relevant technology. The embodiments of the present disclosure do not impose any restrictions on this. For example, the second machine learning model can be a large language model (LLM) in the relevant technology. Thus, the LLM model can be trained by constructing training samples, so that the LLM model can output structured answers to questions based on the input prompt words.

[0069] For example, sample prompt words annotated with labels can be obtained, where the labels are used to indicate the true structured question answers corresponding to the sample prompt words, the sample prompt words are input into the LLM model to obtain predicted structured question answers, the loss function values ​​of the true structured question answers and the predicted structured question answers are calculated, and the parameter values ​​of the LLM model are adjusted based on the loss function values ​​until the LLM model converges.

[0070] To facilitate understanding of the knowledge question answering method disclosed herein, a possible implementation of this solution is described below: like Figure 2 As shown, a smart object is displayed on the platform page. By clicking on the smart object, a smart object page is displayed on the platform page. When the user enters the target question "What is XX" in natural language on the smart object page, the platform backend inputs "What is XX" into the first machine learning model. The first machine learning model performs intent recognition and key field extraction on "What is XX" to obtain the key field "XX". After that, based on the semantics of "XX", the proper nouns and / or synonyms are expanded in the preset vocabulary to obtain the expanded word "XXX". After obtaining the expanded word "XXX", the first machine learning model performs vectorization processing based on "XX" and "XXX", and then performs matching retrieval and semantic recall in the knowledge base to obtain the target knowledge document. Then, the relevance between the target question and the target knowledge document is determined by the relevance model, and the knowledge document with higher relevance is determined, and the document identifier corresponding to the knowledge document and the target question are filled into the corresponding position of the prompt word template to obtain the target prompt text, and the target prompt text is input into the second machine learning model to obtain a structured answer for extracting the corresponding question in the knowledge document corresponding to the document identifier.

[0071] By adopting the above method, the machine learning model can identify and understand the questions input by the user, and extract the key fields in the questions, which can improve the accuracy of recalling the relevant questions of the user. Then, by combining the technology of document fragment splitting vectorization and semantic retrieval, the accuracy of recalling the relevant documents of the user's question can be improved. Then the relevant document fragments are handed over to the machine learning model for answering, so that the user can directly get the answer to the question. It can not only improve the accuracy and search efficiency of users' retrieval of knowledge documents in a specific field, but also directly get the answer to the question, and improve the efficiency of users' understanding of business knowledge in a specific field.

[0072] Based on the same concept, the present disclosure also provides a knowledge question answering device, such as Figure 5 As shown, the knowledge question answering device 500 may include: An acquisition module 501 is used to acquire a target question input by a user in a natural language; A determination module 502 is used to search in a knowledge base according to the target question through a machine learning model to obtain a target knowledge document for answering the target question, and determine a target answer for the target question based on the target knowledge document, wherein the knowledge base is used to store business knowledge documents; The display module 503 is used to display the target answer to the user.

[0073] Through the above-mentioned knowledge question and answer device 500, the target question input by the user can be searched in the knowledge base through the machine learning model to obtain the target knowledge document, and then the target answer to the target question can be determined based on the target knowledge document through the machine learning model and displayed to the user. In this way, the question input by the user can be understood through the machine learning model, and the knowledge document can be automatically searched and sorted based on the question input by the user, and the answer to the question can be directly displayed to the user. Not only can the accuracy and search efficiency of the user's retrieval of knowledge documents in a specific field be improved, but the answer to the question can also be directly obtained, which improves the efficiency of the user's understanding of business knowledge in a specific field.

[0074] In a possible manner, there are multiple target knowledge documents, and the determination module 502 may include: A first determination submodule is used to determine the content relevance between the target question and each of the target knowledge documents; A second determination submodule is used to determine a preset number of knowledge documents from a plurality of target knowledge documents according to the content relevance, wherein the content relevance corresponding to the preset number of knowledge documents is greater than the knowledge documents other than the preset number of knowledge documents in the plurality of the target knowledge documents; The third determination submodule is used to determine a target answer to the target question based on the preset number of knowledge documents.

[0075] In a possible manner, the first determining submodule is used to: The target question and multiple target knowledge documents are input into a relevance model to obtain the content relevance between the target question and each target knowledge document, wherein the relevance model is used to output the content relevance between the question and the knowledge document based on the input question and knowledge document.

[0076] In a possible manner, the determining module 502 may include: A generating module, configured to generate a target prompt word based on the target knowledge document, the target question and a preset prompt word template, wherein the target prompt word is used to instruct the machine learning model to determine a target answer to the target question based on the target knowledge document; An input module is used to input the target prompt word into the machine learning model to obtain a target answer to the target question.

[0077] In a possible manner, the determining module 502 may include: An extraction module, used to extract key fields in the target question through the machine learning model; A recall module, configured to perform semantic recall in the knowledge base at least according to the key field to obtain a first knowledge document, wherein the semantic recall is used to query the knowledge base for knowledge documents including a first similar field, and the semantic similarity between the first similar field and the key field is greater than a preset threshold; A retrieval module, configured to perform a matching search in the knowledge base at least according to the key field to obtain a second knowledge document, wherein the matching search is used to query the knowledge base for knowledge documents including the key field; Accordingly, the target knowledge document includes the first knowledge document and the second knowledge document.

[0078] In a possible manner, the knowledge question answering device 500 further includes: A fourth determination submodule is used to determine an expansion word having the same semantics as the key field; The recall module is used to: According to the key field and the expansion word, a semantic recall is performed in the knowledge base, wherein the semantic recall is used to query the knowledge base for knowledge documents including a second similar field, and the semantic similarity between the second similar field and the key field or the expansion word is greater than the preset threshold; The retrieval module is used to: According to the key field and the expanded word, a matching search is performed in the knowledge base, wherein the matching search is used to retrieve knowledge documents in the knowledge base that include the key field or the expanded word.

[0079] In a possible manner, the business knowledge documents in the knowledge base are stored in the following manner: Obtain multiple business knowledge documents through different channels; Splitting each of the business knowledge documents to obtain business knowledge fragments; Vectorizing the business knowledge fragment to obtain a knowledge fragment vector; The knowledge fragment vector is stored in the knowledge base.

[0080] Based on the same concept, an embodiment of the present disclosure also provides a computer-readable medium on which a computer program is stored, and when the program is executed by a processing device, the steps of any of the above-mentioned knowledge question and answer methods are implemented.

[0081] Based on the same concept, the present disclosure also provides an electronic device, which may include: a storage device having a computer program stored thereon; A processing device is used to execute the computer program in the storage device to implement the steps of any of the above-mentioned knowledge question and answer methods.

[0082] Based on the same concept, an embodiment of the present disclosure also provides a computer program product, including a computer program, which implements the steps of any of the above-mentioned knowledge question and answer methods when executed by a processor.

[0083] Reference below Figure 6 , which shows a schematic diagram of the structure of an electronic device (600) suitable for implementing an embodiment of the present disclosure. The terminal device in the embodiment of the present disclosure may include but is not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle terminals (such as vehicle navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 6 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.

[0084] like Figure 6 As shown, the electronic device 600 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 601, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 602 or a program loaded from a storage device 608 into a random access memory (RAM) 603. In the RAM 603, various programs and data required for the operation of the electronic device 600 are also stored. The processing device 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.

[0085] Typically, the following devices may be connected to the I / O interface 605: an input device 606 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 607 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 608 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 609. The communication device 609 may allow the electronic device 600 to communicate with other devices wirelessly or by wire to exchange data. Although Figure 6 The electronic device 600 is shown with various devices, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead.

[0086] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program contains program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device 609, or installed from a storage device 608, or installed from a ROM 602. When the computer program is executed by the processing device 601, the above-mentioned functions defined in the method of the embodiment of the present disclosure are executed.

[0087] It should be noted that the computer-readable medium mentioned above in the present disclosure may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, 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 above. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. Computer readable signal media may also be any computer readable medium other than computer readable storage media, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.

[0088] In some embodiments, any currently known or future developed network protocol such as HTTP (HyperText Transfer Protocol) can be used for communication, and can be interconnected with 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"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any currently known or future developed network.

[0089] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.

[0090] The above-mentioned computer-readable medium carries one or more programs. When the above-mentioned one or more programs are executed by the electronic device, the electronic device: obtains a target question input by a user in a natural language; searches a knowledge base according to the target question through a machine learning model to obtain a target knowledge document for answering the target question, and determines a target answer for the target question based on the target knowledge document, wherein the knowledge base is used to store business knowledge documents; and displays the target answer to the user.

[0091] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages ​​or a combination thereof, including, but not limited to, object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).

[0092] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0093] The modules involved in the embodiments described in the present disclosure may be implemented by software or hardware, wherein the name of a module does not, in some cases, limit the module itself.

[0094] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.

[0095] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or device, or any suitable combination of the foregoing. 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.

[0096] The above description is only a preferred embodiment of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosed concept. For example, the above features are replaced with the technical features with similar functions disclosed in the present disclosure (but not limited to) by each other to form a technical solution.

[0097] In addition, although each operation is described in a specific order, this should not be understood as requiring these operations to be performed in the specific order shown or in a sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details are included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Some features described in the context of a separate embodiment can also be implemented in a single embodiment in combination. On the contrary, the various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination mode.

[0098] Although the subject matter has been described in language specific to structural features and / or method logic actions, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. On the contrary, the specific features and actions described above are merely example forms of implementing the claims. Regarding the device in the above embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here.

Claims

1. A knowledge question answering method, It is characterized in that include: Obtain the target question input by the user in natural language; Searching a knowledge base according to the target question through a machine learning model to obtain a target knowledge document for answering the target question, and determining a target answer to the target question based on the target knowledge document, wherein the knowledge base is used to store business knowledge documents; The target answer is displayed to the user.

2. The knowledge question answering method according to claim 1, It is characterized in that There are multiple target knowledge documents, and determining a target answer to the target question based on the target knowledge documents includes: Determining the content relevance between the target question and each of the target knowledge documents; Determining a preset number of knowledge documents from a plurality of target knowledge documents according to the content relevance, wherein the content relevance corresponding to the preset number of knowledge documents is greater than the knowledge documents other than the preset number of knowledge documents in the plurality of target knowledge documents; A target answer to the target question is determined based on the preset number of knowledge documents.

3. The knowledge question answering method according to claim 2, It is characterized in that Determining the content relevance between the target question and each of the target knowledge documents includes: The target question and multiple target knowledge documents are input into a relevance model to obtain the content relevance between the target question and each target knowledge document, wherein the relevance model is used to output the content relevance between the question and the knowledge document based on the input question and knowledge document.

4. The knowledge question answering method according to any one of claims 1 to 3, It is characterized in that The step of determining a target answer to the target question based on the target knowledge document includes: Based on the target knowledge document, the target question and a preset prompt word template, generating a target prompt word, wherein the target prompt word is used to instruct the machine learning model to determine a target answer to the target question based on the target knowledge document; The target prompt word is input into the machine learning model to obtain a target answer to the target question.

5. The knowledge question answering method according to any one of claims 1 to 3, It is characterized in that The method of searching the knowledge base according to the target question through the machine learning model to obtain a target knowledge document for answering the target question includes: Extracting key fields in the target problem through the machine learning model; At least according to the key field, semantic recall is performed in the knowledge base to obtain a first knowledge document, wherein the semantic recall is used to query the knowledge base for knowledge documents including a first similar field, and the semantic similarity between the first similar field and the key field is greater than a preset threshold; Performing a matching search in the knowledge base at least according to the key field to obtain a second knowledge document, wherein the matching search is used to query the knowledge base for knowledge documents including the key field; Accordingly, the target knowledge document includes the first knowledge document and the second knowledge document.

6. The knowledge question answering method according to claim 5, It is characterized in that Also includes: Determining an expansion word having the same semantics as the key field; The performing semantic recall in the knowledge base at least according to the key field comprises: According to the key field and the expansion word, a semantic recall is performed in the knowledge base, wherein the semantic recall is used to query the knowledge base for knowledge documents including a second similar field, and the semantic similarity between the second similar field and the key field or the expansion word is greater than the preset threshold; The performing a matching search in the knowledge base at least according to the key field includes: According to the key field and the expanded word, a matching search is performed in the knowledge base, wherein the matching search is used to retrieve knowledge documents in the knowledge base that include the key field or the expanded word.

7. The knowledge question answering method according to any one of claims 1 to 3, It is characterized in that The business knowledge documents in the knowledge base are stored in the following manner: Obtain multiple business knowledge documents through different channels; Splitting each of the business knowledge documents to obtain business knowledge fragments; Vectorizing the business knowledge fragment to obtain a knowledge fragment vector; The knowledge fragment vector is stored in the knowledge base.

8. A knowledge question-answering device, It is characterized in that include: An acquisition module, used to acquire a target question input by a user in natural language; a determination module, configured to search a knowledge base according to the target question through a machine learning model to obtain a target knowledge document for answering the target question, and determine a target answer to the target question based on the target knowledge document, wherein the knowledge base is used to store business knowledge documents; A display module is used to display the target answer to the user.

9. A computer readable medium having a computer program stored thereon, It is characterized in that When the computer program is executed by a processing device, the steps of the method according to any one of claims 1 to 7 are implemented.

10. An electronic device, It is characterized in that include: a storage device having a computer program stored thereon; A processing device, configured to execute the computer program in the storage device to implement the steps of the method according to any one of claims 1 to 7.

11. A computer program product comprising a computer program, It is characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.

Citation Information

Cited By

  • Data query method and device, electronic equipment and computer program product

    CN119149579A

  • Question answering method and device based on large model, electronic equipment and medium

    CN119357364A

  • Intelligent application platform data display method and device, equipment, storage medium and computer program product

    CN119782480A

  • Knowledge base construction method and device, equipment and medium

    CN120297399A

  • Intelligent agent question and answer method and device fusing different large models, medium and product

    CN120353909A