A session interaction method and device, electronic equipment and storage medium
By generating and evaluating candidate responses using natural language models, the problem of limited interaction depth among virtual characters in group chats was solved, enabling intelligent interaction between multiple virtual characters and improving the logic of plot development and user experience.
Patent Information
- Application Number
- CN202510327270.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-19
- Publication Date
- 2025-12-26
- Estimated Expiration
- 2045-03-19
AI Technical Summary
Existing technologies have limited depth and low efficiency in content interaction between virtual characters in group chat scenarios, resulting in slow development of virtual storylines.
Candidate responses are generated using a natural language model, and the most suitable response is selected and sent to the target group chat based on multi-dimensional evaluation indicators such as virtual character matching degree, scene matching degree, plot matching degree, virtual character response rate, and liking degree, thus realizing intelligent interaction between multiple virtual characters.
It improves the depth and efficiency of virtual character interaction in group chat scenarios, ensures the logical rationality and emotional consistency of the plot, and provides an immersive group chat experience.
Smart Images

Figure CN120162418B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of natural language model, and particularly relates to a conversation interaction method and device, an electronic device and a storage medium. BACKGROUND
[0002] With the development of artificial intelligence technology, content interaction based on natural language model has more and more wide application in fields such as emotional companionship, psychological counseling and medical question and answer, in which the natural language model plays an important role in the training of virtual roles.
[0003] For content interaction with virtual roles, the existing technology is usually focused on content interaction with a single virtual role. Even in the scenario of establishing a group chat with multiple virtual roles, the existing technology is usually limited to the reply of the conversation by the virtual role specified by the user, and the depth of content interaction is limited, the efficiency is low, and the development of virtual plot is slow. SUMMARY
[0004] The present application provides a conversation interaction method, device, electronic device and storage medium to improve the interaction depth and efficiency of virtual roles in a group chat scenario.
[0005] In a first aspect, an embodiment of the present application provides a conversation interaction method, which comprises:
[0006] If the target group chat detects the interaction content to be replied, a natural language model is called, the natural language model generates at least one candidate reply based on at least the interaction content to be replied, the target group chat includes at least two virtual roles, and the candidate reply matches at least one virtual role in the group chat;
[0007] The natural language model determines the evaluation results of each candidate reply based on at least one reply evaluation index;
[0008] Among them, the reply evaluation index includes at least one of virtual role matching degree, scene matching degree, plot matching degree, virtual role reply rate and virtual role preference;
[0009] According to the evaluation results of each candidate reply, the candidate reply with the highest matching degree with the interaction content to be replied is determined as the target reply from each candidate reply, and the target reply is sent to the target group chat.
[0010] In a second aspect, an embodiment of the present application further provides a conversation interaction device, which comprises:
[0011] a candidate reply generation module configured to, if the target group chat detects the interactive content to be replied, invoke a natural language model, the natural language model being configured to generate at least one candidate reply based on at least the interactive content to be replied, the target group chat including at least two virtual roles, the candidate reply matching at least one virtual role in the group chat;
[0012] a candidate reply evaluation module configured to determine an evaluation result of each candidate reply based on at least one reply evaluation index by the natural language model;
[0013] wherein the reply evaluation index includes at least one of a virtual role matching degree, a scenario matching degree, a plot matching degree, a virtual role reply rate, and a virtual role likeability;
[0014] a target reply determination module configured to determine, according to the evaluation result of each candidate reply, a candidate reply with a highest matching degree to the interactive content to be replied as a target reply from the candidate replies, and send the target reply to the target group chat.
[0015] In a third aspect, an electronic device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, and the processor executes the program to implement the conversation interaction method according to any of the embodiments of the present application.
[0016] In a fourth aspect, a storage medium storing computer executable instructions is provided, and the computer executable instructions are executed by a computer processor to implement the conversation interaction method according to any of the embodiments of the present application.
[0017] The technical solution of the embodiments of the present application, when the target group chat detects the interactive content to be replied, invokes a natural language model, generates at least one candidate reply based on at least the interactive content to be replied, evaluates each candidate reply in at least one reply evaluation index dimension by the natural language model, obtains the evaluation result of each candidate reply, wherein the reply evaluation index includes at least one of a virtual role matching degree, a scenario matching degree, a plot matching degree, a virtual role reply rate, and a virtual role likeability, and selects a target reply from the candidate replies according to the evaluation result of each candidate reply and sends the target reply to the target group chat. The technical solution of the embodiments of the present application solves the problem that the prior art focuses on the content interaction with a single virtual role, and the problem that the depth and efficiency of content interaction are limited, resulting in slow development of virtual plots. The technical solution of the embodiments of the present application can improve the interaction depth and efficiency of virtual roles in a group chat scenario.
[0018] It is to be understood that the details set forth in the description contained herein do not limit the scope of the application. Other embodiments of the application will be readily apparent to those skilled in the art from the description herein. With reference to the drawings, embodiments of the application are herein described. BRIEF DESCRIPTION OF DRAWINGS
[0019] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the embodiments will be briefly introduced as follows. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without any creative effort based on these drawings.
[0020] Figure 1 is a flow chart of a session interaction method provided by an embodiment of the present application;
[0021] Figure 2 is a flow chart of a session interaction method provided by an embodiment of the present application;
[0022] Figure 3 is a structural schematic diagram of a session interaction device provided by an embodiment of the present application;
[0023] Figure 4 is a structural schematic diagram of an electronic device provided by an embodiment of the present application. DETAILED DESCRIPTION
[0024] In order to make the technical personnel in the art better understand the present application, the technical solutions in the embodiments of the present application will be described clearly and completely with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only some of the embodiments of the present application, but not all. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without any creative effort should belong to the scope of protection of the present application.
[0025] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and do not necessarily describe a specific order or sequence. It should be understood that the data thus used can be interchanged under appropriate circumstances, so that the embodiments of the application described herein can be implemented in an order other than that illustrated or described herein. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion, for example, a process, method, system, product or device including a series of steps or units does not necessarily have to be limited to those steps or units clearly listed, but can include other steps or units not clearly listed or inherent to these processes, methods, products or devices. In the embodiments of the present application, some software, components, models and the like in the prior art may be mentioned, which should be considered as exemplary, and the purpose is only to illustrate the feasibility of the technical solutions in the embodiments of the present application, but it does not mean that the applicant has or must use the scheme.
[0026] The acquisition, transmission, storage, use, processing and the like of data in the technical solutions of the present application comply with the relevant provisions of national laws and regulations.
[0027] Embodiment one
[0028] Figure 1 A flowchart of a conversation interaction method is provided for the first embodiment of the present application. The present embodiment can be applied to the case of conversation interaction of multiple virtual characters. The method can be executed by a conversation interaction device, which can be realized in the form of hardware and / or software. The conversation interaction device can be configured in a server or an electronic device, and realizes conversation interaction based on a natural language model.
[0029] As shown in Figure 1 , the method comprises:
[0030] S110, if the target group chat detects the interactive content to be replied, a natural language model is called, and the natural language model generates at least one candidate reply based on at least the interactive content to be replied.
[0031] Among them, the target group chat includes at least two virtual characters, and the candidate reply matches at least one virtual character in the group chat.
[0032] The target group chat can be established in response to a group chat establishment instruction of the user interaction interface, or can be automatically established according to the development of the plot. In addition to the user, the target group chat also includes at least two virtual characters. The virtual character can be created in response to a character creation instruction of the user interaction interface, or can be automatically created according to the development of the plot; at the same time, the virtual character can be a fictional character created by the user or the developer, or a known character in the published work or plot.
[0033] The to-be-replied interactive content is sent by a user through a user interaction interface or by clicking a button. The natural language model is a model based on artificial intelligence technology that can understand, generate, and process natural language (such as English, Chinese, and other languages used by humans).
[0034] Further, the to-be-replied interactive content can include conversation content and / or other content (such as pictures, videos, or emoticons, etc.), and the number of conversation content and / or other content can be one or at least two.
[0035] Specifically, if the time interval between consecutive conversation content and / or other content is less than or equal to a preset time interval (for example, 10s), and the correlation degree between the consecutive conversation content and / or other content is greater than or equal to a preset correlation degree threshold (for example, 90%), the consecutive conversation content and / or other content can be collectively taken as a group of to-be-replied interactive content, and the natural language model generates candidate replies for the group of to-be-replied interactive content. The correlation degree can be determined by the natural language model. For example, the conversation content is “Today the weather is really good!”, the picture is a blue sky with white clouds, and the time interval between the conversation content and the picture is 1s. In this case, the correlation degree between the conversation content and the picture is high, and they can be taken as a group of to-be-replied interactive content.
[0036] If the time interval between consecutive conversation content and / or other content is greater than the preset time interval, and / or the correlation degree between the consecutive conversation content and / or other content is less than the preset correlation degree threshold, the different conversation content and / or other content are taken as to-be-replied interactive content respectively, and the natural language model generates candidate replies respectively.
[0037] The candidate reply is generated by the natural language model for at least one virtual character, simulating the reply of the virtual character to the to-be-replied interactive content. Similarly, the candidate reply can include conversation content and / or other content (such as pictures, videos, or emoticons, etc.), and the number of conversation content and / or other content can be one or at least two. Meanwhile, for the same virtual character, the natural language model generates a candidate reply based on the to-be-replied interactive content, and the number of candidate replies can be one or at least two.
[0038] In this embodiment, when new to-be-replied interactive content is detected in the target group chat, the natural language model generates candidate replies for other virtual characters in the target group chat except the user. In an optional embodiment, if one or at least two virtual characters are specified in the to-be-replied interactive content, the natural language model generates corresponding candidate replies for the specified virtual characters based on the to-be-replied interactive content.
[0039] In another optional embodiment, if the virtual character is not specified in the interaction content to be replied, the natural language model can generate corresponding candidate replies for all virtual characters in the target group chat except the user based on at least the interaction content to be replied.
[0040] In yet another optional embodiment, a preset number of virtual characters can also be selected from the virtual characters according to the relevance between each virtual character and the interaction content to be replied, the user's preference for each virtual character, and the like. The natural language model can generate corresponding candidate replies for the selected virtual characters based on at least the interaction content to be replied. The relevance between the virtual character and the interaction content to be replied can be determined by the natural language model. The user's preference for each virtual character can be determined according to the user's historical evaluation and historical interaction of each virtual character, and the like.
[0041] The technical solution of the embodiment supports the conversation interaction between multiple virtual characters and the user in the group chat scenario. After the user sends the interaction content to be replied in the target group chat, the natural language model can generate candidate replies for one or at least two virtual characters based on at least the interaction content to be replied. This setting can realize complex interaction between the user and multiple virtual characters.
[0042] Further, the natural language model generates at least one candidate reply based on at least the interaction content to be replied, which can include that the natural language model generates at least one candidate reply based on at least the interaction content to be replied and character data. The character data includes at least one of the following: historical interaction content, virtual character setting, and virtual character relationship network.
[0043] The historical interaction content can include the historical interaction content when the user interacts with the virtual character in a single conversation, the historical interaction content when the user interacts with the virtual character in the target group chat, and the historical interaction content when the user interacts with the virtual character in other group chats. The virtual character setting can include, but is not limited to, the character's personality, family background, personal background, and appearance characteristics, and other content used to describe the virtual character. The virtual character relationship network represents the relationship between the virtual character and the user and / or other virtual characters.
[0044] The virtual character setting and the virtual character relationship network can be generated in response to the input content or the click of the button of the user interaction interface when the virtual character is created, and / or the virtual character setting and / or the virtual character relationship network of the virtual character can be directly determined according to the role data of the known character when the virtual character is a published work or a known character in a plot.
[0045] Further, when the virtual role is created in response to the role creation instruction of the user interaction interface, the virtual role character setting and / or the virtual role relationship network of the virtual role can be expanded by the natural language model according to the virtual role name, the determined character setting, and the like. Specifically, the natural language model can search for a known role with high similarity in the published work or plot according to the virtual role name, the determined character setting, and the like; provide the role data of the known role searched to the user interaction interface for display; and supplement the role data of the known role into the role data of the virtual role in response to the selection operation of the user interaction interface on the role data of the known role.
[0046] Further, when the virtual role is a known role in the published work or plot, or has high similarity with the known role, the embodiment simultaneously supports determining the virtual role character setting and / or the virtual role relationship network of the virtual role according to the role data of the known role, and supports the user to input content or click a button on the user interaction interface to generate the virtual role character setting and / or the virtual role relationship network of the virtual role. Therefore, in the above case, the embodiment can determine, by the natural language model, whether the virtual role character setting and / or the virtual role relationship network generated based on the input content or the button click of the user interaction interface matches the virtual role character setting and / or the virtual role relationship network of the known role. If yes, the virtual role character setting and / or the virtual role relationship network of the two different sources are both used as the role data of the virtual role; otherwise, the natural language model can prompt the user through the user interaction interface that the character setting and / or the relationship network does not match.
[0047] The technical solution of the embodiment is that the natural language model generates candidate replies for the virtual role based on the to-be-replied interactive content and the role data of the virtual role. The advantage of this setting is that the generated candidate replies can be consistent with the character setting of the virtual role, the content of the candidate replies can be adjusted in real time according to the to-be-replied interactive content to adapt to the plot development, and the logical coherence and emotional consistency of the plot can be ensured according to the to-be-replied interactive content, the historical interactive content, and the virtual role relationship network.
[0048] S120, the natural language model determines an evaluation result of each candidate reply based on at least one reply evaluation index.
[0049] In the embodiment, a reply evaluation module can be deployed in the natural language model to evaluate each candidate reply based on the reply evaluation module, or a reply evaluation model can be trained based on the natural language model to evaluate each candidate reply based on the reply evaluation model, and the embodiment does not limit this.
[0050] The reply evaluation index is used to evaluate the degree of adaptation between each candidate reply and the interaction content to be replied.
[0051] The virtual character matching degree represents the matching degree between the candidate reply and the virtual character setting. The scene matching degree represents the matching degree between the candidate reply and the current conversation scene. If the target group chat is established in response to a group chat establishment instruction of the user interaction interface, the current conversation scene can be determined in response to the input content of the user interaction interface or the scene selection button. If the target group chat is automatically created according to the plot development, the current conversation scene can be determined according to the known content of the published work. The plot matching degree represents the matching degree between the candidate reply and the plot development of the virtual plot. The higher the plot matching degree, the closer the candidate reply is to the user's preference, and / or the character setting, and / or the ability to promote the plot development. The virtual character reply rate represents the probability that the historical conversation of each virtual character is replied by the user in the historical interaction process of the multiple virtual characters involved in the user and the group chat. The historical interaction process of multiple virtual characters can refer to the historical conversation interaction in other group chats in addition to the target group chat, and / or the historical conversation interaction of the target group chat before the current time. The virtual character popularity represents the degree of user preference or popularity of the virtual character. The virtual character popularity can be determined according to the historical evaluation of the virtual character, the historical interaction situation (for example, the data size of the user's historical conversation with each virtual character can be used to represent), and the historical charging situation matched with the virtual character.
[0052] The evaluation result can be represented by a score (for example, 1-100), a word (for example, unqualified, good, excellent, etc.), or a number of stars or other graphics. Taking the score as an example, the higher the score, the more suitable the candidate reply is to the character setting, the story development and the plot logic, the user's preference, and the reply to the interaction content to be replied.
[0053] Further, taking the score as an example, when the natural language model determines the evaluation result of each candidate reply based on the reply evaluation index, different weights can be set for different reply evaluation indexes, which can be the same or different. For a candidate reply, the index value of each reply evaluation index is determined, and the weighted sum of the index values of each reply evaluation index is obtained as the evaluation result of the candidate reply.
[0054] The technical solution of the embodiment can realize comprehensive, accurate and objective quantitative evaluation of each candidate reply based on the multi-dimensional reply evaluation indexes of the natural language model, facilitate subsequent selection of an optimal reply to the to-be-replied interactive content from the candidate replies, thereby improving the intelligence of the virtual character reply, promoting the authenticity and coherence of the virtual scenario deduction, and providing a more immersive group chat experience.
[0055] It should be noted that if one or at least two virtual characters are specified in the to-be-replied interactive content, the candidate reply generated by the natural language model for the specified virtual character is not subjected to the reply evaluation in the embodiment, and the candidate reply corresponding to the specified virtual character can be directly sent to the target group chat.
[0056] S130, according to the evaluation results of each candidate reply, determining a candidate reply with the highest matching degree to the to-be-replied interactive content as a target reply from the candidate replies, and sending the target reply to the target group chat.
[0057] In the embodiment, taking the case where the evaluation result is represented in the form of a score as an example, the highest matching degree can be the highest score; taking the case where the evaluation result is represented in the form of a word as an example, the highest matching degree can be that the evaluation result is “excellent”; taking the case where the evaluation result is represented in the form of a star rating as an example, the highest matching degree can be represented as “★★★★★”, and similarly, it can also be represented by the number of other symbols, for example
[0058] It should be noted that if the evaluation results of at least two candidate replies are both the highest matching degree to the to-be-replied interactive content, one of the at least two candidate replies can be randomly selected as the target reply; the candidate reply corresponding to the virtual character with the highest virtual character reply rate and / or virtual character preference can be preferentially selected as the target reply; or the at least two candidate replies can all be target replies, and the embodiment does not limit this.
[0059] Taking the case where the evaluation result is represented in the form of a score as an example, in an optional embodiment, according to the evaluation results of each candidate reply, a candidate reply with the highest matching degree to the to-be-replied interactive content can be determined as a target reply from the candidate replies, which can be determined by the natural language model based on each reply evaluation index, and the candidate reply with the highest score of the evaluation result can be directly selected as the target reply.
[0060] In another optional embodiment, according to the evaluation results of each candidate reply, the candidate reply with the highest matching degree to the interactive content to be replied is determined as the target reply in each candidate reply. The evaluation result of each candidate reply can also be determined by the natural language model based on at least one of the virtual character matching degree, the scene matching degree, and the plot matching degree. According to the evaluation results of each candidate reply corresponding to the same virtual character, the candidate reply with the highest score is selected as the candidate reply with the highest matching degree to the virtual character. According to the virtual character reply rate and / or the virtual character preference, the candidate reply with the highest score is selected as the candidate reply with the highest matching degree to the interactive content to be replied in the candidate reply with the highest matching degree to each virtual character, and is taken as the target reply.
[0061] The technical scheme of the embodiment, the natural language model generates candidate replies for each virtual character based on the interactive content to be replied, and realizes comprehensive, objective and accurate evaluation of the candidate replies based on multi-dimensional reply evaluation indexes. Finally, the candidate reply with the highest matching degree to the interactive content to be replied is selected as the target reply and sent to the group chat. The consistency between the virtual character reply and the virtual character setting and the relationship network is ensured, the intelligence of the virtual character reply is improved, and the logical rationality, coherent plot development and emotional consistency of the virtual plot are improved. In the scene of multi-virtual character conversation interaction, an immersive group chat experience is provided.
[0062] Further, after S130, it further includes: if a target reply self-learning condition is met, the natural language model performs self-learning based on the interactive content in the target group chat; wherein the target reply self-learning condition is met, including at least one of the following: detecting a target reply replacement instruction, detecting an input reply matching the interactive content to be replied, and detecting a reply evaluation result matching the target reply.
[0063] The embodiment also provides a scheme of natural language model self-learning based on feedback of a target reply.
[0064] The detection of the target reply replacement instruction means that the target reply replacement instruction is detected in the user interaction interface. The target reply replacement instruction can be used to instruct the large model to regenerate the target reply, or can be used to switch the target reply to other candidate replies. Specifically, after the target reply is sent to the target group chat in the above embodiment, if the target reply replacement instruction is detected in the user interaction interface, a preset number (for example, 2 or 3) of candidate replies with a higher matching degree to the interactive content to be replied are provided to the user interaction interface for display, and in response to the selection operation of the candidate reply by the user interaction interface, the selected candidate reply is sent to the target group chat as a new target reply.
[0065] The detection of the input reply matching the interaction content to be replied to means that the user inputs the reply matching the interaction content to be replied to through the user interaction interface.
[0066] The detection of the reply evaluation result matching the target reply means that the reply evaluation result of the target reply is detected in the user interaction interface, where the reply evaluation result can be expressed in the form of an expression (such as a smiling expression and an angry expression, a like expression and a dislike expression, √ or ×, etc.), a letter (such as Y and N, etc.), and a word, and the like, to evaluate the user's like or dislike of the target reply. The reply evaluation of the target reply of the virtual role can be that the reply evaluation button is sent together every time the target reply is sent to the group chat, and the user can click the reply evaluation button of the user interaction interface to realize the reply evaluation of the target reply. Alternatively, the reply evaluation interface or button of the virtual role reply can be provided through the user interaction interface every preset time interval or when the target group chat interface of the user interaction interface is closed, and the reply evaluation of the virtual role reply is realized according to the feedback of the reply evaluation interface or reply evaluation button in the user interaction interface. It should be noted that the virtual role reply evaluation at this time can take all the replies corresponding to each virtual role in the evaluation period as the evaluation object, or take a specific reply as the evaluation object, which is not limited in this embodiment.
[0067] In this embodiment, when the target reply replacement instruction is detected, or the input reply more matching the interaction content to be replied to is detected, or the reply evaluation result matching the target reply is detected, it indicates that the target reply does not meet the user's expectation. At this time, if there is a new target reply or input reply, the natural language model can be self-learned based on the new target reply or input reply; if there is no new target reply or input reply, the natural language model can also be self-learned based on the reply evaluation result of the target reply. The advantage of such a setting is that the iterative optimization of the natural language model can be realized based on the feedback of the target reply, and the user's preference can be learned constantly to improve the generation effect of the virtual role reply.
[0068] Further, the embodiment further includes: if a virtual role interaction condition is met, the natural language model generates a chat session matching at least two virtual roles based on at least one of the interaction content to be replied to, the historical interaction content, and the scene type, and sends the chat session to the target group chat; where the virtual role interaction condition is met, including: the difference between the current time and the historical time when the interaction content to be replied to is last detected in the target group chat is greater than or equal to a first time interval, or a virtual role interaction instruction is detected.
[0069] The embodiment further provides a virtual role interaction scheme.
[0070] Specifically, if the difference between the current time and the historical time when the last interaction content to be replied to is detected in the target group chat is greater than or equal to the first time interval, that is, a long time has passed since the user last sent the interaction content to be replied to in the group chat, the virtual characters can continue to interact with each other at this time. Or, the user interaction interface detects the interaction instruction between the virtual characters, and the virtual characters can continue to interact with each other.
[0071] Specifically, when the virtual characters interact with each other, the conversation interaction can be continued based on at least one of the interaction content to be replied to, the historical interaction content, and the scene type. The historical interaction content includes historical conversations in the target group chat that match at least one virtual character, that is, historical conversations sent by users in the target group chat and historical conversations in which at least one virtual character replies to the historical conversations sent by the users. The scene type can include a published plot type, a fictional plot type based on a published character role, a new virtual character plot type, and a regular interaction type, etc. The published plot type means that the current scene is consistent with a known plot in a published work. The fictional plot type based on a published character role means that the virtual character follows a known character in a published work, and the current scene is a fictional plot. The new virtual character plot type means that the virtual character is a virtual character created by the user, and the current scene is a fictional plot. The conversation of the regular interaction type means that the current scene is a daily conversation, a discussion of current affairs, etc., and the conversation does not play a role in promoting the plot development or plays a less role in promoting the plot development.
[0072] Based on at least one of the interaction content to be replied to, the historical interaction content, and the scene type, a chat conversation matching at least two virtual characters is generated. Specifically, if the scene type is the published plot type, the known plot in the published work can be followed based on the interaction content to be replied to and the historical interaction content, and the conversation interaction between the virtual characters can be continued. If the scene type is the fictional plot type based on the published character role or the new virtual character plot type, a chat conversation matching at least two virtual characters can be generated based on the interaction content to be replied to, the historical interaction content, and the role data of the virtual character, and the conversation interaction between the virtual characters can be continued. If the scene type is the regular interaction type, regular interaction content matching at least two virtual characters can be generated based on the interaction content to be replied to, the historical interaction content, and the role data of the virtual character, and the conversation interaction between the virtual characters can be realized.
[0073] The technical solution of the embodiment is that when the chat is stagnant, that is, no new interactive content to be replied to is detected in the target group chat for a long time, or the interaction instruction between virtual characters is detected, the conversation interaction between virtual characters is realized based on at least one of the interactive content to be replied to, the historical interactive content, and the scene type. The advantage of this setting is that complex interaction between multiple virtual characters is realized, the conversation interaction between virtual characters can be consistent with the character setting of the virtual character and the logical coherence of the plot development, the interaction depth of the target group chat is enhanced, and a more realistic and natural immersive group chat experience is provided.
[0074] Further, the embodiment further includes: if a virtual character relationship network updating condition is met, updating the relationship network of the virtual character according to at least one historical interactive content in the target group chat; wherein the virtual character relationship network updating condition includes at least one of the following: a difference between the current time and a historical time when the virtual character relationship network was last updated is greater than or equal to a second time interval, the number of new interactive contents in the target group chat after the virtual character relationship network was last updated is greater than or equal to a first threshold, and a relationship network change trigger word is detected.
[0075] The embodiment further provides a technical solution for updating a virtual character relationship network.
[0076] Specifically, the virtual character relationship network can be updated every second time interval (for example, the virtual character relationship network is updated every 5 minutes), so that the virtual character relationship network is updated when the difference between the current time and the historical time when the virtual character relationship network was last updated is greater than or equal to the second time interval. The number of new interactive contents in the target group chat can also be monitored in real time, and if the number of new interactive contents in the current target group chat is greater than or equal to the preset first threshold compared to the last time when the virtual character relationship network was updated, the virtual character relationship network is updated. At this time, the number of new interactive contents or the data amount of new interactive contents can be used for judgment, for example, the virtual character relationship network can be updated every ten new interactive contents, which is not limited in the embodiment. The virtual character relationship network can also be updated when the relationship network change trigger word is detected in the user interaction interface, wherein the relationship network change trigger word can include confession, marriage proposal, quarrel, etc.
[0077] The relationship network of the virtual character is updated according to at least one historical interactive content in the target group chat. Specifically, the keywords in the historical interactive content can be extracted, wherein the keywords are words indicating the relationship between characters, such as brother, teacher, etc. The relationship network is updated according to the extracted keywords and the virtual characters matched with the keywords.
[0078] For example, if the target group chat includes the historical conversation "I went to the park with my brother @ A character name" sent by the user, the keyword "brother" is detected, and the virtual character A is mentioned in the historical conversation, a relationship between the user and the virtual character A can be established.
[0079] Further, when updating the virtual character relationship network, the historical interaction content during the individual conversation interaction with at least one virtual character and the historical interaction content in the target group chat can also be used to update the virtual character relationship network.
[0080] For example, if there is a historical conversation "Yesterday, I went to the park with my brother" sent by the virtual character A in the individual conversation interaction with the virtual character A, and according to the historical interaction content in the target group chat, the virtual character B is the brother of the virtual character A, it can be considered that the virtual character A and the virtual character B went to the park together yesterday, and the virtual character relationship network can be updated.
[0081] Further, if the relationship to be updated is a known relationship in the relationship network, the relationship network is not updated. If the relationship to be updated is not a known relationship, it is further determined whether the relationship to be updated matches the existing relationship network. If it matches, the relationship network is updated, otherwise a relationship confirmation prompt is given through the user interaction interface. For example, if the relationship network knows that the relationship between virtual characters A and C is that A is the parent and C is the child, and if the relationship to be updated is that A and C are brothers, the relationship to be updated does not match the existing relationship network, and a relationship confirmation prompt is needed.
[0082] The technical solution of the embodiment learns the virtual character relationship based on the natural language model and updates the virtual character relationship network. The advantage of this setting is that it can enrich the virtual character relationship network with the user and between virtual characters in a timely manner, thereby providing rich data support for subsequent conversation interaction and improving the intelligence and accuracy of subsequent conversation interaction.
[0083] Further, the embodiment also includes: if the data update condition is met, the historical interaction content in the target group chat is stored in the role data of each virtual character respectively, and the memory of the target group chat is released.
[0084] The advantage of this setting is that it can reduce memory usage, update the role data of the virtual character in a timely manner, and improve the richness of the role data, thereby making the generation of subsequent virtual character replies more intelligent. At the same time, since the historical interaction content is saved in a timely manner, the subsequent virtual character conversation interaction can have a coherent story and plot development, and the virtual character interaction can be more realistic and natural.
[0085] The technical scheme of the embodiment of the present application, when detecting the to-be-replied interactive content in the target group chat, calls a natural language model, generates at least one candidate reply based on at least the to-be-replied interactive content, evaluates each candidate reply in at least one reply evaluation index dimension through the natural language model, obtains the evaluation result of each candidate reply, wherein the reply evaluation index includes at least one of virtual character matching degree, scene matching degree, plot matching degree, virtual character reply rate, and virtual character like degree, and according to the evaluation result of each candidate reply, selects a target reply from each candidate reply and sends it to the target group chat. The technical scheme of the embodiment of the present application solves the problem that the prior art focuses on content interaction with a single virtual character, and the depth of content interaction is limited and the efficiency is low, which leads to slow development of the virtual plot. The technical scheme of the embodiment of the present application can improve the interaction depth and efficiency of virtual characters in a group chat scenario.
[0086] Embodiment two
[0087] Figure 2 The flowchart of the conversation interaction method provided by the second embodiment of the present application is further specified on the basis of the specific process of generating at least one candidate reply by the natural language model based on at least the to-be-replied interactive content.
[0088] As Figure 2 shown, the method comprises:
[0089] S210, if the target group chat detects to-be-replied interactive content, a natural language model is called.
[0090] S220, the natural language model generates at least one candidate reply based on at least the to-be-replied interactive content.
[0091] The embodiment provides different implementation manners of the natural language model generating candidate replies for virtual characters. The above embodiment has specified the manner of the natural language model generating candidate replies based on to-be-replied interactive content and character data, and the embodiment will not be repeated here.
[0092] Further, S220 can further include:
[0093] The natural language model generates at least one candidate reply based on at least the to-be-replied interactive content and historical interactive content; the historical interactive content includes historical conversations in the target group chat that match at least one virtual character.
[0094] The historical conversations in the target group chat that match at least one virtual character can further include historical conversations sent by a user in the target group chat, and historical conversations in which at least one virtual character replies to the historical conversations.
[0095] In this embodiment, the natural language model generates candidate replies for the virtual role based on the to-be-replied interactive content and the historical interactive content in the target group chat. This setting has the advantage that the generated candidate replies can be more consistent with the plot and scene of the target group chat, and promote the coherence of the conversation interaction in the target group chat.
[0096] Further, S220 can further include:
[0097] A1, determine the scene type corresponding to the target group chat, and determine the data retrieval range matched with the scene type;
[0098] The scene type includes at least one of the following: a published plot type, a fictional plot type based on a published character role, a new virtual role plot type, and a regular interaction type.
[0099] A2, the natural language model generates at least one candidate reply based on at least the to-be-replied interactive content and the data retrieval range.
[0100] The natural language model can perform data retrieval in the knowledge graph or knowledge base to assist in generating candidate replies when generating candidate replies for the virtual role, in addition to the to-be-replied interactive content and the knowledge and patterns learned by the natural language model.
[0101] The data retrieval range is the range used to represent the natural language model when performing data retrieval. Different scene types have different data retrieval ranges. In this embodiment, the scene type corresponding to the target group chat is determined, and the data retrieval range matched with the scene type is determined, which can be realized by a scene classification module deployed in the natural language model, or by a scene classification model obtained by pre-training the natural language model.
[0102] Specifically, when the scene type is a published plot type, the data retrieval range can be limited to the known plot of the published work and its related context. At this time, the natural language model generates candidate replies for the virtual role based on the to-be-replied interactive content and the known plot of the published work, to continue to develop the known plot.
[0103] When the scene type is a fictional plot type based on a character role in a published work, the data retrieval range can include all known plots related to the character role in the published work. At this time, the natural language model generates candidate replies for the virtual role based on the to-be-replied interactive content, the known plot of the published work, and the character data of the virtual role, so that the generated candidate replies can be consistent with the character setting of the virtual role and consistent with the development logic of the fictional plot of the published character role.
[0104] When the scenario type is the new virtual character plot type, the virtual character is a fictional character that does not exist in the published work or plot, and the data retrieval range can include similar plots to the currently developed plot. At this time, the developed plot in the current target group chat can be determined, and a similar plot with a high similarity to the developed plot can be determined. The natural language model reasons based on the to-be-responded interactive content, the similar plot, and the role data of the virtual character, and generates a candidate reply for the virtual character, so that the generated candidate reply can conform to the personality setting of the virtual character and meet the development logic of the fictional plot.
[0105] When the scenario type is the regular interaction type, the data retrieval range can be further determined according to the to-be-responded interactive content. For example, if the to-be-responded interactive content includes current affairs, weather, etc., the data retrieval range can include current affairs news, recent weather data of the current location city or a specified city, etc. Otherwise, if the to-be-responded interactive content is a daily conversation, the data retrieval range can not be limited. The natural language model reasons based on the to-be-responded interactive content and the above data retrieval range to generate a candidate reply that meets the personality setting of the virtual character and can provide targeted intelligent feedback to the to-be-responded interactive content.
[0106] The technical solution of the embodiment can determine different data retrieval ranges according to different current scenario types, and reason the candidate reply based on different data retrieval ranges and to-be-responded interactive content. The advantage of such a setting is that it can reduce the data retrieval amount and improve the generation efficiency and accuracy of the candidate reply. At the same time, the generation of the candidate reply is assisted by data retrieval, which can improve the intelligence of the candidate reply, thereby improving the fitting of the personality setting of the virtual character and promoting the logical coherence of the plot development.
[0107] Further, S220 can further include:
[0108] B1, determining an emotion analysis result matched with the to-be-responded interactive content;
[0109] B2, the natural language model generates at least one candidate reply based on at least the to-be-responded interactive content and the emotion analysis result.
[0110] In the embodiment, the emotion analysis result corresponding to the target group chat can be determined by an emotion analysis module deployed in the natural language model, or the emotion analysis function can be realized by pre-training the natural language model using text data labeled with emotion data.
[0111] The emotion analysis result represents the emotion of the user when sending the to-be-responded interactive content, and is used to assist in determining the emotion of the candidate reply. In this embodiment, if the to-be-responded interactive content includes an expression, the text character corresponding to the expression is extracted. Meanwhile, punctuation marks, keywords and the like in the to-be-responded interactive content are extracted, and the emotion analysis result is determined according to at least one of the text character corresponding to the expression, the punctuation marks and the keywords. The emotion analysis result can be represented in the form of an emotional tendency, such as a positive emotional tendency or a negative emotional tendency, or can be represented by an exact emotional judgment result (for example, happy, sad, etc.).
[0112] In this embodiment, the natural language model generates at least one candidate reply based on at least the to-be-responded interactive content and the emotion analysis result. Specifically, the natural language model infers the candidate reply based on the to-be-responded interactive content, the emotion analysis result, and the relationship between the user and the virtual role. Further, whether the candidate reply can include an expression can also be determined according to the historical conversation habits of the user. If so, an expression that matches the candidate reply can be determined according to the emotion analysis result, the relationship between the user and the virtual role, and the content of the candidate reply.
[0113] The technical solution of this embodiment is that the natural language model generates a candidate reply based on the to-be-responded interactive content and the emotion analysis result of the user. This setting has the advantage that the generated candidate reply can be more in line with the current emotion of the user and more intelligent, thereby improving the conversation interaction experience.
[0114] Further, S220 can further include:
[0115] C1, the natural language model generates at least one initial candidate reply based on at least the to-be-responded interactive content;
[0116] C2, determining an auxiliary reply factor according to the initial candidate reply and the role data of the virtual role;
[0117] The auxiliary reply factor includes at least one of the following: an expression, an action, and a psychological activity description.
[0118] C3, fusing each initial candidate reply and its corresponding auxiliary reply factor to generate a target candidate reply matched with the virtual role.
[0119] In this embodiment, determining the auxiliary reply factor can be implemented by an auxiliary reply module deployed in the natural language model, or by an auxiliary reply model obtained by pre-training the natural language model.
[0120] The initial candidate reply refers to the reply content generated by the natural language model for the virtual character based on the to-be-responded interaction content. The initial candidate reply needs to be fused with the auxiliary reply factor subsequently to generate the final target candidate reply of the virtual character.
[0121] The auxiliary reply factor is used to represent the expression, action, and psychological activity description of the virtual character when responding to the to-be-responded interaction content. Each initial candidate reply and its corresponding auxiliary reply factor are fused to generate a target candidate reply matched with the virtual character. Specifically, if the initial candidate reply is in the form of text, the auxiliary reply factor can be displayed in the target candidate reply in the form of brackets, reduced font size, changed font color, etc. For example, the virtual character A is frightened, and the target candidate reply generated by the natural language model can be: (red eyes, carefully said) I'm fine. If the initial candidate reply is in the form of voice, the volume, tone, pause, speed, etc. of the voice can be adjusted based on the auxiliary reply factor to obtain the final target candidate reply. If the initial candidate reply is in the form of video, the expression, action, and posture of the virtual character in the video can be adjusted based on the auxiliary reply factor to obtain the final target candidate reply.
[0122] The technical solution of the embodiment first generates an initial candidate reply based on the to-be-responded interaction content, then determines an auxiliary reply factor based on the initial candidate reply and the role data of the virtual character, and finally fuses the initial candidate reply with the auxiliary reply factor to obtain the final target candidate reply. The advantage of this setting is that it can make the reply of the virtual character more lively and natural, better fit the current group chat scene, and provide a more immersive group chat experience.
[0123] It should be noted that different candidate reply generation methods are provided in the embodiment: the natural language model generates a candidate reply based on the to-be-responded interaction content and historical interaction content; a data retrieval range is determined through the current scene type, and a candidate reply is generated based on different data retrieval ranges and the to-be-responded interaction content; a candidate reply is generated based on the to-be-responded interaction content and the emotional analysis result of the user; an initial candidate reply is generated based on the to-be-responded interaction content, an auxiliary reply factor is determined based on the initial candidate reply and the role data of the virtual character, and finally the initial candidate reply is fused with the auxiliary reply factor to obtain the final target candidate reply. The above-mentioned several candidate reply generation methods can be selected, or at least two of them can be combined to jointly play a role in generating the final candidate reply of the virtual character.
[0124] S230, the natural language model determines the evaluation result of each candidate reply based on at least one reply evaluation index.
[0125] S240, determining, according to the evaluation results of each candidate reply, a candidate reply with the highest matching degree with the to-be-responded interactive content as a target reply from each candidate reply, and sending the target reply to the target group chat.
[0126] The technical scheme of the embodiment generates candidate replies for the virtual role based on the to-be-responded interactive content and the historical interactive content in the target group chat, so that the generated candidate replies are more consistent with the plot and the scene of the target group chat, and the coherence of the conversation interaction in the target group chat is promoted. The candidate replies are generated based on different data retrieval ranges and the to-be-responded interactive content, which can reduce the data retrieval amount, improve the generation efficiency of the candidate replies, and improve the intelligence of the candidate replies, thereby improving the consistency of the virtual role setting and promoting the logical coherence of the plot development. The candidate replies are generated based on the to-be-responded interactive content and the emotional analysis result of the user, so that the generated candidate replies can be more consistent with the current emotion of the user and more intelligent, and the conversation interaction experience is improved. The initial candidate reply is generated based on the to-be-responded interactive content, the auxiliary reply factor is determined based on the initial candidate reply and the role data of the virtual role, and finally the initial candidate reply and the auxiliary reply factor are fused to obtain the final target candidate reply, which can make the reply of the virtual role more vivid and natural, more consistent with the virtual role setting and the current scene of the group chat, and provide a more immersive group chat experience. The candidate replies are evaluated based on the multi-dimensional reply evaluation index, which realizes comprehensive, objective and accurate evaluation of the candidate replies. The candidate reply with the highest matching degree with the to-be-responded interactive content is selected as the target reply, which ensures the consistency between the virtual role reply and the virtual role setting and the relationship network, improves the intelligence of the virtual role reply, and improves the logical rationality, the coherent plot development and the emotional consistency of the virtual plot, thereby providing an immersive group chat experience in the scene of the conversation interaction of multiple virtual roles.
[0127] Embodiment three
[0128] Figure 3 A structural schematic diagram of a conversation interaction device provided by the third embodiment of the present application is shown in FIG. 3. Figure 3 As shown in the figure, the device comprises:
[0129] The candidate reply generation module 310 is configured to, if the target group chat detects the to-be-responded interactive content, invoke a natural language model, the natural language model generates at least one candidate reply based on at least the to-be-responded interactive content, the target group chat comprises at least two virtual roles, and the candidate reply matches at least one virtual role in the group chat.
[0130] The candidate reply evaluation module 320 is configured to determine the evaluation result of each candidate reply based on at least one reply evaluation index by the natural language model.
[0131] The reply evaluation indexes include at least one of virtual character matching degree, scene matching degree, plot matching degree, virtual character reply rate, and virtual character like degree.
[0132] The target reply determination module 330 is configured to determine, according to the evaluation results of the candidate replies, a candidate reply with the highest matching degree with the to-be-responded interactive content as a target reply from the candidate replies, and send the target reply to the target group chat.
[0133] The technical solution of the embodiment of the present application can improve the interaction depth and efficiency of virtual characters in a group chat scenario.
[0134] In the above embodiment, the candidate reply generation module 310 can include:
[0135] The first candidate reply generation unit is configured to generate at least one candidate reply based on the natural language model and at least the to-be-responded interactive content and the historical interactive content.
[0136] The historical interactive content includes historical conversations in the group chat that match at least one virtual character.
[0137] In the above embodiment, the candidate reply generation module 310 can include:
[0138] The data retrieval range determination unit is configured to determine a scene type corresponding to the target group chat, and determine a data retrieval range matching the scene type.
[0139] The scene type includes at least one of the following: a published plot type, a fictional plot type based on a published work character, a new virtual character plot type, and a regular interaction type.
[0140] The second candidate reply generation unit is configured to generate at least one candidate reply based on the natural language model and at least the to-be-responded interactive content and the data retrieval range.
[0141] On the basis of the above-mentioned embodiments, the candidate reply generation module 310 comprises:
[0142] The emotion analysis result determination unit is configured to determine an emotion analysis result matched with the to-be-responded-to interactive content.
[0143] The third candidate reply generation unit is configured to generate at least one candidate reply based on the to-be-responded-to interactive content and the emotion analysis result by using the natural language model.
[0144] On the basis of the above-mentioned embodiments, the candidate reply generation module 310 comprises:
[0145] The initial candidate reply generation unit is configured to generate at least one initial candidate reply based on the to-be-responded-to interactive content by using the natural language model.
[0146] The auxiliary reply factor determination unit is configured to determine an auxiliary reply factor based on the initial candidate reply and the role data of the virtual role.
[0147] The auxiliary reply factor comprises at least one of an expression, a motion, and a psychological activity description.
[0148] The target candidate reply generation unit is configured to fuse each initial candidate reply and its corresponding auxiliary reply factor to generate a target candidate reply matched with the virtual role.
[0149] On the basis of the above-mentioned embodiments, the device further comprises:
[0150] The natural language model self-learning module is configured to perform self-learning on the natural language model based on the interactive content in the target group chat if a target reply self-learning condition is met.
[0151] The target reply self-learning condition comprises at least one of the following: detecting a target reply replacement instruction, detecting an input reply matched with the to-be-responded-to interactive content, and detecting a reply evaluation result matched with the target reply.
[0152] On the basis of the above-mentioned embodiments, the device further comprises:
[0153] The virtual role interaction module is configured to generate a chat session matched with at least two virtual roles based on at least one of the to-be-responded-to interactive content, the historical interactive content, and the scene type by using the natural language model if a virtual role interaction condition is met, and send the chat session to the target group chat.
[0154] The condition of meeting the interaction between virtual roles includes that a difference between a current time and a historical time when the last interaction content to be replied is detected in the target group chat is greater than or equal to a first time interval, or a trigger instruction of interaction between virtual roles is detected.
[0155] On the basis of the above-mentioned embodiments, optionally, the device further comprises:
[0156] The virtual role relationship network updating module is configured to update the relationship network of the virtual role according to at least one historical interaction content in the target group chat if a virtual role relationship network updating condition is met.
[0157] The virtual role relationship network updating condition includes at least one of the following: a difference between a current time and a historical time when the last virtual role relationship network updating is performed is greater than or equal to a second time interval, new interaction content in the target group chat is greater than or equal to a first threshold after the last virtual role relationship network updating, and a relationship network change trigger word is detected.
[0158] On the basis of the above-mentioned embodiments, optionally, the candidate reply generation module 310 comprises:
[0159] The fourth candidate reply generation unit is configured to generate at least one candidate reply based on at least the interaction content to be replied and the role data by using the natural language model.
[0160] The role data includes at least one of the following: historical interaction content, virtual role character setting, and virtual role relationship network.
[0161] The conversation interaction device provided in the embodiments of the present application can execute the conversation interaction method provided in any of the embodiments of the present application, and has the corresponding function modules and beneficial effects of the execution method.
[0162] Embodiment four
[0163] Figure 4 A structural schematic diagram of an electronic device 10 that can be used to implement embodiments of the present application is shown. The electronic device is intended to represent various forms of digital computers, such as laptops, desktops, tablets, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device can also represent various forms of mobile devices, such as personal digital processors, cellular telephones, smart phones, wearable devices (such as headsets, glasses, watches, etc.), and other similar computing devices. The components shown here, their connections, and their functions, as described above, are meant to be examples only, and are not intended to limit the implementations of the present application described and / or claimed in this document.
[0164] As Figure 4As shown, the electronic device 10 includes at least one processor 11, and a memory, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., connected to the at least one processor 11 in communication. The memory stores a computer program executable by the at least one processor 11, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or loaded into the random access memory (RAM) 13 from the storage unit 18. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0165] Various components in the electronic device 10 are connected to the I / O interface 15, including an input unit 16, such as a keyboard, a mouse, etc., an output unit 17, such as various types of displays, a speaker, etc., a storage unit 18, such as a magnetic disk, an optical disk, etc., and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network, such as the Internet, and / or various telecommunication networks.
[0166] The processor 11 can be various general and / or special-purpose processing components having processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 performs various methods and processes described above, such as the session interaction method.
[0167] In some embodiments, the session interaction method can be implemented as a computer program tangibly embodied in a computer readable storage medium, such as the storage unit 18. In some embodiments, part or all of the computer program can be loaded and / or installed onto the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded onto the RAM 13 and executed by the processor 11, one or more steps of the session interaction method described above can be performed. Alternatively, in other embodiments, the processor 11 can be configured to perform the session interaction method by any other appropriate means, such as by means of firmware.
[0168] The various embodiments of the systems and techniques described above can be implemented in digital electronic circuitry, integrated circuitry, a field programmable gate array (FPGA), an application specific integrated circuit (ASIC), a system on a chip (SOC), a load programmable logic device (CPLD), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include implementation in one or more computer programs that are executable and / or interpretable on a programmable system including at least one programmable processor, which can be special or general purpose, coupled to receive data and instructions from, and to transmit data and instructions to, a storage system, at least one input device, and at least one output device.
[0169] Computer programs used to implement the processes of the application can be written in any combination of one or more programming languages. These computer programs can be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the computer program, when executed, can cause instructions defined in the flow charts and / or block diagrams to be implemented on the computer or other programmable apparatus. The computer programs can be executed entirely on a machine, partially on a machine, partially on a machine as a stand-alone software package, partially on a machine and partially on a remote machine or entirely on a remote machine or server.
[0170] In the context of the present application, a computer-readable storage medium can be a tangible medium that can contain or store computer programs for use by or in connection with an instruction execution system, apparatus, or device. Computer-readable storage media can include, but are not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium can be a machine-readable signal medium. More specific examples of the machine-readable storage medium will include one or more lines of electrical connections, portable computer disks, hard disk drives, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or Flash memory), optical fibers, portable compact disc read-only memories (CD-ROMs), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0171] To provide for interaction with a user, the systems and techniques described here can be implemented on an electronic device having a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user and a keyboard and a pointing device (e.g., a mouse or a trackball) by which the user can provide input to the electronic device. Other kinds of devices can be used to provide for interaction with a user as well; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form, including acoustic, speech, or tactile input.
[0172] The systems and techniques described here can be implemented in a computing system that includes a back end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front end component (e.g., a user computer having a graphical user interface or a Web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back end, middleware, or front end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.
[0173] The computing system can include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. A server can be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system, to solve the defects of large management difficulty and weak business scalability in traditional physical host and VPS service.
[0174] It should be understood that the various forms of flow shown above can be re-ordered, added to, or deleted from without departing from the scope of the present disclosure. For example, the steps recited in the present disclosure can be executed in parallel, executed in sequence, or executed in a different order, as long as the desired results of the present disclosure are achieved, and the present disclosure is not limited herein.
[0175] The specific embodiments described above are not intended to be limiting, and persons skilled in the art will appreciate that various modifications, combinations, sub-combinations and alternatives can be made to the specific embodiments without departing from the spirit and principles of the disclosure. Accordingly, the disclosure is not limited to the specific embodiments described above, but only by the scope of the appended claims.
Claims
1. A method of conversational interaction, characterized by, The method comprises the following steps: if the target group chat detects the interaction content to be replied, a natural language model is called, the natural language model generates at least one candidate reply based on at least the interaction content to be replied, the target group chat comprises at least two virtual roles, and the candidate reply matches at least one virtual role in the group chat; the natural language model determines an evaluation result of each candidate reply based on at least one reply evaluation index; wherein the reply evaluation index comprises at least one of virtual role matching degree, scene matching degree, plot matching degree, virtual role reply rate and virtual role preference degree; the determination of the evaluation result of each candidate reply comprises: according to the evaluation result of each candidate reply, the natural language model determines the evaluation result of each candidate reply based on at least one of the virtual role matching degree, the scene matching degree and the plot matching degree, and according to the evaluation result of each candidate reply corresponding to the same virtual role, the candidate reply with the highest score is selected as the candidate reply with the highest virtual role matching degree; then, according to the virtual role reply rate and / or the virtual role preference degree, the candidate reply with the highest score is selected from the candidate replies with the highest virtual role matching degree as the candidate reply with the highest matching degree to the interaction content to be replied, which is taken as the target reply, and the target reply is sent to the target group chat; wherein the method further comprises: if the virtual role interaction condition is met, the natural language model generates a chat session matching at least two virtual roles based on at least one of the interaction content to be replied, historical interaction content and scene type, and sends the chat session to the target group chat; when the scene type is a published plot type, the chat session is generated based on the interaction content to be replied and the historical interaction content, and a known plot in the published work is followed; when the scene type is a fictitious plot type based on a role in a published work or a new virtual role plot type, the chat session is generated based on the interaction content to be replied, the historical interaction content and the role data of the virtual role; when the scene type is a regular interaction, the chat session is generated based on the interaction content to be replied, the historical interaction content and the role data of the virtual role; wherein the virtual role interaction condition is met, including that the difference between the current time and the historical time when the interaction content to be replied is last detected in the target group chat is greater than or equal to a first time interval.
2. The method of claim 1, wherein, The natural language model generates at least one candidate reply based on at least the interaction content to be replied, comprising: the natural language model generates at least one candidate reply based on at least the interaction content to be replied and the historical interaction content; the historical interaction content comprises historical conversations matching at least one virtual role in the target group chat.
3. The method of claim 1, wherein, The natural language model generates at least one candidate reply based on at least the interaction content to be replied, further comprising: determining the scene type corresponding to the target group chat and determining the data retrieval range matching the scene type; wherein the scene type comprises at least one of the following: a published plot type, a fictitious plot type based on a role in a published work, a new virtual role plot type and a regular interaction type; The natural language model generates at least one candidate reply based on at least the interaction content to be replied and the data retrieval range.
4. The method of claim 1, wherein, The natural language model generates at least one candidate reply based on at least the interaction content to be replied, and further includes: determining a sentiment analysis result matched with the interaction content to be replied; The natural language model generates at least one candidate reply based on at least the interaction content to be replied and the sentiment analysis result.
5. The method of claim 1, wherein, The natural language model generates at least one candidate reply based on at least the interaction content to be replied, including: The natural language model generates at least one initial candidate reply based on at least the interaction content to be replied; determining an auxiliary reply factor according to the initial candidate reply and the role data of the virtual role; The auxiliary reply factor includes at least one of the following: an expression, a motion, and a psychological activity description; fusing each initial candidate reply and its corresponding auxiliary reply factor to generate a target candidate reply matched with the virtual role.
6. The method of claim 1, wherein, After sending the target reply to the target group chat, further including: If a target reply self-learning condition is met, the natural language model performs self-learning based on the interaction content in the target group chat; If a target reply self-learning condition is met, the natural language model performs self-learning based on the interaction content in the target group chat; 7. The method of claim 1, wherein, When a virtual role interaction triggering instruction is detected, the natural language model can also generate a chat session matched with at least two virtual roles based on at least one of the following: the interaction content to be replied, historical interaction content, and a scene type, and send the chat session to the target group chat.
8. The method of claim 1, wherein, The method further includes: If a virtual role relationship network updating condition is met, updating the relationship network of the virtual role according to at least one historical interaction content in the target group chat; If a virtual role relationship network updating condition is met, updating the relationship network of the virtual role according to at least one historical interaction content in the target group chat; 9. The method according to any one of claims 1 to 8, characterized in that, The natural language model generates at least one candidate reply based on at least the interaction content to be replied, and further includes: The natural language model generates at least one candidate reply based on at least the interaction content to be replied and the role data; The role data includes at least one of the following: historical interaction content, virtual role character setting, and virtual role relationship network.
10. A conversation reply apparatus characterized by comprising: including: A candidate reply generation module is configured to call a natural language model if the target group chat detects interaction content to be replied, the natural language model generates at least one candidate reply based on at least the interaction content to be replied, the target group chat includes at least two virtual roles, and the candidate reply is matched with at least one virtual role in the group chat; The candidate reply evaluation module is configured to determine an evaluation result of each candidate reply based on at least one reply evaluation index by the natural language model. The reply evaluation index includes at least one of a virtual character matching degree, a scene matching degree, a plot matching degree, a virtual character reply rate, and a virtual character like degree. The target reply determination module is configured to determine the evaluation result of each candidate reply based on at least one of the virtual character matching degree, the scene matching degree, and the plot matching degree by the natural language model according to the evaluation result of each candidate reply, and select the candidate reply with the highest score as the candidate reply with the highest virtual character matching degree according to the evaluation result of each candidate reply corresponding to the same virtual character. Then, the candidate reply with the highest score is selected as the candidate reply with the highest matching degree for the interaction content to be replied to according to the virtual character reply rate and / or the virtual character like degree, and the candidate reply is taken as the target reply. The target reply is sent to the target group chat. The device further includes an interaction between virtual characters module. The interaction between virtual characters module is configured to, if an interaction between virtual characters condition is met, generate a chat session matching at least two virtual characters based on at least one of the interaction content to be replied to, historical interaction content, and a scene type by the natural language model, and send the chat session to the target group chat. When the scene type is a published plot type, the chat session is generated based on the interaction content to be replied to and the historical interaction content, and a known plot in a published work is followed. When the scene type is a fictional plot type based on a role in a published work or a new virtual character plot type, the chat session is generated based on the interaction content to be replied to, the historical interaction content, and role data of the virtual character. When the scene type is a regular interaction, the chat session is generated based on the interaction content to be replied to, the historical interaction content, and the role data of the virtual character. The interaction between virtual characters condition is met, including that a difference between a current time and a historical time when the interaction content to be replied to is last detected in the target group chat is greater than or equal to a first time interval.
Citation Information
Patent Citations
Content interaction method and device and computer readable storage medium
CN117560337A
Page interaction method and device, equipment and storage medium
CN117707370A
Virtual character generation method and device
CN119597877A