CN110717026B - Text information identification method, man-machine conversation method and related devices - Google Patents

Text information identification method, man-machine conversation method and related devices Download PDF

Info

Publication number
CN110717026B
CN110717026B CN201910950914.7A CN201910950914A CN110717026B CN 110717026 B CN110717026 B CN 110717026B CN 201910950914 A CN201910950914 A CN 201910950914A CN 110717026 B CN110717026 B CN 110717026B
Authority
CN
China
Prior art keywords
text information
information
intention
entity
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.)
Active
Application number
CN201910950914.7A
Other languages
Chinese (zh)
Other versions
CN110717026A (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 CN201910950914.7A priority Critical patent/CN110717026B/en
Publication of CN110717026A publication Critical patent/CN110717026A/en
Application granted granted Critical
Publication of CN110717026B publication Critical patent/CN110717026B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

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/33Querying
    • G06F16/3331Query processing
    • G06F16/334Query execution
    • G06F16/3344Query execution using natural language analysis
    • 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

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Artificial Intelligence (AREA)
  • Mathematical Physics (AREA)
  • Computational Linguistics (AREA)
  • Human Computer Interaction (AREA)
  • Machine Translation (AREA)

Abstract

The invention discloses a text information identification method, which comprises the following steps: acquiring a text information processing result corresponding to the first text information; if the text information processing result meets the information recall condition, generating text information to be identified corresponding to the first text information according to second text information, wherein the second text information is text information associated with the first text information, and the text information to be identified comprises entity information and intention information; determining an entity type corresponding to the entity information based on the intention template set and the intention information; and generating a text information identification result corresponding to the first text information according to the entity type and the intention information corresponding to the entity information. The invention also discloses a method and a device for man-machine conversation. The invention can reduce the complexity of template matching, reduce the situation of error recovery of text information and further improve the accuracy of text information identification.

Description

Text information identification method, man-machine conversation method and related devices
Technical Field
The invention relates to the field of artificial intelligence, in particular to a text information identification method, a man-machine conversation method and a related device.
Background
Natural language understanding (Natural Language Understanding, NLU) is commonly referred to as man-machine dialog. The man-machine dialogue simulates the language interaction process of a person through an electronic computer, so that the computer can understand and use the natural language of the human society to realize the natural language communication between man-machine, and replace part of mental labor of the person. NLU technology plays a very important role in the wave of the current new technological revolution.
At present, a man-machine conversation method is used for acquiring the problem input by a user for a machine, then abstracting a template from the possible contents in a conversation by using a template matching mode, then calculating the input context and the input context to obtain the template closest to the input context, and recovering the input context according to the template and the stored context.
However, since each problem needs to be recovered by adopting a corresponding template, a large number of templates exist in actual production, so that conflicts easily occur between the templates, errors in similarity calculation are caused, and accuracy of text information identification is reduced.
Disclosure of Invention
The embodiment of the invention provides a text information identification method, a man-machine conversation method and a related device, which can reduce the complexity of template matching, reduce the situation of error recovery of text information and further improve the accuracy of text information identification.
In view of this, a first aspect of the present invention provides a method for identifying text information, including:
acquiring a text information processing result corresponding to the first text information;
if the text information processing result meets an information recall condition, generating text information to be identified corresponding to the first text information according to second text information, wherein the second text information is text information associated with the first text information, and the text information to be identified comprises entity information and intention information;
determining an entity type corresponding to the entity information based on an intention template set and the intention information, wherein the intention template set has a corresponding relation with the intention information, and the intention template set comprises at least one intention template;
and generating a text information identification result corresponding to the first text information according to the entity type corresponding to the entity information and the intention information.
A second aspect of the present invention provides a method of human-machine conversation, comprising:
receiving first text information sent by a client;
acquiring a text information processing result corresponding to the first text information;
if the text information processing result meets an information recall condition, generating text information to be identified corresponding to the first text information according to second text information, wherein the second text information is text information associated with the first text information, and the text information to be identified comprises entity information and intention information;
Determining an entity type corresponding to the entity information based on an intention template set and the intention information, wherein the intention template set has a corresponding relation with the intention information, and the intention template set comprises at least one intention template;
generating a text information identification result corresponding to the first text information according to the entity type corresponding to the entity information and the intention information;
determining third text information according to the text information identification result, wherein the third text information comprises reply information with association relation with the first text information;
and sending the third text information to the client so that the client displays the third text information.
A third aspect of the present invention provides a text information recognition apparatus including:
the acquisition module is used for acquiring a text information processing result corresponding to the first text information;
the generation module is used for generating text information to be identified corresponding to the first text information according to second text information if the text information processing result acquired by the acquisition module meets an information recall condition, wherein the second text information is text information associated with the first text information, and the text information to be identified comprises entity information and intention information;
The determining module is used for determining an entity type corresponding to the entity information based on an intention template set and the intention information, wherein the intention template set has a corresponding relation with the intention information, and the intention template set comprises at least one intention template;
the generating module is further configured to generate a text information recognition result corresponding to the first text information according to the entity type corresponding to the entity information and the intention information determined by the determining module.
In one possible design, in a first implementation of the third aspect of the embodiments of the present invention,
the acquisition module is specifically used for processing the first text information to obtain a word segmentation labeling result of the first text information;
acquiring an intention classification result corresponding to the first text information through a statistical classification model;
and generating the text information processing result according to the word segmentation labeling result and the intention classification result.
In a possible design, in a second implementation of the third aspect of the embodiments of the present invention,
the obtaining module is specifically configured to determine that the text information processing result meets the information recall condition if the entity information does not exist in the first text information according to the word segmentation result, and the intention information exists in the first text information according to the intention classification result;
The generation module is specifically configured to obtain the entity information according to the second text information;
and generating text information to be identified corresponding to the first text information according to the intention information of the first text information and the entity information of the second text information.
In one possible design, in a third implementation of the third aspect of the embodiments of the present invention,
the obtaining module is specifically configured to determine that the text information processing result meets the information recall condition if the entity information exists in the first text information according to the word segmentation result and the intention information does not exist in the first text information according to the intention classification result;
the generating module is specifically configured to obtain the intention information according to the second text information;
and generating text information to be identified corresponding to the first text information according to the entity information of the first text information and the intention information of the second text information.
In a possible design, in a fourth implementation of the third aspect of the embodiments of the present invention,
the obtaining module is specifically configured to determine that the text information processing result does not satisfy the information recall condition if the entity information is determined to exist in the first text information according to the word segmentation result and the intention information is determined to exist in the first text information according to the intention classification result;
The generation module is further configured to generate text information to be identified corresponding to the first text information according to the entity information of the first text information and the intention information of the first text information if the text information processing result does not meet an information recall condition;
the determining module is further configured to determine an entity type corresponding to the entity information based on an intent template set and the intent information, where the intent template set has a correspondence with the intent information, and the intent template set includes at least one intent template;
the generating module is further configured to generate a text information recognition result corresponding to the first text information according to the entity type corresponding to the entity information and the intention information determined by the determining module.
In a possible design, in a fifth implementation of the third aspect of the embodiments of the present invention,
the acquisition module is further used for acquiring the intention template set according to the intention information;
matching the entity information according to the intention template set to obtain a matching result;
and if the matching is successful according to the matching result, determining that the text information processing result does not meet the information recall condition.
In one possible design, in a sixth implementation of the third aspect of the embodiments of the present invention,
the acquisition module is specifically used for processing the first text information by adopting a conditional random field algorithm to obtain a word segmentation labeling result of the first text information.
In one possible design, in a seventh implementation of the third aspect of the embodiments of the present invention,
the obtaining module is specifically configured to obtain, by using the transformed bi-directional encoder representation BERT model, an intention classification result corresponding to the first text information.
A fourth aspect of the present invention provides a human-machine conversation device, comprising:
the receiving module is used for receiving the first text information sent by the client;
the acquisition module is used for acquiring a text information processing result corresponding to the first text information received by the receiving module;
the generation module is used for generating text information to be identified corresponding to the first text information according to second text information if the text information processing result acquired by the acquisition module meets an information recall condition, wherein the second text information is text information associated with the first text information, and the text information to be identified comprises entity information and intention information;
The determining module is used for determining an entity type corresponding to the entity information based on an intention template set and the intention information, wherein the intention template set has a corresponding relation with the intention information, and the intention template set comprises at least one intention template;
the generation module is further configured to generate a text information recognition result corresponding to the first text information according to the entity type corresponding to the entity information and the intention information determined by the determination module;
the determining module is further configured to determine third text information according to the text information recognition result generated by the generating module, where the third text information includes reply information having an association relationship with the first text information;
and the sending module is used for sending the third text information determined by the determining module to the client so that the client can display the third text information.
A fifth aspect of the present invention provides a server, comprising: memory, transceiver, processor, and bus system;
wherein the memory is used for storing programs;
the processor is configured to execute the program in the memory, including performing the steps of:
Acquiring a text information processing result corresponding to the first text information;
if the text information processing result meets an information recall condition, generating text information to be identified corresponding to the first text information according to second text information, wherein the second text information is text information associated with the first text information, and the text information to be identified comprises entity information and intention information;
determining an entity type corresponding to the entity information based on an intention template set and the intention information, wherein the intention template set has a corresponding relation with the intention information, and the intention template set comprises at least one intention template;
generating a text information identification result corresponding to the first text information according to the entity type corresponding to the entity information and the intention information;
the bus system is used for connecting the memory and the processor so as to enable the memory and the processor to communicate.
A sixth aspect of the present invention provides a server, comprising: memory, transceiver, processor, and bus system;
wherein the memory is used for storing programs;
The processor is configured to execute the program in the memory, including performing the steps of:
receiving first text information sent by a client;
acquiring a text information processing result corresponding to the first text information;
if the text information processing result meets an information recall condition, generating text information to be identified corresponding to the first text information according to second text information, wherein the second text information is text information associated with the first text information, and the text information to be identified comprises entity information and intention information;
determining an entity type corresponding to the entity information based on an intention template set and the intention information, wherein the intention template set has a corresponding relation with the intention information, and the intention template set comprises at least one intention template;
generating a text information identification result corresponding to the first text information according to the entity type corresponding to the entity information and the intention information;
determining third text information according to the text information identification result, wherein the third text information comprises reply information with association relation with the first text information;
Sending the third text information to the client so that the client displays the third text information;
the bus system is used for connecting the memory and the processor so as to enable the memory and the processor to communicate.
A seventh aspect of the invention provides a computer readable storage medium having instructions stored therein which, when run on a computer, cause the computer to perform the method of the above aspects.
From the above technical solutions, the embodiment of the present invention has the following advantages:
in the embodiment of the invention, a text information identification method is provided, firstly, a text information processing result corresponding to first text information is obtained, if the text information processing result meets an information recall condition, text information to be identified corresponding to the first text information is generated according to second text information, the text information to be identified comprises entity information and intention information, then, based on an intention template set and the intention information, the entity type corresponding to the entity information is determined, the intention template set has a corresponding relation with the intention information, the intention template set comprises at least one intention template, and finally, the text information identification result corresponding to the first text information is generated according to the entity type corresponding to the entity information and the intention information. By the method, the entity information and the intention information of the input text information can be extracted and recovered, the entity information and the intention information can be directly inherited, the entity type corresponding to the entity information is determined from the intention template set based on the intention information, and one intention information is usually only corresponding to a plurality of intention templates, so that the complexity of template matching is reduced, the situation of error recovery of the text information is reduced, and the accuracy of text information identification is further improved.
Drawings
FIG. 1 is a schematic diagram of a text message recognition system according to an embodiment of the present invention;
FIG. 2 is a schematic flow chart of text information recovery in an embodiment of the present invention;
FIG. 3 is a schematic diagram of an embodiment of a method for recognizing text messages according to an embodiment of the present invention;
FIG. 4 is a diagram of one embodiment of generating text information to be identified based on context in an embodiment of the present invention;
FIG. 5 is a diagram of another embodiment of generating text information to be identified based on context in an embodiment of the present invention;
FIG. 6 is a diagram of one embodiment of generating text information to be recognized based on the following in an embodiment of the invention;
FIG. 7 is a schematic diagram of an embodiment of entity identification based on a conditional random field algorithm in an embodiment of the present invention;
FIG. 8 is a schematic diagram of an embodiment of a method for man-machine interaction in an embodiment of the invention;
FIG. 9 is a schematic diagram of a man-machine interactive interface based on a text message recognition method according to an embodiment of the present invention;
FIG. 10 is a schematic diagram of an embodiment of a text information recognition device according to an embodiment of the present invention;
FIG. 11 is a schematic diagram of an embodiment of a man-machine interaction device according to an embodiment of the present invention;
FIG. 12 is a schematic diagram of a server according to an embodiment of the present invention;
Fig. 13 is a schematic structural diagram of a terminal device in an embodiment of the present invention.
Detailed Description
The embodiment of the invention provides a text information identification method, a man-machine conversation method and a related device, which can reduce the complexity of template matching, reduce the situation of error recovery of text information and further improve the accuracy of text information identification.
The terms "first," "second," "third," "fourth" and the like in the description and in the claims and in the above drawings, if any, are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments of the invention described herein may be implemented, for example, in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "includes" 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 or inherent to such process, method, article, or apparatus.
It should be appreciated that the method for recognizing text information provided by the present invention may be applied to a natural language understanding (Natural Language Understanding, NLU) scenario, where NLU is an important part of natural language processing (Nature Language processing, NLP), which is an important research area of artificial intelligence (Artificial Intelligence, AI), to study various theories and methods that enable effective communication between a person and a computer in natural language. Natural language processing is a science that integrates linguistics, computer science, and mathematics. Thus, the research in this field will involve natural language, i.e. language that people use daily, so it has a close relationship with the research in linguistics. Natural language processing techniques typically include text information processing, semantic understanding, machine translation, robotic questions and answers, knowledge maps, and the like.
AI is a theory, method, technique, and application system that utilizes a digital computer or a digital computer-controlled machine to simulate, extend, and extend human intelligence, sense the environment, acquire knowledge, and use knowledge to obtain optimal results. In other words, artificial intelligence is an integrated technology of computer science that attempts to understand the essence of intelligence and to produce a new intelligent machine that can react in a similar way to human intelligence. Artificial intelligence, i.e. research on design principles and implementation methods of various intelligent machines, enables the machines to have functions of sensing, reasoning and decision.
The artificial intelligence technology is a comprehensive subject, and relates to the technology with wide fields, namely the technology with a hardware level and the technology with a software level. Artificial intelligence infrastructure technologies generally include 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 other directions.
It should be understood that the method for identifying text information provided by the invention can be specifically applied to an intelligent question-answering system adopting a structural dialogue, for example, an intelligent question-answering system applied to game applications, or an intelligent question-answering system applied to ticket booking applications, or an intelligent question-answering system applied to online shopping applications, or an intelligent question-answering system applied to video applications, and can also be an intelligent question-answering system applied to other applications. The intelligent question-answering system accurately positions the question knowledge required by the user in a question-answer mode, and provides personalized information service for the user by interacting with the user. Including but not limited to the following forms:
(1) Related question and answer pushing
When a user puts forward a question, the intelligent question-answering system pushes the answer of the question, and knowledge related to the question is pushed for the user to inquire, so that all information is comprehensively mastered by asking a question once.
(2) Intelligent prompt for asking questions
During the questioning process of the user, the intelligent questioning and answering system automatically analyzes the input contents to give optimized complement or related prompts.
(3) Automatic ranking of focus problems
For the heat of the knowledge questioning by the user in a certain time, the intelligent questioning and answering system automatically focuses and displays the hot knowledge on a system page according to the access frequency; the knowledge of a specific category is also ordered according to the access frequency and displayed in the page knowledge category column.
(4) Hot spot word focusing
And the intelligent question-answering system counts the service keywords submitted by the users, focuses according to the access frequency, and automatically links the service list related to the keywords to form service hot spot keywords.
(5) On-line customer service questions and answers
And simulating online customer service personnel, and completing customer service action in a website intelligent customer service mode.
(6) Guided interactive customer service
The common problems are consolidated into knowledge of several process diagnostics, which are interactively served by the guidance.
(7) Customer service seat assistance
The expert seat function is completed, standardized knowledge assistance is provided when common seat personnel cannot answer questions, and the common customer service personnel can answer the questions quickly and accurately.
(8) Changing manual customer service
The user can directly connect the artificial customer service personnel in the intelligent consultation service system to conduct online consultation to the customer service personnel.
The intelligent question-answering system can guide, save human resources and improve the automation of information processing. Based on accumulated common questions and answers thereof, the questions are organized into a standard question and answer library form so as to support intelligent question and answer of various forms of questions.
In order to facilitate understanding, the present invention proposes a text information recognition method, which is applied to a text information recognition system shown in fig. 1, please refer to fig. 1, fig. 1 is a schematic diagram of an architecture of the text information recognition system in an embodiment of the present invention, as shown in the drawing, the text information recognition system includes a server and a client, and it should be noted that the client is disposed on a terminal device, where the terminal device includes, but is not limited to, a tablet computer, a notebook computer, a palm computer, a mobile phone, a voice interaction device, and a personal computer (personal computer, PC), and the invention is not limited thereto. The voice interaction device comprises, but is not limited to, intelligent sound equipment and intelligent household appliances.
The user inputs text information or voice information through the client, and if the user inputs text information, the client can directly send the text information to the server. If the user inputs voice information, the client can firstly convert the voice information into text information and then send the text information to the server, or the client can directly send the voice information to the server and convert the voice information into the text information by the server.
For ease of understanding, referring to fig. 2, fig. 2 is a schematic flow chart of recovering text information according to an embodiment of the present invention, and specifically, as shown in the drawings:
in step S1, the content input by the user is acquired, which may specifically refer to a Query (Query) content, where Query represents a complete input speech or output speech.
In step S2, entity extraction is performed on Query input by the user.
In step S3, intention recognition is performed on the Query input by the user.
In step S4, it is determined whether the entity extracted in step S2 and the intention extracted in step S3 are complete, if the entity and the intention are complete, it is necessary to determine whether the correspondence between the entity and the intention is accurate, and if the correspondence between the entity and the intention is accurate, the process jumps to step S7. If there is no complete entity and intent, step S4 is entered. If there is a complete entity and intent, but the correspondence of the entity and intent is wrong, the Query is directly discarded.
In step S5, if there is no complete entity and intention, the session needs to be recalled according to the missing entity and intention, i.e. the entity or intention is extracted from the stored previous session according to the missing entity and intention, and the supplement of the missing entity or missing intention is implemented, so as to obtain a complete Query.
In step S6, according to the complete Query, an intent type relationship template is used to perform error correction processing and alignment operation, where the error correction processing includes correction of a misplaced word, correction of some ambiguous words, and the alignment operation refers to filling into corresponding slots of the template according to the entity type.
In step S7, the entity and intention of Query are restored, and thus, a subsequent question-answer process can be performed.
With reference to the foregoing description, a method for identifying text information in the present invention will be described below with reference to fig. 3, and one embodiment of the method for identifying text information in an embodiment of the present invention includes:
101. acquiring a text information processing result corresponding to the first text information;
in this embodiment, the text information recognition device obtains a text information processing result corresponding to the first text information, where the text information recognition device is typically disposed at a server side, that is, the server obtains the first text information, and the first text information may be Query, where Query represents a complete input speech. The server needs to process the first text information to obtain a text information processing result, wherein the processing mode mainly comprises the steps of extracting entity information from the first text information and identifying intention information from the first text information. It will be appreciated that entity information may also be referred to as an "entity," entity information refers to one or more words in a Query as a central word of the Query, intent information may also be referred to as an "intent," intent information refers to a real intent behind the Query, one Query corresponds to one intent information, and intent information may be considered as a classification of the Query.
It will be appreciated that if the text information recognition device can be deployed on the terminal device side in the case of being offline, the present invention is described by taking the case that the text information recognition device is deployed on the server, however, this should not be construed as limiting the present invention.
102. If the text information processing result meets the information recall condition, generating text information to be identified corresponding to the first text information according to second text information, wherein the second text information is text information associated with the first text information, and the text information to be identified comprises entity information and intention information;
in this embodiment, the server determines whether an information recall condition is satisfied according to a text information processing result, if the information recall condition is satisfied, the second text information needs to be taken out from a stored session, where the second text information is associated with the first text information, specifically may be the text information of the first text information, for example, two text information input by a user sequentially, i.e., first input "please provide a flight for 8 months and 20 days", then input "please provide a flight from Shenzhen to Shanghai", and if "flight from Shenzhen to Shanghai" belongs to the first text information, then "please provide a flight for 8 months and 20 days" may be the second text information. In practical application, the second text information may also refer to any text information before the first text information, but based on consideration of session habits, the second text information is generally the previous session information adjacent to the first text information.
After the server acquires the second text information, the first text information and the second text information are combined to generate text information to be identified, and the text information to be identified comprises entity information and intention information.
103. Determining an entity type corresponding to the entity information based on the intention template set and the intention information, wherein the intention template set has a corresponding relation with the intention information, and the intention template set comprises at least one intention template;
in this embodiment, the server determines, based on the intention information and the intention template set, an entity type corresponding to the entity information, where one intention information corresponds to one intention template set, that is, one intention information corresponds to one set of intention templates. The set of intent templates includes at least one intent template, for example, an intelligent question-answering system for a game-type application, assuming that there is a "range-type" intent that indicates that the user asks questions about the gun's name range in the game, such as "how much this can be most fired to by the rifle". Only one intention template is included in the intention template set corresponding to the intention of the "range class", and the intention template is the correspondence between the intention of the "range (shoot) class" and the entity type of the "fire_name". The intention information corresponding to the words of the 'how much the rifle can be furthest transmitted' is the 'range class' intention, the extracted entity information is the 'rifle', the 'rifle' belongs to the firearm name according to the intention template corresponding to the 'range class' intention, and the obtained text information to be identified is the 'range class' intention and the 'firearm name' entity type.
104. And generating a text information identification result corresponding to the first text information according to the entity type and the intention information corresponding to the entity information.
In this embodiment, the server generates a text recognition result corresponding to the first text information according to the entity type and the intention information corresponding to the entity information. Specifically, assuming that the obtained entity information is a rifle, the corresponding entity type is a firearm name, the intention information is a range class, and the text information obtained by the method is a range class intention and a firearm name entity type. Optionally, the server determines reply content, such as "rifle is 500 meters in range", based on the text information identification result and specific entity information (such as "rifle").
In the embodiment of the invention, a text information identification method is provided, firstly, a text information processing result corresponding to first text information is obtained, if the text information processing result meets an information recall condition, text information to be identified corresponding to the first text information is generated according to second text information, the text information to be identified comprises entity information and intention information, then, based on an intention template set and the intention information, the entity type corresponding to the entity information is determined, the intention template set has a corresponding relation with the intention information, the intention template set comprises at least one intention template, and finally, the text information identification result corresponding to the first text information is generated according to the entity type corresponding to the entity information and the intention information. By the method, the entity information and the intention information of the input text information can be extracted and recovered, the entity information and the intention information can be directly inherited, the entity type corresponding to the entity information is determined from the intention template set based on the intention information, and one intention information is usually only corresponding to a plurality of intention templates, so that the complexity of template matching is reduced, the situation of error recovery of the text information is reduced, and the accuracy of text information identification is further improved.
Optionally, on the basis of the foregoing respective embodiments corresponding to fig. 3, in a first optional embodiment of the method for controlling an object provided by the embodiment of the present invention, obtaining a text information processing result corresponding to the first text information may include:
processing the first text information to obtain a word segmentation labeling result of the first text information;
acquiring an intention classification result corresponding to the first text information through a statistical classification model;
and generating a text information processing result according to the word segmentation labeling result and the intention classification result.
In this embodiment, a method for obtaining a text information processing result is described, where a server needs to perform two aspects of processing on a first text information, namely, performing entity extraction on the first text information, and performing intent recognition on the first text information. The following will describe each.
Named entity recognition methods can be used in the process of entity extraction, and named entities are the study subjects of the named entity recognition methods and generally comprise three major classes (entity class, time class and digit class) and seven minor classes (person name, place name, institution name, time, date, currency and percentage). Evaluating whether a named entity is correctly identified includes two aspects: whether the boundary of the entity is correct and whether the type of the entity is marked correctly. The main method for identifying the named entities is as follows: rules and dictionary based methods, statistical based methods, and mixtures of both, and the like.
The method based on the rules adopts the manual construction of rule templates by linguistic experts, adopts the methods of statistical information, punctuation marks, keywords, indicator words, direction words, position words (such as tail words) and center words, and the like, takes the matching of modes and character strings as a main means, and most of the systems depend on the establishment of a knowledge base and a dictionary.
Methods based on statistical machine learning mainly include hidden markov models (Hidden Markov Mode, HMM), maximum Entropy (ME), support vector machines (Support VectorMachine, SVM), conditional random fields (ConditionalRandom Fields, CRF), and the like. The statistical-based method has high requirements on feature selection, and various features affecting the task need to be selected from the text and added into feature vectors. Depending on the major difficulties faced by the identification of a particular named entity and the characteristics exhibited, consider selecting a feature set that effectively reflects the characteristics of that type of entity. The main method is that the language information contained in the training corpus is counted and analyzed, so that the characteristics are mined from the training corpus. Related features can be categorized into specific word features, contextual features, dictionary and part-of-speech features, stop word features, core word features, semantic features, and the like.
The hybrid approach mainly refers to fusing rules-based approaches and statistical machine learning-based approaches. Since natural language processing is not entirely a random process, using statistical-based methods alone makes state search space very large, filtering pruning processing must be performed in advance with rule knowledge. Thus, a mixing method is used in many cases.
The general named entity flow is mainly divided into four steps: firstly, word segmentation is carried out on the text corpus to be extracted, namely word segmentation processing is carried out on the first text information, and a word segmentation result is obtained. And secondly, acquiring a domain label to be identified, and labeling the word segmentation result, namely, labeling the part of speech of the word segmentation result of the first text information to obtain the word segmentation labeling result. And thirdly, extracting the segmented words marked by the labels. Fourth, the extracted segmentation words are formed into named entities of the required field. In the invention, because the first text information may not contain the entity information, whether the words containing specific meanings exist or not is needed to be determined after the word segmentation marking result is obtained, namely whether the entity information exists or not is determined, if the words exist, the entity information can be extracted from the first text information, and if the words do not exist, the extraction of the entity information is not needed.
The method of intention recognition can be used in the process of intention recognition, the intention recognition is also a classification problem, and the main method of intention recognition is divided into: a word list exhaustion method, a rule analysis method and a machine learning method.
The vocabulary exhaustion method is simpler, namely, the query intention is obtained by directly matching the vocabulary, and meanwhile, the category which is simpler and has more concentrated query mode can be added. The query pattern may be made unordered. The intention recognition mode is simple to realize, and can accurately solve the high-frequency word.
The rule analysis method is suitable for inquiring the category very conforming to the rule, and the intention of the inquiry is obtained by a rule analysis mode, such as: from Beijing to Shanghai today's air ticket prices can be converted into: from place to place date price of bus ticket/air ticket/train ticket. The mode of carrying out intention recognition by means of rules has good recognition accuracy on Query with strong rules, and accurate information can be extracted well.
The machine learning method processes intention recognition as a classification problem, defines different query intention categories, and then counts the common words under each intention category, such as gun names, attack words, brand words, model words, direction words, ground nouns and the like. And calculating the probability of each intention according to the statistical classification model for the first text information input by the user, and finally giving out the intention classification result of the query. However, not all of the intent classification results are intended to have intent information, e.g., when the intent classification results indicate "no intent," i.e., no intent information. For example, the first text message is "frontal," then the statistical classification model may determine the intent classification result as "no intent.
Based on the description, the server needs to generate a text information processing result according to the word segmentation labeling result and the intention classification result. The text information processing result includes the following four cases:
1. determining existence entity information according to the word segmentation labeling result, and determining existence intention information according to the intention classification result;
2. determining existence entity information according to the word segmentation labeling result, and determining non-existence intention information according to the intention classification result;
3. determining non-existence entity information according to the word segmentation labeling result, and determining existence intention information according to the intention classification result;
4. and determining the information of the non-existence entity according to the word segmentation labeling result, and determining the information of the non-existence intention according to the intention classification result.
Secondly, in the embodiment of the invention, a manner of obtaining a text information processing result is provided, namely, a server can perform word segmentation processing on first text information to obtain a word segmentation result of the first text information, and an intention classification result corresponding to the first text information is obtained through a statistical classification model, and the word segmentation result and the intention classification result are combined to generate the text information processing result. By the method, the input Query can be subjected to entity extraction and intention recognition, so that the text information processing result comprises the judgment results of two dimensions of the entity and the intention, and the Query proposed by the user is restored based on the two dimensions, thereby being beneficial to improving the recognition accuracy.
Optionally, on the basis of the foregoing respective embodiments corresponding to fig. 3, in a second optional embodiment of the method for controlling an object provided by the embodiment of the present invention, generating, according to a word segmentation result and an intent classification result, a text information processing result may include:
if the entity information does not exist in the first text information according to the word segmentation result, and the intention information exists in the first text information according to the intention classification result, determining that the text information processing result meets the information recall condition;
the generating text information to be identified corresponding to the first text information according to the second text information may include:
acquiring entity information according to the second text information;
and generating text information to be identified corresponding to the first text information according to the intention information of the first text information and the entity information of the second text information.
In this embodiment, a method for generating text information to be identified based on a text information processing result is described. Specifically, if the server determines that no entity information exists according to the word segmentation annotation result, but determines that intention information exists according to the intention classification result, the server may determine that the current text information processing result satisfies the information recall condition. Meeting the information recall condition means that relevant information can be extracted from the second text information, wherein the relevant information refers to information missing from the first text information, namely, information missing from the first text information is recalled.
For ease of understanding, referring to fig. 4, fig. 4 is a schematic diagram of an embodiment of generating text information to be identified based on context in the embodiment of the present invention, as shown in the schematic diagram, assuming that the first text information is "that damage value woolen", the server performs entity extraction processing and intention recognition processing on the first text information to obtain a text information processing result, specifically, the text information processing result of the first text information is ((empty), harm), that is, there is no entity information, but there is intention of "damage class" of intention (Harm), so that the server determines that the text information processing result satisfies the information recall condition. The server then obtains the second text message from the stored session, and extracts the second text message to perform entity extraction processing on the second text message assuming that the second text message is "know about the AKM condition", so as to obtain entity information "AKM", where AKM refers to a modified karabinev automatic rifle (Avtomat Kalashnikov Modernizirovannyi). After obtaining the intention of "injury", the server may first obtain an intention template set according to the intention information, and if the intention information does not have a corresponding intention template set, may reply to the first text information by using a preset speech, where the preset speech generally includes some general terms, such as "please replace your question" or "sorry, i don't understand" and so on, which is not limited herein.
Assuming that the set of intention templates for the "injury class" intention includes three intention templates, the first intention template is the "injury class" intention corresponding to the firearm name (fire_name), the second intention template is the "injury class" intention corresponding to the firearm name (fire_name) and the armour (armor), and the third intention template is the "injury class" intention corresponding to the firearm name (fire_name) and the helmet (helmet). The entity information 'AKM' extracted from the second text information belongs to a firearm name (fire_name), the entity information is checked by adopting an intention template, the intention information of the first text information is checked to be obtained, and the entity information of the second text information accords with the first intention template, namely, meets the condition that the 'injury type' intention corresponds to the firearm name (fire_name), and the server fills corresponding slots of the intention template according to specific entity types, for example, the AKM writes the firearm name (fire_name) slots. Therefore, complete text information to be recognized (AKM, harm) with accurate corresponding relation can be generated.
It will be appreciated that if the extracted entity information is an irrelevant entity information, such as a user name (TOM) and a firearm name (fire_name) are irrelevant, and therefore, the firearm name (fire_name) and the user name (TOM) cannot be matched, and thus the correspondence relationship is considered to be inaccurate, that is, the text information to be recognized cannot be generated. In this case, the first text information may also be replied to using a preset voice.
In the embodiment of the invention, a method for generating text information to be identified based on text information processing results is provided, namely if the first text information does not have entity information, but the first text information has intention information, the server can extract the entity information from the second text information, and then the intention information of the first text information and the entity information of the second text information are fused to obtain the text information to be identified. By the method, the text can inherit the above information, so that the situation that the Query is difficult to recover due to the lack of the text information is avoided as much as possible, and the accuracy of text information identification is improved.
Optionally, on the basis of the foregoing respective embodiments corresponding to fig. 3, in a third optional embodiment of the method for controlling an object provided by the embodiment of the present invention, generating, according to a word segmentation result and an intent classification result, a text information processing result may include:
if the first text information exists entity information according to the word segmentation result and the first text information does not exist intention information according to the intention classification result, determining that the text information processing result meets the information recall condition;
Generating text information to be identified corresponding to the first text information according to the second text information, including:
acquiring intention information according to the second text information;
and generating text information to be identified corresponding to the first text information according to the entity information of the first text information and the intention information of the second text information.
In this embodiment, a method for generating text information to be identified based on a text information processing result is described. Specifically, if the server determines that there is entity information according to the word segmentation annotation result, but it determines that there is no intention information according to the intention classification result, the server may determine that the current text information processing result satisfies the information recall condition. Meeting the information recall condition means that relevant information can be extracted from the second text information, wherein the relevant information refers to information missing from the first text information, namely, information missing from the first text information is recalled.
For ease of understanding, referring to fig. 5, fig. 5 is a schematic diagram of another embodiment of generating text information to be identified based on context in the embodiment of the present invention, as shown in the schematic diagram, assuming that the first text information is "that AKM, the server performs entity extraction processing and intention recognition processing on the first text information to obtain a text information processing result, specifically, the text information processing result of the first text information is (AKM, (null)), that is, no intention information exists, but there is entity information" AKM ", so that the server determines that the text information processing result satisfies the information recall condition. The server then obtains the second text information from the stored session, and, assuming that the second text information is "what the injury of M416 is", extracts the second text information to perform entity extraction processing to obtain entity information "M416", and performs intention recognition on the second text information to obtain intention information "injury type" intention. Where M416 refers to an assault rifle. At this point, the server gets two pieces of entity information, namely "AKM" and "M416". After obtaining the intention of "injury", the server may first obtain an intention template set according to the intention information, and if the intention information does not have a corresponding intention template set, may reply to the first text information by using a preset speech, where the preset speech generally includes some general terms, such as "please replace your question" or "sorry, i don't understand" and so on, which is not limited herein.
Assuming that the set of intention templates for the "injury class" intention includes three intention templates, the first intention template is the "injury class" intention corresponding to the firearm name (fire_name), the second intention template is the "injury class" intention corresponding to the firearm name (fire_name) and the armour (armor), and the third intention template is the "injury class" intention corresponding to the firearm name (fire_name) and the helmet (helmet). The entity information "M416" extracted from the second text information belongs to a firearm name (fire_name), and the entity information "AKM" extracted from the first text information also belongs to a firearm name (fire_name), and when only one entity information appears in the intention template, the entity information appearing in the first text information is subject to. The entity information 'AKM' extracted from the first text information belongs to a firearm name (fire_name), the entity information is checked by adopting an intention template, the entity information of the first text information and the intention information of the second text information obtained by checking accord with the first intention template, namely that the 'injury' intention corresponds to the firearm name (fire_name) is met, and the server fills corresponding slots of the intention template according to specific entity types, for example, the AKM writes the firearm name (fire_name) slots. Therefore, complete text information to be recognized (AKM, harm) with accurate corresponding relation can be generated.
It will be appreciated that if the extracted entity information is an irrelevant entity information, such as a user name (TOM) and a firearm name (fire_name) are irrelevant, and therefore, the firearm name (fire_name) and the user name (TOM) cannot be matched, and thus the correspondence relationship is considered to be inaccurate, that is, the text information to be recognized cannot be generated. In this case, the first text information may also be replied to using a preset voice.
Secondly, in the embodiment of the invention, a method for generating text information to be identified based on a text information processing result is provided, namely if the first text information has entity information but no intention information exists, the server can extract the intention information from the second text information, and then the entity information of the first text information and the intention information of the second text information are fused to obtain the text information to be identified. By the method, the text can inherit the above information, so that the situation that the Query is difficult to recover due to the lack of the text information is avoided as much as possible, and the accuracy of text information identification is improved.
Optionally, on the basis of the foregoing respective embodiments corresponding to fig. 3, in a fourth optional embodiment of the method for controlling an object provided by the embodiment of the present invention, generating, according to a word segmentation result and an intent classification result, a text information processing result may include:
If the first text information existence entity information is determined according to the word segmentation result and the first text information existence intention information is determined according to the intention classification result, determining that the text information processing result does not meet the information recall condition;
may further include:
if the text information processing result does not meet the information recall condition, generating text information to be identified corresponding to the first text information according to the entity information of the first text information and the intention information of the first text information;
determining an entity type corresponding to the entity information based on the intention template set and the intention information, wherein the intention template set has a corresponding relation with the intention information, and the intention template set comprises at least one intention template;
and generating a text information identification result corresponding to the first text information according to the entity type and the intention information corresponding to the entity information.
In this embodiment, a method for generating text information to be identified based on a text information processing result is described. Specifically, if the server determines that entity information exists according to the word segmentation annotation result and determines that intention information exists according to the intention classification result, the server may determine that the current text information processing result does not satisfy the information recall condition. And in the case that the information recall condition is not met, the related information does not need to be extracted from the second text information.
For ease of understanding, referring to fig. 6, fig. 6 is a schematic diagram of an embodiment of generating text information to be identified based on the following description, where, as shown in the schematic diagram, it is assumed that the first text information is "what the injury of AKM is", and the server performs entity extraction processing and intention recognition processing on the first text information to obtain a text information processing result, specifically, the text information processing result of the first text information is (AKM, harm), that is, there is both "injury type" intention and "AKM" of entity information, so that the server determines that the text information processing result does not satisfy the information recall condition. At this time, after obtaining the intention of "injury", the server may first obtain the intention template set according to the intention information, and if the intention information does not have the corresponding intention template set, may reply to the first text information by using a preset speech, where the preset speech generally includes some general terms, such as "please replace the question" or "sorry, i don't understand" and so on, which is not limited herein.
Assuming that the set of intention templates for the "injury class" intention includes three intention templates, the first intention template is the "injury class" intention corresponding to the firearm name (fire_name), the second intention template is the "injury class" intention corresponding to the firearm name (fire_name) and the armour (armor), and the third intention template is the "injury class" intention corresponding to the firearm name (fire_name) and the helmet (helmet). The entity information 'AKM' extracted from the first text information belongs to a firearm name (fire_name), the entity information is checked by adopting an intention template, the entity information of the first text information and the intention information of the first text information obtained by checking accord with the first intention template, namely the intention of 'injury type' is satisfied and corresponds to the firearm name (fire_name), and a server fills corresponding slots of the intention template according to specific entity types, for example, the AKM writes the firearm name (fire_name) slots. Therefore, complete text information to be recognized (AKM, harm) with accurate corresponding relation can be generated.
It will be appreciated that if the extracted entity information is an irrelevant entity information, such as a user name (TOM) and a firearm name (fire_name) are irrelevant, and therefore, the firearm name (fire_name) and the user name (TOM) cannot be matched, and thus the correspondence relationship is considered to be inaccurate, that is, the text information to be recognized cannot be generated. In this case, the first text information may also be replied to using a preset voice.
In the embodiment of the invention, a method for generating text information to be identified based on text information processing results is provided, namely if the first text information has entity information and intention information, the server determines that the text information processing results do not meet information recall conditions, namely related information does not need to be extracted from a stored session. By the method, the text information to be identified can be efficiently generated, the information is not required to be recalled under the condition that the information recall condition is not met, and the stored information is not required to be extracted or intended to be identified, so that the identification efficiency of the text information is improved.
Optionally, on the basis of the foregoing respective embodiments corresponding to fig. 3, in a fifth optional embodiment of the method for controlling an object according to the present invention, after the root obtains a text information processing result corresponding to the first text information, the method may further include:
Acquiring an intention template set according to intention information;
matching the entity information according to the intention template set to obtain a matching result;
if the matching is successful according to the matching result, the text information processing result is determined to not meet the information recall condition.
In this embodiment, a method for matching entity information by using an intent template set is introduced. It will be appreciated that in determining whether the text information processing results satisfy the information recall condition, it is also necessary to consider whether the entity information matches the intention information. Specifically, taking the first text information as an example, assuming that both the intention information and the entity information exist in the first text information, then the intention template set needs to be acquired according to the intention information. Assuming that the intention information is a "comparison" intention, three intention templates are included in an intention template set corresponding to the "comparison" intention, the first "comparison" intention corresponding to a firearm name (fire_name) and a firearm name (fire_name), the second "comparison" intention corresponding to a Helmet name (helmet_name) and a Helmet name (helmet_name), and the third "comparison" intention corresponding to an armor name (armor_name) and an armor name (armor_name). Assuming that the entity information extracted from the first text information is "bread", it is obvious that the "bread" does not belong to a protective tool, a helmet and a firearm, and therefore the entity information extracted from the first text information is not matched with the intended template set, the obtained matching result is that the matching fails, and at the moment, the first text information can be selected to be discarded. Optionally, it may be further determined that the text information processing result meets the information recall condition, so that the server may select to extract entity information from the second text information to match, and if the entity information extracted from the second text information is "rifle" and the rifle "belongs to the armour, the server generates corresponding text information to be identified according to the intention information in the first text information and the entity information of the second text information.
Assuming that the entity information extracted from the first text information is 'AKM', obviously 'AKM' belongs to firearms, so that the entity information extracted from the first text information is matched with the intention template set, the obtained matching result is successful, at the moment, the text information processing result can be determined that the information recall condition is not met, and the server directly generates corresponding text information to be identified according to the intention information and the entity information in the first text information.
It can be appreciated that in the process of generating the text information to be identified, the server also needs to match the intention information in the first text information with the entity information in the second text information, or match the entity information in the first text information with the intention information in the second text information. The matching process is similar to the above method, namely, the intention information is determined firstly, then whether the intention template set can be acquired or not is determined according to the intention information, and if the intention template set can not be acquired, the matching is failed. If the intention template set can be obtained, continuing to match the intention templates in the intention template set with the entity information, and if the match is successful, generating corresponding text information to be identified. If the matching fails, the method can directly adopt a preset speaking technique to reply.
In the embodiment of the invention, a method for matching entity information by an intention template set is provided, namely after intention information is obtained, the intention template set is required to be obtained according to the intention information, then the intention template in the intention template set is matched with the entity information to obtain a matching result, and only if the matching is successful, the condition that the information recall condition is not met is determined. By the method, the matching condition of the intention information and the entity information can be verified, if the entity information and the intention information are failed to be matched, the fact that correct replies can not be made is indicated, and at the moment, some preset dialogs can be selected to reply, so that the flexibility of the intelligent question-answering system is improved.
Optionally, in a sixth optional embodiment of the method for controlling an object according to the present invention based on the respective embodiments corresponding to fig. 3, performing word segmentation processing on the first text information to obtain a word segmentation labeling result of the first text information may include:
and performing word segmentation processing on the first text information by adopting a conditional random field algorithm to obtain a word segmentation labeling result of the first text information.
In this embodiment, a method for entity identification by using a CRF algorithm is provided, and a server performs word segmentation processing on first text information by using the CRF algorithm to obtain a word segmentation result of the first text information. Specifically, referring to fig. 7, fig. 7 is a schematic diagram of an embodiment of entity recognition based on a conditional random field algorithm in an embodiment of the present invention, where some feature functions are defined for text information, and the feature functions are used to represent whether two words in one text information satisfy a relationship. For example, f (noun+preposition) =1 in a text message indicates that the text message is accurate. F (preposition+preposition) = -1 in one text message, this text message is inaccurate. And then adding and summing all characteristic functions in one text message to obtain a score F, wherein the score F can be calculated by adopting the following method:
F=lamda 1×f (noun+preposition) +lamda2×f (preposition+preposition) +lamda 3×f (noun+noun);
wherein, lamda1, lamda2 and lamda3 are model parameters and are obtained through a large amount of corpus training.
The first text message is assumed to be "rifle injury woolen", wherein three words, respectively, "rifle," "injury," and "woolen," can be divided. Based on the above formula:
f=lamda 1×f ("rifle" + "injury") +lamda2×f ("rifle" + "injury") +lamda 3×f ("rifle" + "injury") +lamda 1×f ("injury" + "woolen") +lamda2×f ("injury" + "woolen") +lamda 3×f ("injury" + "woolen")
And inputting the first text information as 'rifle injury woolen' into a model of a CRF algorithm, and obtaining word segmentation labeling results, such as verbs, nouns, prepositions and the like.
In addition, in the embodiment of the invention, a method for entity identification by adopting a conditional random field algorithm is provided, and compared with a method for rule extraction by adopting the conditional random field algorithm, the method is more convenient because no rule is required to be configured, and the extraction can be directly carried out through a data training model. Compared with the HMM algorithm, the conditional random field algorithm is more flexible in extracting text features and can extract more features, so that the overall effect of extracting entity information is better.
Optionally, in a seventh optional embodiment of the method for controlling an object according to the present invention based on the respective embodiments corresponding to fig. 3, the obtaining, based on the statistical classification model, an intention classification result corresponding to the first text information may include:
and obtaining an intention classification result corresponding to the first text information by the converted bi-directional encoder representation BERT model.
In this embodiment, a method for performing intent recognition by using a BERT model is described, where the BERT model is an open-source text model, and the BERT model is used by performing model simple fine tuning (refinement) through two parts, that is, through already trained data. The goal of the BERT model is to train and obtain text semantic representations containing rich semantic information of the text by using a large-scale unlabeled corpus, then fine-tune the text semantic representations in a specific NLP task, and finally apply the text semantic representations to the NLP task.
The finetune method refers to loading a pre-trained BERT model, inputting a data set of a specific field task into the model, continuing back propagation training on a network, and continuously adjusting the weight of an original model to obtain a model suitable for a new specific task.
In addition, in the embodiment of the invention, the method for identifying the intention by adopting the BERT model is provided, the BERT model can quickly train a classification model aiming at a specific task, the use is convenient, and the BERT model is verified by experiments to obtain a better effect in an NLP task, so that the method has stronger practicability and reliability.
With reference to the foregoing description, a method of man-machine interaction in the present invention will be described with reference to fig. 8, and one embodiment of the method of man-machine interaction in the present invention includes:
201. receiving first text information sent by a client;
in this embodiment, the human-machine interaction device receives the first text information sent by the client, where the first text information may be Query, and the Query represents a complete input speech. The client may be a game client, a video client, an instant messaging client, or an online shopping client, which is not limited in this case. The human-machine interaction device is typically deployed on the server side, i.e. the server receives the first text information sent by the client.
It will be appreciated that if the text information recognition device can be deployed on the terminal device side in the case of being offline, the present invention is described by taking the case that the text information recognition device is deployed on the server, however, this should not be construed as limiting the present invention.
202. Acquiring a text information processing result corresponding to the first text information;
in this embodiment, the server obtains a text information processing result corresponding to the first text information, where the server needs to process the first text information to obtain the text information processing result, and the processing mode is mainly that extracting entity information from the first text information and identifying intention information from the first text information. It will be appreciated that entity information may also be referred to as an "entity," entity information refers to one or more words in a Query as a central word of the Query, intent information may also be referred to as an "intent," intent information refers to a real intent behind the Query, one Query corresponds to one intent information, and intent information may be considered as a classification of the Query.
203. If the text information processing result meets the information recall condition, generating text information to be identified corresponding to the first text information according to second text information, wherein the second text information is text information associated with the first text information, and the text information to be identified comprises entity information and intention information;
in this embodiment, the server determines whether an information recall condition is satisfied according to a text information processing result, if the information recall condition is satisfied, the second text information needs to be taken out from the stored session, where the second text information is text information associated with the first text information, specifically may be the above information of the first text information, for example, two text information input by the user sequentially, i.e., first input "please provide a flight for 8 months and 20 days", then input "from Shenzhen to Shanghai", and if "from Shenzhen to Shanghai" belongs to the first text information, then "please provide a flight for 8 months and 20 days" may be the second text information. In practical application, the second text information may also refer to any text information before the first text information, but based on consideration of session habits, the second text information is generally the previous session information adjacent to the first text information.
After the server acquires the second text information, the first text information and the second text information are combined to generate text information to be identified, and the text information to be identified comprises entity information and intention information.
204. Determining an entity type corresponding to the entity information based on the intention template set and the intention information, wherein the intention template set has a corresponding relation with the intention information, and the intention template set comprises at least one intention template;
in this embodiment, the server determines, based on the intention information and the intention template set, an entity type corresponding to the entity information, where one intention information corresponds to one intention template set, that is, one intention information corresponds to one set of intention templates. The set of intent templates includes at least one intent template, for example, an intelligent question-answering system for a game-type application, assuming that there is a "range-type" intent that indicates that the user asks questions about the gun's name range in the game, such as "how much this can be most fired to by the rifle". Only one intention template is included in the intention template set corresponding to the intention of the "range class", and the intention template is the correspondence between the intention of the "range (shoot) class" and the entity type of the "fire_name". The intention information corresponding to the words of the 'how much the rifle can be furthest transmitted' is the 'range class' intention, the extracted entity information is the 'rifle', the 'rifle' belongs to the firearm name according to the intention template corresponding to the 'range class' intention, and the obtained text information to be identified is the 'range class' intention and the 'firearm name' entity type.
205. Generating a text information identification result corresponding to the first text information according to the entity type and the intention information corresponding to the entity information;
in this embodiment, the server generates a text recognition result corresponding to the first text information according to the entity type and the intention information corresponding to the entity information. Specifically, assuming that the obtained entity information is a rifle, the corresponding entity type is a firearm name, the intention information is a range class, and the text information obtained by the method is a range class intention and a firearm name entity type.
206. Determining third text information according to the text information identification result, wherein the third text information comprises reply information with an association relation with the first text information;
in this embodiment, the server determines the third text information according to the text information recognition result, for example, the server determines the third text information based on the text information recognition result and specific entity information (such as "rifle"), and the third text information may be "rifle has a range of 500 meters".
207. And sending the third text information to the client so that the client can display the third text information.
In this embodiment, after the server generates the third text information, the third text information is pushed to the client, and the client may display the third text information to the user.
In order to facilitate understanding, a specific scenario will be taken as an example to describe the man-machine conversation method provided by the present invention, please refer to fig. 9, fig. 9 is a schematic diagram of a man-machine conversation interface based on a text information recognition method in the embodiment of the present invention, as shown in the drawing, a user "tom" is 58 minutes at 10 am on 9.m. 28 in 2019, a question is initiated to a game server through an intelligent question-answering system of a game client, the question is "how much the injury of M4" is, the server extracts entity information as "M4" according to "how much injury of M4" is, the extracted intention information is "injury type" intention, and after template matching, the matching with the intention template is determined successfully, at this time, the content of the answer is determined as "2000 fire" based on the entity information and the intention information. Next, the user "tom" initiates a question to the game server by the intelligent question-answering system of the game client after 11 am 01 minutes at 28 am 9 in 2019, the proposed question is "that AKM woolen", the server extracts entity information as "AKM" according to "that AKM woolen", but fails to extract intention information, so the server acquires intention information from the already stored above, that is, extracts intention information as "injury type" intention from how much "M4 is injured, the server extracts entity information as" AKM "according to" that AKM woolen "and extracts intention information as" injury type "intention based on the above, determines that matching with the intention template is successful after template matching, and at this time, determines the content of the answer as" 1000 fire "based on the entity information and the intention information.
It will be appreciated that "what the damage to M4 is" may refer to the second text message and "that AKM wool" may refer to the first text message.
In the embodiment of the invention, a method for man-machine conversation is provided, firstly, a server receives first text information sent by a client, then the server acquires text information processing results corresponding to the first text information, if the text information processing results meet information recall conditions, the server generates text information to be identified corresponding to the first text information according to second text information, the server determines entity types corresponding to the entity information based on an intention template set and the intention information, then generates text information identification results corresponding to the first text information according to the entity types and the intention information corresponding to the entity information, and determines third text information according to the text information identification results, and finally the server sends the third text information to the client so that the client displays the third text information. By the method, the entity information and the intention information of the input text information can be extracted and recovered, the entity information and the intention information can be directly inherited, the entity type corresponding to the entity information is determined from the intention template set based on the intention information, and one intention information is usually only corresponding to a plurality of intention templates, so that the complexity of template matching is reduced, the situation of error recovery of the text information is reduced, the accuracy of text information identification is further improved, and the accuracy of question and answer is improved.
Referring to fig. 10, fig. 10 is a schematic diagram showing an embodiment of a text information recognition device according to an embodiment of the present invention, and the text information recognition device 30 includes:
an obtaining module 301, configured to obtain a text information processing result corresponding to the first text information;
a generating module 302, configured to generate text information to be identified corresponding to the first text information according to second text information if the text information processing result acquired by the acquiring module 301 meets an information recall condition, where the second text information is text information associated with the first text information, and the text information to be identified includes entity information and intention information;
a determining module 303, configured to determine an entity type corresponding to the entity information based on an intent template set and the intent information, where the intent template set has a correspondence with the intent information, and the intent template set includes at least one intent template;
the generating module 302 is further configured to generate a text information recognition result corresponding to the first text information according to the entity type corresponding to the entity information and the intention information determined by the determining module 303.
In this embodiment, the obtaining module 301 obtains a text information processing result corresponding to a first text information, if the text information processing result obtained by the obtaining module 301 meets an information recall condition, the generating module 302 generates text information to be identified corresponding to the first text information according to second text information, where the second text information is text information associated with the first text information, the text information to be identified includes entity information and intention information, the determining module 303 determines an entity type corresponding to the entity information based on an intention template set and the intention information, where the intention template set has a corresponding relation with the intention information, and the intention template set includes at least one intention template, and the generating module 302 generates a text information identification result corresponding to the first text information according to the entity type corresponding to the entity information and the intention information determined by the determining module 303.
In the embodiment of the invention, the text information identification device is provided, which can extract and recover entity information and intention information of input text information, can directly inherit the entity information and the intention information, and determines the entity type corresponding to the entity information from the intention template set based on the intention information, wherein one intention information usually corresponds to a plurality of intention templates, so that the complexity of template matching is reduced, the situation of error recovery of the text information is reduced, and the accuracy of text information identification is further improved.
Alternatively, on the basis of the embodiment corresponding to fig. 10, in another embodiment of the text information recognition device 30 provided in the embodiment of the present invention,
the obtaining module 301 is specifically configured to process the first text information to obtain a word segmentation labeling result of the first text information;
acquiring an intention classification result corresponding to the first text information through a statistical classification model;
and generating the text information processing result according to the word segmentation labeling result and the intention classification result.
Alternatively, on the basis of the embodiment corresponding to fig. 10, in another embodiment of the text information recognition device 30 provided in the embodiment of the present invention,
the obtaining module 301 is specifically configured to determine that the text information processing result meets the information recall condition if it is determined that the entity information does not exist in the first text information according to the word segmentation result, and it is determined that the intention information exists in the first text information according to the intention classification result;
the generating module 302 is specifically configured to obtain the entity information according to the second text information;
and generating text information to be identified corresponding to the first text information according to the intention information of the first text information and the entity information of the second text information.
Alternatively, on the basis of the embodiment corresponding to fig. 10, in another embodiment of the text information recognition device 30 provided in the embodiment of the present invention,
the obtaining module 301 is specifically configured to determine that the text information processing result satisfies the information recall condition if it is determined that the entity information exists in the first text information according to the word segmentation result, and it is determined that the intention information does not exist in the first text information according to the intention classification result;
the generating module 302 is specifically configured to obtain the intention information according to the second text information;
and generating text information to be identified corresponding to the first text information according to the entity information of the first text information and the intention information of the second text information.
Alternatively, on the basis of the embodiment corresponding to fig. 10, in another embodiment of the text information recognition device 30 provided in the embodiment of the present invention,
the obtaining module 301 is specifically configured to determine that the text information processing result does not satisfy the information recall condition if it is determined that the entity information exists in the first text information according to the word segmentation result, and it is determined that the intention information exists in the first text information according to the intention classification result;
The generating module 302 is further configured to generate text information to be identified corresponding to the first text information according to the entity information of the first text information and the intention information of the first text information if the text information processing result does not satisfy an information recall condition;
the determining module 303 is further configured to determine an entity type corresponding to the entity information based on an intent template set and the intent information, where the intent template set has a correspondence with the intent information, and the intent template set includes at least one intent template;
the generating module 302 is further configured to generate a text information recognition result corresponding to the first text information according to the entity type corresponding to the entity information and the intention information determined by the determining module 303.
Alternatively, on the basis of the embodiment corresponding to fig. 10, in another embodiment of the text information recognition device 30 provided in the embodiment of the present invention,
the obtaining module 301 is further configured to obtain the intent template set according to the intent information;
matching the entity information according to the intention template set to obtain a matching result;
And if the matching is successful according to the matching result, determining that the text information processing result does not meet the information recall condition.
Alternatively, on the basis of the embodiment corresponding to fig. 10, in another embodiment of the text information recognition device 30 provided in the embodiment of the present invention,
the obtaining module 301 is specifically configured to process the first text information by using a conditional random field algorithm, so as to obtain a word segmentation labeling result of the first text information.
Alternatively, on the basis of the embodiment corresponding to fig. 10, in another embodiment of the text information recognition device 30 provided in the embodiment of the present invention,
the obtaining module 301 is specifically configured to obtain, by using the transformed bi-directional encoder representation BERT model, an intention classification result corresponding to the first text information.
Referring to fig. 11 for a detailed description of the man-machine conversation device in the present invention, fig. 11 is a schematic diagram of an embodiment of a man-machine conversation device in an embodiment of the present invention, and a man-machine conversation device 40 includes:
a receiving module 401, configured to receive first text information sent by a client;
an obtaining module 402, configured to obtain a text information processing result corresponding to the first text information received by the receiving module 401;
A generating module 403, configured to generate text information to be identified corresponding to the first text information according to second text information if the text information processing result acquired by the acquiring module meets an information recall condition, where the second text information is text information associated with the first text information, and the text information to be identified includes entity information and intention information;
a determining module 404, configured to determine an entity type corresponding to the entity information based on an intent template set and the intent information, where the intent template set has a correspondence with the intent information, and the intent template set includes at least one intent template;
the generating module 403 is further configured to generate a text information recognition result corresponding to the first text information according to the entity type corresponding to the entity information and the intention information determined by the determining module 404;
the determining module 404 is further configured to determine third text information according to the text information recognition result generated by the generating module 403, where the third text information includes reply information having an association relationship with the first text information;
And the sending module 405 is configured to send the third text information determined by the determining module 404 to the client, so that the client displays the third text information.
In this embodiment, the receiving module 401 receives first text information sent by a client, the obtaining module 402 obtains a text information processing result corresponding to the first text information received by the receiving module 401, if the text information processing result obtained by the obtaining module meets an information recall condition, the generating module 403 generates text information to be identified corresponding to the first text information according to second text information, where the second text information is text information associated with the first text information, the text information to be identified includes entity information and intention information, the determining module 404 determines an entity type corresponding to the entity information based on an intention template set and the intention information, the intention template set includes at least one intention template, the generating module 403 generates a text information identification result corresponding to the first text information according to the entity type corresponding to the entity information determined by the determining module 404, the determining module 404 displays the text information identification result generated by the generating module 403 according to the text information to the third text information, and the determining module 404 determines that the text information has a third text information associated with the client is associated with the third text information, and the determining module 404 determines that the text information has a response relationship.
In the embodiment of the invention, a man-machine dialogue device is provided, which can extract and recover entity information and intention information of input text information, can directly inherit the entity information and the intention information, and determines entity types corresponding to the entity information from an intention template set based on the intention information, wherein one intention information usually corresponds to a plurality of intention templates, so that the complexity of template matching is reduced, the situation of error recovery of the text information is reduced, the accuracy of text information identification is further improved, and the accuracy of question-answering is improved.
Fig. 12 is a schematic diagram of a server structure provided by an embodiment of the present invention, where the server 500 may vary considerably in configuration or performance, and may include one or more central processing units (central processing units, CPU) 522 (e.g., one or more processors) and memory 532, one or more storage media 530 (e.g., one or more mass storage devices) storing applications 542 or data 544. Wherein memory 532 and storage medium 530 may be transitory or persistent. The program stored in the storage medium 530 may include one or more modules (not shown), each of which may include a series of instruction operations on a server. Still further, the central processor 522 may be configured to communicate with a storage medium 530 and execute a series of instruction operations in the storage medium 530 on the server 500.
The server 500 may also include one or more power supplies 526, one or more wired or wireless network interfaces 550, one or more input/output interfaces 558, and/or one or more operating systems 541, such as Windows ServerTM, mac OS XTM, unixTM, linuxTM, freeBSDTM, etc.
The steps performed by the server in the above embodiments may be based on the server structure shown in fig. 12.
In the embodiment of the present invention, the CPU 522 included in the server further has the following functions:
acquiring a text information processing result corresponding to the first text information;
if the text information processing result meets an information recall condition, generating text information to be identified corresponding to the first text information according to second text information, wherein the second text information is text information associated with the first text information, and the text information to be identified comprises entity information and intention information;
determining an entity type corresponding to the entity information based on an intention template set and the intention information, wherein the intention template set has a corresponding relation with the intention information, and the intention template set comprises at least one intention template;
And generating a text information identification result corresponding to the first text information according to the entity type corresponding to the entity information and the intention information.
Optionally, the CPU 522 is specifically configured to perform the following steps:
processing the first text information to obtain a word segmentation labeling result of the first text information;
acquiring an intention classification result corresponding to the first text information through a statistical classification model;
and generating the text information processing result according to the word segmentation labeling result and the intention classification result.
Optionally, the CPU 522 is specifically configured to perform the following steps:
if the entity information does not exist in the first text information according to the word segmentation result, and the intention information exists in the first text information according to the intention classification result, determining that the text information processing result meets the information recall condition;
acquiring the entity information according to the second text information;
and generating text information to be identified corresponding to the first text information according to the intention information of the first text information and the entity information of the second text information.
Optionally, the CPU 522 is specifically configured to perform the following steps:
If the entity information exists in the first text information according to the word segmentation result, and the intention information does not exist in the first text information according to the intention classification result, determining that the text information processing result meets the information recall condition;
acquiring the intention information according to the second text information;
and generating text information to be identified corresponding to the first text information according to the entity information of the first text information and the intention information of the second text information.
Optionally, the CPU 522 is specifically configured to perform the following steps:
if the entity information exists in the first text information according to the word segmentation result, and the intention information exists in the first text information according to the intention classification result, determining that the text information processing result does not meet the information recall condition;
the CPU 522 is further configured to perform the following steps:
if the text information processing result does not meet the information recall condition, generating text information to be identified corresponding to the first text information according to the entity information of the first text information and the intention information of the first text information;
Determining an entity type corresponding to the entity information based on an intention template set and the intention information, wherein the intention template set has a corresponding relation with the intention information, and the intention template set comprises at least one intention template;
and generating a text information identification result corresponding to the first text information according to the entity type corresponding to the entity information and the intention information.
Optionally, the CPU 522 is further configured to perform the following steps:
acquiring the intention template set according to the intention information;
matching the entity information according to the intention template set to obtain a matching result;
and if the matching is successful according to the matching result, determining that the text information processing result does not meet the information recall condition.
Optionally, the CPU 522 is specifically configured to perform the following steps:
and processing the first text information by adopting a conditional random field algorithm to obtain a word segmentation labeling result of the first text information.
Optionally, the CPU 522 is specifically configured to perform the following steps:
and obtaining an intention classification result corresponding to the first text information through the converted bi-directional encoder representation BERT model.
In the embodiment of the present invention, the CPU 522 included in the server further has the following functions:
receiving first text information sent by a client;
acquiring a text information processing result corresponding to the first text information;
if the text information processing result meets an information recall condition, generating text information to be identified corresponding to the first text information according to second text information, wherein the second text information is text information associated with the first text information, and the text information to be identified comprises entity information and intention information;
determining an entity type corresponding to the entity information based on an intention template set and the intention information, wherein the intention template set has a corresponding relation with the intention information, and the intention template set comprises at least one intention template;
generating a text information identification result corresponding to the first text information according to the entity type corresponding to the entity information and the intention information;
determining third text information according to the text information identification result, wherein the third text information comprises reply information with association relation with the first text information;
And sending the third text information to the client so that the client displays the third text information.
The embodiment of the present invention further provides another man-machine interaction device, as shown in fig. 13, for convenience of explanation, only the relevant parts of the embodiment of the present invention are shown, and specific technical details are not disclosed, please refer to the method part of the embodiment of the present invention. The terminal device may be any terminal device including a mobile phone, a tablet computer, a personal digital assistant (Personal Digital Assistant, PDA), a Point of Sales (POS), a vehicle-mounted computer, and the like, taking the terminal device as an example of the mobile phone:
fig. 13 is a block diagram showing a part of the structure of a mobile phone related to a terminal device provided by an embodiment of the present invention. Referring to fig. 13, the mobile phone includes: radio Frequency (RF) circuitry 610, memory 620, input unit 630, display unit 640, sensor 650, audio circuitry 660, wireless fidelity (wireless fidelity, wiFi) module 670, processor 680, power supply 690, and the like. It will be appreciated by those skilled in the art that the handset construction shown in fig. 13 is not limiting of the handset and may include more or fewer components than shown, or may combine certain components, or a different arrangement of components.
The following describes the components of the mobile phone in detail with reference to fig. 13:
the RF circuit 610 may be configured to receive and transmit signals during a message or a call, and in particular, receive downlink information of a base station and process the downlink information with the processor 680; in addition, the data of the design uplink is sent to the base station. Typically, the RF circuitry 610 includes, but is not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier (Low Noise Amplifier, LNA), a duplexer, and the like. In addition, the RF circuitry 610 may also communicate with networks and other devices via wireless communications. The wireless communications may use any communication standard or protocol including, but not limited to, global system for mobile communications (Global System of Mobile communication, GSM), general packet radio service (General Packet Radio Service, GPRS), code division multiple access (Code Division Multiple Access, CDMA), wideband code division multiple access (Wideband Code Division Multiple Access, WCDMA), long term evolution (Long Term Evolution, LTE), email, short message service (Short Messaging Service, SMS), and the like.
The memory 620 may be used to store software programs and modules, and the processor 680 may perform various functional applications and data processing of the cellular phone by executing the software programs and modules stored in the memory 620. The memory 620 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, application programs required for at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may store data (such as audio data, phonebook, etc.) created according to the use of the handset, etc. In addition, memory 620 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid-state storage device.
The input unit 630 may be used to receive input numeric or character information and to generate key signal inputs related to user settings and function control of the handset. In particular, the input unit 630 may include a touch panel 631 and other input devices 632. The touch panel 631, also referred to as a touch screen, may collect touch operations thereon or thereabout by a user (e.g., operations of the user on the touch panel 631 or thereabout using any suitable object or accessory such as a finger, a stylus, etc.), and drive the corresponding connection device according to a preset program. Alternatively, the touch panel 631 may include two parts of a touch detection device and a touch controller. The touch detection device detects the touch azimuth of a user, detects a signal brought by touch operation and transmits the signal to the touch controller; the touch controller receives touch information from the touch detection device and converts it into touch point coordinates, which are then sent to the processor 680 and can receive commands from the processor 680 and execute them. In addition, the touch panel 631 may be implemented in various types such as a resistive type, a capacitive type, an infrared ray, and a surface acoustic wave. The input unit 630 may include other input devices 632 in addition to the touch panel 631. In particular, other input devices 632 may include, but are not limited to, one or more of a physical keyboard, function keys (e.g., volume control keys, switch keys, etc.), a trackball, mouse, joystick, etc.
The display unit 640 may be used to display information input by a user or information provided to the user and various menus of the mobile phone. The display unit 640 may include a display panel 641, and optionally, the display panel 641 may be configured in the form of a liquid crystal display (Liquid Crystal Display, LCD), an Organic Light-Emitting Diode (OLED), or the like. Further, the touch panel 631 may cover the display panel 641, and when the touch panel 631 detects a touch operation thereon or thereabout, the touch panel 631 is transferred to the processor 680 to determine the type of the touch event, and then the processor 680 provides a corresponding visual output on the display panel 641 according to the type of the touch event. Although in fig. 13, the touch panel 631 and the display panel 641 are two independent components to implement the input and input functions of the mobile phone, in some embodiments, the touch panel 631 and the display panel 641 may be integrated to implement the input and output functions of the mobile phone.
The handset may also include at least one sensor 650, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor may include an ambient light sensor that may adjust the brightness of the display panel 641 according to the brightness of ambient light, and a proximity sensor that may turn off the display panel 641 and/or the backlight when the mobile phone is moved to the ear. The accelerometer sensor can be used for detecting the acceleration in all directions (generally three axes), detecting the gravity and the direction when the accelerometer sensor is static, and can be used for identifying the gesture of a mobile phone (such as transverse and vertical screen switching, related games, magnetometer gesture calibration), vibration identification related functions (such as pedometer and knocking), and other sensors such as gyroscopes, barometers, hygrometers, thermometers, infrared sensors which are also configured by the mobile phone are not repeated herein.
Audio circuitry 660, speaker 661, microphone 662 may provide an audio interface between a user and the handset. The audio circuit 660 may transmit the received electrical signal converted from audio data to the speaker 661, and the electrical signal is converted into a sound signal by the speaker 661 to be output; on the other hand, microphone 662 converts the collected sound signals into electrical signals, which are received by audio circuit 660 and converted into audio data, which are processed by audio data output processor 680 for transmission to, for example, another cell phone via RF circuit 610, or which are output to memory 620 for further processing.
WiFi belongs to a short-distance wireless transmission technology, and a mobile phone can help a user to send and receive emails, browse webpages, access streaming media and the like through a WiFi module 670, so that wireless broadband Internet access is provided for the user. Although fig. 13 shows a WiFi module 670, it is understood that it does not belong to the necessary constitution of the mobile phone, and can be omitted entirely as required within the scope of not changing the essence of the invention.
Processor 680 is a control center of the handset, connects various parts of the entire handset using various interfaces and lines, performs various functions of the handset and processes data by running or executing software programs and/or modules stored in memory 620, and invoking data stored in memory 620. Optionally, processor 680 may include one or more processing units; alternatively, processor 680 may integrate an application processor that primarily handles operating systems, user interfaces, applications, etc., with a modem processor that primarily handles wireless communications. It will be appreciated that the modem processor described above may not be integrated into the processor 680.
The handset further includes a power supply 690 (e.g., a battery) for powering the various components, optionally in logical communication with the processor 680 through a power management system, thereby implementing functions such as charge, discharge, and power management through the power management system.
Although not shown, the mobile phone may further include a camera, a bluetooth module, etc., which will not be described herein.
In the embodiment of the present invention, the processor 680 included in the terminal device further has the following functions:
acquiring a text information processing result corresponding to the first text information;
if the text information processing result meets an information recall condition, generating text information to be identified corresponding to the first text information according to second text information, wherein the second text information is text information associated with the first text information, and the text information to be identified comprises entity information and intention information;
determining an entity type corresponding to the entity information based on an intention template set and the intention information, wherein the intention template set has a corresponding relation with the intention information, and the intention template set comprises at least one intention template;
and generating a text information identification result corresponding to the first text information according to the entity type corresponding to the entity information and the intention information.
Optionally, the processor 680 is specifically configured to perform the following steps:
processing the first text information to obtain a word segmentation labeling result of the first text information;
acquiring an intention classification result corresponding to the first text information through a statistical classification model;
and generating the text information processing result according to the word segmentation labeling result and the intention classification result.
Optionally, the processor 680 is specifically configured to perform the following steps:
if the entity information does not exist in the first text information according to the word segmentation result, and the intention information exists in the first text information according to the intention classification result, determining that the text information processing result meets the information recall condition;
acquiring the entity information according to the second text information;
and generating text information to be identified corresponding to the first text information according to the intention information of the first text information and the entity information of the second text information.
Optionally, the processor 680 is specifically configured to perform the following steps:
if the entity information exists in the first text information according to the word segmentation result, and the intention information does not exist in the first text information according to the intention classification result, determining that the text information processing result meets the information recall condition;
Acquiring the intention information according to the second text information;
and generating text information to be identified corresponding to the first text information according to the entity information of the first text information and the intention information of the second text information.
Optionally, the processor 680 is specifically configured to perform the following steps:
if the entity information exists in the first text information according to the word segmentation result, and the intention information exists in the first text information according to the intention classification result, determining that the text information processing result does not meet the information recall condition;
processor 680 is also configured to perform the steps of:
if the text information processing result does not meet the information recall condition, generating text information to be identified corresponding to the first text information according to the entity information of the first text information and the intention information of the first text information;
determining an entity type corresponding to the entity information based on an intention template set and the intention information, wherein the intention template set has a corresponding relation with the intention information, and the intention template set comprises at least one intention template;
And generating a text information identification result corresponding to the first text information according to the entity type corresponding to the entity information and the intention information.
Optionally, the processor 680 is further configured to perform the following steps:
acquiring the intention template set according to the intention information;
matching the entity information according to the intention template set to obtain a matching result;
and if the matching is successful according to the matching result, determining that the text information processing result does not meet the information recall condition.
Optionally, the processor 680 is specifically configured to perform the following steps:
and processing the first text information by adopting a conditional random field algorithm to obtain a word segmentation labeling result of the first text information.
Optionally, the processor 680 is specifically configured to perform the following steps:
and obtaining an intention classification result corresponding to the first text information through the converted bi-directional encoder representation BERT model.
It will be clear to those skilled in the art that, for convenience and brevity of description, specific working procedures of the above-described systems, apparatuses and units may refer to corresponding procedures in the foregoing method embodiments, which are not repeated herein.
In the several embodiments provided in the present invention, it should be understood that the disclosed systems, devices, and methods may be implemented in other manners. For example, the apparatus embodiments described above are merely illustrative, e.g., the division of the units is merely a logical function division, and there may be additional divisions when actually implemented, e.g., multiple units or components may be combined or integrated into another system, or some features may be omitted or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be an indirect coupling or communication connection via some interfaces, devices or units, which may be in electrical, mechanical or other form.
The units described as separate units may or may not be physically separate, and units shown as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in the embodiments of the present invention may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in software functional units.
The integrated units, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied essentially or in part or all of the technical solution or in part in the form of a software product stored in a storage medium, including instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a read-only memory (ROM), a random access memory (random access memory, RAM), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
The above embodiments are only for illustrating the technical solution of the present invention, and not for limiting the same; although the invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims (20)

1. A method of text information recognition, comprising:
acquiring a text information processing result corresponding to the first text information;
if the text information processing result meets an information recall condition, generating text information to be identified corresponding to the first text information according to second text information and the first text information, wherein the second text information is text information related to the first text information, the text information to be identified comprises entity information and intention information, the first text information and the second text information are text information input by the same object, the second text information is the text information above the first text information, and the generating mode of the text information to be identified comprises the following steps: acquiring an intention template set according to intention information of first text information or second text information, wherein the intention template set has a corresponding relation with the intention information, and the intention template set comprises at least one intention template; verifying entity information by using an intention template to obtain a conforming intention template, wherein if an intention template set is obtained according to the intention information of the first text information, the entity information is an entity of the second text information, and if the intention template set is obtained according to the intention information of the second text information, the entity information is an entity of the first text information; filling corresponding slots of the intention template according to corresponding entity types, and generating complete text information to be identified with corresponding relations;
Determining an entity type corresponding to the entity information from the intent template set based on the intent information;
and generating a text information identification result corresponding to the first text information according to the entity type corresponding to the entity information and the intention information.
2. The method of claim 1, wherein the obtaining the text information processing result corresponding to the first text information includes:
processing the first text information to obtain a word segmentation labeling result of the first text information;
acquiring an intention classification result corresponding to the first text information through a statistical classification model;
and generating the text information processing result according to the word segmentation labeling result and the intention classification result.
3. The method according to claim 2, wherein generating the text information processing result according to the word segmentation labeling result and the intention classification result comprises:
if the entity information does not exist in the first text information according to the word segmentation result, and the intention information exists in the first text information according to the intention classification result, determining that the text information processing result meets the information recall condition;
The generating text information to be identified corresponding to the first text information according to the second text information and the first text information includes:
acquiring the entity information according to the second text information;
and generating text information to be identified corresponding to the first text information according to the intention information of the first text information and the entity information of the second text information.
4. The method according to claim 2, wherein generating the text information processing result according to the word segmentation labeling result and the intention classification result comprises:
if the entity information exists in the first text information according to the word segmentation result, and the intention information does not exist in the first text information according to the intention classification result, determining that the text information processing result meets the information recall condition;
the generating text information to be identified corresponding to the first text information according to the second text information and the first text information includes:
acquiring the intention information according to the second text information;
and generating text information to be identified corresponding to the first text information according to the entity information of the first text information and the intention information of the second text information.
5. The method according to claim 2, wherein generating the text information processing result according to the word segmentation labeling result and the intention classification result comprises:
if the entity information exists in the first text information according to the word segmentation result, and the intention information exists in the first text information according to the intention classification result, determining that the text information processing result does not meet the information recall condition;
the method further comprises the steps of:
if the text information processing result does not meet the information recall condition, generating text information to be identified corresponding to the first text information according to the entity information of the first text information and the intention information of the first text information;
determining an entity type corresponding to the entity information from an intention template set based on the intention information, wherein the intention template set has a corresponding relation with the intention information, and the intention template set comprises at least one intention template;
and generating a text information identification result corresponding to the first text information according to the entity type corresponding to the entity information and the intention information.
6. The method according to any one of claims 1 to 5, wherein after the obtaining the text information processing result corresponding to the first text information, the method further includes:
acquiring the intention template set according to the intention information;
matching the entity information according to the intention template set to obtain a matching result;
and if the matching is successful according to the matching result, determining that the text information processing result does not meet the information recall condition.
7. The method according to claim 2, wherein the processing the first text information to obtain the word segmentation and annotation result of the first text information includes:
and processing the first text information by adopting a conditional random field algorithm to obtain a word segmentation labeling result of the first text information.
8. The method according to claim 2, wherein the obtaining, by a statistical classification model, the intent classification result corresponding to the first text information includes:
and obtaining an intention classification result corresponding to the first text information through the converted bi-directional encoder representation BERT model.
9. A method of human-machine conversation, comprising:
Receiving first text information sent by a client;
acquiring a text information processing result corresponding to the first text information;
if the text information processing result meets an information recall condition, generating text information to be identified corresponding to the first text information according to second text information and the first text information, wherein the second text information is text information related to the first text information, the text information to be identified comprises entity information and intention information, the first text information and the second text information are text information input by the same object, the second text information is the text information above the first text information, and the generating mode of the text information to be identified comprises the following steps: acquiring an intention template set according to intention information of first text information or second text information, wherein the intention template set has a corresponding relation with the intention information, and the intention template set comprises at least one intention template; verifying entity information by using an intention template to obtain a conforming intention template, wherein if an intention template set is obtained according to the intention information of the first text information, the entity information is an entity of the second text information, and if the intention template set is obtained according to the intention information of the second text information, the entity information is an entity of the first text information; filling corresponding slots of the intention template according to corresponding entity types, and generating complete text information to be identified with corresponding relations;
Determining an entity type corresponding to the entity information from the intent template set based on the intent information;
generating a text information identification result corresponding to the first text information according to the entity type corresponding to the entity information and the intention information;
determining third text information according to the text information identification result, wherein the third text information comprises reply information with association relation with the first text information;
and sending the third text information to the client so that the client displays the third text information.
10. A text information recognition apparatus, characterized by comprising:
the acquisition module is used for acquiring a text information processing result corresponding to the first text information;
the generation module is configured to generate text information to be identified corresponding to the first text information according to second text information and the first text information if the text information processing result acquired by the acquisition module meets an information recall condition, where the second text information is text information associated with the first text information, the text information to be identified includes entity information and intention information, the first text information and the second text information are text information input by the same object, and the second text information is context information of the first text information, and a generation mode of the text information to be identified includes: acquiring an intention template set according to intention information of first text information or second text information, wherein the intention template set has a corresponding relation with the intention information, and the intention template set comprises at least one intention template; verifying entity information by using an intention template to obtain a conforming intention template, wherein if an intention template set is obtained according to the intention information of the first text information, the entity information is an entity of the second text information, and if the intention template set is obtained according to the intention information of the second text information, the entity information is an entity of the first text information; filling corresponding slots of the intention template according to corresponding entity types, and generating complete text information to be identified with corresponding relations;
A determining module, configured to determine an entity type corresponding to the entity information from the intent template set based on the intent information, where the intent template set has a correspondence with the intent information, and the intent template set includes at least one intent template;
the generating module is further configured to generate a text information recognition result corresponding to the first text information according to the entity type corresponding to the entity information and the intention information determined by the determining module.
11. The apparatus of claim 10, wherein the obtaining module is specifically configured to:
processing the first text information to obtain a word segmentation labeling result of the first text information;
acquiring an intention classification result corresponding to the first text information through a statistical classification model;
and generating the text information processing result according to the word segmentation labeling result and the intention classification result.
12. The apparatus of claim 11, wherein the obtaining module is specifically configured to:
if the entity information does not exist in the first text information according to the word segmentation result, and the intention information exists in the first text information according to the intention classification result, determining that the text information processing result meets the information recall condition;
The generating module is specifically configured to:
acquiring the entity information according to the second text information;
and generating text information to be identified corresponding to the first text information according to the intention information of the first text information and the entity information of the second text information.
13. The apparatus of claim 11, wherein the obtaining module is specifically configured to:
if the entity information exists in the first text information according to the word segmentation result, and the intention information does not exist in the first text information according to the intention classification result, determining that the text information processing result meets the information recall condition;
the generating module is specifically configured to:
acquiring the intention information according to the second text information;
and generating text information to be identified corresponding to the first text information according to the entity information of the first text information and the intention information of the second text information.
14. The apparatus of claim 11, wherein the obtaining module is specifically configured to:
if the entity information exists in the first text information according to the word segmentation result, and the intention information exists in the first text information according to the intention classification result, determining that the text information processing result does not meet the information recall condition;
The generating module is further configured to: if the text information processing result does not meet the information recall condition, generating text information to be identified corresponding to the first text information according to the entity information of the first text information and the intention information of the first text information;
the determining module is used for determining an entity type corresponding to the entity information from an intention template set based on the intention information, wherein the intention template set has a corresponding relation with the intention information, and the intention template set comprises at least one intention template;
the generating module is further configured to generate a text information identification result corresponding to the first text information according to the entity type corresponding to the entity information and the intention information.
15. The apparatus of any one of claims 10 to 14, wherein the obtaining module is further configured to obtain the set of intent templates from the intent information; matching the entity information according to the intention template set to obtain a matching result; and if the matching is successful according to the matching result, determining that the text information processing result does not meet the information recall condition.
16. The apparatus of claim 11, wherein the obtaining module is specifically configured to process the first text information by using a conditional random field algorithm to obtain a word segmentation labeling result of the first text information.
17. The apparatus according to claim 11, wherein the obtaining module is specifically configured to obtain, by using the transformed bi-directional encoder representation BERT model, an intention classification result corresponding to the first text information.
18. A human-machine conversation device, comprising:
the receiving module is used for receiving the first text information sent by the client;
the acquisition module is used for acquiring a text information processing result corresponding to the first text information received by the receiving module;
the generation module is configured to generate text information to be identified corresponding to the first text information according to second text information and the first text information if the text information processing result acquired by the acquisition module meets an information recall condition, where the second text information is text information associated with the first text information, the text information to be identified includes entity information and intention information, the first text information and the second text information are text information input by the same object, and the second text information is context information of the first text information, and a generation mode of the text information to be identified includes: acquiring an intention template set according to intention information of first text information or second text information, wherein the intention template set has a corresponding relation with the intention information, and the intention template set comprises at least one intention template; verifying entity information by using an intention template to obtain a conforming intention template, wherein if an intention template set is obtained according to the intention information of the first text information, the entity information is an entity of the second text information, and if the intention template set is obtained according to the intention information of the second text information, the entity information is an entity of the first text information; filling corresponding slots of the intention template according to corresponding entity types, and generating complete text information to be identified with corresponding relations;
The determining module is used for determining the entity type corresponding to the entity information from the intention template set based on the intention information;
the generation module is further configured to generate a text information recognition result corresponding to the first text information according to the entity type corresponding to the entity information and the intention information determined by the determination module;
the determining module is further configured to determine third text information according to the text information recognition result generated by the generating module, where the third text information includes reply information having an association relationship with the first text information;
and the sending module is used for sending the third text information determined by the determining module to the client so that the client can display the third text information.
19. A server, comprising: memory, transceiver, processor, and bus system; wherein the memory is used for storing programs;
the processor being configured to execute a program in the memory, comprising performing the method of any of the preceding claims 1 to 8, or performing the method of claim 9;
the bus system is used for connecting the memory and the processor so as to enable the memory and the processor to communicate.
20. A computer readable storage medium comprising instructions which, when run on a computer, cause the computer to perform the method of any one of claims 1 to 8, or to perform the method of claim 9.
CN201910950914.7A 2019-10-08 2019-10-08 Text information identification method, man-machine conversation method and related devices Active CN110717026B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910950914.7A CN110717026B (en) 2019-10-08 2019-10-08 Text information identification method, man-machine conversation method and related devices

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910950914.7A CN110717026B (en) 2019-10-08 2019-10-08 Text information identification method, man-machine conversation method and related devices

Publications (2)

Publication Number Publication Date
CN110717026A CN110717026A (en) 2020-01-21
CN110717026B true CN110717026B (en) 2023-09-22

Family

ID=69212262

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910950914.7A Active CN110717026B (en) 2019-10-08 2019-10-08 Text information identification method, man-machine conversation method and related devices

Country Status (1)

Country Link
CN (1) CN110717026B (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111414467A (en) * 2020-03-20 2020-07-14 中国建设银行股份有限公司 Question-answer dialogue method and device, electronic equipment and computer readable storage medium
CN112183097B (en) * 2020-09-27 2024-06-21 深圳追一科技有限公司 Entity recall method and related device
CN111930919B (en) * 2020-09-30 2021-01-05 知学云(北京)科技有限公司 Enterprise online education APP voice interaction implementation method
CN115062620A (en) * 2021-02-27 2022-09-16 华为技术有限公司 Semantic understanding method and device
CN113127602B (en) * 2021-04-30 2023-05-26 竹间智能科技(上海)有限公司 Intention recognition method and device
CN113297419B (en) * 2021-06-23 2024-04-09 南京谦萃智能科技服务有限公司 Video knowledge point determining method, device, electronic equipment and storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2017041372A1 (en) * 2015-09-07 2017-03-16 百度在线网络技术(北京)有限公司 Man-machine interaction method and system based on artificial intelligence
CN110096570A (en) * 2019-04-09 2019-08-06 苏宁易购集团股份有限公司 A kind of intension recognizing method and device applied to intelligent customer service robot

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2017041372A1 (en) * 2015-09-07 2017-03-16 百度在线网络技术(北京)有限公司 Man-machine interaction method and system based on artificial intelligence
CN110096570A (en) * 2019-04-09 2019-08-06 苏宁易购集团股份有限公司 A kind of intension recognizing method and device applied to intelligent customer service robot

Also Published As

Publication number Publication date
CN110717026A (en) 2020-01-21

Similar Documents

Publication Publication Date Title
CN110717026B (en) Text information identification method, man-machine conversation method and related devices
CN109033156B (en) Information processing method and device and terminal
CN111177371B (en) Classification method and related device
CN107301213A (en) Intelligent answer method and device
CN110634474B (en) Speech recognition method and device based on artificial intelligence
CN111553162A (en) Intention identification method and related device
CN111597804B (en) Method and related device for training entity recognition model
CN110162600B (en) Information processing method, session response method and session response device
CN108877780B (en) Voice question searching method and family education equipment
CN110276010B (en) Weight model training method and related device
CN114328852A (en) Text processing method, related device and equipment
CN111651604A (en) Emotion classification method based on artificial intelligence and related device
CN112257472A (en) Training method of text translation model, and text translation method and device
CN112749252A (en) Text matching method based on artificial intelligence and related device
CN111611369B (en) Interaction method and related device based on artificial intelligence
CN114328908A (en) Question and answer sentence quality inspection method and device and related products
CN112328783A (en) Abstract determining method and related device
CN112907255A (en) User analysis method and related device
CN113822038A (en) Abstract generation method and related device
CN116955610A (en) Text data processing method and device and storage medium
CN110781274A (en) Question-answer pair generation method and device
CN112036135B (en) Text processing method and related device
CN114840563B (en) Method, device, equipment and storage medium for generating field description information
CN112307198B (en) Method and related device for determining abstract of single text
CN113703883A (en) Interaction method and related device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
REG Reference to a national code

Ref country code: HK

Ref legal event code: DE

Ref document number: 40018337

Country of ref document: HK

SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant