# US 2021/0280189 A1 · Method and apparatus for generating conversation, electronic device, and storage medium

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2021/0280189 A1
- Document ID: US20210280189A1
- Status: Published application
- Kind: A1
- Application number: 17/326,917
- Filed: 2021-05-21
- Published: 2021-09-09
- Earliest claimed: 2020-09-18
- Assignees: Beijing Baidu Netcom Science Technology Co., Ltd.
- Applicants: Beijing Baidu Netcom Science and Technology Co., Ltd.
- Inventors: Jun Xu; Zeyang Lei; Zhengyu Niu; Hua Wu; Haifeng Wang
- Web page: https://patentgrep.com/patent/US20210280189A1

## CPC

- G06F 16/3329: Natural language query formulation
- G10L 15/22: Procedures used during a speech recognition process, e.g. man-machine dialogue
- G06F 16/367: {Ontology}
- G10L 15/083: {Recognition networks (G10L15/142, G10L15/16 take precedence)}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)
- G10L: SPEECH ANALYSIS TECHNIQUES OR SPEECH SYNTHESIS; SPEECH RECOGNITION; SPEECH OR VOICE PROCESSING TECHNIQUES; SPEECH OR AUDIO CODING OR DECODING

## Abstract

A first expression corresponding to an input statement is obtained from a conversational graph. The conversational graph includes expressions having association relationships therebetween and conversation target clusters having association relationships therebetween. Each conversation target cluster includes at least two expressions. A second expression associated with the first expression is obtained from the conversational graph based on the association relationships of expressions and the association relationships of conversational target clusters in the conversational graph. A reply statement is generated based on the second expression and the input statement.

## Claims

### Claim 1

A method for generating a conversation, comprising:
obtaining an input statement;
obtaining a first expression corresponding to the input statement from a conversational graph, the conversational graph comprising expressions having association relationships therebetween and conversation target clusters having association relationships therebetween, and each conversation target cluster comprising at least two expressions;
obtaining a second expression associated with the first expression from the conversational graph based on the association relationships of expressions and the association relationships of conversational target clusters in the conversational graph; and
generating a reply statement based on the second expression and the input statement.

### Claim 2 (depends on 1)

The method of claim 1, wherein obtaining the second expression comprises:
obtaining first candidate expressions associated with the first expression from the conversational graph based on the association relationships of expressions in the conversational graph;
determining a second conversation target cluster based on an association relationship between a first conversation target cluster to which the first expression belongs and a respective candidate conversation target cluster to which each first candidate expression belongs; and
obtaining the second expression associated with the first expression from the second conversation target cluster.

### Claim 3 (depends on 2)

The method of claim 2, wherein the association relationships of expressions comprise directions of edges connecting the expressions and first weights of respective edges, and
wherein, obtaining the first candidate expressions comprises:
obtaining the first candidate expressions from the conversational graph based on the directions and the first weights, each first candidate expression corresponding to an edge pointing from the first expression to the first candidate expression, and the first weight of the edge being greater than a first threshold.

### Claim 4 (depends on 2)

The method of claim 2, wherein the association relationships of expressions comprise directions of edges connecting the expressions, and
wherein obtaining the first candidate expressions comprises:
obtaining the first candidate expression based on the directions and the number of edges, the direction of the edge between each first candidate expression and the first expression being from the first expression to the first candidate expression, and the number of edges corresponding to each first candidate expression being greater than a second threshold.

### Claim 5 (depends on 2)

The method of claim 2, wherein obtaining the first candidate expressions comprises:
obtaining second candidate expressions associated with the first expression from the conversational graph based on the association relationships of expressions; and
obtaining the first candidate expressions from the second candidate expressions based on the number of times of selecting each second candidate expression.

### Claim 6 (depends on 2)

The method of claim 2, wherein determining the second conversation target cluster comprises:
determining that the second conversation target cluster is the same as the first conversation target cluster based on a candidate conversation target cluster to which a first candidate expression belongs being the first conversation target cluster.

### Claim 7 (depends on 2)

The method of claim 2, wherein the association relationships of conversation target clusters comprise directions of edges connecting the conversation target clusters and second weights of respective edges, and
wherein determining the second conversation target cluster comprises:
obtaining the second conversation target cluster from the candidate conversation target clusters based on the direction of the edge connecting the first conversation target cluster and each candidate conversation target cluster and the second weight of the edge, the edge pointing from the first conversation target cluster to the second conversation target cluster, and the second weight of the edge being greater than a third threshold.

### Claim 8 (depends on 2)

The method of claim 2, wherein the association relationships of conversation target clusters comprise directions of edges connecting the conversation target clusters and second weights of respective edges, each conversation target cluster corresponding to a conversation target, and
wherein determining the second conversation target cluster comprises:
determining a to-be-guided conversation target by recognizing the input statement;
determining a third conversation target cluster based on a matching degree between the to-be-guided conversation target and each conversation target cluster in the conversational graph; and
obtaining the second conversation target cluster from the candidate conversation target clusters based on the direction of the edge between each candidate conversation target cluster and the third conversation target cluster and the second weight of the edge.

### Claim 9 (depends on 1)

The method of claim 1, wherein obtaining the first expression comprises:
obtaining word segmentations of the input statement by performing word segmentation processing on the input statement; and
determining the first expression from the conversational graph based on an association degree between each word segmentation and each expression contained in the conversational graph.

### Claim 10 (depends on 9)

The method of claim 9, wherein determining the first expression based on the association degree comprises:
obtaining third candidate expressions from the conversational graph based on the association degree; and
obtaining the first expression from the third candidate expressions based on a similarity degree between each third candidate expression and the input statement.

### Claim 11 (depends on 1)

The method of claim 1, further comprising:
obtaining a conversational data set, the conversational data set comprising groups of conversation;
extracting expressions from the conversational data set;
determining the association relationships between the expressions based on co-occurrence ways of every two expressions in a common group of conversation; and
determining the conversation target clusters and the association relationships of conversation target clusters by clustering the expressions based on the association relationships of expressions.

### Claim 12 (depends on 11)

The method of claim 11, wherein extracting the expressions comprises:
obtaining a syntax tree corresponding to each conversation contained in the conversational data set by parsing the conversation; and
extracting an expression corresponding to each conversation from a root node of the syntax tree corresponding to the conversation.

### Claim 13

An electronic device, comprising:
at least one processor; and
a memory, communicatively coupled to the at least one processor,
wherein the memory is configured to store instructions executable by the at least one processor, and when the instructions are executed by the at least one processor, the at least one processor is configured to:
obtain an input statement;
obtain a first expression corresponding to the input statement from a conversational graph, the conversational graph comprising expressions having association relationships therebetween and conversation target clusters having association relationships therebetween, and each conversation target cluster comprising at least two expressions;
obtain a second expression associated with the first expression from the conversational graph based on the association relationships of expressions and the association relationships of conversational target clusters in the conversational graph; and
generate a reply statement based on the second expression and the input statement.

### Claim 14 (depends on 13)

The electronic device of claim 13, wherein the at least one processor is further configured to:
obtain first candidate expressions associated with the first expression from the conversational graph based on the association relationships of expressions in the conversational graph;
determine a second conversation target cluster based on an association relationship between a first conversation target cluster to which the first expression belongs and a respective candidate conversation target cluster to which each first candidate expression belongs; and
obtain the second expression associated with the first expression from the second conversation target cluster.

### Claim 15 (depends on 14)

The electronic device of claim 14, wherein the association relationships of expressions comprise directions of edges connecting the expressions and first weights of respective edges, and
the at least one processor is further configured to:
obtain the first candidate expressions from the conversational graph based on the directions and the first weights, each first candidate expression corresponding to an edge pointing from the first expression to the first candidate expression, and the first weight of the edge being greater than a first threshold.

### Claim 16 (depends on 14)

The electronic device of claim 14, wherein the association relationships of expressions comprise directions of edges connecting the expressions, and
the at least one processor is further configured to:
obtain the first candidate expression based on the directions and the number of edges, the direction of the edge between each first candidate expression and the first expression being from the first expression to the first candidate expression, and the number of edges corresponding to each first candidate expression being greater than a second threshold.

### Claim 17 (depends on 14)

The electronic device of claim 14, wherein the at least one processor is further configured to:
obtain second candidate expressions associated with the first expression from the conversational graph based on the association relationships of expressions; and
obtain the first candidate expressions from the second candidate expressions based on the number of times of selecting each second candidate expression.

### Claim 18 (depends on 14)

The electronic device of claim 14, wherein the at least one processor is further configured to:
determine that the second conversation target cluster is the same as the first conversation target cluster based on a candidate conversation target cluster to which a first candidate expression belongs being the first conversation target cluster.

### Claim 19 (depends on 14)

The electronic device of claim 14, wherein the association relationships of conversation target clusters comprise directions of edges connecting the conversation target clusters and second weights of respective edges, and
the at least one processor is further configured to:
obtain the second conversation target cluster from the candidate conversation target clusters based on the direction of the edge connecting the first conversation target cluster and each candidate conversation target cluster and the second weight of the edge, the edge pointing from the first conversation target cluster to the second conversation target cluster, and the second weight of the edge being greater than a third threshold.

### Claim 20

A non-transitory computer readable storage medium, having computer instructions stored thereon, wherein the computer instructions are configured to cause a computer to execute a method for generating the conversation, the method comprising:
obtaining an input statement;
obtaining a first expression corresponding to the input statement from a conversational graph, the conversational graph comprising expressions having association relationships therebetween and conversation target clusters having association relationships therebetween, and each conversation target cluster comprising at least two expressions;
obtaining a second expression associated with the first expression from the conversational graph based on the association relationships of expressions and the association relationships of conversational target clusters in the conversational graph; and
generating a reply statement based on the second expression and the input statement.
