Method and device for locating an answer based on question and answer
AssigneeBeijing Baidu Netcom Science Technology Co., Ltd.
InventorsXingwu Sun, Xingjian Li
Life of this patent
Estimating the term…
Abstract
The present disclosure discloses a method and a device for locating an answer based on question and answer, in which the method includes: receiving a query sentence; parsing the query sentence, to generate a semantic parse tree corresponding to the query sentence; matching the semantic parse tree with a pre-established matching base, to obtain an alignment probability between each of candidate answers in the pre-established matching base and the semantic parse tree; and determining a final answer according to the alignment probability.
Claims11
A method for locating an answer based on question and answer, comprising:
- receiving, by a processor of a search engine, a query sentence input by a user via a search box;
- parsing the query sentence by the processor, to generate a semantic parse tree corresponding to the query sentence;
- matching the semantic parse tree with a pre-established matching base by the processor, to obtain an alignment probability between each of candidate answers in the pre-established matching base and the semantic parse tree;
- determining a final answer to the query sentence by the processor according to the alignment probability;
- and
- displaying the final answer on a result page of the search engine;
- wherein the alignment probability between each of candidate answers in the pre-established matching base and the semantic parse tree comprises a word alignment probability, matching the semantic parse tree with a pre-established matching base by the processor to obtain an alignment probability between each of candidate answers in the pre-established matching base and the semantic parse tree comprises:
- obtaining by the processor an alignment probability of each part of speech in the semantic parse tree based on a positive probability and a reverse probability of the part of speech and a preset weight for the part of speech;
- and obtaining by the processor the word alignment probability according to the alignment probability of each part of speech in the semantic parse tree;
- wherein the alignment probability between each of candidate answers in the pre-established matching base and the semantic parse tree comprises a phrase alignment probability;
- and
- wherein matching the semantic parse tree with a pre-established matching base by the processor to obtain an alignment probability between each of candidate answers in the pre-established matching base and the semantic parse tree comprises:
- calculating by the processor a product of an alignment probability of each of successfully matching phrases and a number of words in the respective successfully matching phrase, to obtain a positive probability and a reverse probability of each of the successfully matching phrases, wherein the successfully matching phrases are phrases that are successfully matched between candidate answers in the pre-established matching base and the semantic parsing tree;
- and
- obtaining by the processor a maximum value from the positive probability and the reverse probability of each of the successfully matching phrases, and performing a weighted summation on obtained maximum values to obtain the phrase alignment probability.
A device for locating an answer based on question and answer, comprising:
- one or more processors of a search engine;
- a memory storing instructions executable by the one or more processors;
- wherein the one or more processors are configured to:
- receive a query sentence;
- parse the query sentence, to generate a semantic parse tree corresponding to the query sentence;
- match the semantic parse tree with a pre-established matching base, to obtain an alignment probability between each of candidate answers in the pre-established matching base and the semantic parse tree;
- determine a final answer according to the alignment probability;
- and
- display the final answer on a result page of the search engine;
- wherein the alignment probability between each of candidate answers in the pre-established matching base and the semantic parse tree comprises a word alignment probability, matching the semantic parse tree with a pre-established matching base by the processor to obtain an alignment probability between each of candidate answers in the pre-established matching base and the semantic parse tree comprises:
- obtaining by the processor an alignment probability of each part of speech in the semantic parse tree based on a positive probability and a reverse probability of the part of speech and a preset weight for the part of speech;
- and obtaining by the processor the word alignment probability according to the alignment probability of each part of speech in the semantic parse tree;
- wherein the alignment probability between each of candidate answers in the pre-established matching base and the semantic parse tree comprises a phrase alignment probability;
- and
- wherein the one or more processors are configured to match the semantic parse tree with a pre-established matching base, to obtain an alignment probability between each of candidate answers in the pre-established matching base and the semantic parse tree by the acts of:
- calculating a product of an alignment probability of each of successfully matching phrases and a number of words in the respective successfully matching phrase, to obtain a positive probability and a reverse probability of each of the successfully matching phrases, wherein the successfully matching phrases are phrases that are successfully matched between candidate answers in the pre-established matching base and the semantic parsing tree;
- and
- obtaining a maximum value from the positive probability and the reverse probability of each of the successfully matching phrases, and performing a weighted summation on obtained maximum values to obtain the phrase alignment probability.
A non-transitory computer-readable storage medium having stored therein instructions that, when executed by a processor of a search engine, cause the processor to perform a method for locating an answer based on question and answer, the method comprising:
- receiving a query sentence;
- parsing the query sentence, to generate a semantic parse tree corresponding to the query sentence;
- matching the semantic parse tree with a pre-established matching base, to obtain an alignment probability between each of candidate answers in the pre-established matching base and the semantic parse tree;
- determining a final answer according to the alignment probability;
- and
- displaying the final answer on a result page of the search engine;
- wherein the alignment probability between each of candidate answers in the pre-established matching base and the semantic parse tree comprises a word alignment probability, matching the semantic parse tree with a pre-established matching base by the processor to obtain an alignment probability between each of candidate answers in the pre-established matching base and the semantic parse tree comprises:
- obtaining by the processor an alignment probability of each part of speech in the semantic parse tree based on a positive probability and a reverse probability of the part of speech and a preset weight for the part of speech;
- and obtaining by the processor the word alignment probability according to the alignment probability of each part of speech in the semantic parse tree;
- wherein the alignment probability between each of candidate answers in the pre-established matching base and the semantic parse tree comprises a phrase alignment probability;
- and
- wherein matching the semantic parse tree with a pre-established matching base by the processor to obtain an alignment probability between each of candidate answers in the pre-established matching base and the semantic parse tree comprises:
- calculating by the processor a product of an alignment probability of each of successfully matching phrases and a number of words in the respective successfully matching phrase, to obtain a positive probability and a reverse probability of each of the successfully matching phrases, wherein the successfully matching phrases are phrases that are successfully matched between candidate answers in the pre-established matching base and the semantic parsing tree;
- and
- obtaining by the processor a maximum value from the positive probability and the reverse probability of each of the successfully matching phrases, and performing a weighted summation on obtained maximum values to obtain the phrase alignment probability.
Dependencies are inferred from the claim text.