A data processing method, device, equipment and medium
By performing text classification and subject identification tasks in parallel, using multi-task models to judge the changing trends in information, the problems of low information processing efficiency and poor reusability in the existing technology are solved, and efficient and accurate information trend judgment and multi-scenarios are achieved application.
Patent Information
- Application Number
- CN202111076630.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-09-14
- Publication Date
- 2024-11-01
- Estimated Expiration
- 2041-09-14
AI Technical Summary
The existing technology is difficult to efficiently determine effective information that reflects the changing trend from a large amount of information, especially in financial scenarios, which cannot handle the changing trends of multiple subjects at the same time, and waste of computing resources and data performance losses are large, so it cannot be used in different scenarios. Reuse between.
By performing text classification tasks and subject recognition tasks in parallel, using a multi-task model to determine the target sentence and subject at the same time, judging trends based on the label of the target subject, and using the migration and reuse mechanism of the multi-task model is used to apply to different categories of information.
It reduces the time for judging the trend of the target subject in the information, improves efficiency and accuracy, and realizes the reuse and wide application of information trend judgment between different scenarios.
Smart Images

Figure CN113849640B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a data processing method, device, equipment and medium. Background Art
[0002] With the development of the Internet, the amount of information that users can obtain has increased dramatically. How to determine effective information from a large amount of information, especially information that can reflect changing trends, has become an important issue.
[0003] In view of the above, there is a need for more effective and efficient data processing schemes for determining valid information. Summary of the invention
[0004] The embodiments of this specification provide a data processing method, apparatus, device and medium to solve the technical problem of how to more effectively and efficiently determine the change trend of a subject.
[0005] To solve the above technical problems, the embodiments of this specification provide the following technical solutions:
[0006] The embodiment of this specification provides a first data processing method, including:
[0007] Acquire original information, perform a text classification task and a subject recognition task on the original information in parallel, and determine a text classification result and a subject recognition result of the original information;
[0008] Determine whether the target sentence exists in the original information according to the text classification result, determine whether there is a subject in the original information according to the subject identification result, and determine the subject label corresponding to each subject existing in the original information;
[0009] If the original information contains a target sentence, the trend judgment result of the target subject is determined according to the subject label corresponding to the target subject contained in the target sentence.
[0010] The present invention provides a data processing device, including:
[0011] A task module, used to obtain original information, perform a text classification task and a subject recognition task on the original information in parallel, and determine a text classification result and a subject recognition result of the original information;
[0012] An analysis module is used to determine whether the target sentence exists in the original information according to the text classification result, and to determine whether there is a subject in the original information according to the subject identification result, and to determine the subject label corresponding to each subject existing in the original information;
[0013] The judgment module is used to determine the trend judgment result of the target subject according to the subject label corresponding to the target subject contained in the target sentence if the original information has a target sentence.
[0014] The embodiment of this specification provides a data processing device, including:
[0015] at least one processor;
[0016] as well as,
[0017] a memory communicatively coupled to the at least one processor;
[0018] in,
[0019] The memory stores instructions that can be executed by the at least one processor. The instructions are executed by the at least one processor to enable the at least one processor to perform the first data processing method mentioned above.
[0020] An embodiment of the present specification provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are executed by a processor, the above-mentioned first data processing method is implemented.
[0021] At least one of the above technical solutions adopted in the embodiments of this specification can achieve the following beneficial effects:
[0022] By executing the text classification task and the subject identification task in parallel on the original information, and performing text classification and subject identification at the same time, that is, determining the target sentence and the subject at the same time from the original information, and then determining the trend judgment result of the target subject according to the subject label corresponding to the target subject in the target sentence. Since the text classification task and the subject identification task can be executed in parallel and at the same time, the time for judging the change trend of the target subject in the original information is reduced, and the efficiency of judging the change trend of the target subject in the original information is improved.
[0023] The embodiment of this specification provides a second data processing method, including:
[0024] Constructing a multi-task model, training the multi-task model using samples of the first category, and using the multi-task model trained with the samples of the first category to perform the text classification task and the subject recognition task described in the first data processing method in parallel on the original information belonging to the first category;
[0025] Partially replace the first category samples with the second category samples, repeatedly train the multi-task model using the second category samples and the first category samples that have not been replaced, and use the repeatedly trained multi-task model to perform the text classification task and subject recognition task described in the first data processing method in parallel on the original information belonging to the first category or the second category; or, replace the first category samples with the second category samples, repeatedly train the multi-task model using the second category samples, and use the repeatedly trained multi-task model to perform the text classification task and subject recognition task described in the first data processing method in parallel on the original information belonging to the second category.
[0026] The present invention provides a data processing device, including:
[0027] An application module, used for constructing a multi-task model, training the multi-task model using samples of the first category, and using the multi-task model trained with the samples of the first category to perform the text classification task and the subject recognition task described in the first or second data processing method in parallel on the original information belonging to the first category;
[0028] A migration module is used to partially replace the first category samples with the second category samples, repeatedly train the multi-task model using the second category samples and the first category samples that have not been replaced, and use the multi-task model after repeated training to perform the text classification task and the subject recognition task described in the first or second data processing method in parallel on the original information belonging to the first category or the second category; or, use the second category samples to replace the first category samples, repeatedly train the multi-task model using the second category samples, and use the multi-task model after repeated training to perform the text classification task and the subject recognition task described in the first or second data processing method in parallel on the original information belonging to the second category.
[0029] The embodiment of this specification provides a data processing device, including:
[0030] at least one processor;
[0031] as well as,
[0032] a memory communicatively coupled to the at least one processor;
[0033] in,
[0034] The memory stores instructions that can be executed by the at least one processor. The instructions are executed by the at least one processor, so that the at least one processor can perform the second data processing method mentioned above.
[0035] An embodiment of the present specification provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are executed by a processor, the second data processing method described above is implemented.
[0036] At least one of the above technical solutions adopted in the embodiments of this specification can achieve the following beneficial effects:
[0037] The multi-task model trained with samples of a specific category can be used for the parallel execution of the text classification task and the subject recognition task of the original information of the same category, and then the trend judgment result of the target subject in the original information of the same category is determined by the first data processing method. In this way, on the basis of the above beneficial effects, since the samples and the original information belong to the same category, it is conducive to improving the accuracy of the multi-task model obtained by training to judge the change trend of the target subject in the original information, that is, improving the effect of judging the change trend of the target subject in the original information.
[0038] By partially or completely replacing samples of different categories, the trained multi-task model can be used to judge the changing trends of target subjects in original information of different categories, thus realizing the migration and reuse of the multi-task model between original information of different categories, improving the breadth and diversity of application of the multi-task model, and further improving the effect and efficiency of judging the changing trends of target subjects in original information of different categories. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] In order to more clearly illustrate the technical solutions in the embodiments of this specification or the prior art, the following is a brief introduction to the drawings required for use in the embodiments of this specification or the prior art description. Obviously, the drawings introduced below are only some of the drawings that may be involved in the embodiments recorded in this specification. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0040] Figure 1 It is a modeling schematic diagram of the prior art.
[0041] Figure 2 It is a schematic diagram of the execution body of the data processing method in the first embodiment of this specification.
[0042] Figure 3 It is a flowchart of the data processing method in the first embodiment of this specification.
[0043] Figure 4 It is a schematic diagram of the shared parameter layer in the first embodiment of this specification.
[0044] Figure 5 This is a schematic diagram of the multi-task model deployment in the first embodiment of this specification.
[0045] Figure 6 It is a flowchart of the data processing method in the second embodiment of this specification.
[0046] Figure 7 This is a schematic diagram of the sample pool changes in the second embodiment of this specification.
[0047] Figure 8 It is a schematic diagram of the structure of the data processing device in the third embodiment of this specification.
[0048] Fig. 9 It is a schematic diagram of the structure of the data processing device in the fourth embodiment of this specification. DETAILED DESCRIPTION
[0049] In order to enable those skilled in the art to better understand the technical solutions in this specification, the technical solutions of the embodiments of this specification will be clearly and completely described below in conjunction with the drawings of the embodiments of this specification. Obviously, the embodiments described in this specification are only some embodiments of this application, not all embodiments. Based on the embodiments of this specification, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of this application.
[0050] The current society is in an era of information explosion. The amount of information that users, institutions or other subjects can obtain has increased dramatically, and the difficulty of determining effective information from a large amount of information has also increased. In particular, the "effective information" can be the change trend information of the subject. For example, in the financial scenario, there are various information released by practitioners or various institutions every year, every month or even every day, which can contain the change trend information of various subjects. Obviously, it is extremely difficult to read all the information and extract the change trend information of various subjects from it. The change trend of the subject can generally be expressed by the three elements of the viewpoint, namely the viewpoint sentence, the viewpoint subject and the viewpoint trend. Among them, the viewpoint sentence refers to the sentence used to express the development and change of the subject in the information; generally, the viewpoint sentence should be released by practitioners or institutions, representing the overall or main viewpoint or conclusion of the development and change of the subject in the information. For example, "some interviewees believe that the price of pork is on a downward trend" may be just a description in the information, and the main viewpoint of the information may be different from it; the viewpoint subject can also be called the subject, which refers to the subject involved in the viewpoint sentence, and the viewpoint trend refers to the specific description of the development and change of the subject in the viewpoint sentence.
[0051] In the prior art, computer technology can be used to obtain the subject's change trend information from various information, that is, to model the three elements of the opinion respectively, and then use the pipeline method to integrate the execution process of each model, and finally obtain the subject's change trend information. Specifically, the prior art solution is to first establish an opinion classification model for opinion sentences, extract opinion sentences from the information, and obtain an opinion sentence set; then use the subject extraction model to use entity labeling or keyword / regular expression matching strategies for each sentence in the opinion sentence set to obtain the opinion subject; finally, use a sentiment classification model (usually a three-category model) to determine the expected change trend of the opinion subject, such as Figure 1 As shown. It can be seen that the prior art uses three models: opinion classification model, subject extraction model, and sentiment classification model. Each downstream model needs to rely on the results of the upstream model. On the one hand, this causes a waste of computing resources and increases computing time. On the other hand, it relies on the final sentiment classification model to judge the change trend of the subject, resulting in only one change trend result for an opinion sentence, corresponding to one subject. When there are multiple subjects in an opinion sentence (such as "The price of live pigs will show a downward trend in the future, but the price of beef will be expected to rise", there are two subjects, live pig prices and beef prices), the solution of the prior art cannot obtain the change trends corresponding to multiple subjects, that is, it is incompatible with complex scenarios. On the other hand, the solution of the prior art cannot use the sample data of a single element to generate gains for each element because it is modeled separately, resulting in data performance loss. In addition, the solution in the prior art cannot be reused between different scenarios, including the inability to obtain transformation trend information for information in different scenarios.
[0052] The first embodiment of this specification (hereinafter referred to as "embodiment one") provides a data processing method. The execution subject of embodiment one can be a terminal (including but not limited to mobile phones, computers, pads, televisions) or a server or an operating system or an application or a data processing platform or a data processing system, etc., that is, the execution subject can be various and can be set, used or changed as needed. In addition, a third-party application can also assist the execution subject in executing embodiment one. For example Figure 2 As shown, the data processing method in Example 1 can be executed by a server, and an application corresponding to the server can be installed on a terminal (held by a user). Data can be transmitted between the terminal or the application and the server, and data can be collected, input or output, or pages or information processing can be performed (for the user) through the terminal or the application, thereby assisting the server in executing the data processing method in Example 1.
[0053] like Figure 3 As shown, the data processing method provided in the first embodiment includes:
[0054] S101: (Execution subject) obtaining original information, performing a text classification task and a subject recognition task on the original information in parallel, and determining a text classification result and a subject recognition result of the original information;
[0055] The execution subject of the first embodiment can obtain original information, which is generally information in text form. The original information can be uploaded to the execution subject of the first embodiment, or can be transmitted to the execution subject of the first embodiment by other devices. The first embodiment does not specifically limit how to obtain the original information.
[0056] The original information may include a single text sentence, for example, the original information is a single Chinese sentence or an English sentence; the original information may also include multiple text sentences, for example, the original information is an article, and the article includes multiple Chinese sentences. If the original information includes multiple text sentences, the original information can be sentence-separated to determine the individual text sentences contained in the original information. Among them, sentence-separating the original information can include dividing the original information according to punctuation marks (such as periods and semicolons) in the original information. In addition, sentence-separation can be performed by other devices, and the single sentence can be transmitted as the original information to the execution subject of Example 1.
[0057] After obtaining the original information, the execution subject of the first embodiment can perform the text classification task and the subject identification task on the original information in parallel, and the text classification task and the subject identification task can be performed simultaneously. If the original information includes multiple text sentences, then performing the text classification task and the subject identification task on the original information in parallel can include: (after the original information is divided into sentences) for any text sentence included in the original information, performing the text classification task and the subject identification task on the text sentence in parallel.
[0058] In the first embodiment, performing the text classification task and the subject recognition task on the original information in parallel may include: using a multi-task model to perform the text classification task and the subject recognition task on the original information in parallel. Figure 5 , the multi-task model is described below:
[0059] In the first embodiment, the changing trend of the subject in the original information is abstracted into two parts: the opinion sentence and the subject. The subject includes but is not limited to various accounts, users, merchants or enterprises, network business service providers, institutions, etc. Each subject can be composed of two corresponding parameters: attributes and trends. The attributes are used to characterize the meaning or type or form of the subject, such as the above-mentioned accounts, users, merchants or enterprises, network business service providers, institutions, etc. The attributes can also be called the subject name. For example, if the text sentence is "Live pigs are expected to accelerate, and live pig prices may go down", it contains two subject attributes "live pigs are slaughtered" and "live pig prices". The trend corresponding to "live pigs are slaughtered" is "acceleration", and the trend corresponding to "live pig prices" is downward. After defining the above structure of the changing trend, the above structure can be modeled.
[0060] In the first embodiment, a text classification task and a subject identification task can be defined, and both can be deep learning tasks. The text classification task is used to determine whether there is a target sentence in the original information, including determining whether each text sentence included in the original information is a target sentence, and the target sentence can be an opinion sentence, that is, the text classification task is a text binary classification task; the subject identification task is used to determine whether there is a subject in the original information, and determine the subject label corresponding to each subject in the original information.
[0061] In Example 1, a multi-task model can be constructed, and the multi-task model can perform the above-mentioned text classification task and subject recognition task in parallel (and simultaneously). Among them, the multi-task model can be constructed based on a multi-task framework, and the above-mentioned text classification task and subject recognition task can be defined on the multi-task framework. Multi-task: Multi-task learning is a kind of joint learning, in which multiple tasks are learned in parallel, and the results affect each other. In practical problems, it is to integrate multiple learning tasks into one model, such as text classification tasks and subject recognition tasks. The multi-task framework is a learner that uses the useful information contained in multiple learning tasks to help each learning task obtain more accurate results.
[0062] After defining the above text classification tasks and subject recognition tasks, you can select the BERT pre-trained model as the shared parameter layer of the multi-task framework, that is, select the BERT pre-trained model as the shared parameter layer of the above multi-task model, for example Figure 4 As shown. The last hidden layer of the BERT pre-trained model is connected to the fully linked layer for subject recognition as a sub-task layer of the subject recognition task; the first node in the last hidden layer of the BERT pre-trained model (i.e., the node corresponding to "CLS") is connected to the binary fully linked layer for text classification as a sub-task layer of the text classification task.
[0063] Through the above content, the modeling of the above structure for the changing trend is perfectly integrated into the multi-task algorithm framework, achieving the compatibility of physical definition and algorithm definition, and forming the above-mentioned multi-task model.
[0064] In the first embodiment, after constructing the multi-task model, the multi-task model can be trained using samples. In particular, the samples used to train the multi-task model carry category labels, which are obtained by taking the Cartesian product of the entity label and the sequence label. The following further describes how to generate samples:
[0065] In the first embodiment, an entity tag set can be constructed. Among them, the change trend can be defined as three trends: rise, fall and flat. Different tags are used to represent different change trends. In the first embodiment, the POS tag is used to represent rise, the NEG tag is used to represent fall, and the MID tag is used to represent flat. The tag representing the change trend is merged with the entity tag (the entity tag is denoted as P), so as to construct an entity tag set {P_POS, P_NEG, P_MID, O} (O generally represents an unrelated or ignorable word). Among them, P can represent an attribute, and POS, NEG, and MID represent a trend.
[0066] According to the BIESO annotation criteria, the sequence annotation tags {B, I, E, S, O} can be determined, where the B tag indicates the beginning of the entity (Begin), the I tag indicates the inside (inside), the O tag indicates the outside (outside), the E tag indicates the end of the entity (End), and S indicates a single-character entity (Single).
[0067] Determine the Cartesian product of the entity label set and the sequence label set, the Cartesian product is {P_POS_B, P_POS_I, P_POS_E, P_POS_S, O, P_NEG_B, P_NEG_I, P_NEG_E, P_NEG_S, O, P_MID_B, P_MID_I, P_MID_E, P_MID_S, O}. Among them, the product of the sequence label and "O" is "O". The elements in the Cartesian product combine the entity label and the sequence label, so that they have the sequence label meaning and the change trend meaning of the entity. Each element in the Cartesian product is used as a category label, and the category label also has the sequence label meaning and the change trend meaning, which can be used to characterize entities and change trends. Since a single character can be labeled by an entity label and a sequence label, and the Cartesian product is a fusion of the entity label and the sequence label, the original set of entity labels and sequence label sets are expanded to a word-level label set (i.e., the Cartesian product). Each character can be mapped to a category label in the Cartesian product. The category label is used to characterize whether the character is an entity (determined by the sequence label in the category label corresponding to the character) and the change trend (determined by the change trend label in the category label corresponding to the character).
[0068] In the first embodiment, a large number of existing articles or information can be segmented into words / sentences, and the character level (i.e., single character) or word level (i.e., single word) obtained after the segmentation is used as the sample to be labeled, thereby forming a sample set to be labeled. The elements in the above Cartesian product are used to label the sample set to be labeled, so that each sample corresponds to an element in the Cartesian product, and each sample carries its corresponding element in the Cartesian product, thereby forming a labeled sample set.
[0069] After completing the construction of the multi-task model and the labeled sample set, the labeled samples can be used to train the multi-task model to determine the various weight parameters of the multi-task model, including updating the parameters of the BERT model and fine-tuning the BERT model. It can also be seen that the text classification task and subject recognition task defined above are supervised deep learning tasks. The trained multi-task model can be deployed on the execution entity of Example 1 to perform text classification tasks and subject recognition tasks on the original information in parallel, and determine the text classification results (i.e., the execution results of the text classification task) and subject recognition results (i.e., the execution results of the subject recognition task) of the original information.
[0070] In addition, the multi-task model can be built and trained by the execution entity of the first embodiment, or can be built or trained by other devices and deployed on the execution entity of the first embodiment.
[0071] S103: (Executing body) determining whether the target sentence exists in the original information according to the text classification result, determining whether the subject exists in the original information according to the subject recognition result, and determining the subject label corresponding to each subject existing in the original information;
[0072] After determining the text classification result of the original information, the execution subject of Example 1 can determine whether there is a target sentence in the original information based on the text classification result, that is, determine whether each text sentence contained in the original information is a target sentence, including determining whether each text sentence contained in the original information is an opinion sentence. Among them, determining whether each text sentence contained in the original information is a target sentence includes: for any text sentence contained in the original information, determining whether the text sentence is a target sentence based on the output data (i.e., the text classification result) of the full link layer of the text classification task (i.e., the above-mentioned two-category full link layer). For example, a threshold can be set, and by judging the output data of the two-category full link layer and the threshold, it is determined whether the text sentence is a target sentence.
[0073] After determining the subject recognition result of the original information, the execution subject of the first embodiment can determine whether there is a subject in the original information, and for any subject in the original information, determine the subject tag corresponding to the subject. The subject recognition result includes a sequence labeling result of the original information, and determining whether there is a subject in the original information can include: determining whether there is a subject in the original information according to the sequence labeling result of the original information.
[0074] Determining the subject labels corresponding to each subject existing in the original information may include: for any subject existing in the original information, determining the subject label corresponding to the subject according to the output data of the full link layer of the subject recognition task. Since the samples used for training the multi-task model have category labels, each character in the original information is used as or corresponds to a token in the process of performing the subject recognition task using the multi-task model, so the category label of each character in the original information or the token corresponding to each character can be determined. In the first embodiment, determining the subject labels corresponding to each subject existing in the original information may include: for any subject existing in the original information, determining the category labels of each token corresponding to the subject; and determining the subject label corresponding to the subject according to the category labels of each token corresponding to the subject. Among them, according to the category labels of each token corresponding to the subject, determining the subject label corresponding to the subject may include: for any token corresponding to the subject, using the entity label in the category label of the token as the subject label corresponding to the subject. This is because the entity labels in the category labels of each token corresponding to the same subject are the same. For example, if the category labels of the two tokens corresponding to a subject are P_POS_B and P_POS_I respectively, then for any token corresponding to the subject, the entity label in its category label, that is, P_POS, is used as the subject label of the subject.
[0075] Specifically, since each character in a single text sentence in the original information corresponds to a token of the multi-task model (specifically the BERT model), if any subject contains one character, the token corresponding to the character is the token corresponding to the subject; if any subject contains multiple characters, the tokens corresponding to each character contained in the subject are all tokens corresponding to the subject.
[0076] S105: If the original information contains a target sentence, then (the execution subject) determines the trend judgment result of the target subject according to the subject label corresponding to the target subject contained in the target sentence.
[0077] It should be noted that there may be multiple text sentences in the original information. Even if some text sentences are not target sentences, they may still contain subjects and the changing trend of the subjects. Please refer to the description of the above-mentioned opinion sentences. For example, "Some interviewees believe that the price of live pigs is on a downward trend" is not a target sentence, but it still contains the subject "live pig prices" and the changing trend "declining". In general, the first embodiment is concerned with the changing trend of the subject in the target sentence.
[0078] In the first embodiment, when there is a target sentence in the original information, the execution subject of the first embodiment can use the subject existing in the determined target sentence as the target subject, and determine the trend judgment result of the target subject according to the subject label corresponding to the target subject. Among them, determining the trend judgment result of the target subject according to the subject label corresponding to the target subject can include: judging the change trend of the target subject according to the subject label of the target subject, and determining the trend judgment result of the target subject. For example, for any target subject, the subject label of the target subject is P_NEG, and the trend corresponding to NEG is falling, so the change trend of the target subject is judged to be a falling trend, and the trend judgment result of the target subject is falling or a similar result.
[0079] The first embodiment is further described below by a non-limiting example:
[0080] For example, the original information contains the text sentence "Pork prices and beef prices rose and fell respectively", and the multi-task model is used to perform text classification tasks and subject recognition tasks on the text sentence.
[0081] Specifically, the text sentence is IDed and converted into a vector using a dictionary. Since the length of the text sentence is 16, the text sentence is converted into a 16-dimensional vector.
[0082] The 16-dimensional vector is completed according to the defined maximum length (max_seq). For example, if the defined maximum length is 128 dimensions, the 16-dimensional vector is completed to 128 dimensions.
[0083] Input the 128-dimensional vector into the BERT model and output a 16*768-dimensional vector;
[0084] The 1*768 dimensional vector output by [CLS] of the BERT model is input into the 768*1 fully linked layer (fully linked layer of the text classification task) to obtain a 1*1 dimensional vector, that is, a single value. The single value is sigmoid normalized to obtain the output data of the fully linked layer of the text classification task, that is, the normalized value. The threshold can be preset to 0.5. If the output data of the fully linked layer of the text classification task is greater than 0.5, the text sentence is judged to be the target sentence, that is, the opinion sentence; if the output data of the fully linked layer of the text classification task is not greater than 0.5, the text sentence is judged not to be the target sentence, that is, not an opinion sentence. The following assumes that the text sentence is the target sentence.
[0085] Each word in the text sentence corresponds to a token. Each token (1*768 vector) of the BERT model is connected to a 768*num_label (num_label is the number of elements in the Cartesian product, that is, the number of category labels. In the above Cartesian product, num_label is 15, so the following takes num_label as 15 as an example) fully connected layer (fully connected layer of the subject identification task), so as to perform subject identification and obtain a 1*15-dimensional vector corresponding to each token. The 1*15-dimensional vector corresponding to each token is softmax normalized to obtain a normalized 1*15-dimensional vector corresponding to each token (referred to as a 1*15-dimensional normalized vector).
[0086] For any token, the value of each element in the 1*15-dimensional normalized vector corresponding to the token represents the probability that the category label of the token is the corresponding element in the above Cartesian product. That is, the value of the first element in the 1*15-dimensional normalized vector corresponding to the token represents the probability that the category label of the token is the first element in the above Cartesian product; the value of the second element in the 1*15-dimensional normalized vector corresponding to the token represents the probability that the category label of the token is the second element in the above Cartesian product; and so on, the value of the 15th element in the 1*15-dimensional normalized vector corresponding to the token represents the probability that the category label of the token is the 15th element in the above Cartesian product. The element with the largest probability is the category label of the token, as shown in Table 1 below:
[0087] Token or character Category Label pig P_POS_B Meat P_POS_I price P_POS_I grid P_POS_E and O ox P_NEG_B Meat P_NEG_I price P_NEG_I grid P_NEG_E point O Don't O superior O Lift O and O Down O drop O
[0088] Table 1
[0089] It can be seen that the above target sentence contains two target subjects, "pork price" and "beef price". For the category label of any of the four tokens corresponding to "pork price", the entity label contained therein is P_POS, so the subject label corresponding to the target subject "pork price" is P_POS, which means that the change trend of the target subject "pork price" is an upward trend, and the trend judgment result of the target subject is an increase or rise or similar result; for the category label of any of the four tokens corresponding to "beef price", the entity label contained therein is P_NEG, so the subject label corresponding to the target subject "beef price" is P_NEG, which means that the change trend of the target subject "beef price" is a downward trend, and the trend judgment result of the target subject is a decrease or a decline or a similar result. Of course, the trend judgment result can be displayed to the user in a suitable manner, such as text or charts or other forms, and the first embodiment does not make specific limitations.
[0090] The above examples are only examples and can be applied to any text sentences. The steps or processes in the above examples are not unique. For example, normalization can be performed in a variety of ways.
[0091] In the first embodiment, the text classification task and the subject identification task are performed in parallel on the original information, and the text classification and subject identification are performed simultaneously, that is, the target sentence and the subject are determined from the original information at the same time (rather than determining the opinion sentence and the opinion subject in sequence), and then the trend judgment result of the target subject is determined according to the subject label corresponding to the target subject in the target sentence. Since the text classification task and the subject identification task can be performed in parallel and simultaneously, that is, the target sentence and the subject are modeled at the same time, the system performance utilization rate can be improved, the time for judging the change trend of the target subject in the original information can be reduced, and the efficiency of judging the change trend of the target subject in the original information can be improved.
[0092] In Example 1, the physical structure of the opinion system is integrated into the multi-task model. The BERT model is used as the shared parameter layer. The text classification task and the subject identification task can share parameters. The shared parameter layer among the three elements of opinion can utilize more text prior information, so that multiple tasks can be calculated in parallel and promote each other, improve the utilization rate of sample data, improve the text classification effect and subject identification effect, and thus improve the efficiency of judging the changing trend of the target subject in the original information.
[0093] In the first embodiment, only one multi-task model is needed to realize the simultaneous training and parallel execution of the text classification task and the subject recognition task, as well as the simultaneous extraction of the three elements of the viewpoint, which can improve the efficiency of judging the change trend of the target subject in the original information. The multiple tasks of the multi-task model promote each other, so that each sample data can be fully utilized, and multi-task parallel computing is realized, which improves the computing efficiency and the effect and efficiency of judging the change trend of the target subject in the original information.
[0094] In the first embodiment, the change trend is integrated into the subject recognition task through entity tags (POS, NEG, MID). No matter how many subjects there are in a single text sentence, each subject can correspond to the change trend, so it can be applied to complex original information of single subject and multiple subjects, and has a wider scope of application.
[0095] The second embodiment of this specification (hereinafter referred to as "embodiment 2") provides a data processing method. The execution subject of embodiment 2 can be a terminal (including but not limited to mobile phones, computers, pads, televisions) or a server or an operating system or an application or a data processing platform or a data processing system, etc., that is, the execution subject can be various and can be set, used or changed as needed. In addition, a third-party application can also assist the execution subject in executing embodiment 2. For example Figure 2As shown, the data processing method in Example 2 can be executed by the server, and an application corresponding to the server can be installed on the terminal (held by the user). Data can be transmitted between the terminal or the application and the server, and data can be collected, input or output, or page or information processing can be performed (for the user) through the terminal or the application, thereby assisting the server in executing the data processing method in Example 2.
[0096] like Figure 6 As shown, the data processing method provided in the second embodiment includes:
[0097] S202: (Executing subject) constructing a multi-task model, using the first category samples to train the multi-task model, and using the multi-task model trained by the first category samples to perform the text classification task and subject recognition task described in Example 1 in parallel on the original information belonging to the first category;
[0098] The execution entity of Example 2 can construct a multi-task model, train the multi-task model using samples of the first category, and use the multi-task model trained with samples of the first category to perform the text classification task and subject recognition task and other processes described in Example 1 on the original information belonging to the first category in parallel, so as to determine the trend judgment result of the target subject in the "original information of the first category".
[0099] It can be seen that the execution subject of the second embodiment can also execute the entire process of the first embodiment, except that the samples in the second embodiment are limited to the first category samples, and the original information in the second embodiment is limited to the first category original information.
[0100] S204: (Execution subject) Partially replace the first category samples with the second category samples, repeatedly train the multi-task model using the second category samples and the first category samples that have not been replaced, and use the repeatedly trained multi-task model to perform the text classification task and subject recognition task described in Example 1 on the original information belonging to the first category or the second category in parallel; or, replace the first category samples with the second category samples, repeatedly train the multi-task model using the second category samples, and use the repeatedly trained multi-task model to perform the text classification task and subject recognition task described in Example 1 in parallel on the original information belonging to the second category.
[0101] (1) The execution subject of the second embodiment can replace part of the first category samples with second category samples, use the second category samples and the first category samples that have not been replaced to repeatedly train the multi-task model, and use the repeatedly trained multi-task model to perform the text classification task and subject recognition task and other processes described in the first embodiment in parallel on the original information belonging to the first category or the second category, so as to determine the trend judgment result of the target subject in the "original information of the first category or the second category", that is, the trend judgment result of the target subject in the original information of the first category can be determined, and the trend judgment result of the target subject in the original information of the second category can be determined.
[0102] The above-mentioned model training process and the process of executing the text classification task and the subject identification task in parallel to determine the trend judgment result of the target subject in the "original information of the first category or the second category" refer to the first embodiment.
[0103] It can be seen that since the first category samples and the second category samples are used to train the multi-task model, the multi-task model trained by the first category samples and the second category samples can be used to determine the trend judgment results of the target subject in the "original information of the first category or the second category".
[0104] (2) The executing entity of Example 1 may replace all first category samples with second category samples, use the second category samples to repeatedly train the multi-task model, and use the repeatedly trained multi-task model to perform the text classification task and subject recognition task and other processes described in Example 1 on the original information belonging to the second category in parallel, so as to determine the trend judgment result of the target subject in the "original information of the second category".
[0105] The above-mentioned model training process and the parallel execution of the text classification task and the subject identification task to determine the trend judgment result of the target subject in the "second category of original information" refer to the first embodiment.
[0106] It can be seen that since the second category samples are used to train the multi-task model, the multi-task model obtained by training the second category samples can be used to determine the trend judgment result of the target subject in the “second category original information”.
[0107] The first embodiment explains that each subject has two parts, namely, attributes and trends, and the sample also has two parts, namely, attributes and trends. When replacing samples of the first category and the second category, it is only necessary to replace the attribute part (also referred to as a keyword group) of the first category sample with the attribute of the second sample, so that the sample pool composed of the first sample can be converted into a sample pool composed of the first sample and the second sample or a sample pool composed of the second sample.
[0108] Since the second embodiment can execute all the processes of the first embodiment, the second embodiment has the beneficial effects described in the first embodiment.
[0109] Since the samples and the original information can be of the same category, the multi-task model trained with the first category samples and / or the second category samples is used to determine the trend judgment results of the target subject in the "original information of the first category and / or the second category". Since the original information and the samples are of the same category, it is beneficial to improve the accuracy of the trained multi-task model in judging the changing trend of the target subject in the original information, that is, it improves the effect of judging the changing trend of the target subject in the original information.
[0110] The categories in the second embodiment can be set as needed, including different scenarios as different categories, for example, the first category corresponds to financial scenarios, the second category corresponds to instant messaging scenarios, etc. By partially or completely replacing samples of different categories, the trained multi-task model can be used to judge the change trend of the target subject in the original information of different categories or multiple categories, so that the data processing method described in the first embodiment can be applied to the original information of different categories or multiple categories, that is, the migration application and reuse of the data processing method described in the first embodiment on the original information of different categories or multiple categories are realized. Since the categories can correspond to the scenarios, the migration application and reuse of the data processing method described in the first embodiment on different scenarios or multiple scenarios are also realized.
[0111] Since the migration application of the data processing method described in Example 1 in different scenarios is achieved through sample replacement, the sample pool used to train the multi-task model can be shared regardless of the scenario. It only needs to partially or completely change the sample categories in the sample pool to achieve the migration application and reuse of the data processing method described in Example 1 in different scenarios or multiple scenarios.
[0112] In particular, only a small part of the samples of a certain category needs to be replaced with samples of other categories, such as the second sample, without the need to regenerate a large number of samples for each category, so that the data processing method described in Example 1 can be migrated and applied to original information of different categories, thereby reducing the difficulty and complexity of multi-task model reuse and migration.
[0113] Since only one multi-task model is needed in Example 1 and Example 2 to realize the judgment of the change trend of the target subject in the original information, when migrating between different categories or different scenarios, only one multi-task model needs to be trained again. The fewer models that need to be trained, the more conducive it is to improve the migration and reuse efficiency.
[0114] In the second embodiment, if part of the first category samples are replaced by second category samples, the replaced first category samples can be randomly selected to improve the extensiveness of the second category samples.
[0115] In the first and second embodiments, the samples are positioned as structures such as attributes and trends. This structure is universal. Only by replacing the attributes in the samples, a certain type of samples can be replaced with samples of other types. For example, the attributes in the first category of samples are attributes in financial scenarios such as financial accounts, banks, and payment institutions. They can be replaced with attributes in social scenarios such as social accounts and media, that is, the samples of the financial category are replaced with samples of the social category, so that the replacement of samples of different categories can be achieved. Labels such as POS, NEG, MID, and O can remain unchanged, for example Figure 7 As shown, the difficulty and complexity of sample replacement can be reduced.
[0116] The execution subject of Example 1 or Example 2 can be a node in the blockchain. The multi-task model deployed by the execution subject of Example 1 or Example 2 and the determined target sentence, subject, subject label and other data can be stored in other nodes of the blockchain where they are located (after consensus), so as to realize the distributed storage of the data and prevent the data from being tampered with. At the same time, the other nodes can also act as the execution subject of Example 1 or Example 2 and execute the content described in Example 1 or Example 2.
[0117] like Figure 8 As shown, the third embodiment of this specification provides a data processing device corresponding to the data processing method described in the first embodiment, including:
[0118] Task module 301, used to obtain original information, perform text classification task and subject recognition task on the original information in parallel, and determine text classification result and subject recognition result of the original information;
[0119] The analysis module 303 is used to determine whether the target sentence exists in the original information according to the text classification result, and determine whether there is a subject in the original information according to the subject identification result, and determine the subject label corresponding to each subject existing in the original information;
[0120] The judgment module 305 is used to determine the trend judgment result of the target subject according to the subject label corresponding to the target subject contained in the target sentence if the original information has a target sentence.
[0121] Optionally, performing text classification and subject recognition on the original information in parallel includes:
[0122] A multi-task model is used to perform a text classification task and a subject recognition task on the original information in parallel.
[0123] Optionally, the device further comprises:
[0124] The model module is used to build a multi-task model, where the multi-task model uses the BERT pre-trained model as a shared parameter layer.
[0125] Optionally, building a multi-task model includes:
[0126] The last hidden layer of the BERT pre-trained model is connected to the fully connected layer of the subject recognition task, and the first node in the last hidden layer of the BERT pre-trained model is connected to the fully connected layer of the text classification task to form a multi-task model.
[0127] Optionally, determining whether the target sentence exists in the original information according to the text classification result includes:
[0128] For any text sentence included in the original information, determining whether the text sentence is a target sentence according to output data of the full-link layer of the text classification task;
[0129] and / or,
[0130] Determining the subject label corresponding to each subject existing in the original information includes:
[0131] For any subject existing in the original information, determine the subject label corresponding to the subject according to the output data of the full-link layer of the subject identification task;
[0132] and / or,
[0133] The subject recognition result includes a sequence labeling result; and determining whether the subject exists in the original information according to the subject recognition result includes:
[0134] It is determined whether a subject exists in the original information according to the sequence labeling result.
[0135] Optionally, the model module is also used to: use samples to train the multi-task model before using the multi-task model to perform text classification tasks and subject recognition tasks in parallel on the original information; wherein the samples carry category labels, and the category labels are obtained by taking the Cartesian product of entity labels and sequence annotation labels.
[0136] Optionally, the model module is further used to: construct an entity label set, determine a Cartesian product of the entity label set and a sequence annotation label set, and use each element in the Cartesian product as a category label;
[0137] Optionally, determining a subject label corresponding to each subject in the original information includes:
[0138] For any subject existing in the original information, determine the category label of each token corresponding to the subject;
[0139] According to the category labels of each token corresponding to the subject, the subject label corresponding to the subject is determined.
[0140] Optionally, determining the subject label corresponding to the subject according to the category labels of each token corresponding to the subject includes:
[0141] For any token corresponding to the subject, the entity label in the category label of the token is used as the subject label corresponding to the subject.
[0142] Optionally, determining the trend judgment result of the target subject according to the subject label corresponding to the target subject contained in the target sentence includes:
[0143] The change trend of the target subject is judged according to the subject label of the target subject contained in the target sentence, and a trend judgment result of the target subject is determined.
[0144] Optionally, performing the text classification task and the subject recognition task in parallel on the original information includes:
[0145] For any text sentence included in the original information, a text classification task and a subject recognition task are performed on the text sentence in parallel.
[0146] Optionally, performing the text classification task and the subject recognition task in parallel on the original information includes:
[0147] The text classification task and the subject recognition task are performed on the original information in parallel and simultaneously.
[0148] like Fig. 9 As shown, the fourth embodiment of this specification provides a data processing device corresponding to the data processing method described in the second embodiment, including:
[0149] An application module 402 is used to construct a multi-task model, train the multi-task model using samples of the first category, and use the multi-task model trained with the samples of the first category to perform the text classification task and the subject recognition task described in the first or second embodiment in parallel on the original information belonging to the first category;
[0150] The migration module 404 is used to partially replace the first category samples with the second category samples, repeatedly train the multi-task model using the second category samples and the first category samples that have not been replaced, and use the multi-task model after repeated training to perform the text classification task and the subject recognition task described in Example 1 or Example 2 on the original information belonging to the first category or the second category in parallel; or, use the second category samples to replace the first category samples, repeatedly train the multi-task model using the second category samples, and use the multi-task model after repeated training to perform the text classification task and the subject recognition task described in Example 1 or Example 2 on the original information belonging to the second category.
[0151] Optionally, the migration module 404 is further configured to: if the first category samples are partially replaced by the second category samples, randomly select the first category samples to be replaced.
[0152] A fifth embodiment of the present specification provides a data processing device, including:
[0153] at least one processor;
[0154] as well as,
[0155] a memory communicatively coupled to the at least one processor;
[0156] in,
[0157] The memory stores instructions that can be executed by the at least one processor. The instructions are executed by the at least one processor, so that the at least one processor can execute the data processing method described in Embodiment 1 or Embodiment 2.
[0158] A sixth embodiment of the present specification provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are executed by a processor, the data processing method described in the first or second embodiment is implemented.
[0159] The above embodiments may be used in combination, and modules with the same name between different embodiments or within the same embodiment may be the same or different modules.
[0160] The above describes specific embodiments of the present specification, and other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the accompanying drawings do not necessarily have to be performed in the specific order or sequential order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0161] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device, equipment, and non-volatile computer-readable storage medium embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiments.
[0162] The apparatus, device, non-volatile computer-readable storage medium and method provided in the embodiments of this specification correspond to each other, and therefore, the apparatus, device, and non-volatile computer storage medium also have similar beneficial technical effects as the corresponding methods. Since the beneficial technical effects of the methods have been described in detail above, the beneficial technical effects of the corresponding apparatus, device, and non-volatile computer storage medium will not be repeated here.
[0163] In the 1990s, improvements to a technology could be clearly distinguished as hardware improvements (for example, improvements to the circuit structure of diodes, transistors, switches, etc.) or software improvements (improvements to the method flow). However, with the development of technology, many improvements to the method flow today can be regarded as direct improvements to the hardware circuit structure. Designers almost always obtain the corresponding hardware circuit structure by programming the improved method flow into the hardware circuit. Therefore, it cannot be said that an improvement in a method flow cannot be implemented using a hardware entity module. For example, a programmable logic device (PLD) (such as a field programmable gate array (FPGA)) is such an integrated circuit whose logical function is determined by the user's programming of the device. Designers can "integrate" a digital system on a PLD by programming it themselves, without having to ask a chip manufacturer to design and produce a dedicated integrated circuit chip. Moreover, nowadays, instead of manually making integrated circuit chips, this kind of programming is mostly implemented by "logic compiler" software, which is similar to the software compiler used when developing and writing programs, and the original code before compilation must also be written in a specific programming language, which is called hardware description language (HDL). There is not only one HDL, but many kinds, such as ABEL (Advanced Boolean Expression Language), AHDL (Altera Hardware Description Language), Confluence, CUPL (Cornell University Programming Language), HDCal, JHDL (Java Hardware Description Language), Lava, Lola, MyHDL, PALASM, RHDL (Ruby Hardware Description Language), etc. The most commonly used ones are VHDL (Very-High-Speed Integrated Circuit Hardware Description Language) and Verilog. Those skilled in the art should also know that it is only necessary to program the method flow slightly in the above-mentioned hardware description languages and program it into the integrated circuit, and then it is easy to obtain the hardware circuit that implements the logic method flow.
[0164] The controller can be implemented in any appropriate manner, for example, the controller can take the form of a microprocessor or processor and a computer-readable medium storing a computer-readable program code (such as software or firmware) that can be executed by the (micro)processor, a logic gate, a switch, an application-specific integrated circuit (ASIC), a programmable logic controller, and an embedded microcontroller. Examples of controllers include, but are not limited to, the following microcontrollers: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicone Labs C8051F320. The memory controller can also be implemented as part of the control logic of the memory. Those skilled in the art also know that in addition to implementing the controller in a purely computer-readable program code manner, the controller can be implemented in the form of a logic gate, a switch, an application-specific integrated circuit, a programmable logic controller, and an embedded microcontroller by logically programming the method steps. Therefore, this controller can be considered as a hardware component, and the devices included therein for implementing various functions can also be regarded as structures within the hardware component. Or even, the devices for implementing various functions can be regarded as both software modules for implementing the method and structures within the hardware component.
[0165] The systems, devices, modules or units described in the above embodiments may be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, the computer may be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
[0166] For the convenience of description, the above device is described in various units according to their functions. Of course, when implementing this specification, the functions of each unit can be implemented in the same or multiple software and / or hardware.
[0167] Those skilled in the art will appreciate that the embodiments of this specification may be provided as methods, systems, or computer program products. Therefore, the embodiments of this specification may be in the form of complete hardware embodiments, complete software embodiments, or embodiments in combination with software and hardware. Moreover, the embodiments of this specification may be in the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.
[0168] This specification is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of this specification. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0169] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0170] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0171] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0172] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0173] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0174] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0175] This specification may be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. This specification may also be practiced in distributed computing environments where tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules may be located in local and remote computer storage media, including storage devices.
[0176] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0177] The above is only an embodiment of this specification and is not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.
Claims
1. A data processing method, comprising: Acquire original information, perform a text classification task and a subject recognition task on the original information in parallel, and determine a text classification result and a subject recognition result of the original information; Determine whether the target sentence exists in the original information according to the text classification result, determine whether there is a subject in the original information according to the subject identification result, and determine the subject label corresponding to each subject existing in the original information; The subject tag is used to determine the change trend of the target subject; If the original information contains a target sentence, the trend judgment result of the target subject is determined according to the subject label corresponding to the target subject contained in the target sentence.
2. The method according to claim 1, wherein the text classification and subject recognition of the original information are performed in parallel, comprising: A multi-task model is used to perform a text classification task and a subject recognition task on the original information in parallel.
3. The method of claim 2, further comprising: A multi-task model is constructed, wherein the multi-task model uses the BERT pre-trained model as a shared parameter layer.
4. The method as claimed in claim 3, wherein constructing a multi-task model comprises: The last hidden layer of the BERT pre-trained model is connected to the fully connected layer of the subject recognition task, and the first node in the last hidden layer of the BERT pre-trained model is connected to the fully connected layer of the text classification task to form a multi-task model.
5. The method according to claim 4, wherein determining whether the target sentence exists in the original information according to the text classification result comprises: For any text sentence included in the original information, determining whether the text sentence is a target sentence according to output data of the full-link layer of the text classification task; and / or, Determining the subject label corresponding to each subject existing in the original information includes: For any subject existing in the original information, determine the subject label corresponding to the subject according to the output data of the full-link layer of the subject identification task; and / or, The subject recognition result includes a sequence labeling result; and determining whether the subject exists in the original information according to the subject recognition result includes: It is determined whether a subject exists in the original information according to the sequence labeling result.
6. The method according to claim 2, before using the multi-task model to perform the text classification task and the subject recognition task on the original information in parallel, the method further comprises: Using samples to train the multi-task model; The sample carries a category label, and the category label is obtained by taking the Cartesian product of the entity label and the sequence annotation label.
7. The method of claim 1, further comprising: Constructing an entity tag set, determining a Cartesian product of the entity tag set and a sequence annotation tag set, wherein each element in the Cartesian product is used as a category label; Determining the subject label corresponding to each subject existing in the original information includes: For any subject existing in the original information, determine the category label of each token corresponding to the subject; According to the category labels of each token corresponding to the subject, the subject label corresponding to the subject is determined.
8. The method of claim 7, wherein determining the subject label corresponding to the subject according to the category labels of each token corresponding to the subject comprises: For any token corresponding to the subject, the entity label in the category label of the token is used as the subject label corresponding to the subject.
9. The method according to claim 1, determining the trend judgment result of the target subject according to the subject label corresponding to the target subject contained in the target sentence comprises: The change trend of the target subject is judged according to the subject label of the target subject contained in the target sentence, and a trend judgment result of the target subject is determined.
10. The method according to claim 1, wherein the step of performing the text classification task and the subject recognition task on the original information in parallel comprises: For any text sentence included in the original information, a text classification task and a subject recognition task are performed on the text sentence in parallel.
11. The method according to any one of claims 1 to 10, wherein the step of performing a text classification task and a subject recognition task on the original information in parallel comprises: The text classification task and the subject recognition task are performed on the original information in parallel and simultaneously.
12. A data processing method, comprising: Constructing a multi-task model, training the multi-task model using samples of the first category, and using the multi-task model trained with the samples of the first category to perform the text classification task and the subject recognition task described in any one of claims 1 to 11 in parallel on the original information belonging to the first category; Partially replacing the first category samples with the second category samples, repeatedly training the multi-task model with the second category samples and the first category samples that have not been replaced, and using the repeatedly trained multi-task model to perform the text classification task and subject recognition task described in any one of claims 1 to 11 in parallel on the original information belonging to the first category or the second category; or Use the second category samples to replace the first category samples, use the second category samples to repeatedly train the multi-task model, and use the repeatedly trained multi-task model to perform the text classification task and subject recognition task described in any one of claims 1 to 11 in parallel on the original information belonging to the second category.
13. The method according to claim 12, wherein if the second category samples are partially substituted for the first category samples, the method further comprises: Randomly select the first category samples to be replaced.
14. A data processing device, comprising: A task module, used to obtain original information, perform a text classification task and a subject recognition task on the original information in parallel, and determine a text classification result and a subject recognition result of the original information; An analysis module is used to determine whether the target sentence exists in the original information according to the text classification result, and to determine whether there is a subject in the original information according to the subject identification result, and to determine the subject label corresponding to each subject existing in the original information; The subject tag is used to determine the change trend of the target subject; A judgment module is used to determine a trend judgment result of the target subject according to a subject label corresponding to the target subject contained in the target sentence if the original information contains a target sentence.
15. A data processing device, comprising: An application module, used for constructing a multi-task model, training the multi-task model using samples of the first category, and using the multi-task model trained with the samples of the first category to perform the text classification task and the subject recognition task described in any one of claims 1 to 13 in parallel on the original information belonging to the first category; A migration module, used to partially replace the first category samples with the second category samples, repeatedly train the multi-task model using the second category samples and the first category samples that have not been replaced, and use the repeatedly trained multi-task model to perform the text classification task and subject recognition task described in any one of claims 1 to 13 in parallel on the original information belonging to the first category or the second category; or, use the second category samples to replace the first category samples, repeatedly train the multi-task model using the second category samples, and use the repeatedly trained multi-task model to perform the text classification task and subject recognition task described in any one of claims 1 to 13 in parallel on the original information belonging to the second category.
16. A data processing device comprising: at least one processor; as well as, a memory communicatively coupled to the at least one processor; in, The memory stores instructions that can be executed by the at least one processor. The instructions are executed by the at least one processor to enable the at least one processor to perform the data processing method according to any one of claims 1 to 13.
17. A computer-readable storage medium storing computer-executable instructions, wherein the computer-executable instructions, when executed by a processor, implement the data processing method according to any one of claims 1 to 13.
