CN118069813A - A method, device, terminal device and storage medium for processing dialogue interaction - Google Patents

A method, device, terminal device and storage medium for processing dialogue interaction Download PDF

Info

Publication number
CN118069813A
CN118069813A CN202410371837.0A CN202410371837A CN118069813A CN 118069813 A CN118069813 A CN 118069813A CN 202410371837 A CN202410371837 A CN 202410371837A CN 118069813 A CN118069813 A CN 118069813A
Authority
CN
China
Prior art keywords
keyword
intention
slot
chat
similarity
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202410371837.0A
Other languages
Chinese (zh)
Inventor
苏立伟
谭火超
陶飞达
刘振华
康峰
曹彦朝
杨秋勇
李庭磊
梁瑞莹
张艳
苏林峰
叶枝平
舒畅
李文虎
皮伟丰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong Power Grid Co Ltd
Customer Service Center of Guangdong Power Grid Co Ltd
Original Assignee
Guangdong Power Grid Co Ltd
Customer Service Center of Guangdong Power Grid Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangdong Power Grid Co Ltd, Customer Service Center of Guangdong Power Grid Co Ltd filed Critical Guangdong Power Grid Co Ltd
Priority to CN202410371837.0A priority Critical patent/CN118069813A/en
Publication of CN118069813A publication Critical patent/CN118069813A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/33Querying
    • G06F16/332Query formulation
    • G06F16/3329Natural language query formulation
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/36Creation of semantic tools, e.g. ontology or thesauri
    • G06F16/367Ontology
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/22Matching criteria, e.g. proximity measures
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/279Recognition of textual entities
    • G06F40/284Lexical analysis, e.g. tokenisation or collocates
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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 OR CALCULATING; 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
    • G06F40/295Named entity recognition
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/30Semantic analysis

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Artificial Intelligence (AREA)
  • Computational Linguistics (AREA)
  • Data Mining & Analysis (AREA)
  • General Health & Medical Sciences (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Health & Medical Sciences (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Mathematical Physics (AREA)
  • Databases & Information Systems (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Evolutionary Biology (AREA)
  • Evolutionary Computation (AREA)
  • Animal Behavior & Ethology (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Human Computer Interaction (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Machine Translation (AREA)

Abstract

本发明公开了一种对话交互处理方法、装置、终端设备及存储介质,所述方法包括:对用户输入的文字输入数据进行关键词提取,获取关键词数据集,接着将关键词数据集与预设的语义槽进行比对,确定用户的聊天意图;若聊天意图为闲聊意图,则直接根据预设的闲聊模块输出用于闲聊的第一回复文本;若聊天意图为非闲聊意图,那么需要从预设的QA知识库中获取候选问题集合并计算相似度,获取相似度最大的目标候选问题,进而获取目标候选问题所对应的目标回复文本并作为用于回答用户的第二回复文本。通过实施本发明可以同时兼顾闲聊状态和非闲聊状态下的对话交互,不需要再预先通过手动调节或者选择对应的对话模式,提高了用户使用智能客服对话的便利性。

The present invention discloses a method, device, terminal device and storage medium for processing dialogue interaction, the method comprising: extracting keywords from text input data input by a user, obtaining a keyword data set, then comparing the keyword data set with a preset semantic slot to determine the user's chat intention; if the chat intention is a small talk intention, directly outputting a first reply text for small talk according to a preset small talk module; if the chat intention is a non-small talk intention, then it is necessary to obtain a candidate question set from a preset QA knowledge base and calculate the similarity, obtain a target candidate question with the greatest similarity, and then obtain a target reply text corresponding to the target candidate question and use it as a second reply text for answering the user. By implementing the present invention, dialogue interactions in small talk state and non-small talk state can be taken into account at the same time, and there is no need to manually adjust or select the corresponding dialogue mode in advance, which improves the convenience of users using intelligent customer service dialogue.

Description

Dialogue interaction processing method and device, terminal equipment and storage medium
Technical Field
The present invention relates to the field of intelligent customer service conversations, and in particular, to a method and apparatus for processing a conversation interaction, a terminal device, and a storage medium.
Background
At present, when a large group of clients need to communicate, for example, the retail industry has a large number of stores, hundreds and thousands of stores, manpower customer service resources are often insufficient, or under the condition that customer service manpower expense is expected to be reduced, a plurality of enterprises can adopt a scheme of firstly enabling the clients to communicate with an automatic service system and then delivering manual service after the automatic system fails to solve the problem, so that the overall efficiency of the service is improved; therefore, various intelligent customer services are also developed, and the intelligent customer services can be specifically classified into task types, question-answering types and boring types according to the functional emphasis. The task type can acquire useful information through a single-round or multi-round dialogue mode to help the service object to complete certain tasks, the question-answering type is only used for replying to the problem, and the boring type can carry out interactive boring with the service object.
However, at present, three types of intelligent customer service can achieve good effects in the respective focused fields, but the three types of intelligent customer service are deficient in the scene of considering various chat modes, and users need to adjust or select according to different dialogue requirements, so that the efficiency is low.
Disclosure of Invention
The invention provides a dialogue interaction processing method, a dialogue interaction processing device, a terminal device and a storage medium, which can simultaneously give consideration to dialogue interaction in a boring state and a non-boring state, do not need to manually adjust or select corresponding dialogue modes in advance, and improve the convenience of using intelligent customer service dialogue by a user. .
The invention provides a dialogue interaction processing method, which comprises the following steps: acquiring text input data input by a user;
extracting keywords from the text input data to obtain a keyword data set;
Comparing the keyword data set with a preset semantic slot, and determining chat intention of a user according to the comparison result; wherein the chat intent comprises: chat intents and non-chat intents;
When the chat intention is a chat intention, calling a preset chat module to enable the chat module to acquire a first reply text for answering a user according to the text input data; when the chat intention is not the chatting intention, acquiring a candidate problem set from a preset QA knowledge base according to the text input data and the keyword data set, acquiring a target candidate problem with the maximum similarity with the text input data from the candidate problem set according to the text input data and the candidate problem set, acquiring a target reply text corresponding to the target candidate problem, and taking the target reply text as a second reply text for answering a user.
Further, the semantic slot includes: the system comprises fault entity slots for representing service related problem main bodies, processing request slots for representing problem processing request keywords and processing attribute slots for representing corresponding specific processing points of problem entities.
Further, the comparing the keyword dataset with a preset semantic slot, and determining the chat intention of the user according to the comparison result includes:
Comparing each keyword in the keyword data set with a preset semantic slot, and if each keyword does not belong to a fault entity slot, a processing request slot and a processing attribute slot, or only one keyword in each keyword belongs to a keyword of the processing request slot, and the other keywords do not belong to keywords of the fault entity slot and the processing attribute slot, determining that chat intention of a user is chatting intention; otherwise, determining that the chat intention of the user is a non-boring chat intention.
Further, the non-boring intent includes: strong processing intent, query intent, polling intent, and unknown intent;
If the keyword data set has a keyword belonging to a fault entity slot, a keyword belonging to a processing request slot and a keyword belonging to a processing attribute slot, determining that the non-boring intention is a strong processing intention;
If the keyword data set has a keyword belonging to the processing request slot and a keyword belonging to the processing attribute slot, determining the non-boring intent as the processing intent;
If the keyword data set has a keyword belonging to a fault entity slot, or has a keyword belonging to a fault entity slot and a keyword belonging to a processing request slot, or has a keyword belonging to a fault entity slot and a keyword belonging to a processing attribute slot, determining the non-chatting intention as an inquiry intention;
If only one keyword in the keyword data set belongs to the keyword of the processing attribute slot, determining the non-boring intent as the polling intent;
And if at least two keywords in the keyword data set belong to keywords of the fault entity slot, and/or at least two keywords belong to keywords of the processing attribute slot, determining that the non-boring intention is an unknown intention.
Further, the obtaining, according to the text input data and the candidate question set, a target candidate question with the maximum similarity with the text input data from the candidate question set includes:
Calculating semantic similarity of the text input data and each candidate problem in the candidate problem set, and obtaining first similarity;
Calculating semantic similarity between the context of the text input data and each candidate problem context in the candidate problem set, and obtaining second similarity;
Calculating the similarity between the abstract information of the text input data and the abstract information of each candidate problem in the candidate problem set, and obtaining a third similarity;
And calculating the target similarity of the text input data and each candidate problem in the candidate problem set according to the first similarity, the second similarity and the third similarity, and taking the candidate problem with the maximum target similarity as a target candidate problem.
Further, the target similarity between the text input data and each candidate question in the candidate question set is calculated by the following formula:
wherein, Similarity of the calculated candidate questions to the current input; /(I)Representing a first similarity of the candidate question to the current input; sim (C k,Di) represents a second similarity of the candidate question to the current input; Representing a third similarity of the candidate question to the current input; lambda 1、λ2 and lambda 3 are respectively preset weighting coefficients.
Further, the keyword extraction is performed on the text input data to obtain a keyword dataset, including:
and recognizing and extracting keywords with parts of speech being nouns or verbs in the text input data, and establishing a keyword data set according to the extracted keywords.
On the basis of the method item embodiments, the invention correspondingly provides device item embodiments;
the invention provides a dialogue interaction processing device, which comprises: the system comprises a data acquisition module, a keyword extraction module, a chat intention module and a text acquisition module;
the data acquisition module is used for acquiring text input data input by a user;
the keyword extraction module is used for extracting keywords from the text input data to obtain a keyword data set;
The chat intention module is used for comparing the keyword data set with a preset semantic slot, and determining the chat intention of the user according to the comparison result; wherein the chat intent comprises: chat intents and non-chat intents;
The text acquisition module is used for calling a preset chatting module when the chatting intention is the chatting intention, so that the chatting module acquires a first reply text for answering a user according to the text input data; when the chat intention is not the chatting intention, acquiring a candidate problem set from a preset QA knowledge base according to the text input data and the keyword data set, acquiring a target candidate problem with the maximum similarity with the text input data from the candidate problem set according to the text input data and the candidate problem set, acquiring a target reply text corresponding to the target candidate problem, and taking the target reply text as a second reply text for answering a user.
On the basis of the method item embodiment, the invention correspondingly provides a terminal equipment item embodiment;
The invention provides a terminal device, which comprises a processor, a memory and a computer program stored in the memory and configured to be executed by the processor, wherein the processor realizes any one of the dialogue interaction processing methods when executing the computer program.
Based on the method item embodiment, the invention correspondingly provides a storage medium item embodiment;
The invention provides a storage medium which comprises a stored computer program, wherein the computer program controls equipment where the storage medium is located to execute any one of the dialogue interaction processing methods when running.
The embodiment of the invention has the following beneficial effects:
The invention provides a dialogue interaction processing method, a dialogue interaction processing device, terminal equipment and a storage medium; the method comprises the steps of extracting keywords from text input data input by a user after the text input data are acquired, and acquiring a keyword data set; and comparing the acquired keyword data set with a preset semantic slot, so that the chat intention of the user can be determined. If the chat intention of the user is the chat intention, directly calling the existing preset chat module and directly outputting a first reply text for the chat; if the chat intention of the user is not the chatting intention, a candidate question set is required to be acquired from a preset QA knowledge base, a target candidate question with the maximum similarity with the text input data is calculated, and then a target reply text corresponding to the target candidate question is acquired and used as a second reply text for answering the user. By implementing the invention, the conversation interaction in the boring state and the non-boring state can be simultaneously considered, and the corresponding conversation mode does not need to be manually adjusted or selected in advance, so that the convenience of using intelligent customer service conversations by the user is improved.
Drawings
FIG. 1 is a schematic flow chart of a method for processing dialogue interaction according to an embodiment of the invention;
FIG. 2 is a flow chart of another method for processing dialogue interaction according to an embodiment of the invention;
FIG. 3 is a schematic diagram of a finite state machine modeling business logic flow according to an embodiment of the present invention;
FIG. 4 is a schematic diagram of multi-round dialogue and keyword extraction according to an embodiment of the present invention;
Fig. 5 is a schematic structural diagram of a dialogue interaction processing device according to an embodiment of the present invention.
Detailed Description
The following description of the embodiments of the present invention will be made more apparent and fully hereinafter with reference to the accompanying drawings, in which some, but not all embodiments of the invention are shown. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
As shown in fig. 1, a method for processing dialogue interaction according to an embodiment includes:
Step S101, acquiring text input data input by a user;
step S102, extracting keywords from the text input data to obtain a keyword dataset;
Step S103, comparing the keyword data set with a preset semantic slot, and determining chat intention of a user according to the comparison result; wherein the chat intent comprises: chat intents and non-chat intents;
Step S104, when the chat intention is a chatting intention, calling a preset chatting module to enable the chatting module to acquire a first reply text for answering a user according to the text input data; when the chat intention is not the chatting intention, acquiring a candidate problem set from a preset QA knowledge base according to the text input data and the keyword data set, acquiring a target candidate problem with the maximum similarity with the text input data from the candidate problem set according to the text input data and the candidate problem set, acquiring a target reply text corresponding to the target candidate problem, and taking the target reply text as a second reply text for answering a user.
For step S101, in a preferred embodiment, text input data entered by a user is obtained while performing a dialogue interaction with the user.
For step S102, in a preferred embodiment, keyword extraction is performed on the text input data to obtain a keyword dataset, which specifically includes:
After the text input data is obtained, the keywords with the parts of speech being nouns or verbs in the text input data are identified, and then the keywords with the identified parts of speech being nouns or verbs are extracted to establish a keyword data set. The method for identifying the keyword with part of speech as noun or verb is any method in the prior art, and the invention is not particularly limited.
For step S103, in a preferred embodiment, the semantic slots include, but are not limited to: the system comprises a fault entity slot for representing a business related problem main body, a processing request slot for representing a problem processing request and a processing attribute slot for representing a corresponding specific processing point of a problem entity.
Comparing the keyword dataset with a preset semantic slot, and determining chat intention of a user according to the comparison result, wherein the method specifically comprises the following steps:
And comparing each keyword in the keyword data set with each preset semantic slot, and determining chat intention of the user as chatting intention if each keyword does not belong to the fault entity slot, the processing request slot and the processing attribute slot or only one keyword in each keyword belongs to the keyword of the processing request slot and the other keywords do not belong to the keywords of the fault entity slot and the processing attribute slot. Otherwise, determining that the chat intention of the user is a non-boring chat intention.
Judging that the chat intention of the user is a chatting intention, wherein the chatting intention is mainly based on a comparison result of keywords and preset semantic slots, if all the keywords do not belong to the preset slots, or only one keyword belongs to a processing request slot, and the other keywords do not belong to a fault entity and a processing attribute slot, the chatting content of the user is indicated to not relate to preset service related problems, or only to processing requests but not to specific problem entities and attributes; in this case, the chat intention of the user is more prone to boring, and thus the chat intention of the user is judged as boring.
In a preferred embodiment, the non-boring intent includes: strong processing intent, query intent, polling intent, and unknown intent;
If the keyword data set has a keyword belonging to a fault entity slot, a keyword belonging to a processing request slot and a keyword belonging to a processing attribute slot, determining that the non-boring intention is a strong processing intention;
If the keyword data set has a keyword belonging to the processing request slot and a keyword belonging to the processing attribute slot, determining the non-boring intent as the processing intent;
If the keyword data set has a keyword belonging to a fault entity slot, or has a keyword belonging to a fault entity slot and a keyword belonging to a processing request slot, or has a keyword belonging to a fault entity slot and a keyword belonging to a processing attribute slot, determining the non-chatting intention as an inquiry intention;
If only one keyword in the keyword data set belongs to the keyword of the processing attribute slot, determining the non-boring intent as the polling intent;
And if at least two keywords in the keyword data set belong to keywords of the fault entity slot, and/or at least two keywords belong to keywords of the processing attribute slot, determining that the non-boring intention is an unknown intention.
For step S104, in a preferred embodiment, when it is determined that the chat intention is a chat intention, then an existing preset chat module may be directly invoked, so that the chat module retrieves corresponding text according to the text input data to answer. The method for talking with the user under the chat intention belongs to the conventional means in the prior art, so the chat module is not particularly limited, and belongs to any chat module capable of realizing related functions in the prior art.
When the chat intention is determined to be not the chatting intention, searching a preset QA knowledge base according to the text input data and the keyword data set to obtain a candidate problem set with an association relation with the text input data and the keyword data set, and then obtaining a target candidate problem with the maximum similarity with the text input data from the candidate problem set according to the text input data and the candidate problem set; because the target reply texts corresponding to the target candidate questions are all data pre-stored in the QA knowledge base, after the target candidate questions are determined, the corresponding target reply texts can be directly obtained, and then the target reply texts are used as second reply texts for answering the user.
In a preferred embodiment, according to the text input data and the candidate problem set, the method for obtaining the target candidate problem with the maximum similarity with the text input data from the candidate problem set specifically includes:
firstly, calculating semantic similarity of the text input data and each candidate problem in the candidate problem set, and obtaining first similarity;
then calculating semantic similarity between the context of the text input data and each candidate problem context in the candidate problem set, and obtaining a second similarity;
calculating the similarity between the abstract information of the text input data and the abstract information of each candidate problem in the candidate problem set, and obtaining a third similarity;
and finally, calculating the target similarity of the text input data and each candidate problem in the candidate problem set according to the first similarity, the second similarity and the third similarity, and taking the candidate problem with the maximum target similarity as a target candidate problem.
Optionally, the method for calculating the second similarity is: acquiring context distributed expression of the context of the current text input data through a cyclic neural network, and taking the context distributed expression as a first context distributed expression; respectively acquiring context distributed expressions of the contexts of the candidate questions in the candidate question set through a cyclic neural network to serve as second context distributed expressions; and finally, respectively calculating the similarity of the first context distributed expression and the second context distributed expression as the second similarity of the corresponding candidate problem and the current input.
The method for calculating the third similarity comprises the following steps: abstract extraction is carried out on the current text input data (also can be multi-round dialogue data) to obtain abstract information of the current multi-round dialogue; and respectively carrying out abstract extraction on each candidate multi-round dialogue in the candidate multi-round dialogue set to obtain abstract information of each candidate multi-round dialogue, and respectively calculating the similarity between the abstract information of the current multi-round dialogue and the abstract information of each candidate multi-round dialogue in the candidate multi-round dialogue set to serve as a third similarity between the corresponding candidate problem and the current input.
In a preferred embodiment, the target similarity between the text input data and each candidate problem in the candidate problem set is calculated by means of weighted summation, and the target similarity is expressed by the following formula:
wherein, Similarity of the calculated candidate questions to the current input; /(I)Representing a first similarity of the candidate question to the current input; sim (C k,Di) represents a second similarity of the candidate question to the current input; Representing a third similarity of the candidate question to the current input; lambda 1、λ2 and lambda 3 are respectively preset weighting coefficients.
In an alternative embodiment, as shown in fig. 2, the dialogue interaction processing method includes the following steps:
s1: receiving text input by a user;
S2: identifying user intention and analyzing slot positions;
s3: executing dialogue logic processing by using dialogue track trace backtracking and slot constraint according to FSM business logic to know whether the user has chat intention;
S4: if the chat intention is the chatting intention, calling a preset chatting module to perform query processing according to the text input to acquire a first reply text;
S5: if the chat intention is not the chatting intention, the multi-round multi-phone reply selection method based on the QA knowledge base reasoning is utilized to query and process the text input by the user, and a second reply text is obtained.
In an optional embodiment, for step S2, identifying the user intention and analyzing the slot, and determining the chat intention of the user specifically includes:
S21: and creating a semantic slot, wherein the semantic slot comprises three slots of a fault entity A, a processing request B and a processing attribute C. Specifically, the fault entity a refers to a business related problem body, such as "how bad my computer screen, how do it need to be repaired? "wherein" computer "is the failed entity. Processing request B refers to keywords that can represent problem processing requests, such as "repair", "how do", "are? ". The processing attribute C represents a specific processing point corresponding to the problem entity, for example, the "screen" is the "computer" processing attribute.
S22: and carrying out semantic extraction on the text input, and judging the intention of the text input as boring intention if the keyword belonging to any slot position in the semantic slot cannot be extracted from the text input or only one keyword belonging to a processing request is extracted from the text input. Specifically, if only keywords belonging to the processing request exist in the semantics of the text input, or keywords with no available semantics exist, the text input can be determined to be boring. Otherwise, judging the intention of the text input as a non-boring intention.
In this embodiment, the non-boring intents include strong processing intents, query intents, polling intents, and unknown intents. And if a keyword belonging to a fault entity, a keyword belonging to a processing request and a keyword belonging to a processing attribute are extracted from the text input, judging that the intention of the text input is a strong processing intention.
And if a keyword belonging to a processing request and a keyword belonging to a processing attribute are extracted from the text input, judging that the intention of the text input is the processing intention.
And if a keyword belonging to the fault entity is extracted from the text input, or a keyword belonging to the fault entity and a keyword belonging to the processing request are extracted, or a keyword belonging to the fault entity and a keyword belonging to the processing attribute are extracted, judging that the intention of the text input is the query intention.
If only one keyword belonging to the processing attribute is extracted from the text input, judging that the intention of the text input is a polling intention.
And if a plurality of keywords belonging to the fault entity are extracted from the text input and/or a plurality of keywords belonging to the processing attribute, judging that the intention of the text input is unknown.
In an alternative embodiment, for step S3, as shown in fig. 3: executing dialogue logic processing by using dialogue track trace backtracking and slot constraint according to FSM business logic to know whether a user has chat intention or not, and specifically comprising the following steps:
S31: updating probability distribution of state tracking by using the identified user intention and/or the analysis slot;
s32: the FSM determines whether the dialogue state is transferred or not, and updates the dialogue track and the instant constraint;
S33: checking whether the current dialogue has slot negation or constraint modification;
S34: if yes, positioning a backtracking position according to the backtracking list, determining a transfer direction by the FSM, executing service logic according to the transferred state and the node position of the FSM, and continuing step S5;
s35: if not, service logic is executed according to the current state and the node position of the FSM, and the step S4 is continued. In this case, the state distribution may be updated in step S31 by the user intention and/or the analyzed slot recognized in step S22. Then in step S32, the finite state machine decides whether the dialogue state is transferred according to the current state distribution and the instant constraint list, and updates the dialogue track and the instant constraint. In step S33, it is checked whether there is a slot negation or constraint modification for the current dialog. If there is a negative slot or constraint modification, locating the trace-back position according to the trace-back list in step S34, determining a transfer direction by the finite state machine according to the updated state, and executing service logic of finite state machine modeling according to the transferred state and the node position of the finite state machine; if neither slot negation nor constraint modification exists, then in step S35, finite state machine modeled business logic is executed based on the current state and node locations of the finite state machine. FSM represents a finite state machine. That is, first, the state distribution is updated by recognizing the user intention and slot information, and then it is decided whether the dialog state is transferred according to the current state distribution and the instant constraint list, and the dialog track and the instant constraint are updated. Then, checking whether the current dialogue has negative slot position or constraint modification, if so, positioning the backtracking position according to the backtracking list, and determining the transfer direction according to the updated state; if not, executing the service logic of finite state machine modeling according to the current state and the node position of the finite state machine, wherein the processing flow is used for realizing the dynamic adjustment and flow control of the dialogue system.
The FSM node locations described above: a Finite State Machine (FSM) is a computational model that describes states and transitions of states of objects, and in a dialog system, FSM node locations can be understood as states or phases in which a current dialog is placed. Constraint modification: constraints refer to restrictions or regulations on certain behaviors or conditions, and in a dialog system, constraints may relate to restrictions on logic, flow, rules, etc. of a dialog, which may mean that the state or flow of the dialog needs to be adjusted or traced back if there is a slot negation or constraint modification. Positioning the backtracking position: backtracking is an algorithm, belonging to the prior art, for returning to a previous state and trying other paths during a search, where in a dialog system the backtracking location can be understood as the dialog state or step that needs to be returned. Finite state machine: a finite state machine is a computational model that describes states of a system or object and transitions between states, and in a dialog system, can be used to model the states and flow of a dialog.
Furthermore, the finite state machine is used to model business logic by setting the following basic state nodes: user node (UserNode): the node is responsible for receiving and analyzing the intention of a user query (query), the node is activated only if the user query is consistent with the intention of the analysis responsible for the node, and meanwhile, the node also has a dialogue slot collecting function, a plurality of nodes can be appointed and collected at the node, clarification and modification of slots are supported, and the user can inform the slot information according to any sequence. Robot node (BotNode): the node is responsible for informing the user of the execution result of the Dialogue Manager (DM) and has the function of dialogue logic guidance, and the user is guided to conduct dialogue according to the expected logic by sending a preset guidance language. Functional node (Funct ionNode, or FUNCNode): the node may execute a pre-set functional script or call a third party Application Program Interface (API) to perform some dialog-independent function using information collected during the dialog. Switching node (Swi tchNode): the node has a branch forwarding function, and is generally used for switching the logical branches of the dialogue according to the slots, global variables, function execution results and even intentions collected in the dialogue. Slot Node (S lot Node): the node is usually used for collecting the slot position which is dominant at the machine end, a plurality of nodes can be appointed to be collected at the node, clarification and modification of the slot position are supported, and a user can inform the slot position information according to any sequence. Topic node (SubNode): the node encapsulates functionality that invokes a specified topic, which is responsible for managing the triggering and result return of the topic. It enables a dependency nesting between topics. It is responsible for multiplexing the dialog logic, which can be packaged as a single topic, and any topic using the dialog logic can be multiplexed by the topic node.
In an alternative embodiment, as shown in fig. 4, step S5 includes the steps of:
Extracting keywords from the current multi-round dialogue to obtain a first keyword combination;
The method comprises the steps of taking a first keyword combination and current input as questions, retrieving a candidate question set from a QA knowledge base, acquiring corresponding contexts of each candidate question, and constructing a candidate multi-round dialogue set; the QA knowledge base is constructed based on a plurality of dialogue data sets acquired in advance;
Constructing a candidate multi-round dialogue set, which specifically comprises the following steps: searching the QA knowledge base according to the first keyword combination to obtain multiple rounds of conversations containing keywords in the first keyword combination as a first multiple rounds of conversation set; searching the QA knowledge base according to the current input to obtain N candidate sentences which are most similar to the current input and multiple rounds of conversations containing the sentences as a second multiple round of conversation set; and acquiring intersections of the first multi-round dialogue set and the second multi-round dialogue set to obtain a candidate problem set and a candidate multi-round dialogue set.
The construction method of the QA knowledge base comprises the following steps: performing word segmentation and keyword extraction on a multi-round dialogue data set acquired in advance; indexing the multi-round dialogue data set by using the keywords, and storing the keywords and IDs of the multi-round dialogues containing the keywords; for each multi-round dialogue, establishing an inverted index for each sentence, and storing the sentence containing the keyword, the ID of the multi-round dialogue to which the sentence belongs and the position of the sentence in the multi-round dialogue.
In an alternative embodiment, the natural language dialogue interactive processing method comprises the following working principles: firstly judging the chat intention of the user according to the text input of the user, distributing a corresponding query module according to the chat intention to perform query processing, obtaining a corresponding reply text, meeting the user requirement as much as possible, and efficiently completing the question-answering task. The method can be used without a great amount of data combined with deep learning to perform relation extraction, named entity recognition, intention recognition and training of natural language generation, and is aimed at general questions and answers. The method is oriented to small sample data, and the core logic is mainly realized by making rules, but not by a deep learning mode. The interactive robot implementing the method is suitable for retail industry, can flexibly expand, can flexibly and efficiently reply only by a small amount of data, and can freely add specific scenes. The reply selection method based on the QA knowledge base can effectively utilize the context information in the knowledge base and the context information of the current multi-round dialogue to push so as to greatly improve the relevance and rationality of reply sentences and improve the robustness of correctly selecting the reply sentences, thereby greatly improving the dialogue experience of users.
On the basis of the method item embodiments, the invention correspondingly provides the device item embodiments.
As shown in fig. 5, an embodiment of the present invention provides a dialogue interaction processing apparatus, including: the system comprises a data acquisition module, a keyword extraction module, a chat intention module and a text acquisition module;
the data acquisition module is used for acquiring text input data input by a user;
the keyword extraction module is used for extracting keywords from the text input data to obtain a keyword data set;
The chat intention module is used for comparing the keyword data set with a preset semantic slot, and determining the chat intention of the user according to the comparison result; wherein the chat intent comprises: chat intents and non-chat intents;
The text acquisition module is used for calling a preset chatting module when the chatting intention is the chatting intention, so that the chatting module acquires a first reply text for answering a user according to the text input data; when the chat intention is not the chatting intention, acquiring a candidate problem set from a preset QA knowledge base according to the text input data and the keyword data set, acquiring a target candidate problem with the maximum similarity with the text input data from the candidate problem set according to the text input data and the candidate problem set, acquiring a target reply text corresponding to the target candidate problem, and taking the target reply text as a second reply text for answering a user.
It should be noted that the apparatus embodiments described above are merely illustrative, and the modules described as separate components may or may not be physically separate, and components shown as modules may or may not be physical modules, i.e., may be located in one place, or may be distributed over multiple network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment. In addition, in the drawings of the embodiment of the device provided by the invention, the connection relation between the modules represents that the modules have communication connection, and can be specifically implemented as one or more communication buses or signal lines. Those of ordinary skill in the art will understand and implement the present invention without undue burden.
It will be clearly understood by those skilled in the art that, for convenience and brevity, the specific working process of the apparatus described above may refer to the corresponding process in the foregoing method embodiment, which is not described herein again.
On the basis of the method item embodiment, the invention correspondingly provides a terminal equipment item embodiment.
Another embodiment of the present invention provides a terminal device including a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor; when the processor executes the computer program, the dialogue interaction processing method according to any embodiment of the invention is realized.
Illustratively, in this embodiment the computer program may be partitioned into one or more modules, which are stored in the memory and executed by the processor to perform the present invention. The one or more module elements may be a series of computer program instruction segments capable of performing a specific function, the instruction segments describing the execution of the computer program in the device;
the terminal equipment can be computing equipment such as a desktop computer, a notebook computer, a palm computer, a cloud server and the like. The device may include, but is not limited to, a processor, a memory;
The Processor may be a central processing module (Centra l Process I ng Un it, CPU), or other general purpose Processor, digital signal Processor (DI GITA L SI GNA L Processor, DSP), application specific integrated circuit (APP L I CAT I on SPEC I F I C I NTEGRATED CI rcu it, AS ic), off-the-shelf programmable gate array (Fi e l d-Programmab L E GATE ARRAY, FPGA) or other programmable logic device, discrete gate or transistor logic device, discrete hardware components, or the like. The general purpose processor may be a microprocessor or the processor may be any conventional processor or the like, which is a control center of the device, and which connects various parts of the entire device using various interfaces and lines;
The memory may be used to store the computer program and/or modules, and the processor may implement various functions of the device by running or executing the computer program and/or modules stored in the memory, and invoking data stored in the memory. The memory may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function, and the like; in addition, the memory may include high-speed random access memory, and may also include non-volatile memory, such as a hard disk, memory, plug-in hard disk, smart memory card (SMART MED I A CARD, SMC), secure digital (Secure Di g ita l, SD) card, flash memory card (F L ASH CARD), at least one magnetic disk storage device, flash memory device, or other volatile solid-state storage device.
Based on the method item embodiments, the invention correspondingly provides storage medium item embodiments.
Another embodiment of the present invention provides a storage medium, where the storage medium includes a stored computer program, where when the computer program runs, the device where the storage medium is controlled to execute the dialogue interaction processing method according to any one of the embodiments of the present invention.
In this embodiment, the storage medium is a computer-readable storage medium, and the computer program includes computer program code, where the computer program code may be in a source code form, an object code form, an executable file, or some intermediate form, and so on. The computer readable medium may include: any entity or device capable of carrying the computer program code, a recording medium, a U disk, a removable hard disk, a magnetic disk, an optical disk, a computer Memory, a Read-On-y Memory (ROM), a random access Memory (RAM, random Access Memory), an electrical carrier signal, a telecommunications signal, a software distribution medium, and so forth.
The above embodiment of the present invention has the following effects by implementing the present invention:
1. The method can be used without a great amount of data combined with deep learning to perform relation extraction, named entity recognition, intention recognition and training of natural language generation, and is aimed at general questions and answers. The method is oriented to small sample data, and the core logic is mainly realized by making rules, but not by a deep learning mode.
2. The interactive robot implementing the method is suitable for retail industry, can flexibly expand, can flexibly and efficiently reply only by a small amount of data, and can freely add specific scenes.
3. The reply selection method based on the QA knowledge base can effectively utilize the context information in the knowledge base and the context information of the current multi-round dialogue to infer, can greatly improve the relevance and rationality of reply sentences, and improves the robustness of correctly selecting the reply sentences, thereby greatly improving the dialogue experience of users.
4. The method and the device can simultaneously give consideration to dialogue interaction in the boring state and the non-boring state, do not need to manually adjust or select corresponding dialogue modes in advance, and improve the convenience of using intelligent customer service dialogue by users.
While the foregoing is directed to the preferred embodiments of the present invention, it will be appreciated by those skilled in the art that changes and modifications may be made without departing from the principles of the invention, such changes and modifications are also intended to be within the scope of the invention.

Claims (10)

1. A method for processing dialogue interaction, comprising:
Acquiring text input data input by a user;
extracting keywords from the text input data to obtain a keyword data set;
Comparing the keyword data set with a preset semantic slot, and determining chat intention of a user according to the comparison result; wherein the chat intent comprises: chat intents and non-chat intents;
When the chat intention is a chat intention, calling a preset chat module to enable the chat module to acquire a first reply text for answering a user according to the text input data; when the chat intention is not the chatting intention, acquiring a candidate problem set from a preset QA knowledge base according to the text input data and the keyword data set, acquiring a target candidate problem with the maximum similarity with the text input data from the candidate problem set according to the text input data and the candidate problem set, acquiring a target reply text corresponding to the target candidate problem, and taking the target reply text as a second reply text for answering a user.
2. The dialog interaction processing method of claim 1, wherein the semantic slot comprises: the system comprises fault entity slots for representing service related problem main bodies, processing request slots for representing problem processing request keywords and processing attribute slots for representing corresponding specific processing points of problem entities.
3. The method for processing dialogue interaction as claimed in claim 2, wherein the comparing the keyword dataset with a preset semantic slot, and determining the chat intention of the user according to the comparison result comprises:
Comparing each keyword in the keyword data set with a preset semantic slot, and if each keyword does not belong to a fault entity slot, a processing request slot and a processing attribute slot, or only one keyword in each keyword belongs to a keyword of the processing request slot, and the other keywords do not belong to keywords of the fault entity slot and the processing attribute slot, determining that chat intention of a user is chatting intention; otherwise, determining that the chat intention of the user is a non-boring chat intention.
4. The conversational interaction processing method of claim 3, wherein the non-boring intent comprises: strong processing intent, query intent, polling intent, and unknown intent;
If the keyword data set has a keyword belonging to a fault entity slot, a keyword belonging to a processing request slot and a keyword belonging to a processing attribute slot, determining that the non-boring intention is a strong processing intention;
If the keyword data set has a keyword belonging to the processing request slot and a keyword belonging to the processing attribute slot, determining the non-boring intent as the processing intent;
If the keyword data set has a keyword belonging to a fault entity slot, or has a keyword belonging to a fault entity slot and a keyword belonging to a processing request slot, or has a keyword belonging to a fault entity slot and a keyword belonging to a processing attribute slot, determining the non-chatting intention as an inquiry intention;
If only one keyword in the keyword data set belongs to the keyword of the processing attribute slot, determining the non-boring intent as the polling intent;
And if at least two keywords in the keyword data set belong to keywords of the fault entity slot, and/or at least two keywords belong to keywords of the processing attribute slot, determining that the non-boring intention is an unknown intention.
5. The method of claim 4, wherein the obtaining, from the candidate problem set, the target candidate problem having the greatest similarity with the text input data according to the text input data and the candidate problem set, comprises:
Calculating semantic similarity of the text input data and each candidate problem in the candidate problem set, and obtaining first similarity;
Calculating semantic similarity between the context of the text input data and each candidate problem context in the candidate problem set, and obtaining second similarity;
Calculating the similarity between the abstract information of the text input data and the abstract information of each candidate problem in the candidate problem set, and obtaining a third similarity;
And calculating the target similarity of the text input data and each candidate problem in the candidate problem set according to the first similarity, the second similarity and the third similarity, and taking the candidate problem with the maximum target similarity as a target candidate problem.
6. The conversational interaction processing method of claim 5, wherein the target similarity of the text input data to each candidate question in the set of candidate questions is calculated by:
wherein, Similarity of the calculated candidate questions to the current input; /(I)Representing a first similarity of the candidate question to the current input; sim (C k,Di) represents a second similarity of the candidate question to the current input; Representing a third similarity of the candidate question to the current input; lambda 1、λ2 and lambda 3 are respectively preset weighting coefficients.
7. The method of claim 6, wherein the keyword extraction of the text input data to obtain a keyword dataset comprises:
and recognizing and extracting keywords with parts of speech being nouns or verbs in the text input data, and establishing a keyword data set according to the extracted keywords.
8. A dialog interaction handling device, comprising: the system comprises a data acquisition module, a keyword extraction module, a chat intention module and a text acquisition module;
the data acquisition module is used for acquiring text input data input by a user;
the keyword extraction module is used for extracting keywords from the text input data to obtain a keyword data set;
The chat intention module is used for comparing the keyword data set with a preset semantic slot, and determining the chat intention of the user according to the comparison result; wherein the chat intent comprises: chat intents and non-chat intents;
The text acquisition module is used for calling a preset chatting module when the chatting intention is the chatting intention, so that the chatting module acquires a first reply text for answering a user according to the text input data; when the chat intention is not the chatting intention, acquiring a candidate problem set from a preset QA knowledge base according to the text input data and the keyword data set, acquiring a target candidate problem with the maximum similarity with the text input data from the candidate problem set according to the text input data and the candidate problem set, acquiring a target reply text corresponding to the target candidate problem, and taking the target reply text as a second reply text for answering a user.
9. A terminal device comprising a processor, a memory and a computer program stored in the memory and configured to be executed by the processor, the processor implementing the dialog interaction handling method of any of claims 1 to 7 when the computer program is executed.
10. A storage medium comprising a stored computer program, wherein the computer program, when run, controls a device in which the storage medium is located to perform the dialog interaction handling method of any of claims 1 to 7.
CN202410371837.0A 2024-03-29 2024-03-29 A method, device, terminal device and storage medium for processing dialogue interaction Pending CN118069813A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202410371837.0A CN118069813A (en) 2024-03-29 2024-03-29 A method, device, terminal device and storage medium for processing dialogue interaction

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202410371837.0A CN118069813A (en) 2024-03-29 2024-03-29 A method, device, terminal device and storage medium for processing dialogue interaction

Publications (1)

Publication Number Publication Date
CN118069813A true CN118069813A (en) 2024-05-24

Family

ID=91105911

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202410371837.0A Pending CN118069813A (en) 2024-03-29 2024-03-29 A method, device, terminal device and storage medium for processing dialogue interaction

Country Status (1)

Country Link
CN (1) CN118069813A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN119441464A (en) * 2025-01-09 2025-02-14 浙江孚临科技有限公司 A method for identifying intentions in multi-round conversations in question-answering
CN120611727A (en) * 2025-08-12 2025-09-09 浪潮通用软件有限公司 Contract generation method and system based on multi-round dialogue interaction and intelligent element extraction

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN119441464A (en) * 2025-01-09 2025-02-14 浙江孚临科技有限公司 A method for identifying intentions in multi-round conversations in question-answering
CN120611727A (en) * 2025-08-12 2025-09-09 浪潮通用软件有限公司 Contract generation method and system based on multi-round dialogue interaction and intelligent element extraction

Similar Documents

Publication Publication Date Title
CA3040373C (en) Deep learning techniques based multi-purpose conversational agents for processing natural language queries
US11115353B1 (en) Conversational bot interaction with utterance ranking
CN108345690B (en) Intelligent question and answer method and system
CN118822705B (en) Financial artificial intelligence management service platform and financial business processing method
CN118069813A (en) A method, device, terminal device and storage medium for processing dialogue interaction
WO2026000596A1 (en) Task-oriented dialogue method, storage medium, and computer device
CN119670863A (en) Information generation method, device, electronic device and storage medium
CN107239450B (en) Method for processing natural language based on interactive context
CN119415661A (en) Method, device, equipment, medium and program product for responding to user question information
CN107958059B (en) Intelligent question answering method, device, terminal and computer readable storage medium
CN110795544B (en) Content searching method, device, equipment and storage medium
CN119759598B (en) Intelligent scheduling method of computing network resources based on large model intention perception
CN116974554A (en) Code data processing methods, devices, computer equipment and storage media
CN119884347A (en) Intelligent memory data processing method, system and nonvolatile storage medium
CN118838998A (en) Man-machine interaction method and device and computer readable storage medium
CN113704422A (en) Text recommendation method and device, computer equipment and storage medium
CN110008308A (en) For the method and apparatus of user's question sentence supplemental information
CN110795547A (en) Text recognition method and related product
CN110413627B (en) Information optimization method, device, server and storage medium
CN119884312A (en) Dialogue data processing method, system, equipment and medium
CN120030120A (en) Retrieval method, retrieval device and retrieval equipment based on knowledge graph and hybrid expert model
CN111858864B (en) Method, device, electronic device and readable medium for implementing slot filling
CN117827674A (en) Defect and test case matching method and device, electronic equipment and storage medium
CN113868396A (en) Task intelligent dialogue construction method and system based on knowledge graph
CN116561248B (en) An information processing method, apparatus and electronic device

Legal Events

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