CN112148862A - Question intention identification method and device, storage medium and electronic equipment - Google Patents

Question intention identification method and device, storage medium and electronic equipment Download PDF

Info

Publication number
CN112148862A
CN112148862A CN202011102362.3A CN202011102362A CN112148862A CN 112148862 A CN112148862 A CN 112148862A CN 202011102362 A CN202011102362 A CN 202011102362A CN 112148862 A CN112148862 A CN 112148862A
Authority
CN
China
Prior art keywords
entity
answer
question
result
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
CN202011102362.3A
Other languages
Chinese (zh)
Other versions
CN112148862B (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.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen 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 Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN202011102362.3A priority Critical patent/CN112148862B/en
Publication of CN112148862A publication Critical patent/CN112148862A/en
Application granted granted Critical
Publication of CN112148862B publication Critical patent/CN112148862B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/33Querying
    • G06F16/332Query formulation
    • G06F16/3329Natural language query formulation or dialogue systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/35Clustering; Classification
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/279Recognition of textual entities
    • G06F40/289Phrasal analysis, e.g. finite state techniques or chunking
    • G06F40/295Named entity recognition

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Computational Linguistics (AREA)
  • Databases & Information Systems (AREA)
  • Mathematical Physics (AREA)
  • Artificial Intelligence (AREA)
  • Human Computer Interaction (AREA)
  • Health & Medical Sciences (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • General Health & Medical Sciences (AREA)
  • Machine Translation (AREA)

Abstract

The application provides a question intention identification method, a question intention identification device, a storage medium and electronic equipment, which are applied to an artificial intelligence natural language processing direction, and for a question-answer pair of question-answer data, the intention of a question can be determined by combining the answer, so that the model is determined to determine which reasoning needs to be carried out on the question to obtain the answer. In the process of classifying the question intention by combining the answer, the text segment relevant to the answer is determined in the context text of the question-answer pair, and the text processing result of the text segment is used for correcting the text processing result of the answer, so that the accuracy of classifying the question intention is improved. In addition, the text processing in the application relates to part of speech recognition and named entity recognition, so that the heuristic problem and intention recognition algorithm at least combines part of speech recognition and named recognition, the comprehensiveness of the text processing can be ensured to the maximum extent, and the classification error caused by the processing of a single technology is avoided.

Description

Question intention identification method and device, storage medium and electronic equipment
Technical Field
The present application relates to the field of artificial intelligence technologies, and in particular, to a problem intention identification method, apparatus, storage medium, and electronic device.
Background
The intent of the question, i.e. the answer to the question, the model requires reasoning about the question. Currently, the research on problem intentions is still in the initial stage, and in problem data sets such as SQuAD, HotpotQA and the like, the problem intentions are simply classified by simply identifying core problem phrases in the problem.
However, because of the numerous problem modes, it is difficult to cover all the problem modes by manually defining the core problem phrases.
Disclosure of Invention
In view of the above, the present application provides a problem intention identifying method, device, storage medium and electronic device to improve the accuracy of problem intention classification.
To achieve the above object, in one aspect, the present application provides a question intention identifying method, including:
acquiring question-answer data to be identified, wherein the question-answer data comprises a question-answer pair comprising a question and an answer and a context text of the question-answer pair in an article to which the question-answer pair belongs;
determining a text segment which is the same as the answer in the context text, and respectively obtaining the text segment and a text processing result of the answer, wherein the text processing result comprises a part-of-speech tagging result and an entity tagging result;
correcting the part-of-speech tagging result of the answer according to the part-of-speech tagging result of the text segment, and correcting the entity tagging result of the answer according to the entity tagging result of the text segment;
and performing intention classification on the question at least based on the part-of-speech tagging result after answer correction and the entity tagging result after correction.
In a possible implementation manner, the modifying the part-of-speech tagging result of the answer according to the part-of-speech tagging result of the text fragment includes:
counting the distribution probability of the part of speech tagging results of the text segments;
and taking the part-of-speech tagging result with the highest distribution probability as the part-of-speech tagging result of the answer.
In another possible implementation manner, the modifying the entity tagging result of the answer according to the entity tagging result of the text fragment includes:
acquiring an entity label of a first entity in the entity labeling result of the text segment and an entity label of a second entity in the entity labeling result of the answer;
combining and de-duplicating the first entity and the second entity to obtain a third entity;
and determining a target entity label of the third entity according to at least one of the entity labeling result of the third entity in the text segment and the entity label in the entity labeling result of the answer, wherein the target entity label of the third entity belongs to the entity labeling result after the answer is corrected.
In another possible implementation manner, the determining, according to at least one of the entity labels of the third entity in the entity labeling result of the text segment and the entity labeling result of the answer, the target entity label of the third entity includes:
and if the entity labels of the third entity in the entity labeling result of the text segment are multiple, taking the entity label with the highest frequency in the multiple entity labels of the third entity as the target entity label of the third entity.
In another possible implementation manner, the performing intent classification on the question based on at least the modified part-of-speech tagging result and the modified entity tagging result of the answer includes:
if the entity labeling result after answer correction comprises a plurality of entities and the entity labels of the entities in the entity labeling result after answer correction belong to the same type, identifying the parts of speech of other phrases except the entities in the part of speech labeling result after answer correction;
and if the parts of speech of the other phrases are conjunctions, determining the intention of the question according to the same entity label in the entity labeling result of the plurality of entities after the answer correction.
In another possible implementation manner, the performing intent classification on the question based on at least the modified part-of-speech tagging result and the modified entity tagging result of the answer further includes:
and if the parts of speech of the other phrases are not all connecting words, matching a preset problem text mode for the problem to determine the intention of the problem according to the matched target problem text mode.
In another possible implementation manner, the performing intent classification on the question based on at least the modified part-of-speech tagging result and the modified entity tagging result of the answer further includes:
and matching a preset character string mode to the question to determine the intention of the question according to the matched target character string mode.
In yet another aspect, the present application also provides an issue intention identifying apparatus, including:
the data acquisition module is used for acquiring question and answer data to be identified, wherein the question and answer data comprises a question and answer pair containing a question and an answer and a context text of the question and answer pair in an article to which the question and answer pair belongs;
the text processing module is used for determining a text segment which is the same as the answer in the context text and respectively acquiring the text segment and a text processing result of the answer, wherein the text processing result comprises a part-of-speech tagging result and an entity tagging result;
the annotation correcting module is used for correcting the part-of-speech annotation result of the answer according to the part-of-speech annotation result of the text segment and correcting the entity annotation result of the answer according to the entity annotation result of the text segment;
and the intention classification module is used for classifying the intention of the question at least based on the part-of-speech tagging result after the answer is corrected and the entity tagging result after the answer is corrected.
In yet another aspect, the present application further provides a storage medium having stored therein computer-executable instructions for performing the problem intent identification method.
In another aspect, the present application further provides an electronic device, including: at least one memory and at least one processor; the memory stores a program, and the processor invokes the program stored in the memory, the program being for implementing the problem intent identification method.
According to the question intention identification method, the question intention identification device, the storage medium and the electronic equipment, for question-answer pairs of question-answer data, the intention of questions can be determined by combining answers, and therefore it is determined which reasoning needs to be carried out on the questions by a model to obtain the answers. In the process of classifying the question intention by combining the answers, the answers lack context information and are limited in classification accuracy when being used alone, so that the text segment relevant to the answers is determined in the context text of the question-answer pair, and the text processing result of the text segment is used for correcting the text processing result of the answers, so that the accuracy of classifying the question intention is improved.
In addition, the text processing in the application relates to part of speech recognition and named entity recognition, so that the heuristic problem and intention recognition algorithm at least combines part of speech recognition and named recognition, the comprehensiveness of the text processing can be ensured to the maximum extent, and the classification error caused by the processing of a single technology is avoided.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced below, it is obvious that the drawings in the following description are only embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.
Fig. 1 is a block diagram of a hardware structure of an electronic device according to an embodiment of the present disclosure;
FIG. 2 is a flowchart of a method for identifying a problem intention according to an embodiment of the present application;
FIG. 3 is a flowchart of another method of problem intent identification method provided by an embodiment of the present application;
fig. 4 is a schematic structural diagram of a problem intention recognition apparatus according to an embodiment of the present application.
Detailed Description
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 of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
In order to make the aforementioned objects, features and advantages of the present application more comprehensible, the present application is described in further detail with reference to the accompanying drawings and the detailed description.
Artificial Intelligence (AI) is a theory, method, technique and application system that uses a digital computer or a machine controlled by a digital computer to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use the knowledge to obtain the best results. In other words, artificial intelligence is a comprehensive technique of computer science that attempts to understand the essence of intelligence and produce a new intelligent machine that can react in a manner similar to human intelligence. Artificial intelligence is the research of the design principle and the realization method of various intelligent machines, so that the machines have the functions of perception, reasoning and decision making.
The artificial intelligence technology is a comprehensive subject and relates to the field of extensive technology, namely the technology of a hardware level and the technology of a software level. The artificial intelligence infrastructure generally includes technologies such as sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technologies, operation/interaction systems, mechatronics, and the like. The artificial intelligence software technology mainly comprises a computer vision technology, a voice processing technology, a natural language processing technology, machine learning/deep learning and the like.
Among them, Natural Language Processing (NLP) is an important direction in the fields of computer science and artificial intelligence. It studies various theories and methods that enable efficient communication between humans and computers using natural language. Natural language processing is a science integrating linguistics, computer science and mathematics. Therefore, the research in this field will involve natural language, i.e. the language that people use everyday, so it is closely related to the research of linguistics. Natural language processing techniques typically include text processing, semantic understanding, machine translation, robotic question and answer, knowledge mapping, and the like.
The application mainly relates to text preprocessing and semantic understanding in natural language processing technology, and divides an original complete data set into subsets with different question intentions, and researches on generalization performance of a question-answering model on different question intentions or researches on a specific intention reasoning process of the model can be carried out among the subsets.
Therefore, the samples in the data set can be respectively used as question and answer data to be identified in the application, and the question intentions of the samples in the data set can be classified based on the application, so that the samples are divided into different subsets according to the question intentions.
To facilitate understanding of the present application by those skilled in the art, the following terms related to the present application are first defined:
named Entity Recognition (NER): the finger identifies and marks entities with specific meanings in the text, and generally an entity represents a specific object individual, such as a name of a person, a place name, time, a number and the like.
Part-of-Speech (POS) recognition: and labeling the phrases in the text as corresponding parts of speech, such as nouns, adjectives, verbs and the like.
Model generalization performance (modegeneralization): refers to the performance of the model after being trained on a certain field/fields and then directly applied to other unknown fields.
There is currently less research on the classification of problems intentions. The SQuAD, HotpotQA, etc. query and answer datasets simply classify questions based on the core question vocabulary (central query word) in the question. For example, in english data, a specific question text pattern is formed from the question words at the head of WH, verb (is, are), and verb assist (do, dos), and the question is matched with the designed pattern, thereby completing classification.
Or identifying the named entity in the answer based on the NER tool, and if the named entity exists, classifying the named entity according to the category of the named entity, otherwise, classifying the question intention of the named entity into a general noun.
It can be seen that in the prior art, only the question intentions are classified from the question text level (question mode) or the answer text level (NER classification), on one hand, the manually designed question mode has limited diversity and cannot cover all question types, on the other hand, the existing NER tool has a certain error, and the single NER classification based on the answers greatly affects the accuracy of the question intentions.
In this regard, the question intention identification scheme provided by the application can determine the intention of the question by combining the answers in the question-answer pair, thereby determining which reasoning needs to be performed on the question by the model to obtain the answer. And in the process of classifying the question intention by combining the answer, determining a text segment related to the answer in the context text of the question-answer pair, and correcting the text processing result of the answer by using the text processing result of the text segment, thereby improving the accuracy of classifying the question intention. In addition, the text processing in the application relates to part of speech recognition and named entity recognition, so that the heuristic problem and intention recognition algorithm at least combines part of speech recognition and named recognition, the comprehensiveness of the text processing can be ensured to the maximum extent, and the classification error caused by the processing of a single technology is avoided.
The problem intention identification method provided by the embodiment of the application can be applied to electronic devices such as a server or a PC terminal, and referring to a hardware structure block diagram of the electronic device shown in fig. 1, the hardware structure of the electronic device may include:
at least one processor 11, at least one communication interface 12, at least one memory 13 and at least one communication bus 14;
in the embodiment of the present application, the number of the processor 11, the communication interface 12, the memory 13 and the communication bus 14 is at least one, and the processor 11, the communication interface 12 and the memory 13 complete mutual communication through the communication bus 14;
the processor 11 may be a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), or an application Specific Integrated circuit (asic), or one or more Integrated circuits configured to implement the embodiments of the present application, etc.;
the memory 13 may include a high-speed RAM memory, and may further include a non-volatile memory (non-volatile memory) or the like, such as at least one disk memory;
wherein, the memorizer stores the procedure, the procedure that the processor can call the memorizer to store, the procedure is used for:
acquiring question-answer data to be identified, wherein the question-answer data comprises a question-answer pair comprising a question and an answer and a context text of the question-answer pair in an article to which the question-answer pair belongs;
determining text segments which are the same as the answers in the context texts, and respectively acquiring text processing results of the text segments and the answers, wherein the text processing results comprise part-of-speech tagging results and entity tagging results;
correcting the part-of-speech tagging result of the answer according to the part-of-speech tagging result of the text segment, and correcting the entity tagging result of the answer according to the entity tagging result of the text segment;
and performing intention classification on the questions at least based on the part-of-speech tagging results after answer correction and the entity tagging results after answer correction.
Alternatively, the detailed function and the extended function of the program may be described with reference to the following.
Referring to a method flowchart of the problem intention identification method shown in fig. 2, the problem intention identification method provided by the embodiment of the present application includes the following steps:
s101, obtaining question and answer data to be identified, wherein the question and answer data comprises a question and answer pair containing a question and an answer and a context text of the question and answer pair in the article to which the question and answer pair belongs.
In the embodiment of the present application, the question-answer data to be identified may be a sample in a data set of the intentions of the question to be distinguished, and the question-answer data at least includes a question-answer pair and the context text of the question-answer pair in the article.
For a question-answer pair, it generally corresponds to a portion of the text in an article. For example, an article related to newton mentions that "newton finds the law of universal gravitation on the basis of the previous (kepler, hooke, rahn and harley) research by virtue of his extraordinary mathematical ability", for which a question-answer pair can be generated: the question "who the finder of the law of universal gravitation is" and the answer "newton".
In this regard, based on the research of "newton's predecessors (kepler, hooke, rahn and harley), the sentence, a plurality of sentences above the sentence, and a plurality of sentences below the sentence in the article can be found as the context text of the question-answer pair by virtue of the extraordinary mathematical ability of the article. Of course, the number of sentences above and below is not limited in the embodiments of the present application.
S102, determining a text segment which is the same as the answer in the context text, and respectively obtaining text processing results of the text segment and the answer, wherein the text processing results comprise part-of-speech tagging results and entity tagging results.
In the embodiment of the application, one or more text segments which are the same as the answer can be retrieved from the context text in a character string matching manner. Continuing with the question-answer pair-who the finder of the universal gravitation law is "and the answer" newton "as examples, all" newtons "can be retrieved from the context text of the question-answer pair, and each" newton "phrase retrieved is used as a text fragment.
In addition, in this embodiment of the application, a text processing tool, such as SpaCy, may be used to perform part-of-speech recognition and named entity recognition on the context text and the answer, respectively, that is, obtain a part-of-speech tagging result and an entity tagging result of the context text, and a part-of-speech tagging result and an entity tagging result of the answer. The part-of-speech tagging result comprises part-of-speech tagged to each phrase, and the entity tagging result comprises entity tags tagged to the identified entities.
Therefore, on the basis of the determined text segment, the part-of-speech tagging result and the entity tagging result of the text segment are obtained from the corresponding position of the context text according to the position of the text segment in the context text. Continuing to take question-answer pairs-who the finder of the law of universal gravitation is the question "and the answer" newton "as an example, assume that the text in the context thereof consists of sentence 1, sentence 2 and sentence 3, and the text segment of the answer" newton "has 3 positions where it appears-the 5 th phrase of sentence 1, the 1 st phrase of sentence 3 and the 10 th phrase of sentence 3. Therefore, after the part-of-speech tagging results and the entity tagging results of sentence 1, sentence 2 and sentence 3 are obtained, the part-of-speech tagging results and the entity tagging results of the 5 th phrase of sentence 1, the 1 st phrase of sentence 3 and the 10 th phrase of sentence 3 in the context text can be obtained as the part-of-speech tagging results and the entity tagging results of the text segment, respectively.
S103, correcting the part-of-speech tagging result of the answer according to the part-of-speech tagging result of the text segment, and correcting the entity tagging result of the answer according to the entity tagging result of the text segment.
In the embodiment of the application, part-of-speech recognition and entity recognition of the text segment are performed based on the context text, so that context information is considered in part-of-speech tagging results and entity tagging results, and the tagging results are obviously more comprehensive and accurate unlike the case that answers lack context information, and entity missing or part-of-speech errors caused by individual tagging of the answers cannot occur.
Based on this, compared with named entity recognition, part-of-speech recognition has stronger dependence on context information, so when the part-of-speech tagging result of the answer is corrected, the part-of-speech tagging result of the text segment is taken as a reference, the part-of-speech tagging result of the text segment and the part-of-speech tagging result of the answer can be specifically compared, and once the part-of-speech tagging result of the text segment is different from the part-of-speech tagging result of the answer, the part-of-speech tagging result of the text segment is taken as the part-of-speech tagging result after.
If the number of the text segments is one, or the number of the text segments is multiple and the part-of-speech tagging results of the multiple text segments are one (the part-of-speech tagging results of all the text segments are the same), the part-of-speech tagging results of the text segments can be directly adopted.
In addition, if the number of the text segments is multiple, wherein multiple part-of-speech tagging results may occur, that is, the part-of-speech tagging results of at least two text segments are different, then the distribution probability of the part-of-speech tagging results of the text segments may be counted, and the part-of-speech tagging result with the highest distribution probability is used as the part-of-speech tagging result of the answer. The distribution probability is explained below:
specifically, assuming that there are N text segments, where N1 text segments with part-of-speech tagging result a, N2 text segments with part-of-speech tagging result b, N3 text segments with part-of-speech tagging result c, and N1+ N2+ N3 ═ N, it may be determined that the distribution probability of the part-of-speech tagging result a is N1/N, the distribution probability of the part-of-speech tagging result b is N2/N, and the distribution probability of the part-of-speech tagging result c is N3/N.
Based on the above, the part-of-speech tagging result corresponding to the highest probability in the distribution probabilities N1/N, N2/N, N3/N is selected as the part-of-speech tagging result of the answer.
In addition, when the entity labeling result of the answer is corrected, in consideration of entity loss caused by missed detection of named recognition entity recognition, the entity labeling result of the text fragment and the entity labeling result of the answer can be merged, namely a union set is obtained. Therefore, the entity comprehensiveness in the entity labeling result after answer correction is higher.
Specifically, the merged entity tagging result includes two parts, the merged entity and the entity tag of the merged entity. Generally, an entity represents a certain individual in different contexts, such as "newton" and "beijing", so that when the named entity is identified, the entity label for the entity label can be determined, for example, the entity label for "newton" is "person name" and the entity label for "beijing" is "place name".
Therefore, when the entity labeling result of the text segment and the entity labeling result of the answer are combined, the entity can be directly combined and deduplicated, and for the entity obtained after combination and deduplication, the entity label of the entity can be directly obtained from the entity labeling result of the text segment or the entity labeling result of the answer. The following steps can be specifically adopted:
acquiring an entity label of a first entity in an entity labeling result of the text fragment and an entity label of a second entity in an entity labeling result of the answer; combining and de-duplicating the first entity and the second entity to obtain a third entity; and determining a target entity label of the third entity according to at least one of the entity labeling result of the third entity in the text segment and the entity label in the entity labeling result of the answer, wherein the target entity label of the third entity belongs to the entity labeling result after the answer is corrected.
In the embodiment of the present application, the entities included in the answer can be determined to the greatest extent by merging and deduplicating the entity (i.e., the first entity) of the text segment and the entity (i.e., the second entity) of the answer. Further, for a third entity obtained after combining and deduplication:
and if the third entity is only located in the entity labeling result of the text segment, acquiring the entity label of the third entity from the entity labeling result of the located text segment as the target entity label. Similarly, if the third entity is only located in the entity labeling result of the answer, the entity label thereof is obtained from the entity labeling result of the answer as the target entity label thereof.
In addition, in practical applications, the individuals represented by parts of the entities appearing in different contexts are not fixed, such as "304", which can be regarded as numbers on one hand and organization names on the other hand, and the entity labels of "304" as entities are divided into "numbers" and "organizations".
Therefore, if the third entity is not only located in the entity labeling result of the text segment, but also located in the entity labeling result of the answer, the entity label of the third entity is obtained from the entity labeling result of the located text segment and the entity labeling result of the answer; and further comparing whether the obtained entity labels are the same.
If the two tags are the same, one entity tag is arbitrarily selected as the target entity tag.
And if different, one entity tag can be selected as the target entity tag according to the context. For example, the text segment where the third entity is located is one, and the corresponding entity tag in the entity tagging result of the text segment is also one, and since one text segment cannot accurately describe the context, the entity tag of the third entity in the entity tagging result of the answer can be used as the target entity tag.
And ensuring that one entity in the entity labeling result after answer modification corresponds to an entity label capable of representing the real context. The following steps may be adopted when determining the target entity tag of the third entity in the embodiment of the present application:
and if the entity labels of the third entity in the entity labeling result of the text segment are multiple, taking the entity label with the highest frequency of occurrence in the multiple entity labels of the third entity as the target entity label of the third entity.
In the embodiment of the application, if the text segment where the third entity is located is multiple and the entity labels in the entity labeling results of the multiple text segments are different, that is, the text segments are multiple, the occurrence frequency of each entity label of the third entity can be counted at this time, and the entity label with the highest occurrence frequency is used as the target entity label.
For example, the third entity is located in the entity labeling result of M text segments, the frequency of occurrence of the entity label d is M1, the frequency of occurrence of the entity label e is M2, and M1+ M2 is M, and then the entity label corresponding to the largest one of M1 and M2 is used as the target entity label of the third entity.
Therefore, all the third entities and the target entity labels thereof form the entity labeling result after answer correction.
And S104, performing intention classification on the questions at least based on the part-of-speech tagging results after answer correction and the entity tagging results after answer correction.
Since the answers have a clear causal relationship to the questions, this can be done based on the answers when classifying the intent of the question. In addition, the entity tag and the intention category have a certain corresponding relationship, for example, "person" corresponds to "person category", "date" corresponds to "date category", "number" corresponds to "number category", "location" corresponds to "location category", and other entity tags correspond to "object category", therefore, in the embodiment of the present application, the corresponding intention category may be preliminarily determined by the entity tag in the answer-corrected entity tagging result, and further, the classification may be assisted by the part of speech in the answer-corrected part of speech tagging result. Thereby taking the finally determined intention category as the intention of the problem.
For example, in some scenarios, the model for intent classification may be trained based on a machine learning algorithm, and the parameter weight of the model is trained through some prior entity tagging samples and part-of-speech tagging samples, so as to ensure that the accuracy of the model for intent classification meets the requirement. In practical application, the part-of-speech tagging result after answer modification and the entity tagging result after modification are input into a trained model, so that the intention category output by the model is obtained.
However, the machine learning algorithm is greatly limited by the context and number of samples, and for this reason, the intention classification method provided by the embodiment of the present application sequentially classifies according to a certain scheme logic on the basis of simultaneously introducing two technologies, named entity recognition and part-of-speech recognition, so that question-answer data that may be misclassified by a single technology can be correctly classified under the combined action of multiple factors.
In some embodiments, if the answer-modified entity labeling result includes an entity, the intention of the question is determined according to an entity label of the entity in the answer-modified entity labeling result, and specifically, the intention may be determined based on a corresponding relationship between the entity label and the intention category.
In order to further ensure the accuracy of intent classification, the text length of the answer can be further limited, that is, the intent of the question can be determined according to the entity label of the entity in the entity labeling result after answer modification on the basis that the entity labeling result after answer modification contains one entity and the text length of the answer is smaller than a preset threshold value. Otherwise, the intention classification is realized by matching the following ways such as 'question text mode', 'part of speech mode' and 'character string mode'.
In other embodiments, if the entity tagging result after the answer correction includes a plurality of entities and the entity tags of the plurality of entities in the entity tagging result after the answer correction belong to the same type, identifying the parts of speech of other phrases except the plurality of entities in the part of speech tagging result after the answer correction; and if the parts of speech of other phrases are conjunctions, determining the intention of the question according to the same entity label in the entity labeling result of the plurality of entities after answer correction.
In the embodiment of the present application, for a scene in which each entity label in the entity labeling result after answer modification is the same, the probability that the question belongs to the intention category corresponding to the entity label is high, but in order to further ensure the accuracy of intention classification, the parts of speech of other phrases except the entities in the answer need to be further identified, and if the phrases are conjunctions such as "and", "or", "and", "or", "as well as", and "as well as", it can be determined that there are multiple entities in the answer that are the same in parallel intention category. In this case, it is more accurate to determine the intention of the question based on the correspondence between the entity label and the intention category.
For example, for the question-answer pair-what the famous tourist attractions of Beijing has "and the answer" the old palace, the great wall, the Yihe garden and the Yuanming garden ", it is obvious that the entity labels of the" old palace "," the great wall "," the Yihe garden "and" the Yuanming garden "in the answer are all" places ", and" are conjunctions, so that the intention of the question "what the famous tourist attractions of Beijing have" is "place category" can be clear.
On the basis, if the parts of speech of other phrases are not all connecting words, matching a preset problem text mode for the problem so as to determine the intention of the problem according to the matched target problem text mode.
Specifically, in the embodiment of the present application, at least one question text pattern may be set in advance for each intention category of a question, the question text pattern may only match the beginning, the end, or any position of the question, and if the text of the question matches one of the question text patterns, that is, the target question text pattern is determined, the question is classified into the intention category corresponding to the target question text pattern.
For example, in english, "who is/who are/who did" as the beginning can match the question intention of "person category", while "how manual/how mura/how old" as the beginning can match the question intention of "number category", and "where is/where do" as the beginning can match the question intention of "place category".
In some other embodiments, to realize the classification of specific question intentions, such as "date category" and "number category", the embodiments of the present application may set at least one string pattern for a specific question intention in advance, such as a string pattern of "date category" being "DD/MM/YYYY" and a string pattern of "number category" being a pure number, a number + currency symbol or a number + comma separator. At the beginning of the intent classification of the question, the question is first matched with a preset character string pattern, and the intent of the question is determined according to the matched target character string pattern.
Many questions may not be classified through the above process, and in other embodiments, if no entity is identified in the answer, i.e., the answer's entity label is empty but contains noun/noun phrases, it may be considered as a "general noun category", e.g., "mad monkey/gold/a village". Thus, the question intent of the "general noun class" can be identified by setting some specific part-of-speech patterns, such as "article + noun", such as "adjective + noun", to match the answer. Specifically, the part-of-speech tagging result after the answer correction is matched with a preset part-of-speech pattern, so as to determine the intention of the question according to the matched target part-of-speech pattern.
To facilitate understanding of the present application, an exemplary scenario of the present application is described below.
Several categories of question intentions "date category", "number category", "location category", "general noun category" and other category labels "object category" are defined herein. Referring to a method flowchart of the problem intention identification method shown in fig. 3, the problem intention identification process of the present application is explained in detail as follows:
s201: and determining a text segment which is the same as the answer in the context text in a character string matching mode, and respectively obtaining text processing results of the text segment and the answer.
S202: and correcting the text processing result of the answer by using the text processing result of the text fragment: due to the lack of context information, the individual labeling may result in missing entities or part-of-speech errors. The part-of-speech tagging result after answer correction is based on the text segment, and the entity tagging result after answer correction is obtained by merging the text segment and the entity of the answer.
S203: for the text of the answer, whether the character string pattern of the date is matched is judged: the method of using string matching confirms whether the text of the answer contains such a pattern, determines that the question is intended as "date category" if it contains, and proceeds to step S204 if it does not.
S204: for the text of the answer, whether the character string pattern of the number is matched is judged: the method of using string matching confirms whether the text of the answer contains such a pattern, determines that the question is intended to be "numeric category" if contained, and proceeds to step S205 if not contained.
S205: and judging whether the entity marking result after the answer correction only contains one entity and the text length of the answer is less than a preset threshold value: if so, determining the intent of the problem based on the entity tag of the entity; if not, the process proceeds to step S206.
S206: and for the entity labeling result after answer correction, judging whether the entity labels of the multiple entities are the same and the parts of speech of other phrases except the multiple entities are conjunctions: if the number of entities in the entity labeling result after answer correction is greater than 1, the part of speech of other phrases except the entities in the text of the answer is further required to be obtained, on one hand, the part of speech labeling result after answer correction can be used for determining, on the other hand, a connected word list can be set, and if the other phrases except the entities are all in the connected word list, the intention of the question is determined according to the entity label of any entity; otherwise, the process proceeds to step S207.
S207: judging whether a problem text mode matched with the problem exists: the step sets a series of text patterns for each intention type of the question, and can only match the beginning, the end or any position, and determine the intention of the question according to the matched target question text patterns. If no question text pattern is matched, step S208 is entered.
S208: judging whether a part-of-speech mode matched with the part-of-speech tagging result after answer correction exists or not: this step sets some specific part-of-speech patterns for the general noun class of the answer, and determines that the question is intended as a "general noun class" if there are matching target part-of-speech patterns. If not, it is considered to be another label, possibly containing some long sentences, adjectives, verb phrases, etc., such as "black/singing/a US $10a week rain over Tesla's US $18per week sarary".
In summary, according to the method, three types of factors related to the problem intention, namely naming recognition, part of speech recognition and specific pattern recognition are considered at the same time, and through the series connection of related steps, the problems which are possibly misclassified by a single technology can be correctly classified under the combined action of a plurality of factors.
To verify the effectiveness of the present application, applicants classified the original dataset into several subsets on the SQuAD and NewsQA datasets using the present application and NER-based methods, and randomly selected 100 samples on each subset to manually evaluate the classification accuracy, the results are shown in the following table. It can be seen that the classification accuracy of the present application across classes is generally higher than that of a single NER-based approach.
Figure BDA0002725832230000151
In the following, the problem intention identifying device provided in the embodiments of the present application is described, and the problem intention identifying device described below may be regarded as a program module that is required to be provided by an electronic device to implement the problem intention identifying method provided in the embodiments of the present application. The issue intent recognition device contents described below may be cross-referenced with the issue intent recognition method contents described above.
Fig. 4 is a schematic structural diagram of a problem intention recognition apparatus according to an embodiment of the present application. As shown in fig. 4, the problem intention identifying apparatus includes:
the data acquisition module 101 is configured to acquire question and answer data to be identified, where the question and answer data includes a question-answer pair including a question and an answer, and a context text of the question-answer pair in an article to which the question-answer pair belongs;
the text processing module 102 is configured to determine a text segment identical to the answer in the context text, and obtain a text processing result of the text segment and the answer, where the text processing result includes a part-of-speech tagging result and an entity tagging result;
the label correction module 103 is configured to correct a part-of-speech label result of the answer according to the part-of-speech label result of the text segment, and correct an entity label result of the answer according to the entity label result of the text segment;
and an intention classification module 104, configured to perform intention classification on the question based on at least the modified part-of-speech tagging result of the answer and the modified entity tagging result.
In the device for identifying a question intention provided in an embodiment of the present application, the annotation correction module 103 corrects a part-of-speech annotation result of an answer according to a part-of-speech annotation result of a text segment, including:
counting the distribution probability of part-of-speech tagging results of the text segments; and taking the part-of-speech tagging result with the highest distribution probability as the part-of-speech tagging result of the answer.
In the device for identifying a question intention provided in the embodiment of the present application, the annotation correction module 103 corrects the entity annotation result of the answer according to the entity annotation result of the text segment, including:
acquiring an entity label of a first entity in an entity labeling result of the text fragment and an entity label of a second entity in an entity labeling result of the answer; combining and de-duplicating the first entity and the second entity to obtain a third entity; and determining a target entity label of the third entity according to at least one of the entity labeling result of the third entity in the text segment and the entity label in the entity labeling result of the answer, wherein the target entity label of the third entity belongs to the entity labeling result after the answer is corrected.
In the device for identifying a question intention provided in the embodiment of the present application, the annotation modification module 103 determines the target entity label of the third entity according to at least one of the entity labels of the third entity in the entity annotation result of the text segment and the entity labeling result of the answer, including:
and if the entity labels of the third entity in the entity labeling result of the text segment are multiple, taking the entity label with the highest frequency of occurrence in the multiple entity labels of the third entity as the target entity label of the third entity.
In the device for identifying a question and an intention provided in the embodiment of the present application, the intention classification module 104 performs intention classification on the question based on at least a part-of-speech tagging result after answer modification and a modified entity tagging result, including:
if the entity labeling result after answer correction comprises a plurality of entities and the entity labels of the entities in the entity labeling result after answer correction belong to the same type, identifying the parts of speech of other phrases except the entities in the part of speech labeling result after answer correction; and if the parts of speech of other phrases are conjunctions, determining the intention of the question according to the same entity label in the entity labeling result of the plurality of entities after answer correction.
Further, in the device for identifying question intentions provided in the embodiment of the present application, the intention classifying module 104 performs intention classification on the question based on at least the modified part-of-speech tagging result of the answer and the modified entity tagging result, and further includes:
and if the parts of speech of other phrases are not all connecting words, matching a preset problem text mode for the problem to determine the intention of the problem according to the matched target problem text mode.
Further, in the device for identifying question intentions provided in the embodiment of the present application, the intention classifying module 104 performs intention classification on the question based on at least the modified part-of-speech tagging result of the answer and the modified entity tagging result, and further includes:
the question is matched with a preset character string pattern to determine the intention of the question according to the matched target character string pattern.
Embodiments of the present application also provide a computer-readable storage medium, in which computer-executable instructions are stored, and the computer-executable instructions are configured to perform the above problem intention identification method.
Alternatively, the detailed functionality and extended functionality of the computer-executable instructions may be as described above.
The above detailed description is provided for a problem intention recognition method, apparatus, storage medium and electronic device, and the principle and implementation of the present application are explained by applying specific examples, and the description of the above embodiments is only used to help understanding the method and core ideas of the present application; meanwhile, for a person skilled in the art, according to the idea of the present application, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present application.
It should be noted that, in the present specification, the embodiments are all described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments may be referred to each other. The device disclosed by the embodiment corresponds to the method disclosed by the embodiment, so that the description is simple, and the relevant points can be referred to the method part for description.
It is further noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include or include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the application. Thus, the present application is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (10)

1. A question intention identification method, characterized in that the method comprises:
acquiring question-answer data to be identified, wherein the question-answer data comprises a question-answer pair comprising a question and an answer and a context text of the question-answer pair in an article to which the question-answer pair belongs;
determining a text segment which is the same as the answer in the context text, and respectively obtaining the text segment and a text processing result of the answer, wherein the text processing result comprises a part-of-speech tagging result and an entity tagging result;
correcting the part-of-speech tagging result of the answer according to the part-of-speech tagging result of the text segment, and correcting the entity tagging result of the answer according to the entity tagging result of the text segment;
and performing intention classification on the question at least based on the part-of-speech tagging result after answer correction and the entity tagging result after correction.
2. The method of claim 1, wherein said modifying the part-of-speech tagging result of the answer according to the part-of-speech tagging result of the text segment comprises:
counting the distribution probability of the part of speech tagging results of the text segments;
and taking the part-of-speech tagging result with the highest distribution probability as the part-of-speech tagging result of the answer.
3. The method of claim 1, wherein the modifying the entity tagging result of the answer according to the entity tagging result of the text segment comprises:
acquiring an entity label of a first entity in the entity labeling result of the text segment and an entity label of a second entity in the entity labeling result of the answer;
combining and de-duplicating the first entity and the second entity to obtain a third entity;
and determining a target entity label of the third entity according to at least one of the entity labeling result of the third entity in the text segment and the entity label in the entity labeling result of the answer, wherein the target entity label of the third entity belongs to the entity labeling result after the answer is corrected.
4. The method of claim 3, wherein the determining the target entity label of the third entity according to at least one of the entity labels of the third entity in the entity labeling result of the text segment and the entity labeling result of the answer comprises:
and if the entity labels of the third entity in the entity labeling result of the text segment are multiple, taking the entity label with the highest frequency in the multiple entity labels of the third entity as the target entity label of the third entity.
5. The method of claim 1, wherein the intent classification of the question based on at least the modified part-of-speech tagging result and the modified entity tagging result of the answer comprises:
if the entity labeling result after answer correction comprises a plurality of entities and the entity labels of the entities in the entity labeling result after answer correction belong to the same type, identifying the parts of speech of other phrases except the entities in the part of speech labeling result after answer correction;
and if the parts of speech of the other phrases are conjunctions, determining the intention of the question according to the same entity label in the entity labeling result of the plurality of entities after the answer correction.
6. The method of claim 5, wherein the intent classification of the question based on at least the modified part-of-speech tagging result and the modified entity tagging result of the answer further comprises:
and if the parts of speech of the other phrases are not all connecting words, matching a preset problem text mode for the problem to determine the intention of the problem according to the matched target problem text mode.
7. The method of claim 5, wherein the intent classification of the question based on at least the modified part-of-speech tagging result and the modified entity tagging result of the answer further comprises:
and matching a preset character string mode to the question to determine the intention of the question according to the matched target character string mode.
8. An issue intent recognition apparatus, the apparatus comprising:
the data acquisition module is used for acquiring question and answer data to be identified, wherein the question and answer data comprises a question and answer pair containing a question and an answer and a context text of the question and answer pair in an article to which the question and answer pair belongs;
the text processing module is used for determining a text segment which is the same as the answer in the context text and respectively acquiring the text segment and a text processing result of the answer, wherein the text processing result comprises a part-of-speech tagging result and an entity tagging result;
the annotation correcting module is used for correcting the part-of-speech annotation result of the answer according to the part-of-speech annotation result of the text segment and correcting the entity annotation result of the answer according to the entity annotation result of the text segment;
and the intention classification module is used for classifying the intention of the question at least based on the part-of-speech tagging result after the answer is corrected and the entity tagging result after the answer is corrected.
9. A storage medium having stored thereon computer-executable instructions for performing the problem intent identification method of any of claims 1-7.
10. An electronic device, comprising: at least one memory and at least one processor; the memory stores a program that the processor calls, the program implementing the question intention identifying method according to any one of claims 1 to 7.
CN202011102362.3A 2020-10-15 2020-10-15 Method and device for identifying problem intention, storage medium and electronic equipment Active CN112148862B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011102362.3A CN112148862B (en) 2020-10-15 2020-10-15 Method and device for identifying problem intention, storage medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011102362.3A CN112148862B (en) 2020-10-15 2020-10-15 Method and device for identifying problem intention, storage medium and electronic equipment

Publications (2)

Publication Number Publication Date
CN112148862A true CN112148862A (en) 2020-12-29
CN112148862B CN112148862B (en) 2024-01-30

Family

ID=73951944

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011102362.3A Active CN112148862B (en) 2020-10-15 2020-10-15 Method and device for identifying problem intention, storage medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN112148862B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112328799A (en) * 2021-01-06 2021-02-05 腾讯科技(深圳)有限公司 Question classification method and device
CN112711657A (en) * 2021-01-06 2021-04-27 北京中科深智科技有限公司 Question-answering method and question-answering system
CN116431794A (en) * 2023-06-15 2023-07-14 图观(天津)数字科技有限公司 Intelligent question-answering method and system based on flow automatic robot technology

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110096570A (en) * 2019-04-09 2019-08-06 苏宁易购集团股份有限公司 A kind of intension recognizing method and device applied to intelligent customer service robot
US10489393B1 (en) * 2016-03-30 2019-11-26 Amazon Technologies, Inc. Quasi-semantic question answering
CN111078875A (en) * 2019-12-03 2020-04-28 哈尔滨工程大学 Method for extracting question-answer pairs from semi-structured document based on machine learning
CN111552805A (en) * 2020-04-16 2020-08-18 重庆大学 Question and answer system question and sentence intention identification method
CN111708874A (en) * 2020-08-24 2020-09-25 湖南大学 Man-machine interaction question-answering method and system based on intelligent complex intention recognition

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10489393B1 (en) * 2016-03-30 2019-11-26 Amazon Technologies, Inc. Quasi-semantic question answering
CN110096570A (en) * 2019-04-09 2019-08-06 苏宁易购集团股份有限公司 A kind of intension recognizing method and device applied to intelligent customer service robot
CN111078875A (en) * 2019-12-03 2020-04-28 哈尔滨工程大学 Method for extracting question-answer pairs from semi-structured document based on machine learning
CN111552805A (en) * 2020-04-16 2020-08-18 重庆大学 Question and answer system question and sentence intention identification method
CN111708874A (en) * 2020-08-24 2020-09-25 湖南大学 Man-machine interaction question-answering method and system based on intelligent complex intention recognition

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112328799A (en) * 2021-01-06 2021-02-05 腾讯科技(深圳)有限公司 Question classification method and device
CN112711657A (en) * 2021-01-06 2021-04-27 北京中科深智科技有限公司 Question-answering method and question-answering system
CN116431794A (en) * 2023-06-15 2023-07-14 图观(天津)数字科技有限公司 Intelligent question-answering method and system based on flow automatic robot technology
CN116431794B (en) * 2023-06-15 2023-08-15 图观(天津)数字科技有限公司 Intelligent question-answering method and system based on flow automatic robot technology

Also Published As

Publication number Publication date
CN112148862B (en) 2024-01-30

Similar Documents

Publication Publication Date Title
Kozareva et al. Paraphrase identification on the basis of supervised machine learning techniques
US20190347571A1 (en) Classifier training
CN110276023B (en) POI transition event discovery method, device, computing equipment and medium
US7630981B2 (en) Method and system for learning ontological relations from documents
US10713438B2 (en) Determining off-topic questions in a question answering system using probabilistic language models
CN107436864A (en) A kind of Chinese question and answer semantic similarity calculation method based on Word2Vec
CN110909122B (en) Information processing method and related equipment
CN112148862B (en) Method and device for identifying problem intention, storage medium and electronic equipment
CN116795973B (en) Text processing method and device based on artificial intelligence, electronic equipment and medium
CN110569335B (en) Triple verification method and device based on artificial intelligence and storage medium
US9703773B2 (en) Pattern identification and correction of document misinterpretations in a natural language processing system
US20200311345A1 (en) System and method for language-independent contextual embedding
CN113505786A (en) Test question photographing and judging method and device and electronic equipment
Singh et al. Review of real-word error detection and correction methods in text documents
Khan et al. Urdu word segmentation using machine learning approaches
CN112711666B (en) Futures label extraction method and device
CN109992651A (en) A kind of problem target signature automatic identification and abstracting method
Khamphakdee et al. A Framework for Constructing Thai Sentiment Corpus using the Cosine Similarity Technique
Dündar et al. A Hybrid Approach to Question-answering for a Banking Chatbot on Turkish: Extending Keywords with Embedding Vectors.
CN114492437B (en) Keyword recognition method and device, electronic equipment and storage medium
JP6586055B2 (en) Deep case analysis device, deep case learning device, deep case estimation device, method, and program
Alfaidi et al. Exploring the performance of farasa and CAMeL taggers for arabic dialect tweets.
CN114298032A (en) Text punctuation detection method, computer device and storage medium
CN110276001B (en) Checking page identification method and device, computing equipment and medium
Gayen et al. Automatic identification of Bengali noun-noun compounds using random forest

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