A method for generating a classification model, a text relationship classification method and a device

Through joint learning and training of the initial model, a multi-layer output layer classification model is generated, which solves the problem of low accuracy of text relationship classification caused by insufficient number of samples in the existing technology, and achieves simplification of the training process and improvement of classification accuracy. .

CN112417151BActive Publication Date: 2024-10-29新奥新智科技有限公司
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
CN202011282096.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-11-16
Publication Date
2024-10-29
Estimated Expiration
2040-11-16

AI Technical Summary

Technical Problem

Insufficient number of samples during the training process of existing classification models or simplification of the training process will lead to a decrease in the accuracy of text relationship classification results, making it difficult to improve the training efficiency and accuracy of the classification model.

Method used

By obtaining a training sample set, including text samples and text relationship classification result samples, the initial model is jointly learned and trained to generate a classification model, and multi-layer output layers are used for training to simplify the training process and improve classification accuracy.

Benefits of technology

It achieves the simplification of the training process and improves the accuracy of the classification model in classifying text relationships, improving the accuracy of classification results and user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112417151B_ABST
    Figure CN112417151B_ABST
Patent Text Reader

Abstract

The embodiment disclosed in the present invention discloses a method for generating a classification model, a method and a device for classifying text relations, and a specific implementation of the method includes: obtaining a training sample set, wherein the training samples in the training sample set include text samples and text relationship classification result samples corresponding to the text samples; and performing joint learning training on an initial model according to the training sample set to obtain a classification model, wherein the initial model includes multiple output layers. This implementation simplifies the training process and improves the accuracy of the text relationship classification results generated by the classification model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments disclosed in the present invention relate to the field of computer technology, and in particular to a method for generating a classification model, a method and a device for classifying text relations. Background Art

[0002] With the advancement of data processing technology and the rapid popularization of mobile Internet, computer technology has been widely used in various fields of society, and with it comes the generation of massive data. Among them, text data has received more and more attention.

[0003] Generally, the accuracy of the text relationship classification results of the classification model is closely related to the number of samples in the classification model training process. Reducing the number of samples or simplifying the training process will often reduce the accuracy of the text relationship classification results. Therefore, the training process of the classification model is more cumbersome, and the accuracy of the text relationship classification results of the classification model is difficult to improve. Summary of the invention

[0004] The content of the present invention is used to introduce the concepts in a brief form, which will be described in detail in the detailed implementation section below. The content of the present invention is not intended to identify the key features or essential features of the technical solution claimed for protection, nor is it intended to limit the scope of the technical solution claimed for protection.

[0005] Some embodiments disclosed in the present invention propose a method for generating a classification model, a method, device, electronic device and computer-readable medium for classifying text relations to solve the technical problems mentioned in the above background technology section.

[0006] In a first aspect, some embodiments disclosed in the present invention provide a method for generating a classification model, the method comprising:

[0007] Acquire a training sample set, wherein the training samples in the training sample set include text samples and text relationship classification result samples corresponding to the text samples;

[0008] According to the training sample set, the initial model is jointly learned and trained to obtain a classification model, wherein the initial model includes multiple output layers.

[0009] In a second aspect, some embodiments disclosed in the present invention provide a text relationship classification method, the method comprising:

[0010] Get the target text;

[0011] The target text is input into a pre-trained classification model to obtain a text relationship classification result of the target text, wherein the classification model is generated by a method as described in one of the above embodiments.

[0012] In a third aspect, some embodiments disclosed in the present invention provide a device for generating a classification model, the device comprising:

[0013] An acquisition module is configured to acquire a training sample set, wherein the training samples in the training sample set include text samples and text relationship classification result samples corresponding to the text samples;

[0014] The training module is configured to perform joint learning training on the initial model according to the training sample set to obtain a classification model, wherein the initial model includes multiple output layers.

[0015] In a fourth aspect, some embodiments disclosed in the present invention provide a text relationship classification device, the device comprising:

[0016] A target text acquisition module is configured to acquire a target text;

[0017] The classification module is 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 described in one of the above embodiments.

[0018] In a fifth aspect, an embodiment of the present application provides an electronic device, the electronic device comprising:

[0019] one or more processors;

[0020] A storage device for storing one or more programs;

[0021] When one or more programs are executed by one or more processors, the one or more processors implement the method described in any implementation manner of the first aspect or the second aspect.

[0022] In a sixth aspect, an embodiment of the present application provides a computer-readable medium having a computer program stored thereon, which, when executed by a processor, implements the method described in any implementation manner in the first aspect or the second aspect.

[0023] The method for generating a classification model provided by one of the above-mentioned embodiments disclosed in the present invention has at least the following beneficial effects: first, a training sample set is obtained, and then the initial model is jointly learned and trained according to the training sample set to obtain a classification model. Because the text samples in the above-mentioned training sample set match the text relationship classification result samples in the above-mentioned training sample set, the classification model obtained after training is more accurate. The process of training the initial model using the joint learning training method is simpler, requires fewer samples, and is more flexible, so that the present invention discloses the simplification of the training process and the improvement of the classification accuracy of the classification model for text relationships.

[0024] The text relationship classification method provided by one of the above embodiments disclosed in the present invention has at least the following beneficial effects: first, a target text is obtained, and then the target text is input into a pre-trained classification model to obtain a text relationship classification result of the target text. The trained classification model is used to make the text relationship classification result of the target text more accurate, thereby improving the accuracy of the text relationship classification result and improving the user experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0025] The above and other features, advantages and aspects of the embodiments disclosed in the present invention will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the accompanying drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and that components and elements are not necessarily drawn to scale.

[0026] Figure 1 It is a schematic diagram of application scenarios of some embodiments of the method for generating a classification model disclosed in the present invention;

[0027] Figure 2 is a flowchart of some embodiments of the method for generating a classification model disclosed in the present invention;

[0028] Figure 3 is a schematic diagram of the structure of an initial model according to some embodiments disclosed in the present invention;

[0029] Figure 4 is a flowchart of some embodiments of the text relationship classification method disclosed in the present invention;

[0030] Figure 5 is a schematic diagram of the structure of some embodiments of the device for generating a classification model disclosed in the present invention;

[0031] Figure 6 is a schematic diagram of the structure of some embodiments of the text relationship classification device disclosed in the present invention;

[0032] Figure 7 It is a schematic diagram of the structure of some embodiments of the electronic device suitable for implementing the disclosure of the present invention. DETAILED DESCRIPTION

[0033] The embodiments disclosed in the present invention will be described in more detail below with reference to the accompanying drawings. Although certain embodiments disclosed in the present invention are shown in the accompanying drawings, it should be understood that the present invention can be implemented in various forms and should not be construed as being limited to the embodiments described herein. On the contrary, these embodiments are provided to provide a more thorough and complete understanding of the present invention. It should be understood that the drawings and embodiments disclosed in the present invention are only for exemplary purposes and are not intended to limit the scope of protection disclosed in the present invention.

[0034] It should also be noted that, for ease of description, only the parts related to the invention are shown in the drawings. In the absence of conflict, the embodiments and features in the embodiments disclosed in the present invention can be combined with each other.

[0035] It should be noted that the concepts such as "first" and "second" mentioned in the disclosure of the present invention are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.

[0036] It should be noted that the modifications of "one" and "plurality" mentioned in the disclosure of the present invention are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, it should be understood as "one or more".

[0037] The names of the messages or information exchanged between multiple devices in the disclosed embodiments of the present invention are only used for illustrative purposes and are not used to limit the scope of these messages or information.

[0038] The present invention will be described in detail below with reference to the accompanying drawings and in conjunction with embodiments.

[0039] Figure 1 It is a schematic diagram of an application scenario of the survival classification model method according to some embodiments disclosed in the present invention.

[0040] like Figure 1 As shown, first, the server 101 can obtain the training sample set 102 from local pre-storage or network download. Here, the training sample set 102 includes a text sample 1021 and a text relationship classification result sample 1022 corresponding to the text sample 1021. Afterwards, the server 101 can perform joint learning training on the initial model 103 according to the training sample set 102 to obtain the classification model 104.

[0041] It is understandable that the method for generating a classification model can be executed by the server 101, or it can also be executed by a terminal device. The execution subject of the above method can also include a device formed by integrating the above server 101 and the above terminal device through a network, or it can also be executed by various software programs. Among them, the terminal device can be various electronic devices with information processing capabilities, including but not limited to smart phones, tablet computers, e-book readers, laptop portable computers and desktop computers, etc. When the execution subject is software, it can be installed in the electronic devices listed above. It can be implemented as multiple software or software modules for providing distributed services, for example, or it can be implemented as a single software or software module. No specific limitation is made here.

[0042] It should be understood that Figure 1 The number of servers in the example is only for illustration purposes. Any number of servers may be provided as required.

[0043] Continue to refer Figure 2 , shows a process 200 of some embodiments of generating a classification model and a text relationship classification method disclosed in the present invention. The generating classification model and the text relationship classification method include the following steps:

[0044] Step 201: Obtain a training sample set.

[0045] In some embodiments, the execution body of the method for generating a classification model (eg Figure 1 The server shown in the figure can obtain the training sample set by downloading from the 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 the process of classifying text (or entity) relationships according to a certain classification system or standard.

[0046] Step 202: Perform joint learning training on the initial model according to the training sample set to obtain a classification model, wherein the initial model includes multiple output layers.

[0047] In some embodiments, based on the training sample set obtained in step 201, the execution subject may perform joint learning training on the initial model according to the training samples to obtain a classification model. The initial model includes multiple output layers.

[0048] Here, the joint learning in the above joint learning training usually refers to a type of multi-task learning (MTL).

[0049] In this embodiment, the initial model can be various existing neural network models created based on machine learning technology. The neural network model can have various existing neural network structures. As an example, the multi-layer output layer can be a two-layer output layer, the first output layer is composed of a word embedding layer, a long short-term memory network (LSTM) and a first output layer; the second output layer is composed of a word embedding layer, a bidirectional long short-term memory network (LSTM), a unidirectional long short-term memory network (LSTM) and a second output layer. Here, the long short-term memory network can be multi-layer.

[0050] In some optional implementations of some embodiments, the text relationship classification result sample includes: each output layer in the multiple output layers of the initial model corresponds to the expected output of the text sample.

[0051] In some optional implementations of some embodiments, the text samples in the training samples can be input into the initial model to obtain the output results corresponding to each output layer of the initial model. Afterwards, based on a preset loss function, the difference between the expected output and the output result of each output layer is determined respectively to obtain multiple loss values ​​corresponding to the multiple output layers. The initial model is then optimized according to the multiple loss values ​​to obtain a classification model.

[0052] Specifically, the execution entity can analyze the output results of each output layer and the expected output of the corresponding output layer, so as to determine the loss value. For example, the output result and the above-mentioned expected output can be used as parameters and input into the specified loss function, so as to calculate the loss value between the two. Afterwards, the relevant parameters of the model are adjusted according to the determined loss value. Here, the loss function is usually used to measure the degree of inconsistency between the predicted value (such as the output result) of the model and the true value (such as the expected output result). 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 can be set according to actual needs. It should be noted that the loss functions of the above-mentioned multiple output layers are usually different.

[0053] In some optional implementations of some embodiments, the multi-layer output layer is a three-layer output layer, wherein the first layer is a word embedding layer plus a bidirectional LSTM; the second layer is a unidirectional LSTM; and the third layer: a CNN model.

[0054] For example Figure 3 As shown in the schematic diagram of the initial model, the first output layer of the initial model is composed of a word embedding layer (wordembedding), a bidirectional long short-term memory network (LSTM) and a first output layer connected in sequence; the second output layer is composed of a word embedding layer, a bidirectional long short-term memory network, and a unidirectional long short-term memory network connected in sequence; the third output layer is composed of a word embedding layer, a bidirectional long short-term memory network, a unidirectional long short-term memory network and a convolutional neural network (CNN) connected in sequence. Here, the above-mentioned long short-term memory network can be multi-layered.

[0055] One of the above-mentioned embodiments disclosed in the present invention has the following beneficial effects: first, a training sample set is obtained, and then the initial model is jointly learned and trained according to the training sample set to obtain a classification model. Because the text samples in the above-mentioned training sample set match the text relationship classification result samples in the above-mentioned training sample set, the classification model obtained after training is more accurate. The process of training the initial model using the joint learning training method is simpler, the number of samples required is smaller, and it is more flexible, so that the present invention discloses the simplification of the training process and the improvement of the classification accuracy of the classification model for text relationships.

[0056] Further references Figure 4 , which shows a process 400 of some embodiments of the text relationship classification method disclosed in the present invention. The process 400 of the text relationship classification method includes the following steps:

[0057] Step 401, obtaining the target text.

[0058] In some embodiments, the execution subject of the text relationship classification method can obtain the target text from local pre-storage or network download, etc. Here, the above target text generally refers to the text that the user needs to perform text relationship classification.

[0059] It is understandable that the text relationship classification method can be executed by a server, or it can also be executed by a terminal device. The execution subject of the above method can also include a device formed by integrating the above server and the above terminal device through a network, or it can also be executed by various software programs. Among them, the terminal device can be various electronic devices with information processing capabilities, including but not limited to smart phones, tablet computers, e-book readers, laptop computers and desktop computers, etc. When the execution subject is software, it can be installed in the electronic devices listed above. It can be implemented as multiple software or software modules for providing distributed services, for example, or it can be implemented as a single software or software module. No specific limitation is made here.

[0060] Step 402: input the target text into a pre-trained classification model to obtain a text relationship classification result of the target text.

[0061] In some embodiments, the execution entity may 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 a method such as one of the above-mentioned embodiments.

[0062] One of the above embodiments disclosed in the present invention has the following beneficial effects: first, a target text is obtained, and then the target text is input into a pre-trained classification model to obtain a text relationship classification result of the target text. The trained classification model is used to make the text relationship classification result of the target text more accurate, thereby improving the accuracy of the text relationship classification result and improving the user experience.

[0063] Further references Figure 5 As an implementation of the methods shown in the above figures, the present invention discloses some embodiments of a device for generating a classification model. These device embodiments are similar to Figure 2 Corresponding to the method embodiments shown, the device can be specifically applied to various electronic devices.

[0064] like Figure 5 As shown, in some embodiments, the classification model generation device 500 includes:

[0065] An acquisition module 501 and a training module 502. The acquisition module 501 is configured to acquire a training sample set, wherein the 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 the initial model according to the training sample set to obtain a classification model, wherein the initial model includes multiple output layers.

[0066] In an optional implementation of some embodiments, the text relationship classification result sample includes: each output layer in the multiple output layers of the initial model corresponds to the expected output of the text sample.

[0067] In an optional implementation of some embodiments, the training module 502 of the classification model generating device 500 is further configured to: perform joint learning training on the initial model according to the training sample set to obtain the classification model, including:

[0068] A result acquisition module, used for inputting the text samples in the training samples into the initial model to obtain the output results corresponding to each output layer of the initial model;

[0069] A loss value acquisition unit, used to determine the difference between the expected output and the output result of each output layer based on a preset loss function, and obtain multiple loss values ​​corresponding to the multiple output layers;

[0070] A classification model acquisition module is used to optimize the initial model according to the multiple loss values ​​to obtain a classification model.

[0071] In an optional implementation of some embodiments, the multi-layer output layer is a three-layer output layer, wherein the first layer is a word embedding layer plus a bidirectional LSTM; the second layer is a unidirectional LSTM; and the third layer: a CNN model.

[0072] It is understandable that the modules described in the device 500 are similar to those described in the reference Figure 2 Therefore, the operations, features and beneficial effects described above for the method are also applicable to the device 500 and the modules contained therein, and will not be described in detail here.

[0073] One of the above-mentioned embodiments disclosed in the present invention has the following beneficial effects: first, a training sample set is obtained, and then the initial model is jointly learned and trained according to the training sample set to obtain a classification model. Because the text samples in the above-mentioned training sample set match the text relationship classification result samples in the above-mentioned training sample set, the classification model obtained after training is more accurate. The process of training the initial model using the joint learning training method is simpler, the number of samples required is smaller, and it is more flexible, so that the present invention discloses the simplification of the training process and the improvement of the classification accuracy of the classification model for text relationships.

[0074] Further references Figure 6 As an implementation of the methods shown in the above figures, the present invention discloses some embodiments of a text relationship classification device. These device embodiments are similar to Figure 4 Corresponding to the method embodiments shown, the device can be specifically applied to various electronic devices.

[0075] like Figure 6 As shown, some embodiments of the classification model generation device 600 include: 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; and 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, wherein the classification model is generated by a method as described in one of the above embodiments.

[0076] It is understandable that the modules described in the device 600 are similar to those described in the reference Figure 4 Therefore, the operations, features and beneficial effects described above for the method are also applicable to the device 600 and the modules contained therein, and will not be described in detail here.

[0077] One of the above embodiments disclosed in the present invention has the following beneficial effects: first, a target text is obtained, and then the target text is input into a pre-trained classification model to obtain a text relationship classification result of the target text. The trained classification model is used to make the text relationship classification result of the target text more accurate, thereby improving the accuracy of the text relationship classification result and improving the user experience.

[0078] Reference below Figure 7 , which shows an electronic device (eg, Figure 1 A schematic diagram of the structure of the server 700. Figure 7 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments disclosed in the present invention.

[0079] like Figure 7 As shown, the electronic device 700 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 701, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 702 or a program loaded from a storage device 708 into a random access memory (RAM) 703. In the RAM 703, various programs and data required for the operation of the electronic device 700 are also stored. The processing device 701, the ROM 702, and the RAM 703 are connected to each other via a bus 704. An input / output (I / O) interface 705 is also connected to the bus 704.

[0080] Typically, the following devices may be connected to the I / O interface 705: an input device 706 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 707 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 708 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 709. The communication device 709 may allow the electronic device 700 to communicate with other devices wirelessly or by wire to exchange data. Although Figure 7 The electronic device 700 is shown with various devices, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead. Figure 7 Each block shown in the figure may represent one device, or may represent multiple devices as required.

[0081] In particular, according to some embodiments disclosed in the present invention, the process described above with reference to the flowchart can be implemented as a computer software program. For example, some embodiments disclosed in the present invention include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In some such embodiments, the computer program can be downloaded and installed from the network through the communication device 709, or installed from the storage device 708, or installed from the ROM 702. When the computer program is executed by the processing device 701, the above-mentioned functions defined in the method of some embodiments disclosed in the present invention are executed.

[0082] It should be noted that the computer-readable medium described in some embodiments disclosed in the present invention may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, 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 disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In some embodiments disclosed in the present invention, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In some embodiments disclosed in the present invention, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. The computer readable signal medium may also be any computer readable medium other than a computer readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.

[0083] In some embodiments, the client and the server may communicate using any currently known or future developed network protocol such as HTTP (HyperText Transfer Protocol), and may be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any currently known or future developed network.

[0084] The above-mentioned computer-readable medium may be included in the above-mentioned electronic device; or it may exist independently without being assembled into the electronic device. The above-mentioned computer-readable medium carries one or more programs. When the above-mentioned one or more programs are executed by the electronic device, the electronic device: obtains a training sample set, wherein the training samples in the training sample set include text samples and text relationship classification result samples corresponding to the text samples; performs joint learning training on the initial model according to the training sample set to obtain a classification model, wherein the initial model includes multiple output layers. Or when the above-mentioned one or more programs are executed by the electronic device, the electronic device: obtains a target text; inputs 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 described in one of the above-mentioned embodiments.

[0085] Computer program code for performing the operations of some embodiments disclosed in the present invention may be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" language or similar programming languages. The program code may be executed entirely on a user's computer, partially on a user's computer, as an independent software package, partially on a user's computer, partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0086] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to the various embodiments disclosed in the present invention. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0087] The modules described in some embodiments disclosed in the present invention may be implemented by software or hardware. The modules described may also be set in a processor, for example, it may be described as: a processor includes an acquisition module and a training module. The names of these modules do not constitute a limitation on the modules themselves in some cases, for example, the acquisition module may also be described as a "module for acquiring a training sample set".

[0088] The functions described above herein 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 chips (SOCs), complex programmable logic devices (CPLDs), and the like.

[0089] The above descriptions are only some preferred embodiments disclosed in the present invention and the explanation of the technical principles used. Those skilled in the art should understand that the scope of the invention involved in the embodiments disclosed in the present invention is not limited to the technical solutions formed by the specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above inventive concept. For example, the above features are replaced with the technical features with similar functions disclosed in the embodiments disclosed in the present invention (but not limited to) to form a technical solution.

Claims

1. A method for generating a classification model, characterized in that: include: Acquire a training sample set, wherein the training samples in the training sample set include text samples and text relationship classification result samples corresponding to the text samples; According to the training sample set, the initial model is jointly learned and trained to obtain a classification model, wherein the initial model includes three output layers; wherein the first layer is composed of a word embedding layer and a bidirectional LSTM connected in sequence; the second layer is composed of a word embedding layer, a bidirectional LSTM, and a unidirectional LSTM connected in sequence; the third layer is composed of a word embedding layer, a bidirectional LSTM, a unidirectional LSTM and a CNN connected in sequence; the joint learning in the joint learning training refers to a type of multi-task learning; wherein the text samples in the training samples are input into the initial model to obtain the output results corresponding to each output layer of the initial model; based on a preset loss function, the difference between the expected output and the output result of each output layer is determined respectively to obtain multiple loss values ​​corresponding to the three output layers, and the initial model is optimized according to the multiple loss values ​​to obtain a classification model; The text relationship classification result samples include: Each of the three output layers of the initial model corresponds to the expected output of the text sample.

2. The method according to claim 1, characterized in that The method of performing joint learning training on the initial model according to the training sample set to obtain a classification model includes: Inputting the text samples in the training samples into the initial model to obtain the output results corresponding to each output layer of the initial model; Based on a preset loss function, respectively determine the difference between the expected output and the output result of each output layer to obtain a plurality of loss values ​​corresponding to the three output layers; The initial model is optimized according to the multiple loss values ​​to obtain a classification model.

3. A text relationship classification method, characterized in that: include: Get the target text; The target text is input 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 as described in any one of claims 1-2 above.

4. A device for generating a classification model, characterized in that: include: An acquisition module is configured to acquire a training sample set, wherein the training samples in the training sample set include text samples and text relationship classification result samples corresponding to the text samples; The training module is configured to perform joint learning training on the initial model according to the training sample set to obtain a classification model, wherein the initial model includes three output layers; wherein the first layer is composed of a word embedding layer and a bidirectional LSTM connected in sequence; the second layer is composed of a word embedding layer, a bidirectional LSTM, and a unidirectional LSTM connected in sequence; the third layer is composed of a word embedding layer, a bidirectional LSTM, a unidirectional LSTM and a CNN connected in sequence; the joint learning in the joint learning training refers to a type of multi-task learning; wherein the text samples in the training samples are input into the initial model to obtain the output results corresponding to each output layer of the initial model; based on a preset loss function, the difference between the expected output and the output result of each output layer is determined respectively to obtain multiple loss values ​​corresponding to the three output layers, and the initial model is optimized according to the multiple loss values ​​to obtain a classification model; The text relationship classification result samples include: Each of the three output layers of the initial model corresponds to the expected output of the text sample.

5. The device for generating a classification model according to claim 4, characterized in that: include: The training module includes: A result acquisition module, used for inputting the text samples in the training samples into the initial model to obtain the output results corresponding to each output layer of the initial model; A loss value acquisition module, used to determine the difference between the expected output and the output result of each output layer based on a preset loss function, and obtain multiple loss values ​​corresponding to the three output layers; A classification model acquisition module is used to optimize the initial model according to the multiple loss values ​​to obtain a classification model.

6. A text relationship classification device, characterized in that: include: A target text acquisition module is configured to acquire a target text; The classification module is 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 described in any one of claims 1-2 above.

7. An electronic device, characterized in that: include: one or more processors; a storage device having one or more programs stored thereon, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 2, or implement the method according to claim 3.

8. A computer readable medium having a computer program stored thereon, wherein: When the program is executed by a processor, the method according to any one of claims 1 to 2 is implemented, or the method according to claim 3 is implemented.

Citation Information

Patent Citations

  • Adversarial generative network for defending text malicious sample and training method thereof

    CN111046673A

  • Voice model generation method and device, voice recognition method and device, equipment and medium

    CN111354345A

  • The method for analyzing a set of billing data in neural networks

    EP3185184A1

  • Verifying and correcting training data for text classification

    US20200034482A1

  • Classification and moderation of text

    US20200142999A1