CN-114297351-B - Sentence question-answering method, sentence question-answering device, sentence question-answering equipment storage medium and sentence question-answering computer program product
Abstract
The application discloses a sentence question-answering method, a sentence question-answering device, sentence question-answering equipment, sentence question-answering storage medium and sentence question-answering computer program products, and relates to the technical field of artificial intelligence. The method comprises the steps of obtaining a target question sentence, matching the target question sentence with a keyword matching tree to obtain first node attributes of candidate keywords corresponding to the target question sentence in the keyword matching tree, determining second node attributes of the candidate keywords corresponding to the designated logic nodes based on the first node attributes, and determining a result corresponding to a target attribute requirement in the keyword matching tree based on the second node attributes as a response result. The target question sentence is matched with the keyword matching tree, the node attribute of each node in the keyword matching tree is determined, so that a response result corresponding to the target question sentence is obtained, the matching accuracy of the corresponding candidate keywords in the target question sentence is improved, the matching efficiency is improved, and the matching speed can be increased by determining the response result based on the node attribute.
Inventors
- HUANG YU
- ZHAO RUIHUI
- LIU YAFEI
- Wang Shuojia
- YE BIRONG
- ZHENG JIANGUANG
Assignees
- 腾讯科技(深圳)有限公司
Dates
- Publication Date
- 20260505
- Application Date
- 20211015
Claims (11)
- 1. A method for question answering of sentences, the method comprising: acquiring a target question sentence; Matching the target question sentence with a keyword matching tree to obtain a first node attribute corresponding to a candidate keyword in the keyword matching tree and the target question sentence, wherein the first node attribute is used for indicating a matching relationship between the target question sentence and the candidate keyword; determining a second node attribute corresponding to a specified logical node of the candidate keyword in the keyword matching tree based on the first node attribute, wherein the second node attribute is used for indicating a combined logical relationship of the candidate keyword at the specified logical node, and determining the second node attribute corresponding to the candidate keyword of the specified logical node by using a AND or NON logical relationship; And determining a response result corresponding to the target question sentence based on the second node attribute, wherein the response result is a result corresponding to the target attribute requirement in the keyword matching tree, and the response result is an answer corresponding to the question after determining that the question corresponding to the combination logic relationship is met in the question set based on the second node attribute.
- 2. The method of claim 1, wherein determining, based on the first node attribute, a second node attribute of the keyword matching tree for the candidate keyword corresponding to a specified logical node comprises: Acquiring a logic relationship of a designated logic node corresponding to the candidate keyword in the keyword matching tree; Determining a logic matching result of the designated logic node based on the first node attribute; and taking the logic matching result of the designated logic node as the second node attribute.
- 3. The method of claim 2, wherein the determining a logical match result for the specified logical node based on the first node attribute comprises: matching the first node attribute with a preset logic relationship of the designated logic node; Determining that a logical matching result of the designated logical node is a matching relationship in response to the first node attribute conforming to a preset logical relationship of the designated logical node; And determining that the logic matching result of the designated logic node is a mismatch relation in response to the first node attribute not conforming to the preset logic relation of the designated logic node.
- 4. The method of claim 2, wherein the step of determining the position of the substrate comprises, The logical relationship of the specified logical node includes any one of a logical relationship, or a logical relationship and a non-logical relationship.
- 5. The method according to any one of claims 1 to 4, wherein the matching the target question sentence with a keyword matching tree to obtain a first node attribute of a candidate keyword in the keyword matching tree corresponding to the target question sentence includes: Inputting characters in the target question sentence into a character matching model, wherein the character matching model comprises the keyword matching tree; Matching the character with the candidate keywords in the keyword matching tree through the character matching model, and determining a matching result of the target question sentence and the candidate keywords; And determining the first node attribute corresponding to the candidate keyword based on the matching result.
- 6. The method according to any one of claims 1 to 4, wherein determining, based on the second node attribute, a response result corresponding to the target question sentence includes: determining a result corresponding to the target attribute requirement as the response result in response to the second node attribute meeting the target attribute requirement; and responding to the second node attribute not meeting the target attribute requirement, and performing response analysis on the target question sentence through a classification model to obtain the response result.
- 7. The method of claim 6, wherein the performing, by the classification model, the answer analysis on the target question sentence to obtain the answer result includes: Carrying out weight analysis on the characters in the target question sentence through a classification model to obtain a weight analysis result; And determining the response result corresponding to the target question sentence based on the weight analysis result.
- 8. A sentence question-answering apparatus, the apparatus comprising: the acquisition module is used for acquiring the target question statement; The matching module is used for matching the target question sentence with a keyword matching tree to obtain a first node attribute corresponding to the candidate keyword in the keyword matching tree and the target question sentence, wherein the first node attribute is used for indicating the matching relation between the target question sentence and the candidate keyword; A determining module, configured to determine, based on the first node attribute, a second node attribute corresponding to a specified logical node, where the second node attribute is used to indicate a combined logical relationship of the candidate keyword at the logical node, where the second node attribute corresponding to the candidate keyword is determined by using a non-logical relationship with the specified logical node; The determining module is further configured to determine a response result corresponding to the target question sentence based on the second node attribute, where the response result is a result corresponding to the target attribute requirement in the keyword matching tree, and the response result is an answer corresponding to the question after determining that the question corresponding to the combination logic relationship is satisfied in the question set based on the second node attribute.
- 9. A computer device comprising a processor and a memory, wherein the memory has stored therein at least one program that is loaded and executed by the processor to implement the sentence question-answering method according to any one of claims 1 to 7.
- 10. A computer-readable storage medium, wherein at least one program is stored in the storage medium, and the at least one program is loaded and executed by a processor to implement the sentence question-answering method according to any one of claims 1 to 7.
- 11. A computer program product comprising a computer program or instructions which when executed by a processor implements the sentence question-answering method according to any one of claims 1 to 7.
Description
Sentence question-answering method, sentence question-answering device, sentence question-answering equipment storage medium and sentence question-answering computer program product Technical Field The embodiment of the application relates to the technical field of artificial intelligence, in particular to a statement question-answering method, a device, equipment, a storage medium and a computer program product. Background Intelligent questions and answers are a common form of man-machine interaction and are widely used in various fields, such as medical fields. In the intelligent question-answering process, the user sends a question to the intelligent question-answering robot, and the intelligent question-answering robot searches matched answers according to the user question and feeds the answers back to the user, so that intelligent dialogue is realized in the question and the answer. In the intelligent question-answering process, questions initiated by users may have various forms, but the corresponding answers are the same, namely, one answer has a plurality of similar question sets, the intelligent question-answering robot needs to judge the similarity of the questions, and correct answers corresponding to the similar questions are determined from an intelligent question-answering library. However, because of the limited set of similar questions in the intelligent question and answer library, some questions initiated by the user are not included in the intelligent question and answer library, and the accuracy of the intelligent question and answer is low, resulting in lower accuracy of answers obtained by the user. Disclosure of Invention The embodiment of the application provides a statement question-answering method, a device, equipment, a storage medium and a computer program product, which can improve the accuracy of obtaining a response result corresponding to a target question statement. The technical scheme is as follows: In one aspect, a sentence question-answering method is provided, the method includes: acquiring a target question sentence; Matching the target question sentence with a keyword matching tree to obtain a first node attribute corresponding to a candidate keyword in the keyword matching tree and the target question sentence, wherein the first node attribute is used for indicating a matching relationship between the target question sentence and the candidate keyword; determining a second node attribute corresponding to the candidate keyword and a designated logic node in the keyword matching tree based on the first node attribute, wherein the second node attribute is used for indicating a combination logic relationship of the candidate keyword at the logic node; and determining a response result corresponding to the target question sentence based on the second node attribute, wherein the response result is a result corresponding to the target attribute requirement in the keyword matching tree. In another aspect, a sentence question-answering apparatus is provided, the apparatus including: the acquisition module is used for acquiring the target question statement; The matching module is used for matching the target question sentence with a keyword matching tree to obtain a first node attribute corresponding to the candidate keyword in the keyword matching tree and the target question sentence, wherein the first node attribute is used for indicating the matching relation between the target question sentence and the candidate keyword; a determining module, configured to determine, based on the first node attribute, a second node attribute corresponding to a specified logical node, where the second node attribute is used to indicate a combined logical relationship of the candidate keyword at the logical node, where the second node attribute corresponds to the candidate keyword in the keyword matching tree; The determining module is further configured to determine a response result corresponding to the target question statement based on the second node attribute, where the response result is a result corresponding to the target attribute requirement in the keyword matching tree. In another aspect, a computer device is provided, where the computer device includes a processor and a memory, where the memory stores at least one instruction, at least one program, a set of codes, or a set of instructions, where the at least one instruction, the at least one program, the set of codes, or the set of instructions are loaded and executed by the processor to implement a statement question-answering method according to any one of the embodiments of the present application. In another aspect, a computer readable storage medium is provided, where at least one instruction, at least one program, a set of codes, or a set of instructions is stored, where the at least one instruction, the at least one program, the set of codes, or the set of instructions are loaded and executed by a processor to impleme