Knowledge response method and device, equipment, storage medium and program product
By extracting the keyword and semantic information of user problems, combining the recall and intention characteristics of the knowledge base and knowledge graph, the problems of insufficient semantic understanding and inaccurate user intention recognition in the existing credit card processing field knowledge response system are solved, and more accurate and relevant question-and-answer results are achieved.
Patent Information
- Application Number
- CN202510222907.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-27
- Publication Date
- 2025-05-30
AI Technical Summary
The existing knowledge response system in the field of credit card processing has problems such as insufficient semantic understanding and inaccurate user intention identification, which may lead to hallucinations and other problems in the results generated by the model.
By obtaining user questions, keywords and semantic information are extracted separately, text and semantic recalls are performed based on the preset knowledge base, intention characteristics are determined in combination with the knowledge graph, different characteristics are fused for prompt word engineering, and pre-trained big model is input to obtain target answers.
It improves the semantic understanding and intention recognition of user problems, reduces the problem of hallucination in big models, and improves the relevance and accuracy of question-and-answer questions.
Smart Images

Figure CN120067270A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of fintech, and more particularly to a knowledge answering method, apparatus, device, storage medium, and program product. Background Art
[0002] With the rapid development of artificial intelligence technology, knowledge answering systems have been widely used in various fields. For example, in the field of credit card application in finance, such systems can provide information feedback according to users' questions, improving the efficiency of information retrieval and knowledge acquisition.
[0003] However, the existing responses in the field of credit card application mainly generate classification models through text matching or traditional machine learning and deep learning models, etc., classify the user input and map it to specific FAQs (frequently-asked questions), and return answers. Although the generative large model has a good anthropomorphic effect, direct use will lead to insufficient semantic understanding and inaccurate user intention recognition, and problems such as hallucinations will occur in the results generated by the model.
[0004] In addition, traditional knowledge in the credit card field usually exists in the form of long documents. Although these documents are rich in information, they are huge in length and cannot directly answer customer questions. A large amount of manpower is required to maintain a large number of FAQs based on these documents. Summary of the Invention
[0005] In view of the above problems, the present disclosure provides a knowledge answering method, apparatus, device, storage medium, and program product.
[0006] According to a first aspect of the present disclosure, there is provided a knowledge answering method, including: obtaining a user question, and respectively extracting keywords and semantic information of the user question; based on a preset knowledge base, performing text recall processing on the keywords and semantic recall processing on the semantic information to respectively obtain a first similarity feature and a second similarity feature of the user question; based on a preset knowledge graph, determining an intention feature of the user question according to the entity and attribute of the user question; fusing the first similarity feature, the second similarity feature and the intention feature and performing prompt engineering processing to obtain a prompt word feature corresponding to the user question; inputting the prompt word feature into a pre-trained large model to obtain a target answer corresponding to the user question.
[0007] According to an embodiment of the present disclosure, before respectively extracting the keywords and semantic information of the user question, the method further includes: before respectively extracting the keywords and semantic information of the user question, retrieving and determining that the target answer corresponding to the user question cannot be obtained based on a preset rule and FAQ classification.
[0008] According to an embodiment of the present disclosure, based on a preset knowledge base, text recall processing is performed on keywords to obtain first similarity features of a user question, including: vectorizing the keywords and the knowledge base respectively, and calculating the similarity between the vector features of the keywords and multiple knowledge base entries; selecting a first knowledge base entry similar to the keywords according to the similarity result and a preset similarity threshold, and the first knowledge base entry includes the first similarity features of the user question.
[0009] According to an embodiment of the present disclosure, based on a preset knowledge base, semantic recall processing is performed on semantic information to obtain second similarity features of a user question, including: extracting features of the semantic information by using natural language processing technology to obtain vector features of the semantic information; calculating the similarity between the vector features of the semantic information and multiple knowledge base entries; based on a clustering algorithm, determining a second knowledge base entry similar to the semantic information of the user question, and the second knowledge base entry includes the second similarity features of the user question.
[0010] According to an embodiment of the present disclosure, based on a preset knowledge graph, according to the entities and attributes of a user question, intention features of the user question are determined, including: using natural language processing technology to determine the entities and attributes of the user question; matching the entities and attributes of the user question with the nodes in the preset knowledge graph respectively to determine the attributes corresponding to the entities; classifying the intention of the user question according to the entities and their corresponding attributes; based on the result of the intention classification and the relationship reasoning function in the knowledge graph, according to the entities of the user question and the attributes corresponding to the entities, determining the intention features of the user question.
[0011] According to an embodiment of the present disclosure, the first similarity features, the second similarity features and the intention features are fused and prompt engineering processing is performed to obtain prompt word features corresponding to the user question, including: merging the first similarity features, the second similarity features and the intention features to construct a comprehensive feature vector; generating prompt word features by using natural language processing technology based on the comprehensive feature vector; screening the prompt word features and retaining the prompt word features higher than a preset relevance threshold.
[0012] The second aspect of the present disclosure provides a knowledge answering device, including: a user question acquisition module, configured to acquire a user question and respectively extract the keyword and semantic information of the user question; a similar feature acquisition module, configured to perform text recall processing on the keyword and semantic recall processing on the semantic information based on a preset knowledge base, and respectively obtain the first similar feature and the second similar feature of the user question; an intention feature determination module, based on a preset knowledge graph, to determine the intention feature of the user question according to the entity and attribute of the user question; a prompt word feature acquisition module, configured to fuse the first similar feature, the second similar feature and the intention feature and perform prompt word engineering processing to obtain a prompt word feature corresponding to the user question; a target answer determination module, configured to input the prompt word feature into a pre-trained large model to obtain a target answer corresponding to the user question.
[0013] According to an embodiment of the present disclosure, the device further includes: a retrieval module, configured to retrieve and determine that the target answer corresponding to the user question cannot be obtained based on a preset rule and FAQ classification before respectively extracting the keyword and semantic information of the user question.
[0014] The third aspect of the present disclosure provides an electronic device, including: one or more processors; a memory, configured to store one or more computer programs, wherein, the above-mentioned one or more processors execute the above-mentioned one or more computer programs to implement the steps of the above-mentioned method.
[0015] The fourth aspect of the present disclosure further provides a computer-readable storage medium, on which a computer program or instruction is stored, and when the computer program or instruction is executed by a processor, the steps of the above-mentioned method are implemented.
[0016] The fifth aspect of the present disclosure further provides a computer program product, including a computer program or instruction, and when the computer program or instruction is executed by a processor, the steps of the above-mentioned method are implemented. Description of the Drawings
[0017] Through the following description of the embodiments of the present disclosure with reference to the drawings, the above-mentioned content and other objects, features and advantages of the present disclosure will become clearer. In the drawings:
[0018] Figure 1 Schematically shows an application scenario diagram of the knowledge answering method according to an embodiment of the present disclosure;
[0019] Figure 2 Schematically shows a flowchart of the knowledge answering method according to an embodiment of the present disclosure;
[0020] Figure 3 Schematically shows a flowchart of obtaining the first similar feature according to an embodiment of the present disclosure;
[0021] Figure 4Schematically shows a flowchart for obtaining a second similarity feature according to an embodiment of the present disclosure;
[0022] Figure 5 Schematically shows a flowchart for obtaining an intention feature according to an embodiment of the present disclosure;
[0023] Figure 6 Schematically shows a structural block diagram of a knowledge answering device according to an embodiment of the present disclosure; and
[0024] Figure 7 Schematically shows a block diagram of an electronic device suitable for implementing a knowledge answering method according to an embodiment of the present disclosure. Detailed implementation manners
[0025] Hereinafter, embodiments of the present disclosure will be described with reference to the accompanying drawings. However, it should be understood that these descriptions are merely exemplary and are not intended to limit the scope of the present disclosure. In the following detailed description, for the sake of explanation, many specific details are set forth to provide a comprehensive understanding of the embodiments of the present disclosure. However, obviously, one or more embodiments can also be implemented without these specific details. In addition, in the following description, descriptions of well-known structures and technologies are omitted to avoid unnecessarily obscuring the concepts of the present disclosure.
[0026] The terms used herein are merely for describing specific embodiments and are not intended to limit the present disclosure. The terms "including", "comprising", etc. used herein indicate the presence of features, steps, operations, and / or components, but do not exclude the presence or addition of one or more other features, steps, operations, or components.
[0027] All terms used herein (including technical and scientific terms) have the meanings commonly understood by those skilled in the art, unless otherwise defined. It should be noted that the terms used herein should be interpreted as having a meaning consistent with the context of this specification and should not be interpreted in an idealized or overly rigid manner.
[0028] In the case of using expressions such as "at least one of A, B, and C", generally, it should be interpreted according to the meaning commonly understood by those skilled in the art (for example, "a system having at least one of A, B, and C" should include, but is not limited to, a system having only A, only B, only C, having A and B, having A and C, having B and C, and / or having A, B, and C).
[0029] It should be noted that the knowledge answering method and device of the present disclosure can be used in the field of fintech and can also be used in any field other than the field of fintech. The application fields of the knowledge answering method and device of the present disclosure are not limited.
[0030] In the technical solutions of the present disclosure, the user information involved (including but not limited to user personal information, user image information, user device information, such as location information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) are all information and data authorized by the user or fully authorized by all parties. Moreover, the processing of relevant data, such as collection, storage, use, processing, transmission, provision, disclosure, and application, all comply with relevant laws, regulations, and standards, adopt necessary confidentiality measures, do not violate public order and good customs, and provide corresponding operation entrances for users to choose to authorize or refuse.
[0031] In the scenario of making automated decisions using personal information, the methods, devices, and systems provided by the embodiments of the present disclosure all provide corresponding operation entrances for users to choose to agree or refuse the results of automated decisions; if the user chooses to refuse, the expert decision-making process will be entered. The expression "automated decision" here refers to the activity of automatically analyzing and evaluating an individual's behavior habits, interests, hobbies, or economic, health, credit status, etc. through a computer program and making decisions. The expression "expert decision" here refers to the activity of making decisions by personnel who are engaged in work in a specific field, have specialized experience, knowledge, and skills, and have reached a certain professional level.
[0032] The embodiments of the present disclosure provide a knowledge answering method, which includes: obtaining a user question, and respectively extracting the keyword and semantic information of the user question; based on a preset knowledge base, performing text recall processing on the keyword and semantic recall processing on the semantic information to respectively obtain the first similarity feature and the second similarity feature of the user question; based on a preset knowledge graph, determining the intention feature of the user question according to the entity and attribute of the user question; fusing the first similarity feature, the second similarity feature, and the intention feature and performing prompt engineering processing to obtain a prompt word feature corresponding to the user question; and inputting the prompt word feature into a pre-trained large model to obtain the target answer corresponding to the user question.
[0033] Through the embodiments of the present disclosure, this method can accurately understand the user's intention through a comprehensive analysis of the user question, extract and process semantic information using natural language processing technology, and can better understand complex questions, so as to maintain an efficient response ability when facing diverse user questions. In addition, by establishing a comprehensive knowledge base and knowledge graph, it can quickly locate information related to the user question, greatly reduce the search time, improve the efficiency of information acquisition, and finally generate targeted prompt words by fusing different features, use the pre-trained large model to output the correct answer, reduce the hallucination problem of the large model, and improve the relevance and accuracy of the question and answer.
[0034] Figure 1A schematic diagram shows an application scenario diagram of the knowledge answering method according to an embodiment of the present disclosure.
[0035] As Figure 1 shown, the application scenario 100 according to this embodiment may include terminal devices 101, 102, 103, a network 104, and a server 105. The network 104 is used to provide a medium for communication links between the first terminal device 101, the second terminal device 102, the third terminal device 103, and the server 105. The network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, etc.
[0036] Users can use the first terminal device 101, the second terminal device 102, and the third terminal device 103 to interact with the server 105 through the network 104 to receive or send messages, etc. Various communication client applications may be installed on the first terminal device 101, the second terminal device 102, and the third terminal device 103, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social platform software, etc. (only for example).
[0037] The first terminal device 101, the second terminal device 102, and the third terminal device 103 may be various electronic devices with a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop portable computers, and desktop computers, etc.
[0038] The server 105 may be a server providing various services, such as a background management server that supports the websites browsed by users using the first terminal device 101, the second terminal device 102, and the third terminal device 103 (only for example). The background management server may analyze and process data such as user requests received, and feedback the processing results (such as web pages, information, or data obtained or generated according to user requests) to the terminal device.
[0039] It should be noted that the knowledge answering method provided by the embodiments of the present disclosure can generally be executed by the server 105. Correspondingly, the knowledge answering device provided by the embodiments of the present disclosure can generally be set in the server 105. The knowledge answering method provided by the embodiments of the present disclosure can also be executed by a server or a server cluster different from the server 105 and capable of communicating with the first terminal device 101, the second terminal device 102, the third terminal device 103, and / or the server 105. Correspondingly, the knowledge answering device provided by the embodiments of the present disclosure can also be set in a server or a server cluster different from the server 105 and capable of communicating with the first terminal device 101, the second terminal device 102, the third terminal device 103, and / or the server 105.
[0040] It should be understood, Figure 1The numbers of the terminal devices, networks, and servers in [it] are merely illustrative. According to the implementation requirements, there can be any number of terminal devices, networks, and servers.
[0041] Based on the Figure 1 scenario described below, the knowledge answering method of the disclosed embodiments will be described in detail through Figures 2 to 5 the following.
[0042] Figure 2 The flowchart of the knowledge answering method according to the embodiments of the present disclosure is schematically shown.
[0043] As Figure 2 shown, in the embodiments of the present disclosure, the knowledge answering method specifically includes operations S210 to S250.
[0044] In operation S210, obtain the user's question, and extract the keyword and semantic information of the user's question respectively.
[0045] According to the embodiments of the present disclosure, for example, in the field of financial banking, in the scenario of recommending credit card applications to users, relevant questions of the user will be obtained in order to answer the customer's questions more accurately and provide accurate credit card recommendations and corresponding products to the customer. In this scenario, obtain the user's question, for example, "Do you have any recommendations for a credit card with a preferential interest rate?" and other such relevant questions.
[0046] After obtaining such questions from the user, generally, it is considered to retrieve and determine whether the target answer corresponding to the user's question can be obtained based on preset rules and FAQ classification. This method can quickly match the user's question and provide accurate answers based on predefined rules and frequently asked questions. However, when faced with complex or unique questions, it will be found that there is no corresponding FAQ to match, and this method cannot provide a prepared answer. Therefore, the embodiments of the present disclosure propose a new answering method.
[0047] It can be understood that in the embodiments of the present disclosure, after obtaining the user's question, first retrieve and determine that the target answer corresponding to the user's question cannot be obtained.
[0048] Furthermore, according to the obtained user's question, extract the keyword and semantic information of the user's question respectively.
[0049] Exemplarily, clean the user question, and use natural language processing techniques (such as TF-IDF, BERT, etc.) to extract the keywords of the user question. In addition, the semantic information of the user can also be identified through syntactic analysis and semantic role labeling. For example, for the user question "Do you have any recommendations for a credit card with a favorable interest rate?", the keywords that can be extracted are "interest rate", "favorable", and "credit card", and the semantic information can be "Need a recommendation for a credit card with a low interest rate".
[0050] Through the embodiments of the present disclosure, a comprehensive analysis of the user question can accurately understand the user's intention, thereby providing a more accurate answer and significantly improving user satisfaction.
[0051] In operation S220, based on a preset knowledge base, perform text recall processing on the keywords and semantic recall processing on the semantic information to obtain the first similar feature and the second similar feature of the user question respectively.
[0052] Figure 3 The flowchart of obtaining the first similar feature according to the embodiment of the present disclosure is schematically shown.
[0053] As Figure 3 shown, in the embodiment of the present disclosure, based on a preset knowledge base, perform text recall processing on the keywords to obtain the first similar feature of the user question, which specifically includes operations S310 to S320.
[0054] In operation S310, vectorize the keywords and the knowledge base respectively, and calculate the similarity between the vector features of the keywords and multiple knowledge base entries.
[0055] Exemplarily, a pre-trained word vectorization model (such as Word2Vec) can be used to vectorize the extracted keywords, and each keyword is converted into a vector form.
[0056] In the embodiment of the present disclosure, there are multiple entries in the preset knowledge base, and each entry can also be processed using the same vectorization model.
[0057] Furthermore, for example, use cosine similarity to calculate the similarity between the keyword vector of the user question and the vectors of multiple knowledge base entries.
[0058] In operation S320, according to the similarity result and a preset similarity threshold, select the first knowledge base entry similar to the keywords. The first knowledge base entry includes the first similar feature of the user question.
[0059] Exemplarily, first, a similarity threshold is preset (e.g., 0.7). Then, after calculating the similarity between all keywords and the knowledge base entries, the results are compared with the threshold. For example, the similarity between entry 1 and the keyword is 0.3, the similarity between entry 2 and the keyword is 0.5, and the similarity between entry 3 and the keyword is 0.85 (meeting the threshold), etc. At this time, entry 3 is the first knowledge base entry similar to the keyword, and this entry 3 can be the first similar feature of the user's question.
[0060] Through the embodiments of the present disclosure, the keywords in the user's question can be effectively vectorized and the similarity with the entries in the knowledge base can be calculated, so as to select the knowledge base entry closest to the user's question, which can improve the accuracy and efficiency of information retrieval for the user's question.
[0061] Figure 4 The flowchart of obtaining the second similar feature according to an embodiment of the present disclosure is schematically shown.
[0062] As Figure 4 shown, in the embodiments of the present disclosure, based on a preset knowledge base, semantic recall processing is performed on semantic information to obtain the second similar feature of the user's question, which specifically includes operations S410 to S430.
[0063] In operation S410, natural language processing technology is used to extract features from the semantic information to obtain the vector features of the semantic information.
[0064] In operation S420, the vector features of the semantic information are calculated for similarity with multiple knowledge base entries.
[0065] In operation S430, based on a clustering algorithm, a second knowledge base entry similar to the semantic information of the user's question is determined, and the second knowledge base entry includes the second similar feature of the user's question.
[0066] In the embodiments of the present disclosure, first, the semantic information is preprocessed, such as word segmentation, stop word removal, etc. Then, natural language processing technology (such as a word embedding model) is used to extract features from the semantic information to obtain the vector features of the semantic information. Finally, the vector features of the semantic information are calculated for similarity with multiple knowledge base entries to obtain the similarity.
[0067] Furthermore, the K-means clustering algorithm is selected. The vector features of all knowledge base entries are input into the K-means algorithm, the number of clusters is set. After clustering, the knowledge base entries are divided into several groups. Then, the cluster center closest to the semantic information is found, and the entry with the highest similarity is selected from this cluster as the second knowledge base entry, and the second similar feature of the user's question is also obtained.
[0068] Through the embodiments of the present disclosure, this process utilizes feature extraction and similarity calculation in natural language processing technology, and combines clustering algorithms to enhance the accuracy and efficiency of information retrieval for user questions.
[0069] In operation S230, based on a preset knowledge graph, according to the entities and attributes of the user question, determine the intent features of the user question.
[0070] Figure 5 Schematically shows a flowchart of obtaining intent features according to an embodiment of the present disclosure.
[0071] As Figure 5 shown, in the embodiments of the present disclosure, based on a preset knowledge graph, according to the entities and attributes of the user question, determine the intent features of the user question, specifically including operations S510 to S540.
[0072] In operation S510, use natural language processing technology to determine the entities and attributes of the user question.
[0073] In operation S520, match the entities and attributes of the user question with the nodes in the preset knowledge graph respectively to determine the attributes corresponding to the entities.
[0074] In operation S530, classify the user question according to the entity and its corresponding attributes.
[0075] In operation S540, based on the result of the intent classification and the relationship reasoning function in the knowledge graph, according to the entity of the user question and the attributes corresponding to the entity, determine the intent features of the user question.
[0076] Exemplarily, in the embodiments of the present disclosure, first use natural language processing tools to perform named entity recognition on the sentence, such as "want a credit card with preferential interest rate", and identify the entity as "credit card" and the attribute as "low interest rate". It should be noted that in the embodiments of the present disclosure, after determining the entity and attribute, slot filling of the user question can also be performed, such as supplementing information "user age 18" and "user's city Chengdu".
[0077] Then use the preset knowledge graph to perform node matching on "credit card", "low interest rate", "user age" and "user's city". For example, the preset knowledge graph includes nodes "Peony Ultra-Preferential Series Credit Card", corresponding attributes: 25 years old, Chengdu, interest rate 2%; node "Peony Struggle Series Credit Card", corresponding attributes: 35 years old, Beijing, interest rate 3%; "Peony Panda Credit Card", corresponding attributes: 65 years old, Shanghai, interest rate 3%, etc.
[0078] Further, match the identified entity "credit card" with the nodes in the knowledge graph to determine that the node corresponding to the entity "credit card" and the corresponding attributes are "interest rate" and "user's city".
[0079] Further, the trained intent classification model (such as a BERT-based classifier) can be used to classify the user's question, and finally determine that the intent feature of the user's question is "low credit card interest rate and in line with the city of residence".
[0080] Through the embodiments of the present disclosure, intent classification and reasoning are performed based on the information in the knowledge graph, which not only improves the ability to understand the user's needs but also enhances the effectiveness of providing target answers.
[0081] In operation S240, fuse the first similarity feature, the second similarity feature, and the intent feature and perform prompt engineering processing to obtain a prompt word feature corresponding to the user's question.
[0082] In operation S250, input the prompt word feature into the pre-trained large model to obtain the target answer corresponding to the user's question.
[0083] In the embodiments of the present disclosure, fusing the first similarity feature, the second similarity feature, and the intent feature and performing prompt engineering processing to obtain a prompt word feature corresponding to the user's question includes: combining the first similarity feature, the second similarity feature, and the intent feature to construct a comprehensive feature vector; based on the comprehensive feature vector, using natural language processing technology to generate a prompt word feature; screening the prompt word feature and retaining the prompt word feature higher than the preset correlation threshold.
[0084] Exemplarily, combine the above first similarity feature, second similarity feature, and intent feature to generate a prompt word. For example, "ICBC Love Car Series Credit Cards offer up to 20% cashback on weekends in over 50,000 cities across the country; Peony Ultra-Privilege Series Credit Cards enjoy three major installment offers, apply now, with a 40% discount on interest rate; Peony Struggle Series Credit Cards, apply now, with a 50% discount on interest rate". Then input the generated prompt word into the pre-trained large model. For the user's question "Do you have any recommendations for a credit card with a favorable interest rate?", the accurate target answer "The Peony Struggle Series Credit Card is suitable for you" is output.
[0085] Through the embodiments of the present disclosure, by fusing different features to generate targeted prompt words and using the pre-trained large model to output accurate answers, the hallucination problem of the large model is reduced, and the relevance and accuracy of the question and answer are improved. In addition, when performing knowledge graph recall in the embodiments of the present disclosure, more products that are more in line with the actual situation of the user are further screened through slot filling processing, making the final answer result of the large model more accurate.
[0086] Based on the above knowledge answering method, the present disclosure also provides a knowledge answering device. The following will be combined with Figure 6 to describe this device in detail.
[0087] Figure 6 The structural block diagram of the knowledge answering device according to an embodiment of the present disclosure is schematically shown.
[0088] As Figure 6 shown, the knowledge answering device 600 of this embodiment includes a user question acquisition module 610, a similar feature acquisition module 620, an intention feature determination module 630, a prompt word feature acquisition module 640, and a target answer determination module 650.
[0089] The user question acquisition module 610 is used to acquire the user question and extract the keyword and semantic information of the user question respectively. In one embodiment, the user question acquisition module 610 can be used to perform the operation S210 described above, which will not be elaborated here.
[0090] The similar feature acquisition module 620 is used to perform text recall processing on the keyword and semantic recall processing on the semantic information based on a preset knowledge base, and obtain the first similar feature and the second similar feature of the user question respectively. In one embodiment, the similar feature acquisition module 620 can be used to perform the operation S220 described above, which will not be elaborated here.
[0091] The intention feature determination module 630 determines the intention feature of the user question based on the preset knowledge graph according to the entity and attribute of the user question. In one embodiment, the intention feature determination module 630 can be used to perform the operation S230 described above, which will not be elaborated here.
[0092] The prompt word feature acquisition module 640 is used to fuse the first similar feature, the second similar feature and the intention feature and perform prompt word engineering processing to obtain the prompt word feature corresponding to the user question. In one embodiment, the prompt word feature acquisition module 640 can be used to perform the operation S240 described above, which will not be elaborated here.
[0093] The target answer determination module 650 is used to input the prompt word feature into a pre-trained large model to obtain the target answer corresponding to the user question. In one embodiment, the target answer determination module 650 can be used to perform the operation S250 described above, which will not be elaborated here.
[0094] In the embodiment of the present disclosure, the knowledge answering device 600 further includes a retrieval module, which is used to retrieve and determine that the target answer corresponding to the user question cannot be obtained based on preset rules and FAQ classification before respectively extracting the keyword and semantic information of the user question.
[0095] In an embodiment of the present disclosure, the similar feature acquisition module 620 includes a first similar feature acquisition unit and a second similar feature acquisition unit.
[0096] The first similar feature acquisition unit is configured to perform vectorization processing on the keyword and the knowledge base respectively, and calculate the similarity between the vector feature of the keyword and multiple knowledge base entries; according to the similarity result and a preset similarity threshold, select a first knowledge base entry similar to the keyword, and the first knowledge base entry includes the first similar feature of the user question.
[0097] The second similar feature acquisition unit is configured to extract features from the semantic information by using natural language processing technology to obtain the vector feature of the semantic information; calculate the similarity between the vector feature of the semantic information and multiple knowledge base entries; based on a clustering algorithm, determine a second knowledge base entry similar to the semantic information of the user question, and the second knowledge base entry includes the second similar feature of the user question.
[0098] In an embodiment of the present disclosure, the intent feature determination module 630 includes an entity and attribute confirmation unit, a corresponding entity attribute determination unit, an intent classification unit, and an intent feature confirmation unit.
[0099] The entity and attribute confirmation unit is configured to use natural language processing technology to determine the entity and attributes of the user question. In one embodiment, the entity and attribute confirmation unit can be used to perform the operation S510 described above, which will not be elaborated here.
[0100] The corresponding entity attribute determination unit is configured to match the entity and attributes of the user question with the nodes in a preset knowledge graph respectively to determine the attributes corresponding to the entity. In one embodiment, the corresponding entity attribute determination unit can be used to perform the operation S520 described above, which will not be elaborated here.
[0101] The intent classification unit is configured to classify the user question according to the entity and its corresponding attributes. In one embodiment, the intent classification unit can be used to perform the operation S530 described above, which will not be elaborated here.
[0102] The intent feature confirmation unit is configured to determine the intent feature of the user question based on the result of the intent classification and the relationship reasoning function in the knowledge graph, according to the entity of the user question and the attributes corresponding to the entity. In one embodiment, the intent feature confirmation unit can be used to perform the operation S540 described above, which will not be elaborated here.
[0103] According to an embodiment of the present disclosure, any one or more of the user question acquisition module 610, the similar feature acquisition module 620, the intent feature determination module 630, the prompt word feature acquisition module 640, and the target answer determination module 650 may be combined and implemented in one module, or any one of them may be split into multiple modules. Alternatively, at least part of the functions of one or more of these modules may be combined with at least part of the functions of other modules and implemented in one module. According to an embodiment of the present disclosure, at least one of the user question acquisition module 610, the similar feature acquisition module 620, the intent feature determination module 630, the prompt word feature acquisition module 640, and the target answer determination module 650 may be at least partially implemented as a hardware circuit, such as a field programmable gate array (FPGA), a programmable logic array (PLA), a system on chip, a system on substrate, a system on package, an application specific integrated circuit (ASIC), or any other reasonable way of integrating or packaging circuits, etc., in hardware or firmware, or implemented in any one of the three implementation manners of software, hardware, and firmware, or in any appropriate combination of several of them. Alternatively, at least one of the user question acquisition module 610, the similar feature acquisition module 620, the intent feature determination module 630, the prompt word feature acquisition module 640, and the target answer determination module 650 may be at least partially implemented as a computer program module, which can execute corresponding functions when the computer program module is run.
[0104] Figure 7 FIG. schematically shows a block diagram of an electronic device suitable for implementing the knowledge answering method according to an embodiment of the present disclosure.
[0105] As Figure 7 shown, the electronic device 700 according to an embodiment of the present disclosure includes a processor 701, which can perform various appropriate actions and processes according to the program stored in the read only memory (ROM) 702 or the program loaded from the storage section 708 into the random access memory (RAM) 703. The processor 701 may include, for example, a general microprocessor (such as a CPU), an instruction set processor, and / or a related chipset, and / or a dedicated microprocessor (such as an application specific integrated circuit (ASIC)), etc. The processor 701 may also include on-board memory for caching purposes. The processor 701 may include a single processing unit or multiple processing units for performing different actions of the method flow according to an embodiment of the present disclosure.
[0106] In the RAM 703, various programs and data required for the operation of the electronic device 700 are stored. The processor 701, the ROM 702, and the RAM 703 are connected to each other via a bus 704. The processor 701 performs various operations of the method flow according to the embodiments of the present disclosure by executing the programs in the ROM 702 and / or the RAM 703. It should be noted that the programs can also be stored in one or more memories other than the ROM 702 and the RAM 703. The processor 701 can also perform various operations of the method flow according to the embodiments of the present disclosure by executing the programs stored in one or more memories.
[0107] According to an embodiment of the present disclosure, the electronic device 700 may further include an input / output (I / O) interface 705, and the input / output (I / O) interface 705 is also connected to the bus 704. The electronic device 700 may further include one or more of the following components connected to the input / output (I / O) interface 705: an input portion 706 including a keyboard, a mouse, etc.; an output portion 707 including, for example, a cathode ray tube (CRT), a liquid crystal display (LCD), etc. and a speaker, etc.; a storage portion 708 including a hard disk, etc.; and a communication portion 709 including a network interface card such as a LAN card, a modem, etc. The communication portion 709 performs communication processing via a network such as the Internet. A drive 710 is also connected to the input / output (I / O) interface 705 as needed. A removable medium 711, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 710 as needed so that a computer program read from it can be installed into the storage portion 708 as needed.
[0108] The present disclosure also provides a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiments; or may exist separately without being assembled into the device / apparatus / system. The above computer-readable storage medium carries one or more programs, and when the one or more programs are executed, the method according to the embodiments of the present disclosure is implemented.
[0109] According to an embodiment of the present disclosure, the computer-readable storage medium may be a non-volatile computer-readable storage medium, for example, it may include but is not limited to: portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the above. In the present disclosure, the computer-readable storage medium may be any tangible medium that contains or stores a program, and this program can be used by or in combination with an instruction execution system, apparatus, or device. For example, according to an embodiment of the present disclosure, the computer-readable storage medium may include one or more memories other than the ROM 702 and / or RAM 703 and / or ROM 702 and RAM 703 described above.
[0110] An embodiment of the present disclosure also includes a computer program product, which includes a computer program that contains program code for executing the method shown in the flowchart. When the computer program product runs in a computer system, the program code is used to enable the computer system to implement the knowledge answering method provided by the embodiment of the present disclosure.
[0111] When the computer program is executed by the processor 701, it executes the above functions defined in the system / apparatus of the embodiment of the present disclosure. According to an embodiment of the present disclosure, the above-described system, apparatus, module, unit, etc. can be implemented by computer program modules.
[0112] In one embodiment, the computer program can rely on tangible storage media such as optical storage devices and magnetic storage devices. In another embodiment, the computer program can also be transmitted and distributed in the form of a signal on a network medium, and is downloaded and installed through the communication part 709, and / or installed from the removable medium 711. The program code contained in the computer program can be transmitted by any suitable network medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.
[0113] In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 709, and / or installed from the removable medium 711. When the computer program is executed by the processor 701, it executes the above functions defined in the system of the embodiment of the present disclosure. According to an embodiment of the present disclosure, the above-described system, device, apparatus, module, unit, etc. can be implemented by computer program modules.
[0114] According to embodiments of the present disclosure, program code for executing the computer programs provided by the embodiments of the present disclosure can be written in any combination of one or more programming languages. Specifically, these computing programs can be implemented using high-level procedural and / or object-oriented programming languages, and / or assembly / machine languages. Programming languages include, but are not limited to, such as Java, C++, Python, the "C" language, or similar programming languages. The program code can be executed entirely on the user's computing device, partially on the user's device, partially on a remote computing device, or entirely on a remote computing device or server. In cases involving a remote computing device, the remote computing device can be connected to the user's computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computing device (e.g., by using an Internet service provider to connect through the Internet).
[0115] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architectures, functions, and operations of systems, methods, and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagram may represent a module, a program segment, or a part of code, and the above-mentioned module, program segment, or part of code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order from that marked in the accompanying drawings. For example, two consecutive blocks shown may actually be executed substantially in parallel, and they may sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in the block diagram or flowchart, and the combination of blocks in the block diagram or flowchart, can be implemented by a dedicated hardware-based system for performing the specified functions or operations, or can be implemented by a combination of dedicated hardware and computer instructions.
[0116] Those skilled in the art can understand that the features described in the various embodiments of the present disclosure can be combined and / or combined in various ways, even if such combinations or combinations are not explicitly described in the present disclosure. In particular, without departing from the spirit and teachings of the present disclosure, the features described in the various embodiments of the present disclosure can be combined and / or combined in various ways. All such combinations and / or combinations fall within the scope of the present disclosure.
[0117] The above describes the embodiments of the present disclosure. However, these embodiments are only for illustrative purposes and not for limiting the scope of the present disclosure. Although the embodiments are described separately above, this does not mean that the measures in the various embodiments cannot be used advantageously in combination. Without departing from the scope of the present disclosure, those skilled in the art can make various substitutions and modifications, and all such substitutions and modifications should fall within the scope of the present disclosure.
Claims
1. A knowledge answering method, characterized in that: The method comprises: Obtain user questions, and extract keywords and semantic information of the user questions respectively; Based on a preset knowledge base, performing text recall processing on the keywords and performing semantic recall processing on the semantic information, respectively obtaining a first similarity feature and a second similarity feature of the user question; Based on the preset knowledge graph, determine the intention characteristics of the user question according to the entities and attributes of the user question; The first similarity feature, the second similarity feature and the intention feature are integrated and processed by prompt word engineering to obtain a prompt word feature corresponding to the user question; The prompt word features are input into a pre-trained large model to obtain the target answer corresponding to the user question.
2. The knowledge response method according to claim 1, characterized in that: Before respectively extracting the keywords and semantic information of the user question, the method further includes: Before respectively extracting the keywords and semantic information of the user question, based on preset rules and FAQ classification, it is retrieved and determined that the target answer corresponding to the user question is not available.
3. The knowledge response method according to claim 1 or 2, characterized in that: Based on the preset knowledge base, the keyword is subjected to text recall processing to obtain the first similarity feature of the user question, including: Vectorizing the keywords and the knowledge base respectively, and calculating the similarity between the vector features of the keywords and multiple knowledge base entries; According to the similarity result and a preset similarity threshold, a first knowledge base entry similar to the keyword is selected, where the first knowledge base entry includes a first similar feature of the user question.
4. The knowledge answering method according to claim 3, characterized in that: Based on a preset knowledge base, semantic recall processing is performed on the semantic information to obtain a second similar feature of the user question, including: Using natural language processing technology to extract features of the semantic information to obtain vector features of the semantic information; Calculate similarity between the vector features of the semantic information and the multiple knowledge base entries; Based on a clustering algorithm, a second knowledge base entry that is close to the semantic information of the user question is determined, where the second knowledge base entry includes a second similar feature of the user question.
5. The knowledge response method according to claim 1 or 4, characterized in that: The determining of the intention features of the user question based on the preset knowledge graph and according to the entities and attributes of the user question includes: Using natural language processing technology, determine the entity and attributes of the user question; Match the entity and attribute of the user question with the nodes in the preset knowledge graph respectively to determine the attribute corresponding to the entity; According to entities and their corresponding attributes, the user questions are classified into intent categories; Based on the results of intent classification and the relational reasoning function in the knowledge graph, the intent characteristics of the user question are determined according to the entities of the user question and the attributes corresponding to the entities.
6. The knowledge answering method according to claim 1 or 4, characterized in that: The fusing of the first similarity feature, the second similarity feature and the intention feature and performing prompt word engineering processing to obtain a prompt word feature corresponding to the user question includes: Combining the first similarity feature, the second similarity feature and the intention feature to construct a comprehensive feature vector; Based on the comprehensive feature vector, using natural language processing technology to generate prompt word features; The prompt word features are screened, and prompt word features that are higher than a preset relevance threshold are retained.
7. A knowledge response device, characterized in that: The device comprises: A user question acquisition module, used to acquire user questions and extract keywords and semantic information of the user questions; A similarity feature acquisition module, used to perform text recall processing on the keywords and semantic recall processing on the semantic information based on a preset knowledge base, to obtain a first similarity feature and a second similarity feature of the user question respectively; An intention feature determination module, based on a preset knowledge graph, determines the intention feature of the user question according to the entity and attribute of the user question; A prompt word feature acquisition module, used to fuse the first similarity feature, the second similarity feature and the intention feature and perform prompt word engineering processing to obtain a prompt word feature corresponding to the user question; The target answer determination module is used to input the prompt word features into a pre-trained large model to obtain the target answer corresponding to the user question.
8. The knowledge response device according to claim 7, characterized in that: The device also includes: The retrieval module is used to retrieve and determine that a target answer corresponding to the user question is not available based on preset rules and FAQ classification before respectively extracting the keywords and semantic information of the user question.
9. An electronic device, comprising: one or more processors; a memory for storing one or more computer programs, It is characterized in that the one or more processors execute the one or more computer programs to implement the steps of the method according to any one of claims 1 to 6.
10. A computer-readable storage medium having a computer program or instruction stored thereon, characterized in that: When the computer program or instruction is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
11. A computer program product comprising a computer program or instructions, characterized in that When the computer program or instruction is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
Citation Information
Cited By
Intelligent document question and answer method, device and equipment and storage medium
CN120706544A
Large screen content recall method and device, storage medium and program product
CN120849535A