Dialogue method and apparatus, device and medium
By analyzing historical dialogue data between users and virtual characters, the intimacy and relationship levels are determined, solving the problem of simulating relationship development in long-term dialogues and improving the accuracy of dialogue generation models and user experience.
Patent Information
- Application Number
- CN202211213930.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-30
- Publication Date
- 2025-12-09
- Estimated Expiration
- 2042-09-30
AI Technical Summary
Existing technologies cannot effectively simulate the progressive development of the relationship between users and virtual characters during long-term dialogues, resulting in poor accuracy of dialogue generation models and poor user experience.
By analyzing historical dialogue data between users and virtual characters, the intimacy and relationship level are determined. Based on semantic analysis and relationship level, response information is generated to improve the accuracy of response information.
It improves the realism and user experience of dialogues between virtual characters and users, can more accurately simulate interpersonal dialogues, and enhances the long-term dialogue capability of dialogue generation models.
Smart Images

Figure CN115577081B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present disclosure relates to the technical field of artificial intelligence, in particular to the technical field of natural language processing, and more particularly to a dialogue method and device, an electronic device, a computer readable storage medium and a computer program product. BACKGROUND
[0002] Artificial intelligence is a discipline that studies enabling computers to simulate some thinking processes and intelligent behaviors (such as learning, reasoning, thinking, planning, etc.) of humans, which includes both hardware and software technologies. Artificial intelligence hardware technologies generally include technologies such as sensors, special artificial intelligence chips, cloud computing, distributed storage, big data processing, etc.; artificial intelligence software technologies mainly include computer vision technology, speech recognition technology, natural language processing technology, and machine learning / deep learning, big data processing technology, knowledge graph technology, etc.
[0003] With the development of computer technology, the application of human-computer dialogue is becoming more and more widespread, especially dialogue based on virtual roles and users to simulate real interpersonal dialogue.
[0004] The methods described in this section do not necessarily have to be previously conceived or employed. Unless otherwise indicated, nothing in this section should be assumed to be prior art merely because it is included in this section. Similarly, any problems mentioned in this section should not be assumed to have been recognized in the art. SUMMARY
[0005] The present disclosure provides a dialogue method and device based on a virtual role, an electronic device, a computer readable storage medium and a computer program product.
[0006] According to an aspect of the present disclosure, a dialogue method based on a virtual role is provided, comprising: obtaining historical dialogue data of a user and a virtual role; determining a closeness of historical dialogue content of the user and the virtual role based on the historical dialogue data; determining a relationship level of the user and the virtual role based on the closeness; and in response to receiving first dialogue information sent by the user to the virtual role, determining first reply information for sending to the user based on the relationship level and the first dialogue information.
[0007] According to another aspect of the disclosure, there is provided a virtual character-based conversation device, comprising: an acquisition unit configured to acquire historical conversation data of a user with a virtual character; a first determination unit configured to determine a closeness of historical conversation content of the user with the virtual character based on the historical conversation data; a second determination unit configured to determine a relationship level of the user with the virtual character based on the closeness; and a third determination unit configured to, in response to receiving first conversation information sent by the user to the virtual character, determine first reply information for sending to the user based on the relationship level and the first conversation information.
[0008] According to another aspect of the disclosure, there is provided an electronic device, comprising: at least one processor; and a memory communicatively connected with the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the conversation method.
[0009] According to another aspect of the disclosure, there is provided a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to cause the computer to perform the conversation method.
[0010] According to another aspect of the disclosure, there is provided a computer program product comprising a computer program, wherein the computer program, when executed by a processor, can implement the conversation method.
[0011] According to one or more embodiments of the disclosure, conversation content for sending to a user can be more accurately generated.
[0012] It should be understood that the contents described in this section are not intended to identify key or important features of the embodiments of the disclosure, nor are they used to limit the scope of the disclosure. Other features of the disclosure will become apparent through the following description. BRIEF DESCRIPTION OF DRAWINGS
[0013] The accompanying drawings illustrate exemplary embodiments and constitute a part of the specification. Together with the written description, the drawings serve to explain exemplary implementations of the embodiments. The illustrated embodiments are merely examples for illustrative purposes and do not limit the scope of the claims. In all the drawings, the same reference numbers refer to similar but not necessarily identical elements.
[0014] Figure 1 A schematic diagram of an exemplary system in which the various methods described herein can be implemented according to exemplary embodiments of the disclosure is shown;
[0015] Figure 2 A flowchart of a conversation method according to exemplary embodiments of the disclosure is shown;
[0016] Figure 3 A flowchart of a dialogue method according to an example embodiment of the present disclosure is shown;
[0017] Figure 4 A schematic diagram of a dialogue process according to an example embodiment of the present disclosure is shown;
[0018] Figure 5 A structural block diagram of a dialogue device according to an example embodiment of the present disclosure is shown;
[0019] Figure 6 A structural block diagram of an example electronic device that can be used to implement embodiments of the present disclosure is shown. DETAILED DESCRIPTION
[0020] Exemplary embodiments of the present disclosure are described below with reference to the accompanying drawings, which include various details of the embodiments of the present disclosure to assist in understanding them. These should be considered in their context only. Thus, those of ordinary skill in the art will recognize the various changes and modifications of the embodiments described herein, without departing from the scope of the present disclosure. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
[0021] In the present disclosure, the terms "first", "second", and the like are used to describe various elements only and are not intended to limit the positional relationship, the time relationship, or the importance relationship of the elements, and such terms are only used to distinguish one element from another. In some examples, the first element and the second element can refer to the same instance of the element, and in some cases, based on the context of the description, they can also refer to different instances.
[0022] The terms used in the description of various described examples in the present disclosure are only for the purpose of describing specific examples and are not intended to be limiting. Unless the number of elements is specifically limited, the element can be one or more, if the number of elements is not specifically limited. In addition, the term "and / or" used in the present disclosure encompasses any one of the listed items and all possible combinations thereof.
[0023] In the related art, a large amount of corpus is usually used to train a deep learning model to obtain a dialogue generation model capable of generating reply content based on the dialogue content sent by a user or capable of generating dialogue content for active sending to the user. However, the dialogue generation method based on the deep learning model can only realize content understanding and generation for short dialogue scenarios, and when a user has a long dialogue with a virtual role, the progressive development of the relationship between the two parties in the long dialogue process cannot be considered, the simulation effect of real interpersonal dialogue is poor, and the user experience is affected.
[0024] Based on this, the disclosure provides a dialogue method based on a virtual role, determines the intimacy of historical dialogue content according to historical dialogue data of a user and a virtual role, and further determines the relationship level of the user and the virtual role, so that the reply information can be determined on the basis of semantic analysis combined with the relationship level between the two, and the accuracy of the reply information is improved.
[0025] Embodiments of the disclosure will be described in detail below with reference to the accompanying drawings.
[0026] Figure 1 A schematic diagram of an example system 100 in which various methods and apparatus described herein can be implemented in accordance with embodiments of the disclosure is shown. With reference to Figure 1 The system 100 includes one or more client devices 101, 102, 103, 104, 105, and 106, a server 120, and one or more communication networks 110 that couple the one or more client devices to the server 120. The client devices 101, 102, 103, 104, 105, and 106 can be configured to execute one or more application programs.
[0027] In embodiments of the disclosure, the server 120 can run one or more services or software applications that enable the performance of dialogue methods.
[0028] In certain embodiments, the server 120 can also provide other services or software applications that can include non-virtual environments and virtual environments. In certain embodiments, these services can be provided as web-based services or cloud services, for example, to users of the client devices 101, 102, 103, 104, 105, and / or 106 under a software as a service (SaaS) model.
[0029] In Figure 1 In the configuration shown, the server 120 can include one or more components that implement the functionality performed by the server 120. These components can include software components, hardware components, or a combination thereof, executable by one or more processors. Users operating the client devices 101, 102, 103, 104, 105, and / or 106 can in turn utilize one or more client application programs to interact with the server 120 to utilize the services provided by these components. It should be understood that various different system configurations are possible, which can differ from the system 100. Thus, Figure 1 The system 100 is one example of a system for implementing the various methods described herein, and is not intended to be limiting.
[0030] A user can use the client devices 101, 102, 103, 104, 105, and / or 106 to send conversational information. The client devices can provide an interface that enables a user of the client device to interact with the client device. The client devices can also output information to the user via the interface. Although Figure 1 Only six client devices are depicted, but those skilled in the art will appreciate that the present disclosure can support any number of client devices.
[0031] The client devices 101, 102, 103, 104, 105, and / or 106 can include various types of computer devices, such as portable handheld devices, general purpose computers (such as personal computers and laptop computers), workstation computers, wearable devices, smart screen devices, self-service kiosk devices, service robots, gaming systems, thin clients, various messaging devices, sensors or other sensing devices, and the like. These computer devices can run various types and versions of software applications and operating systems, such as MICROSOFT Windows, APPLE iOS, UNIX-like operating systems, Linux or Linux-like operating systems (such as GOOGLE Chrome OS); or include various mobile operating systems, such as MICROSOFT Windows Mobile OS, iOS, Windows Phone, Android. Portable handheld devices can include cellular telephones, smartphones, tablet computers, personal digital assistants (PDAs), and the like. Wearable devices can include head-mounted displays (such as smart glasses) and other devices. Gaming systems can include various handheld gaming devices, Internet-enabled gaming devices, and the like. The client devices are capable of executing various different applications, such as various Internet-related applications, communication applications (such as email applications), short message service (SMS) applications, and can use various communication protocols.
[0032] The networks 110 can be any type of networks known to those skilled in the art that can support data communications using any of a plurality of available protocols, including without limitation TCP / IP, SNA, IPX, etc. As examples only, one or more of the networks 110 can be a local area network (LAN), an Ethernet-based network, a token ring, a wide area network (WAN), the Internet, a virtual network, a virtual private network (VPN), an intranet, an extranet, a blockchain network, a public switched telephone network (PSTN), an infrared network, a wireless network (e.g., Bluetooth, WIFI), and / or any combination of these and / or other networks.
[0033] The server 120 can include one or more general purpose computers, special purpose server computers (e.g., PC (personal computer) servers, UNIX servers, mid-range servers), blade servers, mainframe computers, server clusters, or any other appropriate arrangement and / or combination. The server 120 can include one or more virtual machines running virtual operating systems, or other computing architectures involving virtualization (e.g., one or more flexible pools of logical storage devices that can be virtualized to maintain virtual storage devices for the servers). In various embodiments, the server 120 can run one or more services or software applications that provide the functionality described below.
[0034] The computing units in the server 120 can run one or more operating systems including any of the operating systems described above, as well as any commercially available server operating systems. The server 120 can also run any of a variety of additional server applications and / or mid-tier applications, including HTTP servers, FTP servers, CGI servers, JAVA servers, database servers, etc.
[0035] In some embodiments, the server 120 can include one or more applications to analyze and consolidate data feeds and / or event updates from users of the client devices 101, 102, 103, 104, 105, and 106. The server 120 can also include one or more applications to display the data feeds and / or real-time events via one or more display devices of the client devices 101, 102, 103, 104, 105, and 106.
[0036] In some embodiments, the server 120 can be a server of a distributed system, or a server combined with a blockchain. The server 120 can also be a cloud server, or an intelligent cloud computing server or intelligent cloud host with artificial intelligence technology. The cloud server 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 virtual private server (VPS, Virtual Private Server) services.
[0037] The system 100 can also include one or more databases 130. In certain embodiments, these databases can be used to store data and other information. For example, one or more of the databases 130 can be used to store information such as audio files and video files. The databases 130 can reside in various locations. For example, databases used by the server 120 can be local to the server 120 or can be remote from the server 120 and can communicate with the server 120 via a network- based or dedicated connection. The databases 130 can be of different types. In certain embodiments, databases used by the server 120 can be, for example, relational databases. One or more of these databases can store, update, and retrieve data to and from the databases in response to commands.
[0038] In certain embodiments, one or more of the databases 130 can also be used by applications to store application data. Databases used by applications can be databases of different types, such as key-value stores, object stores, or regular stores supported by file systems.
[0039] Figure 1 The system 100 can be configured and operated in various ways to enable the application of various methods and apparatuses described in accordance with the present disclosure.
[0040] Figure 2 A flowchart of a conversation method 200 according to an example embodiment of the present disclosure is shown. As shown, the method 200 includes: Figure 2
[0041] Step S210, obtaining historical conversation data of a user and a virtual role;
[0042] Step S220, determining an intimacy of historical conversation content of the user and the virtual role based on the historical conversation data;
[0043] Step S230, determining a relationship level of the user and the virtual role based on the intimacy; and
[0044] Step S240, in response to receiving first conversation information sent by the user to the virtual role, determining first reply information for sending to the user based on the relationship level and the first conversation information.
[0045] By analyzing the historical dialogue data between the user and the virtual role, the intimacy of the historical dialogue content is determined, and the relationship level between the user and the virtual role is determined based on this. Using the relationship level, the relationship development between the user and the virtual role can be indicated to simulate the real interpersonal relationship stage. Therefore, based on semantic analysis and the relationship level between the two, the reply information sent to the user can be determined to more accurately simulate real interpersonal dialogue and improve user experience.
[0046] In some examples, the virtual role can be deployed in an entity chat robot, and the reply information can be sent to the user in the form of text or voice. However, it is not limited to this, for example, it can also be deployed on a specific application or website platform, and the present disclosure does not limit this.
[0047] In some examples, the relationship level between the user and the virtual role can be determined from a plurality of preset relationship levels, and the plurality of preset relationship levels can be artificially configured in advance.
[0048] In some examples, the intimacy of the historical dialogue content is in the form of a quantitative intimacy score. Therefore, the relationship level between the user and the virtual role can be determined based on the relative size relationship between the intimacy score and the preset threshold. For example, when the relationship level is determined from a plurality of preset relationship levels, the intimacy of the historical dialogue content can be represented by a score within a certain numerical range, and a level threshold corresponding to each preset relationship level is set. The relationship level between the user and the virtual role is determined from the plurality of preset relationship levels based on the relative size relationship between the intimacy score and the plurality of level thresholds.
[0049] In some examples, the historical dialogue content contained in the historical dialogue data can be analyzed using an intimacy score model to obtain a corresponding intimacy score, and the intimacy score model can be obtained by training sample dialogue content including artificially annotated intimacy score labels.
[0050] In some examples, the intimacy of the historical dialogue content can also be determined based on the frequency of occurrence of specific keywords that can indicate higher intimacy by analyzing the keywords contained in the historical dialogue content.
[0051] Applicants have found that the historical dialogue time characteristics of the user and the virtual role based on the historical dialogue content can also effectively indicate the relationship development between the two. For example, when the user and the virtual role have a long dialogue every day, it can be determined that the relationship between the two is relatively close, that is, corresponding to a higher relationship level.
[0052] Based on this, according to some embodiments, the method 200 further includes: determining, based on the historical dialogue data, a historical dialogue duration and a historical dialogue frequency of the user and the virtual role, and determining the relationship level of the user and the virtual role in step S230 includes: determining the relationship level of the user and the virtual role based on the closeness, the historical dialogue duration and the historical dialogue frequency. In this way, the relationship level of the user and the virtual role can be more accurately determined in combination with the historical dialogue duration and the historical dialogue frequency of the user and the virtual role.
[0053] In some examples, the historical dialogue duration and the historical dialogue frequency of the user and the virtual role can be represented by a quantified score based on certain preset rules. For example, the relative size relationship between the historical dialogue duration and the historical dialogue frequency and a preset threshold can be used to determine a quantified score, and then the score and the closeness score are weighted and summed, and the relationship level of the user and the virtual role is determined based on the result of the weighted sum.
[0054] Generally, the dialogue content between the user and the virtual role is around a certain topic, and different topic content can indicate different dialogue closeness. For example, when the user and the virtual role develop a dialogue around a more private topic, it can be judged that this segment of dialogue content corresponds to a higher closeness.
[0055] Based on this, according to some embodiments, determining the closeness of the historical dialogue content of the user and the virtual role based on the historical dialogue data in step S220 includes: determining at least one historical topic of the user and the virtual role based on the historical dialogue data; obtaining a topic closeness corresponding to each historical topic from a topic database, the topic database including a mapping relationship between a plurality of topics and their topic closeness; and determining the closeness of the historical dialogue content of the user and the virtual role based on the topic closeness of each of the at least one historical topic. In this way, the topic closeness of the historical topic of the user and the virtual role can be more efficiently and accurately determined using the topic closeness information stored in the topic database, and the closeness of the historical dialogue content can be more simply and accurately determined based on this.
[0056] In some examples, after determining the topic closeness of the historical topic of the user and the virtual role, the historical dialogue content corresponding to the historical topic can also be further analyzed semantically to more accurately determine the corresponding closeness. Referring to the examples described above, when the historical dialogue content contained in the historical dialogue data is analyzed using a closeness scoring model to obtain a quantified closeness score, the topic closeness corresponding to the historical dialogue content can be input into the model at the same time to obtain a more accurate closeness score result.
[0057] In the case of using the topic closeness to indicate the closeness of the historical conversation content, the closeness of the historical conversation content can be more accurately determined based on the historical conversation duration and the historical conversation frequency corresponding to each topic. For example, when the historical conversation duration and the historical conversation frequency corresponding to the historical topic with a higher topic closeness are higher, it can be determined that the closeness of the historical conversation content is higher.
[0058] Based on this, according to some embodiments, the method 200 further includes: for each historical topic in the at least one historical topic, determining the historical topic conversation duration and the historical topic conversation frequency corresponding to the historical topic, and the determining, in step S220, of the closeness of the historical conversation content of the user and the virtual role includes: determining the closeness of the historical conversation content of the user and the virtual role based on the topic closeness, the historical topic conversation duration and the historical topic conversation frequency corresponding to the at least one historical topic respectively. In this way, the closeness of the historical conversation content can be more accurately determined in combination with the historical topic conversation duration and the historical topic conversation frequency.
[0059] According to some embodiments, the method 200 further includes: for each historical topic in the at least one historical topic, determining the preference of the user for the historical topic, and the determining, in step S220, of the closeness of the historical conversation content of the user and the virtual role includes: determining the closeness of the historical conversation content of the user and the virtual role based on the topic closeness and the preference of the user for the at least one historical topic corresponding to the at least one historical topic respectively. In this way, the closeness of the historical conversation content can be more accurately determined in combination with the preference of the user for each historical topic. For example, when the user prefers the historical topic with a higher topic closeness, it can be determined that the closeness of the historical conversation content is higher.
[0060] In some examples, when the relationship level between the user and the virtual role is low, the conversation between them is dominated by the user, i.e. the virtual role can only generate reply information in response to the conversation information sent by the user actively, and the two only have a conversation around the topic initiated by the user. As the relationship between the two develops, the virtual role can actively initiate other topics to simulate real interpersonal conversation and further improve the user experience.
[0061] Based on this, according to some embodiments, the method 200 further includes: in response to the relationship level satisfying a preset condition, determining a first topic corresponding to first dialogue information sent by the user to the virtual role based on the first dialogue information; determining a second topic based on the relationship level, where the second topic is different from the first topic; and determining second dialogue information for sending to the user based on the second topic. In this way, dialogue information for sending to the user can be determined based on the relationship level between the user and the virtual role to initiate a dialogue with the user around a new topic, further improving the user experience.
[0062] In some examples, the second topic can be determined based on analysis of historical dialogue data and the relationship level. For example, the second topic can be determined from historical topics based on historical dialogue durations and historical dialogue frequencies of the historical topics in historical dialogue content between the user and the virtual role, or the second topic can be determined based on user preferences for the historical topics, so that the second dialogue information sent can be more in line with the user's preferences.
[0063] In some examples, the second topic can also be determined according to a preset rule. As described above, different topics have different topic intimacy levels, so the second topic can be selected from a topic library based on the relationship level between the user and the virtual role, where the second topic has a topic intimacy level that matches the relationship level, based on which the second dialogue information sent to the user is determined. Alternatively, the second topic can also be selected from the topic library, where the second topic has a topic intimacy level that is slightly higher than the intimacy level matched by the current relationship level, so that dialogue content around the topic with a higher intimacy level can be initiated to promote the development of the relationship between the virtual role and the user, improving the user experience. For example, relationship level information within a certain historical time period can be obtained, and in response to the current relationship level lasting for more than a preset time period, the second topic is selected from the topic library, where the second topic has a topic intimacy level that is slightly higher than the intimacy level matched by the current relationship level, to promote the development of the relationship between the virtual role and the user.
[0064] According to some embodiments, the method 200 further includes: obtaining second reply information sent by the user in response to the second dialogue information; determining a current intimacy level based on the second reply information; and adjusting the relationship level between the user and the virtual role based on the current intimacy level. In this way, the current intimacy level can be analyzed based on the reply information of the user, and then the relationship level is adjusted, improving the accuracy of the relationship level.
[0065] When the computer can more accurately determine the user's preference for at least part of the topic, it can be indicated that the virtual character has a higher level of relationship with the user, i.e. the relationship between the two is closer. Based on this, in some examples, the expected reply information can be determined based on the second dialogue information based on the determination of the user's preference, and then whether the expected reply information is accurate is judged based on the expected reply information and the second reply information sent by the user, and then the current closeness is more accurately analyzed, and the accuracy of the relationship level is improved.
[0066] Figure 3 A flowchart of a dialogue method 300 according to an example embodiment of the present disclosure is shown. As shown, the method 300 includes: Figure 3
[0067] Step S301, obtaining historical dialogue data of a user and a virtual character;
[0068] Step S302, determining a historical dialogue duration and a historical dialogue frequency of the user and the virtual character based on the historical dialogue data;
[0069] Step S303, determining at least one historical topic of the user and the virtual character based on the historical dialogue data;
[0070] Step S304, obtaining a topic closeness corresponding to each historical topic from a topic library;
[0071] Step S305, for each historical topic, determining a historical topic dialogue duration and a historical topic dialogue frequency corresponding to the historical topic;
[0072] Step S306, for each historical topic, determining a preference of the user for the historical topic;
[0073] Step S307, based on the topic closeness, the historical topic dialogue duration and the historical topic dialogue frequency respectively corresponding to each historical topic, and the preference of the user for each historical topic, determining a closeness of historical dialogue content of the user and the virtual character;
[0074] Step S308, determining a relationship level of the user and the virtual character based on the closeness, the historical dialogue duration and the historical dialogue frequency;
[0075] Step S309, in response to receiving first dialogue information sent by the user to the virtual character, determining first reply information for sending to the user based on the relationship level and the first dialogue information.
[0076] By utilizing the method 300, the closeness of historical conversation content, the historical conversation duration, the historical conversation frequency, and the relationship level between the user and the virtual role can be determined by analyzing the historical conversation data between the user and the virtual role. The reply information sent to the user is determined based on the semantic analysis and the relationship level between the user and the virtual role, so that the reply information can more accurately simulate real interpersonal conversation and improve user experience.
[0077] Figure 4 A schematic diagram of a conversation process according to an example embodiment of the present disclosure is shown. In this example, four preset relationship levels can be pre-set, which correspond to four stages of relationship development between the user and the virtual role, for example, can include the initial acquaintance stage, the exploration communication stage, the in-depth communication stage, and the stable communication stage. The corresponding closeness is analyzed based on the conversation data between the user and the virtual role to indicate the relationship level between them.
[0078] In this example, in response to receiving the first conversation information sent by the user to the virtual role, the historical conversation data between the user and the virtual role is analyzed to determine the relationship level between them, and the first reply information sent by the virtual role to the user is determined based on the relationship level and the semantic content of the first conversation information.
[0079] In some examples, when the relationship level between the user and the virtual role is obtained, it can be stored in a relationship level memory library, so that the relationship level information can be directly extracted from the relationship level memory library without repeating the data analysis and relationship level determination steps. For example, when the relationship level between the user and the virtual role meets a preset condition, the relationship level information can be extracted from the relationship level memory library, and the new topic that can be initiated is determined based on the historical conversation content. The second conversation information is generated based on the new topic and sent to the user to initiate a conversation around the new topic.
[0080] In the technical solution of the present disclosure, the collection, storage, use, processing, transmission, provision, and disclosure of user personal information comply with relevant laws and regulations and do not violate public order and good customs.
[0081] According to an aspect of the present disclosure, a virtual role-based conversation device is also provided. Figure 5 A structural block diagram of a conversation device 500 according to an example embodiment of the present disclosure is shown. As shown, Figure 5 The device 500 includes:
[0082] The acquisition unit 510 is configured to acquire historical conversation data between a user and a virtual role.
[0083] The first determining unit 520 is configured to determine, based on the historical dialogue data, a closeness of historical dialogue content between the user and the virtual role.
[0084] The second determining unit 530 is configured to determine, based on the closeness, a relationship level between the user and the virtual role.
[0085] The third determining unit 540 is configured to, in response to receiving first dialogue information sent by the user to the virtual role, determine, based on the relationship level and the first dialogue information, first reply information for sending to the user.
[0086] According to some embodiments, the apparatus 500 further comprises a fourth determining unit configured to determine, based on the historical dialogue data, a historical dialogue duration and a historical dialogue frequency between the user and the virtual role, wherein the second determining unit 530 is configured to determine, based on the closeness, the historical dialogue duration and the historical dialogue frequency, the relationship level between the user and the virtual role.
[0087] According to some embodiments, the first determining unit 520 comprises a first determining sub-unit configured to determine, based on the historical dialogue data, at least one historical topic between the user and the virtual role, an obtaining sub-unit configured to obtain, from a topic database, a topic closeness corresponding to each historical topic, the topic database comprising a mapping relationship between a plurality of topics and their topic closeness, and a second determining sub-unit configured to determine, based on the topic closeness of each of the at least one historical topic, the closeness of historical dialogue content between the user and the virtual role.
[0088] According to some embodiments, the apparatus 500 further comprises a fifth determining unit configured to determine, for each of the at least one historical topic, a historical topic dialogue duration and a historical topic dialogue frequency corresponding to the historical topic, wherein the second determining sub-unit is configured to determine, based on the topic closeness, the historical topic dialogue duration and the historical topic dialogue frequency corresponding to each of the at least one historical topic, the closeness of historical dialogue content between the user and the virtual role.
[0089] According to some embodiments, the apparatus 500 further comprises a sixth determining unit configured to determine, for each of the at least one historical topic, a preference of the user for the historical topic, wherein the second determining sub-unit is configured to determine, based on the topic closeness and the preference of the user for the at least one historical topic, the closeness of historical dialogue content between the user and the virtual role.
[0090] According to some embodiments, the apparatus 500 further comprises a seventh determining unit configured to, in response to the relationship level satisfying a preset condition, determine a first topic corresponding to the first dialogue information sent by the user to the virtual role based on the first dialogue information; an eighth determining unit configured to determine a second topic based on the relationship level, wherein the second topic is different from the first topic; and a ninth determining unit configured to determine second dialogue information for sending to the user based on the second topic.
[0091] According to some embodiments, the obtaining unit 510 is further configured to obtain second reply information sent by the user in response to the second dialogue information, and the apparatus 500 further comprises a tenth determining unit configured to determine a current closeness based on the second reply information; and an adjusting unit configured to adjust the relationship level between the user and the virtual role based on the current closeness.
[0092] The operations of the units 510-540 of the dialogue apparatus 500 are similar to the operations of the steps S210-S240 described above, and thus are not described herein.
[0093] According to another aspect of the present disclosure, there is also provided an electronic device, comprising at least one processor; and a memory connected with the at least one processor in communication; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the above-mentioned virtual role-based dialogue method.
[0094] According to another aspect of the present disclosure, there is also provided a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to enable the computer to perform the above-mentioned virtual role-based dialogue method.
[0095] According to another aspect of the present disclosure, there is also provided a computer program product comprising a computer program, wherein the computer program, when executed by a processor, implements the above-mentioned virtual role-based dialogue method.
[0096] Reference Figure 6The present invention describes a structural block diagram of an electronic device 600 that can serve as a server or client of the present disclosure, which is an example of a hardware device that can be applied to various aspects of the present disclosure. The electronic device is intended to represent various forms of digital electronic computer devices, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the present disclosure described and / or claimed herein.
[0097] like Figure 6 As shown, device 600 includes a computing unit 601, which can perform various appropriate actions and processes based on a computer program stored in read-only memory (ROM) 602 or a computer program loaded from storage unit 608 into random access memory (RAM) 603. RAM 603 may also store various programs and data required for the operation of device 600. The computing unit 601, ROM 602, and RAM 603 are interconnected via bus 604. Input / output (I / O) interface 605 is also connected to bus 604.
[0098] Multiple components in device 600 are connected to I / O interface 605, including: input unit 606, output unit 607, storage unit 608, and communication unit 609. Input unit 606 can be any type of device capable of inputting information to device 600. Input unit 606 can receive input numerical or character information and generate key signal inputs related to user settings and / or function control of the electronic device, and can include, but is not limited to, a mouse, keyboard, touchscreen, trackpad, trackball, joystick, microphone, and / or remote control. Output unit 607 can be any type of device capable of presenting information, and can include, but is not limited to, a monitor, speaker, video / audio output terminal, vibrator, and / or printer. Storage unit 608 can include, but is not limited to, a hard disk and an optical disk. Communication unit 609 allows device 600 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks, and can include, but is not limited to, modems, network cards, infrared communication devices, wireless communication transceivers, and / or chipsets, such as Bluetooth™ devices, 802.11 devices, WiFi devices, WiMax devices, cellular communication devices, and / or the like.
[0099] The computing unit 601 can be various general and / or special purpose processing components with processing and computing capabilities. Some examples of the computing unit 601 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various specialized artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 601 performs various methods and processes described above, such as the virtual character-based conversation method. For example, in some embodiments, the virtual character-based conversation method can be implemented as a computer software program tangibly embodied in a machine-readable medium, such as the storage unit 608. In some embodiments, part or all of the computer program can be loaded and / or installed onto the device 600 via the ROM 602 and / or the communication unit 609. When the computer program is loaded onto the RAM 603 and executed by the computing unit 601, one or more steps of the virtual character-based conversation method described above can be performed. Alternatively, in other embodiments, the computing unit 601 can be configured to perform the virtual character-based conversation method by any other suitable means, such as by means of firmware.
[0100] Various implementations of the systems and techniques described above can be realized 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 complex programmable logic device (CPLD), computer hardware, firmware, software, and / or combinations thereof. These various implementations 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.
[0101] Program code for carrying out methods of the present disclosure can be written in any combination of one or more programming languages. The program code can be provided to a processor or controller of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the program code, when executed by the processor or controller, produces a means for implementing the functions / acts specified in the flowcharts and / or block diagrams. The program code 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.
[0102] In the context of this disclosure, a machine-readable medium can be a tangible medium that contains or stores a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include but is not limited to an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. 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.
[0103] To provide for interaction with a user, the systems and techniques described here can be implemented on a computer 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 computer. 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.
[0104] 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), the Internet, and a blockchain network.
[0105] The computer system can include clients and servers. This relationship can be remote or on-site. The servers can be cloud servers, servers of a distributed system, or servers combined with a blockchain.
[0106] It should be understood that the various forms of flow shown above can be used to reorder, add, or delete steps. For example, the steps described in the present disclosure can be performed in parallel, sequentially, or in a different order, as long as the desired results of the technical solutions disclosed in the present disclosure can be achieved, which are not limited herein.
[0107] Although embodiments or examples of the present disclosure have been described with reference to the accompanying drawings, it should be understood that the above-described methods, systems, and devices are merely exemplary embodiments or examples, and the scope of the present disclosure is not limited by these embodiments or examples, but only by the granted claims and their equivalent scope. Various elements in the embodiments or examples can be omitted or replaced by equivalent elements. In addition, each step can be performed in an order different from that described in the present disclosure. Further, various elements in the embodiments or examples can be combined in various ways. It is important that many of the elements described herein can be replaced by equivalent elements that appear after the present disclosure as technology evolves.
Claims
1. A virtual role-based conversation method, comprising: obtaining historical conversation data of a user with a virtual role; determining a closeness of historical conversation content of the user with the virtual role based on the historical conversation data; determining a relationship level of the user with the virtual role based on the closeness; and in response to receiving first conversation information sent by the user to the virtual role, determining first reply information for sending to the user based on the relationship level and the first conversation information, the method further comprising: in response to the relationship level satisfying a preset condition, determining a first topic corresponding to the first conversation information sent by the user to the virtual role based on the first conversation information; determining a second topic different from the first topic based on the relationship level; and determining second conversation information for sending to the user based on the second topic; determining expected reply information based on the second conversation information; determining a current closeness based on second reply information sent by the user in response to the second conversation information and the expected reply information; and adjusting the relationship level of the user with the virtual role based on the current closeness. 2.The method of claim 1, further comprising: determining a historical conversation duration and a historical conversation frequency of the user with the virtual role based on the historical conversation data, wherein the determining the relationship level of the user with the virtual role comprises: determining the relationship level of the user with the virtual role based on the closeness, the historical conversation duration and the historical conversation frequency. the determining the closeness of historical conversation content of the user with the virtual role based on the historical conversation data comprises:
3. The method of claim 1, wherein, determining at least one historical topic of the user with the virtual role based on the historical conversation data; obtaining a topic closeness corresponding to each historical topic from a topic database, the topic database comprising a mapping relationship between a plurality of topics and their topic closenesses; and determining the closeness of historical conversation content of the user with the virtual role based on the topic closeness of each of the at least one historical topic. 4.The method of claim 3, further comprising: determining a historical topic conversation duration and a historical topic conversation frequency corresponding to each of the at least one historical topic, wherein the determining the closeness of historical conversation content of the user with the virtual role comprises: determining the closeness of historical conversation content of the user with the virtual role based on the topic closeness, the historical topic conversation duration and the historical topic conversation frequency corresponding to each of the at least one historical topic. 5.The method of claim 3 or 4, further comprising: determining a preference of the user for each of the at least one historical topic, wherein the determining the closeness of historical conversation content of the user with the virtual role comprises: determine the intimacy of the historical conversation content between the user and the virtual role based on the topic intimacy corresponding to each of the at least one historical topic and the preference of the user for the at least one historical topic.
6. A virtual role-based conversation apparatus, comprising: an obtaining unit configured to obtain historical conversation data of a user and a virtual role; a first determining unit configured to determine an intimacy of historical conversation content between the user and the virtual role based on the historical conversation data; a second determining unit configured to determine a relationship level between the user and the virtual role based on the intimacy; and a third determining unit configured to, in response to receiving first conversation information sent by the user to the virtual role, determine first reply information for sending to the user based on the relationship level and the first conversation information, the apparatus further comprising: a seventh determining unit configured to, in response to the relationship level satisfying a preset condition, determine a first topic corresponding to first conversation information sent by the user to the virtual role based on the first conversation information; an eighth determining unit configured to determine a second topic based on the relationship level, wherein the second topic is different from the first topic; a ninth determining unit configured to determine second conversation information for sending to the user based on the second topic, the apparatus being further configured to determine expected reply information based on the second conversation information; a tenth determining unit configured to determine a current intimacy based on second reply information sent by the user in response to the second conversation information and the expected reply information; and an adjusting unit configured to adjust the relationship level between the user and the virtual role based on the current intimacy.
7. The apparatus of claim 6, further comprising: a fourth determining unit configured to determine a historical conversation duration and a historical conversation frequency of the user and the virtual role based on the historical conversation data, wherein the second determining unit is configured to: determine the relationship level between the user and the virtual role based on the intimacy, the historical conversation duration and the historical conversation frequency.
8. The apparatus of claim 6, wherein, the first determining unit comprising: a first determining sub-unit configured to determine at least one historical topic of the user and the virtual role based on the historical conversation data; an obtaining sub-unit configured to obtain a topic intimacy corresponding to each historical topic from a topic database, the topic database comprising a mapping relationship between a plurality of topics and their topic intimacies; and a second determining sub-unit configured to determine the intimacy of the historical conversation content between the user and the virtual role based on the topic intimacy corresponding to each of the at least one historical topic.
9. The apparatus of claim 8, further comprising: a fifth determining unit configured to determine, for each historical topic of the at least one historical topic, a historical topic conversation duration and a historical topic conversation frequency corresponding to the historical topic, wherein the second determining sub-unit is configured to: determine the intimacy of the historical conversation content of the user with the virtual role based on the topic intimacy respectively corresponding to the at least one historical topic, the historical topic conversation duration and the historical topic conversation frequency.
10. The apparatus of claim 8 or 9, further comprising: a sixth determining unit configured to determine, for each of the at least one historical topic, a preference of the user for the historical topic, wherein the second determining sub-unit is configured to: determine the intimacy of the historical conversation content of the user with the virtual role based on the topic intimacy respectively corresponding to the at least one historical topic and the preference of the user for the at least one historical topic.
11. An electronic device, comprising: at least one processor; and a memory connected with the at least one processor in communication; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-5.
12. A non-transitory computer readable storage medium having stored thereon computer instructions, wherein, The computer instructions are used to enable the computer to perform the method according to any one of claims 1-5.
13. A computer program product comprising a computer program, wherein, The computer program, when executed by the processor, implements the method according to any one of claims 1-5. The computer program, when executed by the processor, implements the method according to any one of claims 1-5.
Citation Information
Patent Citations
Man-machine interaction method and device for conversation system
CN106020488A
Method and device for generating reply information based on robot emotional state
CN109033179A
Intimacy determination method, apparatus and device, and medium
CN109450776A
Interaction method and device of robot, terminal equipment and readable storage medium
CN112497217A
Human-computer interaction method and device, electronic equipment and storage medium
CN114461775A