CN113849640A - Data processing method, device, equipment and medium - Google Patents

Data processing method, device, equipment and medium Download PDF

Info

Publication number
CN113849640A
CN113849640A CN202111076630.3A CN202111076630A CN113849640A CN 113849640 A CN113849640 A CN 113849640A CN 202111076630 A CN202111076630 A CN 202111076630A CN 113849640 A CN113849640 A CN 113849640A
Authority
CN
China
Prior art keywords
original information
main body
task
subject
text classification
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111076630.3A
Other languages
Chinese (zh)
Inventor
吴欣辉
张锐汀
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Alipay Hangzhou Information Technology Co Ltd
Original Assignee
Alipay Hangzhou Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Alipay Hangzhou Information Technology Co Ltd filed Critical Alipay Hangzhou Information Technology Co Ltd
Priority to CN202111076630.3A priority Critical patent/CN113849640A/en
Publication of CN113849640A publication Critical patent/CN113849640A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/35Clustering; Classification
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/205Parsing
    • G06F40/211Syntactic parsing, e.g. based on context-free grammar [CFG] or unification grammars
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/279Recognition of textual entities
    • G06F40/289Phrasal analysis, e.g. finite state techniques or chunking
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Health & Medical Sciences (AREA)
  • Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Computational Linguistics (AREA)
  • Data Mining & Analysis (AREA)
  • Biomedical Technology (AREA)
  • Molecular Biology (AREA)
  • Computing Systems (AREA)
  • Evolutionary Computation (AREA)
  • Biophysics (AREA)
  • Mathematical Physics (AREA)
  • Software Systems (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Databases & Information Systems (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The embodiment of the specification discloses a data processing method, a device, equipment and a medium, wherein the data processing method comprises the following steps: acquiring original information, executing a text classification task and a main body identification task on the original information in parallel, and determining a text classification result and a main body identification result of the original information; determining whether a target sentence exists in the original information according to a text classification result, determining whether a main body exists in the original information according to a main body identification result, and determining a main body label corresponding to each main body existing in the original information; and if the original information has the target sentence, determining a trend judgment result of the target subject according to a subject label corresponding to the target subject contained in the target sentence.

Description

Data processing method, device, equipment and medium
Technical Field
The present application relates to the field of computer technologies, and in particular, to a data processing method, apparatus, device, and medium.
Background
With the development of networks, the amount of information that users can obtain increases dramatically, and how to determine effective information from a large amount of information, especially information that can reflect a trend of change, is an important issue.
In view of the foregoing, there is a need for a more efficient and effective data processing scheme for determining valid information.
Disclosure of Invention
Embodiments of the present specification provide a data processing method, apparatus, device, and medium, so as to solve a technical problem of how to determine a variation trend of a subject more effectively and more efficiently.
In order to solve the above technical problem, the embodiments of the present specification provide the following technical solutions:
an embodiment of the present specification provides a first data processing method, including:
acquiring original information, executing a text classification task and a main body identification task on the original information in parallel, and determining a text classification result and a main body identification result of the original information;
determining whether a target sentence exists in the original information according to a text classification result, determining whether a main body exists in the original information according to a main body identification result, and determining a main body label corresponding to each main body existing in the original information;
and if the original information has the target sentence, determining a trend judgment result of the target subject according to a subject label corresponding to the target subject contained in the target sentence.
An embodiment of the present specification provides a data processing apparatus, including:
the task module is used for acquiring original information, executing a text classification task and a main body recognition task on the original information in parallel and determining a text classification result and a main body recognition result of the original information;
the analysis module is used for determining whether a target sentence exists in the original information according to a text classification result, determining whether a main body exists in the original information according to a main body identification result, and determining a main body label corresponding to each main body existing in the original information;
and the judging module is used for determining a trend judging result of the target subject according to a subject label corresponding to the target subject contained in the target sentence if the original information has the target sentence.
An embodiment of the present specification provides a data processing apparatus, including:
at least one processor;
and the number of the first and second groups,
a memory communicatively coupled to the at least one processor;
wherein,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the first data processing method described above.
Embodiments of the present specification provide a computer-readable storage medium, which stores computer-executable instructions, and when executed by a processor, the computer-executable instructions implement the first data processing method described above.
The embodiment of the specification adopts at least one technical scheme which can achieve the following beneficial effects:
the text classification task and the main body recognition task are executed in parallel on the original information, and the text classification and the main body recognition are simultaneously carried out, namely, a target sentence and a main body are simultaneously determined from the original information, and then a trend judgment result of the target main body is determined according to a main body label corresponding to the target main body in the target sentence. Because the text classification task and the main body recognition task can be executed in parallel and simultaneously, the time for judging the change trend of the target main body in the original information is reduced, and the efficiency for judging the change trend of the target main body in the original information is improved.
An embodiment of the present specification provides a second data processing method, including:
constructing a multitask model, training the multitask model by using a first category sample, and executing a text classification task and a main body recognition task in parallel on original information belonging to a first category by using the multitask model trained by using the first category sample;
replacing the first class sample with a second class sample part, repeatedly training the multitask model by using the second class sample and the first class sample which is not replaced, and executing the text classification task and the subject identification task in parallel by using the repeatedly trained multitask model for original information belonging to the first class or the second class by using a first data processing method; or, replacing the first class sample with a second class sample, repeatedly training the multitask model by using the second class sample, and executing the text classification task and the subject recognition task in parallel on the original information belonging to the second class of the repeatedly trained multitask model.
An embodiment of the present specification provides a data processing apparatus, including:
the application module is used for constructing a multitask model, using a first category sample to train the multitask model, and executing the text classification task and the main body recognition task in parallel on original information belonging to a first category by using the multitask model trained by using the first category sample according to a first data processing method or a second data processing method;
a migration module, configured to use a second category sample to partially replace the first category sample, use the second category sample and the first category sample that is not replaced to repeatedly train the multitask model, and execute the text classification task and the subject recognition task in parallel for original information belonging to the first category or the second category by using the repeatedly trained multitask model; or, replacing the first category sample with a second category sample, repeatedly training the multitask model by using the second category sample, and executing the text classification task and the subject recognition task in parallel on the original information belonging to the second category by using the repeatedly trained multitask model.
An embodiment of the present specification provides a data processing apparatus, including:
at least one processor;
and the number of the first and second groups,
a memory communicatively coupled to the at least one processor;
wherein,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the second data processing method described above.
Embodiments of the present specification provide a computer-readable storage medium, which stores computer-executable instructions, and when executed by a processor, the computer-executable instructions implement the second data processing method described above.
The embodiment of the specification adopts at least one technical scheme which can achieve the following beneficial effects:
the multi-task model trained by using the samples of the specific category can be used for parallel execution of a text classification task and a subject recognition task of the original information of the same category, and further a trend judgment result of a target subject in the original information of the same category is determined through a first data processing method. Therefore, on the basis of the beneficial effects, the sample and the original information belong to the same category, so that the accuracy of the multi-task model obtained by training in judging the change trend of the target subject in the original information is improved, and the effect of judging the change trend of the target subject in the original information is improved.
Through partial or complete replacement among different types of samples, the trained multi-task model can be used for judging the change trend of the target subject in different types of original information, migration, use and multiplexing of the multi-task model among different types of original information are realized, the application universality and diversity of the multi-task model are improved, and the change trend judgment effect and efficiency of the target subject in different types of original information are further improved.
Drawings
In order to more clearly illustrate the embodiments of the present specification or the technical solutions in the prior art, the drawings used in the description of the embodiments of the present specification or the prior art will be briefly described below. It should be apparent that the drawings described below are only some of the drawings to which the embodiments described in the present specification may relate, and that other drawings may be derived from those drawings by those of ordinary skill in the art without inventive effort.
FIG. 1 is a prior art modeling diagram.
Fig. 2 is a schematic diagram of an execution main body of the data processing method in the first embodiment of the present specification.
Fig. 3 is a flowchart illustrating a data processing method in the first embodiment of the present specification.
Fig. 4 is a schematic diagram of a shared parameter layer in the first embodiment of the present specification.
Fig. 5 is a diagram of a multitask model deployment in the first embodiment of the present specification.
Fig. 6 is a flowchart illustrating a data processing method in a second embodiment of the present specification.
FIG. 7 is a schematic diagram showing a variation of the cuvette in the second embodiment of the present specification.
Fig. 8 is a schematic configuration diagram of a data processing apparatus in a third embodiment of the present specification.
Fig. 9 is a schematic configuration diagram of a data processing apparatus in a fourth embodiment of the present specification.
Detailed Description
In order to make those skilled in the art better understand the technical solutions in the present specification, the technical solutions in the embodiments of the present specification will be clearly and completely described below with reference to the drawings of the embodiments of the present specification. It is to be understood that the embodiments described herein are only some embodiments of the application and not all embodiments. All other embodiments, which can be obtained by a person skilled in the art without making any inventive step based on the embodiments of the present disclosure, shall fall within the scope of protection of the present application.
In the current society, in an information explosion age, the amount of information that can be acquired by users or organizations or other subjects is increasing rapidly, and the difficulty in determining effective information from a large amount of information is also increasing. Specifically, the "effective information" may be variation trend information of the subject. For example, in a financial scenario, every month or even every day, there are various kinds of information published by practitioners or various organizations, which may include information about the variation trend of various kinds of subjects. Obviously, it is extremely difficult to read all the information and extract the information of the variation trend of various subjects from the information. The trend of change of the subject can be generally expressed by three elements of viewpoints, namely, a viewpoint sentence, a viewpoint subject, and a viewpoint trend. Wherein, the viewpoint sentence refers to the sentence used to represent the development and change condition of the subject in the information; generally, the viewpoint sentence should be issued by a practitioner or an organization and represents the whole or main viewpoint or conclusion of the development and change situation of the subject in the information, like that "some interviewees think that the pork price is in a descending trend" may be described only by one sentence in the information, and the main viewpoint of the information may be different from the description; a concept principal may also be referred to as a subject, referring to the principal involved in the concept sentence, with the concept trend referring to a detailed description of the developmental changes to the principal in the concept sentence.
In the prior art, the change trend information of the main body can be obtained from various information by using a computer technology, namely, the three factors are respectively modeled aiming at the viewpoint, then the execution flows of the models are integrated by using a pipeline method, and finally the change trend information of the main body is obtained. Specifically, the prior art scheme is to establish a viewpoint classification model for viewpoint sentences, extract viewpoint sentences from information, and obtain a viewpoint sentence set; then, a main body extraction model is used for using a strategy of entity marking or keyword/regular expression matching for each sentence in the viewpoint sentence set to obtain a viewpoint main body; finally, an emotion classification model (usually a three-classification model) is used to determine a trend expectation for the subject of the point of view, as shown in FIG. 1. Therefore, in the prior art, three models, namely a viewpoint classification model, a main body extraction model and an emotion classification model, are shared, and each downstream model needs to depend on the result of an upstream model, so that on one hand, the waste of computing resources is caused, and the computing time is increased; on the other hand, the change trend of the main body is judged by depending on the final sentiment classification model, so that only one change trend result can exist in one viewpoint sentence and corresponds to one main body; under the condition that a plurality of main bodies exist in one viewpoint sentence (for example, the price of a live pig tends to be in a descending trend in the future, but the price of beef tends to be in an ascending date, two main bodies of the price of the live pig and the price of the beef exist), the scheme in the prior art cannot obtain the change trend corresponding to the plurality of main bodies, namely, incompatibility to complex scenes occurs; on the other hand, the prior art solution cannot generate gain for each element by using sample data of a single element because the model is modeled separately, and the performance of the data is lost. In addition, the scheme in the prior art cannot be multiplexed among different scenes, including the acquisition of the transformation trend information aiming at the information of different scenes.
A first embodiment (hereinafter referred to as "embodiment one") of this specification provides a data processing method, and an execution subject of the embodiment one may be a terminal (including but not limited to a mobile phone, a computer, a pad, a television) or a server or an operating system or an application program or a data processing platform or a data processing system, and the like, that is, the execution subject may be various and may be set, used, or changed as needed. In addition, a third party application may assist the execution principal in executing embodiment one. For example, as shown in fig. 2, the data processing method in the first embodiment may be executed by a server, and an application program (corresponding to the server) may be installed on a terminal (held by a user), so that data transmission may be performed between the terminal or the application program and the server, and data collection or input or output or page or information processing may be performed by the terminal or the application program, so as to assist the server in executing the data processing method in the first embodiment.
As shown in fig. 3, a data processing method according to a first embodiment includes:
s101: the method comprises the steps that (an execution main body) original information is obtained, a text classification task and a main body recognition task are executed on the original information in parallel, and a text classification result and a main body recognition result of the original information are determined;
an executing agent may obtain original information, which is typically in text form. The original information may be uploaded to the execution subject of the first embodiment, or may be transmitted to the execution subject of the first embodiment by other devices. The embodiment is not particularly limited as to how the original information is acquired.
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 a plurality of text sentences, for example, the original information is an article, and the article includes a plurality of text sentences. If the original information includes a plurality of text sentences, the original information can be divided into sentences to determine each text sentence contained in the original information. The clause dividing of the original information may include dividing the original information according to punctuation marks (e.g., periods, semicolons) in the original information. In addition, the sentence division may be performed by another device, and the single sentence may be transmitted as the original information to the execution subject of the first embodiment.
After the original information is acquired, the execution main body in the first embodiment may execute the text classification task and the main body recognition task in parallel on the original information, and the text classification task and the main body recognition task may be performed simultaneously. If the original information includes a plurality of text sentences, performing a text classification task and a main body recognition task on the original information in parallel may include: and (after the sentence division is carried out on the original information), executing a text classification task and a main body identification task on any text sentence contained in the original information in parallel.
In one embodiment, performing the text classification task and the main body recognition task in parallel on the original information may include: and executing a text classification task and a main body identification task on the original information in parallel by using a multi-task model. Referring to fig. 5, the multitasking model is explained as follows:
in the first embodiment, the variation trend of the subject in the original information is abstracted into two parts, namely the viewpoint sentence and the subject. The main bodies include but are not limited to various accounts, users, merchants or enterprises, network service providers, organizations, and the like, each main body may be composed of two corresponding parameters, namely, attributes and trends, the attributes are used for characterizing the meaning or type or form of the main body, such as the above-mentioned accounts, users, merchants or enterprises, network service providers, organizations, and the like, and the attributes may also be referred to as main body names. For example, if the text sentence indicates that the live pig listing is expected to be accelerated, the live pig price is or will go down, the text sentence includes two main attributes of the live pig listing and the live pig price, the trend corresponding to the live pig listing is accelerated, and the trend corresponding to the live pig price is down. After the structure of the variation trend is defined, the structure can be modeled.
In one embodiment, a text classification task and a subject recognition task may be defined, and both may be deep learning tasks. The text classification task is used for judging whether a target sentence exists in the original information or not, and comprises the steps of judging whether each text sentence included in the original information is the target sentence or not, wherein the target sentence can be a viewpoint sentence, namely the text classification task is a text two-classification task; the main body identification task is used for determining whether main bodies exist in the original information or not and determining main body labels corresponding to the main bodies existing in the original information.
In one embodiment, a multitask model may be constructed, which may perform the text classification task and the subject recognition task in parallel (and at the same time). The multitask model can be constructed based on a multi-task framework, and the text classification task and the subject identification task are defined on the multi-task framework. multi-task: the multi-task learning is a combined learning, a plurality of tasks are learned in parallel, and results influence each other. In practical problems, a plurality of learning tasks are merged into one model to be completed, such as a text classification task and a subject recognition task. The multi-task framework is a learner that utilizes useful information contained in multiple learning tasks to help each learning task get more accurate results.
After the text classification task and the subject recognition task are defined, the BERT pre-training model may be selected as a shared parameter layer of a multi-task framework, that is, the BERT pre-training model may be selected as a shared parameter layer of the multi-task model, for example, as shown in fig. 4. Connecting the last hidden layer of the BERT pre-training model with a full link layer for subject recognition, and taking the hidden layer as a subtask layer of a subject recognition task; and connecting the first node (namely the node corresponding to the CLS) in the last hidden layer of the BERT pre-training model with a two-classification full-link layer for text classification, wherein the first node is used as a subtask layer of a text classification task.
Through the content, the modeling of the structure aiming at the variation trend is perfectly integrated into a multi-task algorithm framework, the compatibility of physical definition and algorithm definition is realized, and the multi-task model is formed.
In one embodiment, after the multitask model is constructed, the multitask model can be trained by using the samples. In particular, the samples used for training the multitask model carry class labels, and the class labels are obtained by taking Cartesian product of the entity labels and the sequence labeling labels. How to generate the samples is further explained below:
in one embodiment, an entity tag set can be constructed. In the first embodiment, the POS tag is used to represent rising, the NEG tag is used to represent falling, and the MID tag is used to represent flat. The tags representing the trend of change are fused with entity tags (entity tags are marked as P), so that an entity tag set { P _ POS, P _ NEG, P _ MID, O } (O generally represents a non-relational or negligible word) is constructed. Wherein, P can represent attributes, and POS, NEG, MID represent trends.
According to the BIESO labeling criteria, a sequence labeling label { B, I, E, S, O }, where B label represents the beginning (Begin) of an entity, I label represents the inside (inside), O label represents the outside (outside), E label represents the End (End) of an entity, and S represents a Single character entity (Single) may be determined.
Determining Cartesian products of the entity tag set and the sequence tagging tag set, wherein the Cartesian products are { 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 }. Wherein the product of the sequence tag and "O" is "O". The elements in the Cartesian product fuse the entity label and the sequence labeling label, thereby having the sequence labeling significance and the change trend significance of the entity. And each element in the Cartesian product is taken as a category label, and the category label has sequence labeling significance and change trend significance and can be used for representing the entity and the change trend. Because a single character can be labeled by an entity label and a sequence label, and the cartesian product is the fusion of the entity label and the sequence label, the original entity label set and sequence label set are expanded into a label set at word level (i.e. cartesian product), each character can correspond to a category label in the cartesian product, and the category label is used for representing whether the character is an entity (judged by the sequence label in the category label corresponding to the character) and a variation trend (determined by the variation trend label in the category label corresponding to the character).
In the first embodiment, word segmentation/sentence segmentation can be performed on a large amount of existing information such as articles or information, and the word level (i.e. single character) or the word level (i.e. single word) obtained after word segmentation/sentence segmentation is used as a sample to be labeled, so as to form a sample set to be labeled. And labeling the sample set to be labeled by using the elements in the Cartesian product, so that each sample corresponds to the elements in the Cartesian product and carries the elements in the corresponding Cartesian product, thereby forming a labeled sample set.
After the construction of the multitask model and the labeled sample set are completed, the labeled samples can be used for training the multitask model so as to determine various weight parameters of the multitask model, including updating parameters of the BERT model and performing fine-tune on the BERT model. It can also be seen that the text classification task and the subject recognition task defined above are supervised deep learning tasks. The trained multitask model may be deployed on the execution main body of the first embodiment, and is used for executing a text classification task and a main body recognition task on original information in parallel, and determining a text classification result (i.e., an execution result of the text classification task) and a main body recognition result (i.e., an execution result of the main body recognition task) of the original information.
In addition, the multitask model may be built and trained by the execution main body of the first embodiment, or may be built or trained by other devices and deployed on the execution main body of the first embodiment.
S103: determining whether a target sentence exists in the original information according to a text classification result, determining whether a main body exists in the original information according to a main body identification result, and determining a main body label corresponding to each main body existing in the original information;
after determining the text classification result of the original information, the execution main body according to the first embodiment may determine whether a target sentence exists in the original information according to the text classification result, that is, determine whether each text sentence included in the original information is a target sentence, including determining whether each text sentence included in the original information is a viewpoint sentence. Wherein, determining whether each text sentence contained in the original information is a target sentence comprises: and for any text sentence contained in the original information, determining whether the text sentence is the target sentence or not according to the output data (namely the text classification result) of the full link layer (namely the two-classification full link layer) of the text classification task. For example, a threshold may be set, and by determining the output data of the two-classification full link layer and the threshold, it is determined whether the text sentence is the target sentence.
After determining the main body identification result of the original information, the execution main body in the first embodiment may determine whether a main body exists in the original information, and determine a main body tag corresponding to any main body existing in the original information. Wherein the subject identification result includes a sequence labeling result of the original information, and determining whether the subject exists in the original information may include: and determining whether the main body exists in the original information according to the sequence marking result of the original information.
Determining the body label corresponding to each body in which the original information exists may include: and for any main body existing in the original information, determining a main body label corresponding to the main body according to the output data of the full link layer of the main body identification task. Because the sample used for training the multitask model has the category label, each character in the original information is used as or corresponds to one token in the process of executing the subject recognition task by adopting the multitask model, and therefore the category label of each character in the original information or the token corresponding to each character can be determined. In a first embodiment, determining a body label corresponding to each body in which the original information exists may include: determining the category label of each token corresponding to any main body in the original information; and determining a main body label corresponding to the main body according to the category label of each token corresponding to the main body. Determining the subject label corresponding to the subject according to the category label of each token corresponding to the subject may include: and regarding any token corresponding to the main body, taking the entity label in the category label of the token as the main body label corresponding to the main body. This is because the entity labels in the category labels of the tokens corresponding to the same subject are the same. For example, if the class labels of two tokens corresponding to a certain subject are P _ POS _ B and P _ POS _ I, respectively, the entity label in the class label, i.e., P _ POS, of any token corresponding to the subject is taken as the subject label of the subject.
Specifically, each character in a single text sentence in the original information corresponds to a token of a multitask model (specifically, a BERT model), so if any main body contains one character, the token corresponding to the character is the token corresponding to the main body; if any body contains a plurality of characters, the token corresponding to each character contained in the body is the token corresponding to the body.
S105: and if the original information has the target sentence, determining a trend judgment result of the target subject according to a subject label corresponding to the target subject contained in the target sentence (an execution subject).
Note that a plurality of text sentences may exist in the original information, and some text sentences may have a tendency of changing between the main body and the main body even if they are not the target sentence, as described in the above viewpoint sentence. For example, "some interviewees consider the price of live pigs to be in a downward trend" is not a target sentence, but the subject of "price of live pigs" and the trend of "downward" are still present. In general, the first concern of the embodiment is the tendency of the subject to change in the target sentence.
In the first embodiment, when the target sentence exists in the original information, the execution subject in the first embodiment may use a subject existing in the determined target sentence as a target subject, and determine a trend determination result of the target subject according to a subject tag corresponding to the target subject. Determining a trend judgment result of the target subject according to the subject label corresponding to the target subject may include: and judging the variation 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 fall, so the trend of the target subject is determined as a fall trend, and the trend of the target subject is determined as fall or the like.
The first embodiment is further illustrated below by way of a non-limiting example:
for example, the original information includes a text sentence "pork price and beef price rise and fall respectively", and a text classification task and a subject recognition task are performed on the text sentence using a multitask model.
Specifically, the text sentence is subjected to ID conversion, and the text sentence is converted into a vector by using a dictionary. Since the text sentence is 16 in length, the text sentence is converted into a 16-dimensional vector.
The 16-dimensional vector is complemented according to a defined maximum length (max _ seq), e.g. the defined maximum length is 128-dimensional, the 16-dimensional vector is complemented to 128-dimensional.
Inputting the 128-dimensional vector into a BERT model and outputting a 16 x 768-dimensional vector;
the vector of 1 x 768 dimensions output by [ CLS ] of the BERT model is input into a full link layer of 768 x 1 (a full link layer of a text classification task), and the vector of 1 x 1 dimensions, namely a single value, is obtained. And carrying out sigmoid normalization on the single value to obtain output data of a full link layer of the text classification task, namely the normalized value. A preset threshold value is 0.5, and if the output data of the full link layer of the text classification task is greater than 0.5, the text sentence is judged to be a target sentence, namely, a viewpoint sentence; and if the output data of the full link layer of the text classification task is not more than 0.5, judging that the text sentence is not the target sentence, namely not the viewpoint sentence. In the following, it is assumed that the text sentence is a target sentence.
Each word in the text sentence corresponds to one token, each token (1 × 768 vector) of the BERT model is followed by a full link layer (full link layer of the body recognition task) of 768 × num _ label (num _ label is the number of elements in the cartesian product, that is, the number of category labels, where num _ label is 15 in the cartesian product, so the following description will be given by taking num _ label as 15 as an example), thereby performing body recognition and obtaining a 1 × 15-dimensional vector corresponding to each token. And performing softmax normalization on the 1 x 15-dimensional vector corresponding to each token to obtain the normalized 1 x 15-dimensional vector (referred to as the 1 x 15-dimensional normalized vector) corresponding to each token.
For any token, the value of each element in the 1 x 15 dimensional normalized vector corresponding to the token represents the probability that the class label of the token is the corresponding element in the above cartesian product. That is, the value of the 1 st element in the 1 x 15-dimensional normalized vector corresponding to the token represents the probability that the class label of the token is the 1 st element in the above cartesian product; the value of the 2 nd element in the 1 x 15 dimensional normalized vector corresponding to the token represents the probability that the class label of the token is the 2 nd element in the above cartesian product; by analogy, the value of the 15 th element in the 1 × 15-dimensional normalized vector corresponding to the token represents the probability that the class label of the token is the 15 th element in the cartesian product, and the element with the highest probability is the class label of the token, as shown in table 1 below:
token or character Category label
Pig P_POS_B
Meat P_POS_I
Price of P_POS_I
Grid (C) P_POS_E
And O
cattle P_NEG_B
Meat P_NEG_I
Price of P_NEG_I
Grid (C) P_NEG_E
Is divided into O
Clip for fixing O
On the upper part O
Lifting of wine O
And O
lower part O
Descend O
TABLE 1
As can be seen, the above target sentence includes two target subjects of "pork price" and "beef price". For the category label of any token of the 4 tokens corresponding to the "pork price", the entity labels contained in the category labels are all P _ POS, so that the subject label corresponding to the target subject of the "pork price" is P _ POS, which indicates that the trend of the target subject of the "pork price" is an increasing trend, and the trend judgment result of the target subject is an increasing or rising or similar result; for the category label of any token of the 4 tokens corresponding to the "beef price", the entity labels included in the category label are P _ NEG, so that the subject label corresponding to the target subject of the "beef price" is P _ NEG, which indicates that the trend of the target subject of the "beef price" is a falling trend, and the trend judgment result of the target subject is a falling or descending or similar result. Of course, the trend determination result may be presented to the user in a suitable manner, such as a text or a chart or other forms, and the embodiment is not limited in particular.
The above examples are merely examples, which may be applied to any text sentence, and the steps or processes in the above examples are not exclusive, and for example, normalization may be performed in various ways.
In the first embodiment, a text classification task and a subject recognition task are executed in parallel on original information, and text classification and subject recognition are performed simultaneously, that is, a target sentence and a subject are determined simultaneously from the original information (rather than a viewpoint sentence and a viewpoint subject being determined sequentially), and then a trend judgment result of the target subject is determined according to a subject label corresponding to the target subject in the target sentence. Because the text classification task and the main body recognition task can be executed in parallel and at the same time, namely, the target sentence and the main body are modeled at the same time, the system performance utilization rate can be improved, the time for judging the change trend of the target main body in the original information is shortened, and the efficiency for judging the change trend of the target main body in the original information is improved.
In the first embodiment, the physical structure of the viewpoint system is integrated into the multitask model, the BERT model is used as a shared parameter layer, the text classification task and the main body recognition task can share parameters, the viewpoint three elements share the parameter layer, more text prior information can be utilized, the multitask can be subjected to parallel calculation and mutual promotion, the sample data utilization rate is improved, the text classification effect and the main body recognition effect are improved, and therefore the change trend judgment efficiency of the target main body in the original information is improved.
In the first embodiment, only one multi-task model is needed, simultaneous training and simultaneous parallel execution of the text classification task and the subject recognition task can be realized, and simultaneous extraction of three factors of viewpoints can be realized, so that the efficiency of judging the change trend of the target subject in the original information can be improved. A plurality of tasks of the multi-task model are mutually promoted, so that each sample data can be fully utilized, multi-task parallel computing is realized, and computing efficiency and the effect and efficiency of judging the change trend of the target subject in the original information are improved.
In the first embodiment, the change trend is integrated into the main body recognition task in a mode of entity tags (POS, NEG, MID), and no matter how many main bodies exist in a single text sentence, each main body can correspond to the change trend, so that the method can be applied to complex original information of single main bodies and multiple main bodies, and the application range is wider.
A second embodiment (hereinafter, referred to as "second embodiment") of this specification provides a data processing method, and an execution subject of the second embodiment may be a terminal (including but not limited to a mobile phone, a computer, a pad, a television), or a server, or an operating system, or an application program, or a data processing platform, or a data processing system, and the like, that is, the execution subject may be various and may be set, used, or changed as needed. In addition, a third party application may also assist the execution principal in executing embodiment two. For example, as shown in fig. 2, the data processing method in the second embodiment may be executed by a server, and an application program (corresponding to the server) may be installed on a terminal (held by a user), so that data transmission may be performed between the terminal or the application program and the server, and data collection or input or output or page or information processing may be performed by the terminal or the application program, so as to assist the server in executing the data processing method in the second embodiment.
As shown in fig. 6, the data processing method according to the second embodiment includes:
s202: constructing a multitask model (an execution main body), training the multitask model by using a first category sample, and executing the text classification task and the main body recognition task in parallel on original information belonging to a first category by using the multitask model trained by using the first category sample;
the execution subject of the second embodiment may construct a multitask model, train the multitask model using the first type of sample, and execute the text classification task and the subject recognition task described in the first embodiment and other processes in parallel on the original information belonging to the first type of the multitask model after being trained using the first type of sample, so as to determine a trend determination result of the target subject in the "original information of the first type".
It can be seen that the execution subject of the second embodiment can also execute all the processes of the first embodiment, except that the samples in the second embodiment are defined as the first category samples, and the original information in the second embodiment is defined as the original information of the first category.
S204: (execution subject) replacing the first class sample with a second class sample part, repeatedly training the multitask model by using the second class sample and the first class sample which is not replaced, and executing the text classification task and the subject identification task in parallel on original information belonging to the first class or the second class by using the repeatedly trained multitask model; or, replacing the first category sample with a second category sample, repeatedly training the multitask model by using the second category sample, and executing the text classification task and the subject recognition task in parallel on the original information belonging to the second category by using the repeatedly trained multitask model.
(1) In the second embodiment, the executing entity may replace a part of the first category sample with a second category sample, repeatedly train the multitask model using the second category sample and the first category sample that is not replaced, perform the text classification task and the entity recognition task, and other processes in parallel on the original information belonging to the first category or the second category of the repeatedly trained multitask model, so as to determine a trend determination result of the target entity in the "original information of the first category or the second category", that is, determine a trend determination result of the target entity in the original information of the first category, and determine a trend determination result of the target entity in the original information of the second category.
The above-described model training process and the process of executing the text classification task and the subject recognition 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.
It can be seen that since the multitask model is trained by using the first class sample and the second class sample, the multitask model trained by the first class sample and the second class sample can be used for determining the trend judgment result of the target subject in the "original information of the first class or the second class".
(2) The executive agent of the first embodiment may replace all the first category samples with the second category samples, repeatedly train the multitask model by using the second category samples, and execute the text classification task and the agent recognition task, as well as other processes, in parallel on the original information belonging to the second category, of the repeatedly trained multitask model, so as to determine a trend determination result of the target agent in the "original information of the second category".
The above-described model training process and the parallel execution of the text classification task and the subject recognition task in order to determine the trend judgment result of the target subject in the "original information of the second category" refer to the first embodiment.
It can be seen that since the multitask model is trained by using the second category sample, the multitask model trained by the second category sample can be used for determining the trend judgment result of the target subject in the "original information of the second category".
In the first embodiment, each subject has two parts of attribute and trend, and the sample also has two parts of attribute and trend. When the samples of the first category and the second category are replaced, only the attribute part (also called as a key word group) of the samples of the first category needs to be replaced by the attribute of the samples of the second category, so that the sample pool composed of the first samples can be changed into the sample pool composed of the first samples and the second samples or the sample pool composed of the second samples.
Since the second embodiment can perform all the processes of the first embodiment, the second embodiment has the advantages described in the first embodiment.
Because the samples and the original information can be of the same type, the multitask model trained by the first type sample and/or the second type sample is used for determining the trend judgment result of the target subject in the original information of the first type and/or the second type.
The category in the second embodiment may be set as required, and includes that different scenes are taken as different categories, for example, the first category corresponds to a financial scene, the second category corresponds to an instant messaging scene, and the like. Through partial or complete replacement among samples of different categories, the trained multitask model can be used for judging the change trend of the target subject in the original information of different categories or multiple categories, namely, the data processing method in the first embodiment can be applied to the original information of different categories or multiple categories, namely, the data processing method in the first embodiment is migrated and reused on the original information of different categories or multiple categories. Since the category may correspond to a scene, migration application and multiplexing of the data processing method in the first embodiment on different scenes or multiple scenes are also achieved.
Because the migration application of the data processing method in the first embodiment on different scenes is realized through sample replacement, no matter what kind of scenes the sample pool for training the multitask model is used for, the sample pool for training the multitask model can be shared, and the migration application and multiplexing of the data processing method in the first embodiment on different scenes or multiple scenes can be realized only by partially or completely changing the sample types in the sample pool.
Particularly, only a small part of samples of a certain category needs to be replaced by samples of other categories, for example, the second sample, and a large number of samples do not need to be regenerated for each category, so that the migration application of the data processing method in the first embodiment on the original information of different categories can be realized, and the difficulty and complexity of multiplexing and migrating the multitask model are reduced.
Since the change trend judgment of the target subject in the original information can be realized only by one multitask model in the first embodiment and the second embodiment, only one multitask model needs to be trained again when the migration between different types or different scenes is performed, and the smaller the number of the models needing to be trained is, the better the migration and reuse efficiency is improved.
In the second embodiment, if part of the first category samples are replaced with the second category samples, the replaced first category samples can be randomly selected, so as to improve the universality of the second category samples.
In the first embodiment and the second embodiment, the samples are positioned in a structure of attributes and trends, which has universality, and only the attributes in the samples need to be replaced, so that a certain type of samples can be replaced by other types of samples, for example, the attributes in the first type of samples are attributes in financial scenes such as financial accounts, banks and payment institutions, and can be replaced by attributes in social scenes such as social accounts and media, that is, the samples in financial categories are replaced by the samples in social categories, and the tags such as POS, NEG, MID and O for replacing the samples in different categories can be unchanged, for example, as shown in fig. 7, so that the difficulty and complexity of sample replacement can be reduced.
The execution subject of the first embodiment or the second embodiment may be a node in a blockchain, and each item of data, such as the multitask model deployed by the execution subject of the first embodiment or the second embodiment and the determined target sentence, subject label, and the like, may be (through consensus) stored in other nodes of the blockchain where the execution subject of the first embodiment or the second embodiment is located, so as to implement distributed storage of each item of data, and prevent each item of data from being tampered with, and at the same time, each other node may also serve as the execution subject of the first embodiment or the second embodiment, and execute the content described in the first embodiment or the second embodiment.
As shown in fig. 8, a third embodiment of the present specification provides a data processing apparatus corresponding to the data processing method according to the first embodiment, including:
a task module 301, configured to obtain original information, execute a text classification task and a main body recognition task in parallel on the original information, and determine a text classification result and a main body recognition result of the original information;
an analysis module 303, configured to determine whether a target sentence exists in the original information according to a text classification result, determine whether a main body exists in the original information according to a main body identification result, and determine a main body label corresponding to each main body existing in the original information;
a determining module 305, configured to determine a trend determining result of the target subject according to a subject tag corresponding to the target subject included in the target sentence if the original information has the target sentence.
Optionally, performing text classification and body recognition on the original information in parallel includes:
and executing a text classification task and a main body identification task on the original information in parallel by using a multi-task model.
Optionally, the apparatus further comprises:
and the model module is used for constructing a multi-task model, and the multi-task model adopts a BERT pre-training model as a shared parameter layer.
Optionally, constructing the multitask model includes:
connecting the last hidden layer of the BERT pre-training model with the full link layer of the main body recognition task, and connecting the first node in the last hidden layer of the BERT pre-training model with the full link layer of the text classification task to form the multi-task model.
Optionally, determining whether the target sentence exists in the original information according to the text classification result includes:
for any text sentence contained in the original information, determining whether the text sentence is a target sentence or not according to the output data of the full link layer of the text classification task;
and/or the presence of a gas in the gas,
determining the body label corresponding to each body existing in the original information includes:
for any main body existing in the original information, determining a main body label corresponding to the main body according to the output data of the full link layer of the main body identification task;
and/or the presence of a gas in the gas,
the subject identification result comprises a sequence annotation result; determining whether a subject exists in the original information according to a subject recognition result includes:
and determining whether a main body exists in the original information according to the sequence labeling result.
Optionally, the model module is further configured to: before executing a text classification task and a main body recognition task on the original information in parallel by using a multi-task model, training the multi-task model by using a sample; the sample carries a class label, and the class label is obtained by taking Cartesian product of an entity label and a sequence label.
Optionally, the model module is further configured to: constructing an entity label set, and determining Cartesian products of the entity label set and a sequence labeling label set, wherein each element in the Cartesian products is used as a category label;
optionally, determining the body label corresponding to each body existing in the original information includes:
determining the category label of each token corresponding to any main body existing in the original information;
and determining a main body label corresponding to the main body according to the category label of each token corresponding to the main body.
Optionally, determining, according to the category label of each token corresponding to the main body, that the main body label corresponding to the main body includes:
and regarding any token corresponding to the main body, taking the entity label in the category label of the token as the main body label corresponding to the main body.
Optionally, determining a trend judgment result of the target subject according to the subject label corresponding to the target subject included in the target sentence includes:
and judging the variation trend of the target subject according to the subject label of the target subject contained in the target sentence, and determining the trend judgment result of the target subject.
Optionally, performing a text classification task and a main body recognition task on the original information in parallel includes:
and executing a text classification task and a main body identification task in parallel on any text sentence contained in the original information.
Optionally, performing a text classification task and a main body recognition task on the original information in parallel includes:
and performing a text classification task and a main body recognition task on the original information in parallel.
As shown in fig. 9, a fourth embodiment of this specification provides a data processing apparatus corresponding to the data processing method according to the second embodiment, including:
an application module 402, configured to construct a multitask model, train the multitask model using a first category sample, and execute the text classification task and the subject recognition task described in the first embodiment or the second embodiment in parallel on original information belonging to the first category of the multitask model trained using the first category sample;
a migration module 404, configured to use a second class sample to partially replace the first class sample, use the second class sample and the first class sample that is not replaced to repeatedly train the multitask model, and execute the text classification task and the subject recognition task described in embodiment one or embodiment two in parallel on original information belonging to the first class or the second class of the repeatedly trained multitask model; or, replacing the first class sample with a second class sample, repeatedly training the multitask model by using the second class sample, and executing the text classification task and the subject recognition task in parallel on the original information belonging to the second class of the repeatedly trained multitask model.
Optionally, the migration module 404 is further configured to: if the second class sample is partially substituted for the first class sample, the substituted first class sample is randomly selected.
A fifth embodiment of the present specification provides a data processing apparatus including:
at least one processor;
and the number of the first and second groups,
a memory communicatively coupled to the at least one processor;
wherein,
the memory stores instructions executable by the at least one processor, the instructions being executable by the at least one processor to enable the at least one processor to perform the data processing method of embodiment one or embodiment two.
A sixth embodiment of the present specification provides a computer-readable storage medium storing computer-executable instructions that, when executed by a processor, implement the data processing method of the first or second embodiment.
The above embodiments may be used in combination, and the modules having the same name between different embodiments or within the same embodiment may be the same or different modules.
While certain embodiments of the present disclosure have been described above, other embodiments are within the scope of the following claims. In some cases, the actions or steps recited in the claims may be performed in a different order than in the embodiments and still achieve desirable results. In addition, the processes depicted in the accompanying figures do not necessarily have to be in the particular order shown or in sequential order to achieve desirable results. In some embodiments, multitasking and parallel processing may also be possible or may be advantageous.
The embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the apparatus, device, and non-volatile computer-readable storage medium embodiments, since they are substantially similar to the method embodiments, the description is relatively simple, and in relation to the description, reference may be made to some portions of the description of the method embodiments.
The apparatus, the device, the nonvolatile computer readable storage medium, and the method provided in the embodiments of the present specification correspond to each other, and therefore, the apparatus, the device, and the nonvolatile computer storage medium also have similar advantageous technical effects to the corresponding method.
In the 90 s of the 20 th century, improvements in a technology could clearly distinguish between improvements in hardware (e.g., improvements in circuit structures such as diodes, transistors, switches, etc.) and improvements in software (improvements in process flow). However, as technology advances, many of today's process flow improvements have been seen as direct improvements in hardware circuit architecture. Designers almost always obtain the corresponding hardware circuit structure by programming an improved method flow into the hardware circuit. Thus, it cannot be said that an improvement in the process flow cannot be realized by hardware physical modules. For example, a Programmable Logic Device (PLD), such as a Field Programmable Gate Array (FPGA), is an integrated circuit whose Logic functions are determined by programming the Device by a user. A digital system is "integrated" on a PLD by the designer's own programming without requiring the chip manufacturer to design and fabricate application-specific integrated circuit chips. Furthermore, nowadays, instead of manually making an Integrated Circuit chip, such Programming is often implemented by "logic compiler" software, which is similar to a software compiler used in program development and writing, but the original code before compiling is also written by a specific Programming Language, which is called Hardware Description Language (HDL), and HDL is not only one but many, such as abel (advanced Boolean Expression Language), ahdl (alternate Hardware Description Language), traffic, pl (core universal Programming Language), HDCal (jhdware Description Language), lang, Lola, HDL, laspam, hardward Description Language (vhr Description Language), vhal (Hardware Description Language), and vhigh-Language, which are currently used in most common. It will also be apparent to those skilled in the art that hardware circuitry that implements the logical method flows can be readily obtained by merely slightly programming the method flows into an integrated circuit using the hardware description languages described above.
The controller may be implemented in any suitable manner, for example, the controller may take the form of, for example, a microprocessor or processor and a computer-readable medium storing computer-readable program code (e.g., software or firmware) executable by the (micro) processor, logic gates, switches, an Application Specific Integrated Circuit (ASIC), a programmable logic controller, and an embedded microcontroller, examples of which include, but are not limited to, the following microcontrollers: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicone Labs C8051F320, the memory controller may also be implemented as part of the control logic for the memory. Those skilled in the art will also appreciate that, in addition to implementing the controller as pure computer readable program code, the same functionality can be implemented by logically programming method steps such that the controller is in the form of logic gates, switches, application specific integrated circuits, programmable logic controllers, embedded microcontrollers and the like. Such a controller may thus be considered a hardware component, and the means included therein for performing the various functions may also be considered as a structure within the hardware component. Or even means for performing the functions may be regarded as being both a software module for performing the method and a structure within a hardware component.
The systems, devices, modules or units illustrated in the above embodiments may be implemented by a computer chip or an entity, or by a product with certain functions. One typical implementation device is a computer. In particular, the computer may be, for example, a personal computer, a laptop computer, a cellular telephone, a camera phone, a smartphone, 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.
For convenience of description, the above devices are described as being divided into various units by function, and are described separately. Of course, the functions of the various elements may be implemented in the same one or more software and/or hardware implementations of the present description.
As will be appreciated by one skilled in the art, the present specification embodiments may be provided as a method, system, or computer program product. Accordingly, embodiments of the present description may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, embodiments of the present description may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and so forth) having computer-usable program code embodied therein.
The description has been presented with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the description. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include forms of volatile memory in a computer readable medium, Random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of a computer-readable medium.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, 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 disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape disk storage or other magnetic storage devices, or any other non-transmission medium which can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
This description may be described in the general context of computer-executable instructions, such as program modules, being executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform particular tasks or implement particular abstract data types. The specification may also be practiced in distributed computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed computing environment, program modules may be located in both local and remote computer storage media including memory storage devices.
The embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the system embodiment, since it is substantially similar to the method embodiment, the description is simple, and for the relevant points, reference may be made to the partial description of the method embodiment.
The above description is only an example of the present specification, and is not intended to limit the present application. Various modifications and changes may occur to those skilled in the art. 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 (17)

1. A method of data processing, comprising:
acquiring original information, executing a text classification task and a main body identification task on the original information in parallel, and determining a text classification result and a main body identification result of the original information;
determining whether a target sentence exists in the original information according to a text classification result, determining whether a main body exists in the original information according to a main body identification result, and determining a main body label corresponding to each main body existing in the original information;
and if the original information has the target sentence, determining a trend judgment result of the target subject according to a subject label corresponding to the target subject contained in the target sentence.
2. The method of claim 1, wherein performing text classification and body recognition on the raw information side-by-side comprises:
and executing a text classification task and a main body identification task on the original information in parallel by using a multi-task model.
3. The method of claim 2, further comprising:
and constructing a multi-task model, wherein the multi-task model adopts a BERT pre-training model as a shared parameter layer.
4. The method of claim 3, constructing a multitask model comprising:
connecting the last hidden layer of the BERT pre-training model with the full link layer of the main body recognition task, and connecting the first node in the last hidden layer of the BERT pre-training model with the full link layer of the text classification task to form the multi-task model.
5. The method of claim 4, wherein determining whether the target sentence exists in the original information according to the text classification result comprises:
for any text sentence contained in the original information, determining whether the text sentence is a target sentence or not according to the output data of the full link layer of the text classification task;
and/or the presence of a gas in the gas,
determining the body label corresponding to each body existing in the original information includes:
for any main body existing in the original information, determining a main body label corresponding to the main body according to the output data of the full link layer of the main body identification task;
and/or the presence of a gas in the gas,
the subject identification result comprises a sequence annotation result; determining whether a subject exists in the original information according to a subject recognition result includes:
and determining whether a main body exists in the original information according to the sequence labeling result.
6. The method of claim 2, prior to performing a text classification task and a subject recognition task in parallel on the raw information using a multi-task model, the method further comprising: training the multitask model using samples;
the sample carries a class label, and the class label is obtained by taking Cartesian product of an entity label and a sequence label.
7. The method of claim 1, further comprising:
constructing an entity label set, and determining Cartesian products of the entity label set and a sequence labeling label set, wherein each element in the Cartesian products is used as a category label;
determining the body label corresponding to each body existing in the original information includes:
determining the category label of each token corresponding to any main body existing in the original information;
and determining a main body label corresponding to the main body according to the category label of each token corresponding to the main body.
8. The method of claim 7, wherein determining the subject label corresponding to the subject according to the category label of each token corresponding to the subject comprises:
and regarding any token corresponding to the main body, taking the entity label in the category label of the token as the main body label corresponding to the main body.
9. The method of claim 1, wherein determining a trend determination result of the target subject according to a subject label corresponding to the target subject included in the target sentence comprises:
and judging the variation trend of the target subject according to the subject label of the target subject contained in the target sentence, and determining the trend judgment result of the target subject.
10. The method of claim 1, performing a text classification task and a subject recognition task in parallel on the original information comprises:
and executing a text classification task and a main body identification task in parallel on any text sentence contained in the original information.
11. The method of any of claims 1-10, performing a text classification task and a subject recognition task side-by-side on the original information comprises:
and performing a text classification task and a main body recognition task on the original information in parallel.
12. A method of data processing, comprising:
constructing a multitask model, training the multitask model by using a first category sample, and executing a text classification task and a subject recognition task in parallel on original information belonging to a first category by using the multitask model trained by using the first category sample according to any one of claims 1 to 11;
partially replacing the first class sample with a second class sample, repeatedly training the multitask model by using the second class sample and the first class sample which is not replaced, and executing the text classification task and the subject identification task in parallel according to any one of claims 1 to 11 on original information belonging to a first class or a second class by using the repeatedly trained multitask model; or,
replacing the first class sample with a second class sample, repeatedly training the multitask model by using the second class sample, and executing the text classification task and the subject recognition task in parallel on original information belonging to a second class by using the repeatedly trained multitask model.
13. The method of claim 2, if a second class sample portion is used in place of the first class sample, the method further comprising:
randomly selecting the replaced first category sample.
14. A data processing apparatus comprising:
the task module is used for acquiring original information, executing a text classification task and a main body recognition task on the original information in parallel and determining a text classification result and a main body recognition result of the original information;
the analysis module is used for determining whether a target sentence exists in the original information according to a text classification result, determining whether a main body exists in the original information according to a main body identification result, and determining a main body label corresponding to each main body existing in the original information;
and the judging module is used for determining a trend judging result of the target subject according to a subject label corresponding to the target subject contained in the target sentence if the original information has the target sentence.
15. A data processing apparatus comprising:
an application module, configured to construct a multitask model, train the multitask model using a first category sample, and execute the text classification task and the subject recognition task according to any one of claims 1 to 13 in parallel on original information belonging to a first category of the multitask model after being trained using the first category sample;
a migration module, configured to partially replace the first category sample with a second category sample, repeatedly train the multitask model using the second category sample and the first category sample that is not replaced, and execute the text classification task and the subject recognition task in parallel according to any one of claims 1 to 13 on original information belonging to the first category or the second category of the repeatedly trained multitask model; or, replacing the first class sample with a second class sample, repeatedly training the multitask model by using the second class sample, and executing the text classification task and the subject identification task in parallel according to any one of claims 1 to 13 on the original information belonging to the second class by using the repeatedly trained multitask model.
16. A data processing apparatus comprising:
at least one processor;
and the number of the first and second groups,
a memory communicatively coupled to the at least one processor;
wherein,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the data processing method of any one of claims 1 to 13.
17. A computer-readable storage medium storing computer-executable instructions that, when executed by a processor, implement the data processing method of any one of claims 1 to 13.
CN202111076630.3A 2021-09-14 2021-09-14 Data processing method, device, equipment and medium Pending CN113849640A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111076630.3A CN113849640A (en) 2021-09-14 2021-09-14 Data processing method, device, equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111076630.3A CN113849640A (en) 2021-09-14 2021-09-14 Data processing method, device, equipment and medium

Publications (1)

Publication Number Publication Date
CN113849640A true CN113849640A (en) 2021-12-28

Family

ID=78974201

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111076630.3A Pending CN113849640A (en) 2021-09-14 2021-09-14 Data processing method, device, equipment and medium

Country Status (1)

Country Link
CN (1) CN113849640A (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20190188260A1 (en) * 2017-12-14 2019-06-20 Qualtrics, Llc Capturing rich response relationships with small-data neural networks
WO2020073507A1 (en) * 2018-10-11 2020-04-16 平安科技(深圳)有限公司 Text classification method and terminal
CN111563164A (en) * 2020-05-07 2020-08-21 成都信息工程大学 Specific target emotion classification method based on graph neural network
US20200293720A1 (en) * 2018-02-01 2020-09-17 Tencent Technology (Shenzhen) Company Limited Text classification method, computer device, and storage medium
CN111967242A (en) * 2020-08-17 2020-11-20 支付宝(杭州)信息技术有限公司 Text information extraction method, device and equipment
CN113379386A (en) * 2021-06-16 2021-09-10 南京大学 Task allocation and pricing method based on multi-stage sampling

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20190188260A1 (en) * 2017-12-14 2019-06-20 Qualtrics, Llc Capturing rich response relationships with small-data neural networks
US20200293720A1 (en) * 2018-02-01 2020-09-17 Tencent Technology (Shenzhen) Company Limited Text classification method, computer device, and storage medium
WO2020073507A1 (en) * 2018-10-11 2020-04-16 平安科技(深圳)有限公司 Text classification method and terminal
CN111563164A (en) * 2020-05-07 2020-08-21 成都信息工程大学 Specific target emotion classification method based on graph neural network
CN111967242A (en) * 2020-08-17 2020-11-20 支付宝(杭州)信息技术有限公司 Text information extraction method, device and equipment
CN113379386A (en) * 2021-06-16 2021-09-10 南京大学 Task allocation and pricing method based on multi-stage sampling

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
张辰;冯冲;刘全超;师超;黄河燕;周海云;: "基于多特征融合的中文比较句识别算法", 中文信息学报, no. 06, 15 November 2013 (2013-11-15) *

Similar Documents

Publication Publication Date Title
CN111563551B (en) Multi-mode information fusion method and device and electronic equipment
CN106250385B (en) System and method for automated information abstraction processing of documents
CN108346107B (en) Social content risk identification method, device and equipment
CN111985229A (en) Sequence labeling method and device and computer equipment
CN111401058B (en) Attribute value extraction method and device based on named entity recognition tool
CN109902271A (en) Text data mask method, device, terminal and medium based on transfer learning
CN112257114A (en) Application privacy compliance detection method, device, equipment and medium
CN113221555A (en) Keyword identification method, device and equipment based on multitask model
CN110674188A (en) Feature extraction method, device and equipment
CN106611015A (en) Tag processing method and apparatus
CN111339311A (en) Method, device and processor for extracting structured events based on generative network
CN113704429A (en) Semi-supervised learning-based intention identification method, device, equipment and medium
CN109582774A (en) Natural language classification method, device, equipment and storage medium
CN112101526A (en) Knowledge distillation-based model training method and device
CN115344504B (en) Software test case automatic generation method and tool based on requirement specification
JP2023539470A (en) Automatic knowledge graph configuration
CN114332873A (en) Training method and device for recognition model
CN116245097A (en) Method for training entity recognition model, entity recognition method and corresponding device
CN113360654A (en) Text classification method and device, electronic equipment and readable storage medium
Aly et al. Pytext: A seamless path from nlp research to production
CN113222022A (en) Webpage classification identification method and device
CN111222315A (en) Film scenario prediction method
CN113887235A (en) Information recommendation method and device
Lamons et al. Python Deep Learning Projects: 9 projects demystifying neural network and deep learning models for building intelligent systems
CN113849640A (en) Data processing method, device, equipment and medium

Legal Events

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