Method and apparatus for building text classification model, and text classification method and apparatus

US10783331B2 · US · B2

Patent metadata
FieldValue
Publication numberUS-10783331-B2
Application numberUS-201816116710-A
CountryUS
Kind codeB2
Filing dateAug 29, 2018
Priority dateSep 26, 2017
Publication dateSep 22, 2020
Grant dateSep 22, 2020

How to read this patent

A practical reading order for non-experts. Skip the full description unless you need deep technical detail.

  1. Title

    What the patent document calls the invention.

  2. Abstract

    A short plain-language summary of the technical disclosure.

  3. Assignees and inventors

    Who owns or filed the patent and who is credited as inventor.

  4. Key dates

    Filing, priority, publication, and grant dates set the timeline.

  5. First independent claim

    The legal scope of protection — read this for what is actually claimed.

  6. CPC / IPC classifications

    Technology tags used to group this patent with similar filings.

  7. Citations and related patents

    Prior art links and similar publications in this corpus.

Abstract

Official abstract text for this publication.

The present disclosure provides a method and apparatus for building a text classification model, and a text classification method and apparatus. The method of building a text classification model comprises: obtaining a training sample; obtaining a vector matrix corresponding to the text, after performing word segmentation for the text based on an entity dictionary; using the vector matrix corresponding to the text and a class of the text to train a first classification model and a second classification model respectively; during the training process, using a loss function of the first classification model and a loss function of the second classification model to obtain a loss function of the text classification model, and using the loss function of the text classification model to adjust parameters for the first classification model and the second classification model, to obtain the text classification model formed by the first classification model and the second classification model. The text classification method comprises: obtaining a to-be-classified text; obtaining a vector matrix corresponding to the text, after performing word segmentation for the text based on an entity dictionary; inputting the vector matrix into a text classification model, and obtaining a classification result of the text according to output of the text classification model. The text classification effect can be improved through the technical solutions of the present disclosure.

First claim

Opening claim text (preview).

What is claimed is: 1. A method of building a text classification model, wherein the method comprises: obtaining a training sample, wherein the training sample includes a text and a corresponding class; obtaining a vector matrix corresponding to the text, after performing word segmentation for the text based on an entity dictionary; using the vector matrix corresponding to the text and a class of the text to train a first classification model and a second classification model respectively; and during the training, using a loss function of the first classification model and a loss function of the second classification model to obtain a loss function of the text classification model, and using the loss function of the text classification model to adjust parameters for the first classification model and the second classification model, to obtain the text classification model formed by the first classification model and the second classification model. 2. The method according to claim 1 , wherein the text classification model is used to classify a medical text. 3. The method according to claim 1 , wherein a training target of the first classification model and the second classification model is to minimize the loss function of the text classification model. 4. The method according to claim 1 , wherein the first classification model is a probability-based classification model. 5. The method according to claim 4 , wherein the first classification model comprises a classification model combined based on a bidirectional length memory unit and a convolutional neural network. 6. The method according to claim 4 , wherein the training the first classification model comprises: training the first classification model by regarding the text as input, and regarding the class of the text as output. 7. The method according to claim 1 , wherein the second classification model is a similarity-based classification model. 8. The method according to claim 7 , wherein the second classification model comprises a classification model based on a deep neural network. 9. The method according to claim 7 , wherein the training the second classification model comprises: training the second classification model by regarding the text and expert's data corresponding to the class of the text as input, and regarding a similarity between the text and the expert's data as output. 10. The method according to claim 1 , wherein the using a loss function of the first classification model and a loss function of the second classification model to obtain a loss function of the text classification model comprises: using a preset combination form to integrate the loss function of the first classification model and the loss function of the second classification model, to obtain the loss function of the text classification model. 11. A text classification method, wherein the method comprises: obtaining a to-be-classified text; obtaining a vector matrix corresponding to the to-be-classified text, after performing word segmentation for the to-be-classified text based on an entity dictionary; and inputting the vector matrix into a text classification model, and obtaining a classification result of the to-be-classified text according to output of the text classification model, wherein the text classification model is pre-built according to a method of building the text classification model, wherein the method of building the text classification model comprises: obtaining a training sample, wherein the training sample includes a text and a corresponding class; obtaining a vector matrix corresponding to the text, after performing word segmentation for the text based on an entity dictionary; using the vector matrix corresponding to the text and a class of the text to train a first classification model and a second classification model respectively; and during the training, using a loss function of the first classification model and a loss function of the second classification model to obtain a loss function of the text classification model, and using the loss function of the text classification model to adjust parameters for the first classification model and the second classification model, to obtain the text classification model formed by the first classification model and the second classification model. 12. A device, wherein the device comprises: one or more processors; and a storage for storing one or more programs, wherein the one or more programs, when executed by said one or more processors, enable said one or more processors to implement a method of building a text classification model, wherein the method comprises: obtaining a training sample, wherein the training sample includes a text and a corresponding class; obtaining a vector matrix corresponding to the text, after performing word segmentation for the text based on an entity dictionary; using the vector matrix corresponding to the text and a class of the text to train a first classification model and a second classification model respectively; and during the training, using a loss function of the first classification model and a loss function of the second classification model to obtain a loss function of the text classification model, and using the loss function of the text classification model to adjust parameters for the first classification model and the second classification model, to obtain the text classification model formed by the first classification model and the second classification model. 13. The device according to claim 12 , wherein the text classification model is used to classify a medical text. 14. The device according to claim 12 , wherein a training target of the first classification model and the second classification model is to minimize the loss function of the text classification model. 15. The device according to claim 12 , wherein the first classification model is a probability-based classification model. 16. The device according to claim 15 , wherein the first classification model comprises a classification model combined based on a bidirectional length memory unit and a convolutional neural network. 17. The device according to claim 15 , wherein the training the first classification model comprises: training the first classification model by regarding the text as input, and regarding the class of the text as output. 18. A device, wherein the device comprises: one or more processors; and a storage for storing one or more programs, wherein the one or more programs, when executed by said one or more processors, enable said one or more processors to implement a text classification method, wherein the method comprises: obtaining a to-be-classified text; obtaining a vector matrix corresponding to the to-be-classified text, after performing word segmentation for the to-be-classified text based on an entity dictionary; and inputting the vector matrix into a text classification model, and obtaining a classification result of the to-be-classified text according to output of the text classification model, wherein the text classification model is pre-built according to a method of building the text classification model, wherein the method of building the text classification model comprises: obtaining a training sample, wherein the training sample includes a text and a corresponding class; obtaining a vector matrix corresponding to the text, after performing word segmentation for the text based on an entity dictionary; using the vector matrix corresponding to the text and a class of the text to

Assignees

Inventors

Classifications

  • G06F40/216Primary

    using statistical methods · CPC title

  • G06F40/44Primary

    Statistical methods, e.g. probability models · CPC title

  • the supervisor being an automated module, e.g. intelligent oracle · CPC title

  • based on distances to training or reference patterns · CPC title

  • Combinations of networks · CPC title

Patent family

Related publications grouped by family.

External sources

Frequently asked questions

Answers are generated from the same data shown on this page.

What does patent US10783331B2 cover?
The present disclosure provides a method and apparatus for building a text classification model, and a text classification method and apparatus. The method of building a text classification model comprises: obtaining a training sample; obtaining a vector matrix corresponding to the text, after performing word segmentation for the text based on an entity dictionary; using the vector matrix corre…
Who is the assignee on this patent?
Baidu online network technology beijing co ltd
What technology area does this patent fall under?
Primary CPC classification G06F40/216. Mapped technology areas include Physics.
When was this patent published?
Publication date Tue Sep 22 2020 00:00:00 GMT+0000 (Coordinated Universal Time) (B2). Legal status and post-grant events are not shown on this page.
What related patents are in patentsdb?
We list 8 related publications on this page (citations in our corpus or others sharing the same primary CPC).