A method, system, device and storage medium for original text disassembly and label identification
By inputting the original file into the pre-trained model and pipeline model, combining the multi-label classification model and entity recognition model to identify the label and logical relationship in the declaration content, the problem of low automatic label recognition accuracy in the existing technology is solved, and higher recognition accuracy and model performance are achieved.
Patent Information
- Application Number
- CN202411110591.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-13
- Publication Date
- 2025-04-29
- Estimated Expiration
- 2044-08-13
AI Technical Summary
When the declaration content is expressed in a variety of ways and types of tags, it is difficult for the prior art to achieve high accuracy automatic tag recognition.
By inputting the original file into the pre-trained pre-trained model, the text label vector is obtained and inputting it into the pipeline model, combining the multi-label classification model, entity recognition model and multi-category classification model, the tags, entity BIO sequences and logical relationships of multiple categories, and finally the keywords and units are identified through the rule model.
It improves the label recognition range and accuracy of the original file, reduces the cost of training each task model separately, and improves the overall model performance.
Smart Images

Figure CN119025963B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of artificial intelligence technology, and in particular to a method, system, device and storage medium for original text disassembly and label recognition. Background Art
[0002] When releasing declaration information, the operation staff is responsible for sorting out the numerous declaration conditions, breaking down the corresponding labels for these declaration conditions, and accurately pushing declaration matters and declaration conditions to the enterprise after matching them with the enterprise matters. In actual projects, a large amount of disassembly work is done entirely manually, which is inefficient; and disassembly requires certain professional knowledge and experience accumulation, which increases the learning cost of the operation staff and makes it difficult to advance the work quickly.
[0003] In addition to the manual entry method, there are also some simple automated methods that realize the function of automatic filling in of some content, such as regular expression recognition and tag management. However, due to the diverse expressions of different content and the wide variety of tags, there are fewer contents that can be automatically recognized and the recognition accuracy is low. Summary of the invention
[0004] In view of this, the embodiments of the present application are committed to providing a method, system, device and storage medium for original text disassembly and label recognition, which are used to solve the problem that when the declared content is expressed in various ways and there are many types of labels, the automatically recognized content is small and the recognition accuracy is low.
[0005] According to a first aspect of the present invention, the present invention provides a method for original text decomposition and label recognition, comprising:
[0006] Input the original file into the pre-trained model to obtain the text label vector;
[0007] Input the text label vector into a pre-trained pipeline model to obtain labels of multiple categories, entity BIO sequences, and logical relationships in each label, respectively. The pipeline model includes a multi-label classification model, an entity recognition model, and a multi-category classification model;
[0008] The rule model is used to perform keyword recognition and unit recognition on the labels of the multiple categories, the entity BIO sequence and the logical relationship in each label to obtain a recognition result.
[0009] Preferably, the training of the pre-trained model includes:
[0010] Using the training data as the input of the pre-training model and the text label vector as the output of the pre-training model;
[0011] The training data is composed of label data obtained by disassembling historical original file data.
[0012] Preferably, the training of the pipeline model includes:
[0013] Input the text label vector into the multi-label classification model, select the text label vector greater than a set threshold through the sigmoid function, and output labels of multiple categories;
[0014] The labels of the multiple categories are concatenated with the text label vector and input into the entity recognition model, and the entity BIO sequence of each label is output;
[0015] The labels of the multiple categories, the entity BIO sequence of each label and the text label vector are input into the multi-category classification model, and the logical relationship in each label is output.
[0016] Preferably, after inputting the text label vector into a pre-trained pipeline model to obtain labels of multiple categories, entity BIO sequences and logical relations in each label, the method further includes:
[0017] Calculate a first loss function based on the multiple labels through BCE1oss;
[0018] Calculate a second loss function through CRF based on the entity BIO sequence;
[0019] Calculate a third loss function through CrossEntropyLoss based on the logical relationship;
[0020] Based on the back propagation of the first loss function, the second loss function and the third loss function, the pipeline model parameters are updated.
[0021] Preferably, updating the pipeline model parameters based on the back propagation of the first loss function, the second loss function and the third loss function comprises:
[0022] Respectively weighting and summing the first loss function, the second loss function, and the third loss function to obtain a total loss function;
[0023] Back-propagation is performed on the pipeline model based on the total loss function to update the pipeline model parameters.
[0024] Preferably, the step of performing keyword recognition and unit recognition on the labels of the multiple categories, the entity BIO sequence and the logical relationship in each label by using a rule model to obtain a recognition result further includes:
[0025] Using the rule model, the labels of the multiple categories, the entity BIO sequence and the logical relationship in each label are subjected to keyword recognition and the logical relationship field is corrected to obtain a corrected relationship word result;
[0026] Unit recognition is performed through the maximum matching algorithm to obtain the recognition unit result.
[0027] Preferably, the unit identification is performed by using a maximum matching algorithm, and after obtaining the identification unit result, the method includes:
[0028] When special tags exist, convert them into standard tags;
[0029] Get the identification tag type based on the standard tag.
[0030] According to a second aspect of the present invention, there is also provided a system for original text disassembly and label identification, comprising:
[0031] Disassembly module, input the original file into the pre-trained pre-trained model to obtain the text label vector;
[0032] An acquisition module inputs the text label vector into a pre-trained pipeline model to obtain labels of multiple categories, entity BIO sequences, and logical relationships in each label, respectively. The pipeline model includes a multi-label classification model, an entity recognition model, and a multi-category classification model;
[0033] The recognition module is used to perform keyword recognition and unit recognition on the labels of the multiple categories, the entity BIO sequence and the logical relationship in each label through a rule model to obtain a recognition result.
[0034] According to a third aspect of the present invention, there is also provided an electronic device, comprising a processor and a memory, wherein the memory stores computer executable instructions that can be executed by the processor, and the processor executes the computer executable instructions to implement the original text decomposition and label recognition method.
[0035] According to a fourth aspect of the present invention, a computer-readable storage medium is also provided, wherein the computer-readable storage medium stores computer-executable instructions. When the computer-executable instructions are called and executed by a processor, the computer-executable instructions prompt the processor to implement the original text disassembly and label recognition method.
[0036] According to the first aspect of the present invention, by inputting the original file into the pre-trained model to obtain a text label vector as the input of the subsequent pipeline model, and combining the multi-label classification model, the entity recognition model and the multi-classification model to form a pipeline model, the underlying features of the model can be shared and the overall performance of the model can be improved. At the same time, the output of each step in the pipeline model is the input of the next step, reducing the cost of training each task model separately, and then the unit of each label in the original file is identified through the output of each model in the pipeline model, thereby improving the scope and accuracy of identifying the original file. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] Figure 1 A schematic flow chart of a method for original text decomposition and tag identification according to an embodiment of the present invention is shown;
[0038] Figure 2 A flowchart of model training according to an embodiment of the present invention is shown;
[0039] Figure 3 A schematic flow chart of a system for original text disassembly and label identification according to an embodiment of the present invention is shown. DETAILED DESCRIPTION
[0040] In order to make the above-mentioned purposes, characteristic vectors and advantages of the present application more obvious and easy to understand, the specific implementation methods of the present application are described in detail below in conjunction with the accompanying drawings. It is understandable that the specific embodiments described herein are only used to explain the present application, rather than to limit the present application. It should also be noted that, for ease of description, only part of the structure related to the present application is shown in the accompanying drawings, rather than all of the structures. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.
[0041] The terms "including" and "having" and any variations thereof in this application are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device comprising a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to these processes, methods, products or devices.
[0042] Reference to "embodiment" herein means that a particular feature vector, structure or characteristic described in conjunction with the embodiment may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0043] Figure 1 FIG. 2 shows a schematic flow chart of a method for text decomposition and tag identification according to an embodiment of the present invention. Figure 1 As shown, a method for original text decomposition and label recognition includes:
[0044] Step S100, inputting the original file into a pre-trained model to obtain a text label vector;
[0045] Step S200, inputting the text label vector into a pre-trained pipeline model to obtain labels of multiple categories, entity BIO sequences and logical relationships in each label, respectively. The pipeline model includes a multi-label classification model, an entity recognition model and a multi-category classification model;
[0046] Step S300, using a rule model to perform keyword recognition and unit recognition on multiple categories of tags, entity BIO sequences and logical relationships in each tag to obtain recognition results.
[0047] By inputting the original file into the pre-trained model to obtain the text label vector as the input of the subsequent pipeline model, and combining the multi-label classification model, entity recognition model and multi-classification model to form a pipeline model, the underlying features of the model can be shared to improve the overall performance of the model. At the same time, the output of each step in the pipeline model is the input of the next step, reducing the cost of training each task model separately. The unit of each label in the original file is then identified through the output of each model in the pipeline model, which improves the scope and accuracy of identifying the original file.
[0048] In step S100, the training of the pre-trained model includes:
[0049] The training data is used as the input of the pre-trained model, and the text label vector is used as the output of the pre-trained model;
[0050] The training data consists of label data obtained by disassembling the historical original file data.
[0051] By training the pre-trained model, all the label tags in the file are obtained to provide input data for the subsequent processing model.
[0052] In step S200, the training of the pipeline model includes:
[0053] Input the text label vector into the multi-label classification model, select the text label vector greater than the set threshold through the sigmoid function, and output multiple category labels;
[0054] The labels of multiple categories are concatenated with the text label vector and input into the entity recognition model, and the entity BIO sequence of each label is output;
[0055] The labels of multiple categories, the entity BIO sequence of each label and the text label vector are input into the multi-category classification model, and the logical relationship of each label is output.
[0056] There are multiple labels in the text label vector, all of which are input into the multi-label classification model. The labels are filtered through the sigmod function. By setting a threshold, labels less than the threshold are excluded to obtain target labels of multiple categories. The labels of multiple categories are input into the second-step entity recognition model of the pipeline model together with the text label vector output by the pre-trained model to obtain the entity BIO sequence corresponding to each label. The entity BIO sequence includes the label value. The entity BIO sequence of each label and the text label vector output by the pre-trained model are then input into the multi-category classification model together to obtain the logical relationship of each label, including greater than, less than, more and less. The output of each model in the pipeline model is input into the next model together with the output of the pre-trained model, which reduces the cost of training each task model. Each task model shares the underlying features and improves the performance of the overall model.
[0057] In step S200, after the text label vector is input into the pre-trained pipeline model to obtain labels of multiple categories, entity BIO sequences and logical relations in each label, the following steps are also included:
[0058] Step S210, calculating a first loss function by BCEloss based on multiple labels;
[0059] Step S220, calculating a second loss function through CRF based on the entity BIO sequence;
[0060] Step S230, calculating a third loss function through CrossEntropyLoss based on the logical relationship;
[0061] Step S240: Update pipeline model parameters based on back propagation of the first loss function, the second loss function, and the third loss function.
[0062] Since the output of the previous step will affect the prediction result of the next step, the loss function will be small only when the results of all three steps are correct. The loss functions of the three stages will backpropagate and affect the parameters of the entire model, thereby ensuring the overall accuracy of the model.
[0063] In step S240, based on the back propagation of the first loss function, the second loss function and the third loss function, the pipeline model parameters are updated, including:
[0064] Step S241, weighting and summing the first loss function, the second loss function and the third loss function respectively to obtain a total loss function;
[0065] Step S242, back-propagating the pipeline model based on the total loss function to update the pipeline model parameters.
[0066] Since the content weights of the three models’ outputs are different, the loss function of each step is weighted, and the total loss function is obtained by summing up the weights. The total loss function is used to backpropagate the model, thereby improving the performance of each task.
[0067] In step S300, keyword recognition and unit recognition are performed on the labels of the multiple categories, the entity BIO sequence and the logical relationship through a rule model to obtain a recognition result, which also includes:
[0068] Step S310, performing keyword recognition on the labels of the multiple categories, the entity BIO sequence and the logical relationship through the rule model and correcting the logical relationship field to obtain a corrected relationship word result;
[0069] Step S320, performing unit recognition through a maximum matching algorithm to obtain a recognition unit result.
[0070] After the logical relationship is output, it is necessary to correct the logical relationship. For example, if the salary is higher than 3,000, the higher value needs to be corrected and the rule model needs to be set according to actual needs.
[0071] In step S300, after the unit recognition is performed by the maximum matching algorithm and the recognition unit result is obtained, the following steps are included:
[0072] When special tags exist, convert them into standard tags;
[0073] Get the identification tag type based on the standard tag.
[0074] Figure 2 FIG. 4 shows a flow chart of model training according to an embodiment of the present invention; Figure 2 As shown in the figure, in consideration of accelerating the training of the model, the pre-trained language model and the pipeline model are shared to form the AI model, wherein the output of the pre-trained language model is not back-propagated, and only the downstream model network weights are updated. The pipeline model includes a multi-label classification model, an entity recognition model, and a multi-category classification model. Because the pre-trained language model and the pipeline model are shared, different flow processes are presented during training and prediction. The input of the combined model is the conditional content of the matter, and the output of the combined model is the label, relationship, attribute value, and unit.
[0075] First, the pre-trained model is trained with training data. The training data is sorted out according to a unified template and the manually disassembled fields are used as label data. At the same time, the training data of the model includes: scene, name, matter, condition content, label (label name, relationship, attribute value, unit), condition json (JavaScriptObject Notation), label json. The output result is used as the input of the pipeline model.
[0076] The following shows some of the pre-trained model network structure codes for obtaining text label vectors:
[0077]
[0078]
[0079] The following shows the multi-label classification model network structure:
[0080] Multi-label classification models identify the label categories in training samples;
[0081] For example, the tag category is: Employers refer to enterprises, social groups, and industry organizations that are legally registered, pay taxes, and conduct statistical registration in the Economic Development Zone, ′[{″tagname″:"Registration address″, ″tagrelationname″:″equal to", ″tagvalue″:″Economic Development Zone", ″unitname″:″″}, {″tagname″:"Enterprise type", ″tagrelationname"":″equal to", ″tagvalue"′:"Social groups, industry organizations", ″unitname″:″″}]′);
[0082] Then, by splicing with the output results of the pre-trained model, we can obtain label results of multiple categories. Some data of label results of multiple categories are as follows:
[0083] BaseModelOutputWithPoolingAndCrossAttentions(pooler_output=tensor([[0.8893, 0.8644, 0.7737, 0.921 6, 0.7522, -0.3759, -0.5978, 0.8823, 0.7901, -0.9008, 0.9934, 0.8257, 0.6871, -0.9333, 0.6958, -0.9626, 0.9 767, 0.9820, -0.8691, -0.1862, 0.9881, -0.9465, -0.9933, -0.4051, 0.9924, 0.3346, -0.9150, -0.9543, -0.5528, -0.9507, -0.9418, 0.8268, 0.8658, -0.2260, -0.9766, -0.9839, 0.7749, 0.9747, 0.9666, -0.8846, -0.8731, -0. 6104, -0.2078, -0.5268, -0.0405, -0.2849, -0.9535, 0.8346, -0.9495, 0.6220, 0.9721, 0.9861, 0.8113, 0.4472, 0.2020, 0.3399, 0.9006, -0.9909, 0.6071, -0.9800, -0.1366, 0.9881, -0.8702, 0.9378, 0.9952, -0.5322, 0.995 0, -0.2296, -0.8709, -0.9578, 0.9906, 0.9218, 0.9495, -0.9174, -0.9782, -0.2278, 0.9205, 0.9758, -0.6386, 0 .4315, 0.0312]]), hidden_states=None, past_key_values=None, attentions=None, cross_attentions=None).
[0084] The above output enters MultiSequenceClassification and gets two parts:
[0085] BCELoss: tensor(0.6804, grad_fn= <binarycrossentropywithlogitsbackward>) and the corresponding multi-label classification results Logits are obtained after the sigmoid function: tensor([[-0.4715, 0.4952, -0.9875, 0.2991, -0.4259, -0.5382, 0.2382, 0.9494, -0.0938, 0.1086, 0.6237, -0.8516, 0.2809, 0.0291, -0.1804, -0.1838, 0.3329, -0.5700, -0.5031]],
[0086]
[0087] The entity recognition model identifies entity BIO sequences in the label results of multiple categories, and obtains entity BIO sequence results by splicing the pre-trained model with the text label vector output by the pre-trained model. Some data of the entity BIO sequence results are as follows:
[0088] BaseModelOutputWithPoolingAndCrossAttentions(1ast_hidden_state=tensor([[[-0.3270, 0.0431, 0.7523, ..., -0.0309, -0.6253, -0.3638],
[0089] [-0.5422, -0.0053, -0.4489, ..., -0.4358, -0.4571, -0.5714],
[0090] [0.3469, 0.3796, 0.3477, ..., 0.4945, -0.2304, -0.4743],
[0091] …,
[0092] [-0.0626, 0.1609, 0.6945, ..., 0.2450, -0.5212, -0.2431],
[0093] [0.2063, 0.6332, 0.3359, …, -1.0599, 0.5836, -0.5826],
[0094] [0.8046, 0.2273, 0.9056, ..., -0.0219, 0.7934, -0.2548], ...,
[0095] [0.0832, 0.0718, 0.2939, ..., -0.4500, -0.2400, -0.1674],
[0096] [0.5060, -0.5231, 0.1164, ..., 0.2268, -0.0583, -0.2664],
[0097] [-0.0626, 0.1609, 0.6945, ..., 0.2450, -0.5212, -0.2431]]]),
[0098] ), hidden_states=None, past_key_values=None, attentions=None, cross_attentions=None).
[0099] The above output enters the entity recognition model and gets two parts:
[0100] CRFLoss tensor(46.6679, grad_fn=<MulBackward0>)
[0101] Output: tensor([[[0.0622, 0.0047, -0.0431],
[0102] [0.0496, 0.0131, -0.0041],
[0103] [0.0411, 0.0219, 0.0262],
[0104] [0.0311, -0.0191, 0.0433],
[0105] [0.0421, -0.0135, -0.0467],
[0106] [0.0027, -0.0037, 0.0215],
[0107] [0.0228, 0.0207, -0.0328],
[0108] [0.0192, -0.0235, 0.0367],
[0109] [0.0137, -0.0191, -0.0379],
[0110] [0.0275, -0.0166, 0.0242],
[0111] [0.0163, 0.0357, 0.0077],
[0112] [-0.0272, -0.0217, -0.0051],
[0113] [0.0302, 0.0 186, -0.0260]]], grad_fn=<AddBackward0>).
[0114] The following shows the network structure code of the multi-category classification model:
[0115] SingleSequenceClassification
[0116] (dropout): Dropout (p=0.4, inplace=False)
[0117] (classifier): Linear(in_features=256, out_features=6, bias=Trrue)
[0118] ).
[0119] The multi-category classification model is used to identify the label results of multiple categories and the logical relationship in the entity BIO sequence. The logical relationship results are obtained through the text label vector output by the pre-trained model. The data of the logical relationship results are as follows:
[0120] tensor([[[-0.0000,-0.0676,-0.0000,...,-0.0000,-0.0000,0.0000],
[0121] [-0.0219, -0.0977, -0.0000, ..., -0.1095, -0.0580, 0.0540],
[0122] [-0.0000, -0.1146, -0.1239, ..., -0.1218, -0.0456, 0.0000],
[0123] …,
[0124] [-0.0812, -0.0000, -0.0000, ..., -0.0722, 0.0108, 0.0620],
[0125] [-0.1004, -0.0000, -0.1305, ..., -0.0551, -0.0000, 0.0000],
[0126] [-0.0912, -0.0000, -0.0963, ..., -0.0294, -0.0016, 0.0339]]],
[0127] grad_fn = <MulBackward0>)
[0128] The above output enters the multi-class classification model and gets two parts:
[0129] CELoss: tensor(2.2768, grad_fn=<NllLossBackward>)
[0130] Logits:tensor([[0.0046,-0.0319,-0.0612,1.1158,-0.3453,0.1607],
[0131] [-0.6443, 0.2519, -0.3218, 0.4470, -0.0615, 0.2947]],
[0132] grad_fn = <AddmmBackward>)
[0133] The biggest advantage of the pipeline model is that the output of the previous step will affect the prediction result of the next step. Only when the results of the three steps are correct can the loss be small, thereby ensuring the overall accuracy of the model. Therefore, when the pipeline model outputs the results, it is necessary to calculate the loss function and perform backpropagation. The loss function of the multi-label classification model is calculated by BCELoss (binary cross entropy loss), the loss function of the entity recognition model is calculated by CRF (conditional random field), and the loss function of the multi-category classification model is calculated by CrossEntropyLoss (cross entropy loss).
[0134] BCELoss calculates the loss function as shown below:
[0135]
[0136] Where: BCELoss is the binary cross entropy loss; N is the number of samples; y i is the actual label; p i is the predicted probability.
[0137] CRF calculates the loss function as shown below:
[0138] CRFLoss=-(score(x,y)-log∑ y′∈y(x) exp(score(x,y′)));
[0139] Where: CRFLoss is a conditional random field; x is the input sequence; y is the standard label sequence; y(x) is the set of all possible label sequences; score(x, y) is the score of the input sequence X and the label sequence y.
[0140] CrossEntropyLoss calculates the loss function as shown below:
[0141]
[0142] Where: CELoss is the cross entropy loss; N is the number of samples; C is the number of categories; yic is the actual label; pic is the probability of predicting belonging to category c.
[0143] The label results of multiple categories, entity BIO sequence results and logical relationship results are used as AI model recognition results. The AI model results are passed into the rule model for keyword recognition and keyword correction, including but not limited to greater than, more than, etc. At the same time, unit recognition is performed through the maximum matching algorithm to obtain recognition unit results. Since the maximum matching algorithm is for keywords or phrases, there may be the same prefix or suffix when listing, and one keyword may be part of another keyword, so the FMM forward maximum matching and BMM reverse maximum matching are combined for matching.
[0144] In addition, when special labels appear in the recognition results, additional post-processing is required to convert the special labels into standard results and produce the final output results.
[0145] Figure 3 FIG. 2 shows a schematic flow chart of a system for disassembling original text and identifying labels according to an embodiment of the present invention. Figure 3 As shown, in particular, a system for disassembling original text and identifying labels is also provided, including:
[0146] The disassembly module 810 inputs the original document into a pre-trained model to obtain a text label vector;
[0147] The acquisition module 820 inputs the text label vector into a pre-trained pipeline model to obtain labels of multiple categories, entity BIO sequences, and logical relationships in each label. The pipeline model includes a multi-label classification model, an entity recognition model, and a multi-category classification model.
[0148] The recognition module 830 is used to perform keyword recognition and unit recognition on multiple categories of tags, entity BIO sequences and logical relationships in each tag through a rule model to obtain recognition results.
[0149] In particular, an electronic device is also provided, the electronic device includes a processor and a memory, the memory stores computer executable instructions that can be executed by the processor, and the processor executes the computer executable instructions to implement the original text disassembly and label recognition method, for example, to execute the above-described Figure 1 The method comprises steps S100 to S300.
[0150] In particular, a computer-readable storage medium is also provided, wherein the computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are called and executed by a processor, the computer-executable instructions prompt the processor to implement the original text disassembly and label recognition method, for example, to execute the above-described Figure 1 The method comprises steps S100 to S300.
[0151] The processor is used to complete various control logics of the device, which can be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA), a single-chip microcomputer, an ARM (Acorn RISCMachine) or other programmable logic device, a discrete gate or transistor logic, a discrete hardware component, or any combination of these components. In addition, the processor can also be any traditional processor, microprocessor or state machine. The processor can also be implemented as a combination of computing devices, for example, a combination of a DSP and a microprocessor, a plurality of microprocessors, one or more microprocessors combined with a DSP and / or any other such configuration.
[0152] The memory may include a program storage area and a data storage area, wherein the program storage area may store an operating system and applications required for at least one function; the data storage area may store data created according to the use of the device, etc. In addition, the memory may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some embodiments, the memory may optionally include a memory remotely arranged relative to the processor, and these remote memories may be connected to the device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0153] As an example, non-volatile storage media can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) as external cache memory. By way of illustration and not limitation, RAM can be obtained in many forms such as synchronous RAM (SRAM), dynamic RAM, (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), Synchlink DRAM (SLDRAM), and direct Rambus RAM (DRRAM). The disclosed memory components or memories of the operating environment described herein are intended to include one or more of these and / or any other suitable types of memory.
[0154] Of course, those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing related hardware (such as a processor, a controller, etc.) through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium, and the computer program can include the processes of the above-mentioned method embodiments when executed. The storage medium can be a memory, a disk, a floppy disk, a flash memory, an optical storage device, etc.
[0155] The above are only some specific implementation methods of the present application, and any other improvements made based on the concept of the present application are deemed to be within the protection scope of the present application.< / binarycrossentropywithlogitsbackward>
Claims
1. A method for original text decomposition and label recognition, characterized in that: include: Input the file into the pre-trained model to obtain the text label vector; Input the text label vector into a pre-trained pipeline model to obtain labels of multiple categories, entity BIO sequences, and logical relationships in each label, respectively. The pipeline model includes a multi-label classification model, an entity recognition model, and a multi-category classification model; Perform keyword recognition and unit recognition on the labels of the multiple categories, the entity BIO sequence and the logical relationship in each label through a rule model to obtain a recognition result; The training of the pipeline model includes: Input the text label vector into the multi-label classification model, select the text label vector greater than a set threshold through the sigmoid function, and output labels of multiple categories; The labels of the multiple categories are concatenated with the text label vector and input into the entity recognition model, and the entity BIO sequence of each label is output; The labels of the multiple categories, the entity BIO sequence of each label and the text label vector are input into the multi-category classification model, and the logical relationship in each label is output.
2. The method according to claim 1, characterized in that The training of the pre-trained model includes: Using the training data as the input of the pre-training model and the text label vector as the output of the pre-training model; The training data is composed of label data obtained by disassembling historical original file data.
3. The method according to claim 1, characterized in that After inputting the text label vector into a pre-trained pipeline model to obtain labels of multiple categories, entity BIO sequences and logical relationships in each label, the method further includes: Calculate a first loss function based on the multiple labels by BCEloss; Calculate a second loss function through CRF based on the entity BIO sequence; Calculate a third loss function through CrossEntropyLoss based on the logical relationship; Based on the back propagation of the first loss function, the second loss function and the third loss function, the pipeline model parameters are updated.
4. The method according to claim 3, characterized in that The updating of the pipeline model parameters based on the back propagation of the first loss function, the second loss function and the third loss function comprises: Respectively weighting and summing the first loss function, the second loss function, and the third loss function to obtain a total loss function; Back-propagation is performed on the pipeline model based on the total loss function to update the pipeline model parameters.
5. The method according to claim 1, characterized in that: The step of performing keyword recognition and unit recognition on the labels of the multiple categories, the entity BIO sequence and the logical relationship in each label by using a rule model to obtain a recognition result further includes: Using the rule model, the tags of the multiple categories, the entity BIO sequence and the logical relationship in each tag are subjected to keyword recognition and the logical relationship field is corrected to obtain a corrected relationship word result; Unit recognition is performed through the maximum matching algorithm to obtain the recognition unit result.
6. The method according to claim 5, characterized in that After the unit recognition is performed by the maximum matching algorithm and the recognition unit result is obtained, the following steps are included: When special tags exist, convert them into standard tags; Get the identification tag type based on the standard tag.
7. A system for disassembling original text and identifying labels using the method according to any one of claims 1 to 6, characterized in that: include: Disassembly module, input the original file into the pre-trained pre-trained model to obtain the text label vector; An acquisition module inputs the text label vector into a pre-trained pipeline model to obtain labels of multiple categories, entity BIO sequences, and logical relationships in each label, respectively. The pipeline model includes a multi-label classification model, an entity recognition model, and a multi-category classification model; The recognition module is used to perform keyword recognition and unit recognition on the labels of the multiple categories, the entity BIO sequence and the logical relationship in each label through a rule model to obtain a recognition result.
8. An electronic device, characterized in that: The electronic device includes a processor and a memory, wherein the memory stores computer executable instructions that can be executed by the processor, and the processor executes the computer executable instructions to implement the original text disassembly and label recognition method described in any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions. When the computer-executable instructions are called and executed by the processor, the computer-executable instructions prompt the processor to implement the original text disassembly and label recognition method described in any one of claims 1 to 6.
Citation Information
Patent Citations
Text classification method based on extraction
CN116304064A
Clinical discovery event extraction method and device
CN116631642A