IP Library › Granted Patent US 11,475,069
Granted Patent B2
US 11,475,069 · App. 17/028,431 · Granted Oct 18, 2022

Corpus processing method, apparatus and storage medium

Inventors: Zhi Cui (Beijing, CN); Kecong Xiao (Beijing, CN); Qun Zhao (Beijing, CN)
Assignee: Beijing Xiaomi Pinecone Electronics Co., Ltd.
G06F16/90332G06F40/289G06F40/30G06K9/6257
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 11,475,069
App. No.
17/028,431
Granted
Oct 18, 2022
Kind
B2
Abstract

The present disclosure relates to a corpus processing method, a corpus processing apparatus and a storage medium. The corpus processing method can include obtaining a message input by a user, retrieving a reply message matching the message input by the user from a plurality of candidate corpora, in which the plurality of the candidate corpora includes candidate corpora obtained after removing a negative emotion corpus, and sending the reply message.

Claims (55)

1. A corpus processing method, comprising:

obtaining a message input by a user;

retrieving a reply message matching the message input by the user from a plurality of candidate corpora that include candidate corpora obtained after removing a negative emotion candidate corpus; and

sending the reply message;

wherein the method further comprises:

obtaining a candidate corpus set;

calling, an emotion recognition model that is configured to output an emotion score according to an input corpus;

inputting a candidate corpus in the candidate corpus set into the emotion recognition model and determining the negative emotion candidate corpus in the candidate corpus set based on an output of the emotion recognition model and a preset negative emotion score threshold; and

removing the negative emotion candidate corpus to obtain the plurality of the candidate corpora.

2. The method of claim 1 , further comprising:

obtaining a training set that includes a plurality of negative emotion training corpora and a plurality of positive emotion training corpora;

inputting the plurality of the negative emotion training corpora and the plurality of the positive emotion training corpora into an initial emotion recognition model, and outputting emotion scores of the training corpora through the initial emotion recognition model; and

adjusting a parameter of the initial emotion recognition model based on the emotion scores of the training corpora and a loss function to obtain the emotion recognition model that satisfies a loss value.

3. The method of claim 2 , further comprising:

obtaining a verification set that includes a plurality of negative emotion verification corpora and a plurality of positive emotion verification corpora;

inputting the plurality of the negative emotion verification corpora and the plurality of the positive emotion verification corpora into the emotion recognition model, and outputting emotion scores of the verification corpora through the emotion recognition model; and

determining a negative emotion score threshold based on the emotion scores of the verification corpora.

4. The method of claim 1 , further comprising:

obtaining an updated candidate corpus set by taking a preset time interval as a unit, determining a negative emotion candidate corpus in the updated candidate corpus set based on an output of the emotion recognition model, and removing the negative emotion candidate corpus in the updated candidate corpus set.

5. A corpus processing apparatus, comprising:

a processor; and

a memory for storing instructions executable by the processor,

wherein the processor is configured to implement a corpus processing method comprising:

obtaining a message input by a user;

retrieving a reply message matching the message input by the user from a plurality of candidate corpora that includes candidate corpora obtained after removing a negative emotion candidate corpus; and

sending the reply message; wherein the method further comprises: obtaining a candidate corpus set; calling an emotion recognition model that is configured to output an emotion score according to an input corpus; inputting a candidate corpus in the candidate corpus set into the emotion recognition model and determining the negative emotion candidate corpus in the candidate corpus set based on an output of the emotion recognition model and a preset negative emotion score threshold; and removing the negative emotion candidate corpus to obtain the plurality of the candidate corpora.

6. The apparatus of claim 5 , wherein the method further comprises:

obtaining a training set that includes a plurality of negative emotion training corpora and a plurality of positive emotion training corpora;

inputting the plurality of the negative emotion training corpora and the plurality of the positive emotion training corpora into an initial emotion recognition model, and outputting emotion scores of the training corpora through the initial emotion recognition model; and

adjusting a parameter of the initial emotion recognition model based on the emotion scores of the training corpora and a loss function to obtain the emotion recognition model that satisfies a loss value.

7. The apparatus of claim 6 , wherein the method further comprises:

obtaining a verification set that includes a plurality of negative emotion verification corpora and a plurality of positive emotion verification corpora;

inputting the plurality of the negative emotion verification corpora and the plurality of the positive emotion verification corpora into the emotion recognition model, and outputting emotion scores of the verification corpora through the emotion recognition model; and

determining a negative emotion score threshold based on the emotion scores of the verification corpora.

8. The apparatus of claim 5 , wherein the method further comprises:

obtaining an updated candidate corpus set by taking a preset time interval as a unit, determining a negative emotion candidate corpus in the updated candidate corpus set according to an output of the emotion recognition model, and removing the negative emotion candidate corpus in the updated candidate corpus set.

9. A non-transitory computer-readable storage medium having stored therein instructions that, when executed by a processor, cause the processor to perform a corpus processing method comprising:

obtaining a message input by a user;

retrieving a reply message matching the message input by the user from a plurality of candidate corpora that includes candidate corpora obtained after removing a negative emotion candidate corpus; and

sending the reply message;

wherein the method further comprises:

obtaining a candidate corpus set;

calling an emotion recognition model that is configured to output an emotion score according to an input corpus;

inputting a candidate corpus in the candidate corpus set into the emotion recognition model and determining the negative emotion candidate corpus in the candidate corpus set based on an output of the emotion recognition model and a preset negative emotion score threshold; and

removing the negative emotion candidate corpus to obtain the plurality of the candidate corpora.

10. The storage medium of claim 9 , wherein the method further comprises:

obtaining a training set that includes a plurality of negative emotion training corpora and a plurality of positive emotion training corpora;

inputting the plurality of the negative emotion training corpora and the plurality of the positive emotion training corpora into an initial emotion recognition model and outputting emotion scores of the training corpora through the initial emotion recognition model; and

adjusting a parameter of the initial emotion recognition model based on the emotion scores of the training corpora and a loss function to obtain the emotion recognition model that satisfies a loss value.

11. The storage medium of claim 10 , wherein the method further comprises:

obtaining a verification set that includes a plurality of negative emotion verification corpora and a plurality of positive emotion verification corpora;

inputting the plurality of the negative emotion verification corpora and the plurality of the positive emotion verification corpora into the emotion recognition model, and outputting emotion scores of the verification corpora through the emotion recognition model; and

determining a negative emotion score threshold according to the emotion scores of the verification corpora.

12. The storage medium of claim 9 , wherein the method further comprises:

obtaining an updated candidate corpus set by taking a preset time interval as a unit, determining a negative emotion candidate corpus in the updated candidate corpus set according to an output of the emotion recognition model, and removing the negative emotion candidate corpus in the updated candidate corpus set.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Sep 22, 2020
From: CUI, ZHI; XIAO, KECONG; ZHAO, QUN
To: BEIJING XIAOMI PINECONE ELECTRONICS CO., LTD.
Reel/Frame 053847/0411 →
Priority Claims (1)
CN 202010274262.2 · Apr 9, 2020 · national
Continuity (1)
Related Publication 20210319069A1 · Oct 14, 2021