CN115249017A - Text labeling method, intention recognition model training method and related equipment - Google Patents

Text labeling method, intention recognition model training method and related equipment Download PDF

Info

Publication number
CN115249017A
CN115249017A CN202110698706.XA CN202110698706A CN115249017A CN 115249017 A CN115249017 A CN 115249017A CN 202110698706 A CN202110698706 A CN 202110698706A CN 115249017 A CN115249017 A CN 115249017A
Authority
CN
China
Prior art keywords
target
text
intention
information
target text
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.)
Granted
Application number
CN202110698706.XA
Other languages
Chinese (zh)
Other versions
CN115249017B (en
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.)
Mashang Xiaofei Finance Co Ltd
Original Assignee
Mashang Xiaofei Finance 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 Mashang Xiaofei Finance Co Ltd filed Critical Mashang Xiaofei Finance Co Ltd
Priority to CN202110698706.XA priority Critical patent/CN115249017B/en
Publication of CN115249017A publication Critical patent/CN115249017A/en
Application granted granted Critical
Publication of CN115249017B publication Critical patent/CN115249017B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/30Semantic analysis
    • 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/08Learning methods

Landscapes

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

Abstract

The embodiment of the application provides a text labeling method, an intention recognition model training method and related equipment, wherein the method comprises the following steps: the method comprises the steps of performing intention recognition on a target text to be labeled through an intention recognition model obtained through pre-training to obtain an intention recognition result corresponding to the target text, and then generating an intention labeling label according to the intention recognition result of the target text. By adopting the embodiment of the application, the accuracy of text labeling can be improved.

Description

Text labeling method, intention recognition model training method and related equipment
Technical Field
The embodiment of the application relates to the technical field of machine learning, in particular to a text labeling method, an intention recognition model training method and related equipment.
Background
With the rapid development of scientific technology, more and more manual repeated mechanical labor is gradually replaced by artificial intelligence, and machine learning is taken as an important branch of artificial intelligence and is widely applied to various fields such as machine translation, artificial intelligence customer service, text detection and the like. The principle is to build and train a mathematical model based on sample data (also called training data) according to a machine learning algorithm, so that the mathematical model can be used for prediction or decision without explicit programming to perform tasks. At present, more mature and practical applications are supervised machine learning, which relies on a large amount of labeled data, that is, a large amount of historical data needs to be labeled with training labels to obtain sample data for training a mathematical model. However, the work of labeling data mainly depends on manual labeling, but the manual labeling efficiency is low, and the labeling of text data has strong subjectivity, so that the labeling accuracy is low.
In the related technology, in order to solve the problem of low efficiency and accuracy of manual labeling of data, a text data labeling method is provided, which mainly extracts classification matching rules and feature words from a corpus to be labeled, verifies the classification matching rules and the feature words, stores the classification matching rules into a rule base and the feature words into a feature word base after the verification is passed, and performs large-scale machine classification labeling on text data according to the rule base and the feature word base.
However, the text data tagging method needs to construct a matching rule base and a feature word base according to the corpus to be tagged, the effect of tagging data depends on the scale and the perfection degree of the matching rule base and the feature word base, and if the scale of the matching rule base and the feature word base is small and cannot completely contain the feature words and the classification rules of the corpus to be tagged, two sentences with the same semantics may be tagged with two different tags and tagging errors due to different feature words, so that the accuracy of text tagging is finally affected.
Disclosure of Invention
The embodiment of the application provides a text labeling method, an intention recognition model training method and related equipment, so as to improve the accuracy of text labeling.
In a first aspect, an embodiment of the present application provides a text annotation method, including:
acquiring a target text to be marked;
inputting the target text into an intention recognition model, and outputting an intention recognition result of the target text;
generating an intention labeling label of the target text according to the intention recognition result;
and labeling the target text according to the intention labeling label.
In the embodiment of the application, because the intention identification model can identify the intention of the text, the semantic intention of the text can be more accurately understood in the aspect of deep semantics, and then the intention labeling label generated according to the intention information can more accurately reflect the semantic characteristics of the text, and finally, the intention labeling label is used for labeling the text, so that the labeling generalization capability is stronger, namely, the labeling results of the texts with the same semantics are the same, the complexity of the labeling results is reduced, and the labeling accuracy is improved.
In a second aspect, an embodiment of the present application provides a method for training an intention recognition model, including:
extracting a target text set from a corpus, wherein the target text set comprises a plurality of texts, and each text corresponds to intention information;
and inputting the intention information corresponding to each text in the target text set and the target text set as a training set into a pre-established deep learning network for training to obtain an intention recognition model.
In the embodiment of the application, the intention recognition model is obtained by training the text based on a plurality of different intention information and the intention information of each text label, so that the intention of the text can be understood from the aspect of depth semantics by using the intention recognition model to recognize the intention of the text, the characteristics of the text can be reflected in the aspect of semantics, and the accuracy of subsequently labeling the text by using the text intention is improved.
In a third aspect, an embodiment of the present application provides a text annotation device, including:
the text acquisition module is used for acquiring a target text to be labeled;
the intention recognition module is used for inputting the target text into an intention recognition model and outputting an intention recognition result of the target text;
the label generating module is used for generating an intention labeling label of the target text according to the intention identification result;
and the text labeling module is used for labeling the target text according to the intention labeling label.
In a fourth aspect, an embodiment of the present application provides a training apparatus for an intention recognition model, including:
the extraction module is used for extracting a target text set from a corpus, wherein the target text set comprises a plurality of texts, and each text corresponds to intention information;
and the training module is used for inputting intention information corresponding to each text in the target text set and the target text set as a training set into a pre-established deep learning network for training to obtain an intention recognition model.
In a fifth aspect, an embodiment of the present application provides a computer device, including: at least one processor and memory;
the memory stores computer-executable instructions;
the at least one processor executes the computer-executable instructions stored in the memory, so that the at least one processor executes the text annotation method according to the first aspect or the training method of the intention recognition model according to the second aspect of the embodiments of the present application.
In a sixth aspect, an embodiment of the present application provides a computer-readable storage medium, where a computer executable instruction is stored in the computer-readable storage medium, and when a processor executes the computer executable instruction, the text labeling method according to the first aspect or the training method for the intention recognition model according to the second aspect of the embodiment of the present application is implemented.
In a seventh aspect, an embodiment of the present application provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, the method for text annotation according to the first aspect or the method for training an intention recognition model according to the second aspect of the embodiment of the present application is implemented.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the description below are only some embodiments of the present application, and it is also possible for those skilled in the art to obtain other drawings based on these drawings without inventive labor.
FIG. 1 is a schematic diagram of an implementation environment of a text annotation method according to an exemplary embodiment of the present application;
FIG. 2 is a flowchart illustrating a text annotation method according to an exemplary embodiment of the present application;
FIG. 3 is a diagram illustrating an application scenario of a text annotation method according to an exemplary embodiment of the present application;
FIG. 4 is a flowchart illustrating a text annotation method according to another exemplary embodiment of the present application;
FIG. 5 is a flowchart illustrating a text annotation process according to another exemplary embodiment of the present application;
FIG. 6 is a flowchart illustrating a method of training an intent recognition model in accordance with an exemplary embodiment of the present application;
FIG. 7 is a visual scene diagram of a text annotation method according to an exemplary embodiment of the present application;
FIG. 8 is a schematic diagram illustrating a deep learning network according to an exemplary embodiment of the present application;
FIG. 9 is a schematic structural diagram of a text annotation device according to an exemplary embodiment of the present application;
FIG. 10 is a schematic diagram illustrating an exemplary embodiment of a training apparatus for an intent recognition model;
fig. 11 is a schematic structural diagram of a computer device according to an exemplary embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any inventive effort, shall fall within the scope of protection of the present application.
The terms "first," "second," "third," "fourth," and the like in the description and in the claims of the present application and in the drawings described above, if any, are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the application described herein are, for example, capable of operation in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
In various fields such as intelligent customer service question answering and network searching, questions proposed by users need to be answered, namely, suitable answers are matched in an information database aiming at the questions proposed by the users. However, different users may ask different questions for different situations, and different users may express different questions for the same situation, so that it is necessary to label various text expressions and search the information database for appropriate answers according to the labels. In the related technology, a text data labeling method is provided, which mainly comprises the steps of screening out representative corpora from corpora to be labeled as typical corpora, and extracting key features from the typical corpora; and then extracting matching rules and feature words corresponding to classification according to the key features, verifying the classification matching rules and the feature words, storing the classification matching rules into a rule base and the feature words into a feature word base after the verification is passed, carrying out large-scale machine classification labeling on the text data according to the rule base and the feature word base, and then carrying out auditing and checking on the machine labeled data manually. That is to say, the existing text data tagging method needs to construct a matching rule base and a feature word base according to the corpus to be tagged, for example, the corpus to be tagged includes 100 texts, then some representative texts need to be selected from the 100 texts according to the existing method, assuming that 20 texts are selected from the 100 texts as typical corpus, analyzing the 20 texts to extract key features, such as keywords in the texts, such as entity names, subject languages, behavior information, and the like, then extracting matching rules and feature words corresponding to the classification according to the key features, storing the matching rules and feature words extracted from the 20 texts into the rule base and the feature word base, and then tagging the 100 texts to be tagged according to the rule base and the feature word base.
However, the effect of the existing method on text labeling depends on the scale and perfection of the matching rule base and the feature word base, and if the scale of the matching rule base and the feature word base is small, the feature words and the classification rules of the corpus to be labeled cannot be completely contained, or the matching rules and the feature words stored in the matching rule base and the feature word base cannot be used as typical features of the corpus to be labeled, two sentences with the same semantics may be labeled with two different labels and labeling errors due to different feature words, for example, there are 3 search problems about information a in the corpus to be labeled, namely, "how information a is obtained", "how information a should be obtained by three users" and "obtaining mode of information a", the semantics of the 3 texts are all "obtaining mode of information a", the feature words of the three texts are different, and if the three pieces of data are labeled according to the existing method, three different labels are obtained, thereby causing a problem of text labeling confusion with the same semantics. For example, the feature words and the matching rules of the three texts related to the search problem of the information a are not stored in the feature word library and the rule matching library, and when the three texts related to the search problem of the information a are labeled according to the feature word library and the rule matching library, a labeling error may occur. Therefore, the existing method depends on a large rule to match the rule base and the feature word base, so that the final data labeling result is disordered, complicated and low in accuracy.
Aiming at the defect, the technical idea of the embodiment of the application mainly comprises the following steps: specifically, the method comprises the steps of firstly obtaining an intention recognition model based on corpus training in the existing corpus, carrying out deep semantic intention recognition on the text to be labeled through the intention recognition model to obtain an intention recognition result of the text to be labeled, and generating an intention labeling label. The method has the advantages that a large-scale rule word library and a matching rule library are not required to be constructed, only a small amount of universal linguistic data are used for training to obtain the intention recognition model, the intention recognition model can be used for directly recognizing the semantic intention of the text to be labeled, the text is labeled by the label based on the semantic intention, the labeling generalization capability can be improved, and the labeling is more accurate. For example, for the three texts related to the search problem of the information a, if the labeling labels are generated based on the semantic intention understanding of the three texts, since the semantics of the three texts are the same, the labeling labels corresponding to the three texts are the same finally, thereby reducing the labeling complexity and improving the labeling accuracy.
Fig. 1 is a schematic diagram of an implementation environment of a text annotation method according to an exemplary embodiment of the present application, where an application scenario provided by the present embodiment mainly includes: the terminal 101 and the text labeling platform 102 communicate with each other in a wired or wireless manner, where the wired manner may be data transmission between the terminal and the text labeling platform through High Definition Multimedia Interface (HDMI) and other lines; the wireless mode can be that the terminal and the text labeling platform communicate through Bluetooth, wireless network and the like.
It should be noted that the terminal may be, but is not limited to, an intelligent interactive device such as a mobile phone, a tablet, a computer, a display terminal, an intelligent household appliance, and an intelligent wearable device, and the text annotation platform may be, but is not limited to, a device having an information processing function such as a server, a mobile phone, and a tablet.
Illustratively, the terminal 101 collects a text to be labeled, for example, a user inputs a text through a search webpage displayed by a display terminal, a mobile phone, and the like, an intelligent household appliance collects a voice text of the user, and the like, and then the terminal sends the collected text to a text labeling platform, and the text labeling platform obtains the text and then performs related processing on the text.
It should be noted that the method provided by the present application can be widely applied to application scenarios such as intelligent customer service answering, network search, and the like in various fields, and the implementation process of the text annotation method provided by the present application will be described in detail below with reference to specific application scenarios.
Fig. 2 is a flowchart illustrating a text annotation method according to an exemplary embodiment of the present application. As shown in fig. 2, the text annotation method provided in this embodiment may include the following steps.
S201, obtaining a target text to be marked.
In this step, the target text to be labeled may be a sentence input by the user through the terminal, may be a text extracted from the user speech collected by the terminal, or may be a segment of text extracted from the document by the terminal, and then the target text to be labeled is sent to the text labeling platform by the terminal for processing.
For example, in the web search application scenario shown in fig. 3, a user inputs "why the mobile phone is not logged in at all" in a displayed web search interface through the display terminal 301, and then the display terminal 301 sends a target text to be annotated "why the mobile phone is not logged in at all" to the service end 302, so that the service end 302 obtains the target text.
S202, inputting the target text into an intention recognition model, and outputting an intention recognition result of the target text.
In this step, the intention recognition model is obtained by training in advance according to the corpora in the corpus, which may be a general corpus of each field, and the general corpus includes the corpora already disclosed in each field, for example, a field-open corpus, an existing intelligent customer service corpus, a web search corpus, and the like. Extracting a plurality of texts from the corpus, labeling an intention label for each text, and training based on the plurality of texts and the intention label corresponding to each text to obtain the intention recognition model.
Specifically, the target text is input into an intention recognition model, and the intention recognition model can be used for carrying out deep semantic understanding on the target text so as to recognize the semantic intention to be expressed by the target text.
For example, in the web search application scenario shown in fig. 3, a user inputs "why the mobile phone is not logged in all" through the display terminal 301 in a displayed web search interface, and after acquiring a target text to be labeled "why the mobile phone is not logged in all", the server 302 inputs the target text into the intention recognition model, and the intention recognition model performs semantic intention recognition on the target text to obtain a reason that the semantic intention of the target text is that the user wants to know that the mobile phone is logged in all, so that the intention recognition model may output an intention recognition result of the target text as "abnormal mobile phone login".
It should be noted that the detailed training process of the intention recognition model will be described in the following embodiments, and will not be described in detail here.
S203, generating an intention labeling label of the target text according to the intention recognition result.
In this step, after the intention recognition result of the intention recognition model for the target text is obtained, the intention recognition result may be converted into a label according to a certain label generation rule.
In one possible embodiment, the tag generation rule may be determined according to the intention recognition result, and is used for indicating that the intention labeling tag of the target text is generated based on the intention recognition result. For example, if the intention identification result includes "exception" information, the tag generation rule indicates that: and generating an intention labeling label according to the intention identification result and the abnormal reason/solution.
For example, in the application scenario shown in fig. 3, if the intention recognition result of the server for the to-be-annotated data "how the mobile phone is logged in is" abnormal mobile phone login ", the generated intention annotation label is" reason/solution for abnormal mobile phone login "according to the label generation rule.
It should be noted that, the intention identification results corresponding to different texts are different, and therefore, the label generation rules determined correspondingly may also be different, in this embodiment, only one kind of label generation rule corresponding to the intention identification result is exemplified, in an actual situation, for the intention identification result not including the "abnormal" information, there are other corresponding label generation rules, and this embodiment is not particularly limited.
And S204, labeling the target text according to the intention labeling label.
In this step, according to the intention label obtained in step S203, the method for labeling the target text may be, but is not limited to, establishing a corresponding relationship between the target text and the intention label, and storing the corresponding relationship.
In the embodiment, the intention recognition model can recognize the intention of the text, so that the semantic intention of the text can be understood more accurately in the aspect of deep semantics, secondly, the intention label generated according to the intention information can reflect the semantic characteristics of the text more accurately, and finally, the intention label is used for labeling the text, so that the labeling generalization capability is stronger, namely, the labeling results of the texts with the same semantics are the same, the complexity of the labeling results is reduced, and the labeling accuracy is improved.
Fig. 4 is a flowchart of a text annotation method according to another exemplary embodiment of the present application, and this embodiment further describes, on the basis of the embodiment of the method shown in fig. 2, a process of performing semantic intent recognition on a text based on an intent recognition model in the text annotation method in detail.
As shown in fig. 4, the method provided by this embodiment includes: respectively inputting the obtained target text into a sentence pattern recognition model, a behavior recognition model and a state recognition model; based on the sentence pattern recognition model, executing step S2021 to perform sentence pattern intention recognition on the target text to obtain target sentence pattern intention information of the target text output by the sentence pattern recognition model; based on the behavior recognition model, executing step S2022, performing behavior intention recognition on the target text to obtain target behavior intention information of the target text output by the behavior recognition model; based on the state recognition model, step S2023 is executed to perform state intention recognition on the target text, so as to obtain target state intention information of the target text output by the state recognition model.
In this embodiment, the intention identification result includes three categories, namely target sentence pattern intention information, target behavior intention information and target state intention information, where the sentence pattern intention information represents the user tone and specific intention reflected by the target text; the behavior intention information characterizes the user behavior and the business behavior represented by the target text. For example, for "why the mobile phone does not log on at all" it means that the user behavior is login; the state intention information is used for representing whether the behavior operation represented in the data to be labeled by the user is in a normal state or an abnormal state, for example, "how the mobile phone logs in cannot" indicates that the behavior operation represented in the "logging in" by the user is in an abnormal state.
In one or more possible cases of this embodiment, the target sentence intent information includes: inquiring concept, inquiring processing method, inquiring reason, inquiring place, inquiring time, inquiring whether or not, inquiring state, inquiring condition, inquiring influence, inquiring place, statement, praying messenger and inquiring amount, etc.
In one or more possible cases of this embodiment, the target behavior intention information includes: opening, applying, postponing, modifying, freezing, logging out, terminating, punishing, releasing, setting, recording, authenticating, adjusting, quitting, returning, inviting, locking, purchasing, resolving, maintaining, registering, suspending, deducting, repayment, checking, reducing, exempting, delivering, canceling, filling, code scanning, promoting, increasing, adding, unbinding, binding, logging in, signing, auditing, borrowing, cashing, cash registering and the like.
In one or more possible cases of this embodiment, the target state intention information includes: abnormal and normal.
Specifically, the target text is input into a sentence pattern recognition model, and the sentence pattern recognition model is used for performing deep semantic understanding on the sentence pattern intention of the target text to obtain one of the multiple sentence pattern intentions output by the sentence pattern recognition model; inputting the target text into a behavior recognition model, wherein the sentence pattern recognition model is used for carrying out deep semantic understanding on the behavior intention of the target text to obtain one of the multiple behavior intentions output by the behavior recognition model; and inputting the target text into a state recognition model, wherein the state recognition model is used for performing deep semantic understanding on the state intention of the target text to obtain one of the two state behavior intents output by the state recognition model.
Illustratively, the data to be labeled, namely 'identity information is wrong, how the data is modified' is input into the sentence pattern recognition model, the behavior recognition model and the state recognition model, the sentence pattern intention information output by the sentence pattern recognition model is 'question method', the behavior intention information output by the behavior recognition model is 'modified', and the state intention information output by the state recognition model is 'abnormal'.
In one possible embodiment, the sentence recognition model, the behavior recognition model, and the state recognition model each include: the system comprises an input layer, a language representation layer, a full connection layer and a classification layer;
the input layer is used for converting the target text into a target word identification set, and the target word identification set comprises the identification of each word in the target text; the language representation layer is used for converting the target word identification set output by the input layer into a sentence vector; the full connection layer is used for performing feature space conversion on the sentence vector to obtain a target vector corresponding to the sentence vector, and the target vector represents the intention feature of the target text; in the sentence pattern recognition model, the classification layer is used for predicting the target sentence pattern intention information according to the target vector; in the behavior recognition model, the classification layer is configured to predict the target behavior intention information according to the target vector; in the state recognition model, the classification layer is configured to predict the target state intention information according to the target vector.
The language representation layer is a pre-trained language model (BERT).
In this embodiment, after the target text is input into the input layer, the input layer adds an identifier before and after each text, and the identifiers are respectively used for identifying the start position and the end position of each text. And then converting each character in the text into a corresponding word identifier to obtain a target word identifier set corresponding to each text.
Illustratively, the target text input to the input layer has a sentence a and a sentence B, and then identifiers [ CLS ] and [ SEP ] are added before and after the sentence a and the sentence B, respectively, wherein the [ CLS ] identifier is placed at the beginning of the sentence, and the [ SEP ] identifier is placed at the end of the sentence, so as to obtain two sentences with identifiers: [ CLS ] + sentence A + [ SEP ] and [ CLS ] + sentence B + [ SEP ]. Then, each character in the sentences a and B with identifiers is converted into a word identifier (i.e., a word ID), resulting in an identifier sequence corresponding to each of the two sentences. For example, the numbers 1, 2 and 3 \8230areused to indicate the word identifiers corresponding to each character in the sentence, and the finally obtained identifier sequence in the shape of [ CLS ] +2 71 + [ SEP ] is the converted target word identifier set.
And further, inputting the target word identification set output by the input layer into a language representation layer BERT, and performing deep semantic understanding on each character in the target text according to the target word identification set in the BERT layer. Specifically, BERT is provided with a dictionary table, which represents the correspondence between word identifiers and word vectors. Therefore, after the BERT receives the target text, corresponding word vectors are inquired in the dictionary table according to each word identifier, finally, the word vectors are spliced to obtain sentence vectors corresponding to the target text, and the sentence vectors can describe the semantics of the target text.
Further, sentence vectors output by the BERT layer are input into a full connection layer, and the full connection layer (dense layer) performs feature space conversion on the sentence vectors. For example, the sentence vector input by the BERT layer to the fully-connected layer is an N × 1-dimensional feature vector for describing the semantics of the target text, the fully-connected layer performs feature space meaning conversion on the sentence vector to obtain an M × 1-dimensional target vector for describing the intention feature of the target text, so that the target vector can not only represent the intention feature of the target text, but also the dimension of the target vector just meets the dimension required for inputting the next classification layer, where N and M are positive integers.
Further, the classification layer may be, but is not limited to, a Softmax function layer, and the Softmax function is used for multi-classification tasks, and may map the output probability to a distribution. Specifically, after receiving the target vector, the Softmax function layer predicts the intention information probability corresponding to each character in the target vector, and finally outputs intention information with the maximum probability as intention information of the target text.
It should be noted that the sentence pattern recognition model, the behavior recognition model, and the state recognition model are obtained by extracting a target text from a corpus, labeling sentence pattern intention information, behavior intention information, and state intention information on the target text, respectively, to obtain three training sets, and training three deep learning network models using the three training sets, respectively. The specific training process will be described in detail in the following embodiments.
In the embodiment, three intention recognition models which respectively perform sentence pattern intention recognition, behavior intention recognition and state intention recognition on the text to be marked are obtained through independent training, so that each intention recognition model can more accurately recognize the sentence pattern intention, the behavior intention and the state intention of the text to be marked, and the marking accuracy is further improved.
Fig. 5 is a flowchart illustrating a text annotation method according to another exemplary embodiment of the present application, and the present embodiment further describes a method for generating an intention annotation tag in detail based on the embodiment illustrated in fig. 4.
As shown in fig. 5, the generating an intention label according to the intention recognition result of the target text includes:
s501, determining a label generation rule according to the target state intention information, wherein the label generation rule is used for indicating that: and generating an intention labeling label of the target text based on the target sentence pattern intention information and/or the target behavior intention information of the target text.
S502, according to the label generation rule and first information, generating an intention label of the target text, wherein the first information comprises the target sentence pattern intention information and/or the target behavior intention information.
In this embodiment, the label generation rule is a rule for indicating that target sentence pattern intention information, target behavior intention information, and target state intention information, which are output from the sentence pattern recognition model, the behavior recognition model, and the state recognition model, respectively, are mapped as the intention labeling label.
In some embodiments, the tag generation rule is determined according to target state intention information, and if the state intention information indicates an abnormal state, the tag generation rule is used to indicate: target behavior intention information and second information of the target text are used as intention labeling labels of the target text, wherein the second information comprises abnormal reasons or abnormal solution methods corresponding to the abnormal states; if the state intention information indicates a normal state, the tag generation rule is used for indicating: and taking the target behavior intention information and the target sentence intention information of the target text as the intention labeling label of the target text.
Specifically, the tag generation rule is set according to the state intention, and when the state intention of the text is abnormal, the semantic intention of the response includes two cases, namely question reason and question solution method, so the tag generation rule can be determined as follows: < target behavioral intention information > + anomaly cause/anomaly resolution, and when the sentence pattern intention information of this text is "question cause", the tag generation rule is: < target behavioral intention information > + abnormal cause, when the sentence meaning information of the text is "question method", the tag generation rule is: < objective behavioral intention information > + abnormal solution, when the sentence pattern intention information is other than "question cause" and "question method", the tag generation rule is: < target behavioral intention information > + cause of abnormality; when the state of the text is normal, the tag generation rule may be determined as < behavior intention information > + < sentence intention information >.
For example, if the target text is "automatic payment failure", the corresponding target sentence pattern intention information is "statement", the target behavior intention information is "payment", and the target state intention information is "exception", and since the target state intention information is exception, the tag generation rule is: < target behavior intention information > + abnormal cause, namely repayment + abnormal cause, and finally the intention label generated according to the label generation rule is "repayment abnormal cause". For another example, if the target text is "how to pay again", the corresponding target sentence pattern intention information is "question method", the target behavior intention information is "payment", and the target state intention information is "normal", and since the target state intention information is normal, the tag generation rule is: < behavioral intention information > + < sentence pattern intention information >, that is, repayment + question method, and finally the intention label generated according to the label generation rule is the 'repayment method'.
In this embodiment, different tag generation rules are respectively determined according to the target sentence pattern intention information, the target behavior intention information and the target state intention information of the target text, and the target sentence pattern intention information, the target behavior intention information and the target state intention information are mapped to the intention label of the target text according to the tag generation rules, so that the final label can be guaranteed to be more standardized on the basis of accurately reflecting the meaning intention of the target text, and the situation of label confusion is avoided.
Under one or more possible embodiments provided herein, after the obtaining the target text, the method further includes: and identifying the feature name corresponding to the entity in the target text.
It should be noted that the entity in this embodiment may be an item, a person name, a place name, and all other entities identified by names. For example, the entity may be, but is not limited to, a commodity, attributes of the commodity, and behaviors of the merchant in the e-commerce field, and may be, but is not limited to, a consumer financial product and various attributes of the product in the consumer financial field.
For example, products such as mobile phones, computers, watches, home appliances, etc. belong to entities, and various attributes of the products such as mobile phones, computers, etc. also belong to entities. For another example, in the field of consumer finance, financial products such as funds and stocks belong to an entity, and accordingly, various attributes of financial products such as funds and stocks also belong to an entity.
In this embodiment, some target texts may include names of some physical devices such as a mobile phone, a computer, a watch, a home appliance, and the like, or names of financial products consumed, for example, the data of "my mobile phone is logged in abnormally", "how to adjust a display date of an electronic watch", "price of fund", and the like includes such physical names as "mobile phone", "watch", "fund", and the like. Therefore, when a user provides a target text, a service entity in each target text needs to be provided, an entity library is established, various entity identifiers are stored in the entity library, and since the same entity may have multiple different identifiers, for example, the identifier of an android phone may include an M-phone, an N-phone, and an android phone, normalization processing is performed on the various entity identifiers to obtain uniform names corresponding to multiple different identifiers of the same entity, for example, the M-phone, the N-phone, and the android phone are collectively called the android phone, and the uniform names corresponding to the multiple different identifiers of the same entity are stored in the entity library as feature names of the entity.
In specific implementation, identifying the feature name corresponding to the entity in the target text includes:
determining an entity identifier included in the target text according to an entity library;
and determining a feature name corresponding to the entity identifier according to the entity library, wherein the feature name is a unified name of various identifiers corresponding to the entity.
Specifically, after the text annotation platform obtains the target text, the text annotation platform searches the entity library to determine the entity identifier included in the target text, and searches the normalized uniform name corresponding to the entity identifier in the entity library.
Further, in the case where the target text includes a business entity name, the tag generation rule is determined according to the target sentence pattern intention information, the target behavior intention information, the target state intention information, and the feature name of the entity of the target text.
Specifically, if the target state intention information indicates an abnormal state, the tag generation rule is used to indicate: taking a feature name corresponding to an entity in a target text, target behavior intention information of the target text and third information as an intention labeling label of the target text, wherein the third information comprises an abnormal reason or an abnormal solution corresponding to the abnormal state; if the state intention information indicates a normal state, the tag generation rule is used for indicating: and taking the feature name corresponding to the entity in the target text, the target behavior intention information and the target sentence pattern intention information of the target text as the intention labeling label of the target text.
In one or more possible cases of the embodiment, when the state intention of the text is abnormal, the tag generation rule may be determined as: < entity's feature name > + < behavioral intention information > + abnormal cause/abnormal solution, and, when the target sentence pattern intention information of the text is "question cause", the tag generation rule is: < entity feature name > + < target behavior intention information > + abnormal cause, when the target sentence pattern intention information of the text is "question method", the tag generation rule is: < entity's feature name > + < target behavior intention information > + abnormal solution, when the target sentence pattern intention information is other than "question reason" and "question method", the label generation rule is: < feature name of entity > + < target action intention information > + cause of abnormality; when the status intention of the text is normal, the tag generation rule may be determined as < feature name of entity > + < target behavior intention information > + < target sentence intention information >.
Illustratively, the three target texts are: the first one is: how the android phone logs in fails, a second: "how to solve the abnormal login of the android mobile phone" and a third "how to solve the abnormal login of the mobile phone is that the login of the mobile phone is unsuccessful", respectively identifying semantic intentions and characteristic names of the entities of the three target texts, and respectively obtaining four elements, namely an entity characteristic name, target sentence pattern intention information, target behavior intention graph information and target state intention information, corresponding to each target text, wherein the four elements corresponding to the first one are as follows: entity feature names-android, sentence pattern intention-question cause, behavior intention-login, state intention-exception; the second corresponds to four elements: entity feature names, android phones, sentence pattern intention-question methods, behavior intention-login, state intention-exception; the third corresponding four elements are: entity feature name-cell phone, sentence intent-statement, behavioral intent-login, status intent-exception. According to the label generation rule, respectively generating the intention label corresponding to each of the three text label data as follows: the first one is: "abnormal reason for login of android phone", the second: 'an android mobile phone login abnormity solving method', the third step is that: the abnormal reason of the mobile phone login is realized.
It should be noted that, if the entity name of the android phone does not exist in the entity library, the intention label corresponding to the first and third bars is: the second corresponding intention label is: "solving method for abnormal login". If the mobile phone is the feature name corresponding to the android mobile phone in the entity library, the first and third corresponding intention label tags are both: the second corresponding intention label is as follows: method for solving abnormal login of mobile phone "
In the embodiment, the entity library is added to identify the entity feature name in the target text, so that the problem of label labeling confusion is avoided, and the finally generated intention labeling label is more accurate.
Fig. 6 is a flowchart illustrating a training method of an intention recognition model according to an exemplary embodiment of the present application, and the present embodiment mainly describes a training process of the intention recognition model.
As shown in fig. 6, the method provided by this embodiment includes:
s601, extracting a target text set from the corpus, wherein the target text set comprises a plurality of texts, and each text corresponds to one intention information. The corpus can be a general corpus of each field, and the general corpus comprises the corpora which are already disclosed in each field, such as a public field pre-corpus, an existing intelligent customer service corpus, a network search corpus and the like.
In one or more possible embodiments, the text annotation platform sends an acquisition instruction to the corpus, and the corpus returns the target text set to the text annotation platform according to the acquisition instruction.
For example, the target text set may be a text in a specific field stored in a corpus, for example, a text in multiple fields such as an e-commerce field and a financial field is stored in the corpus, if a technician wants to use a text training model in the e-commerce field, the acquisition instruction sent by the text annotation platform to the corpus includes e-commerce field information and a preset number, and the corpus returns a preset number of texts in all corpora in the e-commerce field to the text annotation platform according to the acquisition instruction.
In one or more possible embodiments, the corpus can send the target text set in the corpus to the text annotation platform at a preset time.
For example, the target text set may be a newly added text in the corpus, and assuming that the preset time is 1 hour, the corpus sends the newly added text to the text labeling platform every 1 hour.
And S602, inputting intention information corresponding to each text in the target text set and the target text set as a training set into a pre-established deep learning network for training to obtain an intention recognition model.
The intention information comprises one of sentence pattern intention information, behavior intention information and state intention information, and the intention identification model comprises one of a sentence pattern identification model, a behavior identification model and a state identification model.
In this embodiment, the general purpose intention of the text is first divided into three categories, namely, a sentence pattern intention, a behavior intention, and a state intention, wherein the sentence pattern intention represents the user tone and the specific intention of the target text; the behavior intention information represents user behaviors and business behaviors represented by the target text; the state intention information is used for representing whether the user is in a normal state or an abnormal state in the action operation reaction represented in the data to be annotated.
Specifically, the text labeling platform sends the target text set to the terminal for displaying so as to indicate a user to input sentence pattern intention information, behavior intention information and state intention information corresponding to each text through the terminal, and the text labeling platform labels each text according to the three intention information input by the user to respectively obtain the sentence pattern intention information, the behavior intention information and the state intention information corresponding to each text.
In a possible embodiment, three training sets are respectively obtained according to three intention information of a text, and three deep learning networks are respectively trained by using the three training sets to respectively obtain a sentence pattern recognition model, a behavior recognition model and a state recognition model.
It should be noted that the intention recognition model obtained by using the training method of the intention recognition model provided in the embodiment of the present application may be applied to the text labeling method described above.
In the embodiment, the intention recognition model is obtained by training the text based on a plurality of different intention information and the intention information of each text label, so that the intention of the text can be understood from the aspect of deep semantics by using the intention recognition model to perform intention recognition on the text, the characteristics of the text can be reflected in the aspect of semantics, and the accuracy of labeling the text by using the text intention subsequently is improved.
Fig. 7 is a diagram of a visualization scene of a text annotation method according to an exemplary embodiment of the present application, and this embodiment describes in detail a training process of three intention recognition models and an application process using the three intention recognition models in combination with the visualization scene on the basis of the embodiments shown in fig. 2 to fig. 6.
As shown in fig. 7, the method provided by this embodiment includes:
and S71, extracting the target text set from the corpus.
The corpus can be a general corpus of each field, and the general corpus contains the published corpora in each field, such as a public field pre-corpus, an existing intelligent customer service corpus, a network search corpus, and the like.
In one or more possible embodiments, the text annotation platform sends a retrieval instruction to the corpus, and the corpus returns the target text set to the text annotation platform according to the retrieval instruction.
For example, the target text set may be a text in a specific field stored in a corpus, for example, a text in multiple fields such as an e-commerce field and a financial field is stored in the corpus, if a technician wants to use a text training model in the e-commerce field, the acquisition instruction sent by the text annotation platform to the corpus includes e-commerce field information and a preset number, and the corpus returns a preset number of texts in all corpora in the e-commerce field to the text annotation platform according to the acquisition instruction.
In one or more possible embodiments, the corpus can send the target text set in the corpus to the text annotation platform at a preset time.
Illustratively, the target text set may be a newly added text in the corpus, and assuming that the preset time is 1 hour, the corpus sends the newly added text to the text labeling platform every 1 hour.
S721, determining a first training set according to the sentence pattern and meaning graph information corresponding to each text in the target text set. The first training set is used for training to obtain a sentence pattern recognition model.
In this embodiment, the general purpose intention of the text is first divided into three categories, namely, a sentence pattern intention, a behavior intention, and a state intention, wherein the sentence pattern intention represents the user tone and the specific intention of the target text; the behavior intention information represents user behaviors and business behaviors represented by the target text; the state intention information is used for representing whether the user is in a normal state or an abnormal state in the action operation reaction represented in the data to be annotated.
In one or more possible cases of the present embodiment, the sentence intent may include, but is not limited to: inquiring concept, inquiring processing method, inquiring reason, inquiring place, inquiring time, inquiring whether or not, inquiring state, inquiring condition, inquiring influence, inquiring place, statement, praying messenger and inquiring amount, etc.
Specifically, the text labeling platform sends the target text set to the terminal for displaying so as to indicate a user to input sentence pattern intention information corresponding to each text through the terminal, and the text labeling platform labels each text according to the sentence pattern intention information input by the user.
For example, it is assumed that a target text set extracted from a corpus by a text annotation platform includes "automatic repayment failure", "wrong identity information, how to modify", "why the selected address is always in beijing city and cannot be changed", "how to repay? The text marking platform marks each text according to the label input by the user, and the marking result is shown in table 1.
TABLE 1
Figure BDA0003128864900000171
Illustratively, five texts included in table 1 and sentence intent information corresponding to each text are input to a first deep learning network established in advance as a first training set for training, and a learning rate parameter of the first deep learning network may be set to 0.0005, and 5 times of training iterations are selected for iterative training, so as to obtain the sentence recognition model.
S722, determining a second training set according to the behavior and intention graph information corresponding to each text in the target text set and the target text set; the second training set is used for training to obtain a behavior recognition model.
In one or more possible cases of this embodiment, the behavior intention information includes: opening, applying, postponing, modifying, freezing, logging out, terminating, punishing, releasing, setting, recording, authenticating, adjusting, quitting, returning, inviting, locking, purchasing, resolving, maintaining, registering, suspending, deducting, repayment, checking, reducing, exempting, delivering, canceling, filling, code scanning, promoting, increasing, adding, unbinding, binding, logging in, signing, auditing, borrowing, cashing, cash registering and the like.
Specifically, the text labeling platform sends the target text set to the terminal for displaying so as to indicate a user to input behavior intention information corresponding to each text through the terminal, and the text labeling platform labels each text according to the behavior intention information input by the user
For example, it is assumed that a target text set extracted from a corpus by a text annotation platform includes "automatic repayment failure", "wrong identity information, how to modify", "why the selected address is always in beijing city and cannot be changed", "how to repay? The five texts of 'what is exclusive cash staging', the behavior intention information corresponding to the first four texts input by the user are 'repayment', 'modification' and 'repayment', the text labeling platform labels each text according to the label input by the user, and the labeling result is shown in table 2.
TABLE 2
Figure BDA0003128864900000181
It should be noted that, if the text does not include the action intention, the text may be marked as empty when marking the action intention information, for example, the text "what is a cash exclusive period" belongs to the question concept and does not include a user action or a business action, and therefore the corresponding action intention information may be marked as "empty".
Illustratively, five texts included in table 2 and behavior intention information corresponding to each text are input to a second deep learning network established in advance as a second training set for training, and a learning rate parameter of the second deep learning network may be set to 0.0005, and 5 times of training iterations are selected for iterative training, so as to obtain the behavior recognition model.
And S723, determining a third training set according to the state intention information corresponding to each text in the target text set and the target text set. And the third training set is used for training to obtain a state recognition model.
In one or more possible cases of this embodiment, the state intention information includes: abnormal and normal.
Specifically, the text labeling platform sends the target text set to the terminal for displaying so as to indicate a user to input state intention information corresponding to each text through the terminal, and the text labeling platform labels each text according to the state intention information input by the user
For example, it is assumed that a target text set extracted from a corpus by a text annotation platform includes "automatic repayment failure", "identity information is wrong, how to modify", "why a selected address is Beijing city, and cannot be changed", "how to repay? The five texts of 'what is the exclusive cash stage' are marked by the text marking platform according to the label input by the user, and the marking results are shown in table 3.
TABLE 3
Figure BDA0003128864900000191
Illustratively, five texts included in the table 5 and state intention information corresponding to each text are input to a pre-established third deep learning network as a third training set for training, and a learning rate parameter of the third deep learning network may be set to 0.0005, and 5 times of training iterations are selected for iterative training, so as to obtain the state recognition model.
It should be noted that, the values of the iteration number and the learning rate parameter selected in the training of each model are empirical values, in this embodiment, the learning rate parameter is set to 0.0005, and the iteration number is selected 5 times, so that the final model training effect is better. However, in practical situations, the learning rate parameter and the number of iterations may also be empirically selected with other values, which are not specifically limited in this embodiment.
Further, after the three intention recognition models are obtained through training, the text labeling platform takes a question which is input by a user through a terminal such as a mobile phone, a computer, an intelligent wearable device and the like and is to be consulted as a target text, and respectively inputs the target text into the sentence pattern recognition model, the behavior recognition model and the state recognition model, and the three intention recognition models respectively recognize and obtain sentence pattern intention information, behavior intention information and state intention information of the target text. Meanwhile, the text labeling platform extracts the characteristic name of the entity from the target text. And finally, generating the intention labeling label of the target text according to the characteristic name, the sentence pattern intention information, the behavior intention information and the state intention information of the entity.
In the embodiment, three intention recognition models are obtained by constructing three training sets and respectively training, so that the three intention recognition models can respectively recognize target texts at semantic angles and accurately obtain sentence pattern intentions, behavior intentions and state intentions in the target texts, and accordingly intention labeling labels generated according to the sentence pattern intentions, the behavior intentions and the state intentions are more accurate. Furthermore, the feature names of the entities in the target text are extracted, and the intention labeling labels are generated by combining the feature names of the entities and the semantic intents, so that the label accuracy is further improved.
Fig. 8 is a schematic structural diagram of a deep learning network according to an exemplary embodiment of the present application.
The present embodiment will describe the training process of the intention recognition model in conjunction with the structure of the deep learning network.
The first deep learning network, the second deep learning network, and the third deep learning network have the same structure, and three different intention recognition models are obtained because input training data are different.
As shown in fig. 8, the deep learning network provided in this embodiment mainly includes: an input layer 801, a language representation layer 802, a full connectivity layer 803, and a classification layer 804.
During training, inputting the target text set and intention information corresponding to each text in the target text set into the input layer, wherein the input layer determines a word identification set corresponding to each text and the intention information of each text, and the word identification set comprises an identification of each word in each text and an identification of each word in the intention information of each text;
inputting the word identification set into a language representation layer, wherein the language representation layer converts each text and the intention information of each text into a sentence vector according to the word identification set;
inputting each text and a sentence vector corresponding to the intention information of each text into a full connection layer, wherein the full connection layer performs feature space conversion on the sentence vectors to obtain a target vector corresponding to the sentence vectors, and the target vector represents the intention characteristics of each text;
and inputting the target vector to a classification layer, and determining a probability value of intention information corresponding to each text by the classification layer.
If the intention information is sentence pattern intention information, the intention identification model obtained by the training of the method is a sentence pattern identification model; if the intention information is behavior intention information, an intention recognition model obtained through the training of the method is a behavior recognition model; and if the intention information is state intention information, the intention recognition model obtained by the training of the method is a state recognition model.
In this embodiment, after the intention information corresponding to each text in the target text set and the target text set is input to the input layer, identifiers are added to the input layer before and after the intention information of each text and each text, and the identifiers are respectively used for identifying the start position and the end position of each text and the end position of the intention information. And then converting each character in each text and each character in the intention information into a corresponding word identifier to obtain a word identifier set corresponding to each text and the intention information of each text.
Illustratively, the intention information of the text and the text input into the input layer is C and D, respectively, and then identifiers [ CLS ] and [ SEP ] are added before and after C and D, respectively, wherein the [ CLS ] identifier is placed at the beginning of the sentence for identifying the starting position of the sentence, and the [ SEP ] identifier is placed at the end of the sentence for identifying the ending position of the sentence, so as to obtain a sentence with an identifier: [ CLS ] + C + [ SEP ] + D + [ SEP ]. Then, each character in the sentence with the identifier is converted into a word identifier (i.e. word ID), and an identification sequence corresponding to the sentence is obtained. For example, the numbers 1, 2 and 3 \8230areused to indicate the word identifiers corresponding to each character in the sentence, and the finally obtained identifier sequence in the shape of [ CLS ] +2 71 6+ [ SEP ] +3 + [ SEP ] is the converted word identifier set.
Further, the word identification set output by the input layer is input to a language representation layer BERT, and each character in the target text is subjected to deep semantic understanding according to the word identification set in the BERT layer. Specifically, BERT is provided with a dictionary table, which represents the correspondence between word identifiers and word vectors. Therefore, after the BERT receives the word identification set, the corresponding word vectors are inquired in the dictionary table according to each word identification, finally, the word vectors are spliced to obtain each text and a sentence vector corresponding to the intention information of each text, and the sentence vector can describe the semantics of the target text.
Further, sentence vectors output by the BERT layer are input into a full connection layer, and the full connection layer (dense layer) performs feature space conversion on the sentence vectors. For example, the sentence vector input by the BERT layer to the fully-connected layer is an N × 1-dimensional feature vector for describing semantics of the text and the intention information, the fully-connected layer performs feature space meaning conversion on the sentence vector to obtain an M × 1-dimensional target vector for describing intention features of the text, so that the target vector can not only represent the intention features of the text, but also has a dimension which just meets the dimension required for inputting the next classification layer, wherein N and M are positive integers.
Further, the classification layer may be, but is not limited to, a Softmax function layer, and the Softmax function is used for multi-classification tasks, and may map the output probability to a distribution. Specifically, after receiving the target vector, the Softmax function layer predicts an intention information probability value corresponding to each character in the target vector.
It should be noted that, in this embodiment, only the functions and connections of each network layer in the intent recognition model are exemplarily described in conjunction with the technical solutions provided in this application.
Fig. 9 is a schematic structural diagram of a text annotation device according to an exemplary embodiment of the present application.
As shown in fig. 9, the apparatus provided in this embodiment includes:
a text obtaining module 901, configured to obtain a target text to be labeled;
an intention recognition module 902, configured to input the target text into an intention recognition model, and output an intention recognition result of the target text;
a label generating module 903, configured to generate an icon attention label of the target text according to the intention recognition result;
and a text labeling module 904, configured to label the target text according to the intention labeling tag.
Further, the intention identifying module is specifically configured to:
inputting the target text into a sentence pattern recognition model, and outputting target sentence pattern intention information of the target text; inputting the target text into a behavior recognition model, and outputting target behavior intention information of the target text; inputting the target text into a state recognition model, and outputting target state intention information of the target text;
wherein the intention recognition result includes the target sentence pattern intention information, the target behavior intention information, and the target state intention information. Further, the sentence pattern recognition model, the behavior recognition model and the state recognition model all include: the system comprises an input layer, a language representation layer, a full connection layer and a classification layer;
the input layer is used for converting the target text into a target word identification set, and the target word identification set comprises the identification of each word in the target text;
the language representation layer is used for converting the target word identification set output by the input layer into a sentence vector;
the full connection layer is used for carrying out feature space conversion on the sentence vectors to obtain target vectors corresponding to the sentence vectors, and the target vectors represent the intention features of the target text;
in the sentence pattern recognition model, the classification layer is used for predicting the target sentence pattern intention information according to the target vector; in the behavior recognition model, the classification layer is configured to predict the target behavior intention information according to the target vector; in the state identification model, the classification layer is configured to predict the target state intention information according to the target vector.
Further, the tag generation module is specifically configured to:
determining a tag generation rule according to the target state intention information, wherein the tag generation rule is used for indicating that: generating an intention labeling label of the target text based on the target sentence pattern intention information and/or the target behavior intention information of the target text;
and generating an intention labeling label of the target text according to the label generation rule and first information, wherein the first information comprises the target sentence pattern intention information and/or the target behavior intention information. In the step (A), the step (B) is that,
if the target state intention information indicates an abnormal state, the tag generation rule is used for indicating: target behavior intention information and second information of the target text are used as intention labeling labels of the target text, and the second information comprises abnormal reasons or abnormal solution methods corresponding to the abnormal states;
if the target state intention information indicates a normal state, the tag generation rule is used for indicating: and taking the target behavior intention information and the target sentence intention information of the target text as the intention label of the target text.
Further, the apparatus further comprises: an entity identification module 905, configured to identify a feature name corresponding to an entity in the target text after the target text to be annotated is acquired;
wherein, if the target state intention information indicates an abnormal state, the tag generation rule is used to indicate: taking a feature name corresponding to an entity in a target text, target behavior intention information of the target text and third information as an intention label of the target text, wherein the third information comprises an abnormal reason or an abnormal solution corresponding to the abnormal state;
if the target state intention information indicates a normal state, the tag generation rule is used for indicating: and taking the feature name corresponding to the entity in the target text, the target behavior intention information and the target sentence pattern intention information of the target text as the intention labeling label of the target text.
Further, the entity identification module is specifically configured to:
determining an entity identifier included in the target text according to an entity library;
and determining a feature name corresponding to the entity identifier according to the entity library, wherein the feature name is a unified name of various identifiers corresponding to the entity.
The detailed functional implementation of each module provided in this embodiment may refer to the detailed description in the above related method embodiment.
Fig. 10 is a schematic structural diagram of a training apparatus for an intention recognition model according to an exemplary embodiment of the present application.
As shown in fig. 10, the apparatus provided in this embodiment includes:
an extracting module 1001, configured to extract a target text set from a corpus, where the target text set includes multiple texts, and each text corresponds to one piece of intention information;
the training module 1002 is configured to input intention information corresponding to each text in the target text set and the target text set as a training set into a pre-established deep learning network for training, so as to obtain an intention recognition model.
Further, the intention information includes one of sentence intention information, behavior intention information and state intention information;
the intention recognition model comprises one of a sentence pattern recognition model, a behavior recognition model and a state recognition model.
Further, the pre-established deep learning network comprises: the system comprises an input layer, a language representation layer, a full connection layer and a classification layer; the training module is specifically configured to:
inputting intent information corresponding to each text in the target set of texts and the target set of texts to the input layer, the input layer determining a set of word identifiers corresponding to each text and the intent information of each text, the set of word identifiers including an identification of each word in the each text and an identification of each word in the intent information of the each text;
inputting the word identification set into a language representation layer, wherein the language representation layer converts each text and the intention information of each text into a sentence vector according to the word identification set;
inputting each text and a sentence vector corresponding to the intention information of each text into a full-connection layer, wherein the full-connection layer performs feature space conversion on the sentence vector to obtain a target vector corresponding to the sentence vector, and the target vector represents the intention characteristics of each text;
and inputting the target vector to a classification layer, and determining a probability value of intention information corresponding to each text by the classification layer.
The detailed description of the method embodiments above can be referred to for the specific functional implementation of each module provided in this embodiment.
Fig. 11 is a schematic hardware structure diagram of a computer device according to an embodiment of the present application. As shown in fig. 11, the present embodiment provides a computer device 110 including: at least one processor 1101 and memory 1102. The processor 1101 and the memory 1102 are connected by a bus 1103.
In a particular implementation, the at least one processor 1101 executes computer-executable instructions stored by the memory 1102 to cause the at least one processor 1101 to perform the methods of the above-described method embodiments.
For a specific implementation process of the processor 1101, reference may be made to the above method embodiments, which implement principles and technical effects similar to each other, and details of this embodiment are not described herein again.
In the embodiment shown in fig. 11, it should be understood that the Processor may be a Central Processing Unit (CPU), other general purpose processors, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), etc. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of a method disclosed in connection with the present invention may be embodied directly in a hardware processor, or in a combination of the hardware and software modules within the processor.
The memory may comprise high speed RAM memory and may also include non-volatile storage NVM, such as at least one disk memory.
The bus may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, an Extended ISA (EISA) bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, the buses in the figures of the present application are not limited to only one bus or one type of bus.
Another embodiment of the present application provides a computer-readable storage medium, in which computer-executable instructions are stored, and when a processor executes the computer-executable instructions, the method for labeling a text or training an intention recognition model in the above method embodiments is implemented.
Another embodiment of the present application provides a computer program product comprising a computer program, which when executed by a processor, implements the text labeling method or the training method of the intention recognition model in the above method embodiments.
The computer-readable storage medium may be implemented by any type of volatile or non-volatile memory device or combination thereof, such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disk. Readable storage media can be any available media that can be accessed by a general purpose or special purpose computer.
An exemplary readable storage medium is coupled to the processor such the processor can read information from, and write information to, the readable storage medium. Of course, the readable storage medium may also be an integral part of the processor. The processor and the readable storage medium may reside in an Application Specific Integrated Circuits (ASIC). Of course, the processor and the readable storage medium may reside as discrete components in the apparatus.
Those of ordinary skill in the art will understand that: all or a portion of the steps of implementing the above-described method embodiments may be performed by hardware associated with program instructions. The program may be stored in a computer-readable storage medium. When executed, the program performs steps comprising the method embodiments described above; and the aforementioned storage medium includes: various media that can store program codes, such as ROM, RAM, magnetic or optical disks.
Finally, it should be noted that: the above embodiments are only used for illustrating the technical solutions of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; such modifications and substitutions do not depart from the spirit and scope of the present disclosure.

Claims (14)

1. A text labeling method is characterized by comprising the following steps:
acquiring a target text to be marked;
inputting the target text into an intention recognition model, and outputting an intention recognition result of the target text;
generating an intention labeling label of the target text according to the intention identification result;
and labeling the target text according to the intention labeling label.
2. The method of claim 1, wherein the inputting the target text into an intention recognition model and outputting the intention recognition result of the target text comprises:
inputting the target text into a sentence pattern recognition model, and outputting target sentence pattern intention information of the target text; inputting the target text into a behavior recognition model, and outputting target behavior intention information of the target text; inputting the target text into a state recognition model, and outputting target state intention information of the target text;
wherein the intention recognition result includes the target sentence pattern intention information, the target behavior intention information, and the target state intention information.
3. The method of claim 2, wherein the sentence recognition model, the behavior recognition model, and the state recognition model each comprise: the system comprises an input layer, a language representation layer, a full connection layer and a classification layer;
the input layer is used for converting the target text into a target word identification set, and the target word identification set comprises the identification of each word in the target text;
the language representation layer is used for converting the target word identification set output by the input layer into a sentence vector;
the full connection layer is used for performing feature space conversion on the sentence vector to obtain a target vector corresponding to the sentence vector, and the target vector represents the intention feature of the target text;
in the sentence pattern recognition model, the classification layer is used for predicting the target sentence pattern intention information according to the target vector; in the behavior recognition model, the classification layer is used for predicting the target behavior intention information according to the target vector; in the state recognition model, the classification layer is configured to predict the target state intention information according to the target vector.
4. The method according to claim 2 or 3, wherein the generating an intention labeling label of the target text according to the intention recognition result comprises:
determining a tag generation rule according to the target state intention information, wherein the tag generation rule is used for indicating that: generating an intention labeling label of the target text based on the target sentence pattern intention information and/or the target behavior intention information of the target text;
and generating an intention labeling label of the target text according to the label generation rule and first information, wherein the first information comprises the target sentence pattern intention information and/or the target behavior intention information.
5. The method of claim 4, wherein if the target state intent information indicates an abnormal state, the tag generation rule is used to indicate: target behavior intention information and second information of the target text are used as intention labeling labels of the target text, wherein the second information comprises abnormal reasons or abnormal solution methods corresponding to the abnormal states;
if the target state intention information indicates a normal state, the tag generation rule is used for indicating: and taking the target behavior intention information and the target sentence intention information of the target text as the intention labeling label of the target text.
6. The method of claim 4, wherein after obtaining the target text to be labeled, the method further comprises: identifying a feature name corresponding to an entity in the target text;
wherein, if the target state intention information indicates an abnormal state, the tag generation rule is used to indicate: taking a feature name corresponding to an entity in a target text, target behavior intention information of the target text and third information as an intention labeling label of the target text, wherein the third information comprises an abnormal reason or an abnormal solution corresponding to the abnormal state;
if the target state intention information indicates a normal state, the tag generation rule is used for indicating: and taking the feature name corresponding to the entity in the target text, the target behavior intention information and the target sentence pattern intention information of the target text as the intention labeling label of the target text.
7. The method of claim 6, wherein the identifying the feature name corresponding to the entity in the target text comprises:
determining an entity identifier included in the target text according to an entity library;
and determining a feature name corresponding to the entity identifier according to the entity library, wherein the feature name is a unified name of various identifiers corresponding to the entity.
8. A method for training an intention recognition model, comprising:
extracting a target text set from a corpus, wherein the target text set comprises a plurality of texts, and each text corresponds to intention information;
and inputting intention information corresponding to each text in the target text set and the target text set as a training set into a pre-established deep learning network for training to obtain an intention recognition model.
9. The method of claim 8, wherein the intent information includes one of sentence intent information, behavioral intent information, state intent information;
the intention recognition model comprises one of a sentence pattern recognition model, a behavior recognition model and a state recognition model.
10. The method according to claim 8 or 9, wherein the pre-established deep learning network comprises: the system comprises an input layer, a language representation layer, a full connection layer and a classification layer;
the method for inputting intention information corresponding to each text in the target text set and the target text set as a training set into a pre-established deep learning network for training comprises the following steps:
inputting intent information corresponding to each text in the target set of texts and the target set of texts to the input layer, the input layer determining a set of word identities corresponding to each text and the intent information of each text, the set of word identities including an identity of each word in the each text and an identity of each word in the intent information of the each text;
inputting the set of word identifiers to a language representation layer, the language representation layer converting the each text and the intention information of each text into sentence vectors according to the set of word identifiers;
inputting each text and a sentence vector corresponding to the intention information of each text into a full-connection layer, wherein the full-connection layer performs feature space conversion on the sentence vector to obtain a target vector corresponding to the sentence vector, and the target vector represents the intention characteristics of each text;
inputting the target vector to a classification layer, wherein the classification layer determines a probability value of intention information corresponding to each text.
11. A text labeling apparatus, comprising:
the text acquisition module is used for acquiring a target text to be labeled;
the intention recognition module is used for inputting the target text into an intention recognition model and outputting an intention recognition result of the target text;
the label generating module is used for generating an intention labeling label of the target text according to the intention identification result;
and the text labeling module is used for labeling the target text according to the intention labeling label.
12. An apparatus for training an intention recognition model, comprising:
the extraction module is used for extracting a target text set from a corpus, wherein the target text set comprises a plurality of texts, and each text corresponds to intention information;
and the training module is used for inputting intention information corresponding to each text in the target text set and the target text set as a training set into a pre-established deep learning network for training to obtain an intention recognition model.
13. A computer device, comprising: at least one processor and a memory;
the memory stores computer execution instructions;
the at least one processor executing the computer-executable instructions stored by the memory causes the at least one processor to perform the method of text annotation according to any of claims 1-7 or the method of training an intent recognition model according to any of claims 8-10.
14. A computer-readable storage medium having computer-executable instructions stored thereon, which when executed by a processor implement the method for text annotation according to any one of claims 1-7 or the method for training an intent recognition model according to any one of claims 8-10.
CN202110698706.XA 2021-06-23 2021-06-23 Text labeling method, training method of intention recognition model and related equipment Active CN115249017B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110698706.XA CN115249017B (en) 2021-06-23 2021-06-23 Text labeling method, training method of intention recognition model and related equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110698706.XA CN115249017B (en) 2021-06-23 2021-06-23 Text labeling method, training method of intention recognition model and related equipment

Publications (2)

Publication Number Publication Date
CN115249017A true CN115249017A (en) 2022-10-28
CN115249017B CN115249017B (en) 2023-12-19

Family

ID=83697447

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110698706.XA Active CN115249017B (en) 2021-06-23 2021-06-23 Text labeling method, training method of intention recognition model and related equipment

Country Status (1)

Country Link
CN (1) CN115249017B (en)

Citations (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110307252A1 (en) * 2010-06-15 2011-12-15 Microsoft Corporation Using Utterance Classification in Telephony and Speech Recognition Applications
CN103136360A (en) * 2013-03-07 2013-06-05 北京宽连十方数字技术有限公司 Internet behavior markup engine and behavior markup method corresponding to same
CN110287283A (en) * 2019-05-22 2019-09-27 中国平安财产保险股份有限公司 Intent model training method, intension recognizing method, device, equipment and medium
CN110472230A (en) * 2019-07-11 2019-11-19 平安科技(深圳)有限公司 The recognition methods of Chinese text and device
CN110717017A (en) * 2019-10-17 2020-01-21 腾讯科技(深圳)有限公司 Method for processing corpus
CN110808049A (en) * 2018-07-18 2020-02-18 深圳市北科瑞声科技股份有限公司 Voice annotation text correction method, computer device and storage medium
CN111125354A (en) * 2018-10-31 2020-05-08 北京国双科技有限公司 Text classification method and device
WO2020244066A1 (en) * 2019-06-04 2020-12-10 平安科技(深圳)有限公司 Text classification method, apparatus, device, and storage medium
US20200395008A1 (en) * 2019-06-15 2020-12-17 Very Important Puppets Inc. Personality-Based Conversational Agents and Pragmatic Model, and Related Interfaces and Commercial Models
WO2021042904A1 (en) * 2019-09-06 2021-03-11 平安国际智慧城市科技股份有限公司 Conversation intention recognition method, apparatus, computer device, and storage medium
WO2021051521A1 (en) * 2019-09-18 2021-03-25 平安科技(深圳)有限公司 Response information obtaining method and apparatus, computer device, and storage medium
CN112825114A (en) * 2019-11-21 2021-05-21 中兴通讯股份有限公司 Semantic recognition method and device, electronic equipment and storage medium
WO2021114840A1 (en) * 2020-05-28 2021-06-17 平安科技(深圳)有限公司 Scoring method and apparatus based on semantic analysis, terminal device, and storage medium

Patent Citations (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110307252A1 (en) * 2010-06-15 2011-12-15 Microsoft Corporation Using Utterance Classification in Telephony and Speech Recognition Applications
CN103136360A (en) * 2013-03-07 2013-06-05 北京宽连十方数字技术有限公司 Internet behavior markup engine and behavior markup method corresponding to same
CN110808049A (en) * 2018-07-18 2020-02-18 深圳市北科瑞声科技股份有限公司 Voice annotation text correction method, computer device and storage medium
CN111125354A (en) * 2018-10-31 2020-05-08 北京国双科技有限公司 Text classification method and device
CN110287283A (en) * 2019-05-22 2019-09-27 中国平安财产保险股份有限公司 Intent model training method, intension recognizing method, device, equipment and medium
WO2020244066A1 (en) * 2019-06-04 2020-12-10 平安科技(深圳)有限公司 Text classification method, apparatus, device, and storage medium
US20200395008A1 (en) * 2019-06-15 2020-12-17 Very Important Puppets Inc. Personality-Based Conversational Agents and Pragmatic Model, and Related Interfaces and Commercial Models
CN110472230A (en) * 2019-07-11 2019-11-19 平安科技(深圳)有限公司 The recognition methods of Chinese text and device
WO2021042904A1 (en) * 2019-09-06 2021-03-11 平安国际智慧城市科技股份有限公司 Conversation intention recognition method, apparatus, computer device, and storage medium
WO2021051521A1 (en) * 2019-09-18 2021-03-25 平安科技(深圳)有限公司 Response information obtaining method and apparatus, computer device, and storage medium
CN110717017A (en) * 2019-10-17 2020-01-21 腾讯科技(深圳)有限公司 Method for processing corpus
CN112825114A (en) * 2019-11-21 2021-05-21 中兴通讯股份有限公司 Semantic recognition method and device, electronic equipment and storage medium
WO2021114840A1 (en) * 2020-05-28 2021-06-17 平安科技(深圳)有限公司 Scoring method and apparatus based on semantic analysis, terminal device, and storage medium

Non-Patent Citations (7)

* Cited by examiner, † Cited by third party
Title
AI数据标注猿: "做文本标注必须了解的知识点", pages 1 - 3, Retrieved from the Internet <URL:https://zhuanlan.zhihu.com/p/115209424> *
DIGQUANT点宽: "数据标注:AI背后的人工力量", pages 1, Retrieved from the Internet <URL:https://zhuanlan.zhihu.com/p/354278697> *
HONGXIANG CAI 等: "Revisiting Classification Perspective on Scene Text Recognition", COMPUTER SCIENCE, pages 1 - 10 *
SHERVIN MINAEE 等: "Deep Learning Based Text Classification: A Comprehensive Review", pages 1 - 42, Retrieved from the Internet <URL:https://arxiv.org/pdf/2004.03705.pdf> *
刘伟权, 钟义信: "基于SRNN神经网络的汉语文本词类标注方法", 计算机研究与发展, no. 06, pages 1 - 6 *
吴晓锋;宗成庆;: "基于语义角色标注的新闻领域复述句识别方法", 中文信息学报, no. 05, pages 3 - 9 *
黄超: "知识驱动的特定领域文本分类方法", 中国优秀硕士学位论文全文数据库 信息科技辑, no. 2, pages 138 - 2940 *

Also Published As

Publication number Publication date
CN115249017B (en) 2023-12-19

Similar Documents

Publication Publication Date Title
CN109872162B (en) Wind control classification and identification method and system for processing user complaint information
CN111985229A (en) Sequence labeling method and device and computer equipment
CN109766418B (en) Method and apparatus for outputting information
CN110825827B (en) Entity relationship recognition model training method and device and entity relationship recognition method and device
CN110377733A (en) A kind of text based Emotion identification method, terminal device and medium
CN111177325A (en) Method and system for automatically generating answers
CN111814482B (en) Text key data extraction method and system and computer equipment
CN113761219A (en) Knowledge graph-based retrieval method and device, electronic equipment and storage medium
CN111753090A (en) Document auditing method, device, equipment and medium based on RPA and AI
CN112906361A (en) Text data labeling method and device, electronic equipment and storage medium
CN111177307A (en) Test scheme and system based on semantic understanding similarity threshold configuration
CN112860919A (en) Data labeling method, device and equipment based on generative model and storage medium
CN111091004A (en) Training method and training device for sentence entity labeling model and electronic equipment
CN114048129A (en) Automatic testing method, device, equipment and system for software function change
CN115935344A (en) Abnormal equipment identification method and device and electronic equipment
CN112085091A (en) Artificial intelligence-based short text matching method, device, equipment and storage medium
CN116150367A (en) Emotion analysis method and system based on aspects
CN111324738B (en) Method and system for determining text label
CN113705207A (en) Grammar error recognition method and device
CN116975400A (en) Data hierarchical classification method and device, electronic equipment and storage medium
WO2020242383A1 (en) Conversational diaglogue system and method
CN115249017B (en) Text labeling method, training method of intention recognition model and related equipment
CN112632232B (en) Text matching method, device, equipment and medium
CN112541357B (en) Entity identification method and device and intelligent equipment
CN114637850A (en) Abnormal behavior recognition and model training method, device, equipment and storage 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
GR01 Patent grant
GR01 Patent grant