CN111460123B - Conversation intention identification method and device for teenager chat robot - Google Patents

Conversation intention identification method and device for teenager chat robot Download PDF

Info

Publication number
CN111460123B
CN111460123B CN202010263813.5A CN202010263813A CN111460123B CN 111460123 B CN111460123 B CN 111460123B CN 202010263813 A CN202010263813 A CN 202010263813A CN 111460123 B CN111460123 B CN 111460123B
Authority
CN
China
Prior art keywords
intention
segmentation
word block
word
attribute
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202010263813.5A
Other languages
Chinese (zh)
Other versions
CN111460123A (en
Inventor
李铁乔
战科宇
李冠龙
张恒
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Chinaso Information Technology Co ltd
Original Assignee
Chinaso Information Technology 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 Chinaso Information Technology Co ltd filed Critical Chinaso Information Technology Co ltd
Priority to CN202010263813.5A priority Critical patent/CN111460123B/en
Publication of CN111460123A publication Critical patent/CN111460123A/en
Application granted granted Critical
Publication of CN111460123B publication Critical patent/CN111460123B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/33Querying
    • G06F16/332Query formulation
    • G06F16/3329Natural language query formulation or dialogue systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/33Querying
    • G06F16/3331Query processing
    • G06F16/334Query execution
    • G06F16/3344Query execution using natural language analysis

Landscapes

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

Abstract

The invention discloses a conversation intention identification method and a device aiming at a teenager chat robot, which comprises the steps of establishing a plurality of intention matching templates which are added with length attributes and age-stage priority attribute structures based on the combination of word block sets; segmenting input user dialogue sentences to form a segmentation candidate set, carrying out priority screening on all segmentation candidate items in the segmentation candidate set, and sorting the segmentation candidate items by combining a priority screening rule; pruning the segmentation candidate items according to the sequence position co-occurrence relation of the word block set combination; carrying out secondary pruning on the division candidate items according to the length attribute of the intention matching template corresponding to the word block set combination; and screening out the segmentation mode of the user dialogue sentences with the highest priority, and outputting an intention matching template and intention information corresponding to the user dialogue sentences. The advantages are that: the recognition efficiency and the recognition accuracy of the conversation intention in the field of teenager chatting are high, and various complex application scenes can be met.

Description

Conversation intention identification method and device for teenager chat robot
Technical Field
The invention relates to the field of recognition of conversation intention of a chat robot, in particular to a conversation intention recognition method and device for a teenager chat robot.
Background
With the rapid development of natural language processing technology, the application of the chat robot is gradually popularized, teenagers are more and more emphasized as a rapidly growing group of internet application, and various voice interaction products aiming at the teenagers are rapidly emerged. In order to better improve the user experience of the chat conversation of teenagers, practically meet the requirement of troubling the teenagers on the chat pain points, conduct benign guidance on the thought behaviors and public opinion guidance of the teenagers, and how to accurately acquire the chat intention of the teenager users becomes a key point and a difficult point for the rapid popularization and application of the chat technology.
Traditional (rule engine) rule-based, regular match-based intent recognition, can target a user's conversational intent to a specified broad class; the following disadvantages exist in the development of the technology: A) aiming at stop words (tone words and harmonic words) in a search engine, the stop words are often directly filtered and eliminated, and the support degree of the stop words on some enthusiastic proper nouns and network new words of teenagers is poor; B) the problem of memory occupation explosion is easily triggered by one-time loading of a full amount of conversation sentences, and meanwhile, the efficiency is not high during traversal searching and regular matching searching, and the response delay is large; C) the requirement of extracting the slot position information in the latest dialog intention refining field and the application scene of multi-slot position information combination cannot be met;
the industry compares the fierce and is based on a plurality of training models represented by a theme model and based on machine learning and deep learning; the common characteristics of the models are that the models are based on one training of dialogue corpora, and show better intention recognition accuracy and self-learning, but the training of the models has very much uncertainty, the recognition effect of the same input in the repeated training process has certain volatility, the controllability of interpretability and the accuracy of the intention is difficult to guarantee, and the experience of case users who can not hit some models is not good enough, and a more accurate intention recognition scheme is needed to supplement and perfect;
because of their great curiosity and rapid acceptance of fresh things, the authors in "self-talking words" of teenagers, "published in 2010, indicated that their speech characteristics exhibited multiple characteristics, such as generalization, simplicity, ambiguity, novelty, specificity, etc. Some network new words spread rapidly among teenagers, such as 'top', 'stem', 'brocade carp', 'dish it', 'floating', and 'east', which basically do not accord with the analysis principle of traditional part of speech and sentence syntax; some expressions of Chinese mixed foreign languages and dialects, such as "you have something about Q me", "very much" in "with" printed "being English" in direct transliteration "representing" very fashionable "," me na all being northeast ", etc., need to have special rules and intentions to identify for solving; meanwhile, teenagers are the future of China, and the conversation chatting robot tool for education of the teenagers aims at providing positive guidance for surfing the Internet of the teenagers and showing healthy sunlight for the teenagers. The high importance requirements of education competent departments, extensive parents and teachers are to actively guide words which do not accord with the mainstream value, and the digital harmonic usage like 1314520, 5201314 and the like which expresses emotion is not advocated in the adolescent range, which puts higher requirements on the accuracy of intention recognition of the adolescent chat robot. In addition, the language words such as "qi", "ye", "ou", o ha "," kahum "are used frequently in the conversation, and include some language word stacks, which also appear in the text texts read by primary and secondary school students, such as" brook talk, swp ", often have special meanings in chat expression, and cannot be directly filtered by using the stop word list in the conventional participles. In the prior art document, the invention patent "model training method and device based on dialogue template", application number 201910144645.5, adopts a method of setting dialogue template according to information input by user, improves the training efficiency of dialogue model and reduces the training cost. However, the technical idea of the method, particularly in the field of teenager chat robots, can also encounter the following problems in application: 1) the same dialogue statement can hit a plurality of templates corresponding to intents completely at the same time, and the problem of sorting among different intents matched templates needs to be solved; 2) in the same dialogue statement, different segmentation and combination modes are considered, different positions of different intention matching templates can have common feature words, even under the condition of complete matching, exponential expansion can occur in the candidate combination mode in the matching process, and the recognition rate of the intention is influenced; 3) the same word may appear in multiple different dictionaries, and the same dictionary may appear in multiple templates with different intentions, resulting in waste of storage resources and confusion of configuration management.
Disclosure of Invention
The invention aims to provide a conversation intention identification method and a conversation intention identification device for a teenager chat robot, so as to solve the problems in the prior art.
In order to achieve the purpose, the technical scheme adopted by the invention is as follows:
a conversation intention recognition method for a teenager chat robot, the recognition method comprises the following steps,
s1, based on the combination of the word block sets, creating a plurality of intention matching templates which are added with length attributes and age stage priority attribute structures;
s2, segmenting the input user dialogue sentences to form segmentation candidate sets, performing priority screening on all segmentation candidate items in the segmentation candidate sets, and sorting the segmentation candidate items by combining with a priority screening rule; pruning the segmentation candidate items according to the sequence position co-occurrence relation of the word block set combination; carrying out secondary pruning on the division candidate items according to the length attribute of the intention matching template corresponding to the word block set combination; and screening out the segmentation mode of the user dialogue sentences with the highest priority, and outputting an intention matching template and intention information corresponding to the user dialogue sentences.
Preferably, step S1 includes,
s11, collecting dialogue corpora in teenager chatting, distinguishing and summarizing dialogue sentences according to different dialogue intents, and creating an intention knowledge base; each conversation intention has corresponding slot position information in the intention knowledge base;
s12, segmenting the spoken sentence according to the slot position information of the conversational intention and the occurrence frequency of characters, words and phrases in the conversational sentence to generate a series of word blocks of the characters, words or phrases;
s13, combining word block numbers corresponding to the word blocks, return value attribute numbers of the word blocks in the slot recognition of the meaning knowledge base, length attribute values and age stage priority attributes into a word block structure;
s14, merging the word block structures to generate a word block set;
s15, creating a plurality of intention matching templates for specific intention recognition by using the word block set.
Preferably, steps S130 to S133 are performed between step S12 and step S13;
s130, further numbering after the duplication of the word blocks is removed;
s131, counting all return value attributes of slot information in an intention knowledge base corresponding to each word block;
s132, sequentially judging whether each return value attribute of each word block is a slot position attribute, if so, setting the return value attribute as the attribute of the corresponding word block, and marking the attribute in a return value attribute list; if not, a return value attribute item with a null return value is added in the return value attribute list by default, and the return value attribute item is set as the attribute of the corresponding word block;
and S133, numbering the return value attributes.
Preferably, the merging method in step S14 is specifically to classify the word blocks according to different lengths, organize the word blocks with the same length and capable of being replaced with each other into a word block structure, and merge the word blocks to generate a series of word block sets; when the word block set is constructed, a simple defined basic word block set with few word blocks can be selected, then a plurality of basic word block sets form a composite word block set, and finally a series of word block sets with different word block numbers and with length attribute information are generated.
Preferably, in step S15, the number list of the word block set corresponding to the word block set, the mapping relationship between the return value attribute list of the word blocks in the word block set and the slot positions, the length attribute value, and the age-stage priority attribute are combined to form an intention matching template; each intention matching template comprises the precedence position co-occurrence relation of all word block sets forming the intention matching template in the process of forming a sequence list, word block return value attributes in the word block sets, length attribute values obtained by adding the lengths of all the word block sets and age-stage priority attributes, all the intention matching templates are subjected to unified numbering management, and the intention category numbers to which the intention matching templates belong are recorded.
Preferably, between step S1 and step S2,
loading the word blocks, the word block set, the intention matching template, the configuration information of the intention category and the correlation mapping relation among the word blocks, the word block set, the intention matching template and the intention category into a memory; specifically, a word block matching mode represented by a Trie tree system, particularly a Double Array Trie, is introduced, and the mapping relation between word blocks and word block numbers and the sequence position co-occurrence relation of the word block set combination in the intention matching template are all loaded into a storage structure of the Double Array Trie.
Preferably, step S2 specifically includes the following steps,
s21, carrying out text error correction preprocessing after voice recognition on the user dialogue sentences, extracting length check information of the user dialogue sentences as initial segmentation candidate items and adding the initial segmentation candidate items to a segmentation candidate item set;
s22, judging whether the segmentation candidate set is empty, if so, directly quitting the intention identification process; if not, go to step S23;
s23, extracting an optimal segmentation candidate item from the segmentation candidate item set according to the priority screening rule; performing primary prefix matching on the rest part which is not segmented by using a Double Array Trie loaded with all matching mapping information; finding out all possible prefix matching candidates for the rest un-segmented parts in all intention matching templates;
s24, combining all the identified possible prefix matching candidates with the parts which are recorded in the segmentation candidates and already subjected to prefix segmentation to obtain a new prefix segmentation combination; pruning the new prefix segmentation combination by utilizing the sequence position co-occurrence relation with the word block set in the intention matching template, and removing all invalid segmentation combination items which are not matched and hit with the intention matching template;
s25, carrying out comparison pruning on the new prefix segmentation combination by using the length attribute of the intention matching template and the length verification information of the dialogue statement, and eliminating all invalid segmentation combination items which cannot be matched and hit with the intention matching template;
s26, segmenting and combining the new prefixes, judging whether the corresponding legal candidate template set is empty or not, if yes, directly rejecting the template set, and returning to the step S22; if not, the new prefix segmentation combination is regarded as the current effective prefix segmentation combination, and S27 is executed;
s27, judging whether the segmentation is carried out to the tail part of the dialogue sentence, if so, directly hitting the segmentation item with the highest priority in the prefix segmentation combination which is newly generated at present, extracting a corresponding intention matching template, and returning an intention identification result; if not, adding the effective combination in the new prefix segmentation to the segmentation candidate set, and returning to the step S22.
Preferably, in step S2, the priority filtering rule is specifically,
a1, aiming at all segmentation candidates, carrying out hierarchical ordering of segmentation combination according to the number of segmentation times of word blocks from small to large, wherein the fewer the segmentation times, the higher the hierarchy is, the more the priority is;
a2, in the hierarchy of the same segmentation times, the longer the prefix, the more preferential the matching;
in step S2, the specific process of pruning the segmentation candidates according to the precedence position co-occurrence relationship of the word block set combination and performing secondary pruning on the segmentation candidates according to the length attribute of the intention matching template corresponding to the word block set combination is,
b1, pruning all segmentation candidate items according to the sequence position co-occurrence relation of the word block set combination, and eliminating the interference candidate items which do not accord with the sequence of the front and back combination;
and B2, checking and carrying out secondary pruning according to the length attribute information of the candidate intention matching template corresponding to the word block set combination, and eliminating the interference candidates of which the length attribute of the final intention matching template is not equal to the length of the dialogue statement.
Preferably, in step S27, after the score item with the highest priority in the prefix score combination newly generated at present is hit, if there are a plurality of corresponding intention matching templates, the age attribute of the user is matched with the age-stage priority attribute of each corresponding intention matching template, the intention matching template successfully matched is extracted, and the intention recognition result is returned.
The present invention also provides a dialog intention recognition apparatus for a teenager chat robot, which is capable of performing any one of the above-described dialog intention recognition methods for a teenager chat robot.
Preferably, the module of the identification device comprises,
the chat intention knowledge base is used for initializing the intention knowledge base in the initial operation stage of the device and configuring an intention matching template, and then regularly updating and maintaining the public intention identification module in the operation process of the device by combining the analysis of the chat conversation log, so as to perform benign guidance on the chat intention of the hot topic;
the input module of the chat conversation, the user can use the module to input the conversation sentence;
the dialogue input preprocessing module is used for performing text error correction preprocessing after voice recognition along with dialogue sentences input by a user;
the public intention identification module is used for identifying the intention of the dialogue sentences input by the user;
the personalized intention identification module is used for carrying out personalized customization on the conversation intention by the user according to personal preferences and habits;
the intention extraction and slot filling module is used for fusing intention template matching results of the public intention identification module and the personalized intention identification module and extracting intentions and filling slots;
the judging module is used for judging whether the intention matching template of the hit dialogue statement is unique;
the intention matching result output module is used for directly outputting a result if the judging module judges that the intention matching template of the hit dialogue statement is unique;
the display intention prompt guide module is used for selecting and confirming the user by adopting a display intention prompt method if the judgment module judges that the intention matching template of the hit dialogue sentence is not unique;
the chat conversation log recording module is used for collecting chat conversation records of the user;
and the chat conversation log analysis module is used for analyzing the collected chat conversation records of the user so as to generate and continuously perfect a chat intention knowledge base.
The invention has the beneficial effects that: 1. aiming at the chat conversation characteristics of teenagers, an improved and optimized solution is proposed aiming at the encountered problems, and the requirements of accuracy, controllability and efficiency of conversation intention recognition application in the field of teenager chat are met. 2. By combining with the unified coding of the word blocks, the word block set and the intention matching template, the double pruning is carried out by adopting the precedence position co-occurrence relation of the word block set combination and the length attribute limitation of the user dialogue sentence, the exponential expansion problem of possible candidate combinations needing to be distinguished in the process of matching the words and phrases with the intention matching template is effectively solved, and the matching efficiency is improved while the storage resources are saved. 3. A word block set management mode that a basic word block set is created first and then a composite word block set is created by combination of the basic word block set is provided, and combination requirements of various complex application scenes are met while word block cross-intention matching template multiplexing is supported. 4. By adding the screening rule of the conversation sentence segmentation candidate item priority, the configurable special requirement of controllable intention recognition of the teenager chat conversation intention is met. 5. The full matching after the segmentation of the dialog sentences is designed, so that the accuracy of intention recognition is effectively guaranteed, and a friendly customization scheme is provided for the simultaneous hit condition of multiple intents still existing after full matching.
Drawings
FIG. 1 is a flow chart illustrating an intent recognition method according to an embodiment of the present invention;
FIG. 2 is a flow chart of a method for creating an intent matching template according to an embodiment of the present invention;
FIG. 3 is a diagram illustrating correspondence between word blocks and slots in an intent knowledge base in an embodiment of the present invention;
FIG. 4 is a schematic flow chart illustrating the content executed between step S12 and step S13 in the embodiment of the present invention;
FIG. 5 is a flow chart illustrating matching of user dialog statements using an intent matching template in an embodiment of the present invention;
fig. 6 is a schematic structural diagram of an intention identifying 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 more apparent, the present invention is further described in detail below with reference to the accompanying drawings. It should be understood that the detailed description and specific examples, while indicating the invention, are intended for purposes of illustration only and are not intended to limit the scope of the invention.
Example one
As shown in fig. 1, the present embodiment provides a dialog intention recognition method for a teenager chat robot, the recognition method comprising the steps of,
s1, based on the combination of the word block sets, creating a plurality of intention matching templates which are added with length attributes and age stage priority attribute structures;
s2, segmenting the input user dialogue sentences to form segmentation candidate sets, performing priority screening on all segmentation candidate items in the segmentation candidate sets, and sorting the segmentation candidate items by combining with a priority screening rule; pruning the segmentation candidate items according to the sequence position co-occurrence relation of the word block set combination; carrying out secondary pruning on the division candidate items according to the length attribute of the intention matching template corresponding to the word block set combination; and screening out the segmentation mode of the user dialogue sentences with the highest priority, and outputting an intention matching template and intention information corresponding to the user dialogue sentences.
In this embodiment, as shown in fig. 2, step S1 includes,
s11, collecting dialogue corpora in teenager chatting, distinguishing and summarizing dialogue sentences according to different dialogue intents, and creating an intention knowledge base; each conversation intention has corresponding slot position information in the intention knowledge base;
s12, segmenting the spoken sentence according to the slot position information of the conversational intention and the occurrence frequency of characters, words and phrases in the conversational sentence to generate a series of word blocks of the characters, words or phrases;
s13, combining word block numbers corresponding to the word blocks, return value attribute numbers of the word blocks in the slot recognition of the meaning knowledge base, length attribute values and age stage priority attributes into a word block structure;
s14, merging the word block structures to generate a word block set;
s15, creating a plurality of intention matching templates for specific intention recognition by using the word block set.
Step S1 corresponds to the first step in the intention recognition method, specifically, the dialogue linguistic data of the teenager chat robot are collected, dialogue sentences are distinguished and summarized according to different dialogue intents, and an intention knowledge base is created; segmenting the spoken sentence according to the occurrence frequency of the intended slot information, words and phrases to generate a series of basic elements forming word blocks: words, phrases.
For example, in a conversation sentence of a teenager in a low age stage, the frequency of occurrence of the word "Malthus" is relatively high, and the Malthus "has a plurality of characteristics of both song names and flower names. Adding two intentions of 'playing songs' and 'recognizing plants' into an intention knowledge base, adding a 'Malan' into the intentions as intention slot words, respectively representing slot position information of a target song name and a flower name, and adding corresponding slot position attributes. In addition, the intention knowledge base in the above steps may be known to exist, or may be created and generated by continuously collecting the dialogue corpus of the teenager chat robot and differentiating and summarizing dialogue sentences according to different dialogue intents.
An example of the dialog sentence segmentation based on step S12 is as follows:
'Laohou/Malanhua'
'Laiyou' tea "
'Yiwensiwuxiqie/kalimeris/twenty-one'
'Malanhua/when/open'
The process operation is the basic operation of the intention rule matching, wherein the correspondence between the words, phrases and slots in the intention knowledge base can be seen in fig. 3.
As shown in fig. 4, steps S130 to S133 are performed between step S12 and step S13;
s130, further numbering after the duplication of the word blocks is removed;
s131, counting all return value attributes of slot information in an intention knowledge base corresponding to each word block;
s132, sequentially judging whether each return value attribute of each word block is a slot position attribute, if so, setting the return value attribute as the attribute of the corresponding word block, and marking the attribute in a return value attribute list; if not, a return value attribute item with a null return value is added in the return value attribute list by default, and the return value attribute item is set as the attribute of the corresponding word block;
and S133, numbering the return value attributes.
Specific examples of step S130 are as follows:
the number after deduplication is performed based on the example involved in step S12.
For the example, the first two sentences have obvious intention to listen to songs; the third sentences are the lyrics in the second song respectively and have implicit intention of listening to the songs; the fourth question concerns the flowering time of the maraca. The words are numbered after being de-duplicated, wherein,
p-1-gram includes a word of length 1: put (W)1_1) Am (W)1_2);
The P-2-gram includes a word block of length 2: a head (W)2_1);
The P-3-gram includes a word block of length 3: malan flower (W)3_1) Twenty one (W)3_2);
The P-4-gram includes a block of words of length 4: kalimeris indica (W)4_1) When (W)4_2);
The P-7-gram includes a word block of length 7: one, two, three, four, five, six, seven (W)7_1);
The word block with the attribute of the return value is marked as a word block structure WBi(ii) a The word block structure in step S13 is:
< word Block number, Return value Attribute number, Length Attribute value, [ age class priority Attribute ] >)
The age-stage priority attribute is an optional item, and is divided into four different age stages according to the mastery level and the sensitivity of the adolescent user to language in the different age stages, namely, the four stages of 0-2 years old, 3-5 years old, 6-11 years old and over 12 years old, aiming at application scenes that the same dialogue statement has different intention responses in the different age stages, when generating word blocks with the attribute, corresponding age-stage priority marks are added.
In the above example, the word "magnum" is used as a slot, and there are at least two different attributes: (1) the song name is 'Malanhua', (2) the flowering time of Malanhua: "4 months to 6 months"; "Malan flowering" is used as a slot, and at least one attribute, the name of song "Malan flowering", exists. Adding attributes to the "kalimeris indica" and "kalimeris indica blossoming" word blocks, and assigning corresponding numbers, such as:
number W3_1The first return attribute value of the word block 'Malanhan' is 'Malanha', and the number is W3_1Its collocation relationship with "Malan flower" is described as a word block with return value attribute<W3_1,W3_1,3>Length 3, marked as WB1
The second attribute value of "Malanhua" is flowering time "4 to 6 months", and is numbered W5_1Its collocation relationship with "Malan flower" is described as a word block with return value attribute<W3_1,W5_1,3>Length 3, marked as WB2
Number W4_1The first returned attribute value of the match word "kalanchoe blossoming" is "kalanchoe blossoming" numbered as W4_1Its collocation relationship with "kalanchoe blossoms" is described as a word block with return value attribute<W4_1,W4_1,4>Length 4, marked as WB3
Similarly, "twenty-one" is part of the lyrics, there is no return value for the slot in the example dialog, and one of the attributes is recorded as null, i.e., no return value. Such as:
number W3_2The first returned attribute value of the matching word "twenty-one" is null, and the number is marked as W0_1Its collocation relationship with "twenty-one" is described as a word block with return value attribute<W3_2,W0_1,3>Length 3, marked as WB4
According to the process, through numbering word blocks and attributes, repeated definition of the same words, such as the "kalanchoe odorata" and the "kalanchoe blossoms" in the above example, among a plurality of sentence templates is eliminated, and storage space is saved by using the numbers. (note that, in practical application, the number here may be a shorter number according to specific situations, and the length of the code is further optimized by means of huffman coding, etc.).
The merging method in step S14 is specifically to classify word blocks according to different lengths, organize word blocks with the same length and capable of being replaced with each other into a word block structure, and merge the word blocks to generate a series of word block sets. That is, each word block set contains a plurality of word blocks with the same length and return attribute and which can be replaced with each other, and the number of the word blocks in each word block set may be the same or different.
The composition and combination of the word block set meet three conditions:
1. all word block length attribute values in the word block set are the same;
2. all the word blocks in the word block set have the same attribute categories and can be replaced with each other at the same position of the dialogue statement;
3. if all the word blocks in the word block set have the age priority attribute, the age priority attribute has intersection.
Merging organized word block structures according to replaceability in conversation sentences aiming at word blocks with the same length to generate a series of word block sets; in consideration of eliminating the repeated condition of word blocks possibly existing among the word block sets, defining a simple basic word block set with few word blocks, and then combining the basic word block set to form a composite word block set; all the word blocks in each word block set are required to be equal in length, and the word block sets are provided with length attributes.
A basic word block set may be composed of word block structures corresponding to one or more word blocks, or a basic word block set may be combined to generate a composite word block set. The compound word block sets can be further combined into a compound word block set containing more word blocks under the condition of satisfying combination and combination. Note that the set of word blocks has the same length attribute and age-stage preference attribute as all the word blocks it contains.
For example, "kalan" in the above exampleWhen flowers bloom, the "Malan flower" word block structure WB2Without age limitation, the Chinese character can be independently used as a simple Word Block Set Word-Block-Set { WB2Denoted as WBS1The method can also further form a composite word block set WBS with other flower names of flowers with return value attribute categories of flowering time and same length attribute values, such as morning glory and violet2
And combining the word blocks and the coding systems of the attributes, and adding age stage supplementary information for the word blocks with the return values. When the low-level p-n-grams are accumulated to a certain degree, the high-level p-n-grams can be split, and the high-level p-n-grams can be directly split into a plurality of serial number combinations of the low-level p-n-grams. For example, when "kalan" is numbered W2_2"flowering" is numbered W2_3When the Chinese kalanchoe blossoming word block can be directly mapped into the number combination of the two word blocks<W2_2,W2_3>。
In this embodiment, step S15 is to use the word block set to create an intention matching template for specific intention identification, specifically, to combine a number list of the word block set corresponding to the word block set, a mapping relationship between a return value attribute list of the word blocks in the word block set and slot positions, a length attribute value, and an age-stage priority attribute into the intention matching template; each intention matching template comprises the precedence position co-occurrence relation of all word block sets forming the intention matching template in the process of forming a sequence list, word block return value attributes in the word block sets, length attribute values obtained by adding the lengths of all the word block sets and age-stage priority attributes, all the intention matching templates are subjected to unified numbering management, and the intention category numbers to which the intention matching templates belong are recorded.
The composition rule of the intention matching template is Ti:<A list of the numbers of the word block sets, a mapping relationship between the list of the return values of the word block sets and the slot positions, a length attribute value, [ age-stage priority attribute ]]>(ii) a The return value structure of the intent matching template is:<figure number IiSlot _ map { key: value } set of key-value pairs for slots>(ii) a In defining intent matching templates, non-nulls exist when there are multiple sets of word blocksWhen the value attribute is returned, the mapping relationship from the returned value of the word block set to the value of the intention slot has various types, for example, matching in sequence, taking intersection, corresponding according to a specified sequencing rule, and the like, and a user can also define some mapping rules by self.
Specific to "put kalanchoe blossoming" in the above example, the goal intent is "play song" (intent number I)1) The intent is that there is a slot: id of the target song. Wherein the content of the first and second substances,
a composite word block set composed of word blocks such as "play" and "listen" and "play", and is denoted as WBS3The length attribute is 1, and the return value attributes are all null;
the word block set composed of "one head" and word blocks such as "one branch" and "one song" is marked as WBS4The length attribute is 2, and the return value attributes are all null;
the compound word block set composed of "kalanchoe blossoms" and other four-character songbook song names is marked as WBS5The length attribute is 4, and the return value attribute is a target song id corresponding to each song;
an example of a final template is T1:<WBS3;WBS4;WBS5,(WBS5Return value of-id of target song), 7, [ age-stage priority attribute]>。
Through the process from step S11 to step S15, the configuration information and the number of all candidate words, word blocks, word block sets, templates have been obtained.
In order to facilitate rapid recognition matching of multiple candidates for the word block of the same prefix, the following is performed between step S1 and step S2,
loading the word blocks, the word block set, the intention matching template, the configuration information of the intention category and the correlation mapping relation of the word blocks, the word block set, the intention matching template and the intention category into a memory; and introducing a word block matching mode represented by a Trie tree system, particularly a Double Array Trie, and loading all the mapping relation between the word blocks and the word block numbers and the sequence position co-occurrence relation of the word block set combination in the intention matching template into a storage structure of the Double Array Trie. The step is detailed in the concrete implementation as the following steps:
s200, loading the unified numbers of the word block set, the intention matching template and the intention category in the step S1 to finish the loading of the information of the word block set, the intention matching template and the intention category;
s201, loading a mapping relation from a word block to a word block number in a word block to a Double Array Trie, and performing prefix segmentation on a dialogue word and a dialogue sentence input by a user;
s202, summarizing a plurality of intention matching templates under the same intention category, and loading mapping relations between word blocks and word block sets, between word block sets and intention matching templates and between intention matching templates and intention categories; summarizing and loading the mapping relation from the word block number to the combination set of the < belonging intention category number and the belonging word block set number >;
s203, loading the precedence position co-occurrence relation of the word block sets in each template contained in the intention category to a Double ArrayTrie, and judging pruning by using the precedence position co-occurrence relation of the word block sets while performing segmentation matching on the word blocks;
step S201 is embodied in this example, and the word blocks "put", "one head", "kalanchoe blossoming" and the corresponding word block numbers (W)1_1、W2_1、W3_1、W4_1) The mapping relation of (2) is loaded into the Double Array Trie and is marked as W-ID-DAT. In the process of matching and segmenting conversation sentences, W-ID-DAT can be used for quickly matching prefixes of target conversation sentences, and a word block segmentation mode capable of being matched is judged and identified;
step S202 is to number the intention category IiAnd loading the mapping relation of the plurality of intention matching template numbers contained in the intention into a dictionary, and marking as Intent-T-Set-MAP. The number of all intention matching templates under the intention can be quickly searched out through the intention type number, and then whether the length attribute information of each intention matching template is matched with the target dialogue statement or not is extracted and judged, and the pruning of the length attribute of the intention matching template is carried out. In the embodiment, the intention of listening to songs is numbered I1Number T of template matched with intention1Added into the Intent-T-Set-MAP.
The word blocks are combined into a word block set, the word block set is combined into an intention template, and one or more intention matching templates are contained in a single intention category. In order to facilitate quick retrieval when the target dialogue sentence is segmented and judged, a word block SET in a template matching the single word block and the intention and one-to-many relation between the single word block and the intention category are summarized and characterized into the following dictionary structure which is marked as W-I-WBS-SET-MAP:
word Block number, Set { < intention number, number of word Block Set to which word Block belongs > } >
By means of the structure, after the W-ID-DAT completes the segmentation of the word block once, the intention category possibly corresponding to the word block number and the number of the word block set to which the word block number belongs when the intention matching template is formed under the intention category can be extracted quickly.
Step S202 is embodied in the present example as WBS to which "Malan blossom" word block belongs5A set of word blocks, in the "Play Song" intent category, is an intent matching template T1Component of the contained word block set list. The mapping relationship is expressed as:<W4_1,Set{<T1,WBS5>}>
step S203 is embodied in this example by combining the intention category number with the list of numbers of word block set numbers in the template under the intention category in the form of simple delimiters. The combined sequence of data is as follows:
< intention category number; word Block set number 1, word Block set number 2, word Block set number 3 … … >
T in this example1The loading data of the precedence position co-occurrence relation of the word block set is as follows:<I1;WBS3:WBS4:WBS5>
the data sequence structure clearly represents that under a certain intention category, an intention matching template which is arranged by the following word block set sequence in strict sequence position order exists. The data combination structure is loaded into a Double Array Trie and is recorded as T-WBS-ORDER-DAT, the data combination structure can be used in cooperation with the data structure defined in the step S202, and the problems of judgment and pruning of whether the matching intention matching template can be found in the intention template library or not by repeatedly segmenting front and back in the word block segmentation process are solved.
In this embodiment, as shown in fig. 5, the specific matching process of the user dialog sentences is step S2, step S2 specifically includes the following contents,
s21, carrying out text error correction preprocessing after voice recognition on the user dialogue sentences, extracting length check information of the user dialogue sentences as initial segmentation candidate items and adding the initial segmentation candidate items to a segmentation candidate item set;
s22, judging whether the segmentation candidate set is empty, if so, directly quitting the intention identification process; if not, go to step S23;
s23, extracting an optimal segmentation candidate item from the segmentation candidate item set according to the priority screening rule; performing primary prefix matching on the rest part which is not segmented by using a Double Array Trie loaded with all matching mapping information; finding out all possible prefix matching candidates for the rest un-segmented parts in all intention matching templates;
s24, combining all the identified possible prefix matching candidates with the parts which are recorded in the segmentation candidates and already subjected to prefix segmentation to obtain a new prefix segmentation combination; pruning the new prefix segmentation combination by utilizing the sequence position co-occurrence relation with the word block set in the intention matching template, and removing all invalid segmentation combination items which are not matched and hit with the intention matching template;
s25, carrying out comparison pruning on the new prefix segmentation combination by using the length attribute of the intention matching template and the length verification information of the dialogue statement, and eliminating all invalid segmentation combination items which cannot be matched and hit with the intention matching template;
s26, segmenting and combining the new prefixes, judging whether the corresponding legal candidate template set is empty or not, if yes, directly rejecting the template set, and returning to the step S22; if not, the new prefix segmentation combination is regarded as the current effective prefix segmentation combination, and S27 is executed;
s27, judging whether the segmentation is carried out to the tail part of the dialogue sentence, if so, directly hitting the segmentation item with the highest priority in the prefix segmentation combination which is newly generated at present, extracting a corresponding intention matching template, and returning an intention identification result; if not, adding the effective combination in the new prefix segmentation to the segmentation candidate set, and returning to the step S22.
The computational complexity of matching and pruning using existing intent templates is relatively high. Taking the dialog sentence "one, two, three, five, six, seven, kalanchoe blossoming twenty one" with the length of 14 as an example, when all segmentations are matched, the number of combined template candidates is likely to be very large because the common words in the appearing words are many. Conversational utterances of length N, having
Figure BDA0002440448010000151
(wherein, C0=1,C11) cutting mode; specifically, for each segmentation mode, especially for some fine segmentation modes, if the candidate word block sets corresponding to the cut words are judged one by one, the times needing to be judged are rapidly expanded in a factorial mode.
In the practical application of the juvenile chat conversation, the matching process can be optimized through the preprocessing and pruning strategies of some data, and one or more intentions with the highest priority can be screened out relatively quickly. That is, in the actual matching process of the dialogue sentences, all the occurring intention matching templates need to be quickly matched and pruned so as to quickly acquire the intention matching templates matched with the dialogue sentences;
in step S2, the priority filtering rule is specifically,
a1, aiming at all segmentation candidates, carrying out hierarchical ordering of segmentation combination according to the number of segmentation times of word blocks from small to large, wherein the fewer the segmentation times, the higher the hierarchy is, the more the priority is;
a2, in the hierarchy of the same segmentation times, the longer the prefix, the more preferential the matching;
in step S2, the specific process of pruning the segmentation candidates according to the precedence position co-occurrence relationship of the word block set combination and performing secondary pruning on the segmentation candidates according to the length attribute of the intention matching template corresponding to the word block set combination is,
b1, pruning all segmentation candidate items according to the sequence position co-occurrence relation of the word block set combination, and eliminating the interference candidate items which do not accord with the sequence of the front and back combination;
and B2, checking and carrying out secondary pruning according to the length attribute information of the candidate intention matching template corresponding to the word block set combination, and eliminating the interference candidates of which the length attribute of the final intention matching template is not equal to the length of the dialogue statement.
The key in the steps B1 and B2 is to judge whether the template set is intersected through the inspection information and whether valid candidate template matching items still exist after the intersection of the set is judged. The concrete expression is as follows:
Figure BDA0002440448010000152
wherein the content of the first and second substances,
Figure BDA0002440448010000153
and the template set which represents all valid matches with the length attribute len, which can be matched from the ith prefix segmentation to the jth prefix segmentation.
Figure BDA0002440448010000154
And the template set which represents the effective matching that the word block set ID corresponding to the word block cut out by the m-th segmentation appears at the n-th sequence position in the ID list of the word block set in the template and has the length attribute of len.
Specifically, the example "two, three, five, six, seven kalimeris blossoming twenty one" is a lyric of seven characters in two upper and lower sentences, and the lyric can be multiplexed with the lyric numbered as W4_1The 'kalanchoe blossoming' word block, 'two, three, four, five, seven' and 'twenty-one' are common phrase combinations, the dialogue sentence is segmented into three word blocks when the word blocks are divided, the 'two, three, four, five, seven, kalanchoe blossoming/twenty-one' is carried out, then coding of the word block set and intention matching template configuration are carried out, and the template length attribute is 14.
In the actual matching process, the Double Array Trie can identify all word blocks capable of prefix hit at one time. For example, in the dialog sentence in the example, the word blocks containing the following matching words may be matched first, and the word blocks are sorted in the order of priority from large to small according to the priority screening rule of the segmentation candidate items:
'one, two, three, four, five, six, seven'
'one, two, three, four, five, six'
'one, two, three, four and five'
'one, two, three and four'
'Yidiansan' for curing diabetes "
'one is'
'one'
The more segmentation of the same conversational sentence word block leads to the shorter length of a single word block, the more word block sets and template candidates which may appear and match the single word block, the more possible candidate templates which need to be judged and screened are increased in a factorial level, and the intention matching efficiency is seriously influenced. In practical application, the longer the continuous character combination information in the user dialogue sentence is, the smaller the defined information range is, and the more obvious and accurate the chatting intention is; for example, in the present example, when a dialog sentence with a length of 14 starting with "one, two, three, five, six and seven" is matched, the expressed information is not only accurate but also beneficial to quick understanding, compared with a dialog sentence with a length of 14 starting with "one". Word blocks specific to length, such as numbered W7_1The storage of the 'one, two, three, four, five, six and seven' can be realized by only sequentially recording the sub-word block numbers of the short words forming the phrase, and the effect of reducing repeated storage of word blocks and characters is achieved by mapping the numbers of the sub-word blocks into the sequential combination of the corresponding short word blocks.
In the present embodiment, in steps S23 to S26, the segmentation candidates of the mentioned word block are generated by prefix matching of the W-ID-DAT structure to the target dialogue sentence in step S201; the length attribute information of the template is obtained by the W-I-WBS-SET-MAP structure in step S202 by first extracting the intention category number and the word block SET number corresponding to the word block, and then querying the length attribute information of all intention matching templates containing the target word block SET number under the intention category; the mentioned precedence position co-occurrence relation of the word block set combination is continuously generated by the segmentation candidate item set and the word block combination generated by new segmentation in the segmentation process of the word blocks, preliminary pruning judgment can be carried out by calculating whether intersection exists between the intention category sets corresponding to the previous and next word blocks in the combination process, after the range of the candidate intention categories is reduced, template hit matching judgment pruning is finally carried out by the T-WBS-ORDER-DAT structure in the step S203.
In this embodiment, in step S27, after the highest-priority segmentation item in the prefix segmentation combination newly generated at present is hit, if there are a plurality of corresponding intention matching templates, the age attribute of the user is matched with the age-stage priority attribute of each corresponding intention matching template, the successfully matched intention matching template is extracted, and an intention identification result is returned. That is, special processing needs to be performed on the condition that multiple candidate intents are hit in the same block combination which cannot be distinguished based on the constraints of sorting and screening; for example, the song named "mallow" is not just one songgua, and the recently popular "mallow" of Tengger's leader occupies the leaderboard of the search results of the songs "mallow" of the big song listening platforms in China. Considering that the children songs and popular songs are suitable for teenagers in different age stages, when defining word block composition, corresponding age stage priority attributes are attached to an original word block 'magna', return value attributes correspond to different song IDs, two new word blocks are generated to participate in template configuration of a word block set and an intention, and age stage priority attributes are attached to the word block set and the intention template generated by the new combination. And when the complete segmentation of the conversation sentence is completed and the corresponding template and the intention information are extracted, matching the age attribute of the user with the age-stage priority attribute of the template to extract an optimal intention result item. That is, in step S27, after the highest-priority segment in the prefix segment combination newly generated at present is hit, if there are a plurality of corresponding intention matching templates, the age attribute of the user is matched with the age-stage priority attribute of each corresponding intention matching template, the intention matching template that is successfully matched is extracted, and the intention recognition result is returned.
To facilitate rapid application of the intent recognition method, several points are additionally described. Firstly, the arrangement of constraint rules followed by sorting and screening aims to find a matching template of a conversation sentence by optimal segmentation as soon as possible, and factorial expansion of the number of candidate combination modes needing to be identified and judged due to too many segmentation blocks is reduced and avoided as much as possible; correspondingly, when the intention matching template is configured, the combinability of words in the target sentence is fully considered, and the number of word block sets, particularly single word block sets in the template composition is reduced as much as possible. A template configuration such as "one, three, four, five, six, seven, horse flowering/twenty one" in the example, although increasing the encoding of the phrase "one, three, four, five, six, seven, twenty one", its matching and pruning efficiencies will be significantly better than the template configuration corresponding to "one/two/three/four/five/six/seven/horse flowering/twenty one". Secondly, based on priority constraint rules followed by sequencing and screening, for different segmentation modes of the same conversation statement, the segmentation frequency is less, and the segmentation mode with longer prefix segmentation is matched and hit preferentially; for the situation that the same dialogue statement can be matched and hit with multiple intentions, the effect of preferentially hitting the designated intentions can be achieved by combining the composition of word blocks and adjusting the configuration of templates. And thirdly, in the matching process, the two steps of S24 and S25 relate to pruning according to the co-occurrence matching relation of the word block set and pruning according to the length check information, the purpose is to prune quickly, no obvious sequential relation limitation exists among the pruning, and the sequencing can be adjusted by combining with the actual situation in the actual application.
In this embodiment, for the intention identification method, an intention identification system architecture (identification device) may be provided to carry out the intention identification method, wherein the identification device includes the following constituent modules,
the chat intention knowledge base is used for initializing the intention knowledge base in the initial operation stage of the device and configuring an intention matching template, and then regularly updating and maintaining the public intention identification module in the operation process of the device by combining the analysis of the chat conversation log, so as to perform benign guidance on the chat intention of the hot topic;
the input module of the chat conversation, the user can use the module to input the conversation sentence;
the dialogue input preprocessing module is used for performing text error correction preprocessing after voice recognition along with dialogue sentences input by a user;
the public intention identification module is used for identifying the intention of the dialogue sentences input by the user;
the personalized intention identification module is used for carrying out personalized customization on the conversation intention by the user according to personal preferences and habits;
the intention extraction and slot filling module is used for fusing intention template matching results of the public intention identification module and the personalized intention identification module and extracting intentions and filling slots;
the judging module is used for judging whether the intention matching template of the hit dialogue statement is unique;
the intention matching result output module is used for directly outputting a result if the judging module judges that the intention matching template of the hit dialogue statement is unique;
the display intention prompt guide module is used for selecting and confirming the user by adopting a method of displaying intention prompt if the judgment module judges that the intention matching template of the hit dialogue sentence is not unique (for the situation that multiple intentions hit simultaneously under extreme conditions such as personalized repeated customization and the like);
the chat conversation log recording module is used for collecting chat conversation records of the user;
and the chat conversation log analysis module is used for analyzing the collected chat conversation records of the user so as to generate and continuously perfect a chat intention knowledge base.
That is, in order to satisfy the requirement of fully highlighting the personality of teenagers, the architecture design of the whole intention recognition has a public intention recognition module, and simultaneously adds a personalized intention recognition module with higher priority, so that the user is allowed to carry out personalized customization on conversation intention according to personal preference and habits. For the situation that multiple intentions are hit simultaneously under extreme conditions such as personalized repeated customization and the like, an intention display prompting method is adopted for a user to select and confirm; the chat conversation records of the users are collected, the public intention identification module is updated and maintained regularly, and the benign guidance is carried out on the chat intentions of some hot topics; as shown in fig. 6.
Example two
In this embodiment, the use process of the intention recognition method will be described in detail with reference to the network vocabulary commonly used by teenagers on the network, and "1314520" as an example.
In the embodiment, the conversation content expression forms of teenagers are rich, various and unique and creative, and the meanings of various network new words are also infinite. Generally, among the juvenile population, "1314520" is used to express that love between men and women is more emotional, often interpreted as "one life me love you"; early love is not advocated from the perspective of concern for juvenile education and healthy growth. If the teenager mentions "1314520" in the dialog, it is only the traditional character string containing match that is easy to lead to the direction of this undesirable intention in the intention recognition process; therefore, when the intention identification method is used, the common undesirable intentions (such as '1314520') are appropriately intervened and adjusted by combining the age priority attributes and the priority ranking rule of the intention matching template, and the direction of encouraging teenagers to avoid early love and concentrate on learning is guided.
Starting from the goal of benign guidance of chat intentions beneficial to the development of physical and mental health of teenagers, the intention identification process is specifically described by taking '1314520' as an example.
1. The '1314520' is cut once to construct two simple word block sets WBS10And WBS11;WBS10: containing the number W4_10A length-4 word block "1234" (where the word block may be generated from a simpler combination of word blocks); WBS11: contains the number W3_10A length of 3 words block "520"; return value attribute: containing the number W3_11The length is 3 word blocks "I love you".
2. Adding one (number of representation emotion class intention is I) in the system10Of) the template T10:<WBS10;WBS11,(W3_11) 7, [ age group priority attribute]>(by default, the age group preference attribute is null).
3. In the matching process, the matching is realized by the co-occurrence relation of the sequence positions of the word block sets and the length detection double pruning;
first, the Double Array Trie is used to load the mapping relation W-ID-DAT of < word, word block number > (such as "1234" in this example)>W4_10And "520>W3_10The mapping relationship of) and the sequential relationship of the word block sets in the intention matching template, T-WBS-ORDER-DAT (I is the intention type number in this example)2There is a valid template T under the intention category of10In which WBS10Word block set allows for a subsequent WBS11And a word block set, wherein the following data sequences are added:<I10;WBS10:WBS11>) (ii) a The recording form is as follows: last dictionary of word block number<Intention numbering, numbering of a set of word blocks to which a word block belongs>}>The mapping relation W-I-WBS-SET-MAP of the word block number to the intention number and the combination of the word block SET numbers to which the word block belongs (as in this example)<W3_10,Set{<I10,WBS11>}>) And loading the word blocks, the word block set, the intention matching template, the configuration information of the intention type and the correlation mapping relation among the word blocks, the word block set, the intention matching template and the intention type into a memory.
When a user inputs a dialogue statement, firstly, using a W-ID-DAT structure of Double Array Trie to carry out prefix matching with the input statement (see the attached figure 5);
for example, the user inputs "1314520", prefix matching, and the primary segmentation may have a plurality of possible segmentation modes, and is added to the segmentation candidate set:
13145
1314
131
13
1
from top to bottom, in each segmentation mode, the finer the segmentation is, the more the following candidate possible combination items are. The more decisions are made on the candidate set.
Then taking out the optimal '13145' prefix, continuing to match the rest '20' by using a W-ID-DAT structure, and finding out several continuous cutting modes;
performing pruning of co-occurrence of word block sets aiming at a front segmentation mode and a rear segmentation mode; firstly, the word block set corresponding to the '13145' and the word block set corresponding to the '20' segmentation are used, and T-Judging and pruning by combining WBS-ORDER-DAT with W-I-WBS-SET-MAP, finding that the word block SETs do not form a sequential co-occurrence relation when forming a template, and directly pruning; then extracting length check information from the template candidate set remaining after the pruning in the previous step through numbering, pruning for the second time, and removing all template candidate items which can not hit the sentences with the length of 7, and finally finding that a proper intent matching template input by hitting can not be found in the segmentation mode of 13145; then, taking out the candidate item "1314" with the next priority from the segmentation candidate set, and then carrying out dematching on the rest "520" by using a W-ID-DAT structure; obtaining a plurality of cutting modes; firstly, an optimal segmentation candidate item '520' is taken out for judgment, then co-occurrence pruning of the sequence of the word block SETs is carried out by sequentially combining the T-WBS-ORDER-DAT and the W-I-WBS-SET-MAP, then length check information pruning is carried out on the pruned candidate templates through the length attributes of the intention matching templates contained in the inquiry intention categories, and the T is found1The method can meet the requirement of checking information, and is segmented to the end of a dialogue statement, and finally, the result is directly returned to complete intention matching.
4. Establishing an individualized intention identification module according to the priority sorting rule and the age priority attribute of the intention matching template;
the priority ranking rule of the intention matching template is fundamentally different from a common exhaustion mode in that various template candidates are segmented by an internally agreed rule, the modes are naturally ordered in the aspect of matching hit sequence, the more the modes consume less resources and have more obvious intention, and the more the modes enter a judgment and pruning sequence in advance. For example, the segmentation of '1234/520' is a segmentation recommended for '1314520', when the system has a requirement for adjusting intentions, the purpose of priority of the intentions can be achieved by adding a template with higher priority (segmentation mode), other templates with the priority of the next level can be enabled to achieve the effect of priority hit by removing the intention template combined by the current segmentation mode, and the whole intention management meets the controllable and configurable requirement of teenager conversation intentions;
age priority attribute, in the same segmentation modeUnder the condition, for example, the segmentation of '1234/520' requires that the intention appearing in the age range of 6-11 years is distinguished from other age stages, and prompts children to 'good learning, upward every day'; a number W may be added to "5208_10The new attribute word block with the length of 8, good learning day-to-day, forms a new word block set WBS12: containing the number W3_10Length 3 word block "520", return value attribute: containing the number W8_10A new attribute word block with the length of 8, namely 'good learning heaven-day-up', can be added into the system (the number of the intention for characterizing learning class is I)11Of) a template: t is11:<WBS10;WBS12,(W8_10),7,[3]>(age stage priority attribute is 3, indicating a hit in the age range of 6 to 11 years).
The personalized intention identification module is used for specifically identifying each user individual, and the user can obtain intention control authority with higher priority than the public intention identification module by virtue of the personalized intention identification module. The name and nickname of the pet can be defined as individual intention word blocks, and an individual conversation intention matching template is customized for the pet; the individual requirements of 'all-in-one control' and 'unusual way' of the young are met.
5. The multiplexing of the coding of the word block (word, phrase) and the set of word blocks;
the following two cases are specific: 1314/520 and 520/1314; repeated definition of words in the template configuration process can be reduced through combination of codes of word blocks, and the purposes of optimizing memory occupation and improving service response efficiency are achieved. For example, a word block with a longer text such as "1314" may be further combined with word block numbers of shorter word blocks such as "13" and "14", and when a plurality of intention templates are hit in the same segmentation manner, a template with an age-stage priority attribute and matching with the user's age is hit preferentially.
In the embodiment, through the process, the intention matching method provided by the invention can meet the requirements of accuracy, controllability and efficiency of conversation intention recognition application in the field of teenager chatting for the characteristics of the teenager chatting conversation, can customize the personalized intention recognition module according to specific requirements, and meets the personalized requirements of young people.
By adopting the technical scheme disclosed by the invention, the following beneficial effects are obtained:
the invention provides a conversation intention recognition method and a device aiming at a teenager chat robot, aiming at the characteristics of chat conversation of teenagers, provides an improved and optimized solution for the problems encountered, and meets the requirements of accuracy, controllability and efficiency of conversation intention recognition application in the field of teenager chat; the intention identification method combines the unified coding of the word blocks, the word block set and the intention matching template, adopts the precedence position co-occurrence relation of the word block set combination and the length attribute limitation of the user dialogue sentences to carry out double pruning, effectively solves the exponential expansion problem of possible candidate combinations needing to be distinguished when the words and phrases are matched with the intention matching template, saves the storage resources and improves the matching efficiency; the intention recognition method provides a word block set management mode of firstly creating a basic word block set and then creating a composite word block set by the combination of the basic word block set, and meets the combination requirements of various complex application scenes while supporting the multiplexing of word blocks across intention matching templates; the intention recognition method meets the configurable special controllable intention recognition intention requirement of the teenager chat conversation by adding the priority screening rule of the conversation sentence segmentation candidate items; the intention recognition method is designed based on complete matching after segmentation of the dialogue sentences, so that the accuracy of intention recognition is effectively guaranteed, and a friendly customization scheme is provided for simultaneous hit conditions of multiple intents still existing after complete matching.
The foregoing is only a preferred embodiment of the present invention, and it should be noted that, for those skilled in the art, various modifications and improvements can be made without departing from the principle of the present invention, and such modifications and improvements should also be considered within the scope of the present invention.

Claims (11)

1. A conversation intention identification method aiming at a teenager chat robot is characterized in that: the identification method comprises the following steps of,
s1, based on the combination of the word block sets, creating a plurality of intention matching templates which are added with length attributes and age stage priority attribute structures;
s2, segmenting the input user dialogue sentences to form segmentation candidate sets, performing priority screening on all segmentation candidate items in the segmentation candidate sets, and sorting the segmentation candidate items by combining with a priority screening rule; pruning the segmentation candidate items according to the sequence position co-occurrence relation of the word block set combination; carrying out secondary pruning on the division candidate items according to the length attribute of the intention matching template corresponding to the word block set combination; and screening out the segmentation mode of the user dialogue sentences with the highest priority, and outputting an intention matching template and intention information corresponding to the user dialogue sentences.
2. The dialog intent recognition method for a teenager chat robot as claimed in claim 1, wherein: the step S1 includes the steps of,
s11, collecting dialogue corpora in teenager chatting, distinguishing and summarizing dialogue sentences according to different dialogue intents, and creating an intention knowledge base; each conversation intention has corresponding slot position information in the intention knowledge base;
s12, segmenting the spoken sentence according to the slot position information of the conversational intention and the occurrence frequency of characters, words and phrases in the conversational sentence to generate a series of word blocks of the characters, words or phrases;
s13, combining word block numbers corresponding to the word blocks, return value attribute numbers of the word blocks in the slot recognition of the meaning knowledge base, length attribute values and age stage priority attributes into a word block structure;
s14, merging the word block structures to generate a word block set;
s15, creating a plurality of intention matching templates for specific intention recognition by using the word block set.
3. The dialog intent recognition method for a teenager chat robot as claimed in claim 2, wherein: steps S130 to S133 are performed between step S12 and step S13;
s130, further numbering after the duplication of the word blocks is removed;
s131, counting all return value attributes of slot information in an intention knowledge base corresponding to each word block;
s132, sequentially judging whether each return value attribute of each word block is a slot position attribute, if so, setting the return value attribute as the attribute of the corresponding word block, and marking the attribute in a return value attribute list; if not, a return value attribute item with a null return value is added in the return value attribute list by default, and the return value attribute item is set as the attribute of the corresponding word block;
and S133, numbering the return value attributes.
4. The dialog intent recognition method for a teenager chat robot as claimed in claim 2, wherein: the merging method in step S14 is specifically to classify word blocks according to different lengths, organize word blocks with the same length and capable of being replaced with each other into a word block structure, and merge the word blocks to generate a series of word block sets; when the word block set is constructed, a simple defined basic word block set with few word blocks can be selected, then a plurality of basic word block sets form a composite word block set, and finally a series of word block sets with different word block numbers and with length attribute information are generated.
5. The dialog intent recognition method for a teenager chat robot as claimed in claim 2, wherein: step S15 is to combine the number list of the word block set corresponding to the word block set, the mapping relationship between the return value attribute list of the word blocks in the word block set and the slot positions, the length attribute value, and the age-stage priority attribute into an intention matching template; each intention matching template comprises the precedence position co-occurrence relation of all word block sets forming the intention matching template in the process of forming a sequence list, word block return value attributes in the word block sets, length attribute values obtained by adding the lengths of all the word block sets and age-stage priority attributes, all the intention matching templates are subjected to unified numbering management, and the intention category numbers to which the intention matching templates belong are recorded.
6. The dialog intent recognition method for a teenager chat robot as claimed in claim 5, wherein: between step S1 and step S2,
loading the word blocks, the word block set, the intention matching template, the configuration information of the intention category and the correlation mapping relation among the word blocks, the word block set, the intention matching template and the intention category into a memory; specifically, a word block matching mode represented by a Double Array Trie in a Trie tree system is introduced, and the mapping relation between word blocks and word block numbers and the sequence position co-occurrence relation of the word block set combination in the intention matching template are all loaded into a storage structure of the Double Array Trie.
7. The dialog intent recognition method for a teenager chat robot as claimed in claim 6, wherein: the step S2 specifically includes the following contents,
s21, carrying out text error correction preprocessing after voice recognition on the user dialogue sentences, extracting length check information of the user dialogue sentences as initial segmentation candidate items and adding the initial segmentation candidate items to a segmentation candidate item set;
s22, judging whether the segmentation candidate set is empty, if so, directly quitting the intention identification process; if not, go to step S23;
s23, extracting an optimal segmentation candidate item from the segmentation candidate item set according to the priority screening rule; performing primary prefix matching on the rest part which is not segmented by using a Double Array Trie loaded with all matching mapping information; finding out all possible prefix matching candidates for the rest un-segmented parts in all intention matching templates;
s24, combining all the identified possible prefix matching candidates with the parts which are recorded in the segmentation candidates and already subjected to prefix segmentation to obtain a new prefix segmentation combination; pruning the new prefix segmentation combination by utilizing the sequence position co-occurrence relation with the word block set in the intention matching template, and removing all invalid segmentation combination items which are not matched and hit with the intention matching template;
s25, carrying out comparison pruning on the new prefix segmentation combination by using the length attribute of the intention matching template and the length verification information of the dialogue statement, and eliminating all invalid segmentation combination items which cannot be matched and hit with the intention matching template;
s26, segmenting and combining the new prefixes, judging whether the corresponding legal candidate template set is empty or not, if yes, directly rejecting the template set, and returning to the step S22; if not, the new prefix segmentation combination is regarded as the current effective prefix segmentation combination, and S27 is executed;
s27, judging whether the segmentation is carried out to the tail part of the dialogue sentence, if so, directly hitting the segmentation item with the highest priority in the prefix segmentation combination which is newly generated at present, extracting a corresponding intention matching template, and returning an intention identification result; if not, adding the effective combination in the new prefix segmentation to the segmentation candidate set, and returning to the step S22.
8. The dialog intent recognition method for a teenager chat robot as claimed in claim 7, wherein: in step S2, the priority filtering rule is specifically,
a1, aiming at all segmentation candidates, carrying out hierarchical ordering of segmentation combination according to the number of segmentation times of word blocks from small to large, wherein the fewer the segmentation times, the higher the hierarchy is, the more the priority is;
a2, in the hierarchy of the same segmentation times, the longer the prefix, the more preferential the matching;
in step S2, the specific process of pruning the segmentation candidates according to the precedence position co-occurrence relationship of the word block set combination and performing secondary pruning on the segmentation candidates according to the length attribute of the intention matching template corresponding to the word block set combination is,
b1, pruning all segmentation candidate items according to the sequence position co-occurrence relation of the word block set combination, and eliminating the interference candidate items which do not accord with the sequence of the front and back combination;
and B2, checking and carrying out secondary pruning according to the length attribute information of the candidate intention matching template corresponding to the word block set combination, and eliminating the interference candidates of which the length attribute of the final intention matching template is not equal to the length of the dialogue statement.
9. The dialog intent recognition method for a teenager chat robot as claimed in claim 8, wherein: in step S27, after the highest-priority segmentation item in the prefix segmentation combination newly generated at present is hit, if there are a plurality of corresponding intention matching templates, the age attribute of the user is matched with the age-stage priority attribute of each corresponding intention matching template, the successfully matched intention matching template is extracted, and an intention identification result is returned.
10. A conversation intention recognition device for a teenager chat robot is characterized in that: the intention recognition apparatus is capable of performing the dialog intention recognition method for a teenager chat robot as set forth in any one of claims 1 to 9.
11. The dialog intent recognition device for a teenager chat robot of claim 10, wherein: the module of the identification device comprises the following components,
the chat intention knowledge base is used for initializing the intention knowledge base in the initial operation stage of the device and configuring an intention matching template, and then regularly updating and maintaining the public intention identification module in the operation process of the device by combining the analysis of the chat conversation log, so as to perform benign guidance on the chat intention of the hot topic;
the input module of the chat conversation, the user can use the module to input the conversation sentence;
the dialogue input preprocessing module is used for performing text error correction preprocessing after voice recognition along with dialogue sentences input by a user;
the public intention identification module is used for identifying the intention of the dialogue sentences input by the user;
the personalized intention identification module is used for carrying out personalized customization on the conversation intention by the user according to personal preferences and habits;
the intention extraction and slot filling module is used for fusing intention template matching results of the public intention identification module and the personalized intention identification module and extracting intentions and filling slots;
the judging module is used for judging whether the intention matching template of the hit dialogue statement is unique;
the intention matching result output module is used for directly outputting a result if the judging module judges that the intention matching template of the hit dialogue statement is unique;
the display intention prompt guide module is used for selecting and confirming the user by adopting a display intention prompt method if the judgment module judges that the intention matching template of the hit dialogue sentence is not unique;
the chat conversation log recording module is used for collecting chat conversation records of the user;
and the chat conversation log analysis module is used for analyzing the collected chat conversation records of the user so as to generate and continuously perfect a chat intention knowledge base.
CN202010263813.5A 2020-04-07 2020-04-07 Conversation intention identification method and device for teenager chat robot Active CN111460123B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010263813.5A CN111460123B (en) 2020-04-07 2020-04-07 Conversation intention identification method and device for teenager chat robot

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010263813.5A CN111460123B (en) 2020-04-07 2020-04-07 Conversation intention identification method and device for teenager chat robot

Publications (2)

Publication Number Publication Date
CN111460123A CN111460123A (en) 2020-07-28
CN111460123B true CN111460123B (en) 2020-10-20

Family

ID=71682483

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010263813.5A Active CN111460123B (en) 2020-04-07 2020-04-07 Conversation intention identification method and device for teenager chat robot

Country Status (1)

Country Link
CN (1) CN111460123B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111968636B (en) * 2020-08-10 2021-11-12 湖北亿咖通科技有限公司 Method for processing voice request text and computer storage medium
CN112395885B (en) * 2020-11-27 2024-01-26 安徽迪科数金科技有限公司 Short text semantic understanding template generation method, semantic understanding processing method and device
CN113515611B (en) * 2021-06-22 2022-04-26 镁佳(北京)科技有限公司 Intention recognition method and recognition system for task type multi-intention conversation

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107045496A (en) * 2017-04-19 2017-08-15 畅捷通信息技术股份有限公司 The error correction method and error correction device of text after speech recognition
CN108363690A (en) * 2018-02-08 2018-08-03 北京十三科技有限公司 Dialog semantics Intention Anticipation method based on neural network and learning training method
CN108427722A (en) * 2018-02-09 2018-08-21 卫盈联信息技术(深圳)有限公司 intelligent interactive method, electronic device and storage medium
CN109271498A (en) * 2018-09-14 2019-01-25 南京七奇智能科技有限公司 The natural language interaction method and system of Virtual robot
CN110287283A (en) * 2019-05-22 2019-09-27 中国平安财产保险股份有限公司 Intent model training method, intension recognizing method, device, equipment and medium
CN110386144A (en) * 2019-06-19 2019-10-29 长安大学 The GHMM/GGAP-RBF mixed model and discrimination method that a kind of pair of driver's braking intention is recognized
CN110489566A (en) * 2019-08-22 2019-11-22 上海软中信息系统咨询有限公司 A kind of hospital guide's method of intelligence hospital guide's service robot

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104050256B (en) * 2014-06-13 2017-05-24 西安蒜泥电子科技有限责任公司 Initiative study-based questioning and answering method and questioning and answering system adopting initiative study-based questioning and answering method
CN107766511A (en) * 2017-10-23 2018-03-06 深圳市前海众兴电子商务有限公司 Intelligent answer method, terminal and storage medium
US11819424B2 (en) * 2018-09-24 2023-11-21 Simplify Medical Pty Ltd Robot assisted intervertebral disc prosthesis selection and implantation system

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107045496A (en) * 2017-04-19 2017-08-15 畅捷通信息技术股份有限公司 The error correction method and error correction device of text after speech recognition
CN108363690A (en) * 2018-02-08 2018-08-03 北京十三科技有限公司 Dialog semantics Intention Anticipation method based on neural network and learning training method
CN108427722A (en) * 2018-02-09 2018-08-21 卫盈联信息技术(深圳)有限公司 intelligent interactive method, electronic device and storage medium
CN109271498A (en) * 2018-09-14 2019-01-25 南京七奇智能科技有限公司 The natural language interaction method and system of Virtual robot
CN110287283A (en) * 2019-05-22 2019-09-27 中国平安财产保险股份有限公司 Intent model training method, intension recognizing method, device, equipment and medium
CN110386144A (en) * 2019-06-19 2019-10-29 长安大学 The GHMM/GGAP-RBF mixed model and discrimination method that a kind of pair of driver's braking intention is recognized
CN110489566A (en) * 2019-08-22 2019-11-22 上海软中信息系统咨询有限公司 A kind of hospital guide's method of intelligence hospital guide's service robot

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
人工智能教师的未来角色;余胜泉;《开放教育研究》;20180205;16-28 *
涉罪未成年人心理辅导智能化前瞻;杨天琪等;《青少年犯罪问题》;20190720;64-72 *

Also Published As

Publication number Publication date
CN111460123A (en) 2020-07-28

Similar Documents

Publication Publication Date Title
US7925506B2 (en) Speech recognition accuracy via concept to keyword mapping
CN111460123B (en) Conversation intention identification method and device for teenager chat robot
EP1800294B1 (en) System and methods for improving accuracy of speech recognition
CN105957518B (en) A kind of method of Mongol large vocabulary continuous speech recognition
KR100533810B1 (en) Semi-Automatic Construction Method for Knowledge of Encyclopedia Question Answering System
CN107741928A (en) A kind of method to text error correction after speech recognition based on field identification
CN102549652B (en) Information retrieving apparatus
CN109635295B (en) Poetry retrieval method and system based on semantic analysis
CN109979257B (en) Method for performing accurate splitting operation correction based on English reading automatic scoring
CN106294460A (en) A kind of Chinese speech keyword retrieval method based on word and word Hybrid language model
Claes Cognitive, Social, and Individual Constraints on Linguistic Variation: A Case Study of Presentational'Haber'Pluralization in Caribbean Spanish
CA2880554C (en) System and methods for improving accuracy of speech recognition
CN111489742B (en) Acoustic model training method, voice recognition device and electronic equipment
CN101436179A (en) Method and apparatus for converting text
Amezian et al. Training an LSTM-based Seq2Seq Model on a Moroccan Biscript Lexicon
Nanmalar et al. Literary and Colloquial Tamil Dialect Identification
KR102506706B1 (en) Terminal for building machine learning data and artificial intelligence based system of detecting emotion using bio tagging data
Kurimo et al. To recover from speech recognition errors in spoken document retrieval.
CN114333788A (en) Voice recognition correction method and system based on user intention analysis
Safari et al. Data augmentation and preparation process of PerInfEx: a Persian chatbot with the ability of information extraction
Muhr et al. The Pronouncing Dictionary of Austrian German (AGPD) and the Austrian Phonetic Database (ADABA): Report on a large Phonetic Resources Database of the three Major Varieties of German.
Gregersen The History of Variationist Germanic Linguistics
Esteve et al. Dynamic selection of language models in a dialogue system.
Thirion et al. The South African directory enquiries (SADE) name corpus
Almeman Reducing out-of-vocabulary in morphology to improve the accuracy in Arabic dialects speech recognition

Legal Events

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