CN114490955A - Intelligent dialogue method, device, equipment and computer storage medium - Google Patents

Intelligent dialogue method, device, equipment and computer storage medium Download PDF

Info

Publication number
CN114490955A
CN114490955A CN202011148778.9A CN202011148778A CN114490955A CN 114490955 A CN114490955 A CN 114490955A CN 202011148778 A CN202011148778 A CN 202011148778A CN 114490955 A CN114490955 A CN 114490955A
Authority
CN
China
Prior art keywords
preset
word slot
information
text
filled
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
CN202011148778.9A
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.)
China Mobile Communications Group Co Ltd
China Mobile Shanghai ICT Co Ltd
CM Intelligent Mobility Network Co Ltd
Original Assignee
China Mobile Communications Group Co Ltd
China Mobile Shanghai ICT Co Ltd
CM Intelligent Mobility Network 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 China Mobile Communications Group Co Ltd, China Mobile Shanghai ICT Co Ltd, CM Intelligent Mobility Network Co Ltd filed Critical China Mobile Communications Group Co Ltd
Priority to CN202011148778.9A priority Critical patent/CN114490955A/en
Priority to PCT/CN2021/094223 priority patent/WO2022083114A1/en
Publication of CN114490955A publication Critical patent/CN114490955A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/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
    • 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
    • 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/3343Query execution using phonetics
    • 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
    • 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
    • G06F40/289Phrasal analysis, e.g. finite state techniques or chunking
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/30Semantic analysis

Landscapes

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

Abstract

The invention discloses an intelligent dialogue method, an intelligent dialogue device, intelligent dialogue equipment and a computer storage medium. The method comprises the following steps: acquiring a text sequence of input information; matching the text sequence with at least one preset intention text message according to a preset word shift distance WMD algorithm to obtain a target intention text message; and when the target intention text information comprises word slot filling information, determining first output information according to the word slot filling information and at least one preset word slot to be filled. According to the intelligent dialogue method provided by the embodiment of the invention, the complicated dialogue form can be flexibly dealt with, and effective and friendly man-machine dialogue is realized.

Description

Intelligent dialogue method, device, equipment and computer storage medium
Technical Field
The invention belongs to the technical field of natural language processing, and particularly relates to an intelligent dialogue method, an intelligent dialogue device, intelligent dialogue equipment and a computer storage medium.
Background
Under the drive of the current popular artificial intelligence technology, a conversational robot based on technologies such as mass data, machine learning, natural language processing and the like continuously appears. The conversation robot can generate corresponding reply content according to input information of a user.
At present, more and more multi-directional service conversation robots are applied to various fields to meet service requirements through multiple rounds of conversations. In the multiple rounds of conversations with an open context, factors such as different business requirements and different language habits of users exist, so that the multiple rounds of conversation forms generated by the users and the conversation robots are very complicated, and in the prior art, the mode of managing the multiple rounds of conversations from a single angle of understanding the intention of the users is difficult to flexibly deal with the complicated conversation forms, so that the user experience is poor.
Disclosure of Invention
The embodiment of the invention provides an intelligent conversation method, an intelligent conversation device, intelligent conversation equipment and a computer storage medium, which can flexibly deal with complex conversation forms and realize effective and friendly man-machine conversation.
In a first aspect, an embodiment of the present invention provides an intelligent conversation method, where the method includes:
acquiring a text sequence of input information;
matching the text sequence with at least one preset intention text message according to a preset word shift distance WMD algorithm to obtain a target intention text message;
and when the target intention text information comprises word slot filling information, determining first output information according to the word slot filling information and at least one preset word slot to be filled.
In some implementation manners of the first aspect, matching the text sequence with at least one preset intention text message according to a preset WMD algorithm to obtain a target intention text message includes:
determining a first difference degree between the text sequence and each preset intention text message according to a preset WMD algorithm;
determining preset intention text information corresponding to the minimum first difference degree in the first difference degrees of the text sequence and each preset intention text information;
and when the minimum first difference degree is smaller than or equal to a preset difference degree threshold value, determining the preset intention text information corresponding to the minimum first difference degree as the target intention text information.
In some realizations of the first aspect, before determining the first degree of difference between the text sequence and each preset intended text information according to a preset WMD algorithm, the method further includes:
determining a second difference degree between the preset text sequence and each preset intention text message according to a preset editing distance algorithm;
acquiring corresponding preset intention text information when a second difference degree of the second difference degree between the preset text sequence and each preset intention text information is less than or equal to a preset difference degree threshold value, and acquiring at least one candidate intention text information;
determining a first difference degree between the text sequence and each preset intention text message according to a preset WMD algorithm, wherein the step of determining the first difference degree comprises the following steps:
and determining a first difference degree between the text sequence and each candidate intention text message according to a preset WMD algorithm.
In some implementations of the first aspect, determining a first degree of difference between the text sequence and each preset intention text message according to a preset WMD algorithm includes:
calculating a similarity value of each preset intention text message and the text sequence according to a WMD algorithm; and the number of the first and second groups,
calculating cosine similarity values of each preset intention text message and each preset intention text sequence;
according to the similarity value, the cosine similarity value and the first preset weight parameter alpha1And a second weight parameter alpha2Determining a first degree of difference between the text sequence and each preset intention text information, wherein alpha12=1。
In some implementations of the first aspect, the word slot filling information includes at least one word slot filling text information; determining first output information according to the word slot filling information and at least one preset word slot to be filled, wherein the determining comprises the following steps:
determining a preset word slot to be filled, which is matched with the text information and is filled in each word slot;
and determining first output information according to the filling text information of each word slot and the preset word slot to be filled matched with the word slot.
In some realizations of the first aspect, before determining the first output information according to each word slot filled with the text information and the preset word slot to be filled matched with the text information, the method further includes:
and when the at least one preset word slot to be filled comprises unfilled preset word slots to be filled, determining second output information according to the text information filled in each word slot and the preset word slots to be filled matched with the text information.
In some realizations of the first aspect, the word slots to be filled are preset as unfilled word slots or filled word slots;
when the word slot to be filled is preset as an unfilled word slot, filling the word slot filled text information into the unfilled word slot;
and when the preset word slot to be filled is the filled word slot, replacing the filling content in the filled word slot with the word slot filling text information.
In a second aspect, an embodiment of the present invention provides an intelligent dialog apparatus, where the apparatus includes:
the acquisition module is used for acquiring a text sequence of input information;
the matching module is used for matching the text sequence with at least one preset intention text message according to a preset word shift distance WMD algorithm to obtain a target intention text message;
and the output module is used for determining first output information according to the word slot filling information and at least one preset word slot to be filled when the target intention text information comprises the word slot filling information.
In a third aspect, the present invention provides an intelligent dialogue device, comprising: a processor and a memory storing computer program instructions; the processor, when executing the computer program instructions, implements the intelligent dialog method described in the first aspect or any of the realizable forms of the first aspect.
In a fourth aspect, the present invention provides a computer-readable storage medium, on which computer program instructions are stored, which, when executed by a processor, implement the intelligent dialogue method of the first aspect or any of the realizable manners of the first aspect.
The embodiment of the invention provides an intelligent dialogue method, which is characterized in that target intention text information is determined by adopting a preset Word Move's Distance (WMD) algorithm, the calculation result of semantic similarity can be more reasonable, further, when the target intention text information comprises Word slot filling information, the Word slot filling information can be automatically matched with each preset Word slot to be filled, so that a multi-turn dialogue process is more consistent with a real scene of real person communication, and a question and sentence operation for guiding to ask is determined according to the Word slot filling information and at least one preset Word slot to be filled, so that the multi-turn dialogue is more flexible.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required to be used in the embodiments of the present invention will be briefly described below, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a schematic flow chart of an intelligent dialogue method according to an embodiment of the present invention;
FIG. 2 is a flow chart of another intelligent dialogue method provided by the embodiment of the invention;
fig. 3 is a schematic structural diagram of an intelligent dialogue device according to an embodiment of the present invention;
fig. 4 is a schematic structural diagram of an intelligent dialogue device according to an embodiment of the present invention.
Detailed Description
Features of various aspects and exemplary embodiments of the present invention will be described in detail below, and in order to make objects, technical solutions and advantages of the present invention more apparent, the present invention will be described in further detail below with reference to the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are only intended to illustrate the invention, and not to limit the invention. It will be apparent to one skilled in the art that the present invention may be practiced without some of these specific details. The following description of the embodiments is merely intended to provide a better understanding of the present invention by illustrating examples of the present invention.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
The term "and/or" herein is merely an association describing an associated object, meaning that three relationships may exist, e.g., a and/or B, may mean: a exists alone, A and B exist simultaneously, and B exists alone.
Under the drive of the current popular artificial intelligence technology, a conversational robot based on technologies such as mass data, machine learning, natural language processing and the like continuously appears. The conversation robot can generate corresponding reply content according to input information of a user.
At present, more and more multi-directional service conversation robots are applied to various fields to meet service requirements through multiple rounds of conversations. In addition to conversation robots for daily chatting, conversation robots for more and more multi-directional services are being applied to various fields to meet corresponding service requirements, such as: the task-type conversation robot is deployed in various forms and is arranged in various terminals to serve users.
In the existing multi-turn dialogue system, the intention recognition model is basically based on character string matching and a short text multi-classification model, so that not only is the accuracy low, but also a large amount of labeled training data is needed in the model training process, and the time complexity is high.
Because there are various business requirements of users, different language habits, and other factors in the multi-turn dialog of the open context, the multi-turn dialog form generated by the user and the dialog robot is very complicated. In the prior art, most of ways of managing multiple rounds of conversations from a single perspective of understanding user intentions and the like are difficult to flexibly deal with complex conversation forms, so that the user experience is poor.
In view of the above, an embodiment of the present invention provides an intelligent dialog method, where a preset word-shift distance WMD algorithm is used to determine target intention text information, so that a calculation result of semantic similarity may be more reasonable, and further, when the target intention text information includes word slot filling information, the word slot filling information may be automatically matched with each preset word slot to be filled, so that a multi-turn dialog flow better conforms to a real scene of real person communication, and in particular, a question-and-speak technique for guiding to ask a question may be determined according to the word slot filling information and at least one preset word slot to be filled, so that the multi-turn dialog has more flexibility.
The following describes an intelligent dialogue method provided by an embodiment of the present invention with reference to the accompanying drawings.
Fig. 1 is a flowchart illustrating an intelligent dialogue method according to an embodiment of the present invention. As shown in fig. 1, the method may include S110-S130.
And S110, acquiring a text sequence of the input information.
In S110 in this embodiment of the present invention, the intelligent dialog terminal may obtain input information of the user through an input mode such as voice, text, or option prompt. The intelligent dialogue terminal can obtain the text sequence from the input information based on the word segmentation device.
In some embodiments, a Hanlp tokenizer may be selected for use. In order to improve the accuracy of acquiring the text sequence, before the Hanlp word segmentation device is used, a preset conversation scene exchange word bank can be used for expanding the Hanlp word segmentation device, wherein the conversation scene exchange word bank is used for example, a beverage self-service purchase scene word bank.
In some embodiments, the intelligent dialog terminal may create a Context (Context) for the input information that first enters the dialog and assign a Context identification (Context ID) to the Context. When the intelligent dialogue terminal obtains the input information of the user again, the intelligent dialogue terminal can position the context of the current round of dialogue according to the context identification, and can output the corresponding dialogue according to the current progress of the context so as to realize smooth dialogue with the user. In one example, for a first conversation, the intelligent conversation terminal may output a welcome word corresponding to the first conversation, wherein the welcome word may be selected from a preset welcome word list.
In some embodiments, after obtaining the text sequence, sensitive word detection may be performed on the text sequence, and if no sensitive word is detected, S120 is performed.
If the sensitive words are detected to exist in the text sequence, prompt information can be output to remind the user to input related purchase information again. If the sensitive word is not detected in the text sequence, the method can jump to the intention matching node according to the conversation process of the current context, namely executing S120 to match the text sequence with the target intention text information.
And S120, matching the text sequence with at least one preset intention text message according to a preset WMD algorithm to obtain a target intention text message.
In S120 in the embodiment of the present invention, matching the target intention text information for the text sequence may specifically include steps S121, S122, and S123.
S121, determining a first difference degree between the text sequence and each preset intention text message according to a preset WMD algorithm.
In some embodiments, first, a similarity value of each preset intention text information and the text sequence may be calculated according to a WMD algorithm; calculating cosine similarity values of each preset intention text message and each preset intention text sequence; then, according to the similarity value, the cosine similarity value and the first preset weight parameter alpha1And a second weight parameter alpha2Determining a first degree of difference between the text sequence and each preset intention text information, wherein alpha121. Specifically, as shown in formula (1).
Figure BDA0002740545640000061
Wherein alpha is1For a first predetermined weight parameter, α2And the second preset weight parameter. w is aiAs a word vector in a text sequence, wj' is a corresponding word vector sequence in the preset intention text information, and i and j are positive integers. By alpha1Can be used to express semantic similarity weight, through alpha2The method can be used for representing the weight obtained by calculating the cosine similarity of the word vector sequence.
In the embodiment of the present invention, in order to make the calculation result of the first difference more reasonable, therefore, by calculating the cosine similarity between the word vector sequences, when calculating the first difference between the text sequence and each preset intention text message, the semantic information of the vocabulary which is not registered in the word vector can be also calculated, thereby improving the accuracy of calculating the difference, and simultaneously avoiding the problem of occurrence of an Out of vocabulary (OOV) with semantic similarity.
After the first degree of difference between the text sequence and each preset intention text information is obtained, S122 and S123 are executed.
And S122, determining the preset intention text information corresponding to the minimum first difference degree in the first difference degrees of the text sequence and each preset intention text information.
And S123, when the minimum first difference degree is smaller than or equal to a preset difference degree threshold value, determining preset intention text information corresponding to the minimum first difference degree as target intention text information.
In some embodiments, when the first degree of difference is greater than a preset degree of difference threshold, it indicates that the preset intention text information corresponding to the first degree of difference is an intention that is not related at all, and therefore, when the minimum first degree of difference is less than or equal to the preset degree of difference threshold, the preset intention text information corresponding to the minimum first degree of difference is determined as the target intention text information.
In some embodiments, if the minimum first difference is greater than the preset difference threshold, it indicates that the intention related to the text sequence is not matched, at this time, the context may be checked, the number of times of inquiry is obtained, if the number of times of inquiry does not exceed the preset number of times of inquiry, the inquiry may be reinitiated, and a corresponding dialog may be output according to the current progress of the context, so as to prompt the user to input related purchase information, thereby implementing a smooth dialog with the user. Illustratively, the related purchase information is, for example: "do we have a scratch for iron, American asking for which are you wanted? ".
In some embodiments, in order to improve matching speed and matching accuracy of the intention recognition, before determining the first difference between the text sequence and each preset intention text information according to a preset WMD algorithm, a part of the intention text information may be filtered according to a preset difference threshold. For example, first, a second difference degree between the preset text sequence and each preset intention text message can be determined according to a preset editing distance algorithm; and then, acquiring corresponding preset intention text information when a second difference degree of the second difference degrees of the preset text sequence and each preset intention text information is less than or equal to a preset difference degree threshold value, and obtaining at least one candidate intention text information.
The preset edit distance algorithm is used for comparing the difference degree of two texts, and can refer to the formula (2)
Figure BDA0002740545640000081
The method comprises the steps that a is a preset text sequence, i represents the ith character in the preset text sequence, b is preset intention text information, and j represents the jth character in the preset intention text information; leva,b(i, j) represents the distance between the first i characters in a and the first j characters in b, i.e., the second degree of difference between the preset text sequence and each preset intention text information.
min (i, j) ═ 0, which indicates that one of the values i, j is 0 and that one of the character strings (predetermined text sequences) a is an empty string.
At this time, the conversion from the character string (preset text sequence) a to the character string (preset intention text information) b requires only max (i, j) times of single-character editing operations.
min(i,j)≠0,leva,b(i, j) may include the minimum of the following three cases.
(1)leva,b(i-1, j) +1, representing deletion ai
(2)leva,b(i, j-1) +1, representing deletion bj
(3)leva,b(i-1, j-1) +1, representing the alternative bj
After filtering the partial intention text information according to the preset difference threshold, in step S123, that is, according to the preset WMD algorithm, determining a first difference between the text sequence and each preset intention text information includes: and determining a first difference degree between the text sequence and each candidate intention text message according to a preset WMD algorithm.
After the target intention text information is obtained, S130 is performed next.
S130, when the target intention text information comprises word slot filling information, determining first output information according to the word slot filling information and at least one preset word slot to be filled.
In some embodiments, after obtaining the target intent text information, the intelligent dialog terminal may advance the dialog progress of the context from the intent matching node to the word slot filling node.
In some embodiments, the word slot filling information may include at least one word slot filling text information, and when the target intention text information includes the word slot filling information, the intelligent dialogue terminal may determine that each word slot is filled with a preset word slot to be filled, which the text information matches; and determining first output information according to the filling text information of each word slot and the preset word slot to be filled matched with the word slot.
In order to enable the intelligent dialogue terminal to randomly reply the corresponding dialect with the preset word slot to be filled, the dialogue process is more flexible. In some embodiments, the intelligent dialogue terminal pushes the dialogue process of the context from the intention matching node to the word slot filling node, and may correspond to a plurality of preset word slots to be filled, where the plurality of preset word slots to be filled are parallel word slots, and the filling of the parallel word slots is not sequential at a semantic level.
In one example, the parallel word channel may include, for example, beverage sweetness, beverage cup type, and/or beverage temperature options. In each dialog between the intelligent dialog terminal and the user, the word slot filling information may include word slot filling text information, which may be, for example: half sugar, beaker, and/or heat, etc. The intelligent dialogue terminal can match the word slot filling text information with the parallel word slots in sequence, and fills the word slot filling text information into the appropriate parallel word slots.
In order to make the conversation process between the intelligent terminal and the user more conform to the real scene of real person communication, in some embodiments, the preset word slot to be filled may be an unfilled word slot or a filled word slot. That is, when the word slot to be filled is preset as an unfilled word slot, filling the word slot with the text information into the unfilled word slot; and when the preset word slot to be filled is the filled word slot, replacing the filling content in the filled word slot with the word slot filling text information. That is to say, when the intention matching node is advanced to the word slot filling node, the word slot of the word slot filling node may already be filled, and in the embodiment of the present invention, in order to make the output information of the dialog intelligent terminal more flexible, the word slot that has already been filled may be replaced by new word slot filling text information, so as to implement updating of the word slot.
After filling the word slot filler text information into the appropriate word slot, the first output information may include output end-word related information if there are no unfilled word slots. For example, "succeed in placing an order, ask you for patience waiting", "thank you for patience waiting, this is your coffee, please take good, welcome next time" and so on. In some embodiments, the end-word related information may be obtained from a preset end-word list, wherein the end-word list may include the end-word related information including, but not limited to, text, picture, audio, video, and the like.
After filling the word slot filling text information into the proper word slot, before determining the first output information, when at least one preset word slot to be filled comprises unfilled preset word slots to be filled, determining second output information according to the word slot filling text information and the preset word slot to be filled matched with the word slot filling text information.
The second output information may be a guided question output based on the unfilled word slots. For example, "ask you for food or take away? "," we have a big cup, a middle cup, a small cup, ask you which kind of you want? "etc. to guide questions.
In some embodiments, in order to make the conversation process more consistent with the real scene of real person communication, an additional vocabularies list may be added to the conversation scene communication thesaurus to deal with vocabularies which are not in the scene range but may be asked, for example, when the received input information is "how to go between hands", the intelligent conversation terminal may also provide answers. For example, when the intelligent dialogue terminal cannot extract available information from the received input information, the intelligent dialogue terminal may output "sorry and cannot hear what you are saying".
The intelligent dialogue method provided by the embodiment of the invention has the advantages that the target intention text information is determined by adopting the preset WMD algorithm, the calculation result of the semantic similarity can be more reasonable, further, when the target intention text information comprises the word slot filling information, the word slot filling information can be automatically matched with each preset word slot to be filled, so that the multi-turn dialogue process is more consistent with the real scene of real person communication, and particularly, the question and talk operation for guiding to ask is determined according to the word slot filling information and at least one preset word slot to be filled, so that the multi-turn dialogue is more flexible.
In order to explain the present invention more clearly, the present invention will be further explained with reference to fig. 2 in the following application scenario of purchasing coffee. As shown in fig. 2, the method may include steps S201-S210.
S201, receiving user input information.
Before receiving the input information of the user, the intelligent dialogue terminal can acquire the input information of the user through input modes such as voice, text or option prompt. Before receiving the user input information, the intelligent dialogue terminal may output welcome skills, such as "you are good, welcome," ask what you want to drink ", and the like.
After receiving the user input information, S202 is performed.
S202, acquiring a text sequence of the information input by the user.
The intelligent dialogue terminal can obtain the text sequence from the input information based on the word segmentation device of Hanlp.
S203, detecting whether the text sequence comprises the sensitive words.
When the text sequence includes the sensitive word, executing S204; when the text sequence does not include the sensitive word, S207 is performed.
And S204, judging whether the current inquiry frequency is less than or equal to the preset inquiry frequency.
In order to improve user experience and avoid session redundancy, in some embodiments, a preset number of queries may be preset, and if the current number of queries is greater than the number of queries, the session is ended.
If the current query frequency is less than the preset query frequency, S205 is executed.
And S205, adding 1 to the current inquiry times.
And S206, outputting the reply information.
In some embodiments, the reply message may include a sensitive word reply grammar, such as "the sensitive word is included in your utterance", "warning, the sensitive word is detected", etc., and in combination with the unfilled word slot, the reply message may further include a guided question, such as "we have iron, american, ask what you want to drink", etc., and then re-execute S201, receiving the user input message.
In some embodiments, S207 is performed when the text sequence does not include sensitive words.
And S207, matching the text sequence with at least one preset intention text message.
The intelligent dialogue terminal matches the text sequence with at least one preset intention text message to obtain a target intention text message, and after the target intention text message is obtained, the intelligent dialogue terminal can push the context dialogue progress from the intention matching node to a word slot filling node, and executes S208.
And S208, judging whether the target intention text information comprises word slot filling information.
When the target intention text information includes word slot filling information, performing S209; when the target intention text information does not include word slot filling information, S210 is performed.
S209, word slot filling.
In some embodiments, the word slot filling information may include at least one word slot filling text information, and when the target intention text information includes the word slot filling information, the intelligent dialogue terminal may determine that each word slot is filled with a preset word slot to be filled matched with the text information, where the preset word slot to be filled may include a plurality of filled preset word slots to be filled or unfilled preset word slots to be filled, and the intelligent dialogue terminal fills the text information and the preset word slot to be filled matched therewith according to each word slot.
In one example, when the user has taken coffee latte alone, then wants to change to american coffee, and informs the intelligent dialogue terminal of the cup shape and sweetness in a sentence, according to the embodiment S209 of the present invention, the coffee latte in the word slot to be filled is directly replaced with american coffee through the parallel word-saving slot, and the cup shape and sweetness are filled into the word slot to be filled, so that the user does not need to answer the sweetness information and the cup shape information for the second time, thereby smoothly completing the dialogue process.
S210, judging whether the word slot is filled completely.
If the word slot is filled, executing S206 and outputting reply information; if the slave word slot filling is not completed, S211 is performed.
In performing S206, after filling the word slot filling text information into the appropriate word slot, the first output information may include output end word related information if the word slot filling is completed. For example, "call successfully, ask you for patience waiting", "thank you for patience waiting, this is your coffee, please take good, welcome next time" and so on, and then if no user input information is detected within the preset time range, the current conversation process may be ended.
If the slave word slot filling is not completed, S211 is performed.
And S211, resetting the current inquiry times.
In order to avoid ending the dialog flow in advance when the number of queries exceeds the preset number of queries, the current number of queries may be reset after the partial word slot filling is completed, for example, the current number of queries may be set to zero.
After the current number of inquiries is reset, execution proceeds to S206.
In some embodiments, when the at least one preset word slot to be filled includes an unfilled preset word slot to be filled, the second output information may be determined according to each word slot filled with the text information and the preset word slot to be filled matched therewith. The second output information may be a guided question output based on the unfilled word slots. For example, "ask you for food or take away? "," we have a big cup, a middle cup, a small cup, ask you which kind of you want? "etc. to guide questions.
Next, S201 is executed to receive the information input by the user until the word slot is filled, the purchase order is completed, and the current session process is ended, or the related information input by the user to end the current session is obtained, and the current session process is ended.
The intelligent dialogue method provided by the embodiment of the invention has the advantages that the target intention text information is determined by adopting the preset WMD algorithm, the calculation result of the semantic similarity can be more reasonable, further, when the target intention text information comprises the word slot filling information, the word slot filling information can be automatically matched with each preset word slot to be filled, so that the multi-turn dialogue process is more consistent with the real scene of real person communication, and particularly, the question and talk operation for guiding to ask is determined according to the word slot filling information and at least one preset word slot to be filled, so that the multi-turn dialogue is more flexible.
Fig. 3 is a schematic structural diagram of an intelligent dialog apparatus according to an embodiment of the present invention, and as shown in fig. 3, the intelligent dialog apparatus 300 may include: an acquisition module 310, a matching module 320, and an output module 330.
An obtaining module 310, configured to obtain a text sequence of input information;
the matching module 320 is configured to match the text sequence with at least one preset intention text message according to a preset word shift distance WMD algorithm to obtain a target intention text message;
the output module 330 is configured to determine, when the target intention text information includes word slot filling information, first output information according to the word slot filling information and at least one preset word slot to be filled.
In some embodiments, the matching module 320 is configured to determine a first degree of difference between the text sequence and each preset intention text message according to a preset WMD algorithm; determining preset intention text information corresponding to the minimum first difference degree in the first difference degrees of the text sequence and each preset intention text information; and when the minimum first difference degree is smaller than or equal to a preset difference degree threshold value, determining the preset intention text information corresponding to the minimum first difference degree as the target intention text information.
In some embodiments, the matching module 320 is further configured to determine a second difference between the preset text sequence and each preset intention text message according to a preset edit distance algorithm; acquiring corresponding preset intention text information when a second difference degree of the second difference degree between the preset text sequence and each preset intention text information is less than or equal to a preset difference degree threshold value, and acquiring at least one candidate intention text information; the matching module 320 is further configured to determine a first degree of difference between the text sequence and each candidate intended text message according to a preset WMD algorithm.
In some embodiments, the matching module 320 is further configured to calculate a similarity value between each preset intention text information and the text sequence according to a WMD algorithm; calculating cosine similarity values of each preset intention text message and each preset intention text sequence; according to the similarity value, the cosine similarity value and the first preset weight parameter alpha1And a second weight parameter alpha2Determining a first degree of difference between the text sequence and each preset intention text information, wherein alpha12=1。
In some embodiments, the word slot filling information comprises at least one word slot filling text information; the output module 330 is further configured to determine that each word slot is filled with a preset word slot to be filled, where the text information matches; and determining first output information according to the filling text information of each word slot and the preset word slot to be filled matched with the word slot.
In some embodiments, the output module 330 is further configured to determine, when the at least one preset word slot to be filled includes an unfilled preset word slot to be filled, second output information according to the word slot filling text information and the preset word slot to be filled matched therewith.
In some embodiments, the word slot to be filled is preset to be an unfilled word slot or a filled word slot; when the word slot to be filled is preset as an unfilled word slot, filling the word slot filled text information into the unfilled word slot; and when the preset word slot to be filled is the filled word slot, replacing the filling content in the filled word slot with the word slot filling text information.
It is understood that the intelligent dialog apparatus 300 according to the embodiment of the present invention may correspond to an execution main body of the intelligent dialog method described in the embodiment of the present invention, and specific details of operations and/or functions of each module/unit of the intelligent dialog apparatus 300 may refer to the descriptions of the corresponding parts in the intelligent dialog method described in the embodiment of the present invention, which are not described herein again for brevity.
The intelligent dialogue device 300 of the embodiment of the invention determines the target intention text information by adopting the preset WMD algorithm, so that the calculation result of the semantic similarity is more reasonable, further, when the target intention text information comprises word slot filling information, the word slot filling information can be automatically matched with each preset word slot to be filled, so that the multi-turn dialogue process is more consistent with the real scene of real person communication, and particularly, a question and talk operation for guiding to ask is determined according to the word slot filling information and at least one preset word slot to be filled, so that the multi-turn dialogue is more flexible.
Fig. 4 is a schematic diagram of a hardware structure of an intelligent dialogue device according to an embodiment of the present invention.
As shown in fig. 4, the intelligent dialogue device 400 in the present embodiment includes an input device 401, an input interface 402, a central processor 403, a memory 404, an output interface 405, and an output device 406. The input interface 402, the central processing unit 403, the memory 404, and the output interface 405 are connected to each other through a bus 410, and the input device 401 and the output device 406 are connected to the bus 410 through the input interface 402 and the output interface 405, respectively, and further connected to other components of the intelligent dialogue device 400.
Specifically, the input device 401 receives input information from the outside and transmits the input information to the central processor 403 through the input interface 402; the central processor 403 processes the input information based on computer-executable instructions stored in the memory 404 to generate output information, stores the output information temporarily or permanently in the memory 404, and then transmits the output information to the output device 406 through the output interface 405; output device 406 outputs the output information to the exterior of intelligent dialog device 400 for use by the user.
That is, the intelligent dialogue device 400 shown in fig. 4 may also be implemented to include: a memory storing computer-executable instructions; and a processor that, when executing computer executable instructions, may implement the intelligent dialog method described in connection with embodiments of the present invention.
In one embodiment, the intelligent dialog device 400 shown in fig. 4 comprises: a memory 404 for storing programs; a processor 403 for executing the program stored in the memory to execute the intelligent dialogue method described in the embodiment of the present invention.
An embodiment of the present invention further provides a computer-readable storage medium, where the computer-readable storage medium has computer program instructions stored thereon; the computer program instructions, when executed by a processor, implement the intelligent dialog method described in embodiments of the present invention.
It is to be understood that the invention is not limited to the specific arrangements and instrumentality described above and shown in the drawings. A detailed description of known methods is omitted herein for the sake of brevity. In the above embodiments, several specific steps are described and shown as examples. However, the method processes of the present invention are not limited to the specific steps described and illustrated, and those skilled in the art can make various changes, modifications and additions, or change the order between the steps, after comprehending the spirit of the present invention.
The functional blocks shown in the above-described structural block diagrams may be implemented as hardware, software, firmware, or a combination thereof. When implemented in hardware, it may be, for example, an electronic Circuit, an Application Specific Integrated Circuit (ASIC), suitable firmware, plug-in, function card, or the like. When implemented in software, the elements of the invention are the programs or code segments used to perform the required tasks. The program or code segments may be stored in a machine-readable medium or transmitted by a data signal carried in a carrier wave over a transmission medium or a communication link. A "machine-readable medium" may include any medium that can store or transfer information. Examples of a machine-readable medium include electronic circuits, semiconductor Memory devices, Read-Only memories (ROMs), flash memories, Erasable Read-Only memories (EROMs), floppy disks, Compact disk Read-Only memories (CD-ROMs), optical disks, hard disks, optical fiber media, Radio Frequency (RF) links, and so forth. The code segments may be downloaded via computer networks such as the internet, intranet, etc.
It should also be noted that the exemplary embodiments mentioned in this patent describe some methods or systems based on a series of steps or devices. However, the present invention is not limited to the order of the above-described steps, that is, the steps may be performed in the order mentioned in the embodiments, may be performed in an order different from the order in the embodiments, or may be performed simultaneously.
Aspects of the present disclosure are described above with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the disclosure. It will be understood that each block of the flowchart illustrations and/or block diagrams, and combinations of blocks in the flowchart illustrations 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, 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, enable the implementation of the functions/acts specified in the flowchart and/or block diagram block or blocks. Such a processor may be, but is not limited to, a general purpose processor, a special purpose processor, an application specific processor, or a field programmable logic circuit. It will also be understood that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware for performing the specified functions or acts, or combinations of special purpose hardware and computer instructions.
As described above, only the specific embodiments of the present invention are provided, and it can be clearly understood by those skilled in the art that, for convenience and brevity of description, the specific working processes of the system, the module and the unit described above may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again. It should be understood that the scope of the present invention is not limited thereto, and any person skilled in the art can easily conceive various equivalent modifications or substitutions within the technical scope of the present invention, and these modifications or substitutions should be covered within the scope of the present invention.

Claims (10)

1. An intelligent dialog method, comprising:
acquiring a text sequence of input information;
matching the text sequence with at least one preset intention text message according to a preset word shift distance WMD algorithm to obtain a target intention text message;
and when the target intention text information comprises word slot filling information, determining first output information according to the word slot filling information and at least one preset word slot to be filled.
2. The method of claim 1, wherein the matching the text sequence with at least one preset intention text message according to a preset WMD algorithm to obtain a target intention text message comprises:
determining a first difference degree between the text sequence and each preset intention text message according to a preset WMD algorithm;
determining preset intention text information corresponding to the minimum first difference degree in the first difference degrees of the text sequence and each preset intention text information;
and when the minimum first difference degree is smaller than or equal to the preset difference degree threshold value, determining preset intention text information corresponding to the minimum first difference degree as the target intention text information.
3. The method of claim 2, wherein before said determining a first degree of difference between said text sequence and each of said intended text messages according to a predetermined WMD algorithm, said method further comprises:
determining a second difference degree between the preset text sequence and each preset intention text message according to a preset editing distance algorithm;
acquiring corresponding preset intention text information when a second difference degree of the preset text sequence and each preset intention text information is smaller than or equal to a preset difference degree threshold value, so as to obtain at least one candidate intention text information;
the determining a first difference degree between the text sequence and each preset intention text message according to a preset WMD algorithm comprises the following steps:
and determining a first difference degree between the text sequence and each candidate intention text message according to a preset WMD algorithm.
4. The method according to any one of claims 1 to 3, wherein the determining a first degree of difference between the text sequence and each of the intended text messages according to a predetermined WMD algorithm comprises:
calculating a similarity value of each preset intention text message and the text sequence according to a WMD algorithm; and the number of the first and second groups,
calculating cosine similarity values of each preset intention text message and the text sequence;
according to the similarity value, the cosine similarity value and a first preset weight parameter alpha1And a second weight parameter alpha2Determining a first degree of difference between the text sequence and each preset intention text information, wherein alpha is12=1。
5. The method of claim 1, wherein the word slot filling information comprises at least one word slot filling text information; determining first output information according to the word slot filling information and at least one preset word slot to be filled, wherein the determining comprises the following steps:
determining a preset word slot to be filled, which is matched with the text information and is filled in each word slot;
and determining the first output information according to the filling text information of each word slot and the preset word slot to be filled matched with the word slot.
6. The method according to claim 5, wherein before the determining the first output information according to each of the word slots filled with text information and a preset word slot to be filled matched therewith, the method further comprises:
and when the at least one preset word slot to be filled comprises unfilled preset word slots to be filled, determining second output information according to the text information filled in each word slot and the preset word slots to be filled matched with the word slots.
7. The method according to claim 1, wherein the preset word slot to be filled is an unfilled word slot or a filled word slot;
when the preset word slot to be filled is an unfilled word slot, filling text information filled in the word slot into the unfilled word slot;
and when the preset word slot to be filled is a filled word slot, replacing the filling content in the filled word slot with the word slot filling text information.
8. An intelligent dialog device, the device comprising:
the acquisition module is used for acquiring a text sequence of input information;
the matching module is used for matching the text sequence with at least one preset intention text message according to a preset word shift distance WMD algorithm to obtain a target intention text message;
and the output module is used for determining first output information according to the word slot filling information and at least one preset word slot to be filled when the target intention text information comprises word slot filling information.
9. An intelligent dialogue device, the device comprising: a processor, and a memory storing computer program instructions;
the processor reads and executes the computer program instructions to implement the intelligent dialog method of any of claims 1-7.
10. A computer storage medium having computer program instructions stored thereon which, when executed by a processor, implement the intelligent dialog method of any one of claims 1-7.
CN202011148778.9A 2020-10-23 2020-10-23 Intelligent dialogue method, device, equipment and computer storage medium Pending CN114490955A (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202011148778.9A CN114490955A (en) 2020-10-23 2020-10-23 Intelligent dialogue method, device, equipment and computer storage medium
PCT/CN2021/094223 WO2022083114A1 (en) 2020-10-23 2021-05-17 Smart dialog method, apparatus, device, storage medium, and program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011148778.9A CN114490955A (en) 2020-10-23 2020-10-23 Intelligent dialogue method, device, equipment and computer storage medium

Publications (1)

Publication Number Publication Date
CN114490955A true CN114490955A (en) 2022-05-13

Family

ID=81291485

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011148778.9A Pending CN114490955A (en) 2020-10-23 2020-10-23 Intelligent dialogue method, device, equipment and computer storage medium

Country Status (2)

Country Link
CN (1) CN114490955A (en)
WO (1) WO2022083114A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117609462A (en) * 2023-11-29 2024-02-27 广州方舟信息科技有限公司 Medicine question-answering method, medicine question-answering robot, electronic device and storage medium

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116226356B (en) * 2023-05-08 2023-07-04 深圳市拓保软件有限公司 NLP-based intelligent customer service interaction method and system
CN117332068B (en) * 2023-10-31 2024-08-27 北京百度网讯科技有限公司 Man-machine interaction method and device, electronic equipment and storage medium

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9201859B2 (en) * 2011-12-15 2015-12-01 Microsoft Technology Licensing, Llc Suggesting intent frame(s) for user request(s)
US9996531B1 (en) * 2016-03-29 2018-06-12 Facebook, Inc. Conversational understanding
US10366692B1 (en) * 2017-05-15 2019-07-30 Amazon Technologies, Inc. Accessory for a voice-controlled device
US10546003B2 (en) * 2017-11-09 2020-01-28 Adobe Inc. Intelligent analytics interface
US10498898B2 (en) * 2017-12-13 2019-12-03 Genesys Telecommunications Laboratories, Inc. Systems and methods for chatbot generation
CN110321472A (en) * 2019-06-12 2019-10-11 中国电子科技集团公司第二十八研究所 Public sentiment based on intelligent answer technology monitors system

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117609462A (en) * 2023-11-29 2024-02-27 广州方舟信息科技有限公司 Medicine question-answering method, medicine question-answering robot, electronic device and storage medium
CN117609462B (en) * 2023-11-29 2024-07-09 广州方舟信息科技有限公司 Medicine question-answering method, medicine question-answering robot, electronic device and storage medium

Also Published As

Publication number Publication date
WO2022083114A1 (en) 2022-04-28

Similar Documents

Publication Publication Date Title
CN112365892B (en) Man-machine conversation method, device, electronic device and storage medium
CN114490955A (en) Intelligent dialogue method, device, equipment and computer storage medium
CN110111775B (en) Streaming voice recognition method, device, equipment and storage medium
CN109616108B (en) Multi-turn dialogue interaction processing method and device, electronic equipment and storage medium
CN108694940B (en) Voice recognition method and device and electronic equipment
CN108962233B (en) Voice conversation processing method and system for voice conversation platform
CN1950882B (en) Detection of end of utterance in speech recognition system
US10733986B2 (en) Apparatus, method for voice recognition, and non-transitory computer-readable storage medium
JP6612907B2 (en) Information input method
CN105512228A (en) Bidirectional question-answer data processing method and system based on intelligent robot
CN112365894A (en) AI-based composite voice interaction method and device and computer equipment
CN111540356B (en) Correction method and system for voice conversation
CN109979474B (en) Voice equipment and user speech rate correction method and device thereof and storage medium
CN110019687A (en) A kind of more intention assessment systems, method, equipment and the medium of knowledge based map
CN111191450A (en) Corpus cleaning method, corpus entry device and computer-readable storage medium
CN111428010A (en) Man-machine intelligent question and answer method and device
CN110019691A (en) Conversation message treating method and apparatus
CN111178081A (en) Semantic recognition method, server, electronic device and computer storage medium
CN112084317A (en) Method and apparatus for pre-training a language model
CN111611358A (en) Information interaction method and device, electronic equipment and storage medium
CN110489519B (en) Session method based on session prediction model and related products
CN110047473B (en) Man-machine cooperative interaction method and system
CN114708854A (en) Voice recognition method and device, electronic equipment and storage medium
CN113782030A (en) Error correction method based on multi-mode speech recognition result and related equipment
CN113051384A (en) User portrait extraction method based on conversation and related device

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