CN112417151A - Method for generating classification model and method and device for classifying text relation - Google Patents

Method for generating classification model and method and device for classifying text relation Download PDF

Info

Publication number
CN112417151A
CN112417151A CN202011282096.7A CN202011282096A CN112417151A CN 112417151 A CN112417151 A CN 112417151A CN 202011282096 A CN202011282096 A CN 202011282096A CN 112417151 A CN112417151 A CN 112417151A
Authority
CN
China
Prior art keywords
text
classification
samples
training
output
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202011282096.7A
Other languages
Chinese (zh)
Inventor
赵蕾
王玥
黄信
宋英豪
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ennew Digital Technology Co Ltd
Original Assignee
Ennew Digital Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ennew Digital Technology Co Ltd filed Critical Ennew Digital Technology Co Ltd
Priority to CN202011282096.7A priority Critical patent/CN112417151A/en
Publication of CN112417151A publication Critical patent/CN112417151A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/35Clustering; Classification
    • G06F16/353Clustering; Classification into predefined classes
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/21Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
    • G06F18/214Generating training patterns; Bootstrap methods, e.g. bagging or boosting
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/24Classification techniques

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Artificial Intelligence (AREA)
  • Evolutionary Biology (AREA)
  • Evolutionary Computation (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Databases & Information Systems (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The embodiment of the invention discloses a method for generating a classification model, a method and a device for classifying text relations, wherein a specific implementation mode of the method comprises the following steps: acquiring a training sample set, wherein training samples in the training sample set comprise text samples and text relation classification result samples corresponding to the text samples; and performing joint learning training on the initial model according to the training sample set to obtain a classification model, wherein the initial model comprises a plurality of output layers. The implementation mode simplifies the training process and improves the accuracy of the text relation classification result generated by the classification model.

Description

Method for generating classification model and method and device for classifying text relation
Technical Field
The embodiment of the invention relates to the technical field of computers, in particular to a method for generating a classification model and a method and a device for text relation classification.
Background
With the progress of data processing technology and the rapid spread of mobile internet, computer technology is widely applied to various fields of society, and with the progress of data processing technology, mass data is generated. Among them, text data is receiving more and more attention.
Generally, the accuracy of the text relationship classification result of the classification model is closely related to the number of samples of the classification model in the training process, and the accuracy of the text relationship classification result is often reduced by reducing the number of samples or simplifying the training process. Therefore, the training process of the classification model in the training process is complicated, and the accuracy of the text relation classification result of the classification model is difficult to improve.
Disclosure of Invention
This summary is provided to introduce a selection of concepts in a simplified form that are further described below in the detailed description. This summary of the disclosure is not intended to identify key features or essential features of the claimed subject matter, nor is it intended to be used to limit the scope of the claimed subject matter.
Some embodiments of the present disclosure provide a method for generating a classification model, a method for text relationship classification, an apparatus, an electronic device, and a computer-readable medium, to solve the technical problems mentioned in the background section above.
In a first aspect, some embodiments of the present disclosure provide a method for generating a classification model, the method including:
acquiring a training sample set, wherein training samples in the training sample set comprise text samples and text relation classification result samples corresponding to the text samples;
and performing joint learning training on the initial model according to the training sample set to obtain a classification model, wherein the initial model comprises a plurality of output layers.
In a second aspect, some embodiments of the present disclosure provide a method for classifying text relationships, the method including:
acquiring a target text;
and inputting the target text into a pre-trained classification model to obtain a text relation classification result of the target text, wherein the classification model is generated by the method in one of the embodiments.
In a third aspect, some embodiments of the present disclosure provide an apparatus for generating a classification model, the apparatus including:
the acquisition module is configured to acquire a training sample set, wherein training samples in the training sample set comprise text samples and text relation classification result samples corresponding to the text samples;
and the training module is configured to perform joint learning training on an initial model according to the training sample set to obtain a classification model, wherein the initial model comprises a plurality of output layers.
In a fourth aspect, some embodiments of the present disclosure provide a text relation classification apparatus, including:
a target text acquisition module configured to acquire a target text;
and the classification module is configured to input the target text into a pre-trained classification model to obtain a text relation classification result of the target text, wherein the classification model is generated by the method in one of the above embodiments.
In a fifth aspect, an embodiment of the present application provides an electronic device, including:
one or more processors;
storage means for storing one or more programs;
when executed by one or more processors, cause the one or more processors to implement a method as described in any of the implementations of the first or second aspects.
In a sixth aspect, the present application provides a computer-readable medium, on which a computer program is stored, which, when executed by a processor, implements the method as described in any implementation manner of the first aspect or the second aspect.
The method for generating the classification model provided by one of the embodiments disclosed by the invention at least has the following beneficial effects: firstly, a training sample set is obtained, and then joint learning training is carried out on an initial model according to the training sample set to obtain a classification model. Because the text samples in the training sample set are matched with the text relation classification result samples in the training sample set, the classification model obtained through training has higher accuracy. The process of training the initial model by using the joint learning training method is simpler, the number of samples required is less, and the method has more flexibility, so that the simplification of the training process and the improvement of the classification accuracy of the classification model on the text relation are realized.
The text relation classification method provided by one embodiment of the above embodiments disclosed by the invention at least has the following beneficial effects: firstly, a target text is obtained, and then the target text is input into a pre-trained classification model to obtain a text relation classification result of the target text. The trained classification model is used to enable the text relation classification result of the target text to be more accurate, and the accuracy of the text relation classification result and the user experience are improved.
Drawings
The above and other features, advantages and aspects of the disclosed embodiments will become more apparent from the following detailed description when taken in conjunction with the accompanying drawings. Throughout the drawings, the same or similar reference numbers refer to the same or similar elements. It should be understood that the drawings are schematic and that elements and elements are not necessarily drawn to scale.
FIG. 1 is a schematic diagram of an application scenario in accordance with some embodiments of the disclosed method of generating a classification model;
FIG. 2 is a flow diagram of some embodiments of a method of generating a classification model according to the present disclosure;
FIG. 3 is a schematic structural diagram of an initial model according to some embodiments of the present disclosure;
FIG. 4 is a flow diagram of some embodiments of a textual relationship classification method according to the present disclosure;
FIG. 5 is a schematic block diagram illustration of some embodiments of an apparatus for generating classification models in accordance with the present disclosure;
FIG. 6 is a schematic block diagram of some embodiments of a textual relationship classification device according to the present disclosure;
FIG. 7 is a schematic block diagram of some embodiments of an electronic device suitable for use in implementing the present disclosure.
Detailed Description
Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While certain embodiments of the present disclosure are shown in the drawings, it is to be understood that the present disclosure may be embodied in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete. It should be understood that the drawings and examples are for illustrative purposes only and are not intended to limit the scope of the present disclosure.
It should be noted that, for convenience of description, only the portions related to the related invention are shown in the drawings. The embodiments and features of the embodiments disclosed in the present invention may be combined with each other without conflict.
It should be noted that the terms "first", "second", and the like in the present disclosure are only used for distinguishing different devices, modules, or units, and are not used for limiting the order or interdependence of the functions performed by the devices, modules, or units.
It is noted that references to "a", "an", and "the" modifications in the disclosure are exemplary rather than limiting, and that those skilled in the art will understand that "one or more" unless the context clearly dictates otherwise.
The names of messages or information exchanged between devices in the disclosed embodiments are for illustrative purposes only and are not intended to limit the scope of such messages or information.
The present disclosure will be described in detail below with reference to the accompanying drawings in conjunction with embodiments.
FIG. 1 is a schematic diagram of an application scenario of a survival classification model method according to some embodiments of the present disclosure.
As shown in fig. 1, first, the server 101 may obtain a training sample set 102 from a local pre-storage or network download. Here, the training sample set 102 includes text samples 1021 and text relationship classification result samples 1022 corresponding to the text samples 1021. Thereafter, the server 101 may perform joint learning training on the initial model 103 according to the training sample set 102 to obtain a classification model 104.
It is understood that the method for generating the classification model may be executed by the server 101, or may also be executed by a terminal device, and the execution body of the method may also include a device formed by integrating the server 101 and the terminal device through a network, or may also be executed by various software programs. The terminal device may be various electronic devices with information processing capability, including but not limited to a smart phone, a tablet computer, an e-book reader, a laptop portable computer, a desktop computer, and the like. When the execution subject is software, the software can be installed in the electronic device listed above. It may be implemented, for example, as multiple software or software modules to provide distributed services, or as a single software or software module. And is not particularly limited herein.
It should be understood that the number of servers in fig. 1 is merely illustrative. There may be any number of servers, as desired for implementation.
With continued reference to FIG. 2, a flow 200 of some embodiments of a method of generating a classification model and textual relationship classification in accordance with the present disclosure is shown. The method for generating the classification model and classifying the text relationship comprises the following steps of:
step 201, a training sample set is obtained.
In some embodiments, an executing entity (e.g., the server shown in fig. 1) of the method for generating a classification model may obtain the training sample set by downloading from a network or reading locally through a wired connection or a wireless connection. Here, the training samples in the training sample set include text samples and text relationship classification result samples corresponding to the text samples. Specifically, the text relationship classification generally refers to a process of classifying text (or entity) relationships according to a certain classification system or standard.
Step 202, performing joint learning training on an initial model according to the training sample set to obtain a classification model, wherein the initial model comprises a plurality of output layers.
In some embodiments, based on the training sample set obtained in step 201, the performing entity may perform joint learning training on the initial model according to the training samples to obtain a classification model. The initial model includes a plurality of output layers.
Here, joint learning (joint learning) in the above-described joint learning training generally refers to one of Multi-task learning (MTL).
In the present embodiment, the initial model may be various existing neural network models created based on machine learning techniques. The neural network model can have various existing neural network structures, and the multi-layer output layer can be two output layers as an example, wherein the first output layer is formed by connecting a word embedding layer (word embedding), a long-short term memory network (LSTM) and a first output layer; the second output layer is formed by sequentially connecting a word embedding layer (word embedding), a bidirectional long and short term memory network (LSTM), a unidirectional long and short term memory network (LSTM) and the second output layer. Here, the long-term and short-term memory network may be multi-layered.
In some optional implementations of some embodiments, the text relationship classification result sample includes: each of the multiple output layers of the initial model corresponds to a desired output of the text sample.
In some optional implementation manners of some embodiments, the text samples in the training samples may be input to an initial model, and an output result corresponding to each output layer of the initial model is obtained. And then, respectively determining the difference between the expected output and the output result of each layer of output layer based on a preset loss function to obtain a plurality of loss values corresponding to the plurality of layers of output layers. And optimizing the initial model according to the loss values to obtain a classification model.
Specifically, the execution agent may analyze the output result of each output layer and the expected output of the corresponding output layer, so that the loss value may be determined. For example, the output result and the desired output may be used as parameters, and the parameters may be input to a specified loss function (loss function), so that a loss value between the two may be calculated. And then, adjusting the relevant parameters of the model according to the determined loss value. Here, the loss function is generally used to measure the degree of discrepancy between the predicted value (e.g., output result) and the actual value (e.g., expected output result) of the model. It is a non-negative real-valued function. In general, the smaller the loss function, the better the robustness of the model. The loss function may be set according to actual requirements. Note that the loss functions of the plurality of output layers are usually different from each other.
In some optional implementations of some embodiments, the multi-layer output layer is a three-layer output layer, wherein a first layer is a word embedding layer plus a bi-directional LSTM; the second layer is a unidirectional LSTM; and a third layer: a CNN model.
For example, in the initial model diagram shown in fig. 3, a first output layer of the initial model is formed by sequentially connecting a word embedding layer (word embedding), a bidirectional long-short term memory network (LSTM), and a first output layer; the second output layer is formed by sequentially connecting a word embedding layer, a bidirectional long-short term memory network and a unidirectional long-short term memory network; the third output layer is formed by sequentially connecting a word embedding layer, a bidirectional long-short term memory network, a unidirectional long-short term memory network and a Convolutional Neural Network (CNN). Here, the long-term and short-term memory network may be multi-layered.
One of the above embodiments disclosed by the invention has the following beneficial effects: firstly, a training sample set is obtained, and then joint learning training is carried out on an initial model according to the training sample set to obtain a classification model. Because the text samples in the training sample set are matched with the text relation classification result samples in the training sample set, the classification model obtained through training has higher accuracy. The process of training the initial model by using the joint learning training method is simpler, the number of samples required is less, and the method has more flexibility, so that the simplification of the training process and the improvement of the classification accuracy of the classification model on the text relation are realized.
With further reference to FIG. 4, a flow 400 of some embodiments of the presently disclosed textual relationship classification method is shown. The process 400 of the text relationship classification method includes the following steps:
step 401, obtaining a target text.
In some embodiments, the execution subject of the text relation classification method may obtain the target text from a local pre-storage or network download, and the like. Here, the target text generally refers to text that a user needs to perform text relation classification.
It is understood that the text relation classification method may be executed by a server or a terminal device, and the execution body of the method may further include a device formed by integrating the server and the terminal device through a network, or may also be executed by various software programs. The terminal device may be various electronic devices with information processing capability, including but not limited to a smart phone, a tablet computer, an e-book reader, a laptop portable computer, a desktop computer, and the like. When the execution subject is software, the software can be installed in the electronic device listed above. It may be implemented, for example, as multiple software or software modules to provide distributed services, or as a single software or software module. And is not particularly limited herein.
Step 402, inputting the target text into a pre-trained classification model to obtain a text relation classification result of the target text.
In some embodiments, the executing entity may input the target text into a classification model trained in advance to obtain a text relationship classification result of the target text, where the classification model is generated by the method according to one of the embodiments.
One of the above embodiments disclosed by the invention has the following beneficial effects: firstly, a target text is obtained, and then the target text is input to a pre-trained classification model to obtain a text relation classification result of the target text. The trained classification model is used to enable the text relation classification result of the target text to be more accurate, and the accuracy of the text relation classification result and the user experience are improved.
With further reference to fig. 5, as an implementation of the methods shown in the above figures, the present disclosure provides some embodiments of an apparatus for generating a classification model, which correspond to those of the method shown in fig. 2, and which may be applied in various electronic devices.
As shown in fig. 5, the apparatus 500 for generating a classification model of some embodiments includes:
an acquisition module 501 and a training module 502. The obtaining module 501 is configured to obtain a training sample set, where training samples in the training sample set include text samples and text relationship classification result samples corresponding to the text samples; and the training module 502 is configured to perform joint learning training on an initial model according to the training sample set to obtain a classification model, where the initial model includes multiple output layers.
In an optional implementation of some embodiments, the text relationship classification result sample comprises: each of the multiple output layers of the initial model corresponds to a desired output of the text sample.
In an alternative implementation of some embodiments, the training module 502 of the apparatus 500 for generating a classification model is further configured to: performing joint learning training on the initial model according to the training sample set to obtain a classification model, including:
the result obtaining module is used for inputting the text samples in the training samples into an initial model to obtain an output result corresponding to each output layer of the initial model;
the loss value acquisition unit is used for respectively determining the difference between the expected output and the output result of each layer of output layer based on a preset loss function to obtain a plurality of loss values corresponding to the plurality of layers of output layers;
and the classification model obtaining module is used for optimizing the initial model according to the loss values to obtain a classification model.
In an alternative implementation of some embodiments, the multi-layer output layer is a three-layer output layer, where the first layer is a word embedding layer plus a bi-directional LSTM; the second layer is a unidirectional LSTM; and a third layer: a CNN model.
It is understood that the modules recited in the apparatus 500 correspond to the various steps in the method described with reference to fig. 2. Thus, the operations, features and resulting advantages described above for the method are also applicable to the apparatus 500 and the modules included therein, and are not described herein again.
One of the above embodiments disclosed by the invention has the following beneficial effects: firstly, a training sample set is obtained, and then joint learning training is carried out on an initial model according to the training sample set to obtain a classification model. Because the text samples in the training sample set are matched with the text relation classification result samples in the training sample set, the classification model obtained through training has higher accuracy. The process of training the initial model by using the joint learning training method is simpler, the number of samples required is less, and the method has more flexibility, so that the simplification of the training process and the improvement of the classification accuracy of the classification model on the text relation are realized.
With further reference to fig. 6, as an implementation of the methods shown in the above-mentioned figures, the present disclosure provides some embodiments of a text relation classification apparatus, which correspond to the method embodiments shown in fig. 4, and which may be applied in various electronic devices.
As shown in fig. 6, the apparatus 600 for generating a classification model according to some embodiments includes: a target text acquisition module 601 and a classification module 602, wherein the target text acquisition module 601 is configured to acquire a target text; the classification module 602 is configured to input the target text into a pre-trained classification model to obtain a text relationship classification result of the target text, where the classification model is generated by the method according to one of the above embodiments.
It is understood that the modules recited in the apparatus 600 correspond to the various steps in the method described with reference to fig. 4. Thus, the operations, features and resulting advantages described above for the method are also applicable to the apparatus 600 and the modules included therein, and are not described herein again.
One of the above embodiments disclosed by the invention has the following beneficial effects: firstly, a target text is obtained, and then the target text is input into a pre-trained classification model to obtain a text relation classification result of the target text. The trained classification model is used to enable the text relation classification result of the target text to be more accurate, and the accuracy of the text relation classification result and the user experience are improved.
Referring now to FIG. 7, a block diagram of an electronic device (e.g., the server of FIG. 1) 700 suitable for use in implementing some embodiments of the present disclosure is shown. The electronic device shown in fig. 7 is only an example, and should not bring any limitation to the functions and the scope of use of the disclosed embodiments of the present invention.
As shown in fig. 7, electronic device 700 may include a processing means (e.g., central processing unit, graphics processor, etc.) 701 that may perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM)702 or a program loaded from storage 708 into a Random Access Memory (RAM) 703. In the RAM703, various programs and data necessary for the operation of the electronic apparatus 700 are also stored. The processing device 701, the ROM 702, and the RAM703 are connected to each other by a bus 704. An input/output (I/O) interface 705 is also connected to bus 704.
Generally, the following devices may be connected to the I/O interface 705: input devices 706 including, for example, a touch screen, touch pad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; an output device 707 including, for example, a Liquid Crystal Display (LCD), a speaker, a vibrator, and the like; storage 708 including, for example, magnetic tape, hard disk, etc.; and a communication device 709. The communication means 709 may allow the electronic device 700 to communicate wirelessly or by wire with other devices to exchange data. While fig. 7 illustrates an electronic device 700 having various means, it is to be understood that not all illustrated means are required to be implemented or provided. More or fewer devices may alternatively be implemented or provided. Each block shown in fig. 7 may represent one device or may represent multiple devices as desired.
In particular, according to some embodiments of the present disclosure, the processes described above with reference to the flow diagrams may be implemented as computer software programs. For example, some embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In some such embodiments, the computer program may be downloaded and installed from a network via communications means 709, or may be installed from storage 708, or may be installed from ROM 702. Which when executed by the processing device 701 performs the above-described functions defined in the methods of some embodiments of the present disclosure.
It should be noted that the computer readable medium in some embodiments of the present disclosure may be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In some embodiments of the disclosure, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In some embodiments of the present disclosure, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, optical cables, RF (radio frequency), etc., or any suitable combination of the foregoing.
In some embodiments, the clients, servers may communicate using any currently known or future developed network Protocol, such as HTTP (HyperText Transfer Protocol), and may interconnect with any form or medium of digital data communication (e.g., a communications network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), the Internet (e.g., the Internet), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future developed network.
The computer readable medium may be embodied in the electronic device; or may exist separately without being assembled into the electronic device. The computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to: acquiring a training sample set, wherein training samples in the training sample set comprise text samples and text relation classification result samples corresponding to the text samples; and performing joint learning training on the initial model according to the training sample set to obtain a classification model, wherein the initial model comprises a plurality of output layers. Or when the one or more programs are executed by the electronic device, cause the electronic device to: acquiring a target text; and inputting the target text into a pre-trained classification model to obtain a text relation classification result of the target text, wherein the classification model is generated by the method in one of the embodiments.
Computer program code for carrying out operations for embodiments of the present disclosure may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + +, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The modules described in some embodiments of the present disclosure may be implemented by software or hardware. The described modules may also be provided in a processor, which may be described as: a processor includes an acquisition module and a training module. Where the names of these modules do not in some cases constitute a limitation of the module itself, for example, an acquisition module may also be described as a "module that acquires a training sample set".
The functions described herein above may be performed, at least in part, by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field Programmable Gate Arrays (FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (ASSPs), systems on a chip (SOCs), Complex Programmable Logic Devices (CPLDs), and the like.
The foregoing description is only exemplary of the preferred embodiments of the present disclosure and is provided for the purpose of illustrating the general principles of the technology. It will be appreciated by those skilled in the art that the scope of the invention in the embodiments disclosed in the present application is not limited to the embodiments with specific combinations of the above-mentioned features, but also covers other embodiments with any combination of the above-mentioned features or their equivalents without departing from the inventive concept. For example, the above features and (but not limited to) technical features with similar functions disclosed in the embodiments of the present disclosure are mutually replaced to form the technical solution.

Claims (10)

1. A method of generating a classification model, comprising:
acquiring a training sample set, wherein training samples in the training sample set comprise text samples and text relation classification result samples corresponding to the text samples;
and performing joint learning training on the initial model according to the training sample set to obtain a classification model, wherein the initial model comprises a plurality of output layers.
2. The method of claim 1, wherein the text relationship classification result samples comprise:
each of the multiple output layers of the initial model corresponds to a desired output of the text sample.
3. The method according to claim 2, wherein the performing joint learning training on the initial model according to the training sample set to obtain a classification model comprises:
inputting the text samples in the training samples into an initial model to obtain an output result corresponding to each output layer of the initial model;
respectively determining the difference between the expected output and the output result of each layer of output layer based on a preset loss function to obtain a plurality of loss values corresponding to the plurality of layers of output layers;
and optimizing the initial model according to the loss values to obtain a classification model.
4. The method of any of claims 1-3, wherein the multi-layer output layer is a three-layer output layer, wherein the first layer is a word embedding layer plus bi-directional LSTM; the second layer is a unidirectional LSTM; and a third layer: a CNN model.
5. A text relation classification method is characterized by comprising the following steps:
acquiring a target text;
inputting the target text into a pre-trained classification model to obtain a text relation classification result of the target text, wherein the classification model is generated by the method of any one of claims 1 to 4.
6. An apparatus for generating a classification model, comprising:
the acquisition module is configured to acquire a training sample set, wherein training samples in the training sample set comprise text samples and text relation classification result samples corresponding to the text samples;
and the training module is configured to perform joint learning training on an initial model according to the training sample set to obtain a classification model, wherein the initial model comprises a plurality of output layers.
7. The apparatus for generating a classification model of claim 6, comprising: the training module comprises:
the result obtaining module is used for inputting the text samples in the training samples into an initial model to obtain an output result corresponding to each output layer of the initial model;
the loss value acquisition module is used for respectively determining the difference between the expected output and the output result of each layer of output layer based on a preset loss function to obtain a plurality of loss values corresponding to the plurality of layers of output layers;
and the classification model obtaining module is used for optimizing the initial model according to the loss values to obtain a classification model.
8. A text relation classification apparatus, comprising:
a target text acquisition module configured to acquire a target text;
a classification module configured to input the target text into a pre-trained classification model to obtain a text relationship classification result of the target text, wherein the classification model is generated by the method according to any one of claims 1 to 4.
9. An electronic device, comprising:
one or more processors;
a storage device having one or more programs stored thereon,
when executed by the one or more processors, cause the one or more processors to implement the method of any one of claims 1-4 or the method of claim 5.
10. A computer readable medium, having a computer program stored thereon, wherein the program, when executed by a processor, implements the method of any one of claims 1-4, or implements the method of claim 5.
CN202011282096.7A 2020-11-16 2020-11-16 Method for generating classification model and method and device for classifying text relation Pending CN112417151A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011282096.7A CN112417151A (en) 2020-11-16 2020-11-16 Method for generating classification model and method and device for classifying text relation

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011282096.7A CN112417151A (en) 2020-11-16 2020-11-16 Method for generating classification model and method and device for classifying text relation

Publications (1)

Publication Number Publication Date
CN112417151A true CN112417151A (en) 2021-02-26

Family

ID=74832721

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011282096.7A Pending CN112417151A (en) 2020-11-16 2020-11-16 Method for generating classification model and method and device for classifying text relation

Country Status (1)

Country Link
CN (1) CN112417151A (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP3185184A1 (en) * 2015-12-21 2017-06-28 Aiton Caldwell SA The method for analyzing a set of billing data in neural networks
US20200034482A1 (en) * 2018-07-26 2020-01-30 International Business Machines Corporation Verifying and correcting training data for text classification
CN111046673A (en) * 2019-12-17 2020-04-21 湖南大学 Countermeasure generation network for defending text malicious samples and training method thereof
US20200142999A1 (en) * 2018-11-02 2020-05-07 Valve Corporation Classification and moderation of text
CN111354345A (en) * 2020-03-11 2020-06-30 北京字节跳动网络技术有限公司 Method, apparatus, device and medium for generating speech model and speech recognition

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP3185184A1 (en) * 2015-12-21 2017-06-28 Aiton Caldwell SA The method for analyzing a set of billing data in neural networks
US20200034482A1 (en) * 2018-07-26 2020-01-30 International Business Machines Corporation Verifying and correcting training data for text classification
US20200142999A1 (en) * 2018-11-02 2020-05-07 Valve Corporation Classification and moderation of text
CN111046673A (en) * 2019-12-17 2020-04-21 湖南大学 Countermeasure generation network for defending text malicious samples and training method thereof
CN111354345A (en) * 2020-03-11 2020-06-30 北京字节跳动网络技术有限公司 Method, apparatus, device and medium for generating speech model and speech recognition

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
沈利香;曹国;: "基于数据挖掘的入侵检测多分类模型研究", 常州工学院学报, no. 06 *
沈利香;曹国;: "基于数据挖掘的入侵检测多分类模型研究", 常州工学院学报, no. 06, 28 December 2011 (2011-12-28) *

Similar Documents

Publication Publication Date Title
CN111354345B (en) Method, apparatus, device and medium for generating speech model and speech recognition
CN112684968A (en) Page display method and device, electronic equipment and computer readable medium
CN111857720A (en) Method and device for generating user interface state information, electronic equipment and medium
CN113468344B (en) Entity relationship extraction method and device, electronic equipment and computer readable medium
CN111309304A (en) Method, device, medium and electronic equipment for generating IDL file
CN112257459B (en) Language translation model training method, translation method, device and electronic equipment
CN109840072B (en) Information processing method and device
CN112732302A (en) Configuration updating method and device of application program and electronic equipment
CN112200183A (en) Image processing method, device, equipment and computer readable medium
CN111324470A (en) Method and device for generating information
CN111026849A (en) Data processing method and device
CN112417151A (en) Method for generating classification model and method and device for classifying text relation
CN115310582A (en) Method and apparatus for training neural network models
CN111309323A (en) Parameter initialization method and device and electronic equipment
CN112464039A (en) Data display method and device of tree structure, electronic equipment and medium
CN111797263A (en) Image label generation method, device, equipment and computer readable medium
CN111338621A (en) Data display method and device, electronic equipment and computer readable medium
CN113077353B (en) Method, device, electronic equipment and medium for generating nuclear insurance conclusion
CN115374320B (en) Text matching method and device, electronic equipment and computer medium
CN115098647B (en) Feature vector generation method and device for text representation and electronic equipment
CN115328811B (en) Program statement testing method and device for industrial control network simulation and electronic equipment
CN115392374A (en) Radar intra-pulse modulation signal identification method and device, electronic equipment and medium
CN117688236A (en) Method and device for pushing article description information, electronic equipment and computer medium
CN113760254A (en) Data model generation method and device, electronic equipment and computer readable medium
CN113486982A (en) Model training method and device and electronic equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination