A session method and apparatus
Patent Information
- Application Number
- CN202510186017.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-19
- Publication Date
- 2026-08-21
AI Technical Summary
现有的智能化对话服务主要集中在个体化的意图识别的实现方面,通过优化意图识别算法来提升整体的意图识别率,未能充分利用上下文意图识别之间的关联关系,致使在意图识别算法优化到一定程度后,很难进一步提升对话整体的意图识别率
[0026]所述发明中的一个实施例具有如下优点或有益效果:通过从目标用户的会话记录中获取待回复的会话内容,判断会话内容是否具有明确的会话意图;响应于会话内容不具有明确的会话意图,在预设的时间窗口内向前查询距离会话内容最近,且与会话内容属于同一话题的会话意图明确的第一历史会话内容,通过整合第一历史会话内容与会话内容,对会话内容进行意图识别;响应于会话内容具有明确的会话意图,在预设的时间窗口内向前查询距离会话内容最近,且与会话内容属于同一话题的会话意图不明确的第二历史会话内容,通过整合第二历史会话内容与会话内容,对会话内容进行意图识别;根据会话内容的意图识别结果,确定对应的应答类型,根据应答类型回复会话内容的技术方案,实现了一种更为准确且回复率高的会话方法,利用历史会话内容来提升意图识别率,不仅助力了会话回复率的提升,而且还保障了回复的准确率,进而提高了用户对智能化对话服务的满意度,以更好地推广应用于各个相关业务领域。
Smart Images

Figure CN122614979A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer technology, and more particularly to a conversation method and apparatus. Background Technology
[0002] With the development of intelligent technologies, intelligent models and algorithms have been applied to various business fields. Given the wide applicability of intelligent dialogue services across multiple business areas, further research on them is of practical significance. Existing intelligent dialogue services primarily focus on the implementation of individualized intent recognition, improving the overall intent recognition rate by optimizing the intent recognition algorithm. However, they fail to fully utilize the correlation between contextual intent recognition, making it difficult to further improve the overall intent recognition rate of the dialogue after the intent recognition algorithm has been optimized to a certain extent. Summary of the Invention
[0003] In view of this, embodiments of the present invention provide a conversation method and apparatus that achieve a more accurate and high-response conversation. By utilizing historical conversation content to improve intent recognition rate, it not only helps to improve the conversation response rate but also ensures the accuracy of the response, thereby improving user satisfaction with intelligent dialogue services and enabling better promotion and application in various related business fields.
[0004] To achieve the aforementioned objective, according to one aspect of an embodiment of the present invention, a session method is provided, comprising:
[0005] Obtain the content of the conversation to be replied to from the target user's conversation history, and determine whether the content of the conversation has a clear conversational intent;
[0006] In response to the fact that the conversation content does not have a clear conversation intent, the system queries forward within a preset time window the first historical conversation content that is closest to the conversation content and belongs to the same topic as the conversation content and has a clear conversation intent. By integrating the first historical conversation content with the conversation content, the system performs intent identification on the conversation content.
[0007] In response to the clear conversation intent of the conversation content, within a preset time window, a second historical conversation content with an unclear conversation intent that is closest to the conversation content and belongs to the same topic as the conversation content is queried backwards. By integrating the second historical conversation content with the conversation content, the intent of the conversation content is identified.
[0008] Based on the intent recognition result of the conversation content, determine the corresponding response type, and reply to the conversation content according to the response type.
[0009] Optionally, obtaining the session content to be replied to from the target user's session records includes: obtaining each session message to be replied to from the message queue, sorting each session message according to the timestamp of each session message to obtain a sequential session queue; obtaining the queue lock of the sequential session queue, sequentially reading the target user's session messages from the sequential session queue, storing the session messages into an independent session record pre-allocated to the target user, and releasing the queue lock; obtaining the session content to be replied to by the target user from the session record.
[0010] Optionally, by integrating the first historical session content and the session content, intent recognition of the session content is performed, including: integrating and rewriting the first historical session content and the session content to generate first integrated session content; determining whether there is an intent inheritance relationship between the first integrated session content and the first historical session content, and using the first integrated session content to replace the session content for intent recognition based on the determination result; by integrating the second historical session content and the session content, intent recognition of the session content is performed, including: integrating and rewriting the second historical session content and the session content to generate second integrated session content; determining whether there is an intent inheritance relationship between the second integrated session content and the session content, and using the second integrated session content to replace the session content for intent recognition based on the determination result.
[0011] Optionally, in response to the intent recognition result being multiple candidate intents, the corresponding response type is determined based on the intent recognition result of the conversation content, including: filtering out irrelevant intents from each of the candidate intents according to preset intent filtering conditions, generating intent selection scripts according to the filtered candidate intents, and sending them to the target user; receiving the target intent selected by the target user, and determining the corresponding response type according to the target intent.
[0012] Optionally, responding to the conversation content according to the response type includes: in response to the response type being an action type, invoking an action dispatcher to determine whether the keywords in the conversation content are complete; if incomplete, obtaining keywords from the target user, generating a corresponding response for the conversation content based on the obtained keywords, and sending the response to the target user; in response to the response type being a question-and-answer type, invoking a knowledge base to generate a corresponding response for the conversation content, and sending the response to the target user; in response to the response type being a casual conversation type, invoking a large model to generate a corresponding response for the conversation content, and sending the response to the target user.
[0013] Optionally, after receiving the target intent selected by the target user, the method further includes: recording the target intent selected by the target user for the session content; after generating a corresponding reply for the session content, the method further includes: recording the intent recognition result of the session content and the corresponding reply.
[0014] Optionally, before performing intent recognition on the session content, the method further includes: confirming that the first integrated session content or the second integrated session content has a clear session intent.
[0015] According to a second aspect of the present invention, a conversation apparatus is provided, comprising:
[0016] The conversation intent determination module is used to obtain the conversation content to be replied to from the conversation records of the target user and determine whether the conversation content has a clear conversation intent.
[0017] The intent recognition first module is used to respond to the fact that the conversation content does not have a clear conversation intent, and to query the first historical conversation content that is closest to the conversation content and belongs to the same topic as the conversation content within a preset time window and has a clear conversation intent, and to perform intent recognition on the conversation content by integrating the first historical conversation content and the conversation content.
[0018] The second intent recognition module is used to respond to the fact that the conversation content has a clear conversation intent, and within a preset time window, to query the second historical conversation content that is closest to the conversation content and belongs to the same topic as the conversation content but has an unclear conversation intent. By integrating the second historical conversation content with the conversation content, the intent of the conversation content is recognized.
[0019] The session response module is used to determine the corresponding response type based on the intent recognition result of the session content, and reply to the session content according to the response type.
[0020] According to a third aspect of the present invention, a session-enabled electronic device is provided, comprising:
[0021] One or more processors;
[0022] Storage device for storing one or more programs.
[0023] When the one or more programs are executed by the one or more processors, the one or more processors implement the method provided in the first aspect of the embodiments of the present invention.
[0024] According to a fourth aspect of the present invention, a computer-readable medium is provided having a computer program stored thereon, which, when executed by a processor, implements the method provided in the first aspect of the present invention.
[0025] According to a fifth aspect of the present invention, a computer program product is provided, comprising a computer program that, when executed by a processor, implements the method provided in the first aspect of the present invention.
[0026] One embodiment of the invention has the following advantages or beneficial effects: by obtaining the conversation content to be replied to from the target user's conversation records, it is determined whether the conversation content has a clear conversation intent; in response to the conversation content not having a clear conversation intent, within a preset time window, a first historical conversation content with a clear conversation intent that is closest to the conversation content and belongs to the same topic as the conversation content is queried backwards; by integrating the first historical conversation content and the current conversation content, the intent of the conversation content is identified; in response to the conversation content having a clear conversation intent, within a preset time window, a second historical conversation content with an unclear conversation intent that is closest to the conversation content and belongs to the same topic as the conversation content is queried backwards; by integrating the second historical conversation content and the current conversation content, the intent of the conversation content is identified; based on the intent identification result of the conversation content, the corresponding response type is determined, and the conversation content is replied to according to the response type. This technical solution realizes a more accurate and high-response-rate conversation method. By using historical conversation content to improve the intent recognition rate, it not only helps to improve the conversation response rate, but also ensures the accuracy of the response, thereby improving user satisfaction with intelligent dialogue services, so as to better promote its application in various related business fields. Attached Figure Description
[0027] The accompanying drawings are provided to better understand the invention and are not intended to unduly limit the scope of the invention. Wherein:
[0028] Figure 1 This is a schematic diagram of the main flow of the session method according to an embodiment of the present invention;
[0029] Figure 2 This is a flowchart of a session method according to a possible embodiment of the present invention;
[0030] Figure 3 This is a schematic diagram illustrating the specific steps of obtaining the conversation content to be replied to in an embodiment of the present invention;
[0031] Figure 4 This is a schematic diagram illustrating the storage of session records according to an embodiment of the present invention;
[0032] Figure 5 This is a schematic diagram of the intent recognition process according to an embodiment of the present invention;
[0033] Figure 6 This is a flowchart of a session method according to another possible embodiment of the present invention;
[0034] Figure 7 This is a schematic diagram illustrating the specific process of replying to conversation content according to an embodiment of the present invention;
[0035] Figure 8 This is a complete flowchart of the session method according to an embodiment of the present invention;
[0036] Figure 9 This is a schematic diagram of the main modules of the conversation device according to an embodiment of the present invention;
[0037] Figure 10 This is an exemplary system architecture diagram in which embodiments of the present invention can be applied;
[0038] Figure 11 This is a schematic diagram of the structure of a computer system suitable for implementing terminal devices or servers of the present invention. Detailed Implementation
[0039] It should be noted that the collection, updating, analysis, use, transmission, and storage of user personal information involved in the technical solution of this invention all comply with relevant laws and regulations, are used for legitimate and reasonable purposes, and are not shared, disclosed, or sold outside of these legitimate uses, and are subject to supervision and management by national regulatory authorities. Necessary measures should be taken to selectively block the use or access to personal information data to prevent unauthorized access to such personal information data, ensure that personnel authorized to access personal information data comply with relevant laws and regulations, and ensure the security of user personal information. Furthermore, once this user personal information data is no longer needed, the risk should be minimized by restricting or even prohibiting data collection and / or deleting the data.
[0040] The following description, in conjunction with the accompanying drawings, illustrates exemplary embodiments of the present invention, including various details to aid understanding. These details should be considered merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the invention. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description.
[0041] To address the problems existing in the prior art, this invention proposes a conversation method that utilizes historical conversation content to coordinate with the current conversation content for intent recognition, based on whether the conversation intent of the current conversation content is clear. This not only solves the problem of intent recognition for conversation content with unclear intent in the current conversation, but also solves the problem of intent recognition for conversation content with unclear intent in the historical conversation when the intent of the current conversation is clear. This achieves a more accurate conversation with a higher response rate. By using historical conversation content to improve the intent recognition rate, it not only helps to improve the conversation response rate, but also ensures the accuracy of the response, thereby improving user satisfaction with intelligent dialogue services and enabling better promotion and application in various related business fields.
[0042] Figure 1 This is a schematic diagram of the main flow of the session method according to an embodiment of the present invention, such as... Figure 1 As shown, the session method of this embodiment includes the following steps S101 to S104.
[0043] Step S101: Obtain the conversation content to be replied to from the target user's conversation record, and determine whether the conversation content has a clear conversation intent.
[0044] Specifically, in an intelligent dialogue system, users send conversation messages through a client. These messages vary depending on the business domain, such as express delivery tracking messages, after-sales return / exchange messages, and business processing inquiries. The dialogue system listens for conversation messages in each user-created conversation box, with each thread responsible for processing and replying to one conversation box. To mitigate the impact of high-traffic scenarios on the dialogue system, each thread establishes an independent conversation record for the user corresponding to its conversation box, which can be a single user session. The listened-up conversation messages are first stored in the conversation record, and then, according to the dialogue system's scheduling, the conversation content to be replied to is retrieved from the conversation record of the currently pending target user.
[0045] The embodiments of the present invention establish corresponding session records for users in the chat box, which can not only alleviate the impact of massive traffic scenarios on the system and play a role in peak shaving and valley smoothing, but also isolate the session messages of different users, making it easier to respond to messages.
[0046] Furthermore, for the current conversation content awaiting a response, to improve the intent recognition rate, the dialogue system first performs preliminary identification of the conversation content to determine whether it has a clear conversational intent. This can be done through keywords, such as whether the conversation content contains words with clear affirmative or negative semantics, like "definitely," "must," "cannot," or "prohibited." If such words are present, the conversation content can be determined to be clear. Alternatively, grammatical analysis can be used. Conversations containing multiple subject-verb-object structures, or those with missing subjects, verbs, or objects, or those with complex or unclear semantic expressions, will be judged as having an ambiguous conversational intent. This method is used to determine whether the conversation content has a clear conversational intent.
[0047] Step S102: In response to the fact that the conversation content does not have a clear conversation intent, within a preset time window, query the first historical conversation content that is closest to the conversation content and belongs to the same topic as the conversation content and has a clear conversation intent. By integrating the first historical conversation content with the conversation content, the intent of the conversation content is identified.
[0048] Specifically, if the current conversation content does not have a clear conversation intent, in order to improve the intent recognition rate and ensure that the current conversation content can have a corresponding intent recognition result in the subsequent intent recognition algorithm, this embodiment of the invention presets an effective time window for conversation processing, such as 5 minutes. Using the timestamp of the current conversation content as the end of the time window, it searches for historical conversation content within the time window. If the time window is 5 minutes, it searches for historical conversation content 5 minutes before the current conversation content. Within the time window, it queries backwards each historical conversation content that belongs to the same topic as the current conversation content, for example, both are inquiries about express delivery. From these historical conversation contents with the same topic, it selects the target historical conversation content with a clear conversation intent and the closest sending time to the current conversation content as the first historical conversation content.
[0049] Based on the first historical session content found, the current session content with unclear session intent is integrated with it. The semantics of the current session content are enhanced by using the first historical session content, which facilitates the intent recognition algorithm to perform intent recognition on the integrated content. The intent recognition result is then used as the intent recognition result of the current session content.
[0050] According to one embodiment of the present invention, before performing intent recognition on the session content, the method further includes: confirming that the first integrated session content has a clear session intent.
[0051] Specifically, before performing intent recognition on the session content, in order to improve the efficiency of intent recognition and avoid sessions without clear session intent consuming intent recognition resources, it is necessary to reconfirm that when the current session content is unclear, the first integrated session content, which combines the first historical session content with the current session content, has a clear session intent, to ensure the smooth progress of subsequent intent recognition. If the first integrated session content does not have a clear session intent, then the current processing ends, and no further response processing is performed.
[0052] Step S103: In response to the clear conversation intent of the conversation content, within a preset time window, query the second historical conversation content that is closest to the conversation content and belongs to the same topic as the conversation content but has an unclear conversation intent. By integrating the second historical conversation content with the conversation content, the intent of the conversation content is identified.
[0053] Specifically, if the current session content has a clear session intent, in order to improve the overall intent recognition rate of the session, this embodiment of the invention will also preset a corresponding time window. In this case, the time window can be the same as or different from the time window mentioned above. Within the time window, each historical session content is queried backwards and belongs to the same topic as the current session content. From these historical session contents with the same topic, the target historical session content with an unclear session intent and the closest sending time to the current session content is selected as the second historical session content.
[0054] Based on the found second historical conversation content, the conversation content with clear intent in the current conversation is integrated with it. The semantics of the second historical conversation content are enhanced by the current conversation content, and then the intent of the integrated content is identified. This achieves the goal of identifying the intent of the current conversation content and the second historical conversation content at the same time, effectively improving the intent recognition rate of the conversation.
[0055] According to one embodiment of the present invention, before performing intent recognition on the session content, the method further includes: confirming that the second integrated session content has a clear session intent.
[0056] Specifically, before performing intent recognition on the session content, in order to improve the efficiency of intent recognition and avoid sessions without clear session intent consuming intent recognition resources, it is necessary to reconfirm that when the current session content is clear, the second integrated session content, which combines the second historical session content with the current session content, has a clear session intent, to ensure the smooth progress of subsequent intent recognition. If the second integrated session content does not have a clear session intent, then the current processing ends, and no further response processing is performed.
[0057] Step S104: Based on the intent recognition result of the conversation content, determine the corresponding response type, and reply to the conversation content according to the response type.
[0058] Specifically, based on the intent recognition result obtained by integrating the first historical conversation content with the current conversation content or integrating the second historical conversation content with the current conversation content, the dialogue system determines the corresponding response type based on the intent recognition result. Specific response types can include text-based responses, image-text responses, or video responses. For example, in the education field, if the user's intent recognition result for the conversation content is to find teaching videos for a specific subject, then the response type would be a video response. Finally, based on the response type, the system finds and constructs the corresponding reply content for the current conversation content and sends it to the target user.
[0059] Figure 2 This is a flowchart of a session method according to a possible embodiment of the present invention. As another embodiment of the present invention, such as... Figure 2 As shown, the session method may include:
[0060] Step S201: Obtain the conversation content to be replied to from the target user's conversation record, and determine whether the conversation content has a clear conversation intent.
[0061] According to one embodiment of the present invention, obtaining the session content to be replied to from the session record of a target user includes: obtaining each session message to be replied to from a message queue; sorting each session message according to the timestamp of each session message to obtain a sequential session queue; obtaining a queue lock of the sequential session queue; sequentially reading the session messages of the target user from the sequential session queue; storing the session messages into an independent session record pre-allocated for the target user; and releasing the queue lock; and obtaining the session content to be replied to by the target user from the session record.
[0062] Specifically, considering that the session messages received by the system may be out of order under high concurrency, and based on the above-mentioned design for handling massive traffic scenarios, this embodiment of the invention first stores the acquired session messages in a message queue, such as MQ, to smooth out peaks and valleys. Then, it sorts each session message to be replied to in the message queue according to its timestamp and stores the sorted session messages in a sequential session queue. Specifically, the sequential session queue of this embodiment of the invention can be implemented using Redis's Zest queue, which ensures that the session system can execute each session message to be replied to in sequence.
[0063] Furthermore, to facilitate the scheduling and management of thread access to each conversation box in the dialogue system and ensure that threads access and process their corresponding conversation boxes in an orderly manner, locks are assigned to each conversation box. Correspondingly, the sequential conversation queue also has its own lock. A thread wanting to retrieve conversation messages first needs to acquire the queue lock of the sequential conversation queue. If the queue lock is acquired, it means the thread can process the current sequential conversation queue. It then sequentially reads the conversation messages of the current target user from the sequential conversation queue, stores the conversation messages in a pre-allocated independent conversation record for the target user, releases the queue lock, and finally retrieves the conversation content to be replied to from the target user's conversation record.
[0064] Understandably, the conversation box in this embodiment of the invention may include a single conversation consisting of a user and a dialogue model, or it may include a group conversation consisting of multiple users and a dialogue model. The users in the group conversation are not related to each other. In this case, in order to avoid the dialogue model from confusing the conversations of multiple users, the dialogue system assigns a corresponding independent conversation record to each user. This allows the system to obtain the conversation content to be replied to sequentially from the conversation record of the target user, ensuring that it is the conversation content to be replied to by the target user, thus providing a reliable data guarantee for subsequent reply processing.
[0065] Figure 3 This is a schematic diagram illustrating the specific steps of obtaining the content of a session to be replied to according to an embodiment of the present invention. The dialogue system listens for session messages in the session window and puts them into a message queue (MQ). Functional modules in the dialogue system consume MQ, retrieve individual session messages from it, sort the session messages according to their timestamps, and store them in a sequential session queue, such as the Zest queue in Redis mentioned above. The dialogue system's scheduling thread attempts to acquire the queue lock of the sequential session queue. If the queue lock is not acquired, other tasks are processed; if the queue lock is acquired, the sequential session queue is locked, session messages are processed, and the target user's session messages are sequentially read from the sequential session queue and stored in a pre-allocated independent session record for the target user. Finally, the queue lock is released, and the task execution module in the dialogue system retrieves the content of the session to be replied to from the target user's session record.
[0066] Figure 4 This is a schematic diagram of the storage of conversation records according to an embodiment of the present invention. In a group conversation scenario, there may be multiple users in a group. The dialogue system assigns a corresponding conversation record to each user. The diagram shows 3 users corresponding to 3 conversation records. Each conversation record not only stores the conversation content that the user has to reply to, but also stores the conversation content that the dialogue system is currently processing; the current process node; the account of the robot model that replied to the conversation; and other relevant information.
[0067] Furthermore, to ensure the accuracy of judging whether the conversational intent is clear, this embodiment of the invention utilizes existing intelligent models. The model within the dialogue system is pre-trained to enable it to determine whether the received conversational content has a clear conversational intent. Specifically, the model's judgment capability can be invoked through a prompt word. The current conversational content and the prompt word are assembled according to the prompt's format and input into the model to obtain the model's output result regarding whether the current conversational content has a clear conversational intent.
[0068] Step S202: In response to the fact that the conversation content does not have a clear conversation intent, query backward within a preset time window the first historical conversation content that is closest to the conversation content and belongs to the same topic as the conversation content and has a clear conversation intent.
[0069] Step S203: Integrate and rewrite the first historical session content and the session content to generate the first integrated session content; determine whether there is an intent inheritance relationship between the first integrated session content and the first historical session content; and use the first integrated session content to replace the session content for intent recognition based on the determination result.
[0070] Specifically, when the current conversation content lacks a clear conversational intent, based on the retrieved first historical conversation content, the first historical conversation content and the current conversation content are integrated and rewritten by the model within the dialogue system. The model performs word segmentation, extraction, understanding, and summarization on the first historical conversation content and the current conversation content, finally outputting the first integrated conversation content. In practice, this usually involves integrating and rewriting several sentences into one sentence. The model within the dialogue system then determines the intent relationship (intent inheritance or intent switching) between the first integrated conversation content and the first historical conversation content, which has a clear conversational intent. If it is an intent inheritance relationship, the model guides subsequent intent recognition based on the intent of the first historical conversation content using the intent inheritance approach. If it is not an intent inheritance relationship, then it is an intent switching relationship, and the model guides subsequent intent recognition based on the intent of the first historical conversation content using the intent switching approach. During intent recognition, the first integrated conversation content is used to replace the current conversation content and is sent to the intent recognition module. The intent recognition module, based on the received intent relationship, performs intent recognition on the first integrated conversation content using an intent recognition algorithm, and uses the intent recognition result as the intent recognition result for the current conversation content.
[0071] Step S204: In response to the fact that the conversation content has a clear conversation intent, within a preset time window, query the second historical conversation content that is closest to the conversation content and belongs to the same topic as the conversation content but has an unclear conversation intent.
[0072] Step S205: Integrate and rewrite the second historical session content and the session content to generate a second integrated session content; determine whether there is an intent inheritance relationship between the second integrated session content and the session content; and use the second integrated session content to replace the session content for intent recognition based on the determination result.
[0073] Specifically, when the current conversation content has a clear conversational intent, based on the found second historical conversation content, the second historical conversation content and the current conversation content are integrated and rewritten by the model within the dialogue system. The model performs word segmentation, extraction, understanding, and summarization on the second historical conversation content and the current conversation content, and finally outputs the second integrated conversation content. In practice, this usually involves integrating and rewriting several sentences into one sentence. The model in the dialogue system is then used to determine the intent relationship (intent inheritance or intent switching) between the second integrated conversation content and the current conversation content with a clear conversational intent. If it is an intent inheritance relationship, the model guides subsequent intent recognition based on the intent of the current conversation content using the intent inheritance approach. If it is not an intent inheritance relationship, it is an intent switching relationship, and the model guides subsequent intent recognition based on the intent of the current conversation content using the intent switching approach. During intent recognition, the second integrated session content is used to replace the current session content and sent to the intent recognition module. Based on the received intent relationship, the intent recognition module performs intent recognition on the second integrated session content through the intent recognition algorithm. This achieves the goal of recognizing the intent of the second historical session content while recognizing the current session content, thereby improving the overall intent recognition rate of the target user's session.
[0074] Figure 5 This is a flowchart illustrating the intent recognition process according to an embodiment of the present invention. First, it is determined whether the current conversation content has a clear conversation intent. If no clear conversation intent is found, the process searches backward within a preset time window for the first historical conversation content that is closest to the current conversation content, has a clear conversation intent, and belongs to the same topic as the current conversation content. If no such content is found, the current process ends. If the first historical conversation content is found, it is integrated and rewritten with the current conversation content. The process then determines whether the rewritten first integrated conversation content has a clear conversation intent. If no clear conversation intent is found, the current process ends, and no further response processing is performed. If a clear conversation intent is found, it is further determined whether there is an intent inheritance relationship between the first integrated conversation content and the first historical conversation content. Based on the determination result, the first integrated conversation content is used to replace the current conversation content for intent recognition.
[0075] If there is a clear conversation intent, the system searches backward within a preset time window for the closest historical conversation content that has an unclear intent and belongs to the same topic as the current conversation content. Understandably, if no second historical conversation content exists, intent identification is only performed on the current conversation content. The second historical conversation content is then integrated and rewritten with the current conversation content. It is then determined whether the rewritten integrated conversation content has a clear conversation intent. If there is no clear conversation intent, the current process ends, and no further response processing is performed. If there is a clear conversation intent, it is then determined whether there is an intent inheritance relationship between the second integrated conversation content and the current conversation content. Based on the determination result, the second integrated conversation content is used instead of the current conversation content for intent identification.
[0076] Step S206: Determine the corresponding response type based on the intent recognition result of the conversation content, and reply to the conversation content according to the response type.
[0077] The session method of this invention utilizes a locking mechanism to ensure the collaborative execution of multiple threads in the dialogue system, thereby improving the system's reliability and fairness. Furthermore, by combining the determination of whether the relationship between the first integrated session content or the second integrated session content after integration and rewriting and the first historical session content or the current session content with a clear session intent is one of intent inheritance or intent switching, the accuracy of subsequent intent recognition is improved, thus better meeting actual needs.
[0078] Figure 6 This is a flowchart of a session method according to another possible embodiment of the present invention. As another embodiment of the present invention, such as... Figure 6 As shown, the session method may include:
[0079] Step S601: Obtain the conversation content to be replied to from the target user's conversation record, and determine whether the conversation content has a clear conversation intent.
[0080] Step S602: In response to the fact that the conversation content does not have a clear conversation intent, within a preset time window, query the first historical conversation content that is closest to the conversation content and belongs to the same topic as the conversation content and has a clear conversation intent. By integrating the first historical conversation content and the conversation content, the intent of the conversation content is identified.
[0081] Step S603: In response to the clear conversation intent of the conversation content, within a preset time window, query the second historical conversation content that is closest to the conversation content and belongs to the same topic as the conversation content but has an unclear conversation intent. By integrating the second historical conversation content with the conversation content, the intent of the conversation content is identified.
[0082] Step S604: In response to the intent recognition result being multiple candidate intents, filter out irrelevant intents from each of the candidate intents according to preset intent filtering conditions, generate intent selection scripts according to the filtered candidate intents, and send them to the target user.
[0083] Specifically, when performing intent recognition on the integrated and rewritten conversation content, and the resulting intent recognition result includes multiple candidate intents, to ensure the accuracy of the response, the system prioritizes soliciting the intent of the target user for this conversation. Furthermore, to ensure a positive user experience, the candidate intents can be filtered based on preset intent filtering conditions, removing intents that are irrelevant or do not match the current business scenario. Finally, based on the filtered candidate intents, the model in the dialogue system generates a selective script to solicit intent from the target user, such as "Would you like to consult about A, B, or C in this conversation?", and sends this selective intent selection script to the target user.
[0084] Step S605: Receive the target intent selected by the target user, and determine the corresponding response type according to the target intent.
[0085] Specifically, after receiving the intent selection sent by the dialogue system, the target user feeds back the option that is closest to their own intent to the dialogue system. After receiving the target intent selected by the target user, the dialogue system determines the response type corresponding to the current conversation content according to the target intent.
[0086] According to one embodiment of the present invention, after receiving the target intent selected by the target user, the target intent selected by the target user for the session content is recorded.
[0087] Specifically, in order to facilitate the tracing of the response session content and improve the performance of the intent recognition algorithm, after receiving the target intent selected by the target user, the target intent selected by the target user for this session content is recorded so as to facilitate the tracing of the response results and optimize the intent recognition algorithm.
[0088] Step S606: In response to the response type being an action type, the action dispatcher is invoked to determine whether the keywords in the conversation content are complete. If incomplete, keywords are obtained from the target user, and a corresponding reply is generated for the conversation content based on the obtained keywords, and the reply is sent to the target user. In response to the response type being a question-and-answer type, the knowledge base is invoked to generate a corresponding reply for the conversation content, and the reply is sent to the target user. In response to the response type being a casual chat type, the large model is invoked to generate a corresponding reply for the conversation content, and the reply is sent to the target user.
[0089] Specifically, embodiments of the present invention can further categorize response types into action types, question-and-answer types, and casual conversation types based on content. For action types, the corresponding action is executed by calling an action dispatcher. Before execution, it is necessary to first determine whether the slots in the conversation content are complete. Slots exist in the form of key-value pairs and are used to record key information occurring during the dialogue. Essentially, slots are keywords in the conversation content. If they are incomplete, it will affect the execution of the action. Therefore, it is necessary to first determine whether the keywords in the conversation content are complete. If incomplete, a slot follow-up question is sent to the target user, which is to obtain keyword information. Once the target user's feedback keywords are obtained, the action dispatcher generates an action-type response based on the complete keywords. If complete, the execution interface is called to directly generate an action-type response.
[0090] For question-and-answer type questions, the question-and-answer knowledge base built by the dialogue system is invoked to determine the confidence level of the returned result. If the confidence level meets the standard, a response to the current conversation content is generated based on the returned result; otherwise, a pre-set fallback response is used. For casual conversation type questions, the model (large model) in the dialogue system is invoked, the conversation content is input into the model, and the model outputs a casual conversation type response.
[0091] According to one embodiment of the present invention, after generating a corresponding reply for the session content, the intent recognition result of the session content and the corresponding reply are recorded.
[0092] Specifically, considering that the target user's conversation box will send multiple conversation contents after it is built, in order to facilitate the dialogue system to record the conversation content of the currently processed response, query the conversation content, and avoid missing individual conversation contents, after generating the corresponding reply for the conversation content, the intent recognition result of the conversation content and the corresponding reply are recorded, and a conversation bill is generated, which plays a recording role similar to a conversation task bill.
[0093] Understandably, recording the target intent selected by the target user for the session content after receiving the target intent can also serve as a reconciliation statement for the dialogue system. This statement is used by the dialogue system to verify the system's processing records when the intent recognition result includes multiple alternative intents. The dialogue system determines whether the response processing task is completed by verifying this reconciliation statement and the aforementioned invoice. If there are incomplete response tasks, the system retryes and records the reason.
[0094] Figure 7This is a schematic diagram illustrating the specific process of replying to conversation content according to an embodiment of the present invention. If the response type is an action type, the action dispatcher is invoked to determine whether the slots in the conversation content are complete. If complete, the corresponding execution interface is invoked to generate an action type response; if incomplete, the missing slots are retrieved from the target user, and an action type response is generated based on the retrieved slots (keywords). If the response type is a question-and-answer type, the knowledge base is invoked to determine the confidence level of the returned result. If the confidence level meets the standard, a response to the current conversation content is generated according to the returned result; otherwise, a pre-set fallback response is used to reply to the conversation content. If the response type is a casual conversation type, the model in the dialogue system is invoked to output a casual conversation type response, and finally, an invoice for the response processing task of the current conversation content is generated.
[0095] Figure 8 This is a complete flowchart of the conversation method according to an embodiment of the present invention. The target user opens a conversation box, the conversation system processes the conversation messages in the conversation box, obtains the conversation messages in the conversation box and stores them in a message queue, sorts them by timestamp and transfers the conversation messages, and establishes an independent conversation record for each user.
[0096] The dialogue system identifies the target user and retrieves the dialogue content to be replied to from the corresponding dialogue records. First, it determines whether the dialogue content has a clear dialogue intent. If not, it searches backward within a preset time window for the closest historical dialogue content that belongs to the same topic and has a clear dialogue intent. If no such content is found, the current process ends. If a historical dialogue content is found, it integrates and rewrites the current dialogue content to generate a first integrated dialogue content. It then determines whether the first integrated dialogue content has a clear dialogue intent. If not, the current process ends, and no further response processing is performed. If a clear dialogue intent exists, it determines whether there is an intent inheritance relationship between the first integrated dialogue content and the first historical dialogue content. Based on the determination result, the first integrated dialogue content is used to replace the original dialogue content for intent identification.
[0097] If the current conversation content has a clear conversation intent, then within a preset time window, search backwards for the second historical conversation content that is closest to the current conversation content and belongs to the same topic, but has an unclear conversation intent. If no such conversation content is found, then only the current conversation content is used for intent identification. If a conversation content is found, the second historical conversation content and the current conversation content are integrated and rewritten to generate a second integrated conversation content. It is then determined whether the second integrated conversation content has a clear conversation intent. If not, then the current processing ends, and no further response processing is performed. If there is a clear conversation intent, it is determined whether there is an intent inheritance relationship between the second integrated conversation content and the current conversation content. Based on the determination result, the second integrated conversation content is used to replace the current conversation content for intent identification.
[0098] Furthermore, if the intent recognition result is multiple candidate intents (multiple intents), irrelevant intents among the candidate intents are filtered out according to preset intent filtering conditions. In addition, for each of the filtered candidate intents, question-and-answer type intents can be pre-judged, ignoring unanswerable question-and-answer type intents. Intent selection scripts are generated based on the remaining candidate intents and sent to the target user so that the target user can select the target intent. Of course, if the intent recognition result is only one intent, or only one candidate intent remains after filtering, then the subsequent response processing flow is directly entered.
[0099] The dialogue system receives the target intent selected by the target user. When the target intent is a single intent, it records the target intent selected by the target user for the conversation content, generates a statement of the dialogue system, and determines the corresponding response type according to the target intent. The response type of the single intent determined at this time is generally divided into action type, question and answer type, and small talk type.
[0100] If the response is an action type, the action dispatcher is invoked to determine if the slots in the conversation content are complete. If complete, the corresponding execution interface is invoked to generate an action-type response. If incomplete, the missing slots are retrieved from the target user, and an action-type response is generated based on the retrieved slots. If the response is a question-and-answer type, the knowledge base is invoked to determine the confidence level of the returned result. If the confidence level is high enough, a response to the current conversation content is generated based on the returned result. If the confidence level is low enough, a pre-set fallback response is used. If the response type is casual conversation, the model in the dialogue system is invoked to output a casual conversation response. Finally, the intent recognition result of the conversation content and the corresponding response are recorded, and an invoice for the response processing task of this conversation content is generated. The dialogue system determines the currently processed conversation content by querying the invoice and the invoice, and records it synchronously in the target user's conversation record. Finally, the generated response is sent to the target user.
[0101] This invention employs a chain-of-responsibility model to complete the entire process of session response. Each node in the process serves as an action link, and each action link corresponds to a status code. After the current action is completed, the process jumps to the next action on the chain. Furthermore, it fully considers the situation where intent identification involves multiple alternative intents, proposing corresponding methods for generating responses for various types of intents, ensuring the feasibility and implementability of the technical solution. Moreover, the use of reconciliation statements and invoices to systematically manage and record the processing process and results of session content ensures the reliability of the session method in this invention.
[0102] Figure 9 This is a schematic diagram of the main modules of a conversation device according to an embodiment of the present invention. Figure 9 As shown, the session device 900 mainly includes a session acquisition module 901, an intent recognition module 902, and a session response module 903.
[0103] The conversation intent determination module 901 is used to obtain the conversation content to be replied to from the conversation record of the target user and determine whether the conversation content has a clear conversation intent.
[0104] The intent recognition first module 902 is used to respond to the fact that the conversation content does not have a clear conversation intent, and to query the first historical conversation content that is closest to the conversation content and belongs to the same topic as the conversation content within a preset time window and has a clear conversation intent, and to perform intent recognition on the conversation content by integrating the first historical conversation content and the conversation content.
[0105] The second intent recognition module 903 is used to respond to the fact that the conversation content has a clear conversation intent, and within a preset time window, to query the second historical conversation content that is closest to the conversation content and belongs to the same topic as the conversation content but has an unclear conversation intent, and to perform intent recognition on the conversation content by integrating the second historical conversation content with the conversation content.
[0106] The session response module 904 is used to determine the corresponding response type based on the intent recognition result of the session content, and reply to the session content according to the response type.
[0107] According to an embodiment of the present invention, the session acquisition module 901 is further configured to: acquire each session message to be replied to from the message queue, sort each session message according to the timestamp of each session message to obtain a sequential session queue; acquire the queue lock of the sequential session queue, sequentially read the session messages of the target user from the sequential session queue, store the session messages in an independent session record pre-allocated to the target user, and release the queue lock; and acquire the session content to be replied to by the target user from the session record.
[0108] According to another embodiment of the present invention, the intent recognition first module 902 is further configured to: integrate and rewrite the first historical session content and the session content to generate first integrated session content; determine whether there is an intent inheritance relationship between the first integrated session content and the first historical session content, and use the first integrated session content to replace the session content for intent recognition based on the determination result; the intent recognition second module 903 is further configured to: integrate and rewrite the second historical session content and the session content to generate second integrated session content; determine whether there is an intent inheritance relationship between the second integrated session content and the session content, and use the second integrated session content to replace the session content for intent recognition based on the determination result.
[0109] According to another embodiment of the present invention, in response to the intent recognition result being a plurality of alternative intents, the session response module 904 is further configured to: filter out irrelevant intents from each of the alternative intents according to preset intent filtering conditions, generate intent selection scripts according to the filtered alternative intents, and send them to the target user; receive the target intent selected by the target user, and determine the corresponding response type according to the target intent.
[0110] According to another embodiment of the present invention, the conversation response module 904 is further configured to: in response to the response type being an action type, invoke an action dispatcher to determine whether the keywords in the conversation content are complete; if incomplete, obtain keywords from the target user, generate a corresponding reply for the conversation content based on the obtained keywords, and send the reply to the target user; in response to the response type being a question-and-answer type, invoke a knowledge base to generate a corresponding reply for the conversation content, and send the reply to the target user; in response to the response type being a casual conversation type, invoke a large model to generate a corresponding reply for the conversation content, and send the reply to the target user.
[0111] According to another embodiment of the present invention, the conversation device 900 further includes a response verification module (not shown in the figure), configured to: after receiving the target intent selected by the target user, record the target intent selected by the target user for the conversation content; and after generating a corresponding reply for the conversation content, record the intent recognition result of the conversation content and the corresponding reply.
[0112] According to another embodiment of the present invention, the conversation device 900 further includes a conversation intent verification module (not shown in the figure), used to: confirm that the first integrated conversation content or the second integrated conversation content has a clear conversation intent before performing intent recognition on the conversation content.
[0113] Figure 10 This is an exemplary system architecture diagram in which embodiments of the present invention can be applied.
[0114] like Figure 10 As shown, system architecture 1000 may include terminal devices 1001, 1002, and 1003, network 1004, and server 1005. Network 1004 is used as a medium to provide communication links between terminal devices 1001, 1002, and 1003 and server 1005. Network 1004 may include various connection types, such as wired or wireless communication links or fiber optic cables, etc.
[0115] Users can use terminal devices 1001, 1002, and 1003 to interact with server 1005 via network 1004 to receive or send messages, etc. Various communication client applications, such as session applications, can be installed on terminal devices 1001, 1002, and 1003 (for example only).
[0116] Terminal devices 1001, 1002, and 1003 can be various electronic devices with displays and web browsing capabilities, including but not limited to smartphones, tablets, laptops, and desktop computers.
[0117] Server 1005 can be a server providing various services, such as a backend management server supporting conversations conducted by users using terminal devices 1001, 1002, and 1003 (for example only). The backend management server can obtain the conversation content to be replied to from the target user's conversation records and determine whether the conversation content has a clear conversation intent. If the conversation content does not have a clear conversation intent, it queries backward within a preset time window for the closest historical conversation content that belongs to the same topic as the conversation content and has a clear conversation intent. By integrating the first historical conversation content with the current conversation content, it performs intent identification on the conversation content. If the conversation content has a clear conversation intent, it queries backward within a preset time window for the closest historical conversation content that belongs to the same topic as the conversation content and has an unclear conversation intent. By integrating the second historical conversation content with the current conversation content, it performs intent identification on the conversation content. Based on the intent identification result of the conversation content, it determines the corresponding response type, replies to the conversation content according to the response type, and feeds back the processing result (e.g., a reply – for example only) to the terminal device.
[0118] It should be noted that the session method provided in the embodiments of the present invention is generally executed by the server 1005, and correspondingly, the session device is generally set in the server 1005.
[0119] It should be understood that Figure 10 The number of terminal devices, networks, and servers shown is merely illustrative. Depending on implementation needs, any number of terminal devices, networks, and servers can be included.
[0120] The following is for reference. Figure 11 , Figure 11 This is a schematic diagram of the structure of a computer system suitable for implementing terminal devices or servers of the present invention. Figure 11 The terminal device or server shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments of the present invention.
[0121] like Figure 11 As shown, the computer system 1100 includes a central processing unit (CPU) 1101, which can perform various appropriate actions and processes based on programs stored in read-only memory (ROM) 1102 or programs loaded from storage section 1108 into random access memory (RAM) 1103. The RAM 1103 also stores various programs and data required for the operation of the system 1100. The CPU 1101, ROM 1102, and RAM 1103 are interconnected via a bus 1104. An input / output (I / O) interface 1105 is also connected to the bus 1104.
[0122] The following components are connected to I / O interface 1105: an input section 1106 including a keyboard, mouse, etc.; an output section 1107 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and speakers, etc.; a storage section 1108 including a hard disk, etc.; and a communication section 1109 including a network interface card such as a LAN card, modem, etc. The communication section 1109 performs communication processing via a network such as the Internet. A drive 1110 is also connected to I / O interface 1105 as needed. Removable media 1111, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., are installed on drive 1110 as needed so that computer programs read from them can be installed into storage section 1108 as needed.
[0123] In particular, according to the embodiments disclosed in this invention, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments disclosed in this invention include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication section 1109, and / or installed from removable medium 1111. When the computer program is executed by central processing unit (CPU) 1101, it performs the functions defined above in the system of this invention.
[0124] It should be noted that the computer-readable medium shown in this invention can be a computer-readable signal medium or a computer-readable storage medium, or any combination of the two. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this invention, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In this invention, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. Computer-readable signal media can also be any computer-readable medium other than computer-readable storage media, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wireless, wire, optical fiber, RF, etc., or any suitable combination thereof.
[0125] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present invention. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0126] The units described in the embodiments of the present invention can be implemented in software or in hardware. The described units can also be housed in a processor; for example, a processor can be described as including: a session intent determination module, an intent recognition first module, an intent recognition second module, and a session response module.
[0127] In some cases, the names of these modules do not constitute a limitation on the module itself. For example, a session response module can also be described as "a module for determining the corresponding response type based on the intent recognition result of the session content, and replying to the session content according to the response type".
[0128] On the other hand, the present invention also provides a computer-readable medium, which may be included in the device described in the embodiments or may exist independently without being assembled into the device. The computer-readable medium carries one or more programs, which, when executed by the device, cause the device to include: obtaining conversation content to be replied to from the conversation records of a target user; determining whether the conversation content has a clear conversation intent; in response to the conversation content not having a clear conversation intent, querying backward within a preset time window for a first historical conversation content with a clear conversation intent that is closest to the conversation content and belongs to the same topic as the conversation content; integrating the first historical conversation content with the conversation content to perform intent identification on the conversation content; in response to the conversation content having a clear conversation intent, querying backward within a preset time window for a second historical conversation content with an unclear conversation intent that is closest to the conversation content and belongs to the same topic as the conversation content; integrating the second historical conversation content with the conversation content to perform intent identification on the conversation content; determining a corresponding response type based on the intent identification result of the conversation content; and replying to the conversation content according to the response type.
[0129] According to the technical solution of the present invention, the following advantages or beneficial effects are achieved: by obtaining the conversation content to be replied to from the conversation records of the target user, it is determined whether the conversation content has a clear conversation intent; in response to the conversation content not having a clear conversation intent, within a preset time window, a first historical conversation content with a clear conversation intent that is closest to the conversation content and belongs to the same topic as the conversation content is queried backwards, and the conversation content is identified by integrating the first historical conversation content and the conversation content; in response to the conversation content having a clear conversation intent, within a preset time window, a second historical conversation content with an unclear conversation intent that is closest to the conversation content and belongs to the same topic as the conversation content is queried backwards, and the conversation content is identified by integrating the second historical conversation content and the conversation content; based on the intent identification result of the conversation content, the corresponding response type is determined, and the conversation content is replied to according to the response type. This technical solution realizes a more accurate and high-response-rate conversation method. By using historical conversation content to improve the intent identification rate, it not only helps to improve the conversation response rate, but also ensures the accuracy of the response, thereby improving user satisfaction with intelligent dialogue services, so as to better promote its application in various related business fields.
[0130] The specific embodiments described herein do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can occur depending on design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.
Claims
1. A conversational method, characterized in that, include: Obtain the content of the conversation to be replied to from the target user's conversation history, and determine whether the content of the conversation has a clear conversational intent; In response to the fact that the conversation content does not have a clear conversation intent, the system queries forward within a preset time window the first historical conversation content that is closest to the conversation content and belongs to the same topic as the conversation content and has a clear conversation intent. By integrating the first historical conversation content with the conversation content, the system performs intent identification on the conversation content. In response to the clear conversation intent of the conversation content, within a preset time window, a second historical conversation content with an unclear conversation intent that is closest to the conversation content and belongs to the same topic as the conversation content is queried backwards. By integrating the second historical conversation content with the conversation content, the intent of the conversation content is identified. Based on the intent recognition result of the conversation content, determine the corresponding response type, and reply to the conversation content according to the response type.
2. The method according to claim 1, characterized in that, Retrieve the content of the conversation to be replied to from the target user's conversation history, including: Retrieve each pending session message from the message queue, and sort each session message according to its timestamp to obtain a sequential session queue; Acquire the queue lock of the sequential session queue, sequentially read the session messages of the target user from the sequential session queue, store the session messages in an independent session record pre-allocated to the target user, and release the queue lock; Obtain the conversation content that the target user needs to reply to from the conversation records.
3. The method according to claim 1, characterized in that, By integrating the first historical session content with the session content, intent recognition is performed on the session content, including: The first historical session content and the session content are integrated and rewritten to generate the first integrated session content; it is determined whether there is an intent inheritance relationship between the first integrated session content and the first historical session content, and based on the determination result, the first integrated session content is used to replace the session content for intent recognition. By integrating the second historical session content with the session content, intent recognition is performed on the session content, including: The second historical session content is integrated and rewritten with the session content to generate a second integrated session content; it is determined whether there is an intent inheritance relationship between the second integrated session content and the session content, and based on the determination result, the second integrated session content is used to replace the session content for intent recognition.
4. The method according to claim 1, characterized in that, In response to the intent recognition result being multiple candidate intents, the corresponding response type is determined based on the intent recognition result of the session content, including: Based on preset intent filtering conditions, irrelevant intents are filtered out from each of the candidate intents. An intent selection script is generated according to each of the filtered candidate intents and sent to the target user. Receive the target intent selected by the target user, and determine the corresponding response type according to the target intent.
5. The method according to claim 1, characterized in that, Responding to the session content according to the response type includes: In response to the response type being an action type, the action dispatcher is invoked to determine whether the keywords in the conversation content are complete. If they are incomplete, the keywords are retrieved from the target user. Based on the retrieved keywords, a corresponding response is generated for the conversation content, and the response is sent to the target user. In response to the fact that the response type is a question-and-answer type, the knowledge base is invoked to generate a corresponding reply for the conversation content, and the reply is sent to the target user; In response to the response type being chatty, the large model is invoked to generate a corresponding reply for the conversation content, and the reply is sent to the target user.
6. The method according to claim 4 or 5, characterized in that, After receiving the target intent selected by the target user, the method further includes: Record the target intent selected by the target user for the session content; After generating a corresponding response for the session content, the method further includes: Record the intent recognition result of the conversation content, and the corresponding response.
7. The method according to claim 3, characterized in that, Before performing intent recognition on the session content, the method further includes: Confirm that the content of the first integrated session, or the content of the second integrated session, has a clear session intent.
8. A conversational device, characterized in that, include: The conversation intent determination module is used to obtain the conversation content to be replied to from the conversation records of the target user and determine whether the conversation content has a clear conversation intent. The intent recognition first module is used to respond to the fact that the conversation content does not have a clear conversation intent, and to query the first historical conversation content that is closest to the conversation content and belongs to the same topic as the conversation content within a preset time window and has a clear conversation intent, and to perform intent recognition on the conversation content by integrating the first historical conversation content and the conversation content. The second intent recognition module is used to respond to the fact that the conversation content has a clear conversation intent, and within a preset time window, to query the second historical conversation content that is closest to the conversation content and belongs to the same topic as the conversation content but has an unclear conversation intent. By integrating the second historical conversation content with the conversation content, the intent of the conversation content is recognized. The session response module is used to determine the corresponding response type based on the intent recognition result of the session content, and reply to the session content according to the response type.
9. A mobile electronic device terminal, characterized in that, include: One or more processors; Storage device for storing one or more programs. When the one or more programs are executed by the one or more processors, the one or more processors implement the method as described in any one of claims 1-7.
10. A computer-readable medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the method as described in any one of claims 1-7.
11. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the method as described in any one of claims 1-7.