CN111738018A - Intention understanding method, device, equipment and storage medium - Google Patents

Intention understanding method, device, equipment and storage medium Download PDF

Info

Publication number
CN111738018A
CN111738018A CN202010591965.8A CN202010591965A CN111738018A CN 111738018 A CN111738018 A CN 111738018A CN 202010591965 A CN202010591965 A CN 202010591965A CN 111738018 A CN111738018 A CN 111738018A
Authority
CN
China
Prior art keywords
sentence
understood
determining
intention
model
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202010591965.8A
Other languages
Chinese (zh)
Inventor
周楠楠
汤耀华
杨海军
徐倩
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
WeBank Co Ltd
Original Assignee
WeBank 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 WeBank Co Ltd filed Critical WeBank Co Ltd
Priority to CN202010591965.8A priority Critical patent/CN111738018A/en
Publication of CN111738018A publication Critical patent/CN111738018A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/30Semantic analysis
    • G06F40/35Discourse or dialogue representation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/33Querying
    • G06F16/332Query formulation
    • G06F16/3329Natural language query formulation or dialogue systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/35Clustering; Classification
    • G06F16/355Class or cluster creation or modification
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/205Parsing
    • G06F40/211Syntactic parsing, e.g. based on context-free grammar [CFG] or unification grammars
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/205Parsing
    • G06F40/216Parsing using statistical methods
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/279Recognition of textual entities
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q30/00Commerce
    • G06Q30/01Customer relationship services

Landscapes

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

Abstract

The invention provides an intention understanding method, device, equipment and storage medium, wherein the method comprises the steps of obtaining a sentence to be understood, determining whether the sentence to be understood is missing components or not, if so, determining the missing components of the sentence to be understood, determining parts of speech corresponding to the components of the sentence to be understood according to the missing components of the sentence to be understood, determining a candidate word set corresponding to the parts of speech according to the parts of speech, determining a complemented sentence according to the candidate word set and the sentence to be understood, performing intention understanding on the complemented sentence, and determining the intention of the sentence to be understood. Because the alternative word set is determined through part-of-speech recognition, words of the alternative word set can be made clear and rich, and the sentence to be understood with the intention can be filled according to the alternative word set, so that the structure and the semantics of the completed sentence to be understood with the intention can be more complete, and the accuracy of the intention understanding can be improved.

Description

Intention understanding method, device, equipment and storage medium
Technical Field
The present invention relates to the field of financial technology (Fintech), and in particular, to an intention understanding method, apparatus, device, and storage medium.
Background
With the development of computer technology, more and more technologies are applied in the financial field, and the traditional financial industry is gradually changing to financial technology, but due to the requirements of the financial industry on safety and real-time performance, higher requirements are also put forward on the technologies. In the customer service in the financial field, rapidly and accurately understanding the intention of a user in human-computer interaction becomes a huge challenge faced by the customer service, and if the intention of the user in a conversation can be understood in time, the method has great significance for improving the quality of the whole conversation and improving the experience of the user.
The conventional intention understanding method generally directly understands the input of the user, but the problem that the input information is insufficient to directly understand the input of the user, so that the intention understanding is not clear exists.
In summary, there is a need for an intention understanding method to solve the problem in the prior art that the input information is not sufficiently understood when the user directly understands the input, which results in ambiguous intention understanding.
Disclosure of Invention
The invention provides an intention understanding method, an intention understanding device, intention understanding equipment and a storage medium, which are used for solving the problem that in the prior art, input information is insufficient, so that intention understanding is ambiguous.
In a first aspect, the present invention provides an intent understanding method, comprising:
obtaining a sentence to be understood;
determining whether the sentence to be understood is missing components;
if so, determining the missing components of the sentence to be understood, and determining the parts of speech corresponding to the missing components of the sentence to be understood according to the missing components of the sentence to be understood;
determining an alternative word set corresponding to the part of speech according to the part of speech, and determining a complemented sentence according to the alternative word set and the sentence to be understood;
and performing intention understanding on the completed sentence, and determining the intention of the sentence to be understood.
In the technical scheme, the part of speech corresponding to the missing component of the sentence to be intended and understood can be timely and accurately determined according to the missing component of the sentence to be intended and understood, the alternative word set corresponding to the part of speech can be determined according to the part of speech, words of the alternative word set can be clear and abundant, then each word in the alternative word set is filled into the missing component sentence to be intended and understood, the complemented sentence is determined, the complemented sentence is subjected to intention and understanding, and the intention of the sentence to be intended and understood can be accurately determined. The alternative word set corresponding to the part of speech is determined through part of speech recognition, so that words of the alternative word set are clear and rich, missing components of the sentence to be intended to be understood are filled according to the alternative word set, the structure and the semantics of the completed sentence to be intended to be understood are more complete, the accuracy of the intention understanding is improved, and the problem that input information is insufficient and the intention understanding is ambiguous when the input of a user is directly understood in the prior art can be solved.
Optionally, the determining, according to the part of speech, a candidate word set corresponding to the part of speech includes:
and determining words corresponding to the part of speech from sentences positioned in front of the sentences to be understood according to the part of speech to obtain a candidate word set corresponding to the part of speech.
In the technical scheme, the alternative word sets corresponding to the parts of speech are determined from the upper text positioned in front of the sentence to be understood through part of speech recognition, the number of the upper text is not limited, so that the selected alternative word sets can be richer, input information can be more sufficient, components missing from the sentence to be understood are filled according to the alternative word sets, the structure and the semantics of the completed sentence to be understood are more complete, the accuracy of intention understanding is improved, and the problems that in the prior art, when the user inputs are understood by combining a fixed number of upper texts, interference is brought to the intention understanding by combining the fixed number of upper texts, and the input information is insufficient can be solved.
Optionally, the determining a complemented sentence according to the candidate word set and the sentence to be understood by the intention includes:
filling each word in the alternative word set into the sentence to be understood by the intention to obtain a plurality of filled sentences;
inputting the filled sentences into a language model for processing to obtain the probability of matching with each sentence to be understood with intent, comparing the probabilities of matching with each sentence to be understood with intent to determine the filled sentences with the probabilities meeting preset conditions, and determining the filled sentences with the probabilities meeting the preset conditions as the completed sentences.
In the technical scheme, each word in the alternative word set is filled into a sentence to be understood with intent to obtain a plurality of filled sentences, then the filled sentences are input into the language model to be processed to obtain the probability of matching each sentence with the sentence to be understood with intent, the probability of matching each sentence with the sentence to be understood with intent is compared, and the filled sentence with the probability according with the preset condition is determined, so that the structure and the semantic meaning of the sentence to be understood with intent are more complete, and the accuracy of the understanding with intent is improved.
Optionally, the comparing the probabilities of matching the sentences to be intended to be understood, determining the filled sentences with the probabilities meeting preset conditions, and determining the filled sentences with the probabilities meeting preset conditions as the completed sentences includes:
comparing the probabilities of matching with the sentences to be understood intently, determining the maximum matching probability, and determining the filled sentences corresponding to the maximum matching probability;
and if the maximum matching probability is larger than or equal to a preset threshold value, determining the filled sentence corresponding to the maximum matching probability as the completed sentence.
According to the technical scheme, the probability of matching with the sentence to be understood with the intention is compared to determine the maximum matching probability, and when the maximum matching probability is greater than or equal to the preset threshold value, the filled sentence corresponding to the maximum matching probability is determined as the completed sentence, so that the structure and the semantic of the sentence to be understood with the intention are more complete and accurate, and the word matched with the sentence to be understood with the intention, which corresponds to the determined maximum matching probability, can better embody the real intention of the sentence to be understood with the intention.
Optionally, the determining whether there is a component missing in the sentence to be understood includes:
inputting the sentence to be understood into a semantic role marking model for semantic recognition, and determining whether the sentence to be understood has component loss; the semantic role labeling model is determined by training a preset sequence labeling model by using a first training sample.
In the technical scheme, because the semantic role model carries out semantic recognition on each word in the sentence to be understood, and the semantic role of each word is recognized, whether the sentence to be understood has component deficiency can be quickly judged by utilizing the semantic role marking model.
Optionally, the training a preset sequence labeling model by using a first training sample to determine the semantic role labeling model includes:
obtaining the first training sample;
preprocessing the first training sample to obtain a processed first training sample;
inputting the processed first training sample into a pre-training model for vectorization processing to obtain a word vector of each word in the processed first training sample;
and training the preset sequence labeling model by using the word vector of each word to obtain the semantic role labeling model.
In the technical scheme, the processed first training sample is input into the pre-training model for vectorization, and the vectorized first training sample is input into the preset sequence labeling model for training to obtain the semantic role labeling model, so that support can be provided for judging whether components of a sentence to be understood are missing and determining the missing components.
Optionally, before the intention of the sentence to be intently understood is determined by performing intention understanding on the complemented sentence, the method further includes:
obtaining the second training sample;
preprocessing the second training sample to obtain a processed second training sample;
inputting the processed second training sample into the pre-training model for vectorization processing to obtain a sentence vector of each sentence in the processed second training sample;
training the sentence vector of each sentence on a preset classification model to obtain an intention understanding model;
the performing intention understanding on the completed sentence and determining the intention of the sentence to be understood includes:
inputting the completed sentence into the intention understanding model for understanding, and determining the intention of the sentence to be understood.
In the above technical solution, the intention understanding model is obtained by inputting the processed second training sample into the pre-training model and the preset classification model for processing, so as to provide support for accurately determining the intention of the sentence to be intended to be understood, and then the sentence to be intended to be understood is input into the intention understanding model for understanding, so as to accurately and quickly determine the intention of the sentence to be intended to be understood.
Optionally, the method further comprises:
and when the sentence to be understood is determined to have no component missing, performing intention understanding on the sentence to be understood, and determining the intention of the sentence to be understood.
In the above technical solution, when it is determined that there is no component missing in the sentence to be intended to be understood, the sentence to be intended to be understood is directly intended to be understood, and the intention of the sentence to be intended to be understood can be quickly identified.
Optionally, training a preset language model with a third training sample to determine the language model includes:
obtaining the third training sample;
preprocessing the third training sample to obtain a processed third training sample;
and inputting the processed third training sample into the preset language model for training to obtain the language model.
In the technical scheme, the processed third training sample is input into the preset language model for training to obtain the language model, and support can be provided for rapidly determining the probability of matching each sentence to be understood with the intention.
In a second aspect, the present invention also provides an intent understanding apparatus, comprising:
an acquisition unit configured to acquire a sentence to be intended to be understood;
the processing unit is used for determining whether the sentence to be understood intently has component missing or not; if so, determining the missing components of the sentence to be understood, and determining the parts of speech corresponding to the missing components of the sentence to be understood according to the missing components of the sentence to be understood; determining an alternative word set corresponding to the part of speech according to the part of speech, and determining a complemented sentence according to the alternative word set and the sentence to be understood; and performing intention understanding on the completed sentence, and determining the intention of the sentence to be understood.
Optionally, the processing unit is specifically configured to:
and determining words corresponding to the part of speech from sentences positioned in front of the sentences to be understood according to the part of speech to obtain a candidate word set corresponding to the part of speech.
Optionally, the processing unit is specifically configured to:
filling each word in the alternative word set into the sentence to be understood by the intention to obtain a plurality of filled sentences;
inputting the filled sentences into a language model for processing to obtain the probability of matching with each sentence to be understood with intent, comparing the probabilities of matching with each sentence to be understood with intent to determine the filled sentences with the probabilities meeting preset conditions, and determining the filled sentences with the probabilities meeting the preset conditions as the completed sentences.
Optionally, the processing unit is specifically configured to:
comparing the probabilities of matching with the sentences to be understood intently, determining the maximum matching probability, and determining the filled sentences corresponding to the maximum matching probability;
and if the maximum matching probability is larger than or equal to a preset threshold value, determining the filled sentence corresponding to the maximum matching probability as the completed sentence.
Optionally, the processing unit is specifically configured to:
inputting the sentence to be understood into a semantic role marking model for semantic recognition, and determining whether the sentence to be understood has component loss; the semantic role labeling model is determined by training a preset sequence labeling model by using a first training sample.
Optionally, the processing unit is specifically configured to:
obtaining the first training sample;
preprocessing the first training sample to obtain a processed first training sample;
inputting the processed first training sample into a pre-training model for vectorization processing to obtain a word vector of each word in the processed first training sample;
and training the preset sequence labeling model by using the word vector of each word to obtain the semantic role labeling model.
Optionally, the processing unit is specifically configured to:
obtaining the second training sample;
preprocessing the second training sample to obtain a processed second training sample;
inputting the processed second training sample into the pre-training model for vectorization processing to obtain a sentence vector of each sentence in the processed second training sample;
training the sentence vector of each sentence on a preset classification model to obtain an intention understanding model;
inputting the completed sentence into the intention understanding model for understanding, and determining the intention of the sentence to be understood.
Optionally, the processing unit is further configured to:
and when the sentence to be understood is determined to have no component missing, performing intention understanding on the sentence to be understood, and determining the intention of the sentence to be understood.
Optionally, the processing unit is specifically configured to:
obtaining the third training sample;
preprocessing the third training sample to obtain a processed third training sample;
and inputting the processed third training sample into the preset language model for training to obtain the language model.
In a third aspect, the invention provides a computing device comprising:
a memory for storing a computer program;
a processor for calling the computer program stored in the memory and executing the intention understanding method according to the obtained program.
In a fourth aspect, the present invention provides a computer-readable storage medium storing a computer-executable program for causing a computer to execute an intention understanding method.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a schematic diagram of a system architecture according to an embodiment of the present invention;
FIG. 2 is a schematic flow chart diagram of an intent understanding method according to an embodiment of the present invention;
FIG. 3 is a schematic flow chart diagram of another method for understanding intent provided by an embodiment of the present invention;
fig. 4 is a schematic structural diagram of an intended understanding apparatus according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention clearer, the present invention will be described in further detail with reference to the accompanying drawings, and it is apparent that the described embodiments are only a part of the embodiments of the present invention, not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Fig. 1 is a system architecture provided in an embodiment of the present invention. As shown in fig. 1, the system architecture may be a server 100 including a processor 110, a communication interface 120, and a memory 130.
The communication interface 120 is used for communicating with a terminal device, and transceiving information transmitted by the terminal device to implement communication.
The processor 110 is a control center of the server 100, connects various parts of the entire server 100 using various interfaces and lines, performs various functions of the server 100 and processes data by running or executing software programs and/or modules stored in the memory 130 and calling data stored in the memory 130. Alternatively, processor 110 may include one or more processing units.
The memory 130 may be used to store software programs and modules, and the processor 110 executes various functional applications and data processing by operating the software programs and modules stored in the memory 130. The memory 130 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function, and the like; the storage data area may store data created according to a business process, and the like. Further, the memory 130 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.
It should be noted that the structure shown in fig. 1 is only an example, and the embodiment of the present invention is not limited thereto.
Based on the above description, fig. 2 exemplarily shows a flow of an intention understanding method provided by an embodiment of the present invention, and the flow can be performed by an intention understanding apparatus.
As shown in fig. 2, the process specifically includes:
in step 201, a sentence to be understood is obtained.
In the embodiment of the present invention, the sentence to be understood may be a sentence input by a user in a dialogue with the machine service, for example, the user inputs "i unbind the bank card to be a bar" or inputs "i unbind the bank card to be a bar" in the process of consulting the machine service in the bank system, or may also be a text-type sentence, which is not limited specifically.
Step 202, determining whether the sentence to be understood is missing components.
In the embodiment of the present invention, for example, after a sentence input by a user is obtained, it is necessary to determine whether the sentence input by the user has component missing, and if the sentence input by the user has component missing, the intention of the sentence input by the user cannot be recognized, that is, the real idea of the user cannot be understood, for example, the user inputs "i unbind is a bar", and the sentence has component missing, so that what the user actually wants to unbind cannot be recognized.
Specifically, the sentence input by the user is input into the semantic role labeling model for semantic recognition, because the semantic character labeling model can be used for performing semantic recognition on each word in the sentence input by the user, the semantic role (such as a performer, a victim and the like) of each word is recognized, and whether the component of the sentence input by the user is missing or not can be judged according to the semantic role of each word in the sentence input by the user, therefore, whether the component of the sentence input by the user is missing or not can be accurately determined by using the semantic role labeling model, and when the component of the sentence input by the user is determined to be missing, the part of speech corresponding to the missing semantic role can be known according to the missing semantic role, so that the part of speech corresponding to the missing component of the sentence input by the user can be quickly and accurately recognized. Wherein, the semantic role labeling model is determined by using a first training sample to train a preset sequence labeling model, the first training sample is firstly obtained, then the first training sample is labeled according to the labeling standard of the semantic role labeling, the semantic role of each word in the training sample is labeled, namely, semantic characters are used for describing the relationship between words in each sentence of the training sample, namely describing the character component of each word in each sentence in the sentence, then preprocessing the training sample marked with the semantic role to obtain a processed first training sample, and inputting the processed first training sample into a pre-training model for vectorization processing to obtain a word vector of each word in the processed first training sample, and then training a preset sequence labeling model by using the word vector of each word to obtain a semantic role labeling model.
Further, a Semantic Role Labeling (SRL) model is determined by training a BERT + BilSTM + CRF-based sequence labeling model by using a first training sample. Firstly, collecting historical dialogue data and labeling the historical dialogue data according to a labeling standard of an SRL (Semantic role labeling), namely labeling the historical dialogue data according to the labeling standard of the Semantic role labeling, labeling a Semantic role of each word in the historical dialogue data, namely describing the relation between the words in each sentence of the historical dialogue data by using the Semantic role, namely describing the role component of each word in each sentence in the sentence to obtain a data set D1, and training an SRL model according to the data set D1, wherein the data in the data set D1 is preprocessed, namely, each sentence in the data set D1 is firstly labeled by [ CLS ] and is finally labeled by [ SEP ], then the data is subjected to character level segmentation and is converted into an ID form, meanwhile, the corpus is changed into a fixed length, sentences with insufficient length are supplemented by '0', and are cut off beyond the fixed length, and inputting the preprocessed sentences into a pre-training model BERT (Pre-training model) to obtain a word vector of each word in the sentences, and then inputting the obtained word vector into a BiLSTM (Bi-directional Long short-Term Memory network) + CRF (Conditional Random Field) model on the upper layer for training to obtain a semantic role labeling model. Wherein, the [ CLS ] label represents the semantic feature vector of the whole text, namely the semantic feature vector representing one sentence, and the [ SEP ] label is a symbol for dividing two sentences.
It should be noted that the task of Semantic Role Labeling (SRL) is to study the relationship between each component in a sentence and a predicate, and describe the relationship between them with a semantic role, that is, determine other arguments and the roles of other arguments with respect to a (core) predicate in the sentence, where the semantic role is the role that the argument plays in the event that the verb refers to, and mainly includes an actor, an object, an experiencer, a beneficiary, a tool, a place, a target, a source, and the like. The important roles are predicates and core arguments, wherein the predicates are generally verbs or adjectives, and the core arguments represent arguments directly related to the predicates, such as the constructor (Arg0) and the destoner (Arg1) of the predicates. For example, "you can search for the particle credit public number" can determine that the predicate is "search", the action is "you", and the affection is "particle credit public number", therefore, for a sentence whose components are not enough to cause difficulty in understanding the intent, the missing components can be determined by the SRL, and then the sentence is complemented by the context, and then the intent understanding is performed, for example, the user inputs "i unbind about being a bar", because the sentence lacks the affection (Arg1), the intent understanding model is difficult to clearly understand whether the user expresses that the user wants to unbind the bank card "or the telephone number", but after completing, the intent understanding model can clearly understand the intent of the user.
Step 203, when it is determined that the sentence to be intended to be understood has components missing, determining the components missing from the sentence to be intended to be understood, and determining the part of speech corresponding to the components missing from the sentence to be intended to be understood according to the components missing from the sentence to be intended to be understood.
In the embodiment of the invention, when it is determined that the sentence to be understood is not missing, the sentence to be understood is understood with intention, and the intention of the sentence to be understood with intention is determined; when it is determined that the components of the sentence to be intended to be understood are missing, determining the components of the sentence to be intended to be understood which are missing, and determining the parts of speech corresponding to the components of the sentence to be intended to be understood which are missing according to the components of the sentence to be intended to be understood which are missing. Specifically, taking the conversation between the user and the machine customer service as an example, when the sentence input by the user is input into the SRL model and it is determined that the component of the sentence input by the user is missing, the component missing from the sentence input by the user is determined according to the result determined by the SRL model, and then the part of speech corresponding to the component missing from the sentence input by the user is determined according to the component missing from the sentence input by the user, for example, "i unbind the sentence in a bar", and the sentence can be determined to be missing to be Arg1 according to the SRL model, but the fact is generally a noun, so that the part of speech corresponding to the missing component is obtained to be a noun. In addition, when the SRL model judges that the sentence input by the user has no component missing, the intention of the sentence input by the user is directly understood, and the intention of the sentence input by the user is determined.
And 204, determining an alternative word set corresponding to the part of speech according to the part of speech, and determining a complemented sentence according to the alternative word set and the sentence to be understood.
In the embodiment of the invention, according to the part of speech, words corresponding to the part of speech are determined from sentences located before the sentences to be understood with intent, a candidate word set corresponding to the part of speech is obtained, each word in the candidate word set is filled into the sentences to be understood with intent, a plurality of filled sentences are obtained, the filled sentences are input into a language model for processing, the probability of matching with each sentence to be understood with intent is obtained, the probability of matching with each sentence to be understood with intent is compared, the maximum matching probability is determined, the filled sentences corresponding to the maximum matching probability are determined, and if the maximum matching probability is greater than or equal to a preset threshold (such as 0.8), the filled sentences corresponding to the maximum matching probability are determined to be completed sentences. The language model is determined by training a preset language model by using a third training sample, the third training sample is firstly obtained, then the third training sample is preprocessed to obtain a processed third training sample, and the processed third training sample is input into the preset language model to be trained to obtain the language model. For the preset language model using the third training sample, the public corpus and the domain corpus are collected to obtain a data set D2, the data set D2 is preprocessed, and the preprocessed data set D2 is input into a 3-gram (trigram) language model for training to obtain the 3-gram language model. Wherein the preset threshold value can be set empirically.
Specifically, taking a conversation between a user and a machine customer service as an example, according to a part of speech corresponding to a missing component of a sentence input by the user, finding all words corresponding to the missing component from the above to obtain a candidate word set W, for example, if the noun in the above is "customer service", "bank card", then W { "customer service", "bank card" }, and bringing each word in W into the sentence to obtain a plurality of filled sentences, inputting the plurality of filled sentences into a trained language model to obtain probabilities of each matching with the sentence input by the user, comparing the probabilities of each matching with the sentence input by the user to determine a maximum matching probability, and determining the filled sentence corresponding to the maximum matching probability, then comparing the maximum matching probability with a preset threshold, if the maximum matching probability is greater than or equal to the preset threshold, and selecting the filled sentence corresponding to the maximum matching probability as a final sentence, namely a completed sentence, otherwise, not filling. For example, each word in W { "customer service", "bank card" } is put in turn to the subject position of "i unbind to go to bar", the probability that each word can be matched with the sentence input by the user according to the language model is compared with the probability that each word is matched with the sentence input by the user, the probability that the "bank card" is matched with the "i unbind to go to bar" is determined to be the maximum, and the maximum matching probability is greater than or equal to the preset threshold value, so that the sentence that the "i unbind to go to bar" is determined to be the completed sentence.
Step 205, performing intention understanding on the completed sentence, and determining the intention of the sentence to be intended understood.
In the embodiment of the invention, the complemented sentence is input into an intention understanding model for understanding, and the intention of the sentence to be understood is determined, wherein the intention understanding model is determined by using a second training sample to train a preset classification model, the second training sample is obtained firstly, then the second training sample is preprocessed to obtain a processed second training sample, the processed second training sample is input into the pre-training model for vectorization to obtain a sentence vector of each sentence in the processed second training sample, and then the sentence vector of each sentence is trained to the preset classification model to obtain the intention understanding model. Specifically, the intent understanding model is determined using a second training sample pair employing a text classification model based on BERT + DNN (Deep Neural Networks). Firstly, corpora in the field are collected, the corpora in the field are labeled according to the labeling standard of intention understanding to obtain a data set D3, and an intention understanding model is trained according to the data set D3, wherein data in the data set D3 are preprocessed, a [ CLS ] label is placed at the beginning of each sentence in the data set D3, a [ SEP ] label is placed at the end of the sentence, then character-level segmentation is carried out and converted into an ID form, the corpora are changed into fixed length, sentences with insufficient length are filled with '0', truncation exceeding the fixed length is carried out, the preprocessed sentences are input into a pre-training model BERT to obtain vector representation of the sentences, and the obtained vector representation is input into a DNN model at the upper layer to be trained to obtain the intention recognition model.
In order to better explain the embodiments of the intent understanding method of the present invention, the following describes a flow of the intent understanding method provided by the embodiments of the present invention through a specific implementation scenario. The implementation scenario is exemplified by a user and machine service conversation.
As shown in fig. 3, the process includes the following steps:
and 301, collecting and marking data, and training an SRL model.
And collecting historical dialogue data, labeling the historical dialogue data according to the labeling standard of the SRL to obtain labeled data, and training the SRL model according to the labeled data to obtain the SRL model.
Step 302, collecting and labeling data, and training a 3-gram language model.
And collecting the open corpus and the in-field corpus, and training the 3-gram language model according to the open corpus and the in-field corpus to obtain the 3-gram language model.
Step 303, collecting and labeling data, and training an intention understanding model.
And collecting the linguistic data in the field, labeling the linguistic data in the field according to the labeling standard of the intention understanding to obtain labeled data, and training the intention understanding model according to the labeled data to obtain the intention understanding model.
At step 304, the user enters a sentence.
In step 305, the SRL model determines whether the sentence has missing components, if yes, step 307 is executed, and if not, step 306 is executed.
Step 306, inputting the sentence input by the user into the intention understanding model for understanding.
When the SRL model judges that the sentence input by the user has no component missing, the sentence input by the user is directly input into the intention understanding model for understanding so as to understand the intention of the sentence input by the user.
Step 307, determine the part of speech based on the missing components.
And when the SRL model judges that the components of the sentence input by the user are missing, determining the part of speech corresponding to the missing components according to the judgment result of the SRL model.
And step 308, finding out all the words corresponding to the part of speech from the above to obtain a candidate word set W.
And finding out all words corresponding to the part of speech from the text according to the part of speech corresponding to the missing component to obtain a candidate word set W.
Step 309, bring each word in W into the sentence input by the user.
At step 310, the probability of each match with the sentence input by the user is calculated according to the language model.
And after each word in the W is brought into a sentence input by the user, obtaining a plurality of filled sentences, inputting the filled sentences into a trained language model, calculating the probability of matching each sentence input by the user, comparing the probabilities of matching each sentence input by the user, determining the maximum matching probability, and determining the filled sentence corresponding to the maximum matching probability.
In step 311, whether the maximum matching probability is greater than or equal to a preset threshold value is determined, if yes, step 312 is executed, and if not, step 313 is executed.
In step 312, the filled sentences corresponding to the maximum matching probability are understood with intent.
And when the maximum matching probability is determined to be larger than or equal to the preset threshold, inputting the filled sentence corresponding to the maximum matching probability into the intention understanding model for intention understanding so as to understand the intention of the sentence input by the user.
Step 313, the original sentence is intently understood.
And when the maximum matching probability is determined to be smaller than a preset threshold value, performing intention understanding on the original sentence.
The embodiment shows that whether the components of the sentences input by the user are missing is judged according to the SRL model, if yes, the missing components of the sentences input by the user are determined, the parts of speech corresponding to the missing components of the sentences input by the user are determined, the candidate word sets corresponding to the parts of speech are determined according to the parts of speech, each word in the candidate word sets is taken into the sentences input by the user to obtain a plurality of filled sentences, then the filled sentences are input into the trained language model, the probability of matching each sentence input by the user is calculated, the probability of matching each sentence input by the user is compared, the maximum matching probability is determined, the filled sentences corresponding to the maximum matching probability are determined, and when the maximum matching probability is determined to be more than or equal to the preset threshold value, the filled sentences corresponding to the maximum matching probability are input into the intention understanding model for intention understanding, the intention of the sentence input by the user can be quickly and accurately determined. Because the missing components of the sentences input by the user can be quickly and accurately judged according to the SRL model, the parts of speech corresponding to the missing components of the sentences input by the user can be determined, then all words corresponding to the parts of speech are determined from the upper parts before the sentences input by the user through part of speech recognition to form the alternative word sets without limiting the number of the upper parts, the selected alternative word sets can be richer, the input information of the user can be more sufficient, the problem that the interference is brought to the intention understanding by combining the fixed number of the upper parts and the input information is insufficient when the input of the user is combined with the fixed number of the upper parts in the prior art can be solved, and then the missing components of the sentences input by the user are filled according to the alternative word sets, so that the structure and the semanteme of the completed sentences input by the user are more complete, and the accuracy of the intention understanding can be improved, furthermore, the problem that input information is insufficient to directly understand the input of the user, so that the intention understanding is not clear in the prior art can be solved.
Based on the same technical concept, fig. 4 exemplarily shows an intention understanding apparatus provided by an embodiment of the present invention, which can execute a flow of an intention understanding method.
As shown in fig. 4, the apparatus includes:
an acquisition unit 401 configured to acquire a sentence to be understood intentionally;
a processing unit 402, configured to determine whether there is a component missing in the sentence to be understood; if so, determining the missing components of the sentence to be understood, and determining the parts of speech corresponding to the missing components of the sentence to be understood according to the missing components of the sentence to be understood; determining an alternative word set corresponding to the part of speech according to the part of speech, and determining a complemented sentence according to the alternative word set and the sentence to be understood; and performing intention understanding on the completed sentence, and determining the intention of the sentence to be understood.
Optionally, the processing unit 402 is specifically configured to:
and determining words corresponding to the part of speech from sentences positioned in front of the sentences to be understood according to the part of speech to obtain a candidate word set corresponding to the part of speech.
Optionally, the processing unit 402 is specifically configured to:
filling each word in the alternative word set into the sentence to be understood by the intention to obtain a plurality of filled sentences;
inputting the filled sentences into a language model for processing to obtain the probability of matching with each sentence to be understood with intent, comparing the probabilities of matching with each sentence to be understood with intent to determine the filled sentences with the probabilities meeting preset conditions, and determining the filled sentences with the probabilities meeting the preset conditions as the completed sentences.
Optionally, the processing unit 402 is specifically configured to:
comparing the probabilities of matching with the sentences to be understood intently, determining the maximum matching probability, and determining the filled sentences corresponding to the maximum matching probability;
and if the maximum matching probability is larger than or equal to a preset threshold value, determining the filled sentence corresponding to the maximum matching probability as the completed sentence.
Optionally, the processing unit 402 is specifically configured to:
inputting the sentence to be understood into a semantic role marking model for semantic recognition, and determining whether the sentence to be understood has component loss; the semantic role labeling model is determined by training a preset sequence labeling model by using a first training sample.
Optionally, the processing unit 402 is specifically configured to:
obtaining the first training sample;
preprocessing the first training sample to obtain a processed first training sample;
inputting the processed first training sample into a pre-training model for vectorization processing to obtain a word vector of each word in the processed first training sample;
and training the preset sequence labeling model by using the word vector of each word to obtain the semantic role labeling model.
Optionally, the processing unit 402 is specifically configured to:
obtaining the second training sample;
preprocessing the second training sample to obtain a processed second training sample;
inputting the processed second training sample into the pre-training model for vectorization processing to obtain a sentence vector of each sentence in the processed second training sample;
training the sentence vector of each sentence on a preset classification model to obtain an intention understanding model;
inputting the completed sentence into the intention understanding model for understanding, and determining the intention of the sentence to be understood.
Optionally, the processing unit 402 is further configured to:
and when the sentence to be understood is determined to have no component missing, performing intention understanding on the sentence to be understood, and determining the intention of the sentence to be understood.
Optionally, the processing unit 402 is specifically configured to:
obtaining the third training sample;
preprocessing the third training sample to obtain a processed third training sample;
and inputting the processed third training sample into the preset language model for training to obtain the language model.
Based on the same technical concept, an embodiment of the present invention provides a computing device, including:
a memory for storing a computer program;
a processor for calling the computer program stored in the memory and executing the intention understanding method according to the obtained program.
Based on the same technical concept, embodiments of the present invention provide a computer-readable storage medium storing a computer-executable program for causing a computer to perform an intention understanding method.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While preferred embodiments of the present invention have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including preferred embodiments and all such alterations and modifications as fall within the scope of the invention.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present invention without departing from the spirit and scope of the invention. Thus, if such modifications and variations of the present invention fall within the scope of the claims of the present application and their equivalents, the present invention is also intended to include such modifications and variations.

Claims (10)

1. An intent understanding method, comprising:
obtaining a sentence to be understood;
determining whether the sentence to be understood is missing components;
if so, determining the missing components of the sentence to be understood, and determining the parts of speech corresponding to the missing components of the sentence to be understood according to the missing components of the sentence to be understood;
determining an alternative word set corresponding to the part of speech according to the part of speech, and determining a complemented sentence according to the alternative word set and the sentence to be understood;
and performing intention understanding on the completed sentence, and determining the intention of the sentence to be understood.
2. The method of claim 1, wherein said determining a set of candidate words corresponding to said part of speech from said part of speech comprises:
and determining words corresponding to the part of speech from sentences positioned in front of the sentences to be understood according to the part of speech to obtain a candidate word set corresponding to the part of speech.
3. The method of claim 1, wherein the determining a complemented sentence from the set of candidate words and the sentence to be understood by intent comprises:
filling each word in the alternative word set into the sentence to be understood by the intention to obtain a plurality of filled sentences;
inputting the filled sentences into a language model for processing to obtain the probability of matching with each sentence to be understood with intent, comparing the probabilities of matching with each sentence to be understood with intent to determine the filled sentences with the probabilities meeting preset conditions, and determining the filled sentences with the probabilities meeting the preset conditions as the completed sentences.
4. The method according to claim 3, wherein the comparing the probabilities of the respective matches with the sentence to be understood, determining the filled sentence with the probability meeting a preset condition, and determining the filled sentence with the probability meeting the preset condition as the completed sentence comprises:
comparing the probabilities of matching with the sentences to be understood intently, determining the maximum matching probability, and determining the filled sentences corresponding to the maximum matching probability;
and if the maximum matching probability is larger than or equal to a preset threshold value, determining the filled sentence corresponding to the maximum matching probability as the completed sentence.
5. The method of claim 1, wherein said determining whether there is a component missing in the sentence to be intended, comprises:
inputting the sentence to be understood into a semantic role marking model for semantic recognition, and determining whether the sentence to be understood has component loss; the semantic role labeling model is determined by training a preset sequence labeling model by using a first training sample.
6. The method of claim 5, wherein the training a predetermined sequence labeling model using a first training sample to determine the semantic character labeling model comprises:
obtaining the first training sample;
preprocessing the first training sample to obtain a processed first training sample;
inputting the processed first training sample into a pre-training model for vectorization processing to obtain a word vector of each word in the processed first training sample;
and training the preset sequence labeling model by using the word vector of each word to obtain the semantic role labeling model.
7. The method of any of claims 1 to 6, wherein before the performing the intent understanding on the complemented sentence and determining the intent of the sentence to be understood, the method further comprises:
obtaining the second training sample;
preprocessing the second training sample to obtain a processed second training sample;
inputting the processed second training sample into the pre-training model for vectorization processing to obtain a sentence vector of each sentence in the processed second training sample;
training the sentence vector of each sentence on a preset classification model to obtain an intention understanding model;
the performing intention understanding on the completed sentence and determining the intention of the sentence to be understood includes:
inputting the completed sentence into the intention understanding model for understanding, and determining the intention of the sentence to be understood.
8. An intent understanding apparatus, comprising:
an acquisition unit configured to acquire a sentence to be intended to be understood;
the processing unit is used for determining whether the sentence to be understood intently has component missing or not; if so, determining the missing components of the sentence to be understood, and determining the parts of speech corresponding to the missing components of the sentence to be understood according to the missing components of the sentence to be understood; determining an alternative word set corresponding to the part of speech according to the part of speech, and determining a complemented sentence according to the alternative word set and the sentence to be understood; and performing intention understanding on the completed sentence, and determining the intention of the sentence to be understood.
9. A computing device, comprising:
a memory for storing a computer program;
a processor for calling a computer program stored in said memory, for executing the method of any one of claims 1 to 7 in accordance with the obtained program.
10. A computer-readable storage medium, characterized in that the computer-readable storage medium stores a computer-executable program for causing a computer to execute the method of any one of claims 1 to 7.
CN202010591965.8A 2020-06-24 2020-06-24 Intention understanding method, device, equipment and storage medium Pending CN111738018A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010591965.8A CN111738018A (en) 2020-06-24 2020-06-24 Intention understanding method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010591965.8A CN111738018A (en) 2020-06-24 2020-06-24 Intention understanding method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN111738018A true CN111738018A (en) 2020-10-02

Family

ID=72651119

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010591965.8A Pending CN111738018A (en) 2020-06-24 2020-06-24 Intention understanding method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN111738018A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112560476A (en) * 2020-12-09 2021-03-26 中科讯飞互联(北京)信息科技有限公司 Text completion method, electronic device and storage device
CN112580310A (en) * 2020-12-28 2021-03-30 河北省讯飞人工智能研究院 Missing character/word completion method and electronic equipment
CN113158648A (en) * 2020-12-09 2021-07-23 中科讯飞互联(北京)信息科技有限公司 Text completion method, electronic device and storage device
WO2023168838A1 (en) * 2022-03-09 2023-09-14 青岛海尔科技有限公司 Sentence text recognition method and apparatus, and storage medium and electronic apparatus

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105589844A (en) * 2015-12-18 2016-05-18 北京中科汇联科技股份有限公司 Missing semantic supplementing method for multi-round question-answering system
CN106357942A (en) * 2016-10-26 2017-01-25 广州佰聆数据股份有限公司 Intelligent response method and system based on context dialogue semantic recognition
CN108664472A (en) * 2018-05-08 2018-10-16 腾讯科技(深圳)有限公司 Natural language processing method, apparatus and its equipment
CN110704641A (en) * 2019-10-11 2020-01-17 零犀(北京)科技有限公司 Ten-thousand-level intention classification method and device, storage medium and electronic equipment
CN111046656A (en) * 2019-11-15 2020-04-21 北京三快在线科技有限公司 Text processing method and device, electronic equipment and readable storage medium
CN111104498A (en) * 2019-12-12 2020-05-05 华南理工大学 Semantic understanding method in task type dialogue system

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105589844A (en) * 2015-12-18 2016-05-18 北京中科汇联科技股份有限公司 Missing semantic supplementing method for multi-round question-answering system
CN106357942A (en) * 2016-10-26 2017-01-25 广州佰聆数据股份有限公司 Intelligent response method and system based on context dialogue semantic recognition
CN108664472A (en) * 2018-05-08 2018-10-16 腾讯科技(深圳)有限公司 Natural language processing method, apparatus and its equipment
CN110704641A (en) * 2019-10-11 2020-01-17 零犀(北京)科技有限公司 Ten-thousand-level intention classification method and device, storage medium and electronic equipment
CN111046656A (en) * 2019-11-15 2020-04-21 北京三快在线科技有限公司 Text processing method and device, electronic equipment and readable storage medium
CN111104498A (en) * 2019-12-12 2020-05-05 华南理工大学 Semantic understanding method in task type dialogue system

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112560476A (en) * 2020-12-09 2021-03-26 中科讯飞互联(北京)信息科技有限公司 Text completion method, electronic device and storage device
CN113158648A (en) * 2020-12-09 2021-07-23 中科讯飞互联(北京)信息科技有限公司 Text completion method, electronic device and storage device
CN112580310A (en) * 2020-12-28 2021-03-30 河北省讯飞人工智能研究院 Missing character/word completion method and electronic equipment
CN112580310B (en) * 2020-12-28 2023-04-18 河北省讯飞人工智能研究院 Missing character/word completion method and electronic equipment
WO2023168838A1 (en) * 2022-03-09 2023-09-14 青岛海尔科技有限公司 Sentence text recognition method and apparatus, and storage medium and electronic apparatus

Similar Documents

Publication Publication Date Title
CN110096570B (en) Intention identification method and device applied to intelligent customer service robot
CN111859960B (en) Semantic matching method, device, computer equipment and medium based on knowledge distillation
CN107679039B (en) Method and device for determining statement intention
CN111325029B (en) Text similarity calculation method based on deep learning integrated model
CN110232114A (en) Sentence intension recognizing method, device and computer readable storage medium
CN111738018A (en) Intention understanding method, device, equipment and storage medium
CN111062217B (en) Language information processing method and device, storage medium and electronic equipment
CN113051374B (en) Text matching optimization method and device
CN110555206A (en) named entity identification method, device, equipment and storage medium
CN111858878B (en) Method, system and storage medium for automatically extracting answer from natural language text
CN112084769B (en) Dependency syntax model optimization method, apparatus, device and readable storage medium
CN112036705A (en) Quality inspection result data acquisition method, device and equipment
CN115080750B (en) Weak supervision text classification method, system and device based on fusion prompt sequence
CN113282711A (en) Internet of vehicles text matching method and device, electronic equipment and storage medium
CN115827819A (en) Intelligent question and answer processing method and device, electronic equipment and storage medium
CN111782793A (en) Intelligent customer service processing method, system and equipment
CN113326702A (en) Semantic recognition method and device, electronic equipment and storage medium
CN113705192B (en) Text processing method, device and storage medium
CN109710756B (en) Document genre classification system and method based on semantic role labeling
CN111178080A (en) Named entity identification method and system based on structured information
CN112036186A (en) Corpus labeling method and device, computer storage medium and electronic equipment
CN116186219A (en) Man-machine dialogue interaction method, system and storage medium
CN113568969B (en) Information extraction method, apparatus, device and computer readable storage medium
CN116483314A (en) Automatic intelligent activity diagram generation method
CN115718889A (en) Industry classification method and device for company profile

Legal Events

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