# US 2022/0044081 A1 · Method for recognizing dialogue intention, 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 2022/0044081 A1
- Document ID: US20220044081A1
- Status: Published application
- Kind: A1
- Application number: 17/476,177
- Filed: 2021-09-15
- Published: 2022-02-10
- Earliest claimed: 2020-12-09
- Assignees: Beijing Baidu Netcom Science Technology Co., Ltd.
- Applicants: Beijing Baidu Netcom Science and Technology Co., Ltd.
- Inventors: Hongjie GUO; Hongyang ZHANG; Zhenyu JIAO; Shuqi SUN; Yue CHANG; Tingting LI
- Web page: https://patentgrep.com/patent/US20220044081A1

## CPC

- G06V 30/274: {Syntactic or semantic context, e.g. balancing}
- G06F 18/22: Matching criteria, e.g. proximity measures
- G06F 40/284: Lexical analysis, e.g. tokenisation or collocates
- G06F 40/295: Named entity recognition
- G06F 40/30: Semantic analysis
- G06V 10/82: using neural networks
- G06V 30/19093: {Proximity measures, i.e. similarity or distance measures}
- G06F 40/216: using statistical methods
- G10L 15/1822: {Parsing for meaning understanding}
- G06V: IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- 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 method for recognizing a dialogue intention, an electronic device and a storage medium are provided. The solution includes: obtaining a sample sentence with an intention category to be predicted and a plurality of supporting sentences each labeled with an intention category; and inputting the sample sentence and the plurality of supporting sentences into a trained intention recognition model, in which the trained intention recognition model is configured to generate a sample sentence vector corresponding to the sample sentence and category vectors corresponding to the plurality of supporting sentences based on the sample sentence and the plurality of supporting sentences, calculate matching degrees between the sample sentence vector and the category vectors, and obtain a predicted intention category of the sample sentence based on the matching degrees.

## Claims

### Claim 1

A method for recognizing a dialogue intention, comprising:
obtaining a sample sentence with an intention category to be predicted and a plurality of supporting sentences each labeled with an intention category; and
inputting the sample sentence and the plurality of supporting sentences into a trained intention recognition model, wherein the trained intention recognition model is configured to generate a sample sentence vector corresponding to the sample sentence and category vectors corresponding to the plurality of supporting sentences based on the sample sentence and the plurality of supporting sentences, calculate matching degrees between the sample sentence vector and the category vectors, and obtain a predicted intention category of the sample sentence based on the matching degrees.

### Claim 2 (depends on 1)

The method of claim 1, wherein the trained intention recognition model is configured to generate the category vectors corresponding to the plurality of supporting sentences based on the sample sentence and the plurality of supporting sentences by:
generating supporting sentence vectors corresponding respectively to the plurality of supporting sentences based on the sample sentence and the plurality of supporting sentences; and
generating the category vectors corresponding to the plurality of supporting sentences based on the supporting sentence vectors.

### Claim 3 (depends on 2)

The method of claim 2, wherein generating the supporting sentence vectors corresponding respectively to the plurality of supporting sentences based on the sample sentence and the plurality of supporting sentences comprises:
generating a sample word vector sequence based on the sample sentence;
generating supporting word vector sequences based on the plurality of supporting sentences;
inputting the sample word vector sequence into a recurrent neural network based time sequence model to obtain an output hidden state of each sample word in the sample sentence;
inputting the supporting word vector sequences into the recurrent neural network based time sequence model to obtain an output hidden state of each supporting word in the plurality of supporting sentences;
generating output vector sequences corresponding respectively to the plurality of supporting sentences based on the output hidden state of each sample word and the output hidden state of each supporting word; and
generating the supporting sentence vectors based on the output vector sequences corresponding respectively to the plurality of supporting sentences.

### Claim 4 (depends on 1)

The method of claim 1, wherein the trained intention recognition model is configured to generate the sample sentence vector corresponding to the sample sentence based on the sample sentence and the plurality of supporting sentences by:
generating a sample word vector sequence based on the sample sentence;
generating supporting word vector sequences based on the plurality of supporting sentences;
inputting the sample word vector sequence into a recurrent neural network based time sequence model to obtain an output hidden state of each sample word in the sample sentence;
inputting the supporting word vector sequences into the recurrent neural network based time sequence model to obtain an output hidden states of each supporting word in the plurality of supporting sentences; and
generating an output vector sequence corresponding to the sample sentence based on the output hidden state of each sample word and the output hidden state of each supporting word; and
generating the sample sentence vector based on the output vector sequence corresponding to the sample sentence.

### Claim 5 (depends on 3)

The method of claim 3, wherein generating the sample word vector sequence based on the sample sentence comprises:
performing a word segmentation on the sample sentence to obtain a plurality of sample words;
determining parts of speech of the plurality of sample words;
performing a named entity recognition on each sample word to obtain sample word named entities; and
generating the sample word vector sequence corresponding to the sample sentence based on the plurality of sample words, the part of speech of each sample word, and the sample word named entities.

### Claim 6 (depends on 3)

The method of claim 3, wherein generating the supporting word vector sequences based on the plurality of supporting sentences comprises:
performing a word segmentation on each supporting sentence to obtain a plurality of supporting words;
determining parts of speech of the supporting words;
performing a named entity recognition on each supporting word to obtain supporting word named entities; and
generating the supporting word vector sequences corresponding to the plurality of supporting sentences based on the plurality of supporting words, the part of speech of each supporting word, and the supporting word named entities.

### Claim 7 (depends on 4)

The method of claim 4, wherein generating the sample sentence vector based on the output vector sequence corresponding to the sample sentence comprises:
obtaining a term frequency and an inverse document frequency of each sample word in the sample sentence with respect to a corpus;
generating a weight of an output vector of each sample word based on the term frequency and the inverse document frequency of the respective sample word; and
generating the sample sentence vector based on output vectors in the output vector sequence corresponding to the sample sentence and the respective weights.

### Claim 8 (depends on 3)

The method of claim 3, wherein generating the supporting sentence vectors based on output vector sequences corresponding respectively to the plurality of supporting sentences comprises:
obtaining a term frequency and an inverse document frequency of each supporting word in the plurality of supporting sentences with respect to a corpus;
generating a weight of an output vector of each supporting word based on the term frequency and the inverse document frequency of the respective supporting word; and
generating the supporting sentence vectors based on output vectors in the output vector sequences corresponding respectively to the plurality of supporting sentences and the respective weights.

### Claim 9 (depends on 2)

The method of claim 2, wherein generating the category vectors corresponding to the plurality of supporting sentences based on the supporting sentence vectors comprises:
obtaining supporting sentence vectors labeled with a same intention category; and
generating the category vector corresponding to the same intention category based on the supporting sentence vectors labeled with the same intention category.

### Claim 10 (depends on 1)

The method of claim 1, wherein the trained intention recognition model is configured to obtain the predicted intention category of the sample sentence based on the matching degrees by:
determining the intention category labeled for the category vector corresponding to a maximum matching degree among the matching degrees as the predicted intention category of the sample sentence.

### Claim 11 (depends on 1)

The method of claim 1, further comprising:
obtaining a first training sentence labeled with an intention category and a plurality of second training sentences;
inputting the first training sentence and the plurality of second training sentences into an intention recognition model to be trained to obtain a predicted intention category of the first training sentence;
adjusting a model parameter of the intention recognition model to be trained based on a difference between the predicted intention category of the first training sentence and the intention category labeled for the first training sentence;
returning to the operation of obtaining a first training sentence labeled with an intention category and a plurality of second training sentences till the difference between the predicted intention category of the first training sentence and the intention category labeled for the first training sentence meets a preset training terminating condition, and determining the intention recognition model to be trained having the adjusted model parameter as the trained intention recognition model.

### Claim 12

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, wherein when the instructions are executed by the at least one processor, the at least one processor is configured to execute the method for recognizing a dialogue intention, comprising:
obtaining a sample sentence with an intention category to be predicted and a plurality of supporting sentences each labeled with an intention category; and
inputting the sample sentence and the plurality of supporting sentences into a trained intention recognition model, wherein the trained intention recognition model is configured to generate a sample sentence vector corresponding to the sample sentence and category vectors corresponding to the plurality of supporting sentences based on the sample sentence and the plurality of supporting sentences, calculate matching degrees between the sample sentence vector and the category vectors, and obtain a predicted intention category of the sample sentence based on the matching degrees.

### Claim 13 (depends on 12)

The device of claim 12, wherein the trained intention recognition model is configured to generate the category vectors corresponding to the plurality of supporting sentences based on the sample sentence and the plurality of supporting sentences by:
generating supporting sentence vectors corresponding respectively to the plurality of supporting sentences based on the sample sentence and the plurality of supporting sentences; and
generating the category vectors corresponding to the plurality of supporting sentences based on the supporting sentence vectors.

### Claim 14 (depends on 13)

The device of claim 13, wherein generating the supporting sentence vectors corresponding respectively to the plurality of supporting sentences based on the sample sentence and the plurality of supporting sentences comprises:
generating a sample word vector sequence based on the sample sentence;
generating supporting word vector sequences based on the plurality of supporting sentences;
inputting the sample word vector sequence into a recurrent neural network based time sequence model to obtain an output hidden state of each sample word in the sample sentence;
inputting the supporting word vector sequences into the recurrent neural network based time sequence model to obtain an output hidden state of each supporting word in the plurality of supporting sentences;
generating output vector sequences corresponding respectively to the plurality of supporting sentences based on the output hidden state of each sample word and the output hidden state of each supporting word; and
generating the supporting sentence vectors based on the output vector sequences corresponding respectively to the plurality of supporting sentences.

### Claim 15 (depends on 12)

The device of claim 12, wherein the trained intention recognition model is configured to generate the sample sentence vector corresponding to the sample sentence based on the sample sentence and the plurality of supporting sentences by:
generating a sample word vector sequence based on the sample sentence;
generating supporting word vector sequences based on the plurality of supporting sentences;
inputting the sample word vector sequence into a recurrent neural network based time sequence model to obtain an output hidden state of each sample word in the sample sentence;
inputting the supporting word vector sequences into the recurrent neural network based time sequence model to obtain an output hidden states of each supporting word in the plurality of supporting sentences; and
generating an output vector sequence corresponding to the sample sentence based on the output hidden state of each sample word and the output hidden state of each supporting word; and
generating the sample sentence vector based on the output vector sequence corresponding to the sample sentence.

### Claim 16 (depends on 14)

The device of claim 14, wherein generating the sample word vector sequence based on the sample sentence comprises:
performing a word segmentation on the sample sentence to obtain a plurality of sample words;
determining parts of speech of the plurality of sample words;
performing a named entity recognition on each sample word to obtain sample word named entities; and
generating the sample word vector sequence corresponding to the sample sentence based on the plurality of sample words, the part of speech of each sample word, and the sample word named entities.

### Claim 17 (depends on 14)

The device of claim 14, wherein generating the supporting word vector sequences based on the plurality of supporting sentences comprises:
performing a word segmentation on each supporting sentence to obtain a plurality of supporting words;
determining parts of speech of the supporting words;
performing a named entity recognition on each supporting word to obtain supporting word named entities; and
generating the supporting word vector sequences corresponding to the plurality of supporting sentences based on the plurality of supporting words, the part of speech of each supporting word, and the supporting word named entities.

### Claim 18 (depends on 15)

The device of claim 15, wherein generating the sample sentence vector based on the output vector sequence corresponding to the sample sentence comprises:
obtaining a term frequency and an inverse document frequency of each sample word in the sample sentence with respect to a corpus;
generating a weight of an output vector of each sample word based on the term frequency and the inverse document frequency of the respective sample word; and
generating the sample sentence vector based on output vectors in the output vector sequence corresponding to the sample sentence and the respective weights.

### Claim 19 (depends on 14)

The device of claim 14, wherein generating the supporting sentence vectors based on output vector sequences corresponding respectively to the plurality of supporting sentences comprises:
obtaining a term frequency and an inverse document frequency of each supporting word in the plurality of supporting sentences with respect to a corpus;
generating a weight of an output vector of each supporting word based on the term frequency and the inverse document frequency of the respective supporting word; and
generating the supporting sentence vectors based on output vectors in the output vector sequences corresponding respectively to the plurality of supporting sentences and the respective weights.

### 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 the method for recognizing a dialogue intention, comprising:
obtaining a sample sentence with an intention category to be predicted and a plurality of supporting sentences each labeled with an intention category; and
inputting the sample sentence and the plurality of supporting sentences into a trained intention recognition model, wherein the trained intention recognition model is configured to generate a sample sentence vector corresponding to the sample sentence and category vectors corresponding to the plurality of supporting sentences based on the sample sentence and the plurality of supporting sentences, calculate matching degrees between the sample sentence vector and the category vectors, and obtain a predicted intention category of the sample sentence based on the matching degrees.
