Chat robot answering method and its device, equipment and medium

By building and updating user portraits and combining with the intelligent response generation mechanism, the shortcomings of chat robots in long-term memory and personalized services are solved, more efficient information processing and more accurate replying are achieved, and user experience is improved.

CN118797014BActive Publication Date: 2024-11-19GUANGZHOU FANGGUI INFORMATION TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411270962.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-11
Publication Date
2024-11-19
Estimated Expiration
2044-09-11

AI Technical Summary

Technical Problem

Existing chatbots have shortcomings in handling long-term memory and personalized services, and it is difficult to effectively remember and utilize historical dialogue information, resulting in insufficient coherence and personalization of user experience.

Method used

By analyzing the latest session data, building recent user portraits, integrating them with long-term user portraits, iteratively updating user portraits, optimizing information processing flow to reduce redundant information interference, and using the intelligent response generation mechanism to generate highly relevant and accurate responses.

Benefits of technology

It significantly improves the long-term memory ability and personalized service level of chat robots, ensures the accuracy and coherence of responses, and improves user satisfaction and communication experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118797014B_ABST
    Figure CN118797014B_ABST
Patent Text Reader

Abstract

The present application relates to a chatbot answering method and its device, equipment, and medium, the method comprising: extracting the user's portrait feature data based on the latest historical conversation data corresponding to the latest conversation generated by the human-computer conversation between the user and the chatbot to form a recent user portrait; calling the long-term user portrait corresponding to the previous conversation of the latest conversation from the portrait feature library, integrating the portrait feature data of the long-term user portrait with the recent user portrait to obtain the user's latest user portrait; replacing the long-term user portrait in the portrait feature library with the latest user portrait to iteratively update the long-term user portrait according to the latest conversation between the user and the chatbot; generating a response text corresponding to the question text based on the question text submitted by the user and the portrait feature data retrieved from the updated long-term user portrait with reference to the question text. The present application realizes the personalization, coherent memory, and intelligent response generation of the chatbot.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to artificial intelligence technology, and in particular to a chat robot answering method and its device, equipment, and medium. Background Art

[0002] With the rapid development of artificial intelligence technology, chatbots, as one of the important ways of human-computer interaction, have been widely used in many fields such as chat companions, customer service, and online assistants. Although chatbot technology has made significant progress in recent years, existing technologies are still insufficient in dealing with long-term memory. When chatbots have human-computer conversations with users, they often find it difficult to effectively remember and use historical conversation information. This short-term memory characteristic limits the robot's ability to understand and respond to users' personalized needs, resulting in insufficient consistency and personalization in user experience.

[0003] In traditional technology, although the method of using historical conversations as prompts to input models is used to enhance the robot's memory ability, this method has obvious limitations. First, due to the limited length of the input prompt, the robot can only consider a limited number of historical conversation turns, which limits the development of its long-term memory ability. Second, longer input not only increases the computational cost, but may also interfere with the model's understanding ability. In addition, historical conversations may contain a lot of redundant information, which makes it difficult for the robot to extract key information when processing, affecting the accuracy and quality of the response.

[0004] In addition, when dealing with multiple rounds of conversations, existing chatbots often have difficulty maintaining the contextual coherence of the conversation and are unable to achieve cross-conversation contextual understanding. This results in the robot rarely considering the user's historical conversation content when generating responses, making the conversation seem stiff and lacking in specificity. When dealing with complex conversations, existing robots also show insufficient information integration and reasoning capabilities, making it difficult to generate accurate and comprehensive responses.

[0005] In summary, existing chatbot technology has obvious deficiencies in long-term memory, personalized services, conversation coherence, and information integration, which limit the chatbot's potential in providing high-quality user experience. Those skilled in the art are in urgent need of a technical solution that can overcome these deficiencies and improve the chatbot's long-term memory ability and personalized service level. Summary of the invention

[0006] The purpose of this application is to solve the above-mentioned problems and to provide a chat robot answering method, a live broadcast chat robot answering method, and corresponding devices, equipment, non-volatile readable storage media, and computer program products.

[0007] According to one aspect of the present application, a chat robot answering method is provided, comprising:

[0008] Extracting the user's portrait feature data based on the latest historical conversation data corresponding to the latest conversation generated by the human-machine dialogue between the user and the chat robot to form a recent user portrait of the user;

[0009] Retrieving the long-term user portrait corresponding to the previous session of the latest session from the portrait feature library, integrating the portrait feature data of the long-term user portrait with the recent user portrait, and obtaining the latest user portrait of the user;

[0010] Replace the long-term user portrait in the portrait feature library with the latest user portrait, so as to iteratively update the long-term user portrait according to the latest conversation between the user and the chat robot;

[0011] Based on the question text submitted by the user and the portrait feature data retrieved from the updated long-term user portrait with reference to the question text, a response text corresponding to the question text is generated.

[0012] According to another aspect of the present application, there is provided a method for automatically answering a live network broadcast, comprising:

[0013] In response to the mode switching command triggered by the anchor user, the corresponding dialogue controls of the chat robot are displayed on the live broadcast interface of the anchor user's live broadcast room;

[0014] In response to a touch event acting on the dialogue control, displaying a dialogue page of the chat robot;

[0015] Submitting the question text input by the audience user to the dialogue page to the server, and obtaining the answer text generated by the server based on the question text;

[0016] Displaying the response text on the conversation page;

[0017] When obtaining the answer text generated by the server based on the question text, the server performs the following steps:

[0018] Extracting the user's portrait feature data based on the latest historical conversation data corresponding to the latest conversation generated by the human-machine dialogue between the user and the chat robot to form a recent user portrait of the user;

[0019] Retrieving the long-term user portrait corresponding to the previous session of the latest session from the portrait feature library, integrating the portrait feature data of the long-term user portrait with the recent user portrait, and obtaining the latest user portrait of the user;

[0020] Replace the long-term user portrait in the portrait feature library with the latest user portrait, so as to iteratively update the long-term user portrait according to the latest conversation between the user and the chat robot;

[0021] Based on the question text submitted by the user and the portrait feature data retrieved from the updated long-term user portrait with reference to the question text, a response text corresponding to the question text is generated.

[0022] According to another aspect of the present application, a chat robot answering device is provided, comprising:

[0023] A recent portrait extraction module is configured to extract the user's portrait feature data based on the latest historical conversation data corresponding to the latest conversation generated by the human-machine dialogue between the user and the chat robot to form a recent user portrait of the user;

[0024] A portrait feature fusion module is configured to call a long-term user portrait corresponding to a previous session of the latest session from a portrait feature library, fuse the portrait feature data of the long-term user portrait with the recent user portrait, and obtain the latest user portrait of the user;

[0025] A long-term portrait updating module, configured to replace the long-term user portrait in the portrait feature library with the latest user portrait, so as to iteratively update the long-term user portrait according to the latest conversation between the user and the chat robot;

[0026] The question answering processing module is configured to generate an answering text corresponding to the question text based on the question text submitted by the user and the portrait feature data retrieved from the updated long-term user portrait with reference to the question text.

[0027] According to another aspect of the present application, a chat robot answering device is provided, comprising a central processing unit and a memory, wherein the central processing unit is used to call and run a computer program stored in the memory to execute the steps of the method described in the present application.

[0028] According to another aspect of the present application, a non-volatile readable storage medium is provided, which stores a computer program implemented according to the chat robot response method in the form of computer-readable instructions, and when the computer program is called and executed by a computer, the steps included in the method are executed.

[0029] According to another aspect of the present application, a computer program product is provided, comprising a computer program / instruction, wherein the computer program / instruction implements the steps of the method when executed by a processor.

[0030] Compared with the prior art, this application aims at the shortcomings of existing chat robots in handling long-term memory and personalized services, and significantly improves personalized services and long-term memory capabilities through innovative technologies. This application first analyzes the latest conversation data to build a recent user portrait, and then integrates it with the long-term user portrait to achieve a personalized and consistent interactive experience. An iterative update mechanism is used to maintain the freshness and accuracy of the user portrait, while optimizing the information processing process to reduce redundant information interference, improve the accuracy of replies and the robot's ability to handle complex conversations. In addition, computing efficiency is improved by limiting the update range, and the quality of replies is ensured by using an intelligent response generation mechanism. Finally, the updated portrait and user questions are combined to generate highly relevant and accurate responses, effectively improving user satisfaction and communication experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0031] Figure 1 This application is an exemplary network architecture that can be used to deploy and implement chatbot services;

[0032] Figure 2 A flowchart of an embodiment of the chat robot answering method of the present application;

[0033] Figure 3 This is a functional block diagram of the chat robot answering device of the present application;

[0034] Figure 4 This is a structural diagram of a chat robot answering device used in this application. DETAILED DESCRIPTION

[0035] like Figure 1 As shown, the implementation of the chatbot answering method of the present application covers the server 81 and the terminal device 80 in the network architecture. The server 81 undertakes the core task of executing the chatbot answering method. The server 81 implements its core tasks by installing and running the computer program product implemented according to the chatbot answering method of the present application, including processing user conversation data, generating and updating user portraits, and generating answer texts based on user questions. The terminal device 80 is the interface for users to contact and use the chatbot. They are deployed through the corresponding application program and communicate with the server 81 over the network to send and receive data.

[0036] In terms of application scenarios, the chatbot answering method of the present application is applicable to a variety of fields, and the functions of the chatbot can be customized according to different application requirements. For example, in the field of chat companions, the chatbot can be presented in the image of an electronic pet to provide users with an intimate communication experience; in online live customer service, the robot can answer audience inquiries in real time in the form of a virtual anchor / digital person to improve service efficiency; in the field of education and training, the robot acts as an online assistant to assist learners in obtaining information and solving problems.

[0037] Taking the chat companion application scenario as an example, the user interacts with the robot through an application on the terminal device. The application has a friendly user interface and presents the chat robot as an electronic pet, which enhances the user's sense of immersion and desire for interaction. When the user asks questions or sends messages to the chat robot, these inputs are sent to the server through the terminal device as question text. After the server receives the user's question text, it processes the data using the method of the present application, including extracting portrait feature data, constructing and fusing user portraits, and generating response text. The generated response text is then sent back to the terminal device and displayed to the user in the tone of an electronic pet on the user interface, completing a complete interaction process.

[0038] In this application, user portraits are used to describe and record the key characteristics and behavior patterns of users so that chatbots can provide more personalized and coherent services based on them. User portraits are defined by multiple portrait feature fields, and the portrait feature data corresponding to these portrait feature fields can be constructed by analyzing the historical conversation data between the user and the chatbot. User portraits can fully capture the personality and needs of users by including portrait feature data corresponding to portrait feature fields of multiple dimensions.

[0039] The profile feature fields used to define user profiles can be set as needed to specify their data structure. The following are some exemplary profile feature fields: Basic information: includes some basic attributes of the user, such as user ID, gender, age, etc. Interests and hobbies: the interests and hobbies shown by the user in the conversation, which helps the robot recommend relevant content. Behavior pattern: the behavioral tendency of the user at different times and in different scenarios, such as the user is more inclined to discuss light topics at night. Conversation history: records the content of the previous conversations between the user and the robot, including timestamps, conversation topics, user emotions, etc. Emotional tendency: the emotional state expressed by the user in the conversation, such as positive, negative or neutral. Preferences: the user's specific settings or preferences for the chatbot, such as language selection, notification preferences, etc. Knowledge level: the knowledge level of the user on a specific topic or field, which helps the robot adjust the depth and complexity of the answer. Interaction frequency: the frequency and duration of the user's interaction with the robot, which reflects the user's activity. Feedback record: user feedback on the robot service, including positive comments and improvement suggestions. Personalized tags: tags assigned according to the user's specific behavior or attributes, used to quickly identify user characteristics. Important events: specific conversational content that is mentioned repeatedly by the user or shows a significant impact on the user's emotions or decision-making in the user's interaction history with the chatbot. These events may include, but are not limited to, milestones in personal life, major achievements, key challenges or turning points, which are particularly emphasized in the user's conversation, such as through repeated mentions, the use of emotionally rich language, or continuous discussion in different conversation occasions.

[0040] The data structure of the user portrait is designed to be flexible and extensible. In actual application, the portrait feature fields in the above examples can be selected as needed, or other portrait feature fields can be expanded. In the process of long-term dialogue between users and chat robots, flexible expansion can also be carried out so that the user portrait can be continuously enriched and updated as the interaction between users and robots deepens. In this application, the construction and update process of the user portrait utilizes technologies such as natural language processing and machine learning to automatically extract useful information from the dialogue data and convert it into structured portrait data.

[0041] By maintaining and utilizing user portraits, chatbots can better understand the uniqueness of each user, thereby providing more accurate and personalized conversations and services. This personalized service not only improves the user experience, but also enhances the user's trust and reliance on chatbots.

[0042] See also Figure 2 According to a chat robot answering method provided by the present application, in some embodiments thereof, the method comprises the following steps:

[0043] Step S3100: extracting the user's portrait feature data based on the latest historical conversation data corresponding to the latest conversation generated by the human-machine dialogue between the user and the chat robot to form a recent user portrait of the user;

[0044] The storage and representation of the dialogue data generated by the human-computer dialogue is the basis for implementing various embodiments of the present application. In practical applications, these data can be stored in a database in a structured or semi-structured form. Figuratively, each human-computer dialogue can be regarded as a conversation, which consists of multiple dialogue rounds, each of which includes the user's input, i.e., the question text, and the robot's output, i.e., the answer text.

[0045] In one embodiment, when the conversation data is stored, each conversation record contains information such as timestamp, user ID, conversation content, and emotion label. The timestamp records the specific time when the conversation occurred, the user ID is used to distinguish different users, and the conversation content includes the user's question text or the robot's answer text. The emotion label is a representation of the user's emotional state in the conversation, such as positive, negative, or neutral, which can be automatically labeled by a sentiment analysis algorithm or obtained by manual labeling.

[0046] For example, a record in the database might look like this:

[0047] Timestamp: 2024-08-24T14:23:01

[0048] User ID: user_12345

[0049] User input: Hello, I am currently learning Python programming.

[0050] Robot reply: Hello! Learning Python is a good choice. I can provide you with learning resources and guidance.

[0051] Emotional label: Positive

[0052] The conversation content itself can be in plain text format, or it can be further segmented and converted into word vectors or sentence vectors to facilitate subsequent natural language processing and machine learning tasks. In addition, the representation of conversation data can also include metadata of the conversation, such as the topic, duration, user satisfaction, etc. This information helps to analyze and understand the conversation more comprehensively.

[0053] In this way, the data generated by the human-computer dialogue can not only be stored effectively, but also be conveniently retrieved and analyzed when needed, providing rich contextual information for the chatbot's response generation.

[0054] The conversation data that has been generated and stored in the database constitutes historical conversation data. All historical conversation data between the user and the robot can be grouped according to a preset strategy to obtain multiple groups of historical conversation data. Each group of historical conversation data can be regarded as a conversation between the user and the robot, wherein the most recent and usually ongoing conversation is the latest conversation, and the historical conversation data before the latest conversation can be regarded as a previous conversation before the latest conversation. The preset strategy for grouping historical conversation data may be different in different embodiments. For example, in one embodiment, the grouping may be based on the number of rounds, that is, the number of rounds reaching a preset round number threshold, for example, a conversation is determined as a unit of 40 rounds of conversation; in another embodiment, the grouping may be based on the time length reaching a preset time length threshold, for example, each conversation is determined at intervals of one month.

[0055] The latest conversation usually helps to provide the user's recent status portrait feature data. Therefore, based on the latest historical conversation data corresponding to the latest conversation, the corresponding portrait feature data can be extracted by comparing the various portrait feature fields defined in the pre-defined user portrait data structure to define the recent user portrait of the user corresponding to the latest conversation. In one embodiment, the "latest conversation" here refers to the current conversation between the user and the robot, and the "latest historical conversation data" refers to a series of historical conversation records that are directly related to the latest conversation and are closest in time, such as the time-continuous historical conversation data corresponding to the most recent 30 rounds of human-computer conversations. It is not difficult to understand that by analyzing these data to construct a recent user portrait, the behavioral characteristics and preferences exhibited by the user in the current conversation can be captured.

[0056] Extracting the portrait feature data can be implemented using natural language processing technology, including but not limited to text analysis, keyword extraction, sentiment analysis, etc. to obtain the portrait feature data corresponding to the portrait feature field in the recent user portrait. For example, by analyzing the text in the latest historical conversation data of the latest conversation, the user's interests, emotional tendencies, language habits and other features can be identified. These features are then quantified into the portrait feature data of the corresponding portrait feature field, and the user's recent user portrait is constructed accordingly.

[0057] It can be seen that the recent user portrait refers to a collection of user features formed based on the portrait feature data extracted from the latest session, which reflects the user's immediate status and needs in the latest session. For example, if the user expresses a strong interest in a topic in the session, then this interest point will be included in the user's recent user portrait as part of the portrait feature data.

[0058] More specifically, in order to realize the extraction of portrait feature data, a variety of technical means can be used. One embodiment is to use a rule-based keyword extraction method to identify and extract key information in the conversation through a preset keyword list. Another embodiment is to apply a machine learning model, such as a support vector machine (SVM) or a deep neural network, or a large language model, to perform semantic analysis corresponding to various portrait feature fields on the conversation text, thereby extracting the corresponding portrait feature data. In addition, unsupervised learning methods such as cluster analysis can also be used to automatically identify patterns and trends in the conversation, thereby enriching the user's portrait feature data.

[0059] In an exemplary embodiment, a large language model is used as a portrait feature extraction model, and the latest historical conversation data of the latest conversation is combined with the portrait feature field list that defines the user portrait and the output format specification of the user portrait to generate corresponding portrait feature prompt text. The portrait feature prompt text is input into the portrait feature extraction model, and the portrait feature extraction model outputs the corresponding portrait feature data, thereby forming a recent user portrait.

[0060] Step S3200: call the long-term user portrait corresponding to the previous session of the latest session from the portrait feature library, merge the portrait feature data of the long-term user portrait with the recent user portrait, and obtain the latest user portrait of the user;

[0061] This step focuses on calling the long-term user portrait of the user who is currently engaging in human-computer dialogue from the portrait feature library, and fusing it with the user's recent user portrait to generate the user's latest user portrait, so as to update the existing long-term user portrait in the portrait feature library, thereby incorporating the user's latest status information into the user's long-term user portrait.

[0062] The portrait feature library is a database that stores long-term user portraits of a large number of users served by the chatbot, where each user has a corresponding long-term user portrait. The long-term user portrait contains the stable characteristics and preferences shown by the user in a series of historical sessions. This information accumulates over time and is updated when necessary. The portrait feature data corresponding to each portrait feature field in the long-term user portrait can be associated to represent its corresponding vector. When a new session is generated, the long-term user portrait related to the user can be retrieved from the portrait feature library to obtain the portrait feature data and / or its vector corresponding to each portrait feature field, so as to integrate it with the portrait feature data generated by this new session.

[0063] To this end, firstly, the corresponding long-term user portrait is called from the portrait feature library according to the user's identity. This long-term user portrait is accumulated based on the data in all the user's past sessions, that is, the previous session of the latest session, and it reflects the user's behavior pattern and preference trend over a long period of time. As for the user's recent user portrait, it has been generated in step S3100, reflecting the user's immediate status and needs in the latest session. Based on this, the user's recent user portrait and long-term user portrait can be further integrated to obtain the latest user portrait.

[0064] The fusion process combines the long-term user profile with the recent user profile to form the user's latest user profile. This fusion can be achieved through different strategies, such as weighted average, feature replacement or feature supplementation. The weighted average strategy may give a higher weight to the recent user profile to reflect the user's latest behavior and preferences. The feature replacement strategy replaces the corresponding features in the long-term user profile with certain key features in the recent user profile to update the user's interests or preferences. The feature supplementation strategy adds new features in the recent user profile to the long-term user profile to enrich the user's profile information.

[0065] In one embodiment, a large language model is used as a portrait feature fusion model to implement the fusion of the user's recent user portrait and long-term user portrait. To this end, it is necessary to construct a corresponding portrait fusion prompt text based on the recent user portrait and the long-term user portrait in combination with the corresponding fusion strategy, and input the portrait feature fusion model to obtain the latest user portrait.

[0066] The selection and application of fusion strategies can be determined based on a variety of factors, including the stability of user behavior, the importance of the latest session, and the frequency of updating the user profile. By setting the fusion strategy in advance on demand, it can ensure that the user profile can reflect the long-term characteristics of the user and adapt to the immediate changes of the user.

[0067] For example, if a user mentions interest in a particular topic multiple times in the latest session, and these mentions are not significantly reflected in the previous long-term user profile, then during the fusion process, the corresponding fusion strategy can choose to increase the weight of the topic in the user profile, or add it to the user profile as a new interest point.

[0068] It can be seen that by integrating the user's long-term user profile and recent user profile, the chatbot can better understand the user's personality and needs, both long-term and short-term. This user profile that integrates historical and recent data provides a solid foundation for generating more accurate and personalized response texts, thereby improving the chatbot's service quality and user experience.

[0069] Step S3300: Replace the long-term user portrait in the portrait feature library with the latest user portrait, so as to iteratively update the long-term user portrait according to the latest conversation between the user and the chat robot;

[0070] The latest user portrait obtained in step S3200 actually constitutes the corresponding long-term user portrait in the user's latest state. Based on this, in this step, the latest user portrait of this user can replace the corresponding long-term user portrait in the portrait feature library for storage according to the data format specification of the portrait feature library representing the long-term user portrait. In this way, the long-term user portrait of this user in the portrait feature library can reflect both the long-term stable characteristics of this user and its latest characteristics.

[0071] It can be seen that, in fact, step S3100 extracts the user's recent user portrait from the latest conversation, step S3200 fuses the recent user portrait and the long-term user portrait to obtain the latest user portrait, and step S3300 replaces the latest user portrait with the long-term user portrait stored in the portrait feature library, which itself constitutes an iterative process. Since multiple sets of historical conversation data may be generated in succession during the long-term communication between the user and the chat robot, the corresponding latest conversations will inevitably be generated in sequence at different corresponding time points. Each time the generation conditions of a latest conversation are met, the iterative process from step S3100 to step S33000 is triggered, which realizes the fusion update of the existing long-term user portrait at that time using the recent user portrait corresponding to the latest conversation. Therefore, for each user, his long-term user portrait is obtained by iteratively updating according to such a mechanism during the long-term conversation between the user and the chat robot.

[0072] Obviously, step S3300 embodies the core principle of iteratively updating the user profile. In this step, it can be understood that as the conversation between the user and the robot continues, each new conversation may bring about an update of the user's state or preference. Therefore, the long-term user profile is not static, but is dynamically maintained through a series of iterative processes.

[0073] Importantly, this process is iterative. As time goes by and more sessions are generated, each new session triggers a series of operations from step S3100 to step S3300, thereby achieving continuous updating of the long-term user profile. This mechanism ensures that the long-term user profile in the profile feature library can adapt to changes in user behavior, whether these changes are gradual or sudden.

[0074] Therefore, for each user, their long-term user profile is continuously updated according to this iterative mechanism. Each iteration is based on the latest session data and takes into account historical profile information to generate an updated long-term user profile that combines the user's historical and current behavior characteristics. This process not only captures the user's immediate needs, but also retains the user's long-term preferences, allowing the chatbot to provide a more accurate and coherent interactive experience.

[0075] Step S3400: Based on the question text submitted by the user and the portrait feature data retrieved from the updated long-term user portrait with reference to the question text, generate a response text corresponding to the question text.

[0076] After completing the iterative update of the user portrait, in the next one or more sessions, the updated long-term user portrait can be used to generate response texts corresponding to the user's questions.

[0077] Specifically, when a user asks a question or sends a message to a chatbot, the chatbot will first respond to the user question event. The chatbot analyzes the user's question text and extracts feature prompt data, which can indicate the profile feature fields that need to be referenced in the user profile. For example, if the user's question text contains certain specific keywords or phrases, these keywords or phrases will be used as feature prompt data to guide the chatbot to retrieve the profile feature data related to these feature prompt data from the user's long-term user profile.

[0078] Next, the robot performs semantic retrieval on the updated long-term user profile in the profile feature library based on these feature prompt data. In one embodiment, the semantic similarity between the feature prompt data and each profile feature data in the user profile can be calculated during this retrieval process to find the profile feature data that is most semantically relevant to the question text.

[0079] Once the relevant image feature data is retrieved, the robot can use the question text and the retrieved image feature data to construct a response prompt text. This response prompt text is the basis for generating the final response text, which contains all the relevant information and context of the user's question.

[0080] Finally, the robot can call the human-computer dialogue model to generate the corresponding answer text according to the answer prompt text. This answer text is the robot's reply to the user's question. It not only takes into account the user's current question, but also combines the user's long-term portrait characteristics to ensure the relevance and personalization of the reply.

[0081] For example, if a user mentions a recent conference they attended in their question, and this information was mentioned in a previous session and recorded in the user’s long-term profile, the bot will take this into account when generating a response and may quote relevant information in the reply or provide follow-up advice and assistance.

[0082] In this way, the robot is able to generate highly personalized and accurate response texts, providing users with a coherent and targeted conversation experience. This process not only improves user satisfaction, but also enhances the practicality and efficiency of the chatbot.

[0083] According to the above embodiments, the present application innovates the answering method to address the deficiencies of existing chat robots in processing long-term memory and personalized services, and achieves the following beneficial effects:

[0084] First, this application constructs a recent user profile by analyzing the latest historical conversation data corresponding to the latest conversation generated by the user and the chatbot. This step effectively captures the characteristics and needs of the user at a specific point in time, providing the robot with a more accurate personalized service foundation.

[0085] Secondly, this application obtains the latest user portrait by calling the long-term user portrait corresponding to the previous session of the latest session from the portrait feature library, and integrating the portrait feature data with the recent user portrait. This fusion process not only takes into account the user's immediate characteristics, but also integrates the user's historical behavior and preferences, significantly improving the robot's long-term memory ability. This improvement in memory ability enables the robot to remember and use the user's communication content at different time points across a single session, providing users with a more coherent and personalized interactive experience.

[0086] Furthermore, the long-term user portrait update mechanism of this application adopts an iterative update method, so that the long-term user portrait can continuously absorb the latest information in the latest conversation, maintaining the freshness and accuracy of the robot's memory. This dynamic update mechanism significantly improves the coherence of the robot in multiple rounds of conversations, allowing users to experience a more natural and humane communication experience.

[0087] Subsequently, this application also optimizes the information processing process, effectively reducing the interference of redundant information in historical conversations, so that the robot can focus more on the user's key needs and questions when generating replies. This optimization not only improves the accuracy and relevance of replies, but also improves the robot's ability to handle complex conversations. By iteratively updating user portraits, the robot can better maintain the contextual coherence of the conversation and generate smooth and consistent replies even in multiple rounds or across conversations.

[0088] In addition, this application also improves computing efficiency by limiting the update and fusion scope of user portraits, avoiding the increase in computing costs and interference with comprehension caused by too long input prompts. The intelligent response generation mechanism further ensures the quality of replies and user satisfaction, making the chatbot more efficient and intelligent when providing services.

[0089] Finally, when generating the response text, this application makes full use of the updated long-term user profile feature data, and combines it with the question text submitted by the user to generate highly relevant and accurate responses. This process not only improves the quality and depth of the response, but also makes the robot's answer closer to the user's actual needs and interests, thereby significantly improving user satisfaction and communication experience.

[0090] On the basis of any embodiment of the method of the present application, based on the latest historical conversation data corresponding to the latest conversation generated by the human-machine dialogue between the user and the chat robot, extracting the user's portrait feature data to form a recent user portrait of the user, including:

[0091] Step S3110, monitoring whether the number of conversation turns in the historical conversation data generated since the previous conversation reaches a preset threshold;

[0092] This step monitors the number of conversation rounds in the historical conversation data and determines whether it reaches a preset threshold, so as to determine whether there is enough conversation data to generate a recent user profile of the user to update the long-term user profile.

[0093] The number of conversation turns refers to the number of times a user and a robot exchange information in a human-machine conversation. For example, if a user sends a message and the robot replies with a message, it constitutes a conversation turn. If the user sends a message again, it constitutes two conversation turns. The number of conversation turns can be monitored by a counter inside the chatbot system, which tracks the number of conversation turns in the history of the previous conversation; it can also be determined by counting the number of conversation turns in the history of the conversation data generated since the previous conversation.

[0094] The preset threshold in this step is a pre-set limit on the number of conversation rounds, which is used to determine whether to continue extracting the profile feature data. If the number of conversation rounds does not reach this threshold, the system will stop the subsequent step of extracting the profile feature because the amount of data may not be sufficient to form a representative recent user profile. This method can avoid building inaccurate recent user profiles based on insufficient data.

[0095] Step S3120: when the preset threshold is reached, the portrait feature prompt template is called, and the generated historical conversation data is used as the historical conversation data of the latest session, and is inserted into the portrait feature prompt template to obtain the portrait feature prompt text, wherein the portrait feature prompt template includes a plurality of portrait feature fields for defining the user portrait and an output format specification of the user portrait;

[0096] When the number of conversation rounds reaches or exceeds the preset threshold, the system will continue to extract the profile feature data. This decision is based on the assumption that a certain number of conversation rounds can provide enough information to capture the user's behavior patterns and preferences. For example, if the preset threshold is set to 30 rounds of conversation, the system will only consider that there is enough data for analysis and profile construction when the user's communication with the robot reaches or exceeds 30 rounds.

[0097] When the number of monitored conversation turns reaches or exceeds the preset threshold, it is actually confirmed that a new conversation has occurred. Therefore, when entering the stage of extracting portrait feature data, the system will call the portrait feature prompt template and use the historical conversation data corresponding to the latest conversation to generate the portrait feature prompt text.

[0098] The profile feature prompt template is a predefined template that contains a series of profile feature fields and output format specifications for defining user profiles. These fields may include user interests, behavioral habits, emotional tendencies, etc., while the output format specifications ensure that the extracted data is both systematic and standardized for subsequent processing. Exemplary output format specifications can be JSON format, list format, or any other feasible format.

[0099] The process of calling the portrait feature prompt template is actually to substitute the latest historical conversation data corresponding to the latest conversation as input data into the template. In other embodiments, this process can also be implemented through automated scripts, or assisted by natural language processing technology. For example, in one embodiment, through these automated scripts or natural language processing technology, the system can first analyze the historical conversation data, identify the information related to the portrait feature fields defined in the template, and organize this information into portrait feature prompt text according to the format specification of the template.

[0100] The profile feature hint text is the basis for extracting user profile feature data. It not only contains the user's direct speech, but may also include information such as the user's behavior patterns, topic preferences, etc. For example, if the user mentions interest in technology many times in the conversation, the profile feature hint text will reflect this and may include "technology enthusiast" as a feature of the user profile.

[0101] By using the portrait feature prompt template, the system can effectively extract valuable information from a large amount of historical conversation data, providing support for building and updating the user's recent user portrait.

[0102] For example, if the user's conversation content shows a strong interest in travel, and this interest is repeatedly mentioned in multiple rounds of conversation, the profile feature prompt template can capture this point and clearly indicate the user's preference in the profile feature prompt text. In this way, when the system builds and updates recent user profiles, it can use "travel enthusiast" as an important feature of the user profile, thereby providing more personalized services and content recommendations in subsequent conversations.

[0103] Step S3130: Call the portrait feature extraction model to summarize the historical conversation data of the latest conversation according to the portrait feature fields and output format specifications in the portrait feature prompt text to extract the portrait feature data of the user.

[0104] The portrait feature extraction model can be based on various large language models, such as BERT and Llama. These models are widely used in text analysis and feature extraction tasks due to their powerful language understanding capabilities. In this application, the portrait feature extraction model uses the deep learning architecture of these large language models to conduct in-depth analysis of the portrait feature prompt text to identify and extract features such as user interests, behavioral habits, and emotional tendencies.

[0105] In specific implementation, the portrait feature extraction model first receives the portrait feature prompt text as input. The prompt text has been generated based on the user's historical conversation data and the portrait feature prompt template, and contains the potential information of the user's portrait. The model encodes the text through a neural network and converts natural language into high-dimensional vector representations. These vectors capture the semantic information and contextual relationships of the text.

[0106] Next, the model uses the attention mechanism to focus on key parts of the text, such as specific keywords, phrases, or sentences. For example, if a user mentions "travel" many times in a conversation, the model will recognize this pattern and use "travel enthusiast" as a feature of the user profile.

[0107] In addition, the portrait feature extraction model can also be combined with other technologies, such as sentiment analysis, to identify the user's emotional state in the conversation and further enrich the emotional tendency characteristics of the user portrait. By comprehensively considering multiple aspects of the text, the model can extract as much as possible the various key portrait feature data corresponding to the user's recent user portrait.

[0108] For example, consider a user who frequently discusses technology news and the latest electronic products in recent conversations with a chatbot. The profile feature extraction model will analyze these discussions, identify the user's interest in "technology" and "electronic products", and embed this information into the recent user profile as profile feature data. If the user expresses his or her anticipation for a new technology product that is about to be released in the conversation, the model can even extract the user's preference for a specific product and reflect it in the recent user profile.

[0109] According to the above process, the portrait feature extraction model not only improves the accuracy and richness of user portraits, but also provides the chatbot with a deeper understanding of users, enabling it to provide more personalized and accurate services and responses. This extraction method based on a large language model can accurately capture the latest key information required for user portraits through the latest conversations, ensuring the high quality and high relevance of the portrait feature data of recent user portraits, and providing a solid foundation for efficient human-computer interaction.

[0110] Based on any embodiment of the method of the present application, a long-term user portrait corresponding to a previous session of the latest session is called from a portrait feature library, and the portrait feature data of the long-term user portrait and the recent user portrait are merged to obtain the latest user portrait of the user, including:

[0111] Step S3210: calling a long-term user portrait of the user from a portrait feature library according to the identity identifier of the user, wherein the long-term user portrait is obtained by sequentially iterating and fusing portrait feature data extracted from all previous sessions of the latest session;

[0112] As shown in the previous example, the portrait feature library is a database that centrally stores user portraits. It contains the long-term user portrait of each user corresponding to the identity of each user. These portraits are accumulated from the data of all previous conversations between the user and the chatbot, reflecting the user's behavior patterns and preference trends over a period of time. The design of the portrait feature library allows the system to efficiently retrieve and update user portraits to support the implementation of personalized services.

[0113] Based on this, the corresponding long-term user profile is first located and called through the user's identity. This process can be achieved by querying the database index, for example, in a key-value-based index architecture, where the user's identity is used as the primary key (Key), the corresponding long-term user profile stored as the value domain (Value) is quickly located. After retrieving the long-term user profile, the system will use this data as a basis and merge it with the user's most recent interaction data to generate an updated user profile, that is, the latest user profile.

[0114] As mentioned above, the long-term user profile is constructed by sequentially iterating and fusing the user's profile feature data in previous sessions. This means that as the user interacts with the robot, the system will continuously update and fuse the user's profile to ensure that the profile reflects the user's latest preferences and behaviors. This iterative update mechanism allows the user profile to evolve over time while maintaining the continuity of its historical information.

[0115] Step S3220: obtaining a portrait fusion prompt template, inserting the portrait feature data of the recent user portrait and the long-term user portrait into the portrait fusion prompt template to obtain a portrait fusion prompt text, wherein the portrait fusion prompt template includes a fusion strategy corresponding to the portrait feature field;

[0116] The portrait fusion prompt template can be customized in advance as needed to guide the portrait feature fusion model to fuse the portrait feature data of the user's long-term user portrait and recent user portrait. The portrait fusion prompt template defines how to extract the portrait feature data corresponding to each portrait feature field from the long-term user portrait and the recent user portrait, and how to combine these features in a meaningful way by including the fusion strategy of the portrait feature field. The fusion strategy may include but is not limited to feature replacement, feature weighting, feature supplementation and other methods.

[0117] For example, if the recent user profile shows that the user is interested in a new topic that is not reflected in the long-term user profile, the fusion strategy may choose to increase the weight of this new interest topic in the updated user profile. On the contrary, if an old interest point is not mentioned in recent sessions, the fusion strategy may reduce the weight of the interest point or remove it from the user profile.

[0118] The use of the profile fusion prompt template ensures that the update of the user profile takes into account both the user's long-term preferences and recent changes in the user. This process can be achieved through automated tools that automatically extract and fuse data from the two user profiles based on the guidance in the template.

[0119] In specific implementations, the portrait fusion prompt template can be designed to accept multiple input formats, such as structured database query results, semi-structured JSON objects, or plain text data. The fusion strategy in the template will guide how to parse these input data and convert them into a unified format for comparison and fusion.

[0120] For example, suppose a user frequently mentions an interest in cooking in recent sessions, while the user's long-term profile records a preference for traveling. The profile fusion hint template will guide the system on how to identify these two interests and balance these preferences in the updated user profile, perhaps by increasing the weight of the cooking interest while maintaining a certain weight for the travel preference.

[0121] When applying the portrait fusion prompt template, fill in the portrait feature data corresponding to the recent user portrait and the long-term user portrait in the corresponding position of the template. By putting these data into the template, the corresponding portrait fusion prompt text can be obtained, which can be used as the input data of the portrait feature fusion model.

[0122] Step S3230, calling the portrait feature fusion model according to the fusion strategy in the portrait fusion prompt text, using the recent user portrait to update the portrait feature data of the long-term user portrait to achieve fusion, and obtaining the fused portrait feature data as the latest user portrait of the user.

[0123] In this embodiment, the implementation of the portrait feature fusion model is based on the advanced technology of the large language model. This model uses deep learning technology, especially the Transformer architecture, to understand and process natural language data. Large language models are able to capture the nuances and complex patterns of language, which makes them very suitable for the task of processing the fusion of user portrait data.

[0124] The core function of the portrait feature fusion model is to effectively integrate the feature data of recent user portraits and long-term user portraits. Therefore, in-depth analysis and intelligent decision-making can be performed on the two portrait data to determine which features should be updated, enhanced, or retained. For example, if the recent user portrait shows that the user has a strong interest in a new field, and this interest is not fully reflected in the long-term user portrait, the fusion model will add this interest point to the user portrait according to the corresponding fusion strategy in the portrait fusion prompt template.

[0125] In the specific implementation, the portrait feature fusion model receives as input data the prompt text generated by the portrait fusion prompt template. The model first parses this data, and then applies its language understanding ability to analyze and compare the differences between the long-term user profile and the recent user profile. Then, the model updates the long-term user profile according to the fusion strategy given in the prompt text. This may include feature replacement, that is, replacing outdated or irrelevant features in the long-term profile with data from the recent profile; feature weighting, that is, adjusting the weights of certain features based on the user's recent activities; and feature supplementation, that is, adding new or missing features to the long-term profile.

[0126] In addition, the profile feature fusion model is also able to handle more complex fusion strategies such as feature decision updating, which may involve comprehensive evaluation and decision making of multiple features to determine their final representation in the user profile.

[0127] By using a large language model as the basis of the portrait feature fusion model, reasoning is performed based on the portrait fusion prompt text with the added fusion strategy to obtain the latest user portrait that integrates the recent user portrait and the long-term user portrait. The method of this application can achieve highly accurate and personalized user portrait updates, providing users with a more coherent and rich interactive experience. This fusion method based on a large language model not only improves the quality and relevance of user portraits, but also enhances the chatbot's contextual understanding and personalized service capabilities in multi-round conversations.

[0128] On the basis of any embodiment of the method of the present application, calling the portrait feature fusion model according to the fusion strategy in the portrait fusion prompt text, using the recent user portrait to update the portrait feature data of the long-term user portrait to achieve fusion, and obtaining the fused portrait feature data as the latest user portrait of the user, including any one or more of the following:

[0129] Step S3231: According to the feature replacement update strategy in the fusion strategy inherited by the portrait fusion prompt text from the portrait fusion prompt template, the portrait feature fusion model replaces the portrait feature data of the corresponding target feature in the long-term user portrait with the portrait feature data of the target feature corresponding to the feature replacement update strategy in the recent user portrait as the corresponding portrait feature data in the latest user portrait;

[0130] The feature replacement update strategy directly uses the profile feature data in the recent user profile to replace the profile feature data of the corresponding features in the long-term user profile. This strategy is suitable for situations where the user's interests or behaviors have changed significantly. For example, if a user recently shows interest in a new topic, and this interest is not reflected in the long-term user profile, the profile feature fusion model will use the relevant data in the recent user profile to replace the old data in the long-term user profile to ensure the timeliness and accuracy of the user profile.

[0131] Step S3232: according to the feature completion and update strategy in the fusion strategy inherited from the portrait fusion prompt template in the portrait fusion prompt text, the portrait feature fusion model completes the portrait feature data of the target feature corresponding to the feature completion and update strategy in the recent user portrait into the latest user portrait;

[0132] The feature completion update strategy aims to add new features from recent user profiles to long-term user profiles. This is applicable to situations where users show new behavioral characteristics or preferences that have not yet been recorded in long-term user profiles. For example, a user may have mentioned new hobbies or activities in a recent conversation, and the profile feature fusion model adds this new information to the long-term user profile as a supplement, making the user profile more comprehensive.

[0133] Step S3233: The portrait feature fusion model integrates the portrait feature data of the target features of the recent user portrait and long-term portrait features corresponding to the feature decision update strategy according to the feature decision update strategy in the fusion strategy inherited from the portrait fusion prompt template in the portrait fusion prompt text, as the corresponding portrait feature data in the latest user portrait.

[0134] The role of the feature decision update strategy is to comprehensively evaluate and decide on multiple features in the long-term user portrait and the recent user portrait. This strategy is suitable for situations where the features in the user portrait need to be fine-tuned. The portrait feature fusion model will weigh the features based on their relevance and importance and decide how they should be presented in the latest user portrait. For example, if a user shows interest in multiple topics in both the recent user portrait and the long-term user portrait, the model will combine this information to decide which points of interest should be emphasized and which can be appropriately reduced in weight. Alternatively, the model can choose to use only one of the recent user portrait and the long-term user portrait.

[0135] The above steps S3231, S3232, and S3233 can be flexibly selected as needed, and can be used individually or in any number, depending on actual needs. Finally, through the fusion processing of the portrait feature fusion model, the latest user portrait of the user can be obtained.

[0136] It can be seen that by flexibly combining and applying the above steps, the method of this application can ensure the accuracy and completeness of the user portrait, while providing a personalized and coherent service experience. This comprehensive update mechanism enables the chatbot to adapt to changes in user interests and behaviors, strengthens the pertinence and naturalness of the conversation, and thus significantly improves user satisfaction and communication experience.

[0137] On the basis of any embodiment of the method of the present application, based on the question text submitted by the user and the portrait feature data retrieved from the updated long-term user portrait with reference to the question text, generating a response text corresponding to the question text includes:

[0138] Step S3410: respond to a user question event, summarize the question text given in the event, and extract feature prompt data having a portrait feature field prompt function;

[0139] When a user submits a question text to the chatbot, a corresponding user question event is triggered. The chatbot system first needs to process the question text carried in the user question event to extract useful information. This process includes summarizing the question text in order to identify and extract feature prompt data that has the function of profiling feature field prompts.

[0140] Feature hint data is key information extracted from the user's question text, which can indicate the user's interests, needs, or emotional state, etc. For example, if the user asks "What science fiction movies are recommended recently?", the summarization process will identify "science fiction movies" as a key feature and use it as feature hint data.

[0141] Following the same principle as extracting the user's recent user profile revealed in the previous article, the summarization process can be implemented through natural language processing techniques, such as text classification, keyword extraction, or sentiment analysis. These techniques can help the system quickly identify and extract the main concepts and sentiment tendencies in the question text. For example, using a machine learning-based keyword extraction algorithm, keywords or phrases in the text can be automatically identified as the basis for understanding user intent and building a user profile.

[0142] In a specific embodiment, the summarization process can adopt different methods, such as rule-based methods, statistical learning methods, or deep learning methods. The rule-based method can rely on a predefined keyword list and grammatical rules to extract features; the statistical learning method can determine the importance based on the frequency of words in the text; and the deep learning method can use pre-trained language models such as BERT or large language models to capture deeper semantic information.

[0143] Through summarization and feature extraction, the system can capture the essence and context of the user's question text, providing accurate input data for subsequent semantic retrieval and answer generation.

[0144] Step S3420: Based on the feature prompt data, semantic search is performed on the updated long-term user portrait of the user in the portrait feature library to retrieve portrait feature data that is semantically similar to the feature prompt data;

[0145] After responding to the user's question event and extracting feature prompt data, we can perform in-depth semantic retrieval on the long-term user profile based on these feature prompt data. This process aims to retrieve the profile feature data that is semantically similar to the user's question text from the updated long-term user profile, so as to generate a more accurate and personalized response text.

[0146] Specifically, this step requires calculating and comparing the semantic similarity between the feature prompt data and the long-term user portrait. First, it is necessary to convert the feature prompt data and the various portrait feature data in the long-term user portrait into a unified vector representation, which can be achieved using a text embedding model, which can convert text into a vector of fixed dimension, so that the text data can be mathematically calculated for distance. It should be pointed out that the portrait feature data in the long-term portrait data can also be represented as a vector in advance and stored in the portrait feature library, and can be directly called in this step.

[0147] Next, use any data distance algorithm, such as cosine similarity, Pearson correlation coefficient algorithm, Euclidean distance algorithm, etc., to calculate and determine the similarity between the feature prompt data and each profile feature data in the long-term user profile. Cosine similarity is relatively efficient and can be used first. It is an indicator to measure the degree of similarity between two vectors in direction. Its value ranges from -1 to 1. The closer the value is to 1, the more similar the two vectors are, and the closer the value is to -1, the less similar the two vectors are.

[0148] Through the operation of the data distance algorithm, a similarity matrix can be obtained, which stores the similarity of each feature prompt data to each person's portrait feature data in the long-term user portrait. After obtaining the similarity matrix, each feature prompt data is sorted according to the similarity, and a specific number of portrait feature data with the highest semantic similarity are screened out. This screening process can be based on threshold judgment or on the required similarity ranking. For example, the top ten portrait feature data with the highest similarity to each feature prompt data can be selected.

[0149] In this way, it can be ensured that the retrieved portrait feature data is highly semantically relevant to the user's question text, thereby providing rich contextual information and personalized basis for generating the response text. For example, if the user's question text contains an interest in a specific topic, such as "science fiction movies", then the retrieved user portrait feature data will contain user preferences and past discussions related to "science fiction movies", and this information will be used to build a response that better meets the user's needs. Through the above semantic retrieval technology, in-depth mining and understanding of the user's long-term portrait is achieved, laying a solid foundation for generating personalized and high-quality response text.

[0150] Step S3430: construct a response prompt text using the question text and the retrieved portrait feature data, and call the human-computer dialogue model to generate a corresponding response text to reply to the user based on the response prompt text.

[0151] After performing semantic retrieval based on the feature prompt data to obtain the corresponding portrait feature data, the response prompt text can be constructed and the final response text can be generated.

[0152] First, you can get a response prompt template that contains a response strategy. This template defines how to combine the question text and the retrieved portrait feature data to construct the response prompt text. The template may contain placeholders or specific fields for inserting the user's question text and related portrait feature data.

[0153] Next, the user's question text and the profile feature data retrieved from the long-term user profile that is similar to the question semantics are filled into the answer prompt template. This filling process needs to ensure the accuracy of the data and the logical coherence, so that the generated answer prompt text can truly reflect the user's intentions and needs.

[0154] After that, the constructed answer prompt text is input into the human-computer dialogue model. At this point, the human-computer dialogue model will conduct an in-depth analysis based on the information in the answer prompt text and generate the answer text according to the preset answer strategy. The model will have an in-depth understanding of the user's question, evaluate the relevance of the retrieved portrait feature data, and infer the possible answer direction and content.

[0155] The generated response text can be processed according to the preset data format, and this processing can also be implemented through the preset format specification instruction model in the response prompt template to ensure that it can be correctly pushed to the user by the chatbot system. This includes but is not limited to text formatting, encoding conversion, and ensuring that the text complies with the standards and protocols of the chatbot output.

[0156] Through the complete execution process obtained through the above embodiments, the chatbot system achieves in-depth understanding and accurate response to user questions, significantly improving user experience and technical effects.

[0157] First, the system summarizes the user's question through natural language processing technology and extracts key feature prompt data, which not only captures the essence of the user's question, but also provides a basis for building a user profile. The system uses advanced semantic retrieval technology to retrieve feature data with similar semantics to the question text from long-term user profiles. This step ensures the personalization and relevance of the answer, allowing the robot to provide customized replies based on the user's historical preferences and interests.

[0158] Furthermore, the system uses answer prompt templates and human-computer dialogue models to generate answer texts. This process not only improves the accuracy of the answers, but also ensures the readability and compliance of the answers through preset data format processing. This method avoids the problems of blunt replies or mismatch with user needs that may occur in traditional chatbots, and achieves more natural and humane communication.

[0159] In addition, this embodiment significantly improves the long-term memory ability of the chatbot with the help of iteratively updating the user portrait and dynamically integrating the latest conversation data. The robot can remember the user's communication content at different time points and maintain coherence in the conversation, and can generate smooth and consistent responses even in multiple rounds or across conversations. This enhanced memory ability makes users feel more intimate and intelligent service.

[0160] Finally, this embodiment effectively reduces the interference of redundant information and improves the quality and depth of replies by optimizing the information processing process. At the same time, through the intelligent response generation mechanism, it ensures the high efficiency and high intelligence of the chatbot in providing services, further improving user satisfaction and communication experience.

[0161] It can be seen that the technical effect achieved by this embodiment provides new possibilities for the development and application of chatbot technology, and demonstrates its potential in providing high-quality user experience.

[0162] On the basis of any embodiment of the method of the present application, based on the feature prompt data, a semantic search is performed on the updated long-term user portrait of the user in the portrait feature library to retrieve portrait feature data that is semantically similar to the feature prompt data, including:

[0163] Step S3421, obtaining a first semantic vector matrix corresponding to each of the feature prompt data and a second semantic vector matrix corresponding to each of the portrait feature data in the updated long-term user portrait;

[0164] Semantic vectorization of feature hint data is the cornerstone of accurate semantic retrieval. Specifically, the feature hint data in text form needs to be converted into numerical vectors, thereby constructing the first semantic vector matrix. Each feature hint data item is mapped to a point in a high-dimensional space through a specific text embedding technology, and the collection of these points constitutes the first semantic vector matrix.

[0165] The choice of text embedding technology is crucial to the quality of the vector. At present, there are many mature text embedding models in the industry, including but not limited to Word2Vec, GloVe, FastText, BERT, GTE, etc. These models can learn the embedding representation of words, phrases or sentences based on a large amount of text data and capture their semantic information.

[0166] In this embodiment, the most suitable embedding model can be selected according to the specific content and characteristics of the feature prompt data. After the model is selected, the feature prompt data is input into the model to obtain a vector representation of each data item. These vectors are arranged in the order of the input data to form a first semantic vector matrix, in which each row represents a vector representation of a feature prompt data.

[0167] For example, if a user asks "What sci-fi movies are recommended recently?", the feature hint data "sci-fi movies" extracted by the summary process will be converted into a vector. If there are multiple feature hint data, such as the user expressed interest in different types of movies at different time points, each point of interest will be converted into an independent vector, and these vectors will be used as rows of the first semantic vector matrix.

[0168] In addition, in order to ensure the consistency of the vectorization process and the quality of the vector, the input text can be preprocessed, including word segmentation, stop word removal, part-of-speech restoration, etc. These preprocessing steps help improve the performance of the text embedding model and ensure that the generated vector can accurately reflect the semantic content of the original text.

[0169] It is not difficult to understand that the semantic vectorization of each portrait feature data in the user's long-term user portrait can also be implemented in the same way as the feature prompt data, and no further explanation is given, thereby obtaining a second semantic vector matrix corresponding to the long-term user portrait. The second semantic vector matrix can be generated in advance and stored in the portrait feature library and directly called in this step, or it can be generated separately in this step.

[0170] In the first semantic vector matrix, each feature prompt data is represented as a corresponding vector. Similarly, in the second semantic vector matrix, each image feature data is represented as a corresponding vector. Each vector is represented by multiple dimensional values.

[0171] After obtaining the first semantic vector matrix and the second semantic vector matrix, the two can be used for subsequent semantic similarity calculation and retrieval to achieve accurate matching and retrieval of relevant portrait feature data in long-term user portraits.

[0172] Step S3422: Apply a data distance algorithm to calculate a similarity matrix between the first semantic vector matrix and the second semantic vector matrix, wherein the similarity matrix includes the similarity between each feature prompt data and each portrait feature data;

[0173] The similarity matrix is ​​obtained by performing similarity calculation based on the first semantic vector matrix and the second semantic vector matrix, which can quantitatively describe the semantic similarity between the feature prompt data and the portrait feature data in the long-term user portrait.

[0174] In specific implementation, the calculation of similarity is usually implemented using a data distance algorithm. The data distance algorithm can measure the proximity of two vectors in the vector space. Common algorithms include cosine similarity and Euclidean distance. These algorithms have different focuses and are suitable for different application scenarios and needs.

[0175] Cosine similarity measures the consistency of two vectors in direction rather than size. It is obtained by calculating the dot product of two vectors and the ratio of their modulus lengths. It is suitable for situations where the difference in vector scale is ignored and the direction is focused. The calculation formula is:

[0176]

[0177] in and Represents a vector in the first semantic vector matrix and the second semantic vector matrix respectively, Represents the dimension of a vector.

[0178] Euclidean distance measures the straight-line distance between two vectors in Euclidean space and is suitable for situations where the difference between vectors is of concern.

[0179] In this embodiment, the selected data distance algorithm is applied to each vector in the first semantic vector matrix and all vectors in the second semantic vector matrix to generate a similarity matrix. The rows of the matrix correspond to the vectors of the feature prompt data, the columns correspond to the vectors of the long-term user portrait, and each element in the matrix represents the similarity of the corresponding vector pair. For example, if the feature prompt data is the key phrase "science fiction movie" in the user's question, and the long-term user portrait contains the user's past preference records for different movie types, the similarity matrix will show the similarity between the phrase "science fiction movie" and each movie type in the user portrait.

[0180] Step S3423: for each feature prompt data, sort the respective portrait feature data according to the similarity, and select part of the portrait feature data according to the sorting result as the portrait feature data having semantic similarity with the feature prompt data.

[0181] After completing the similarity calculation between the feature prompt data and the long-term user portrait feature data, these similarity scores can be sorted and filtered to accurately retrieve the portrait feature data that is closest to the semantics of the user's question.

[0182] First, for each feature prompt data, the corresponding similarity is sorted in descending order. The purpose of this operation is to quickly identify the portrait feature data that is most similar to the feature prompt data. For example, if the feature prompt data is the keyword "science fiction movie" in the user's question, the system will sort according to the long-term user portrait feature data with the highest similarity to the keyword.

[0183] Next, according to business needs and system design, a similarity threshold can be set to eliminate those portrait feature data with low similarity and insufficient relevance. This threshold is set based on considerations of system performance and user satisfaction to ensure that the returned data is highly relevant.

[0184] In addition, a Top-k screening strategy can be used, that is, only the k items with the highest similarity ranking for each feature prompt data are retained. Here, k is a preset integer representing the number of similar portrait feature data that will be returned for each feature prompt data. For example, if k is set to 3, for each feature prompt data, the system will only retain the three most similar portrait feature data.

[0185] Through sorting and screening, the system finally obtains several portrait feature data with the highest similarity for each feature prompt data. These data will be used as the basis for generating the response text to ensure that the chatbot can provide accurate responses based on the user's personalized needs and historical preferences.

[0186] For example, if the profile feature data in the user's long-term user profile shows that the user has a high interest in science fiction movies, and "science fiction movies" are mentioned in the question, the system will give priority to profile feature data related to science fiction movies to construct an answer that fits the user's interests.

[0187] Through the application of the above-mentioned embodiments, the present application can further achieve significant technical effects, especially in terms of improving the personalization and accuracy of chatbot responses. Through semantic vector matrix and similarity calculation, the system can deeply dig into and understand the semantic content behind the user's questions, and then retrieve highly relevant information from long-term user portraits. The sorting and screening process further ensures that only the portrait feature data that best meets the user's current needs and interests is selected, so that the generated answer text not only responds quickly to user questions, but also better fits the user's personalized needs and historical preferences. This precise personalized service not only improves user satisfaction, but also enhances the coherence and naturalness of the user's interaction with the chatbot, providing users with a high-quality communication experience. In addition, the efficiency of this embodiment is also reflected in the ability to quickly process and respond to large amounts of data, even in the case of a large number of users or a rapidly growing data scale, it can maintain high-performance answer generation, which is of great significance for improving the practicality and scalability of chatbots in practical applications.

[0188] On the basis of any embodiment of the method of the present application, the question text and the retrieved portrait feature data are used to construct a response prompt text, and the human-computer dialogue model is called to generate a corresponding response text according to the response prompt text to reply to the user, including:

[0189] Step S3431, obtaining a response prompt template including a response strategy, inserting the current session including the question text and the retrieved portrait feature data into the response prompt template to obtain a response prompt text;

[0190] A response prompt template is a structured text framework that contains placeholders for inserting specific information. These placeholders can be slots for question text, profile feature data, or other relevant contextual information. The template is designed to ensure that all relevant information can be integrated into the final response in a logical and coherent manner.

[0191] In the specific implementation, the content and structure of the answer prompt template must first be determined according to the chatbot's design and application scenarios. For example, the template may contain fixed phrases or sentences used to express greetings, make suggestions, provide information, or ask for further details. Then, the user's actual question text and the retrieved portrait feature data are filled in according to the structure of the template, replacing the corresponding placeholders, thereby obtaining the answer prompt text.

[0192] The filled answer prompt text will serve as the input of the human-computer dialogue model. The model will infer based on this text that integrates user questions and personalized features to generate an answer that meets user needs and has personalized features.

[0193] In addition, the answer prompt template can be designed to adapt to different types of questions and profile feature data to ensure that the chatbot can flexibly respond to various conversation scenarios. For example, the template can contain multiple different branches to handle different types of user questions, such as information query, opinion expression or emotional communication.

[0194] Step S3432: input the response prompt text into the human-computer dialogue model, and the human-computer dialogue model performs reasoning based on the response strategy, the current conversation and the retrieved portrait feature data, and outputs a response text corresponding to the reasoning result;

[0195] After constructing the answer prompt text, the human-computer dialogue model can be used to generate the answer text. In specific implementation, the answer prompt text received by the human-computer dialogue model has integrated the user's question and related portrait feature data. The model will use its language understanding ability to parse the input text, identify key information, and perform logical reasoning based on this information.

[0196] Human-computer dialogue models are usually based on advanced natural language processing technologies, such as recurrent neural networks (RNNs), long short-term memory networks (LSTMs), or Transformer architectures. These technologies enable the model to capture long-distance dependencies and contextual information in the text, thereby generating more accurate and coherent responses. In one embodiment, a large language model can be directly used as a human-computer dialogue model.

[0197] In the process of generating responses, the model will consider multiple factors, including but not limited to the user's direct question, the interests and preferences in the user profile, and the historical context of the conversation. For example, if the user's question is about movie recommendations, and the profile feature data shows that the user prefers science fiction movies, the model will generate a response recommending science fiction movies based on this information.

[0198] In addition, the human-computer dialogue model may also combine other knowledge bases or databases to provide richer and more detailed responses. For example, if the model needs to recommend a specific movie, it may query the movie database to obtain the latest science fiction movie information and integrate it into the response.

[0199] Generally, the response text generated by the model needs to meet the requirements of naturalness and accuracy, and also meet the personalized needs of users. For example, if the user asks "What science fiction movies are recommended recently?", the model may output: "Based on your interests, I recommend you to watch "Interstellar" and "Blade Runner 2049", both of which are highly rated science fiction works in recent years."

[0200] Step S3433: Process the response text into response data according to a preset data format, and push it to the user to complete the interaction with the user's question event.

[0201] When users interact with chatbots, they may use text or voice. Therefore, converting the response text into corresponding response data and pushing it to the user can achieve more effective communication. To this end, based on the generated response text, the response text can be converted into response data suitable for user interaction. During the conversion process, the text or voice content needs to be encapsulated into a format suitable for sending and receiving.

[0202] For text-based response data, the processing mainly includes text cleaning, formatting, and encapsulation. Text cleaning ensures that the response does not contain invalid or irrelevant information, while formatting ensures that the text can be displayed correctly on different devices and interfaces. Encapsulation can use lightweight data exchange formats such as JSON to integrate text content and its metadata (such as timestamps, user IDs, etc.) to form a structured text data packet.

[0203] For response data in voice form, the conversion process includes text-to-speech (TTS) conversion and voice file generation. The TTS engine converts the response text into colloquial speech and then saves it as an audio file. The generated voice data also needs to be packaged, usually including a link to the audio file and necessary metadata.

[0204] The encapsulated response data will be pushed according to the user's interaction mode. In text interaction mode, the system will send a text data packet; in voice interaction mode, the system will provide a link to the voice data packet, and the terminal device can play the voice reply based on the link.

[0205] Through this meticulous processing and delivery approach, chatbots are able to provide responses in the form that best suits the user’s current needs, whether in text or voice, ensuring that users receive timely and accurate feedback, thereby improving the overall interactive experience.

[0206] After applying this embodiment, the chatbot achieves significant technical effect improvement in the interaction with the user. First, through the combination of the answer prompt template and the human-computer dialogue model, the robot can generate highly personalized and context-related answers, which greatly enhances the user experience. Secondly, the generation of answers is not only fast but also accurate, which meets the user's demand for the immediacy of information acquisition. In addition, by converting the answer text into two data forms, text and voice, the robot can adapt to different user preferences and usage scenarios, and can ensure the effectiveness of information transmission whether it is visual or auditory information acquisition. The implementation of the encapsulation and push mechanism ensures the reliability of data transmission and the smoothness of interaction, so that users can obtain a consistent high-quality interactive experience on any device. Finally, this comprehensive technical solution improves the practicality, flexibility and user satisfaction of the chatbot, and demonstrates its great potential in providing efficient and intelligent services.

[0207] According to another aspect of the present application, a network live chat robot answering method is provided, which can be implemented as a computer program product, embedded in a network live program and installed and run in a terminal device, so that audience users can enter the network live broadcast room and implement the following steps in the live broadcast room, including:

[0208] Step S5100: responding to the mode switching instruction triggered by the anchor user, displaying the corresponding dialogue controls of the chat robot in the live broadcast interface of the anchor user's live broadcast room;

[0209] Step S5200: In response to a touch event acting on the dialogue control, display a dialogue page of the chat robot;

[0210] Step S5300, submitting the question text input by the audience user to the dialogue page to the server, and obtaining the answer text generated by the server based on the question text;

[0211] Step S5400, displaying the response text on the conversation page;

[0212] Among them, when obtaining the response text generated by the server based on the question text, the server executes the steps corresponding to any embodiment of the chat robot response method of the present application.

[0213] According to this embodiment, the online live broadcast chat robot response method aims to improve the interactivity and audience participation of online live broadcasts through technical means. It embeds chat robot technology into the online live broadcast program, allowing the audience to interact with the chat robot in the live broadcast room, thereby obtaining a richer and more convenient viewing experience.

[0214] First, when the anchor wants to enable the chatbot function during a live broadcast, he can do so by triggering a mode switching command. This command triggers the system to display chatbot-related dialogue controls on the live broadcast interface. These controls can include a chat window, input box, or specific icon buttons, which provide viewers with a clear interactive entry point.

[0215] Once the audience clicks or touches these dialogue controls, the terminal device will respond to this operation and then display the chatbot's dialogue page. This page provides a platform for the audience to communicate directly with the chatbot, and the audience can enter their questions or comments on this page.

[0216] The question texts submitted by the audience users will be sent to the server. The chatbot answering system running on the server and applying the chatbot answering method of the present application will receive these texts and generate corresponding answer texts based on the question texts.

[0217] Finally, the answer text generated by the server will be sent back to the live broadcast room and displayed to the audience on the conversation page. In this way, the audience users can see the chatbot's response to their questions in real time during the live broadcast, which increases the interactivity and fun of the live broadcast.

[0218] Overall, this embodiment not only reduces the interactive pressure of the anchor during the live broadcast process through the automated answering system, for example, when the anchor user is busy, the chatbot can be temporarily enabled to interact with the audience user, thereby providing the audience with instant feedback and a more personalized viewing experience. At the same time, this method can also use the capabilities provided by the chatbot answering method to continuously optimize and adjust the answer to the audience user based on the continuous dialogue with the audience user, so as to provide more accurate and efficient services.

[0219] In one embodiment of the network live chat robot answering method of the present application, the server can use the chat records generated by the audience user's dialogue with the anchor user and / or other audience users in the anchor user's live broadcast room, that is, the public screen flow of the live broadcast room, as historical dialogue data to extract the recent user portrait of the audience user, so as to further update its long-term user portrait, and the long-term user portrait and recent user portrait of the audience user can be called corresponding to the unique characteristics of the network live broadcast room. Of course, the chat records that are not related to the audience user in the public screen flow can also be filtered out first to avoid the interference of stray information on the extraction of the image feature data of the audience user. Thus, when the audience user enters a network live broadcast room to use the chat robot, the server can generate a more personalized answer text according to the corresponding long-term user portrait of the network live broadcast room, so that the answer text generated by the chat robot can be associated with both the network live broadcast room and the audience user to generate, thereby making the chat robot in the network live broadcast room more friendly and appealing to the audience user.

[0220] See also Figure 3 According to one aspect of the present application, a chat robot answering device is provided, comprising a recent portrait extraction module 3100, a portrait feature fusion module 3200, a long-term portrait updating module 3300, and a question answering processing module 3400, wherein the recent portrait extraction module 3100 is configured to extract the portrait feature data of the user based on the latest historical conversation data corresponding to the latest conversation generated by the human-machine conversation between the user and the chat robot, so as to form the recent user portrait of the user; the portrait feature fusion module 3200 is configured to call the long-term user portrait corresponding to the previous conversation of the latest conversation from the portrait feature library, fuse the portrait feature data of the long-term user portrait with the recent user portrait, and obtain the latest user portrait of the user; the long-term portrait updating module 3300 is configured to replace the long-term user portrait in the portrait feature library with the latest user portrait, so as to iteratively update the long-term user portrait according to the latest conversation between the user and the chat robot; the question answering processing module 3400 is configured to generate the answer text corresponding to the question text based on the question text submitted by the user and the portrait feature data retrieved from the updated long-term user portrait with reference to the question text.

[0221] Based on any embodiment of the device of the present application, the recent portrait extraction module 3100 includes: a conversation turn monitoring module, which is configured to monitor whether the number of conversation turns in the historical conversation data generated since the previous conversation reaches a preset threshold; a portrait prompt construction module, which is configured to call the portrait feature prompt template when the preset threshold is reached, and use the generated historical conversation data as the historical conversation data of the latest conversation, and insert it into the portrait feature prompt template to obtain a portrait feature prompt text, wherein the portrait feature prompt template includes multiple portrait feature fields for defining the user portrait and an output format specification of the user portrait; a portrait summary extraction module, which is configured to call the portrait feature extraction model to summarize the historical conversation data of the latest conversation according to the portrait feature fields and output format specifications in the portrait feature prompt text to extract the portrait feature data of the user.

[0222] Based on any embodiment of the device of the present application, the portrait feature fusion module 3200 includes: a long-term portrait calling module, which is configured to call the long-term user portrait of the user from the portrait feature library according to the identity identifier of the user, and the long-term user portrait is obtained by sequentially iterating and merging the portrait feature data extracted from all previous sessions of the latest session; a fusion prompt construction module, which is configured to obtain a portrait fusion prompt template, insert the portrait feature data of the recent user portrait and the long-term user portrait into the portrait fusion prompt template, and obtain a portrait fusion prompt text, and the portrait fusion prompt template contains a fusion strategy corresponding to the portrait feature field; a portrait fusion execution module, which is configured to call the portrait feature fusion model according to the fusion strategy in the portrait fusion prompt text, and use the recent user portrait to update the portrait feature data of the long-term user portrait to achieve fusion, and obtain the fused portrait feature data as the latest user portrait of the user.

[0223] On the basis of any embodiment of the device of the present application, the portrait fusion execution module includes any one or more of the following modules: a replacement strategy application module, which is configured to use a feature replacement update strategy in a fusion strategy inherited from the portrait fusion prompt template according to the portrait fusion prompt text, and the portrait feature fusion model replaces the portrait feature data of the corresponding target feature in the long-term user portrait with the portrait feature data of the target feature corresponding to the feature replacement update strategy in the recent user portrait as the corresponding portrait feature data in the latest user portrait; a completion strategy application module, which is configured to use a feature completion update strategy in a fusion strategy inherited from the portrait fusion prompt template in the portrait fusion prompt text, and the portrait feature fusion model completes the portrait feature data of the target feature corresponding to the feature completion update strategy in the recent user portrait to the latest user portrait; a decision strategy application module, which is configured to use a feature decision update strategy in a fusion strategy inherited from the portrait fusion prompt template in the portrait fusion prompt text, and the portrait feature fusion model integrates the portrait feature data of the target feature corresponding to the feature decision update strategy in the recent user portrait and the long-term portrait features according to the feature decision update strategy in the fusion strategy inherited from the portrait fusion prompt template in the portrait fusion prompt text, and uses the portrait feature data in the latest user portrait as the corresponding portrait feature data in the latest user portrait.

[0224] Based on any embodiment of the device of the present application, the question answering processing module 3400 includes: a question feature summary module, which is configured to respond to a user question event and summarize the question text given by the event to extract feature prompt data having a portrait feature field prompt function; a similar feature retrieval module, which is configured to perform a semantic search on the updated long-term user portrait of the user in the portrait feature library based on the feature prompt data, and retrieve portrait feature data that is semantically similar to the feature prompt data; a prompt answer generation module, which is configured to construct an answer prompt text using the question text and the retrieved portrait feature data, and call the human-computer dialogue model to generate a corresponding answer text based on the answer prompt text to reply to the user.

[0225] Based on any embodiment of the device of the present application, the similar feature retrieval module includes: a vector matrix acquisition module, configured to acquire a first semantic vector matrix corresponding to each of the feature prompt data and a second semantic vector matrix corresponding to each of the portrait feature data in the updated long-term user portrait; a data distance operation module, configured to apply a data distance algorithm to calculate a similarity matrix between the first semantic vector matrix and the second semantic vector matrix, wherein the similarity matrix contains the similarity of each of the feature prompt data corresponding to each of the portrait feature data; a similar feature determination module, configured to sort each of the portrait feature data according to the similarity for each of the feature prompt data, and screen out part of the portrait feature data according to the sorting result as the portrait feature data that is semantically similar to the feature prompt data.

[0226] Based on any embodiment of the device of the present application, the question and answer execution module includes: an answer prompt construction module, which is configured to obtain an answer prompt template containing an answer strategy, and insert the current session containing the question text and the retrieved portrait feature data into the answer prompt template to obtain an answer prompt text; an answer text generation module, which is configured to input the answer prompt text into a human-computer dialogue model, and the human-computer dialogue model performs reasoning based on the answer strategy, the current session and the retrieved portrait feature data, and outputs an answer text corresponding to the reasoning result; an answer data push module, which is configured to process the answer text into answer data according to a preset data format, and push it to the user to complete the interaction with the user's question event.

[0227] Another embodiment of the present application also provides a chat robot answering device. Figure 4 As shown, a schematic diagram of the internal structure of a chat robot answering device. The chat robot answering device includes a processor, a computer-readable storage medium, a memory, and a network interface connected via a system bus. The computer-readable non-volatile storage medium of the chat robot answering device stores an operating system, a database, and computer-readable instructions. The database may store an information sequence. When the computer-readable instructions are executed by the processor, the processor may implement a chat robot answering method / network live chat robot answering method.

[0228] The processor of the chat robot answering device is used to provide computing and control capabilities to support the operation of the entire chat robot answering device. The memory of the chat robot answering device may store computer-readable instructions, which, when executed by the processor, may enable the processor to execute the chat robot answering method / network live chat robot answering method of the present application. The network interface of the chat robot answering device is used to connect and communicate with a terminal.

[0229] Those skilled in the art will understand that Figure 4 The structure shown in the figure is only a block diagram of a part of the structure related to the present application scheme, and does not constitute a limitation on the chat robot answering device to which the present application scheme is applied. The specific chat robot answering device may include more or fewer components than shown in the figure, or combine certain components, or have a different arrangement of components.

[0230] In this embodiment, the processor is used to execute Figure 3 The memory stores the program code and various data required to execute the above modules or submodules. The network interface is used to realize data transmission between user terminals or servers. The non-volatile readable storage medium in this embodiment stores the program code and data required to execute all modules in the chat robot answering device of this application, and the server can call the program code and data of the server to execute the functions of all modules.

[0231] The present application also provides a non-volatile readable storage medium storing computer-readable instructions. When the computer-readable instructions are executed by one or more processors, the one or more processors execute the steps of the chat robot answering method / live broadcast chat robot answering method of any embodiment of the present application.

[0232] The present application also provides a computer program product, including a computer program / instruction, which implements the steps of the method described in any embodiment of the present application when executed by one or more processors.

[0233] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments of the present application can be implemented by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, the aforementioned storage medium can be a computer-readable storage medium such as a disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM).

[0234] In summary, this application achieves an in-depth understanding and long-term memory of user portrait features through its user portrait construction and fusion process, thus providing a solid foundation for personalized services. By dynamically updating user portraits using the latest session data, this application not only maintains the timeliness of information, but also enhances the robot's coherence and contextual understanding capabilities in multiple rounds of conversations through an iterative update mechanism. In addition, this application effectively eliminates the interference of redundant information and improves the relevance and accuracy of replies through efficient information processing optimization. The improvement in computing efficiency and the introduction of an intelligent response generation mechanism further ensure the high efficiency and intelligence of the chatbot when providing services, and ultimately achieve a more accurate, smooth and natural communication experience with users. This application has broad application prospects, is applicable to multiple application fields, and has technical universality.

Claims

1. A chat robot answering method, characterized in that: include: Extracting the user's portrait feature data based on the latest historical conversation data corresponding to the latest conversation generated by the human-machine dialogue between the user and the chat robot to form a recent user portrait of the user; The long-term user portrait corresponding to the previous session of the latest session is called from the portrait feature library, and the portrait feature data of the long-term user portrait and the recent user portrait are inserted into the portrait fusion prompt template to obtain the portrait fusion prompt text, and the portrait feature fusion model is called to fuse the portrait feature data according to the fusion strategy in the portrait fusion prompt text to obtain the latest user portrait of the user; Replace the long-term user portrait in the portrait feature library with the latest user portrait, so as to iteratively update the long-term user portrait according to the latest conversation between the user and the chat robot; Based on the question text submitted by the user and the portrait feature data retrieved from the updated long-term user portrait with reference to the question text, generate a response text corresponding to the question text; The calling of the portrait feature fusion model to fuse the portrait feature data according to the fusion strategy in the portrait fusion prompt text includes any one or more of the following: According to the feature replacement update strategy in the fusion strategy inherited by the portrait fusion prompt text from the portrait fusion prompt template, the portrait feature fusion model replaces the portrait feature data of the corresponding target feature in the long-term user portrait with the portrait feature data of the target feature corresponding to the feature replacement update strategy in the recent user portrait as the corresponding portrait feature data in the latest user portrait; According to the feature completion and update strategy in the fusion strategy inherited from the portrait fusion prompt template in the portrait fusion prompt text, the portrait feature fusion model completes the portrait feature data of the target feature corresponding to the feature completion and update strategy in the recent user portrait into the latest user portrait; The portrait feature fusion model integrates the portrait feature data of the target features of the recent user portrait and long-term portrait features corresponding to the feature decision update strategy according to the feature decision update strategy in the fusion strategy inherited from the portrait fusion prompt template in the portrait fusion prompt text, as the corresponding portrait feature data in the latest user portrait.

2. The chat robot answering method according to claim 1, characterized in that: Based on the latest historical conversation data corresponding to the latest conversation generated by the human-machine dialogue between the user and the chat robot, extract the user's portrait feature data to form a recent user portrait of the user, including: Monitoring whether the number of conversation turns in historical conversation data generated since the previous conversation reaches a preset threshold; When the preset threshold is reached, the portrait feature prompt template is called, and the generated historical conversation data is used as the historical conversation data of the latest session, and inserted into the portrait feature prompt template to obtain the portrait feature prompt text, wherein the portrait feature prompt template includes multiple portrait feature fields for defining the user portrait and the output format specification of the user portrait; The portrait feature extraction model is called to summarize the historical conversation data of the latest conversation according to the portrait feature fields and output format specifications in the portrait feature prompt text to extract the portrait feature data of the user.

3. The chat robot answering method according to claim 1, characterized in that: The long-term user portrait corresponding to the previous session of the latest session is called from the portrait feature library, and the portrait feature data of the long-term user portrait is integrated with the recent user portrait to obtain the latest user portrait of the user, including: Retrieving a long-term user portrait of the user from a portrait feature library according to the user's identity identifier, wherein the long-term user portrait is obtained by sequentially iterating and fusing portrait feature data extracted from all previous sessions of the latest session; Obtain a portrait fusion prompt template, insert the portrait feature data of the recent user portrait and the long-term user portrait into the portrait fusion prompt template to obtain a portrait fusion prompt text, wherein the portrait fusion prompt template includes a fusion strategy corresponding to the portrait feature field; The portrait feature fusion model is called according to the fusion strategy in the portrait fusion prompt text, and the portrait feature data of the long-term user portrait is updated by using the recent user portrait to achieve fusion, and the fused portrait feature data is obtained as the latest user portrait of the user.

4. The chat robot answering method according to any one of claims 1 to 3, characterized in that: Based on the question text submitted by the user and the portrait feature data retrieved from the updated long-term user portrait with reference to the question text, a response text corresponding to the question text is generated, including: In response to a user question event, a summary is performed from the question text given in the event to extract feature prompt data that has the function of providing a feature field prompt for the portrait; Based on the feature prompt data, semantic retrieval is performed on the updated long-term user portrait of the user in the portrait feature library to retrieve portrait feature data with similar semantics to the feature prompt data; The question text and the retrieved portrait feature data are used to construct a response prompt text, and the human-computer dialogue model is called to generate a corresponding response text to reply to the user based on the response prompt text.

5. The chat robot answering method according to claim 4, characterized in that: Based on the feature prompt data, semantic retrieval is performed on the updated long-term user portrait of the user in the portrait feature library to retrieve portrait feature data that is semantically similar to the feature prompt data, including: Acquire a first semantic vector matrix corresponding to each of the feature prompt data and a second semantic vector matrix corresponding to each of the portrait feature data in the updated long-term user portrait; Applying a data distance algorithm to calculate a similarity matrix between the first semantic vector matrix and the second semantic vector matrix, the similarity matrix comprising similarities between each of the feature prompt data and each of the portrait feature data; For each feature prompt data, the respective portrait feature data are sorted according to the similarity, and part of the portrait feature data is screened out according to the sorting result as the portrait feature data having semantic similarity with the feature prompt data.

6. The chat robot answering method according to claim 4, characterized in that: The question text and the retrieved portrait feature data are used to construct a response prompt text, and the human-computer dialogue model is called to generate a corresponding response text according to the response prompt text to reply to the user, including: Obtaining a response prompt template including a response strategy, inserting the current session including the question text and the retrieved portrait feature data into the response prompt template to obtain a response prompt text; Inputting the response prompt text into a human-computer dialogue model, the human-computer dialogue model performs reasoning based on the response strategy, the current session and the retrieved portrait feature data, and outputs a response text corresponding to the reasoning result; The response text is processed into response data according to a preset data format and pushed to the user to complete the interaction with the user's question event.

7. A network live chat robot answering method, characterized in that: include: In response to the mode switching command triggered by the anchor user, the corresponding dialogue controls of the chat robot are displayed on the live broadcast interface of the anchor user's live broadcast room; In response to a touch event acting on the dialogue control, displaying a dialogue page of the chat robot; Submitting the question text input by the audience user to the dialogue page to the server, and obtaining the answer text generated by the server based on the question text; Displaying the response text on the conversation page; When obtaining the answer text generated by the server based on the question text, the server performs the following steps: Extracting the user's portrait feature data based on the latest historical conversation data corresponding to the latest conversation generated by the human-machine dialogue between the user and the chat robot to form a recent user portrait of the user; The long-term user portrait corresponding to the previous session of the latest session is called from the portrait feature library, and the portrait feature data of the long-term user portrait and the recent user portrait are inserted into the portrait fusion prompt template to obtain the portrait fusion prompt text, and the portrait feature fusion model is called to fuse the portrait feature data according to the fusion strategy in the portrait fusion prompt text to obtain the latest user portrait of the user; Replace the long-term user portrait in the portrait feature library with the latest user portrait, so as to iteratively update the long-term user portrait according to the latest conversation between the user and the chat robot; Based on the question text submitted by the user and the portrait feature data retrieved from the updated long-term user portrait with reference to the question text, generate a response text corresponding to the question text; The calling of the portrait feature fusion model to fuse the portrait feature data according to the fusion strategy in the portrait fusion prompt text includes any one or more of the following: According to the feature replacement update strategy in the fusion strategy inherited by the portrait fusion prompt text from the portrait fusion prompt template, the portrait feature fusion model replaces the portrait feature data of the corresponding target feature in the long-term user portrait with the portrait feature data of the target feature corresponding to the feature replacement update strategy in the recent user portrait as the corresponding portrait feature data in the latest user portrait; According to the feature completion and update strategy in the fusion strategy inherited from the portrait fusion prompt template in the portrait fusion prompt text, the portrait feature fusion model completes the portrait feature data of the target feature corresponding to the feature completion and update strategy in the recent user portrait into the latest user portrait; The portrait feature fusion model integrates the portrait feature data of the target features of the recent user portrait and long-term portrait features corresponding to the feature decision update strategy according to the feature decision update strategy in the fusion strategy inherited from the portrait fusion prompt template in the portrait fusion prompt text, as the corresponding portrait feature data in the latest user portrait.

8. A chat robot answering device, characterized in that: include: A recent portrait extraction module is configured to extract the user's portrait feature data based on the latest historical conversation data corresponding to the latest conversation generated by the human-machine dialogue between the user and the chat robot to form a recent user portrait of the user; A portrait feature fusion module is configured to call a long-term user portrait corresponding to a previous session of the latest session from a portrait feature library, insert the portrait feature data of the long-term user portrait and the recent user portrait into a portrait fusion prompt template to obtain a portrait fusion prompt text, call a portrait feature fusion model to fuse the portrait feature data according to a fusion strategy in the portrait fusion prompt text, and obtain the latest user portrait of the user; A long-term portrait updating module, configured to replace the long-term user portrait in the portrait feature library with the latest user portrait, so as to iteratively update the long-term user portrait according to the latest conversation between the user and the chat robot; A question answering processing module, configured to generate an answering text corresponding to the question text based on the question text submitted by the user and the portrait feature data retrieved from the updated long-term user portrait with reference to the question text; The image feature fusion module also includes any one or more of the following modules: a replacement strategy application module, configured to implement a feature replacement update strategy in a fusion strategy inherited from the portrait fusion prompt template according to the portrait fusion prompt text, wherein the portrait feature fusion model replaces the portrait feature data of the corresponding target feature in the long-term user portrait with the portrait feature data of the target feature corresponding to the feature replacement update strategy in the recent user portrait as the corresponding portrait feature data in the latest user portrait; A completion strategy application module is configured to complete the image feature data of the target feature corresponding to the feature completion update strategy in the recent user portrait according to the feature completion update strategy in the fusion strategy inherited from the image fusion prompt template in the image fusion prompt text, and the image feature fusion model completes the image feature data of the target feature in the recent user portrait corresponding to the feature completion update strategy into the latest user portrait; The decision strategy application module is set to integrate the portrait feature data of the target features of the recent user portrait and long-term portrait features corresponding to the feature decision update strategy according to the feature decision update strategy in the fusion strategy inherited from the portrait fusion prompt template in the portrait fusion prompt text as the corresponding portrait feature data in the latest user portrait.

9. A chat robot answering device, comprising a central processing unit and a memory, characterized in that: The central processing unit is used to call and run the computer program stored in the memory to execute the steps of the method according to any one of claims 1 to 7.

10. A non-volatile readable storage medium, characterized in that: It stores a computer program implemented according to the method described in any one of claims 1 to 7 in the form of computer-readable instructions, and when the computer program is called and executed by a computer, the steps included in the corresponding method are executed.