IP Library Granted Patent US 10,719,662
Granted Patent B2
US 10,719,662 · App. 16/034,607 · Granted Jul 21, 2020

Knowledge map-based question-answer method, device, and storage medium

Inventors: Canhui Ge (Guangzhou, CN); Xiaoxi Jiang (Guangzhou, CN); Hangcheng Zhu (Guangzhou, CN); Nengwei Hua (Guangzhou, CN); Feng Yang (Guangzhou, CN)
Assignee: ALIBABA GROUP HOLDING LIMITED
G06F40/30G06F16/3329G06F16/3344G06F40/211G06F40/295
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 10,719,662
App. No.
16/034,607
Granted
Jul 21, 2020
Kind
B2
Abstract

Knowledge map-based question-answer method, server, and storage medium are provided. The method includes obtaining a natural query sentence inputted by a user, and identifying a globally unique identifier, with respect to the knowledge map, of an entity in the natural query sentence. The knowledge map includes attributes and attribute values of entities and relationships thereof. The method also includes according to a context-free grammar rule, parsing the natural query sentence into a syntax tree, and according to the syntax tree, obtaining a logical expression corresponding to the natural query sentence. Moreover, the method includes according to the logical expression and the globally unique identifier of the entity, generating a machine query sentence corresponding to the knowledge map. Further, the method includes according to the machine query sentence, querying a question-answer result corresponding to the machine query sentence in the knowledge map, and feeding back the question-answer result to the user.

Claims (80)

1. A knowledge map-based question-answer method, comprising:

obtaining a natural query sentence inputted by a user, and identifying a globally unique identifier, with respect to the knowledge map, of an entity in the natural query sentence, wherein the knowledge map includes attributes and attribute values of entities and relationships between the entities;

according to a context-free grammar rule, parsing the natural query sentence into a syntax tree, and according to the syntax tree, obtaining a logical expression corresponding to the natural query sentence;

according to the logical expression and the globally unique identifier of the entity, generating a machine query sentence corresponding to the knowledge map; and

according to the machine query sentence, querying a question-answer result corresponding to the machine query sentence in the knowledge map, and feeding back the question-answer result to the user,

wherein:

when the natural query sentence includes an iterative question-answer, the logical expression includes an inner-layer expression and an outer-layer expression, and

querying the question-answer result includes:

according to the inner-layer expression and a globally unique identifier of an entity involved in the inner-layer expression, generating a first machine query sentence corresponding to the knowledge map;

according to the first machine query sentence, querying a first question-answer result corresponding to the first machine query sentence in the knowledge map;

according to the first question-answer result or a globally unique identifier of an entity involved in the outer-layer expression and the outer-layer expression, generating a second machine query sentence corresponding to the knowledge map; and

according to the second machine query sentence, querying a second query result corresponding to the second machine query sentence in the knowledge map, and feeding back the second query result to the user.

2. The method according to claim 1 , wherein according to the context-free grammar rule, parsing the natural query sentence into the syntax tree, and according to the syntax tree, obtaining the logical expression corresponding to the natural query sentence include:

according to the context-free grammar rule, parsing the natural query sentence from bottom to up into the syntax tree; and

using a logical expression corresponding to a root node of the syntax tree as the logical expression corresponding to the natural query sentence.

3. The method according to claim 2 , wherein according to the context-free grammar rule, parsing the natural query sentence from bottom to up into the syntax tree includes:

obtaining a plurality of terminal symbols corresponding to the natural query sentence;

according to the context-free grammar rule corresponding to the terminal symbols, obtaining a parent node, wherein the parent node includes a non-terminal symbol and an intermediate logical expression, the context-free grammar rule includes a semantic function, and the intermediate logical expression is determined according to the semantic function; and

according to the context-free grammar rule corresponding to at least one non-terminal symbol in the parent node and the intermediate logical expression in each parent node, obtaining the parent node from bottom to up, and repeating the above process of obtaining the parent node until the root node is obtained.

4. The method according to claim 3 , when at least a part of the context-free grammar rule includes type information of the entity, and the corresponding intermediate logical expression includes the type information of the entity, the method further including:

identifying the type information of the entity in the natural query sentence.

5. The method according to claim 4 , wherein according to the context-free grammar rule corresponding to at least one non-terminal symbol in the parent node, and according to the intermediate logical expression in each parent node, obtaining the parent node from bottom to up includes:

when the intermediate logical expression in the parent node is used to express the entity, obtaining the type information of the identified entity;

when the intermediate logical expression in the parent node is used to express an attribute, obtaining the type information of the entity in the intermediate logical expression; and

determining whether the identified type information is consistent with the type information of the entity in the intermediate logical expression, and if yes, according to the context-free grammar rule, which corresponds to a non-terminal symbol corresponding to the entity and a non-terminal symbol corresponding to the attribute, and according to the intermediate logical expression in each parent node, obtaining the parent node from bottom to up.

6. The method according to claim 1 , wherein:

the question-answer result includes one of text information, single entity name, multiple entity names, comparison result, bifurcation information, and multiple lists.

7. A server, comprising:

a memory, storing program instructions for a knowledge map-based question-answer method; and

a processor, coupled to the memory and, when executing the program instructions, configured to:

obtain a natural query sentence inputted by a user, and identify a globally unique identifier, with respect to the knowledge map, of an entity in the natural query sentence,

wherein the knowledge map includes attributes and attribute values of entities and relationships between the entities;

according to a context-free grammar rule, parse the natural query sentence into a syntax tree, and according to the syntax tree, obtain a logical expression corresponding to the natural query sentence;

according to the logical expression and the globally unique identifier of the entity, generate a machine query sentence corresponding to the knowledge map, and according to the machine query sentence, query a question-answer result corresponding to the machine query sentence in the knowledge map, and feed back the question-answer result to the user wherein:

when the natural query sentence includes an iterative question-answer, the logical expression includes an inner-layer expression and an outer-layer expression, and

the question-answer result is queried by the processor configured to:

according to the inner-layer expression and a globally unique identifier of an entity involved in the inner-layer expression, generate a first machine query sentence corresponding to the knowledge map;

according to the first machine query sentence, query a first question-answer result corresponding to the first machine query sentence in the knowledge map;

according to the first question-answer result or a globally unique identifier of an entity involved in the outer-layer expression and the outer-layer expression, generate a second machine query sentence corresponding to the knowledge map; and

according to the second machine query sentence, query a second query result corresponding to the second machine query sentence in the knowledge map, and feed back the second query result to the user.

8. The server according to claim 7 , wherein the processor is further configured to:

according to the context-free grammar rule, parse the natural query sentence from bottom to up into the syntax tree; and

use a logical expression corresponding to a root node of the syntax tree as the logical expression corresponding to the natural query sentence.

9. The server according to claim 8 , wherein the processor is further configured to:

obtain a plurality of terminal symbols corresponding to the natural query sentence;

according to the context-free grammar rule corresponding to the terminal symbols, obtain a parent node, wherein the parent node includes a non-terminal symbol and an intermediate logical expression, the context-free grammar rule includes a semantic function, and the intermediate logical expression is determined according to the semantic function; and

according to the context-free grammar rule corresponding to at least one non-terminal symbol in the parent node and the intermediate logical expression in each parent node, obtain the parent node from bottom to up, and repeat the above process of obtaining the parent node until the root node is obtained.

10. The server according to claim 9 , when at least a part of the context-free grammar rule includes type information of the entity, and the corresponding intermediate logical expression includes the type information of the entity, the processor is further configured to:

identify the type information of the entity in the natural query sentence.

11. The server according to claim 10 , wherein the processor is further configured to:

when the intermediate logical expression in the parent node is used to express the entity, obtain the type information of the identified entity;

when the intermediate logical expression in the parent node is used to express an attribute, obtain the type information of the entity in the intermediate logical expression; and

determine whether the identified type information is consistent with the type information of the entity in the intermediate logical expression, and if yes, according to the context-free grammar rule, which corresponds to a non-terminal symbol corresponding to the entity and a non-terminal symbol corresponding to the attribute, and according to the intermediate logical expression in each parent node, obtain the parent node from bottom to up.

12. The server according to claim 7 , wherein:

the question-answer result includes one of text information, single entity name, multiple entity names, comparison result, bifurcation information, and multiple lists.

13. A non-transitory computer-readable storage medium containing computer-executable program instructions for, when executed by a processor, performing a knowledge map-based question-answer method, the method comprising:

obtaining a natural query sentence inputted by a user, and identifying a globally unique identifier, with respect to the knowledge map, of an entity in the natural query sentence, wherein the knowledge map includes attributes and attribute values of entities and relationships between the entities,

according to a context-free grammar rule, parsing the natural query sentence into a syntax tree, and according to the syntax tree, obtaining a logical expression corresponding to the natural query sentence,

according to the logical expression and the globally unique identifier of the entity, generating a machine query sentence corresponding to the knowledge map, and

according to the machine query sentence, querying a question-answer result corresponding to the machine query sentence in the knowledge map, and feeding back the question-answer result to the user,

wherein:

when the natural query sentence includes an iterative question-answer, the logical expression includes an inner-layer expression and an outer-layer expression, and

querying the question-answer result includes:

according to the inner-layer expression and a globally unique identifier of an entity involved in the inner-layer expression, generating a first machine query sentence corresponding to the knowledge map;

according to the first machine query sentence, querying a first question-answer result corresponding to the first machine query sentence in the knowledge map;

according to the first question-answer result or a globally unique identifier of an entity involved in the outer-layer expression and the outer-layer expression, generating a second machine query sentence corresponding to the knowledge map; and

according to the second machine query sentence, querying a second query result corresponding to the second machine query sentence in the knowledge map, and feeding back the second query result to the user.

14. The storage medium according to claim 13 , wherein according to the context-free grammar rule, parsing the natural query sentence into the syntax tree, and according to the syntax tree, obtaining the logical expression corresponding to the natural query sentence include:

according to the context-free grammar rule, parsing the natural query sentence from bottom to up into the syntax tree; and

using a logical expression corresponding to a root node of the syntax tree as the logical expression corresponding to the natural query sentence.

15. The storage medium according to claim 14 , wherein according to the context-free grammar rule, parsing the natural query sentence from bottom to up into the syntax tree includes:

obtaining a plurality of terminal symbols corresponding to the natural query sentence;

according to the context-free grammar rule corresponding to the terminal symbols, obtaining a parent node, wherein the parent node includes a non-terminal symbol and an intermediate logical expression, the context-free grammar rule includes a semantic function, and the intermediate logical expression is determined according to the semantic function; and

according to the context-free grammar rule corresponding to at least one non-terminal symbol in the parent node and the intermediate logical expression in each parent node, obtaining the parent node from bottom to up, and repeating the above process of obtaining the parent node until the root node is obtained.

16. The storage medium according to claim 15 , when at least a part of the context-free grammar rule includes type information of the entity, and the corresponding intermediate logical expression includes the type information of the entity, the method further including:

identifying the type information of the entity in the natural query sentence.

17. The storage medium according to claim 16 , wherein according to the context-free grammar rule corresponding to at least one non-terminal symbol in the parent node, and according to the intermediate logical expression in each parent node, obtaining the parent node from bottom to up includes:

when the intermediate logical expression in the parent node is used to express the entity, obtaining the type information of the identified entity;

when the intermediate logical expression in the parent node is used to express an attribute, obtaining the type information of the entity in the intermediate logical expression; and

determining whether the identified type information is consistent with the type information of the entity in the intermediate logical expression, and if yes, according to the context-free grammar rule, which corresponds to a non-terminal symbol corresponding to the entity and a non-terminal symbol corresponding to the attribute, and according to the intermediate logical expression in each parent node, obtaining the parent node from bottom to up.

Assignments (2)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded May 14, 2020
From: GUANGZHOU SHENMA MOBILE INFORMATION TECHNOLOGY CO., LTD.
To: ALIBABA GROUP HOLDING LIMITED
Reel/Frame 052665/0384 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Jul 18, 2018
From: GE, CANHUI; JIANG, XIAOXI; ZHU, HANGCHENG; HUA, NENGWEI; YANG, FENG
To: GUANGZHOU SHENMA MOBILE INFORMATION TECHNOLOGY CO., LTD.
Reel/Frame 046389/0389 →
Priority Claims (1)
CN 2017 1 0594646 · Jul 14, 2017 · national
Continuity (1)
Related Publication 20190018839A1 · Jan 17, 2019