WO2020019686A1 - Session interaction method and apparatus - Google Patents

Session interaction method and apparatus Download PDF

Info

Publication number
WO2020019686A1
WO2020019686A1 PCT/CN2019/071301 CN2019071301W WO2020019686A1 WO 2020019686 A1 WO2020019686 A1 WO 2020019686A1 CN 2019071301 W CN2019071301 W CN 2019071301W WO 2020019686 A1 WO2020019686 A1 WO 2020019686A1
Authority
WO
WIPO (PCT)
Prior art keywords
information
user
intent
sentence
intention
Prior art date
Application number
PCT/CN2019/071301
Other languages
French (fr)
Chinese (zh)
Inventor
周建华
武文杰
陈少昂
孙谷飞
丁薛
邓永庆
王德锋
桑聪聪
杨少文
Original Assignee
众安信息技术服务有限公司
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 众安信息技术服务有限公司 filed Critical 众安信息技术服务有限公司
Publication of WO2020019686A1 publication Critical patent/WO2020019686A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/30Semantic analysis
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/279Recognition of textual entities
    • G06F40/289Phrasal analysis, e.g. finite state techniques or chunking
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/08Insurance

Definitions

  • the present invention relates to the field of computer technology, and in particular, to a method and a device for session interaction.
  • the existing human-machine multi-round conversation method technical solutions are based on the user question and the standard requirements included in the requirement structure tree to map, so as to output the standard requirement content of the hit leaf nodes.
  • This solution has shortcomings in flexibility and accuracy, cannot support flexible jumps and calls between multiple conversation processes, and dynamically updated corpus templates in real time, which makes interaction in some scenarios difficult to achieve, and the intention The accuracy of the matching model is low.
  • the conversation includes not only the user's user portrait but also user related users' portraits, such as customers, referees, Beneficiaries, etc.
  • the technical problem solved by the present invention is to provide a conversation interaction method and device that can more accurately guide customer consultation.
  • one aspect of the present invention provides a method for session interaction, which includes the following steps: obtaining a user sentence; determining whether the user sentence contains a conventional question; and if so, calling a routine corresponding to the conventional question in a database Answer and output; if not, determine whether the user statement contains intent, and if so, retrieve and output the conversation flow corresponding to the intent in the database.
  • the inventor in this technical solution uses two rounds of intent judgment to identify the intentions in the user sentence, and makes corresponding outputs respectively, so that the user's intent can be accurately identified, and the customer can be more accurately guided to complete the consultation and follow-up Services.
  • the two intent judgments are used to determine whether the user statement directly contains the existing problems in the database, and to determine whether the user statement implies a specific intention, so as to prevent the user from missing a specific intention type and reduce the probability of recognition errors. To improve the comprehensiveness and accuracy of identification.
  • the method further includes: if not, inferring the intention according to the user sentence; judging whether the value obtained in the intent guessing is greater than a preset threshold; if yes, calling and outputting a conversation flow corresponding to the intent in the database.
  • the manner of the second intent judgment includes two steps, namely, determining whether the user sentence contains the intention, and intent guessing; determining whether the user sentence contains the intention means judgment. Whether the user statement directly includes intent types, such as "car insurance” and "insurance”, and then conducts multiple rounds of conversation according to the intent type; and if the user statement does not directly include these intent types.
  • the inventor further provides an intent-guessing step in this technical solution to further determine whether the user sentence contains an intent type implicitly. For example, "how long can the car be guaranteed", it may point to the "auto insurance” intent type.
  • determining whether the user sentence contains a conventional question includes: performing text processing on the obtained user sentence, and determining whether the user sentence contains a conventional question according to a result of the text processing.
  • the manner of text processing includes text segmentation.
  • the pre-processing step for judging a user sentence includes performing text processing on the user sentence, which can more conveniently perform processing and subsequent recognition judgment, and improve the efficiency and accuracy of recognition.
  • the user sentence includes entity information; the entity information includes one or more of the following: sentence vector information for training and compiling a sequence of word vectors; general entity information for representing general information; industry entity information , Used to represent industry-related information.
  • the user sentence includes entity information to distinguish and judge, and the entity information includes sentence vector information, general entity information, and industry entity information.
  • entity information includes sentence vector information, general entity information, and industry entity information.
  • sentence vector information could be "I have a car accident in Shanghai today. May I ask if the car's off-site auto insurance claim process is the same as the local one?";
  • general entity information can be "today” and “Shanghai” and other time and place information;
  • the industry Entity information can be industry information such as "auto” and "auto insurance”.
  • the user sentence further includes user portrait information, which is used to represent user personal and social relationship information.
  • the system can obtain the user's social relationship by obtaining the user portrait information appearing in the user sentence multiple times.
  • This method can refer to the construction method of the character relationship map in the prior art, or refer to the following Creative way of acquisition designed by the inventor.
  • the system can further improve the session interaction construction of the database based on the user portrait information, so as to further accurately determine the user's intention and implement subsequent information push.
  • the user portrait information includes one or more of personal identification information, personal attribute information, and social relationship information.
  • the method for obtaining user portrait information specifically includes: performing an association calculation on a user sentence to obtain an association relationship, and obtaining the user sentence.
  • the syntactic dependency relationship and dependency structure are extracted, and the personal identification information, personal attribute information, and social relationship information are extracted based on the association relationship for triple-item iterative learning to obtain a user portrait knowledge map.
  • the obtained data structure has a strong network relationship, and it is necessary to obtain or retrieve other relevant node attributes, so that it can be more Accurately obtain the user portrait knowledge map, that is, the character relationship map above.
  • the specific way of performing association calculation on the user sentence is: associating calculation through the POS-CBOW method and improved Word2vec.
  • association calculation is performed by the POS-CBOW method and improved Word2vec. Because the entity attributes and entity distribution are integrated, the technical effect of extracting entity associations can be achieved.
  • the data sets are matched. If there are corresponding general questions in the FAQ data set, the general answers corresponding to the general questions are output.
  • the FAQ data set refers to a database including general questions and general answers as opposed to conventional questions.
  • a conventional question is, for example, "How much is a car insurance a year?", And the corresponding conventional answer may be "4,000 yuan”.
  • Matching the sentence vector information, general entity information, and industry entity information obtained from user sentences in the FAQ data set can accurately match the database and improve the matching efficiency.
  • matching the stitching matrix of sentence vector information, general entity information, and industry entity information to the FAQ data set includes: replacing the general entity information and industry entity information in the stitching matrix with the encoding of the top-level entity, and then Match with the FAQ dataset.
  • replacing the general entity information and industry entity information with the encoding of the top-level entity can more fully match the content of the data set, such as replacing "private car” with "car” , It is replaced by the encoding of the upper layer entity, which can further accurately identify the matching question and the answer corresponding to the question.
  • determining whether the user sentence includes an intention includes: performing a text classification through a CNN model to obtain the intention according to a stitching matrix of entity information and user portrait information.
  • the specific process of the above process is: in an independent sentence S ⁇ R nk of the user session, represented by a k-dimensional vector of n words, and encoding the corresponding information of the entity and the user portrait into a dictionary In Word2vec, the word vector X i ⁇ R k is obtained after segmentation and de-stopping. Then the independent sentence can be expressed as: Represents the connection of the word vector X i .
  • the feature information is mined using the N-Gram form of independent sentences.
  • the CNN model is used to define the text convolution kernel W ⁇ R lk (where the convolution length is L).
  • the largest one-dimensional feature vector is stored as feature information, and the n-dimensional vector is obtained from n convolutions and mapped into a global feature vector of a fixed length.
  • a fully-linked layer is established, which is mapped to the h-dimensional intent space.
  • the binary cross-entropy loss function is optimized through supervised learning, and the probability output by softmax is mapped into the intent-confidence matrix of the h-dimensional intent space.
  • the output is intent and confidence, and a list of entity sets is stored in memory.
  • the type of intention includes one or more of an insurance intention, an underwriting intention, a claims intention, a renewal intention, and a surrender intention.
  • retrieving and outputting a conversation flow corresponding to the intent in the database includes: judging the type of the intent; fetching the required information and obtaining the information according to the type of the intent; and outputting the corresponding scheme according to the information.
  • the specific way of judging the type of intent is to perform a confidence calculation.
  • the confidence level is greater than a set value of a certain intent type, it is determined that the intent type belongs.
  • the confidence type calculation can more accurately identify the user's intention type.
  • the confidence calculation method is the softmax layer output of the fully connected layer vector z Through the judgment of the above-mentioned confidence calculation, the judgment result of the intent type can be obtained more accurately.
  • the information is obtained by obtaining one or two of entity information and user portrait information; and / or inquiring and obtaining information from the user.
  • the second intent judgment step after determining the type of intent, it is necessary to output the solution according to the type of intent.
  • Some information here can be obtained from one or two of entity information and user portrait information, which can improve the efficiency of information acquisition; in addition, users can be asked for information and obtained information to improve the accuracy of information acquisition, thereby Further improve the overall accuracy of the matching output.
  • the information includes one or more of gender, age, license plate number, region, and number of households.
  • the scheme is a recommended insurance scheme.
  • the calculation method of the inferred value is specifically: firstly embed the training word vector into the text segmentation and words of the question text, and then convert it into a sentence vector, stitch the matrix of the sentence vector information, the entity information and the user portrait information through the LSTM model Perform training to extract features.
  • a conversation interaction device including: an acquisition module for acquiring a user sentence; a first judgment module for judging whether the user sentence contains a conventional question; a first output module for the first time When the judgment result of a judgment module is yes, a conventional answer corresponding to a conventional question is retrieved from the database and output; the second judgment module is used to judge whether the user sentence is in the sentence when the judgment result of the first judgment module is no. Contains intent; a second output module is used to retrieve and output the conversation flow corresponding to the intent in the database when the judgment result of the second judgment module is yes.
  • a guessing module configured to make an intention inference according to a user sentence when the judgment result of the second judgment module is negative
  • a third judgment module which is used to judge whether the value obtained in the intention inference is greater than a preset threshold
  • the third output module is configured to retrieve and output the conversation flow corresponding to the intention in the database when the judgment result of the third judgment module is yes.
  • the conversation interaction method of the present invention recognizes the intentions in user sentences through two rounds of intention judgment to make corresponding outputs respectively, so that the user's intentions can be accurately identified, and the customer can be more accurately guided to complete consultation and subsequent services.
  • the second intent judgment method includes two steps, namely, judging whether the user sentence contains an intent, and intent inference. Through the two-step judgment, the user's intent can be more accurately identified. Improve the accuracy of identifying user intentions, and thus avoid errors and incompleteness of user sentence recognition.
  • the preprocessing step of judging a user sentence includes text processing of the user sentence, which can more conveniently perform processing and subsequent recognition judgment, and improve the efficiency and accuracy of recognition.
  • the general entity information and industry entity information are replaced with the encoding of the top-level entity, so that the matching question and the answer corresponding to the question can be further accurately identified.
  • the conversation interaction method of the present invention can obtain related information from one or two of entity information and user portrait information after determining the type of intent, which can improve the efficiency of information acquisition; in addition, it can also be performed to the user. Query and obtain the relevant information to improve the accuracy of the information acquisition, thereby further improving the overall accuracy of the matching output.
  • the conversation interaction method of the present invention realizes the complete extraction of all the information in the context of the user's conversation.
  • entity extraction model and relationship extraction general entities, industry entities and user portraits are extracted from sentences. Users are learned through deep learning models. The intentions and possible intentions have higher accuracy.
  • FIG. 1 is a schematic flowchart of an implementation manner of a session interaction method according to the present invention.
  • FIG. 2 is a schematic diagram of a preferred embodiment of a user knowledge map of the conversation interaction method of the present invention.
  • FIG. 3 is a schematic flowchart of a preferred implementation of the second intention judgment of the conversation interaction method of the present invention.
  • FIG. 4 is a schematic flowchart of defining a session flow rule in the present invention.
  • FIG. 5 is a schematic diagram of a preferred process in the step of FIG. 4.
  • FIG. 6 is a schematic structural diagram of a session interaction apparatus according to an embodiment of the present invention.
  • FIG. 1 is a schematic flowchart of an implementation manner of a session interaction method according to the present invention.
  • the method 100 includes the following steps: 110.
  • the intentions in the user sentence are identified through two rounds of intention judgments to make corresponding outputs respectively, so that the user's intentions can be accurately identified, and the customer can be more accurately guided to complete the consultation and subsequent services.
  • the two intent judgments are used to determine whether the user statement directly contains the existing problems in the database, and to determine whether the user statement implies a specific intention, so as to prevent the specific type of intention implicit from the user from being missed and reduce the recognition error rate. To improve the comprehensiveness and accuracy of identification.
  • the specific process of the second intent judgment 130 is to determine whether the user sentence contains an intent, and if so, retrieve and output the conversation flow corresponding to the intent in the database; if not, Then, the intention inference is performed according to the user sentence, and it is determined whether the value obtained in the intention inference is greater than a preset threshold. If so, it is confirmed that there is an intention, and then the conversation process corresponding to the intention is retrieved from the database and output.
  • the method of the second intent judgment includes two steps, namely, determining whether the user sentence contains the intention, and intent guessing; determining whether the user sentence contains the intention, refers to determining whether the user sentence directly includes the type of the intention. , Such as “car insurance”, “insurance”, etc., and then conduct multiple rounds of conversation according to the type of intent; and if the user statement does not directly include these types of intent, the inventor further provides intent inference in this technical solution Steps to further determine whether the user's sentence contains an intent type, for example, "how long can the car be guaranteed", it is possible to point to the "car insurance” intent type.
  • the user's intention can be identified more accurately, the accuracy of identifying the user's intention can be improved, and the errors and incompleteness of user sentence recognition can be reduced.
  • the obtaining of the sentence in step 110 specifically includes: performing text processing on the obtained user sentence.
  • the text processing manner includes text segmentation.
  • the pre-processing step for judging a user sentence includes text processing on the user sentence, which can more conveniently perform processing and subsequent recognition judgment, and improve the efficiency and accuracy of recognition.
  • the user sentence includes entity information
  • step 110 includes extracting entity information.
  • entity information includes one or more of the following: sentence vector information used to train and compile word vector sequences; general entity information used to represent general information; industry entity information used to represent industry-related information.
  • Entities include entity information to distinguish and judge, and entity information includes sentence vector information, general entity information, and industry entity information.
  • entity information includes sentence vector information, general entity information, and industry entity information.
  • the acquisition of the word vector is completed in the text word segmentation step.
  • An example of sentence vector information could be "I have a car accident in Shanghai today. May I ask if the auto claims insurance process is the same?"
  • the general entity information can be "today”, “Shanghai” and other time and place information; and industry entity information , Can be “auto”, “auto insurance” and other industry information.
  • the user sentence further includes user portrait information, which is used to represent the personal and social relationship of the user.
  • step 110 also extracts user portrait information.
  • the system can obtain the user's social relationship by obtaining the user portrait information appearing in the user sentence multiple times.
  • This method can refer to the way of constructing the task relationship map in the prior art, or refer to the inventor design as described below. Creative way of getting it.
  • the system can further improve the session interaction construction of the database based on the user portrait information, so as to further accurately determine the user's intention and subsequent information push.
  • the user portrait information includes one or more of personal identification information, personal attribute information, and social relationship information.
  • the method for obtaining user portrait information specifically includes: performing association calculations on user sentences to obtain association relationships, obtaining syntactic dependencies and dependency structures in user sentences, and extracting individuals based on the association relationships.
  • the identification information, personal attribute information and social relationship information are subjected to triple-tuple iterative learning to obtain a user portrait knowledge map.
  • the obtained data structure has strong network relationships.
  • the formation process needs to obtain or retrieve the attributes of other related nodes, so that it can be obtained more accurately.
  • User portrait knowledge map which is the relationship map described above.
  • the specific way of performing association calculation on the user sentence is: through the POS-CBOW method, and through the improved Word2vec association calculation. Through the POS-CBOW method and the improved Word2vec for association calculations, due to the integration of entity attributes and entity distribution, the technical effect of extracting entity association relationships can be achieved.
  • Figure 2 is a schematic diagram of a preferred embodiment of a user portrait knowledge map composed of user portraits.
  • My dad is 66 years old this year, and bladder cancer has recovered last year. May I ask Xiaoxin for the elderly?" Is it safe against human cancer? ”,
  • the entity extraction is performed first, including general entity information, industry entity information, and user portrait information extraction, and matrix coding is performed. Specifically, you can do text segmentation first, for example: "I
  • POS-CBOW method to perform correlation calculation through improved Word2vec, obtain syntactic dependencies and dependency structures, extract entities, attributes, relationships through relationships, and learn more templates through triples iteration. For example, get me and dad in the previous sentence. The age is 66 years old, and the disease is bladder cancer. By training the ontology association relationship in the insurance field corpus, a user portrait knowledge map 200 shown in FIG. 2 is obtained.
  • problems such as agents insuring his customers, users recommending good insurance products to friends, and customers insuring themselves, parents, and children, etc., which involve related ontology. Therefore, it is necessary to establish user portrait knowledge through context.
  • Atlas which solves the problem of the complex relationship between many subjects and entities in the conversation. This method builds a knowledge map through user portraits, and solves scenarios such as users querying "my client's policy” or “what friends do I recommend” or "what coverage does my family's insurance cover?”
  • the specific method of the first intent judgment includes: the database is provided with a FAQ data set; a mosaic matrix of sentence vector information, general entity information and industry entity information is performed with the FAQ data set Matching, if there is a corresponding conventional question in the FAQ data set, then a conventional answer corresponding to the conventional question is output.
  • the FAQ data set refers to a database including general questions and general answers corresponding to the general questions.
  • a conventional question is, for example, "How much is a car insurance a year?", And the corresponding conventional answer may be "4,000 yuan”.
  • Matching the sentence matrix information, general entity information, and industry entity information from the user's sentence to the stitching matrix and FAQ data set can accurately match the data blocks and improve the matching efficiency.
  • matching the stitching matrix of sentence vector information, general entity information, and industry entity information with the FAQ data set specifically includes the following steps: replacing the general entity information and industry entity information in the stitching matrix with the most The encoding of the upper entity is then matched with the FAQ data set. Replacing the general entity information and industry entity information with the encoding of the top-level entity can more fully match the content of the data set. For example, replacing "private car” with "car” is the encoding of the upper-level entity, which can further Accurately identify matching questions and answers corresponding to that question.
  • a stitching matrix composed of sentence vectors, general entities, and industry entities is input, and the entities in the user's question sentence are replaced with the encoding of the top-level entity, such as replacing diabetes with Disease, the BMW 320Li is replaced with a car, then the codes of these top-level entities are matched with the problems in the QA, and finally the similarity comparison model is used to find problems in the QA that are greater than a certain similarity threshold.
  • the user asks “Can the BMW 320Li be insured?" And the "Can the car be insured?"
  • Template in QA has the highest similarity, and different answers can be set through QA conditions, such as "Zhongan Auto Insurance can insure vehicles under 2 million ".
  • the specific method for determining the second intent includes: obtaining the intent through text classification through a CNN model according to a stitching matrix of entity information and user portrait information, and FIG. 3 illustrates one of the processes.
  • An independent sentence S ⁇ R nk of a user conversation is represented by a k-dimensional vector of n words, and corresponding information of an entity and a user portrait is encoded into
  • word2vec is used to obtain the word vector X i ⁇ R k after segmentation and de-stopping.
  • the independent sentence can be expressed as: Represents the connection of the word vector X i .
  • the largest one-dimensional feature vector is stored as feature information, and the n-dimensional vector is obtained from n convolutions and mapped into a global feature vector of a fixed length.
  • the output layer establish a fully-linked layer, which is mapped to the h-dimensional intent space, optimize the binary cross-entropy loss function through supervised learning, and map the probability of the softmax output to the intent-confidence matrix of the h-dimensional intent space.
  • the output is intent and confidence, and a list of entity sets is stored in memory.
  • the type of intention includes one or more of an insurance intention, an underwriting intention, a claims intention, a renewal intention, and a surrender intention.
  • the specific manner of fetching and outputting the conversation process corresponding to the intent in the database includes: judging the type of intent; obtaining the required information and obtaining the information according to the type of intent; according to the Information output corresponding scheme.
  • the specific way of judging the type of intent is to perform a confidence calculation.
  • the confidence level is greater than a set value of a certain intent type, it is determined that the intent type belongs. Confidence calculation can more accurately identify the user's intent type.
  • the confidence calculation method is the softmax layer output of the full link layer vector z
  • the way to obtain information is to obtain from one or both of entity information and user portrait information; and / or inquire the user about the information and obtain it.
  • the second intent judgment step after determining the type of intent, it is necessary to output the solution according to the type of intent.
  • the information includes one or more of gender, age, license plate number, region, and number of households.
  • the scheme is a insurance recommendation scheme.
  • FIG. 4 is a schematic flowchart of defining a session flow rule in the present invention.
  • the conversation flow rule 400 contains (intent) triggers, nodes, conditions, and actions.
  • node rules include:
  • Node names 420 are defined, and each node includes corresponding conditions and actions.
  • condition 430 Among them, IF ... ELSE, IF / ELSE, IF / .. and other logical expressions are used to implement the mapping and alignment of entities.
  • the mapping and alignment of the entity includes the mapping of entities and user portraits and the alignment between entities.
  • the condition is defined as age ⁇ 55, and in the user portrait, the attribute of "my dad” who is "born 52" is obtained from “my dad was born in 52", and the age in the condition definition is mapped to the "age” of "my dad", And "52-year-old” is aligned to 66 years old. From the user portrait, it is judged that the condition does not meet age ⁇ 55.
  • an action 440 There are three types defined here, namely cards, jumps, and application programming interface (API) return values. Among them: cards, including selection cards, text cards, graphic cards, graphic lists, pictures, and other cards, interact with users to obtain information and map information, the purpose is to collect structured and unstructured data External data, as well as response and feedback results; jump, you can jump to other nodes or Uniform Resource Locator (URL) or manual, etc .; API return value, return to the server through the API to the user portrait collected Information, acquisition requests, such as insurance recommendations.
  • cards including selection cards, text cards, graphic cards, graphic lists, pictures, and other cards, interact with users to obtain information and map information, the purpose is to collect structured and unstructured data External data, as well as response and feedback results; jump, you can jump to other nodes or Uniform Resource Locator (URL) or manual, etc .
  • API return value return to the server through the API to the user portrait collected Information, acquisition requests, such as insurance recommendations.
  • each node further includes a memory
  • the definition node rule further includes defining a memory
  • the user's question is processed by the intent recognition model to obtain the highest confidence intent and the corresponding entity. For example, the user enters the question “Can a 50-year-old man be insured?" To obtain the highest confidence intent. For “insured”, the corresponding entities are “50 years old” and “male”.
  • the content related to the entity corresponding to the intent in the user input is mapped to the entity as part of the context information of the conversation process, and stored in a storage medium suitable for high-frequency access as a follow-up One of the data sources for the first intention judgment in the step.
  • a trigger triggers multiple rounds of sessions.
  • Node 1 determines whether it has an identity card, obtains it through the API, and reads the user portrait. Node 2. The condition is judged. If an ID is obtained, the card is selected for gender, and jumps to node 3, and the card is selected for age; if no ID is obtained, jumps directly to node 4.
  • Node 4 needs to enter the license plate, node 5 judges whether the region is in the specified region, if so, reads the user portrait and jumps to node 6, otherwise, it gives a selection card and selects the region. Node 6 selects the number of households, and node 7 recommends auto insurance. If the recommendation API fails, an error message is returned.
  • multiple rounds of sessions can be judged by the logic of the nodes and complete the jump of each node. It can support the mapping of entities and user portraits and the alignment of entities. It also supports the selection of cards, text cards, graphic cards, and text. Rich interactive cards such as lists and pictures.
  • a session flow configuration consists of multiple interactive step nodes, which include at least a start node and an end node.
  • Each node consists of a node body, a trigger, multiple sets of conditional behaviors, and a memory network.
  • the node body is the key value of the content that a node needs to collect.
  • the input from the node body and the user to the body will be added to the conversation process context in the form of key-value pairs and stored in the storage medium.
  • the structure of the context is shown in Figure 5.
  • a trigger determines whether the node will be executed. When the condition of the trigger is met, the machine program will push the preset content of the node to the user, and the user will continue to input and complete the user interaction at this step.
  • a trigger consists of a trigger body and a trigger condition. There are three types of trigger bodies, which are intent type (identified with @ symbol), entity type (identified with # symbol), and data type (identified with _ symbol).
  • the data type is defined by the user in advance and stored in the memory medium, and a specific namespace memory in the memory is allocated in advance.
  • the user-defined data x will be stored in memory with memory.x as the key value.
  • the memory.x key-value pair is The life cycle is equivalent to the entire conversation process, and the application range is from the machine to the user.
  • the calculation method of the intentionally inferred value is specifically:
  • the feature is extracted by training through the LSTM model.
  • the specific process is that the current input X t enters a new memory block memory.
  • FIG. 6 is a schematic structural diagram of a session interaction apparatus according to an embodiment of the present invention.
  • the conversation interaction device 600 includes an acquisition module 610, a first determination module 620, a first output module 630, a second determination module 640, and a second output module 650.
  • the obtaining module 610 is used to obtain a user sentence; the first judgment module 620 is used to judge whether the user sentence contains a conventional question; the first output module 630 is used when the judgment result of the first judgment module 620 is yes, in the database Calling a conventional answer corresponding to the conventional question and outputting it; a second judging module 640 for judging whether the user sentence includes an intention when the judging result of the first judging module 620 is no; a second output module 650 for When the judgment result of the second judgment module 640 is YES, a conversation flow corresponding to the intention is retrieved from the database and output.
  • the session interaction device 600 further includes a speculation module 660, a third determination module 670, and a third output module 680.
  • the guessing module 660 is used to make an intention inference according to the user sentence when the judgment result of the second judgment module 640 is negative;
  • the third judgment module 670 is used to judge whether the value obtained from the intention guessing is greater than a preset threshold;
  • the third output The module 680 is configured to: when the determination result of the third determination module 670 is YES, retrieve and output a conversation flow corresponding to the intention in the database.
  • the session interaction device 600 further includes a processing module, configured to perform text processing on the user sentence acquired by the obtaining module 610.
  • the first determining module 620 is specifically configured to determine whether the user sentence contains a conventional question according to the processing result of the processing module.
  • the text processing here includes text segmentation.
  • the user sentence includes entity information
  • entity information includes one or more of the following: sentence vector information for training and compiling a sequence of word vectors; general entity information for representing general information ; Industry entity information, used to represent industry-related information.
  • the user sentence further includes user portrait information, which is used to represent personal and social relationships of the user.
  • the user portrait information includes one or more of personal identification information, personal attribute information, and social relationship information.
  • the method for obtaining user portrait information includes: performing association calculations on user sentences to obtain association relationships, obtaining syntactic dependencies and dependency structures in user sentences, and extracting personal identification information, personal attribute information, and social relationship information based on the association relationship to perform ternary
  • the group learns iteratively to get the user portrait knowledge map.
  • the specific methods used to perform association calculation on user statements include POS-CBOW method and association calculation through improved Word2vec.
  • the first judgment module 620 is specifically configured to match the stitching matrix of sentence vector information, general entity information, and industry entity information with the FAQ data set in the database.
  • the general entity information in the stitching matrix is matched.
  • the information of the industry entity is replaced with the encoding of the top-level entity and then matched with the FAQ data set;
  • the first output module 630 is specifically configured to output a conventional answer corresponding to the conventional question when there is a conventional question in the FAQ data set.
  • the second judgment module 640 is specifically configured to perform text classification through a CNN model to obtain an intent according to a stitching matrix of entity information and user portrait information.
  • the second output module 650 is specifically configured to determine the type of the intent, and the type of the intent includes one or more of an insurance intention, an underwriting intention, a claim intention, a renewal intention, and a surrender intention; according to The type of intent retrieves the required information and obtains this information, which includes one or more of gender, age, license plate number, region, and number of households; according to the information, the corresponding scheme is output, and the scheme includes insurance recommendation Program.
  • the specific way of judging the type of intent here is to calculate the confidence level.
  • the method for obtaining information includes obtaining from one or two of entity information and user portrait information, and the user may also be asked to obtain the information.
  • the session interaction device shown in FIG. 6 may correspond to the session interaction method provided by any of the foregoing embodiments.
  • the specific descriptions and limitations of the session interaction method described above may be applied to the session interaction device, and details are not described herein again.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Computational Linguistics (AREA)
  • General Health & Medical Sciences (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Machine Translation (AREA)

Abstract

Disclosed is a session interaction method. The method comprises: obtaining a user statement; determining whether the user statement comprises a conventional question; if yes, calling, in a database, a conventional answer corresponding to the conventional question and outputting the conventional answer; if no, determining whether the user statement comprises an intention, if yes, calling, in the database, a session flow corresponding to the intention and outputting the session flow. By means of the technical solution, a user intention can be effectively identified and information guidance and scheme pushing can be more accurately performed.

Description

一种会话交互方法及装置Method and device for conversation interaction
本申请要求2018年07月27日提交的申请号为No.201810841590.9的中国申请的优先权,通过引用将其全部内容并入本文。This application claims priority from a Chinese application with application number No. 201810841590.9, filed on July 27, 2018, the entire contents of which are incorporated herein by reference.
技术领域Technical field
本发明涉及计算机技术领域,具体涉及一种会话交互方法及装置。The present invention relates to the field of computer technology, and in particular, to a method and a device for session interaction.
发明背景Background of the invention
目前的计算机会话交互,多数涉及多轮会话,基于预定义的多轮会话规则,允许机器理解用户的意图并从会话流程中挑选合适的应答数据给予用户反馈,一直是人机交互领域努力的方向。Most current computer session interactions involve multiple rounds of conversation. Based on predefined multi-round conversation rules, allowing machines to understand the user's intentions and picking appropriate response data from the conversation process to give users feedback has always been the direction of human-computer interaction. .
然而,目前存在的人机多轮会话方法技术方案均是基于用户问句与需求结构树中包含的标准需求进行映射,从而输出被命中的叶子节点的标准需求内容。这种方案存在着灵活性和准确性上的不足,无法支持灵活的多条会话流程间的跳转和调用,以及实时动态更新的语料模板,这使得某些场景下的交互难以实现,并且意图匹配模型的准确性较低。However, the existing human-machine multi-round conversation method technical solutions are based on the user question and the standard requirements included in the requirement structure tree to map, so as to output the standard requirement content of the hit leaf nodes. This solution has shortcomings in flexibility and accuracy, cannot support flexible jumps and calls between multiple conversation processes, and dynamically updated corpus templates in real time, which makes interaction in some scenarios difficult to achieve, and the intention The accuracy of the matching model is low.
例如,在实际保险行业的多轮会话应用场景中,由于保险本身知识有一定专业性,我们发现用户问题逻辑不清楚,问题比较模糊或者不知道怎么提问,并且保险投保网络复杂,专业术语晦涩难懂等问题,给理解用户自然语言,提供多轮会话交互带来了应用问题,并且对话中,不仅仅包含用户本人的用户画像还包含了用户相关其他用户的画像,比如客户、被推荐人、受益人等。For example, in the multi-round conversation application scenario of the actual insurance industry, because the insurance itself has a certain degree of professionalism, we find that the user's problem logic is unclear, the problem is vague or do not know how to ask questions, and the insurance insurance network is complicated, and the terminology is difficult Understanding and other issues have brought about application problems for understanding the user's natural language and providing multiple rounds of conversational interactions. In addition, the conversation includes not only the user's user portrait but also user related users' portraits, such as customers, referees, Beneficiaries, etc.
因此,如何根据用户的信息,例如意图等推荐相应的问题,以便实现更好地人机交互,一直是相关技术领域需要解决的技术问题之一。Therefore, how to recommend corresponding problems based on user information, such as intent, in order to achieve better human-computer interaction, has always been one of the technical problems to be solved in related technical fields.
发明内容Summary of the Invention
为了克服现有技术的不足,本发明所解决的技术问题是提供一种能更准确引导客户咨询的会话交互方法和装置。In order to overcome the shortcomings of the prior art, the technical problem solved by the present invention is to provide a conversation interaction method and device that can more accurately guide customer consultation.
为解决上述技术问题,本发明一方面提供了一种会话交互方法,该方法包括以下步骤:获取用户语句;判断用户语句是否包含常规问题;若是,在数据库中调取与常规问题相对应的常规答案并输出;若否,判断用户语句中是否包含意图,若是,在数据库中调取与意图相应会话流程并输出。In order to solve the above technical problems, one aspect of the present invention provides a method for session interaction, which includes the following steps: obtaining a user sentence; determining whether the user sentence contains a conventional question; and if so, calling a routine corresponding to the conventional question in a database Answer and output; if not, determine whether the user statement contains intent, and if so, retrieve and output the conversation flow corresponding to the intent in the database.
为解决上述技术问题,发明人在本技术方案中,通过两轮意图判断识别用户语句中的意图, 并分别作出相应的输出,从而能够准确识别用户意图,进而更准确地引导客户完成咨询和后续的服务。两次意图判断分别用于判断用户语句是否直接含有数据库中已有的问题,以及用于判断用户语句是否隐含具体的意图,以防错失用户隐含有具体的意图类型,降低识别错误的概率,提高识别的全面性和准确率。In order to solve the above technical problems, the inventor in this technical solution uses two rounds of intent judgment to identify the intentions in the user sentence, and makes corresponding outputs respectively, so that the user's intent can be accurately identified, and the customer can be more accurately guided to complete the consultation and follow-up Services. The two intent judgments are used to determine whether the user statement directly contains the existing problems in the database, and to determine whether the user statement implies a specific intention, so as to prevent the user from missing a specific intention type and reduce the probability of recognition errors. To improve the comprehensiveness and accuracy of identification.
优选地,还包括:若否,根据用户语句进行意图推测;判断意图推测中所得数值是否大于预设的阈值,若是,在数据库中调取与意图相应的会话流程并输出。Preferably, the method further includes: if not, inferring the intention according to the user sentence; judging whether the value obtained in the intent guessing is greater than a preset threshold; if yes, calling and outputting a conversation flow corresponding to the intent in the database.
需要说明的是,在一些优选的实施方式中,第二意图判断的方式包括两个步骤,分别是判断用户语句中是否包含意图,以及意图推测;判断用户语句中是否包含意图,指的是判断用户语句中是否直接包括意图类型,例如“车险”“投保”等,进而根据意图类型进行多轮会话的引导;而如果用户语句中不直接包含这些意图类型。发明人在本技术方案中还进一步地提供了意图推测这一步骤,以进一步判断用户语句中是否隐含有意图类型,例如“汽车能保障多久”,则有可能指向“车险”的意图类型。通过上述两步的判断,可以更为准确地识别用户意图,提高识别用户意图的准确率,进而避免用户语句识别的误差和不全面。It should be noted that, in some preferred implementation manners, the manner of the second intent judgment includes two steps, namely, determining whether the user sentence contains the intention, and intent guessing; determining whether the user sentence contains the intention means judgment. Whether the user statement directly includes intent types, such as "car insurance" and "insurance", and then conducts multiple rounds of conversation according to the intent type; and if the user statement does not directly include these intent types. The inventor further provides an intent-guessing step in this technical solution to further determine whether the user sentence contains an intent type implicitly. For example, "how long can the car be guaranteed", it may point to the "auto insurance" intent type. Through the above two-step judgment, the user's intention can be identified more accurately, the accuracy of identifying the user's intention can be improved, and the errors and incompleteness of user sentence recognition can be avoided.
优选地,判断用户语句是否包含常规问题包括:对所获取的用户语句进行文本处理,根据文本处理的结果判断用户语句是否包含常规问题。Preferably, determining whether the user sentence contains a conventional question includes: performing text processing on the obtained user sentence, and determining whether the user sentence contains a conventional question according to a result of the text processing.
更优选地,文本处理的方式包括文本分词。More preferably, the manner of text processing includes text segmentation.
需要说明的是,在一些优选的实施方式中,对用户语句进行判断的预处理步骤包括对用户语句进行文本处理,能够更方便地进行处理和后续的识别判断,提高识别的效率和准确性。It should be noted that, in some preferred embodiments, the pre-processing step for judging a user sentence includes performing text processing on the user sentence, which can more conveniently perform processing and subsequent recognition judgment, and improve the efficiency and accuracy of recognition.
优选地,用户语句包括实体信息;实体信息包括以下之中的一种或多种:句向量信息,用于将词向量序列训练并编译;通用实体信息,用于表示通用的信息;行业实体信息,用于表示与行业相关的信息。Preferably, the user sentence includes entity information; the entity information includes one or more of the following: sentence vector information for training and compiling a sequence of word vectors; general entity information for representing general information; industry entity information , Used to represent industry-related information.
需要说明的是,作为一种优选实施方式,用户语句包括实体信息以进行区分和判断,实体信息包括句向量信息、通用实体信息和行业实体信息。句向量信息的例子可以是“我今天在上海出车祸了,请问汽车的异地车险理赔流程和本地一样吗?”;而通用实体信息,可以是“今天”“上海”等时间地点信息;而行业实体信息,可以是“汽车”“车险”等行业信息。It should be noted that, as a preferred embodiment, the user sentence includes entity information to distinguish and judge, and the entity information includes sentence vector information, general entity information, and industry entity information. An example of sentence vector information could be "I have a car accident in Shanghai today. May I ask if the car's off-site auto insurance claim process is the same as the local one?"; And the general entity information can be "today" and "Shanghai" and other time and place information; and the industry Entity information can be industry information such as "auto" and "auto insurance".
更优选地,用户语句还包括用户画像信息,用于表示用户个人及社交关系的信息。More preferably, the user sentence further includes user portrait information, which is used to represent user personal and social relationship information.
需要说明的是,系统可以通过多次获取在用户语句中出现的用户画像信息,来获取用户的社交关系,该方法可以参考现有技术中的人物关系图谱的构建方式,也可以参考如下文的发明人设计的具有创造性的获取方式。通过此步骤,系统可以进一步根据用户画像信息完善数据库的会话交互建设,从而进一步准确地判断用户意图,以及实施后续的信息推送。It should be noted that the system can obtain the user's social relationship by obtaining the user portrait information appearing in the user sentence multiple times. This method can refer to the construction method of the character relationship map in the prior art, or refer to the following Creative way of acquisition designed by the inventor. Through this step, the system can further improve the session interaction construction of the database based on the user portrait information, so as to further accurately determine the user's intention and implement subsequent information push.
进一步地,用户画像信息包括个人识别信息、个人属性信息和社交关系信息之中的一种或 多种;用户画像信息的获取方式具体包括:对用户语句进行关联计算得到关联关系,获取用户语句中的句法依存关系和依存结构,并根据关联关系抽取个人识别信息、个人属性信息和社交关系信息进行三元组迭代学习,得到用户画像知识图谱。Further, the user portrait information includes one or more of personal identification information, personal attribute information, and social relationship information. The method for obtaining user portrait information specifically includes: performing an association calculation on a user sentence to obtain an association relationship, and obtaining the user sentence. The syntactic dependency relationship and dependency structure are extracted, and the personal identification information, personal attribute information, and social relationship information are extracted based on the association relationship for triple-item iterative learning to obtain a user portrait knowledge map.
需要说明的是,根据关联关系抽取个人识别信息、个人属性信息和社交关系信息进行三元组迭代学习,所得到的数据结构存在强的网络关系,需要获取或检索其他相关节点属性,从而能够更准确地得到用户画像知识图谱,即上文的人物关系图谱。It should be noted that, by extracting personal identification information, personal attribute information, and social relationship information based on the association relationship for iterative learning of triples, the obtained data structure has a strong network relationship, and it is necessary to obtain or retrieve other relevant node attributes, so that it can be more Accurately obtain the user portrait knowledge map, that is, the character relationship map above.
在一些实施方式中,对用户语句进行关联计算的具体方式是:通过POS-CBOW方法,并通过改进的Word2vec进行关联计算。In some implementations, the specific way of performing association calculation on the user sentence is: associating calculation through the POS-CBOW method and improved Word2vec.
需要说明的是,在一些更具体的实施方式中,通过POS-CBOW方法,并通过改进的Word2vec进行关联计算,由于综合了实体属性和实体分布,从而能够达到提取实体关联的技术效果。It should be noted that in some more specific implementations, association calculation is performed by the POS-CBOW method and improved Word2vec. Because the entity attributes and entity distribution are integrated, the technical effect of extracting entity associations can be achieved.
进一步地,判断用户语句是否包含常规问题;若是,在数据库中调取与常规问题相对应的常规答案并输出包括:将句向量信息、通用实体信息和行业实体信息的拼接矩阵与数据库中的FAQ数据集进行匹配,若FAQ数据集中存在相应的常规问题,则输出与常规问题相对应的常规答案。Further, determine whether the user sentence contains a conventional question; if so, retrieve a conventional answer corresponding to the conventional question in the database and output: include a stitching matrix of sentence vector information, general entity information, and industry entity information with the database FAQ The data sets are matched. If there are corresponding general questions in the FAQ data set, the general answers corresponding to the general questions are output.
需要说明的是,FAQ数据集是指包括常规问题和以及与常规问题相对于的常规答案的数据库。常规问题例如是“车险一年多少钱?”,而相对应的常规答案可能是“4000元人民币”之类。It should be noted that the FAQ data set refers to a database including general questions and general answers as opposed to conventional questions. A conventional question is, for example, "How much is a car insurance a year?", And the corresponding conventional answer may be "4,000 yuan".
将用户语句中所得的句向量信息、通用实体信息和行业实体信息的拼接矩阵,在FAQ数据集中进行匹配,能够准确地实现数据库的匹配,而且提高匹配效率。Matching the sentence vector information, general entity information, and industry entity information obtained from user sentences in the FAQ data set can accurately match the database and improve the matching efficiency.
在一些实施方式中,将句向量信息、通用实体信息和行业实体信息的拼接矩阵与FAQ数据集进行匹配包括:将拼接矩阵中的通用实体信息和行业实体信息替换成最上层实体的编码,再与FAQ数据集进行匹配。In some implementations, matching the stitching matrix of sentence vector information, general entity information, and industry entity information to the FAQ data set includes: replacing the general entity information and industry entity information in the stitching matrix with the encoding of the top-level entity, and then Match with the FAQ dataset.
需要说明的是,在一些优选的实施方式中,将通用实体信息和行业实体信息替换成最上层实体的编码,可以更全面地匹配数据集的内容,如将“私家车”替换成“汽车”,则为替代成上层实体的编码,这样可以进一步准确地识别相匹配的问题和与该问题对应的答案。It should be noted that in some preferred embodiments, replacing the general entity information and industry entity information with the encoding of the top-level entity can more fully match the content of the data set, such as replacing "private car" with "car" , It is replaced by the encoding of the upper layer entity, which can further accurately identify the matching question and the answer corresponding to the question.
进一步地,判断用户语句中是否包含意图包括:根据实体信息和用户画像信息的拼接矩阵,通过CNN模型进行文本分类获得意图。Further, determining whether the user sentence includes an intention includes: performing a text classification through a CNN model to obtain the intention according to a stitching matrix of entity information and user portrait information.
在更具体的实施方式中,上述过程的具体方式是:在用户会话的某个独立句子S∈R nk中,用n个词的k维向量表示,将实体和用户画像的对应信息编码到字典中,利用word2vec通过分词和去停用词后得到词向量X i∈R k,则该独立句子可以表示为:
Figure PCTCN2019071301-appb-000001
代表了词向量X i的连接。
In a more specific embodiment, the specific process of the above process is: in an independent sentence S ∈ R nk of the user session, represented by a k-dimensional vector of n words, and encoding the corresponding information of the entity and the user portrait into a dictionary In Word2vec, the word vector X i ∈ R k is obtained after segmentation and de-stopping. Then the independent sentence can be expressed as:
Figure PCTCN2019071301-appb-000001
Represents the connection of the word vector X i .
采用独立句子的N-Gram形式来挖掘特征信息,通过CNN模型,将文本卷积核定义W∈R lk(其中,卷积长度为L),对于文本在每个窗口滑动的特征为f i=f(W iX i:i+l-1+b),得到特征图为F=[f 1,f 2,…f n-l+1]。 The feature information is mined using the N-Gram form of independent sentences. The CNN model is used to define the text convolution kernel W ∈ R lk (where the convolution length is L). For the feature of text sliding in each window, f i = f (W i X i: i + l-1 + b), the obtained feature map is F = [f 1 , f 2 , ... f n−l + 1 ].
在池化层中,对特征向量保存最大一维作为特征信息,从n个卷积获取n维向量,映射成固定长度的全局特征向量。In the pooling layer, the largest one-dimensional feature vector is stored as feature information, and the n-dimensional vector is obtained from n convolutions and mapped into a global feature vector of a fixed length.
在输出层中,建立一个全链接层,映射到h维意图空间,通过监督学习优化二元交叉熵损失函数,通过softmax输出的概率映射到h维意图空间的意图-置信度矩阵中。输出结果为意图和置信度,实体集的列表,存储在记忆中。In the output layer, a fully-linked layer is established, which is mapped to the h-dimensional intent space. The binary cross-entropy loss function is optimized through supervised learning, and the probability output by softmax is mapped into the intent-confidence matrix of the h-dimensional intent space. The output is intent and confidence, and a list of entity sets is stored in memory.
在一些实施方式中,意图的类型包括投保意图、核保意图、理赔意图、续保意图和退保意图之中的一种或多种。In some embodiments, the type of intention includes one or more of an insurance intention, an underwriting intention, a claims intention, a renewal intention, and a surrender intention.
作为优选,在数据库中调取与意图相应的会话流程并输出包括:判断意图的类型;根据意图的类型调取所需要的信息并获取信息;根据信息输出相应的方案。As a preference, retrieving and outputting a conversation flow corresponding to the intent in the database includes: judging the type of the intent; fetching the required information and obtaining the information according to the type of the intent; and outputting the corresponding scheme according to the information.
作为优选,判断意图的类型的具体方式是进行置信度计算,当置信度大于某一意图类型的设定值时,则判断属于该意图类型。Preferably, the specific way of judging the type of intent is to perform a confidence calculation. When the confidence level is greater than a set value of a certain intent type, it is determined that the intent type belongs.
需要说明的是,通过置信度计算可以更为准确地识别用户的意图类型,具体地,置信度计算的方法是全连接层向量z的softmax层输出
Figure PCTCN2019071301-appb-000002
通过上述置信度计算的判断,可以更准确地得出意图类型的判断结果。
It should be noted that the confidence type calculation can more accurately identify the user's intention type. Specifically, the confidence calculation method is the softmax layer output of the fully connected layer vector z
Figure PCTCN2019071301-appb-000002
Through the judgment of the above-mentioned confidence calculation, the judgment result of the intent type can be obtained more accurately.
作为优选,获取信息的方式是从实体信息、用户画像信息之中的一种或两种进行获取;和/或向用户进行询问信息并获取。Preferably, the information is obtained by obtaining one or two of entity information and user portrait information; and / or inquiring and obtaining information from the user.
需要说明的是,在第二意图判断步骤中,在判断得到意图类型后,需要根据意图类型进行方案输出,而在此过程中,可能需要综合用户的多种信息,例如年龄、身份证等,而这里有些信息是可以从实体信息、用户画像信息之中的一种或两种进行获取,可以提高信息获取的效率;另外也可以向用户进行询问信息并获取,提高信息获取的准确率,从而进一步提高匹配输出的整体准确度。It should be noted that in the second intent judgment step, after determining the type of intent, it is necessary to output the solution according to the type of intent. In this process, it may be necessary to synthesize a variety of user information, such as age, ID, etc. Some information here can be obtained from one or two of entity information and user portrait information, which can improve the efficiency of information acquisition; in addition, users can be asked for information and obtained information to improve the accuracy of information acquisition, thereby Further improve the overall accuracy of the matching output.
作为优选,信息包括性别、年龄、车牌号、地区、家庭人数之中的一种或多种。Preferably, the information includes one or more of gender, age, license plate number, region, and number of households.
作为进一步优选,方案是险种推荐方案。As a further preference, the scheme is a recommended insurance scheme.
优选地,意图推测的数值的计算方法具体是:首先通过对问句文本分词和词嵌入训练词向量,然后转换成句向量,将句向量信息、实体信息和用户画像信息的矩阵拼接,通过LSTM模型进行训练提取特征,具体过程是当前输入X t进入新的记忆块记忆,通过激活函数映射到输入门i t=σ(w tX t+W th t-1+b q),遗忘门f t=σ(w fX t+W fh t-1+b f)控制了信息量,并更新记忆块q t=tanh(w qX t+W qh t-1+b q),输出信息或会话卡片o t=σ(w oX t+W oh t-1+b o),并且确定了把什么信息 保存在新的记忆块中,C t=tanh(w cX t+W ch t-1+b c),
Figure PCTCN2019071301-appb-000003
更新并输出当前隐层h t=o t*tanh(C t)。最后在LSTM模型线性全链接层后,增加一个Softmax层,将LSTM模型映射到潜在意图空间,得到其概率分布。
Preferably, the calculation method of the inferred value is specifically: firstly embed the training word vector into the text segmentation and words of the question text, and then convert it into a sentence vector, stitch the matrix of the sentence vector information, the entity information and the user portrait information through the LSTM model Perform training to extract features. The specific process is that the current input X t enters the new memory block memory, and is mapped to the input gate i t = σ (w t X t + W t h t-1 + b q ) through the activation function, and the gate f is forgotten. t = σ (w f X t + W f h t-1 + b f ) controls the amount of information and updates the memory block q t = tanh (w q X t + W q h t-1 + b q ), output Information or conversation card o t = σ (w o X t + W o h t-1 + b o ) and determine what information to save in the new memory block, C t = tanh (w c X t + W c h t-1 + b c ),
Figure PCTCN2019071301-appb-000003
Update and output the current hidden layer h t = o t * tanh (C t ). Finally, after the linear full-link layer of the LSTM model, a Softmax layer is added to map the LSTM model to the potential intent space to obtain its probability distribution.
根据本发明的第二方面还提供一种会话交互装置,包括:获取模块,用于获取用户语句;第一判断模块,用于判断用户语句是否包含常规问题;第一输出模块,用于当第一判断模块的判断结果为是时,在数据库中调取与常规问题相对应的常规答案并输出;第二判断模块,用于当第一判断模块的判断结果为否时,判断用户语句中是否包含意图;第二输出模块,用于当第二判断模块的判断结果为是时,在数据库中调取与意图相应的会话流程并输出。According to a second aspect of the present invention, there is also provided a conversation interaction device, including: an acquisition module for acquiring a user sentence; a first judgment module for judging whether the user sentence contains a conventional question; a first output module for the first time When the judgment result of a judgment module is yes, a conventional answer corresponding to a conventional question is retrieved from the database and output; the second judgment module is used to judge whether the user sentence is in the sentence when the judgment result of the first judgment module is no. Contains intent; a second output module is used to retrieve and output the conversation flow corresponding to the intent in the database when the judgment result of the second judgment module is yes.
进一步地,还包括:推测模块,用于当第二判断模块的判断结果为否时,根据用户语句进行意图推测;第三判断模块,用于判断意图推测中所得数值是否大于预设的阈值;第三输出模块,用于当第三判断模块的判断结果为是时,在数据库中调取与意图相应的会话流程并输出。Further, it further comprises: a guessing module, configured to make an intention inference according to a user sentence when the judgment result of the second judgment module is negative; a third judgment module, which is used to judge whether the value obtained in the intention inference is greater than a preset threshold; The third output module is configured to retrieve and output the conversation flow corresponding to the intention in the database when the judgment result of the third judgment module is yes.
与现有技术相比,本发明的有益效果在于:Compared with the prior art, the beneficial effects of the present invention are:
1、本发明的会话交互方法,通过两轮的意图判断识别用户语句中的意图,以分别作出相应的输出,从而能够准确识别用户意图,进而更准确地引导客户完成咨询和后续的服务。1. The conversation interaction method of the present invention recognizes the intentions in user sentences through two rounds of intention judgment to make corresponding outputs respectively, so that the user's intentions can be accurately identified, and the customer can be more accurately guided to complete consultation and subsequent services.
2、本发明的会话交互方法,第二意图判断的方式包括两个步骤,分别是判断用户语句中是否包含意图,以及意图推测,通过该两步的判断,可以更为准确地识别用户意图,提高识别用户意图的准确率,进而避免用户语句识别的误差和不全面。2. In the conversation interaction method of the present invention, the second intent judgment method includes two steps, namely, judging whether the user sentence contains an intent, and intent inference. Through the two-step judgment, the user's intent can be more accurately identified. Improve the accuracy of identifying user intentions, and thus avoid errors and incompleteness of user sentence recognition.
3、本发明的会话交互方法,对用户语句进行判断的预处理步骤包括对用户语句进行文本处理,能够更方便地进行处理和后续的识别判断,提高识别的效率和准确性。3. In the conversation interaction method of the present invention, the preprocessing step of judging a user sentence includes text processing of the user sentence, which can more conveniently perform processing and subsequent recognition judgment, and improve the efficiency and accuracy of recognition.
4、本发明的会话交互方法,在一些优选的实施方式中,将通用实体信息和行业实体信息替换成最上层实体的编码,这样可以进一步准确地识别相匹配问题和与该问题对应的答案。4. In the conversation interaction method of the present invention, in some preferred embodiments, the general entity information and industry entity information are replaced with the encoding of the top-level entity, so that the matching question and the answer corresponding to the question can be further accurately identified.
5、本发明的会话交互方法,在判断得到意图类型后,可以从实体信息、用户画像信息之中的一种或两种进行获取相关信息,可以提高信息获取的效率;另外也可以向用户进行询问该相关信息并获取,提高信息获取的准确率,从而进一步提高匹配输出的整体准确度。5. The conversation interaction method of the present invention can obtain related information from one or two of entity information and user portrait information after determining the type of intent, which can improve the efficiency of information acquisition; in addition, it can also be performed to the user. Query and obtain the relevant information to improve the accuracy of the information acquisition, thereby further improving the overall accuracy of the matching output.
6、本发明的会话交互方法,实现对用户对话中上下文所有信息的完整提取,通过实体提取模型和关系抽取,从句子中提取通用实体、行业实体和用户画像,通过深度学习模型,学习出用户的意图和可能的意图,具有较高的准确度。6. The conversation interaction method of the present invention realizes the complete extraction of all the information in the context of the user's conversation. Through entity extraction model and relationship extraction, general entities, industry entities and user portraits are extracted from sentences. Users are learned through deep learning models. The intentions and possible intentions have higher accuracy.
上述说明仅是本发明技术方案的概述,为了能够更清楚了解本发明的技术手段,而可依照说明书的内容予以实施,并且为了让本发明的上述和其他目的、特征和优点能够更明显易懂,以下特举较佳实施例,并配合附图,详细说明如下。The above description is only an overview of the technical solution of the present invention. In order to understand the technical means of the present invention more clearly, it can be implemented in accordance with the content of the description, and in order to make the above and other objects, features, and advantages of the present invention more comprehensible. The following describes the preferred embodiments and the accompanying drawings in detail as follows.
附图简要说明Brief description of the drawings
图1为本发明会话交互方法的其中一种实施方式的流程示意图。FIG. 1 is a schematic flowchart of an implementation manner of a session interaction method according to the present invention.
图2为本发明会话交互方法的用户知识图谱的一种优选实施方式的示意图。FIG. 2 is a schematic diagram of a preferred embodiment of a user knowledge map of the conversation interaction method of the present invention.
图3为本发明会话交互方法的第二意图判断的一种优选实施方式的流程示意图。FIG. 3 is a schematic flowchart of a preferred implementation of the second intention judgment of the conversation interaction method of the present invention.
图4为本发明中会话流程规则的定义流程示意图。FIG. 4 is a schematic flowchart of defining a session flow rule in the present invention.
图5为图4步骤中的一种优选的流程示意图。FIG. 5 is a schematic diagram of a preferred process in the step of FIG. 4.
图6所示为本发明一实施例提供的会话交互装置的结构示意图。FIG. 6 is a schematic structural diagram of a session interaction apparatus according to an embodiment of the present invention.
实施本发明的方式Mode of Carrying Out the Invention
为使本发明的目的、技术手段和优点更加清楚明白,以下结合附图对本发明作进一步详细说明。In order to make the purpose, technical means, and advantages of the present invention clearer, the present invention is further described in detail below with reference to the accompanying drawings.
图1为本发明会话交互方法的其中一种实施方式的流程示意图。如图1所示,该方法100包括以下步骤:110、语句获取:获取用户语句;120第一意图判断:根据用户语句进行第一意图判断,第一意图判断用于判断用户语句是否包含常规问题;若是,则在数据库中调取与常规问题相对应的常规答案并输出;若否,则进行第二意图判断;130第二意图判断,用于判断用户语句中是否包含意图,若是,则在数据库中调取与意图相应会话流程并输出。FIG. 1 is a schematic flowchart of an implementation manner of a session interaction method according to the present invention. As shown in FIG. 1, the method 100 includes the following steps: 110. Sentence acquisition: obtaining user sentences; 120 first intention judgment: making a first intention judgment according to the user sentence, the first intention judgment is used to determine whether the user sentence contains a conventional question ; If yes, then retrieve and output the conventional answer corresponding to the conventional question in the database; if not, perform the second intent judgment; 130 the second intent judgment is used to determine whether the user sentence contains an intent, and if so, then The conversation process corresponding to the intent is retrieved from the database and output.
以上是本发明的其中一种基础实施方式。在本技术方案中,通过两轮的意图判断识别用户语句中的意图,以分别作出相应的输出,从而能够准确识别用户意图,进而更准确地引导客户完成咨询和后续的服务。两次的意图判断分别用于判断用户语句是否直接含有数据库中已有的问题,以及用于判断用户语句是否隐含具体的意图,以防错失用户隐含的具体的意图类型,降低识别错误率,提高识别的全面性和准确率。The above is one of the basic embodiments of the present invention. In this technical solution, the intentions in the user sentence are identified through two rounds of intention judgments to make corresponding outputs respectively, so that the user's intentions can be accurately identified, and the customer can be more accurately guided to complete the consultation and subsequent services. The two intent judgments are used to determine whether the user statement directly contains the existing problems in the database, and to determine whether the user statement implies a specific intention, so as to prevent the specific type of intention implicit from the user from being missed and reduce the recognition error rate. To improve the comprehensiveness and accuracy of identification.
结合上述基础实施方式,在第二个方面中,第二意图判断130的具体过程是:判断用户语句中是否包含意图,若是,则在数据库中调取与意图相应会话流程并输出;若否,则根据用户语句进行意图推测,判断意图推测中所得数值是否大于预设的阈值,若是,则确认具有意图,进而在数据库中调取与意图相应会话流程并输出。With reference to the above-mentioned basic embodiment, in the second aspect, the specific process of the second intent judgment 130 is to determine whether the user sentence contains an intent, and if so, retrieve and output the conversation flow corresponding to the intent in the database; if not, Then, the intention inference is performed according to the user sentence, and it is determined whether the value obtained in the intention inference is greater than a preset threshold. If so, it is confirmed that there is an intention, and then the conversation process corresponding to the intention is retrieved from the database and output.
在此方面中,第二意图判断的方式包括两个步骤,分别是判断用户语句中是否包含意图,以及意图推测;判断用户语句中是否包含意图,指的是判断用户语句中是否直接包括意图类型,例如“车险”、“投保”等,进而根据意图类型进行多轮会话的引导;而如果用户语句中不直接包含这些意图类型,发明人在本技术方案中还进一步地提供了意图推测这一步骤,以进一步判断用户语句中是否隐含有意图类型,例如“汽车能保障多久”,则有可能指向“车险”的意图类型。通过上述两步的判断,可以更为准确地识别用户意图,提高识别用户意图的准确率,进 而降低用户语句识别的误差和不全面。In this regard, the method of the second intent judgment includes two steps, namely, determining whether the user sentence contains the intention, and intent guessing; determining whether the user sentence contains the intention, refers to determining whether the user sentence directly includes the type of the intention. , Such as "car insurance", "insurance", etc., and then conduct multiple rounds of conversation according to the type of intent; and if the user statement does not directly include these types of intent, the inventor further provides intent inference in this technical solution Steps to further determine whether the user's sentence contains an intent type, for example, "how long can the car be guaranteed", it is possible to point to the "car insurance" intent type. Through the above two-step judgment, the user's intention can be identified more accurately, the accuracy of identifying the user's intention can be improved, and the errors and incompleteness of user sentence recognition can be reduced.
结合上述基础实施方式,在第三个方面中,步骤110语句获取具体包括:对所获取的用户语句进行文本处理。在更进一步具体的实施方式中,文本处理的方式包括文本分词。对用户语句进行判断的预处理步骤包括对用户语句进行文本处理,能够更方便地进行处理和后续的识别判断,提高识别的效率和准确性。With reference to the above-mentioned basic embodiment, in the third aspect, the obtaining of the sentence in step 110 specifically includes: performing text processing on the obtained user sentence. In a further specific embodiment, the text processing manner includes text segmentation. The pre-processing step for judging a user sentence includes text processing on the user sentence, which can more conveniently perform processing and subsequent recognition judgment, and improve the efficiency and accuracy of recognition.
结合上述基础实施方式,在第四个方面中,用户语句包括实体信息,相应地,步骤110包括提取实体信息。该实体信息包括以下之中的一种或多种:句向量信息,用于将词向量序列训练并编译;通用实体信息,用于表示通用的信息;行业实体信息,用于表示与行业相关的信息。With reference to the above-mentioned basic embodiment, in a fourth aspect, the user sentence includes entity information, and accordingly, step 110 includes extracting entity information. The entity information includes one or more of the following: sentence vector information used to train and compile word vector sequences; general entity information used to represent general information; industry entity information used to represent industry-related information.
用户语句包括实体信息以进行区分和判断,实体信息包括句向量信息、通用实体信息和行业实体信息。词向量的获取在文本分词步骤中完成。句向量信息的例子可以是“我今天在上海出车祸了,请问汽车异地险理赔流程一样吗?”;而通用实体信息,可以是“今天”、“上海”等时间地点信息;而行业实体信息,可以是“汽车”、“车险”等行业信息。User statements include entity information to distinguish and judge, and entity information includes sentence vector information, general entity information, and industry entity information. The acquisition of the word vector is completed in the text word segmentation step. An example of sentence vector information could be "I have a car accident in Shanghai today. May I ask if the auto claims insurance process is the same?" And the general entity information can be "today", "Shanghai" and other time and place information; and industry entity information , Can be "auto", "auto insurance" and other industry information.
结合上述基础实施方式,在第五个方面中,用户语句还包括用户画像信息,用于表示用户个人及社交关系的信息,相应地,步骤110还提取用户画像信息。系统可以通过获取多次在用户语句中出现的用户画像信息,从而获取用户的社交关系,该方法可以参考现有技术中的任务关系图谱的构建方式,也可以参考如下文所述的发明人设计的具有创造性的获取方式。通过此步骤,系统可以进一步根据用户画像信息完善数据库的会话交互建设,从而进一步准确地判断用户意图,以及后续的信息推送。在一些更具体的实施方式中,用户画像信息包括个人识别信息、个人属性信息和社交关系信息之中的一种或多种。With reference to the above-mentioned basic embodiment, in the fifth aspect, the user sentence further includes user portrait information, which is used to represent the personal and social relationship of the user. Accordingly, step 110 also extracts user portrait information. The system can obtain the user's social relationship by obtaining the user portrait information appearing in the user sentence multiple times. This method can refer to the way of constructing the task relationship map in the prior art, or refer to the inventor design as described below. Creative way of getting it. Through this step, the system can further improve the session interaction construction of the database based on the user portrait information, so as to further accurately determine the user's intention and subsequent information push. In some more specific implementation manners, the user portrait information includes one or more of personal identification information, personal attribute information, and social relationship information.
结合上述基础实施方式,在第六个方面中,用户画像信息的获取方式具体包括:对用户语句进行关联计算得到关联关系,获取用户语句中的句法依存关系和依存结构,并根据关联关系抽取个人识别信息、个人属性信息和社交关系信息进行三元组迭代学习,得到用户画像知识图谱。With reference to the above-mentioned basic embodiment, in the sixth aspect, the method for obtaining user portrait information specifically includes: performing association calculations on user sentences to obtain association relationships, obtaining syntactic dependencies and dependency structures in user sentences, and extracting individuals based on the association relationships. The identification information, personal attribute information and social relationship information are subjected to triple-tuple iterative learning to obtain a user portrait knowledge map.
根据关联关系抽取个人识别信息、个人属性信息和社交关系信息进行三元组迭代学习,得到的数据结构存在强网络关系,其形成过程需要获取或检索其他相关节点的属性,从而能够更准确地得到用户画像知识图谱,即上文所述的关系图谱。在更具体的一些实施方式中,对用户语句进行关联计算的具体方式是:通过POS-CBOW方法,并通过改进的Word2vec进行关联计算。通过POS-CBOW方法,并通过改进的Word2vec进行关联计算,由于综合了实体属性和实体分布,从而能够实现提取实体关联关系的技术效果。Extract the personal identification information, personal attribute information, and social relationship information according to the association relationship for iterative learning of the triples. The obtained data structure has strong network relationships. The formation process needs to obtain or retrieve the attributes of other related nodes, so that it can be obtained more accurately. User portrait knowledge map, which is the relationship map described above. In some more specific embodiments, the specific way of performing association calculation on the user sentence is: through the POS-CBOW method, and through the improved Word2vec association calculation. Through the POS-CBOW method and the improved Word2vec for association calculations, due to the integration of entity attributes and entity distribution, the technical effect of extracting entity association relationships can be achieved.
如图2所示是用户画像构成的用户画像知识图谱的其中一种优选实施方式的示意图,比如说通过获取用户语句“我爸爸今年66岁了,去年膀胱癌痊愈了,请问可以买孝欣老年人防癌 险吗?”,首先进行实体提取,包括通用实体信息、行业实体信息,以及用户画像信息提取,并进行矩阵化编码。具体可先做文本分词,比如:“我|爸爸|今年|66岁|了,去年|膀胱癌|痊愈|了,请问|可以|买|孝欣老年人防癌险|吗?”。其次通过POS-CBOW方法通过改进的Word2vec进行关联计算,获取句法依存关系和依存结构,通过关系抽取实体、属性、关系,通过三元组迭代学习更多模板,比如上句中得到我和爸爸,年龄是66岁,疾病膀胱癌,投保偏好孝欣老年人防癌险。通过保险领域语料训练本体关联关系,获得图2所示的用户画像知识图谱200。在互联网保险应用场景中,可能存在代理人为他的客户投保,用户给朋友推荐好的保险产品,客户为自己、父母、小孩投保等问题,涉及到关联本体,因此需要通过上下文,建立用户画像知识图谱,从而解决了会话中的主体和实体比较多的关系复杂的问题。此方法通过用户画像构建知识图谱,解决了比如用户查询“我客户的保单”或者“我推荐了哪些朋友”或者“我家庭的保险覆盖了哪些保障范围”等情景。Figure 2 is a schematic diagram of a preferred embodiment of a user portrait knowledge map composed of user portraits. For example, by acquiring the user sentence "My dad is 66 years old this year, and bladder cancer has recovered last year. May I ask Xiaoxin for the elderly?" Is it safe against human cancer? ”, The entity extraction is performed first, including general entity information, industry entity information, and user portrait information extraction, and matrix coding is performed. Specifically, you can do text segmentation first, for example: "I | Dad | This year | 66 years old | I did it last year | Bladder cancer | Healing | I have it, can I buy it? Xiaoxin elderly cancer prevention insurance?" Secondly, use POS-CBOW method to perform correlation calculation through improved Word2vec, obtain syntactic dependencies and dependency structures, extract entities, attributes, relationships through relationships, and learn more templates through triples iteration. For example, get me and dad in the previous sentence. The age is 66 years old, and the disease is bladder cancer. By training the ontology association relationship in the insurance field corpus, a user portrait knowledge map 200 shown in FIG. 2 is obtained. In the Internet insurance application scenario, there may be problems such as agents insuring his customers, users recommending good insurance products to friends, and customers insuring themselves, parents, and children, etc., which involve related ontology. Therefore, it is necessary to establish user portrait knowledge through context. Atlas, which solves the problem of the complex relationship between many subjects and entities in the conversation. This method builds a knowledge map through user portraits, and solves scenarios such as users querying "my client's policy" or "what friends do I recommend" or "what coverage does my family's insurance cover?"
结合上述基础实施方式,在第七个方面中,第一意图判断的具体方法包括:数据库设有FAQ数据集;将句向量信息、通用实体信息和行业实体信息的拼接矩阵,和FAQ数据集进行匹配,若FAQ数据集中存在相应的常规问题,则输出与该常规问题相对应的常规答案。FAQ数据集是指包括常规问题和与该常规问题相对应的常规答案的数据库。常规问题例如是“车险一年多少钱?”,而相对应的常规答案可能是“4000元人民币”之类。将从用户语句中得到的句向量信息、通用实体信息和行业实体信息的拼接矩阵和FAQ数据集进行匹配,能够准确地实现数据块的匹配,提高匹配效率。With reference to the above-mentioned basic embodiment, in the seventh aspect, the specific method of the first intent judgment includes: the database is provided with a FAQ data set; a mosaic matrix of sentence vector information, general entity information and industry entity information is performed with the FAQ data set Matching, if there is a corresponding conventional question in the FAQ data set, then a conventional answer corresponding to the conventional question is output. The FAQ data set refers to a database including general questions and general answers corresponding to the general questions. A conventional question is, for example, "How much is a car insurance a year?", And the corresponding conventional answer may be "4,000 yuan". Matching the sentence matrix information, general entity information, and industry entity information from the user's sentence to the stitching matrix and FAQ data set can accurately match the data blocks and improve the matching efficiency.
在一些实施方式中,在将句向量信息、通用实体信息和行业实体信息的拼接矩阵和FAQ数据集进行匹配时,具体包括以下步骤:将拼接矩阵中的通用实体信息和行业实体信息替换成最上层实体的编码,再与FAQ数据集进行匹配。将通用实体信息和行业实体信息替换成最上层实体的编码,可以更全面地匹配数据集的内容,如将“私家车”替换成“汽车”,即为替代成上层实体的编码,这样可以进一步准确地识别相匹配的问题和与该问题对应的答案。In some implementations, matching the stitching matrix of sentence vector information, general entity information, and industry entity information with the FAQ data set specifically includes the following steps: replacing the general entity information and industry entity information in the stitching matrix with the most The encoding of the upper entity is then matched with the FAQ data set. Replacing the general entity information and industry entity information with the encoding of the top-level entity can more fully match the content of the data set. For example, replacing "private car" with "car" is the encoding of the upper-level entity, which can further Accurately identify matching questions and answers corresponding to that question.
在一些具体的实施例中,例如在FAQ识别中,输入由句向量、通用实体、行业实体构成的拼接矩阵,将用户的问题语句中的实体替换为最上层实体的编码,比如将糖尿病替换成疾病,宝马320Li替换成汽车,然后将这些最上层实体的编码和QA中的问题进行匹配,最后通过相似度比对模型,寻找大于某个相似度阈值的QA中的问题。比如,用户问“请问宝马320Li可以投保吗?”和QA中的“汽车可以投保吗?”模板相似度最高,还可以通过QA条件设置不同答案,比如“众安车险可以投保200万以下的车辆”。In some specific embodiments, for example, in the FAQ identification, a stitching matrix composed of sentence vectors, general entities, and industry entities is input, and the entities in the user's question sentence are replaced with the encoding of the top-level entity, such as replacing diabetes with Disease, the BMW 320Li is replaced with a car, then the codes of these top-level entities are matched with the problems in the QA, and finally the similarity comparison model is used to find problems in the QA that are greater than a certain similarity threshold. For example, the user asks "Can the BMW 320Li be insured?" And the "Can the car be insured?" Template in QA has the highest similarity, and different answers can be set through QA conditions, such as "Zhongan Auto Insurance can insure vehicles under 2 million ".
结合上述基础实施方式,在第八个方面中,第二意图判断的具体方法包括:根据实体信息和用户画像信息的拼接矩阵,通过CNN模型进行文本分类获得意图,图3是表示该过程的其 中一种实施方式的流程示意图,该方法300具体步骤为:310、将用户会话的某个独立句子S∈R nk,用n个词的k维向量表示,将实体和用户画像的对应信息编码到字典中,利用word2vec通过分词和去停用词后得到词向量X i∈R k,则该独立句子可以表示为:
Figure PCTCN2019071301-appb-000004
代表了词向量X i的连接。
With reference to the above-mentioned basic embodiment, in the eighth aspect, the specific method for determining the second intent includes: obtaining the intent through text classification through a CNN model according to a stitching matrix of entity information and user portrait information, and FIG. 3 illustrates one of the processes. A schematic flowchart of an embodiment. The specific steps of the method 300 are: 310. An independent sentence S ∈ R nk of a user conversation is represented by a k-dimensional vector of n words, and corresponding information of an entity and a user portrait is encoded into In the dictionary, word2vec is used to obtain the word vector X i ∈ R k after segmentation and de-stopping. Then the independent sentence can be expressed as:
Figure PCTCN2019071301-appb-000004
Represents the connection of the word vector X i .
320、采用该独立句子的N-Gram形式来挖掘特征信息,并通过CNN模型,将文本卷积核定义W∈R lk(其中,卷积长度为L),对于文本在每个窗口滑动的特征为f i=f(W iX i:i+l-1+b),得到特征图为F=[f 1,f 2,…f n-l+1]。 320. Use the N-Gram form of the independent sentence to mine the feature information, and define the text convolution kernel W ∈ R lk (where the convolution length is L) through the CNN model. For the feature of the text sliding in each window For f i = f (W i X i: i + l-1 + b), the obtained feature map is F = [f 1 , f 2 , ... f n−l + 1 ].
在池化层中,对特征向量保存最大一维作为特征信息,从n个卷积获取n维向量,映射成固定长度的全局特征向量。In the pooling layer, the largest one-dimensional feature vector is stored as feature information, and the n-dimensional vector is obtained from n convolutions and mapped into a global feature vector of a fixed length.
330、在输出层中,建立一个全链接层,映射到h维意图空间,通过监督学习优化二元交叉熵损失函数,通过softmax输出的概率映射到h维意图空间的意图-置信度矩阵中。输出结果为意图和置信度,实体集的列表,存储在记忆中。330. In the output layer, establish a fully-linked layer, which is mapped to the h-dimensional intent space, optimize the binary cross-entropy loss function through supervised learning, and map the probability of the softmax output to the intent-confidence matrix of the h-dimensional intent space. The output is intent and confidence, and a list of entity sets is stored in memory.
在一些实施方式中,意图的类型包括投保意图、核保意图、理赔意图、续保意图和退保意图之中的一种或多种。In some embodiments, the type of intention includes one or more of an insurance intention, an underwriting intention, a claims intention, a renewal intention, and a surrender intention.
作为优选,在第二意图判断步骤中,在数据库中调取与意图相应会话流程并输出的具体方式包括:判断意图的类型;根据意图的类型调取所需要的信息并获取该信息;根据该信息输出相应的方案。As a preference, in the second intent judgment step, the specific manner of fetching and outputting the conversation process corresponding to the intent in the database includes: judging the type of intent; obtaining the required information and obtaining the information according to the type of intent; according to the Information output corresponding scheme.
作为优选,判断意图的类型的具体方式是进行置信度计算,当置信度大于某一意图类型的设定值时,则判断属于该意图类型。通过置信度计算可以更为准确地识别用户的意图类型,具体地,置信度计算的方法是全链接层向量z的softmax层输出
Figure PCTCN2019071301-appb-000005
Preferably, the specific way of judging the type of intent is to perform a confidence calculation. When the confidence level is greater than a set value of a certain intent type, it is determined that the intent type belongs. Confidence calculation can more accurately identify the user's intent type. Specifically, the confidence calculation method is the softmax layer output of the full link layer vector z
Figure PCTCN2019071301-appb-000005
通过上述置信度计算的判断,可以更准确地得出意图类型的判断结果。Through the judgment of the above-mentioned confidence calculation, the judgment result of the intent type can be obtained more accurately.
在一些其他优选的实施方式之中,获取信息的方式是从实体信息和用户画像信息之中的一种或两种进行获取;和/或向用户询问该信息并获取。在第二意图判断步骤中,在判断得到意图类型后,需要根据意图类型进行方案输出,而在此过程中,可能需要综合用户的多种信息,例如年龄、身份证等,而这里有些信息是可以从实体信息和用户画像信息之中的一种或两种中获取到的,从而可以提高信息获取的效率;另外也可以向用户进行询问该信息并获取,提高信息获取的准确率,从而进一步提高匹配输出的整体准确度。作为更进一步地优选方案,该信息包括性别、年龄、车牌号、地区、家庭人数之中的一种或多种。在其他的一些优选方案中,所述方案是险种推荐方案。In some other preferred implementation manners, the way to obtain information is to obtain from one or both of entity information and user portrait information; and / or inquire the user about the information and obtain it. In the second intent judgment step, after determining the type of intent, it is necessary to output the solution according to the type of intent. In this process, it may be necessary to synthesize a variety of information of the user, such as age, ID, etc., and some information here is It can be obtained from one or two of entity information and user portrait information, which can improve the efficiency of information acquisition; in addition, users can be asked about this information and obtain it to improve the accuracy of information acquisition, thereby further Improve the overall accuracy of the matching output. As a further preferred solution, the information includes one or more of gender, age, license plate number, region, and number of households. In some other preferred schemes, the scheme is a insurance recommendation scheme.
以下结合一种具体的实施方式以说明上述获取和判断过程:The following describes the above acquisition and determination process in combination with a specific implementation mode:
图4为本发明中会话流程规则的定义流程示意图。如图4所示,该会话流程规则400包含 了(意图)触发器、节点、条件和动作。FIG. 4 is a schematic flowchart of defining a session flow rule in the present invention. As shown in Figure 4, the conversation flow rule 400 contains (intent) triggers, nodes, conditions, and actions.
定义触发条件规则410包括:定义意图名称和其对应的置信度应当满足的条件,比如:intent=核保and confidence_degree>0.8。Defining a trigger condition rule 410 includes: defining a condition that an intent name and a corresponding confidence degree should satisfy, such as: intent = underwriting and confidence_degree> 0.8.
定义节点规则包括:Define node rules include:
定义节点名称420,每个节点包括相应的条件和动作。 Node names 420 are defined, and each node includes corresponding conditions and actions.
定义条件430。其中,采用IF…ELSE IF/ELSE IF/..等逻辑表达式实现实体的映射和对齐,该实体的映射和对齐包括实体与用户画像的映射和实体之间的对齐。比如条件定义为age<55,而用户画像中通过“我爸52年生的”获取“我爸”年龄“52年生”的属性,将条件定义中的age和“我爸”的“年龄”映射,并将“52年生”对齐为66岁,从用户画像中,判断条件不满足age<55。Define condition 430. Among them, IF ... ELSE, IF / ELSE, IF / .. and other logical expressions are used to implement the mapping and alignment of entities. The mapping and alignment of the entity includes the mapping of entities and user portraits and the alignment between entities. For example, the condition is defined as age <55, and in the user portrait, the attribute of "my dad" who is "born 52" is obtained from "my dad was born in 52", and the age in the condition definition is mapped to the "age" of "my dad", And "52-year-old" is aligned to 66 years old. From the user portrait, it is judged that the condition does not meet age <55.
定义动作440。这里定义了3种类型,即卡片、跳转和应用程序编程接口(Application Programming Interface,API)返回值。其中:卡片,包括了选择卡片、文本卡片、图文卡片、图文列表、图片等卡片,通过卡片和用户交互,获取信息,并进行信息映射,目的是用于收集结构化和非结构化数据的外部数据,以及响应并反馈结果;跳转,可以跳转到其他节点或统一资源定位符(Uniform Resource Locator,URL)或人工等;API返回值,通过API返回给服务器所收集到的用户画像信息,获取请求,比如保险推荐等。Define an action 440. There are three types defined here, namely cards, jumps, and application programming interface (API) return values. Among them: cards, including selection cards, text cards, graphic cards, graphic lists, pictures, and other cards, interact with users to obtain information and map information, the purpose is to collect structured and unstructured data External data, as well as response and feedback results; jump, you can jump to other nodes or Uniform Resource Locator (URL) or manual, etc .; API return value, return to the server through the API to the user portrait collected Information, acquisition requests, such as insurance recommendations.
在一个实施例中,每个节点还包括记忆,则定义节点规则还包括定义记忆。具体来说,对于终端用户输入的问句会做以下两步处理:In one embodiment, each node further includes a memory, and the definition node rule further includes defining a memory. Specifically, the question input by the end user will be processed in the following two steps:
第一步,用户的问句由意图识别模型进行处理,得出置信度最高的意图和对应实体,例如:用户输入问句“50岁的男性能否投保?”,得出置信度最高的意图为“投保”,对应的实体为“50岁”、“男性”。In the first step, the user's question is processed by the intent recognition model to obtain the highest confidence intent and the corresponding entity. For example, the user enters the question "Can a 50-year-old man be insured?" To obtain the highest confidence intent. For "insured", the corresponding entities are "50 years old" and "male".
第二步,将用户输入中与该意图所对应的实体相关的内容,与实体之间做一层映射,作为该会话流程的部分上下文信息,存放于适合高频访问的存储介质中,作为后续步骤中第一意图判断的数据源之一。In the second step, the content related to the entity corresponding to the intent in the user input is mapped to the entity as part of the context information of the conversation process, and stored in a storage medium suitable for high-frequency access as a follow-up One of the data sources for the first intention judgment in the step.
具体例子请见图5。比如,触发器触发了多轮会话,节点1判断有没有身份证,通过API获取,读取用户画像。节点2,条件判断,如果获取到身份证,则给卡片选择性别,并跳转到节点3,给卡片选择年龄;如果没有获取到身份证,直接跳转到节点4。节点4需要输入车牌,节点5判断地区是否在指定地区里,如果是,读取用户画像并跳转到节点6,否则,给出选择卡片,选择地区。节点6选择家庭人数,节点7车险推荐,若调用推荐API失败,则返回错误信息。See Figure 5 for a specific example. For example, a trigger triggers multiple rounds of sessions. Node 1 determines whether it has an identity card, obtains it through the API, and reads the user portrait. Node 2. The condition is judged. If an ID is obtained, the card is selected for gender, and jumps to node 3, and the card is selected for age; if no ID is obtained, jumps directly to node 4. Node 4 needs to enter the license plate, node 5 judges whether the region is in the specified region, if so, reads the user portrait and jumps to node 6, otherwise, it gives a selection card and selects the region. Node 6 selects the number of households, and node 7 recommends auto insurance. If the recommendation API fails, an error message is returned.
从上面的例子看,多轮会话可以通过节点的逻辑判断,完成各个节点的跳转,并且可以支 持实体和用户画像的映射和实体的对齐,支持选择卡片、文本卡片、图文卡片、图文列表、图片等丰富的交互卡片。From the example above, multiple rounds of sessions can be judged by the logic of the nodes and complete the jump of each node. It can support the mapping of entities and user portraits and the alignment of entities. It also supports the selection of cards, text cards, graphic cards, and text. Rich interactive cards such as lists and pictures.
对于上述步骤,下面详细说明下图执行模块:For the above steps, the following figure describes the execution module in detail:
根据获取的意图在预置的会话流程中做匹配,查询相应的会话流程配置。一个会话流程配置由多个交互步骤节点构成,其中至少包含一个起始节点和一个结束节点。Match in the preset session flow according to the acquired intent, and query the corresponding session flow configuration. A session flow configuration consists of multiple interactive step nodes, which include at least a start node and an end node.
每个节点由节点主体、一个触发器、多组条件行为以及内存网络组成。Each node consists of a node body, a trigger, multiple sets of conditional behaviors, and a memory network.
节点主体为一个节点需要采集的内容的key值,节点主体与用户针对该主体的输入会以键值对的形式追加到会话流程上下文中,存储到存储介质中。上下文的结构见图5。The node body is the key value of the content that a node needs to collect. The input from the node body and the user to the body will be added to the conversation process context in the form of key-value pairs and stored in the storage medium. The structure of the context is shown in Figure 5.
触发器决定了是否会执行到该节点。当该触发器的条件被满足时,机器程序会将该节点的预置内容推送给用户,交由用户继续输入,完成该步用户交互。触发器由触发器主体和触发条件构成,触发器主体有三种类型,分别是意图类型(以@符号标识)、实体类型(以#符号标识)和数据类型(以_符号标识)。其中数据类型由用户预先定义并存储于内存介质中,预先分配内存中特定的命名空间memory,用户定义的数据x会以memory.x为key值存储于内存中,该memory.x键值对的生命周期等同于整个会话流程,应用范围为机器端到用户端。The trigger determines whether the node will be executed. When the condition of the trigger is met, the machine program will push the preset content of the node to the user, and the user will continue to input and complete the user interaction at this step. A trigger consists of a trigger body and a trigger condition. There are three types of trigger bodies, which are intent type (identified with @ symbol), entity type (identified with # symbol), and data type (identified with _ symbol). The data type is defined by the user in advance and stored in the memory medium, and a specific namespace memory in the memory is allocated in advance. The user-defined data x will be stored in memory with memory.x as the key value. The memory.x key-value pair is The life cycle is equivalent to the entire conversation process, and the application range is from the machine to the user.
结合上述实施方式,在第九个方面,所述意图推测的数值的计算方法具体是:With reference to the foregoing embodiment, in a ninth aspect, the calculation method of the intentionally inferred value is specifically:
首先通过对问句文本分词和次嵌入训练词向量,然后转换成句向量、实体信息和用户画像的矩阵拼接,通过LSTM模型进行训练提取特征,具体过程是当前输入X t进入新的记忆块记忆,通过激活函数映射到输入门i t=σ(w tX t+W th t-1+b q),遗忘门f t=σ(w fX t+W fh t-1+b f)控制了信息量,并更新记忆块q t=tanh(w qX t+W qh t-1+b q),输出信息或会话卡片o t=σ(w oX t+W oh t-1+b o),并且确定了把什么信息保存在新的记忆块中,C t=tanh(w cX t+W ch t-1+b c),
Figure PCTCN2019071301-appb-000006
更新并输出当前隐层h t=o t*tanh(C t)。最后在LSTM模型线性全链接层后,增加一个Softmax层,将LSTM模型映射到潜在意图空间,得到其概率分布。
First, by segmenting and sub-embedding the training word vector in the question text, and then converting it into a matrix of sentence vectors, entity information, and user portraits, the feature is extracted by training through the LSTM model. The specific process is that the current input X t enters a new memory block memory. The activation function is mapped to the input gate i t = σ (w t X t + W t h t-1 + b q ), and the forgetting gate f t = σ (w f X t + W f h t-1 + b f ) Control the amount of information, and update the memory block q t = tanh (w q X t + W q h t-1 + b q ), output information or session card o t = σ (w o X t + W o h t- 1 + b o ), and determine what information to save in the new memory block, C t = tanh (w c X t + W c h t-1 + b c ),
Figure PCTCN2019071301-appb-000006
Update and output the current hidden layer h t = o t * tanh (C t ). Finally, after the linear full-link layer of the LSTM model, a Softmax layer is added to map the LSTM model to the potential intent space to obtain its probability distribution.
图6所示为本发明一实施例提供的会话交互装置的结构示意图。如图6所示,该会话交互装置600包括获取模块610、第一判断模块620、第一输出模块630、第二判断模块640和第二输出模块650。其中,获取模块610用于获取用户语句;第一判断模块620用于判断该用户语句中是否包含常规问题;第一输出模块630用于当第一判断模块620的判断结果为是时,数据库中调取与该常规问题对应的常规答案并输出;第二判断模块640,用于当第一判断模块620的判断结果为否时,判断用户语句中是否包含意图;第二输出模块650,用于当第二判断模块640的判断结果为是时,在数据库中调取与该意图相应的会话流程并输出。FIG. 6 is a schematic structural diagram of a session interaction apparatus according to an embodiment of the present invention. As shown in FIG. 6, the conversation interaction device 600 includes an acquisition module 610, a first determination module 620, a first output module 630, a second determination module 640, and a second output module 650. Wherein, the obtaining module 610 is used to obtain a user sentence; the first judgment module 620 is used to judge whether the user sentence contains a conventional question; the first output module 630 is used when the judgment result of the first judgment module 620 is yes, in the database Calling a conventional answer corresponding to the conventional question and outputting it; a second judging module 640 for judging whether the user sentence includes an intention when the judging result of the first judging module 620 is no; a second output module 650 for When the judgment result of the second judgment module 640 is YES, a conversation flow corresponding to the intention is retrieved from the database and output.
在一个实施例中,会话交互装置600还包括推测模块660、第三判断模块670和第三输出模块680。其中,推测模块660用于当第二判断模块640的判断结果为否时,根据用户语句进 行意图推测;第三判断模块670用于判断意图推测中所得数值是否大于预设的阈值;第三输出模块680用于当第三判断模块670的判断结果为是时,在数据库中调取与意图相应的会话流程并输出。In one embodiment, the session interaction device 600 further includes a speculation module 660, a third determination module 670, and a third output module 680. Among them, the guessing module 660 is used to make an intention inference according to the user sentence when the judgment result of the second judgment module 640 is negative; the third judgment module 670 is used to judge whether the value obtained from the intention guessing is greater than a preset threshold; the third output The module 680 is configured to: when the determination result of the third determination module 670 is YES, retrieve and output a conversation flow corresponding to the intention in the database.
在一个实施例中,会话交互装置600还包括处理模块,用于对获取模块610获取到的用户语句进行文本处理。这种情况下,第一判断模块620具体用于根据处理模块的处理结果判断用户语句是否包含常规问题。这里的文本处理包括文本分词。In one embodiment, the session interaction device 600 further includes a processing module, configured to perform text processing on the user sentence acquired by the obtaining module 610. In this case, the first determining module 620 is specifically configured to determine whether the user sentence contains a conventional question according to the processing result of the processing module. The text processing here includes text segmentation.
在一个实施例中,用户语句包括实体信息,该实体信息包括以下之中的一种或多种:句向量信息,用于将词向量序列训练并编译;通用实体信息,用于表示通用的信息;行业实体信息,用于表示与行业相关的信息。In one embodiment, the user sentence includes entity information, and the entity information includes one or more of the following: sentence vector information for training and compiling a sequence of word vectors; general entity information for representing general information ; Industry entity information, used to represent industry-related information.
在一个实施例中,用户语句还包括用户画像信息,用于表示用户个人及社交关系的信息。该用户画像信息包括个人识别信息、个人属性信息和社交关系信息之中的一种或多种。In one embodiment, the user sentence further includes user portrait information, which is used to represent personal and social relationships of the user. The user portrait information includes one or more of personal identification information, personal attribute information, and social relationship information.
该用户画像信息的获取方式包括:对用户语句进行关联计算得到关联关系,获取用户语句中的句法依存关系和依存结构,并根据关联关系抽取个人识别信息、个人属性信息和社交关系信息进行三元组迭代学习,得到用户画像知识图谱。这里用于对用户语句进行关联计算的具体方式包括通过POS-CBOW方法,并通过改进的Word2vec进行关联计算。The method for obtaining user portrait information includes: performing association calculations on user sentences to obtain association relationships, obtaining syntactic dependencies and dependency structures in user sentences, and extracting personal identification information, personal attribute information, and social relationship information based on the association relationship to perform ternary The group learns iteratively to get the user portrait knowledge map. The specific methods used to perform association calculation on user statements include POS-CBOW method and association calculation through improved Word2vec.
在一个实施例中,第一判断模块620具体用于将句向量信息、通用实体信息和行业实体信息的拼接矩阵与数据库中的FAQ数据集进行匹配,优选地,将拼接矩阵中的通用实体信息和行业实体信息替换成最上层实体的编码,再与FAQ数据集进行匹配;第一输出模块630具体用于当FAQ数据集中存在常规问题时,输出与该常规问题对应的常规答案。In one embodiment, the first judgment module 620 is specifically configured to match the stitching matrix of sentence vector information, general entity information, and industry entity information with the FAQ data set in the database. Preferably, the general entity information in the stitching matrix is matched. The information of the industry entity is replaced with the encoding of the top-level entity and then matched with the FAQ data set; the first output module 630 is specifically configured to output a conventional answer corresponding to the conventional question when there is a conventional question in the FAQ data set.
在一个实施例中,第二判断模块640具体用于根据实体信息和用户画像信息的拼接矩阵,通过CNN模型进行文本分类获得意图。In one embodiment, the second judgment module 640 is specifically configured to perform text classification through a CNN model to obtain an intent according to a stitching matrix of entity information and user portrait information.
在一个实施例中,第二输出模块650具体用于判断意图的类型,该意图的类型包括投保意图、核保意图、理赔意图、续保意图和退保意图中的一种或多种;根据意图的类型调取所需要的信息并获取该信息,该信息包括性别、年龄、车牌号、地区、家庭人数之中的一种或多种;根据该信息输出相应的方案,该方案包括险种推荐方案。In one embodiment, the second output module 650 is specifically configured to determine the type of the intent, and the type of the intent includes one or more of an insurance intention, an underwriting intention, a claim intention, a renewal intention, and a surrender intention; according to The type of intent retrieves the required information and obtains this information, which includes one or more of gender, age, license plate number, region, and number of households; according to the information, the corresponding scheme is output, and the scheme includes insurance recommendation Program.
这里判断意图的类型的具体方式是进行置信度计算,当置信度大于某一意图类型的设定值时,判断属于该意图类型。获取信息的方式包括从实体信息和用户画像信息之中的一种或两种进行获取,也可以向用户进行询问该信息以获取。The specific way of judging the type of intent here is to calculate the confidence level. When the confidence level is greater than the set value of a certain intent type, it is judged that it belongs to the intent type. The method for obtaining information includes obtaining from one or two of entity information and user portrait information, and the user may also be asked to obtain the information.
图6所示的会话交互装置可以与上述任一实施例提供的会话交互方法相对应,上述关于会话交互方法的具体描述和限定均可以应用于该会话交互装置中,这里不再赘述。The session interaction device shown in FIG. 6 may correspond to the session interaction method provided by any of the foregoing embodiments. The specific descriptions and limitations of the session interaction method described above may be applied to the session interaction device, and details are not described herein again.
以上仅为本发明的较佳实施例而已,并非用于限定本发明的保护范围。凡在本发明的精神 和原则之内,所作的任何修改、等同替换、改进等,均应包含在本发明的保护范围之内。The above are only preferred embodiments of the present invention, and are not intended to limit the protection scope of the present invention. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims (20)

  1. 一种会话交互方法,包括:A session interaction method includes:
    获取用户语句;Get user statements;
    判断所述用户语句是否包含常规问题;Determining whether the user statement contains a conventional question;
    若是,在数据库中调取与所述常规问题相对应的常规答案并输出;If yes, a conventional answer corresponding to the conventional question is retrieved from the database and output;
    若否,判断所述用户语句中是否包含意图,若是,在所述数据库中调取与所述意图相应的会话流程并输出。If not, determine whether the user sentence contains an intention, and if so, retrieve and output a conversation flow corresponding to the intention in the database.
  2. 如权利要求1所述的会话交互方法,其中,还包括:The conversation interaction method according to claim 1, further comprising:
    当确定所述用户语句中不包含意图时,根据所述用户语句进行意图推测;When it is determined that the user sentence does not include an intention, the intention inference is performed according to the user sentence;
    判断所述意图推测中所得数值是否大于预设的阈值,若是,在所述数据库中调取与所述意图相应的会话流程并输出。It is determined whether the value obtained in the intent guess is greater than a preset threshold, and if so, a conversation process corresponding to the intent is retrieved from the database and output.
  3. 如权利要求1所述的会话交互方法,其中,在所述获取用户语句之后还包括:对所述用户语句进行文本处理;The conversation interaction method according to claim 1, further comprising: after obtaining the user sentence, performing text processing on the user sentence;
    所述判断所述用户语句是否包含常规问题包括:The judging whether the user sentence includes a conventional question includes:
    根据所述文本处理的结果判断所述用户语句是否包含所述常规问题。It is determined whether the user sentence includes the conventional question according to a result of the text processing.
  4. 如权利要求3所述的会话交互方法,其中,所述文本处理的方式包括文本分词。The conversation interaction method according to claim 3, wherein the text processing manner includes text segmentation.
  5. 如权利要求1所述的会话交互方法,其中,所述用户语句包括实体信息;所述实体信息包括以下之中的一种或多种:The conversation interaction method according to claim 1, wherein the user sentence includes entity information; the entity information includes one or more of the following:
    句向量信息,用于将词向量序列训练并编译;Sentence vector information, used to train and compile word vector sequences;
    通用实体信息,用于表示通用的信息;General entity information, used to represent general information;
    行业实体信息,用于表示与行业相关的信息。Industry entity information, used to represent industry-related information.
  6. 如权利要求5所述的会话交互方法,其中,所述用户语句还包括用户画像信息,用于表示用户个人及社交关系的信息。The conversation interaction method according to claim 5, wherein the user sentence further includes user portrait information, which is used to represent personal and social relationships of the user.
  7. 如权利要求6所述的会话交互方法,其中,所述用户画像信息包括个人识别信息、个人属性信息和社交关系信息之中的一种或多种;The conversation interaction method according to claim 6, wherein the user portrait information includes one or more of personal identification information, personal attribute information, and social relationship information;
    所述用户画像信息的获取方式具体包括:The obtaining manner of the user portrait information specifically includes:
    对所述用户语句进行关联计算得到关联关系,获取用户语句中的句法依存关系和依存结构,并根据所述关联关系抽取所述个人识别信息、个人属性信息和社交关系信息进行三元组迭代学习,得到用户画像知识图谱。Perform association calculations on the user sentences to obtain association relationships, obtain syntactic dependencies and dependency structures in the user sentences, and extract the personal identification information, personal attribute information, and social relationship information according to the association relationships for triple-iterative learning To get the user portrait knowledge map.
  8. 如权利要求7所述的会话交互方法,其中,对所述用户语句进行关联计算的具体方式 是:通过POS-CBOW方法,并通过改进的Word2vec进行关联计算。The conversation interaction method according to claim 7, wherein the specific way of performing correlation calculation on the user sentence is: POS-CBOW method and correlation calculation through improved Word2vec.
  9. 如权利要求6所述的会话交互方法,其中,所述判断所述用户语句是否包含常规问题;若是,在数据库中调取与所述常规问题相对应的常规答案并输出包括:The conversation interaction method according to claim 6, wherein said judging whether the user sentence contains a conventional question; if so, retrieving and outputting a conventional answer corresponding to the conventional question in a database includes:
    将所述句向量信息、通用实体信息和行业实体信息的拼接矩阵与所述数据库中的FAQ数据集进行匹配,若所述数据库中的FAQ数据集中存在相应的常规问题,则输出与所述常规问题相对应的常规答案。Matching the splicing matrix of the sentence vector information, general entity information and industry entity information with the FAQ data set in the database, and if there are corresponding general problems in the FAQ data set in the database, the output is consistent with the general The conventional answer to the question.
  10. 如权利要求9所述的会话交互方法,其中,所述将所述句向量信息、通用实体信息和行业实体信息的拼接矩阵与所述数据库中的FAQ数据集进行匹配包括:The conversation interaction method according to claim 9, wherein matching the stitching matrix of the sentence vector information, general entity information, and industry entity information with the FAQ data set in the database comprises:
    将所述拼接矩阵中的所述通用实体信息和行业实体信息替换成最上层实体的编码,再与所述数据库中的所述FAQ数据集进行匹配。Replace the general entity information and industry entity information in the stitching matrix with the code of the top-level entity, and then match the FAQ data set in the database.
  11. 如权利要求6所述的会话交互方法,其中,所述判断所述用户语句中是否包含意图包括:The conversation interaction method according to claim 6, wherein the determining whether the user statement includes an intent comprises:
    根据所述实体信息和所述用户画像信息的拼接矩阵,通过CNN模型进行文本分类获得意图。According to the stitching matrix of the entity information and the user portrait information, text classification is performed through a CNN model to obtain an intent.
  12. 如权利要求11所述的会话交互方法,其中,所述意图的类型包括投保意图、核保意图、理赔意图、续保意图和退保意图之中的一种或多种。The conversation interaction method according to claim 11, wherein the type of the intention includes one or more of an insurance intention, an underwriting intention, a claim intention, a renewal intention, and a surrender intention.
  13. 如权利要求12所述的会话交互方法,其中,所述在数据库中调取与所述意图相应的会话流程并输出包括:The conversation interaction method according to claim 12, wherein the retrieval and output of a conversation flow corresponding to the intent in a database comprises:
    判断所述意图的类型;Judging the type of said intent;
    根据所述意图的类型调取所需要的信息并获取所述信息;Retrieve required information and obtain the information according to the type of the intent;
    根据所述信息输出相应的方案。A corresponding scheme is output according to the information.
  14. 如权利要求13所述的会话交互方法,其特征在于,判断所述意图的类型的具体方式是进行置信度计算,当所述置信度大于某一意图类型的设定值时,则判断属于该意图类型。The conversation interaction method according to claim 13, wherein the specific way of determining the type of the intent is to perform a confidence calculation, and when the confidence degree is greater than a set value of a certain type of intent, it is determined that it belongs to Intent type.
  15. 如权利要求13所述的会话交互方法,其特征在于,获取所述信息的方式包括从所述实体信息和所述、用户画像信息之中的一种或两种进行获取;和/或向用户进行询问所述信息并获取。The conversation interaction method according to claim 13, wherein the method of obtaining the information comprises obtaining from one or two of the entity information and the user portrait information; and / or from the user Ask for the information and get it.
  16. 如权利要求13所述的会话交互方法,其特征在于,所述信息包括性别、年龄、车牌号、地区、家庭人数之中的一种或多种。The conversation interaction method according to claim 13, wherein the information comprises one or more of gender, age, license plate number, region, and number of households.
  17. 如权利要求16所述的会话交互方法,其特征在于,所述方案是险种推荐方案。The conversation interaction method according to claim 16, wherein the scheme is a insurance type recommendation scheme.
  18. 如权利要求6所述的会话交互方法,其特征在于,所述意图推测的数值的计算方法具体包括:The conversation interaction method according to claim 6, wherein the calculation method of the intent-predicted value specifically comprises:
    根据所述句向量信息、所述实体信息和所述用户画像信息的拼接矩阵,通过LSTM模型进行文本分类获得用户下一句话可能的潜在意图。According to the stitching matrix of the sentence vector information, the entity information, and the user portrait information, text classification is performed by the LSTM model to obtain the potential intent of the user's next sentence.
  19. 一种会话交互装置,包括:A conversation interaction device includes:
    获取模块,用于获取用户语句;An acquisition module for acquiring user statements;
    第一判断模块,用于判断所述用户语句是否包含常规问题;A first determining module, configured to determine whether the user sentence contains a conventional question;
    第一输出模块,用于当所述第一判断模块的判断结果为是时,在数据库中调取与所述常规问题相对应的常规答案并输出;A first output module, configured to: when the judgment result of the first judgment module is yes, retrieve and output a conventional answer corresponding to the conventional question in a database;
    第二判断模块,用于当所述第一判断模块的判断结果为否时,判断所述用户语句中是否包含意图;A second determination module, configured to determine whether the user statement includes an intention when the determination result of the first determination module is no;
    第二输出模块,用于当所述第二判断模块的判断结果为是时,在所述数据库中调取与所述意图相应的会话流程并输出。A second output module is configured to: when the judgment result of the second judgment module is yes, retrieve and output a conversation flow corresponding to the intention in the database.
  20. 如权利要求19所述的会话交互装置,还包括:The conversation interaction device according to claim 19, further comprising:
    推测模块,用于当所述第二判断模块的判断结果为否时,根据所述用户语句进行意图推测;A guessing module, configured to make an intention inference according to the user sentence when the judgment result of the second judgment module is no;
    第三判断模块,用于判断所述意图推测中所得数值是否大于预设的阈值;A third determining module, configured to determine whether the value obtained in the intent guess is greater than a preset threshold;
    第三输出模块,用于当所述第三判断模块的判断结果为是时,在所述数据库中调取与所述意图相应的会话流程并输出。A third output module is configured to: when the determination result of the third determination module is yes, retrieve and output a conversation flow corresponding to the intent in the database.
PCT/CN2019/071301 2018-07-27 2019-01-11 Session interaction method and apparatus WO2020019686A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201810841590.9 2018-07-27
CN201810841590.9A CN109241251B (en) 2018-07-27 2018-07-27 Conversation interaction method

Publications (1)

Publication Number Publication Date
WO2020019686A1 true WO2020019686A1 (en) 2020-01-30

Family

ID=65073119

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/071301 WO2020019686A1 (en) 2018-07-27 2019-01-11 Session interaction method and apparatus

Country Status (2)

Country Link
CN (1) CN109241251B (en)
WO (1) WO2020019686A1 (en)

Cited By (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111324814A (en) * 2020-03-05 2020-06-23 中国建设银行股份有限公司 Control method, device and system of intelligent equipment
CN111339745A (en) * 2020-03-06 2020-06-26 京东方科技集团股份有限公司 Follow-up report generation method, device, electronic device and storage medium
CN111611362A (en) * 2020-04-07 2020-09-01 安徽慧医信息科技有限公司 Skill development method for realizing active interaction between system and user based on tree data
CN111813896A (en) * 2020-07-13 2020-10-23 重庆紫光华山智安科技有限公司 Text triple relation identification method and device, training method and electronic equipment
CN111814484A (en) * 2020-07-03 2020-10-23 海信视像科技股份有限公司 Semantic recognition method and device, electronic equipment and readable storage medium
CN112463959A (en) * 2020-10-29 2021-03-09 中国人寿保险股份有限公司 Service processing method based on uplink short message and related equipment
CN112669011A (en) * 2020-12-30 2021-04-16 招联消费金融有限公司 Intelligent dialogue method and device, computer equipment and storage medium
CN112860850A (en) * 2021-01-21 2021-05-28 平安科技(深圳)有限公司 Man-machine interaction method, device, equipment and storage medium
CN113064986A (en) * 2021-04-30 2021-07-02 中国平安人寿保险股份有限公司 Model generation method, system, computer device and storage medium
CN113127731A (en) * 2021-03-16 2021-07-16 西安理工大学 Knowledge graph-based personalized test question recommendation method
CN113434633A (en) * 2021-06-28 2021-09-24 平安科技(深圳)有限公司 Social topic recommendation method, device, equipment and storage medium based on head portrait
CN113743124A (en) * 2021-08-25 2021-12-03 南京星云数字技术有限公司 Intelligent question-answer exception processing method and device and electronic equipment
CN116521822A (en) * 2023-03-15 2023-08-01 上海帜讯信息技术股份有限公司 User intention recognition method and device based on 5G message multi-round session mechanism

Families Citing this family (20)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110020913A (en) * 2019-02-20 2019-07-16 中国人民财产保险股份有限公司 Products Show method, equipment and storage medium
CN110096570B (en) * 2019-04-09 2021-03-30 苏宁易购集团股份有限公司 Intention identification method and device applied to intelligent customer service robot
CN110134765B (en) * 2019-05-05 2021-06-29 杭州师范大学 Restaurant user comment analysis system and method based on emotion analysis
CN110287285B (en) * 2019-05-31 2023-06-16 平安科技(深圳)有限公司 Method and device for identifying problem intention, computer equipment and storage medium
CN110399472B (en) * 2019-06-17 2022-07-15 平安科技(深圳)有限公司 Interview question prompting method and device, computer equipment and storage medium
CN110377715A (en) * 2019-07-23 2019-10-25 天津汇智星源信息技术有限公司 Reasoning type accurate intelligent answering method based on legal knowledge map
CN110580284B (en) * 2019-07-31 2023-08-18 平安科技(深圳)有限公司 Entity disambiguation method, device, computer equipment and storage medium
CN110750628A (en) * 2019-09-09 2020-02-04 深圳壹账通智能科技有限公司 Session information interaction processing method and device, computer equipment and storage medium
CN110781280A (en) * 2019-10-21 2020-02-11 深圳众赢维融科技有限公司 Knowledge graph-based voice assisting method and device
CN110968674B (en) * 2019-12-04 2023-04-18 电子科技大学 Method for constructing question and comment pairs based on word vector representation
CN111143545A (en) * 2019-12-31 2020-05-12 北京明略软件系统有限公司 Insurance data acquisition method and device, electronic equipment and computer storage medium
CN113468297B (en) * 2020-03-30 2024-02-27 阿里巴巴集团控股有限公司 Dialogue data processing method and device, electronic equipment and storage equipment
CN111475631B (en) * 2020-04-05 2022-12-06 北京亿阳信通科技有限公司 Disease question-answering method and device based on knowledge graph and deep learning
CN111694939B (en) * 2020-04-28 2023-09-19 平安科技(深圳)有限公司 Method, device, equipment and storage medium for intelligent robot calling
CN111666400B (en) * 2020-07-10 2023-10-13 腾讯科技(深圳)有限公司 Message acquisition method, device, computer equipment and storage medium
CN112183098B (en) * 2020-09-30 2022-05-06 完美世界(北京)软件科技发展有限公司 Session processing method and device, storage medium and electronic device
CN111930854B (en) * 2020-10-10 2021-01-08 北京福佑多多信息技术有限公司 Intention prediction method and device
CN113240438A (en) * 2021-05-11 2021-08-10 京东数字科技控股股份有限公司 Intention recognition method, device, storage medium and program product
CN113918679A (en) * 2021-09-22 2022-01-11 三一汽车制造有限公司 Knowledge question and answer method and device and engineering machinery
CN117078270B (en) * 2023-10-17 2024-02-02 彩讯科技股份有限公司 Intelligent interaction method and device for network product marketing

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20110095083A (en) * 2010-02-16 2011-08-24 윤재민 System and method for analyzing continuous sound, expressing emotion and producing communication about pet dog
CN106294341A (en) * 2015-05-12 2017-01-04 阿里巴巴集团控股有限公司 A kind of Intelligent Answer System and theme method of discrimination thereof and device
CN106407333A (en) * 2016-09-05 2017-02-15 北京百度网讯科技有限公司 Artificial intelligence-based spoken language query identification method and apparatus
CN107193853A (en) * 2016-12-08 2017-09-22 孙瑞峰 A kind of social scenario building method and system based on linguistic context
CN108090174A (en) * 2017-12-14 2018-05-29 北京邮电大学 A kind of robot answer method and device based on system function syntax

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2017175363A1 (en) * 2016-04-07 2017-10-12 株式会社アドバンスト・メディア Information processing system, reception server, information processing method and program
CN106649704B (en) * 2016-12-20 2020-04-07 竹间智能科技(上海)有限公司 Intelligent conversation control method and system
CN107025278A (en) * 2017-03-27 2017-08-08 竹间智能科技(上海)有限公司 Based on interactive user portrait extraction method and device
CN107562856A (en) * 2017-08-28 2018-01-09 深圳追科技有限公司 A kind of self-service customer service system and method
CN107729549B (en) * 2017-10-31 2021-05-11 深圳追一科技有限公司 Robot customer service method and system including element extraction
CN108038234B (en) * 2017-12-26 2021-06-15 众安信息技术服务有限公司 Automatic question template generating method and device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20110095083A (en) * 2010-02-16 2011-08-24 윤재민 System and method for analyzing continuous sound, expressing emotion and producing communication about pet dog
CN106294341A (en) * 2015-05-12 2017-01-04 阿里巴巴集团控股有限公司 A kind of Intelligent Answer System and theme method of discrimination thereof and device
CN106407333A (en) * 2016-09-05 2017-02-15 北京百度网讯科技有限公司 Artificial intelligence-based spoken language query identification method and apparatus
CN107193853A (en) * 2016-12-08 2017-09-22 孙瑞峰 A kind of social scenario building method and system based on linguistic context
CN108090174A (en) * 2017-12-14 2018-05-29 北京邮电大学 A kind of robot answer method and device based on system function syntax

Cited By (22)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111324814A (en) * 2020-03-05 2020-06-23 中国建设银行股份有限公司 Control method, device and system of intelligent equipment
CN111339745A (en) * 2020-03-06 2020-06-26 京东方科技集团股份有限公司 Follow-up report generation method, device, electronic device and storage medium
CN111611362A (en) * 2020-04-07 2020-09-01 安徽慧医信息科技有限公司 Skill development method for realizing active interaction between system and user based on tree data
CN111611362B (en) * 2020-04-07 2023-03-31 安徽慧医信息科技有限公司 Skill development method for realizing active interaction between system and user based on tree data
CN111814484B (en) * 2020-07-03 2024-01-26 海信视像科技股份有限公司 Semantic recognition method, semantic recognition device, electronic equipment and readable storage medium
CN111814484A (en) * 2020-07-03 2020-10-23 海信视像科技股份有限公司 Semantic recognition method and device, electronic equipment and readable storage medium
CN111813896A (en) * 2020-07-13 2020-10-23 重庆紫光华山智安科技有限公司 Text triple relation identification method and device, training method and electronic equipment
CN111813896B (en) * 2020-07-13 2022-12-02 重庆紫光华山智安科技有限公司 Text triple relation identification method and device, training method and electronic equipment
CN112463959A (en) * 2020-10-29 2021-03-09 中国人寿保险股份有限公司 Service processing method based on uplink short message and related equipment
CN112669011A (en) * 2020-12-30 2021-04-16 招联消费金融有限公司 Intelligent dialogue method and device, computer equipment and storage medium
CN112669011B (en) * 2020-12-30 2024-03-22 招联消费金融股份有限公司 Intelligent dialogue method, intelligent dialogue device, computer equipment and storage medium
CN112860850B (en) * 2021-01-21 2022-08-30 平安科技(深圳)有限公司 Man-machine interaction method, device, equipment and storage medium
CN112860850A (en) * 2021-01-21 2021-05-28 平安科技(深圳)有限公司 Man-machine interaction method, device, equipment and storage medium
CN113127731B (en) * 2021-03-16 2024-01-30 北京第一因科技有限公司 Personalized test question recommendation method based on knowledge graph
CN113127731A (en) * 2021-03-16 2021-07-16 西安理工大学 Knowledge graph-based personalized test question recommendation method
CN113064986B (en) * 2021-04-30 2023-07-25 中国平安人寿保险股份有限公司 Model generation method, system, computer device and storage medium
CN113064986A (en) * 2021-04-30 2021-07-02 中国平安人寿保险股份有限公司 Model generation method, system, computer device and storage medium
CN113434633A (en) * 2021-06-28 2021-09-24 平安科技(深圳)有限公司 Social topic recommendation method, device, equipment and storage medium based on head portrait
CN113743124A (en) * 2021-08-25 2021-12-03 南京星云数字技术有限公司 Intelligent question-answer exception processing method and device and electronic equipment
CN113743124B (en) * 2021-08-25 2024-03-29 南京星云数字技术有限公司 Intelligent question-answering exception processing method and device and electronic equipment
CN116521822A (en) * 2023-03-15 2023-08-01 上海帜讯信息技术股份有限公司 User intention recognition method and device based on 5G message multi-round session mechanism
CN116521822B (en) * 2023-03-15 2024-02-13 上海帜讯信息技术股份有限公司 User intention recognition method and device based on 5G message multi-round session mechanism

Also Published As

Publication number Publication date
CN109241251A (en) 2019-01-18
CN109241251B (en) 2022-05-27

Similar Documents

Publication Publication Date Title
WO2020019686A1 (en) Session interaction method and apparatus
US11651163B2 (en) Multi-turn dialogue response generation with persona modeling
CN111709233B (en) Intelligent diagnosis guiding method and system based on multi-attention convolutional neural network
CN111506714A (en) Knowledge graph embedding based question answering
US11893345B2 (en) Inducing rich interaction structures between words for document-level event argument extraction
CN111274365B (en) Intelligent inquiry method and device based on semantic understanding, storage medium and server
CN110737758A (en) Method and apparatus for generating a model
US20200365239A1 (en) System and method for generating clinical trial protocol design document with selection of patient and investigator
WO2023029502A1 (en) Method and apparatus for constructing user portrait on the basis of inquiry session, device, and medium
CN112509690B (en) Method, apparatus, device and storage medium for controlling quality
CN117076653B (en) Knowledge base question-answering method based on thinking chain and visual lifting context learning
WO2022227203A1 (en) Triage method, apparatus and device based on dialogue representation, and storage medium
Patra A survey of community question answering
CN116992007B (en) Limiting question-answering system based on question intention understanding
CN115274086A (en) Intelligent diagnosis guiding method and system
CN115714030A (en) Medical question-answering system and method based on pain perception and active interaction
CN113705207A (en) Grammar error recognition method and device
CN113392205A (en) User portrait construction method, device and equipment and storage medium
CN114372454A (en) Text information extraction method, model training method, device and storage medium
CN116030944A (en) Medical consultation information recommendation method and system
CN114911940A (en) Text emotion recognition method and device, electronic equipment and storage medium
CN114756679A (en) Chinese medical text entity relation combined extraction method based on conversation attention mechanism
CN117591663B (en) Knowledge graph-based large model promt generation method
CN115129364B (en) Fingerprint identity recognition method and system based on abstract syntax tree and graph neural network
CN113704443B (en) Dialog generation method integrating explicit personalized information and implicit personalized information

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 19840464

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205 DATED 06/05/2021)

122 Ep: pct application non-entry in european phase

Ref document number: 19840464

Country of ref document: EP

Kind code of ref document: A1