Human-computer interaction method, device and equipment based on historical dialogues and storage medium
By obtaining and analyzing the user's current dialogue information and historical dialogue database, determining the associated historical memory objects, and generating more accurate reply information, it solves the problems of information loss and inefficiency in long dialogue processing, and improves human-computer interaction Efficiency and precision improve user experience.
Patent Information
- Application Number
- CN202411046432.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-31
- Publication Date
- 2024-11-12
AI Technical Summary
The prior art has problems of information loss and low reply efficiency and accuracy when handling long conversations, resulting in low human-computer interaction efficiency and accuracy, which affects the user experience.
By obtaining the user's current dialogue information and historical dialogue database, we determine the historical memory objects associated with the current dialogue information, and generate reply information based on these objects, reducing the interception and segmentation of long-hierarchical dialogues, and improving the accuracy and efficiency of the determination of reply information.
It improves the efficiency and accuracy of human-computer interaction, improves the user experience, and more accurately retrieves historical information related to the current conversation by generating historical memory objects, reducing information loss and enhancing the certainty of the reply.
Smart Images

Figure CN118940842A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of human-computer interaction in the field of artificial intelligence, and in particular to a human-computer interaction method, device, equipment and storage medium based on historical dialogue. Background Art
[0002] With the development of artificial intelligence technology, users have higher and higher requirements for the interactive experience during human-computer interaction. Users can automatically get a reply to a piece of information by inputting a piece of information according to their needs.
[0003] Users expect to get accurate responses when interacting with computers. How to provide users with efficient and accurate responses is an urgent problem that needs to be solved. Summary of the invention
[0004] The present invention provides a human-computer interaction method, device, equipment and storage medium based on historical dialogue.
[0005] According to a first aspect of the present disclosure, a human-computer interaction method based on historical dialogue is provided, comprising:
[0006] Acquire the user's current conversation information and a historical conversation database; wherein the historical conversation database includes a plurality of historical memory objects, the historical memory objects represent the user's historical conversation information and analysis results of the historical conversation information, the analysis results include timestamps and semantic information of the historical conversation information;
[0007] Determining, from the historical conversation database, a historical memory object associated with the current conversation information as a target memory object;
[0008] According to the target memory object, reply information of the current dialogue information is determined.
[0009] According to a second aspect of the present disclosure, a human-computer interaction device based on historical dialogue is provided, comprising:
[0010] An acquisition unit, configured to acquire the user's current conversation information and a historical conversation database; wherein the historical conversation database includes a plurality of historical memory objects, wherein the historical memory objects represent the user's historical conversation information and an analysis result of the historical conversation information, wherein the analysis result includes a timestamp and semantic information of the historical conversation information;
[0011] a target determination unit, configured to determine, from the historical conversation database, a historical memory object associated with the current conversation information as a target memory object;
[0012] The reply determination unit is used to determine the reply information of the current dialogue information according to the target memory object.
[0013] According to a third aspect of the present disclosure, there is provided an electronic device, including:
[0014] at least one processor; and
[0015] a memory communicatively coupled to the at least one processor;
[0016] The memory stores instructions that can be executed 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 method described in the first aspect of the present disclosure.
[0017] According to a fourth aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to cause the computer to execute the method according to the first aspect of the present disclosure.
[0018] According to a fifth aspect of the present disclosure, a computer program product is provided, comprising a computer program, which implements the steps of the method described in the first aspect of the present disclosure when executed by a processor.
[0019] According to the technology disclosed in the present invention, the efficiency and accuracy of human-computer interaction are improved.
[0020] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] The accompanying drawings are used to better understand the present solution and do not constitute a limitation of the present disclosure.
[0022] Figure 1 is a flowchart of a human-computer interaction method based on historical dialogue provided according to an embodiment of the present disclosure;
[0023] Figure 2 is a flowchart of a human-computer interaction method based on historical dialogue provided according to an embodiment of the present disclosure;
[0024] Figure 3 is a flowchart of a human-computer interaction method based on historical dialogue provided according to an embodiment of the present disclosure;
[0025] Figure 4 is a structural block diagram of a human-computer interaction device based on historical dialogue provided according to an embodiment of the present disclosure;
[0026] Figure 5 is a structural block diagram of a human-computer interaction device based on historical dialogue provided according to an embodiment of the present disclosure;
[0027] Figure 6is a block diagram of an electronic device for implementing the human-computer interaction method based on historical dialogue according to an embodiment of the present disclosure;
[0028] Figure 7 It is a block diagram of an electronic device used to implement the human-computer interaction method based on historical dialogue in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0029] The following is a description of exemplary embodiments of the present disclosure in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.
[0030] Human-computer interaction refers to processing the dialogue information input by the user and sending corresponding reply information to the user. For example, LLM (Large Language Model) can be used to process the dialogue information input by the user. In order to reply more accurate information to the user, the user's historical dialogue information can usually be combined so that the reply information can better meet the user's actual needs.
[0031] However, the historical conversation information of users is usually long. Models such as LLM have input length limitations when processing long conversations, making it impossible to effectively analyze historical conversation information. At present, truncation and segmentation methods can be used to process long conversations. Text truncation refers to directly intercepting a part of the historical conversation information as input, and segmentation input refers to segmenting the historical conversation information of a long conversation into multiple short sequences and inputting them into the model separately. However, text truncation and segmentation input will lead to information loss, affecting the efficiency and accuracy of determining the reply information, resulting in low efficiency and accuracy of human-computer interaction, affecting the user's interactive experience.
[0032] The present invention discloses a human-computer interaction method, device, equipment and storage medium based on historical dialogue, which are applied to the human-computer interaction field in the field of artificial intelligence to improve the efficiency and accuracy of human-computer interaction and enhance user experience.
[0033] It should be noted that the model in this embodiment is not a model for a specific user and cannot reflect the personal information of a specific user. It should be noted that the data in this embodiment comes from a public data set.
[0034] In the technical solution of the present disclosure, the collection, storage, use, processing, transmission, provision and disclosure of user personal information involved are in compliance with the provisions of relevant laws and regulations and do not violate public order and good morals.
[0035] In order to enable readers to more deeply understand the implementation principle of the present disclosure, the following Figure 1-Figure 7 The embodiment is further refined.
[0036] Figure 1 FIG. 1 is a flow chart of a human-computer interaction method based on historical dialogue provided according to an embodiment of the present disclosure. The method can be executed by a human-computer interaction device based on historical dialogue. Figure 1 As shown, the method comprises the following steps:
[0037] S101. Obtain the user's current conversation information and a historical conversation database; wherein the historical conversation database includes a plurality of historical memory objects, the historical memory objects represent the user's historical conversation information and analysis results of the historical conversation information, the analysis results including the timestamp and semantic information of the historical conversation information.
[0038] Exemplarily, when a user performs human-computer interaction, the user can input dialogue information in real time, and the user can input dialogue information in the form of text or voice. For example, a user can input his own questions and get answers to the questions through human-computer interaction. The dialogue information currently input by the user can be obtained in real time, that is, the current dialogue information is obtained. The dialogue information of each human-computer interaction performed by the user can be stored as new historical dialogue information, and the historical dialogue information can be stored in a historical dialogue database. The dialogue information of the human-computer interaction performed by the user can include the dialogue information input by the user and the dialogue information replied by the robot. New historical dialogue information can be obtained in real time or periodically, and the historical dialogue database can be updated.
[0039] When obtaining the current conversation information of the user, a historical conversation database can also be obtained. The historical conversation database may include multiple historical memory objects, each of which may represent a sentence or a section of historical conversation information, as well as the analysis results of the historical conversation information, and the analysis results may include information such as the timestamp and semantic information of the historical conversation information. For example, each conversation information that has been sent is used as a historical conversation information, and each historical conversation information corresponds to a historical memory object, and the historical memory object may represent the text content of the historical conversation information. After obtaining a historical conversation information, the sending time of the historical conversation information may be determined, and the sending time may be stored as a timestamp in the historical memory object of the historical conversation information. The historical conversation information may also be semantically analyzed to obtain semantic information such as emotions, themes, keywords, etc. expressed by the historical conversation information, which is also stored in the historical memory object of the historical conversation information. The historical memory object may be referred to as an IMO (Interactive Memory Object). In this embodiment, the processing method of the semantic analysis is not specifically limited.
[0040] A data table may be provided in the historical conversation database, each row in the data table represents an IMO, and the columns in the data table may represent the fields stored in the IMO, for example, the fields may include the text content, timestamp, title, keyword, topic category, emotion tag, etc. of the historical conversation information. The title may be a summary of the content of the historical conversation information; the keyword is an important phrase in the text content of the historical conversation information; the topic category may be the field involved in the historical conversation information, for example, it may be a topic such as travel, food, etc.; the emotion tag may represent the emotion expressed by the historical conversation information, for example, it may be a positive emotion or a negative emotion. Each time an IMO is obtained, the IMO is stored in the historical conversation database.
[0041] In this embodiment, it also includes: determining the sending time of the current dialogue information, and determining the sending time as the timestamp of the current dialogue information; performing semantic analysis on the current dialogue information to obtain semantic information of the current dialogue information; determining the timestamp of the current dialogue information and the semantic information of the current dialogue information as the analysis result of the current dialogue information; determining the current dialogue information and the analysis result of the current dialogue information as new historical memory objects, and storing them in the historical dialogue database.
[0042] Specifically, after obtaining the current dialogue information, the current dialogue information can be analyzed to obtain the analysis result of the current dialogue information, so that the text content and analysis result of the current dialogue information are stored as a new historical memory object in the historical dialogue database. The analysis result can include information such as the timestamp and semantic information of the dialogue information. Determine the sending time of the current dialogue information, for example, the time when the user sends the dialogue information, or the time when the robot sends the dialogue information. The sending time of the current dialogue information is used as the timestamp of the current dialogue information, that is, the sending time of each dialogue information is marked for the dialogue information.
[0043] A semantic analysis algorithm may also be preset to perform semantic analysis on the current conversation information to obtain semantic information of the current conversation information, which may include titles, keywords, topic categories, sentiment tags, etc. The timestamp of the current conversation information and the semantic information of the current conversation information are determined as the analysis result of the current conversation information. The current conversation information and the analysis result of the current conversation information are determined as a new IMO and stored in the historical conversation database. The IMO may be compressed or encrypted to save storage space and protect data security.
[0044] The beneficial effect of such a setting is that when a user conducts human-computer interaction, a new historical memory object can be generated based on the content of the conversation, the historical conversation database can be automatically updated, the accuracy and efficiency of determining reply information can be improved, and the user experience can be enhanced.
[0045] In this embodiment, it also includes: determining the previous dialogue information of the current dialogue information in the historical dialogue database; marking the current dialogue information and the previous dialogue information of the current dialogue information with a preset logical identifier; wherein the preset logical identifier indicates that there is a logical structure and time sequence between the two dialogue information.
[0046] Specifically, association relationships can be established between different IMOs to reflect the logical structure and time sequence of the conversation. For example, the previous sentence and the next sentence can be associated. That is, for each current conversation message, the previous conversation message of the current conversation message can be determined. A preset logical identifier is marked for the two conversation messages, and the logical identifier can indicate that there is a logical structure and time sequence between the two conversation messages.
[0047] In the historical conversation database, a preset logical identifier is added to the two conversation messages. When searching for one of the conversation messages, another conversation message that is logically associated with the conversation message can be found according to the logical identifier.
[0048] The beneficial effect of such a setting is that by adding logical identifiers, the association relationship between different IMOs can be determined, which facilitates subsequent retrieval and query, thereby improving the efficiency and accuracy of human-computer interaction.
[0049] In this embodiment, it also includes: obtaining the timestamp of the historical memory object in the historical conversation database according to a preset information update cycle; if it is determined according to the timestamp of the historical memory object that the storage time of the historical memory object in the historical conversation database exceeds a preset time threshold, the historical memory object is deleted from the historical conversation database.
[0050] Specifically, the historical conversation database may be updated regularly. An information update cycle is preset, for example, the information update cycle may be 24 hours. According to the preset information update cycle, the timestamps of all historical memory objects in the historical conversation database are obtained, and the timestamps may indicate the time when the historical conversation information in the historical memory object is issued. For example, the time when each historical conversation information is issued is obtained once every 24 hours.
[0051] Determine the current time, and determine whether the storage time of the historical memory object in the historical conversation database exceeds a preset time threshold according to the current time and the timestamp of the historical memory object. For example, if the preset time threshold is one year, determine whether the time difference between the sending time of the historical conversation information and the current time exceeds one year. If it is determined that the storage time of the historical memory object in the historical conversation database exceeds the preset time threshold, the historical memory object can be deleted from the historical conversation database; if it does not exceed the preset time threshold, the historical memory object is retained in the historical conversation database.
[0052] The beneficial effect of this setting is that it can optimize the database structure and improve system performance by cleaning up obsolete IMOs.
[0053] Users can also update the historical dialogue database on their own. For example, users can issue database viewing instructions through a graphical interface or voice commands to view the IMOs in the historical dialogue database in a visual interface. Edit, delete, and deduplicate IMOs in the historical dialogue database. Through manual intervention, the quality of IMOs can be improved, thereby improving the accuracy and efficiency of subsequent human-computer interactions.
[0054] S102: Determine, from the historical conversation database, a historical memory object associated with the current conversation information as a target memory object.
[0055] For example, the robot needs to reply to the user's conversation information. When replying, it can find the IMO associated with the current conversation information from the historical conversation database as the target memory object. The target memory object can be retrieved according to the context of the current conversation information and the actual needs of the user. For example, the current conversation information can be semantically analyzed to find the IMO with the most similar semantics to the current conversation information as the associated target memory object, or the IMO with the most repeated words in the current conversation information can be found as the associated target memory object.
[0056] The target memory object determination rule may be preset, for example, the target memory object may be determined according to the matching degree of the subject category, the number of repeated words, the similarity of semantics, etc. In this embodiment, the target memory object determination rule is not specifically limited.
[0057] S103. Determine the reply information of the current dialogue information according to the target memory object.
[0058] Exemplarily, after obtaining the target memory object, the target memory object and the current dialogue information can be combined to determine the reply information of the current dialogue information, and the reply information can be sent to the user. For example, the reply information of the current dialogue information can be extracted from the target memory object. The information extraction algorithm can be pre-set, for example, key information can be extracted from the target memory object and then integrated into a complete sentence. In this embodiment, the information extraction algorithm is not specifically limited.
[0059] The target memory object may be one or more. If multiple target memory objects are found, the multiple target memory objects may be combined to determine the reply information. For example, the reply information of the current dialogue information may be extracted from the multiple target memory objects respectively, and then the extracted multiple reply information may be integrated into the final reply information.
[0060] In the disclosed embodiment, when a user is performing human-computer interaction, he or she can obtain the current conversation information and the historical conversation database in real time. The historical conversation database may include multiple historical memory objects, each of which can represent the user's historical conversation information and the analysis results such as the timestamp and semantic information of the historical conversation information. For each piece of historical conversation information, a separate historical memory object is generated for storage. Based on the analysis results of the historical memory object, the historical memory object associated with the current conversation information is determined from the historical conversation database as the target memory object. The user is replied to in combination with the target memory object. By generating historical memory objects, the interception of long historical conversations is reduced, the memory capacity is improved, and the historical information related to the current conversation can be retrieved more accurately, thereby improving the accuracy and efficiency of human-computer interaction and enhancing the user's interactive experience.
[0061] Figure 2 A flowchart of a human-computer interaction method based on historical dialogue provided in an embodiment of the present disclosure.
[0062] In this embodiment, a historical memory object associated with the current conversation information is determined from the historical conversation database as a target memory object, including: determining an association value between each historical memory object and the current conversation information in the historical conversation database; wherein the association value represents the degree of association between the historical memory object and the current conversation information; and determining the target memory object from the historical conversation database according to the association value corresponding to each historical memory object.
[0063] like Figure 2 As shown, the method comprises the following steps:
[0064] S201. Obtain the user's current conversation information and a historical conversation database; wherein the historical conversation database includes a plurality of historical memory objects, the historical memory objects represent the user's historical conversation information and analysis results of the historical conversation information, the analysis results including the timestamp and semantic information of the historical conversation information.
[0065] Exemplarily, this step may refer to the above-mentioned step S101 and will not be described in detail.
[0066] S202: Determine the association value between each historical memory object and the current dialogue information in the historical dialogue database; wherein the association value represents the degree of association between the historical memory object and the current dialogue information.
[0067] Exemplarily, for each IMO in the historical conversation database, the association value between the IMO and the current conversation information is determined, and the association value can represent the degree of association between the IMO and the current conversation information. The higher the association value, the more the historical conversation information in the IMO matches the current conversation information. For example, if the subject category of the IMO is the same as the subject category of the current conversation information, the association value is high.
[0068] In this embodiment, determining the association value between each historical memory object and the current dialogue information in the historical dialogue database includes: determining the distance value between the historical memory object and the current dialogue information based on the timestamp of the historical memory object; wherein the distance value represents the time distance between the historical memory object and the current dialogue information; determining the correlation value between the historical memory object and the current dialogue information based on the semantic information of the historical memory object; wherein the correlation value represents the degree of semantic correlation between the historical dialogue information represented by the historical memory object and the current dialogue information; determining the association value between the historical memory object and the current dialogue information based on the distance value and the correlation value corresponding to the historical memory object.
[0069] Specifically, for each IMO, the timestamp of the IMO is determined, that is, the sending time of the IMO is determined. The sending time of the current conversation information is determined, and the distance value between the IMO and the current conversation information is determined according to the timestamp of the IMO and the sending time of the current conversation information. The distance value can represent the time distance between the IMO and the current conversation information. For example, the time difference between the timestamp of the IMO and the sending time of the current conversation information can be determined, and the distance value is determined according to the time difference. The smaller the time difference, the smaller the distance value, that is, the closer the IMO is to the current conversation information.
[0070] Perform semantic analysis on the current dialogue information to obtain the semantic information of the current dialogue information. Determine the semantic information of the historical memory object, and determine the correlation value between the historical memory object and the current dialogue information based on the semantic information of the historical memory object and the semantic information of the current dialogue information. The correlation value can represent the degree of semantic correlation between the historical dialogue information represented by the historical memory object and the current dialogue information. The more similar the semantics of the current dialogue information is to the semantics of the historical memory object, the greater the correlation value can be. For example, the more similar the subject category of the current dialogue information is to the subject category of the historical memory object, the greater the correlation value.
[0071] Semantic information can include titles, keywords, topic categories, sentiment tags, and other information, and the relevant value can be calculated by combining this information. For example, the title of the current conversation information is matched with the title of the historical memory object to obtain a numerical value of the matching result; the keyword of the current conversation information is matched with the keyword of the historical memory object to obtain another numerical value of the matching result. The two numerical values are added together to obtain the relevant value.
[0072] The association value between the historical memory object and the current dialogue information is determined by combining the distance value and the correlation value corresponding to the historical memory object. For example, the distance value and the correlation value may be added to obtain the association value; or the average of the distance value and the correlation value may be calculated as the association value.
[0073] The beneficial effect of this setting is that for each IMO, the recency and relevance with the current conversation information can be calculated, and the associated value can be obtained by combining the calculations. The target memory object associated with the current conversation information can be retrieved more accurately, the reply accuracy can be improved, and the user experience can be enhanced.
[0074] In this embodiment, the semantic information includes an emotion tag, which represents the emotion expressed by the historical conversation information represented by the historical memory object; based on the semantic information of the historical memory object, the correlation value between the historical memory object and the current conversation information is determined, including: performing emotion analysis on the current conversation information to obtain the emotion information of the current conversation information; determining the similarity between the emotion information of the current conversation information and the emotion tag of the historical memory object; and determining the correlation value between the historical memory object and the current conversation information based on the similarity.
[0075] Specifically, the semantic information may include an emotion tag, which may represent the emotion expressed by the historical conversation information represented by the historical memory object. For each IMO, the emotion tag of the IMO may be obtained, that is, the emotion expressed by the historical conversation information in the IMO may be determined.
[0076] The sentiment analysis algorithm is preset to perform sentiment analysis on the current dialogue information to obtain the sentiment information of the current dialogue information, that is, to determine the sentiment expressed by the current dialogue information. In this embodiment, the sentiment analysis algorithm is not specifically limited.
[0077] A similarity determination algorithm is preset to calculate the similarity between the emotion information of the current dialogue information and the emotion label of the historical memory object. The similarity can be expressed as the degree of similarity between the emotion represented by the current dialogue information and the historical dialogue information in the historical memory object. For example, if the emotion information of the current dialogue information represents a positive emotion and the emotion label of the historical memory object also represents a positive emotion, the similarity can be high. In this embodiment, the preset similarity determination algorithm is not specifically limited.
[0078] According to the similarity between the emotion information of the current dialogue information and the emotion tag of the historical memory object, the correlation value between the historical memory object and the current dialogue information is determined. The higher the similarity, the higher the correlation value can be. For example, the similarity can be determined as the correlation value.
[0079] The beneficial effect of such a setting is that relevant values are determined based on the emotion-related information in the semantic information, so that the target memory object is more matched with the current conversation information, the reply information can be more in line with the user's current state, the accuracy of the reply information is improved, and the user experience is enhanced.
[0080] In this embodiment, the association value between the historical memory object and the current dialogue information is determined based on the distance value and correlation value corresponding to the historical memory object, including: determining the sentence structure of the historical dialogue information represented by the historical memory object; wherein the sentence structure represents the grammar and word order of the historical dialogue information; determining the importance value of the historical memory object based on the sentence structure; wherein the importance value represents the grammatical fluency and contextual importance of the historical dialogue information represented by the historical memory object; determining the association value between the historical memory object and the current dialogue information based on the distance value, correlation value, and importance value corresponding to the historical memory object.
[0081] Specifically, for each IMO, the sentence structure of the historical dialogue information represented by the IMO can be determined. The sentence structure can represent the grammar and word order of the historical dialogue information, that is, the grammar used by the historical dialogue information and the word order in the sentence can be determined. For example, the subject, predicate, object, etc. in the historical dialogue information can be determined, and it can also be determined whether the historical dialogue information is expressed completely, clearly, and vividly. Grammatical structure and word order can often reveal the importance of information. For example, in many languages, key components such as subject, predicate, and object are usually located at the core of the sentence, while other modifying components such as attributives and adverbials may be located at the edge. Sentence structure can also represent the sentence pattern of the historical dialogue information. For example, special sentence patterns such as emphasis sentences and inversion sentences are also often used to highlight the importance of information.
[0082] According to the sentence structure, the importance value of the historical memory object can be determined, and the importance value can represent the grammatical fluency and contextual importance of the historical dialogue information represented by the historical memory object. Whether the sentence is fluent can be determined according to the grammatical structure. The smoother the sentence reads, the higher the importance value can be considered. For example, if the positions of the subject and predicate in the historical dialogue information are reversed, it can be determined that the importance value is low. The same sentence may have different importance in different contexts. For example, "it will rain tomorrow" may be very important when planning outdoor activities, but may be irrelevant when discussing historical events. That is, the importance value of the historical dialogue information can be determined by combining the sentence structure and the context of the historical dialogue information.
[0083] For each IMO, the distance value, the correlation value and the importance value can be calculated, and the three indicators can be combined to obtain the correlation value of the IMO. For example, the three indicators can be added to obtain the final correlation value.
[0084] The beneficial effect of such a setting is that the importance of the IMO is determined. The higher the importance, the more likely it is to be determined as a target memory object, thereby improving the accuracy of reply information and enhancing the user's interactive experience.
[0085] In this embodiment, the method further includes: determining the number of occurrences of the historical conversation information represented by the historical memory object in the historical conversation database; and adjusting the importance value of the historical memory object according to the number of occurrences.
[0086] Specifically, repeated IMOs may appear in the historical conversation database. For repeated IMOs, the number of occurrences of the IMOs in the historical conversation database may be determined. The importance value of the IMO may be determined or adjusted based on the number of occurrences. For example, the more the number of occurrences, the higher the importance value.
[0087] After determining the importance value of IMO according to the sentence structure, the importance value can be adjusted according to the number of occurrences. Alternatively, a weighted sum calculation can be performed according to the grammatical structure and the number of occurrences to obtain the importance value of IMO.
[0088] The beneficial effect of such a setting is that the number of occurrences can increase the importance value of the IMO, so that when selecting the target memory object, the IMO with a large number of occurrences can be given priority, which is conducive to meeting the actual needs of users and improving user experience.
[0089] In this embodiment, the association value between the historical memory object and the current dialogue information is determined based on the distance value, correlation value, and importance value corresponding to the historical memory object, including: weighted processing of the distance value, correlation value, and importance value corresponding to the historical memory object, and determining the result of the weighted processing as the association value between the historical memory object and the current dialogue information.
[0090] Specifically, for the three indicators of distance value, correlation value, and importance value, weights can be set according to actual needs or preset rules. After obtaining the distance value, correlation value, and importance value of the IMO, weighted processing can be performed according to the preset weights of the three indicators. For example, a weighted sum calculation can be performed. The calculation result after weighted processing is determined, and the calculation result is determined as the correlation value between the IMO and the current dialogue information.
[0091] The beneficial effect of such a setting is that the three indicators are comprehensively considered to improve the accuracy of determining the associated value, thereby improving the accuracy of determining the reply information.
[0092] S203. Determine the target memory object from the historical conversation database according to the associated value corresponding to each historical memory object.
[0093] Exemplarily, after obtaining the association values of each IMO, the target memory object can be determined from the historical conversation database according to the magnitude of each association value. For example, the IMO with the largest association value can be determined as the target memory object.
[0094] In this embodiment, for each IMO, the correlation value with the current dialogue information can be calculated, so as to find the historical dialogue information with the strongest correlation, assist in responding to the current dialogue information, improve the accuracy of human-computer interaction, and enhance the user experience.
[0095] S204: Determine the reply information of the current dialogue information according to the target memory object.
[0096] Exemplarily, this step may refer to the above-mentioned step S103 and will not be described in detail.
[0097] In the disclosed embodiment, when a user is performing human-computer interaction, he or she can obtain the current conversation information and the historical conversation database in real time. The historical conversation database may include multiple historical memory objects, each of which can represent the user's historical conversation information and the analysis results such as the timestamp and semantic information of the historical conversation information. For each piece of historical conversation information, a separate historical memory object is generated for storage. Based on the analysis results of the historical memory object, the historical memory object associated with the current conversation information is determined from the historical conversation database as the target memory object. The user is replied to in combination with the target memory object. By generating historical memory objects, the interception of long historical conversations is reduced, the memory capacity is improved, and the historical information related to the current conversation can be retrieved more accurately, thereby improving the accuracy and efficiency of human-computer interaction and enhancing the user's interactive experience.
[0098] Figure 3 A flowchart of a human-computer interaction method based on historical dialogue provided in an embodiment of the present disclosure.
[0099] In this embodiment, the reply information of the current dialogue information is determined according to the target memory object, including: inputting the target memory object and the current dialogue information into a preset large language model to obtain the reply information of the current dialogue information; wherein the preset large language model is a neural network model, which is used to communicate with the user during human-computer interaction.
[0100] like Figure 3 As shown, the method comprises the following steps:
[0101] S301. Obtain the user's current conversation information and a historical conversation database; wherein the historical conversation database includes a plurality of historical memory objects, the historical memory objects represent the user's historical conversation information and analysis results of the historical conversation information, the analysis results including the timestamp and semantic information of the historical conversation information.
[0102] Exemplarily, this step may refer to the above-mentioned step S101 and will not be described in detail.
[0103] S302: Determine, from the historical conversation database, a historical memory object associated with the current conversation information as a target memory object.
[0104] Exemplarily, this step may refer to the above-mentioned step S102 and will not be described in detail.
[0105] S303, inputting the target memory object and the current dialogue information into a preset large language model to obtain reply information of the current dialogue information; wherein the preset large language model is a neural network model, which is used to communicate with the user during human-computer interaction.
[0106] Exemplarily, an LLM model is pre-set. After obtaining the target memory object, the target memory object and the current dialogue information can be input into the preset LLM model, and the LLM model outputs the reply information of the current dialogue information. The LLM model is a pre-built and trained neural network model, which can be used to communicate with the user during human-computer interaction and answer questions raised by the user. In this embodiment, the model structure of LLM is not specifically limited.
[0107] For example, the prompt of the LLM model can be generated based on the target memory object and the current dialogue information. LLM performs semantic analysis on the prompt and can also refer to the context of the current dialogue information to obtain the reply information of the current dialogue information. For example, the current dialogue information is "What is the route to community A?", but there is a community A in city B and a community A in city C. If the historical dialogue information in the target memory object mentions community A in city B, then the reply information can be the route to community A in city B.
[0108] In this embodiment, the large language model can combine the current dialogue information and the target memory object to automatically generate reply information, and by using the target memory object, the LLM can more accurately understand the user's intention, improve the response quality, and enhance the user experience.
[0109] In the disclosed embodiment, when a user is performing human-computer interaction, he or she can obtain the current conversation information and the historical conversation database in real time. The historical conversation database may include multiple historical memory objects, each of which can represent the user's historical conversation information and the analysis results such as the timestamp and semantic information of the historical conversation information. For each piece of historical conversation information, a separate historical memory object is generated for storage. Based on the analysis results of the historical memory object, the historical memory object associated with the current conversation information is determined from the historical conversation database as the target memory object. The user is replied to in combination with the target memory object. By generating historical memory objects, the interception of long historical conversations is reduced, the memory capacity is improved, and the historical information related to the current conversation can be retrieved more accurately, thereby improving the accuracy and efficiency of human-computer interaction and enhancing the user's interactive experience.
[0110] Figure 4This is a structural block diagram of a human-computer interaction device based on historical dialogue provided by an embodiment of the present disclosure. For the sake of convenience, only the parts related to the embodiment of the present disclosure are shown. Figure 4 The human-computer interaction device 400 based on historical dialogue includes: an acquisition unit 401, a target determination unit 402 and a reply determination unit 403.
[0111] The acquisition unit 401 is used to acquire the user's current conversation information and a historical conversation database; wherein the historical conversation database includes a plurality of historical memory objects, and the historical memory objects represent the user's historical conversation information and the analysis results of the historical conversation information, and the analysis results include the timestamp and semantic information of the historical conversation information;
[0112] A target determination unit 402 is used to determine, from the historical conversation database, a historical memory object associated with the current conversation information as a target memory object;
[0113] The reply determination unit 403 is used to determine the reply information of the current dialogue information according to the target memory object.
[0114] Figure 5 A structural block diagram of a human-computer interaction device based on historical dialogue provided by an embodiment of the present disclosure, such as Figure 5 As shown, the human-computer interaction device 500 based on historical dialogue includes an acquisition unit 501, a target determination unit 502 and a reply determination unit 503, wherein the target determination unit 502 includes a first determination module 5021 and a second determination module 5022.
[0115] The first determination module 5021 is used to determine the association value between each historical memory object and the current dialogue information in the historical dialogue database; wherein the association value represents the degree of association between the historical memory object and the current dialogue information;
[0116] The second determination module 5022 is used to determine the target memory object from the historical conversation database according to the associated value corresponding to each historical memory object.
[0117] In one example, the first determining module 5021 includes:
[0118] A first determination submodule is used to determine the distance value between the historical memory object and the current dialogue information according to the timestamp of the historical memory object; wherein the distance value represents the time distance between the historical memory object and the current dialogue information;
[0119] A second determination submodule is used to determine a correlation value between the historical memory object and the current dialogue information according to the semantic information of the historical memory object; wherein the correlation value represents the degree of semantic correlation between the historical dialogue information represented by the historical memory object and the current dialogue information;
[0120] The third determination submodule is used to determine the association value between the historical memory object and the current dialogue information according to the distance value and the correlation value corresponding to the historical memory object.
[0121] In one example, the semantic information includes an emotion tag, and the emotion tag represents the emotion expressed by the historical conversation information represented by the historical memory object; the second determination submodule is specifically used to:
[0122] Performing sentiment analysis on the current conversation information to obtain sentiment information of the current conversation information;
[0123] Determining the similarity between the emotion information of the current conversation information and the emotion label of the historical memory object;
[0124] According to the similarity, a correlation value between the historical memory object and the current dialogue information is determined.
[0125] In one example, the third determination submodule is specifically used for:
[0126] Determining the sentence structure of the historical conversation information represented by the historical memory object; wherein the sentence structure represents the grammar and word order of the historical conversation information;
[0127] Determining the importance value of the historical memory object according to the sentence structure; wherein the importance value represents the grammatical fluency and contextual importance of the historical conversation information represented by the historical memory object;
[0128] The association value between the historical memory object and the current dialog information is determined according to the distance value, the correlation value, and the importance value corresponding to the historical memory object.
[0129] In one example, it also includes:
[0130] A number determination unit, used to determine the number of occurrences of the historical conversation information represented by the historical memory object in the historical conversation database;
[0131] The importance value adjustment unit is used to adjust the importance value of the historical memory object according to the number of occurrences.
[0132] In one example, the third determination submodule is specifically used for:
[0133] The distance value, the correlation value, and the importance value corresponding to the historical memory object are weighted, and the result of the weighted processing is determined as the association value between the historical memory object and the current dialogue information.
[0134] In one example, it also includes:
[0135] A timestamp determination unit, used to determine the sending time of the current conversation information, and determine the sending time as the timestamp of the current conversation information;
[0136] A semantic determination unit, configured to perform semantic analysis on the current dialogue information to obtain semantic information of the current dialogue information;
[0137] A result determination unit, configured to determine the timestamp of the current conversation information and the semantic information of the current conversation information as the analysis result of the current conversation information;
[0138] The storage unit is used to determine the current dialogue information and the analysis result of the current dialogue information as new historical memory objects, and store them in the historical dialogue database.
[0139] In one example, it also includes:
[0140] A conversation determination unit, configured to determine, in the historical conversation database, a previous conversation information of the current conversation information;
[0141] The identifier adding unit is used to mark the current dialogue information and the previous dialogue information of the current dialogue information with a preset logical identifier; wherein the preset logical identifier represents that there is a logical structure and time sequence between the two dialogue messages.
[0142] In one example, the reply determination unit 503 includes:
[0143] The model reply module is used to input the target memory object and the current dialogue information into a preset large language model to obtain reply information of the current dialogue information; wherein the preset large language model is a neural network model, which is used to communicate with the user during human-computer interaction.
[0144] In one example, it also includes:
[0145] A timestamp acquisition unit, used to acquire the timestamp of the historical memory object in the historical conversation database according to a preset information update cycle;
[0146] A database updating unit is used to delete the historical memory object from the historical conversation database if it is determined based on the timestamp of the historical memory object that the storage time of the historical memory object in the historical conversation database exceeds a preset time threshold.
[0147] Figure 6 A structural block diagram of an electronic device provided in an embodiment of the present disclosure, such as Figure 6 As shown, the electronic device 600 includes: at least one processor 602; and a memory 601 communicatively connected to the at least one processor 602; wherein the memory stores instructions executable by the at least one processor 602, and the instructions are executed by the at least one processor 602 so that the at least one processor 602 can execute the human-computer interaction method based on historical dialogue disclosed in the present invention.
[0148] The electronic device 600 further includes a receiver 603 and a transmitter 604. The receiver 603 is used to receive instructions and data sent by other devices, and the transmitter 604 is used to send instructions and data to external devices.
[0149] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium and a computer program product.
[0150] According to an embodiment of the present disclosure, the present disclosure also provides a computer program product, which includes: a computer program, the computer program is stored in a readable storage medium, at least one processor of an electronic device can read the computer program from the readable storage medium, and at least one processor executes the computer program so that the electronic device executes the solution provided by any of the above embodiments.
[0151] Figure 7 A schematic block diagram of an example electronic device 700 that can be used to implement an embodiment of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, 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 processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.
[0152] like Figure 7As shown, the device 700 includes a computing unit 701, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 702 or a computer program loaded from a storage unit 708 into a random access memory (RAM) 703. In the RAM 703, various programs and data required for the operation of the device 700 can also be stored. The computing unit 701, the ROM 702, and the RAM 703 are connected to each other via a bus 704. An input / output (I / O) interface 705 is also connected to the bus 704.
[0153] A number of components in the device 700 are connected to the I / O interface 705, including: an input unit 706, such as a keyboard, a mouse, etc.; an output unit 707, such as various types of displays, speakers, etc.; a storage unit 708, such as a disk, an optical disk, etc.; and a communication unit 709, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 709 allows the device 700 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0154] The computing unit 701 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 701 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 701 performs the various methods and processes described above, such as a human-computer interaction method based on historical dialogues. For example, in some embodiments, the human-computer interaction method based on historical dialogues may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit 708. In some embodiments, part or all of the computer program may be loaded and / or installed on the device 700 via the ROM 702 and / or the communication unit 709. When the computer program is loaded into the RAM 703 and executed by the computing unit 701, one or more steps of the human-computer interaction method based on historical dialogues described above may be performed. Alternatively, in other embodiments, the computing unit 701 may be configured to execute the human-computer interaction method based on historical dialogue in any other appropriate manner (eg, by means of firmware).
[0155] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0156] The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0157] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0158] To provide interaction with a user, the systems and techniques described herein 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 pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the 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 input, voice input, or tactile input).
[0159] The systems and techniques described herein may be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system may 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), and the Internet.
[0160] A computer system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship between the client and the server is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may 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 difficult management and weak business scalability in traditional physical hosts and VPS services ("Virtual Private Server", or "VPS" for short). The server may also be a server of a distributed system, or a server combined with a blockchain.
[0161] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this disclosure can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and this document does not limit this.
[0162] The above specific implementations do not constitute a limitation on the protection scope of the present disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present disclosure shall be included in the protection scope of the present disclosure.
Claims
1. A human-computer interaction method based on historical dialogue, comprising: Acquire the user's current conversation information and a historical conversation database; wherein the historical conversation database includes a plurality of historical memory objects, the historical memory objects represent the user's historical conversation information and analysis results of the historical conversation information, the analysis results include timestamps and semantic information of the historical conversation information; Determining, from the historical conversation database, a historical memory object associated with the current conversation information as a target memory object; According to the target memory object, reply information of the current dialogue information is determined.
2. The method according to claim 1, wherein: The step of determining, from the historical conversation database, a historical memory object associated with the current conversation information as a target memory object comprises: Determine an association value between each historical memory object and the current conversation information in the historical conversation database; wherein the association value represents the degree of association between the historical memory object and the current conversation information; The target memory object is determined from the historical conversation database according to the associated values corresponding to the historical memory objects.
3. The method according to claim 2, wherein: The determining of the association value between each historical memory object and the current conversation information in the historical conversation database includes: Determine the distance value between the historical memory object and the current conversation information according to the timestamp of the historical memory object; wherein the distance value represents the time distance between the historical memory object and the current conversation information; Determine, based on the semantic information of the historical memory object, a correlation value between the historical memory object and the current conversation information; wherein the correlation value represents the degree of semantic correlation between the historical conversation information represented by the historical memory object and the current conversation information; According to the distance value and the correlation value corresponding to the historical memory object, the association value between the historical memory object and the current dialogue information is determined.
4. The method according to claim 3, wherein: The semantic information includes an emotion tag, and the emotion tag represents the emotion expressed by the historical conversation information represented by the historical memory object; and determining the correlation value between the historical memory object and the current conversation information according to the semantic information of the historical memory object includes: Performing sentiment analysis on the current conversation information to obtain sentiment information of the current conversation information; Determining the similarity between the emotion information of the current conversation information and the emotion label of the historical memory object; According to the similarity, a correlation value between the historical memory object and the current dialogue information is determined.
5. The method according to claim 3 or 4, wherein: The determining, according to the distance value and the correlation value corresponding to the historical memory object, the association value between the historical memory object and the current dialogue information comprises: Determining the sentence structure of the historical conversation information represented by the historical memory object; wherein the sentence structure represents the grammar and word order of the historical conversation information; Determining the importance value of the historical memory object according to the sentence structure; wherein the importance value represents the grammatical fluency and contextual importance of the historical conversation information represented by the historical memory object; The association value between the historical memory object and the current dialog information is determined according to the distance value, the correlation value, and the importance value corresponding to the historical memory object.
6. The method according to claim 5, further comprising: Determine the number of occurrences of the historical conversation information represented by the historical memory object in the historical conversation database; According to the number of occurrences, the importance value of the historical memory object is adjusted.
7. The method according to claim 6, wherein: Determining the association value between the historical memory object and the current dialogue information according to the distance value, the correlation value, and the importance value corresponding to the historical memory object includes: The distance value, the correlation value, and the importance value corresponding to the historical memory object are weighted, and the result of the weighted processing is determined as the association value between the historical memory object and the current dialogue information.
8. The method according to any one of claims 1 to 7, further comprising: Determine the sending time of the current conversation information, and determine the sending time as the timestamp of the current conversation information; Performing semantic analysis on the current conversation information to obtain semantic information of the current conversation information; Determining the timestamp of the current conversation information and the semantic information of the current conversation information as the analysis result of the current conversation information; The current dialogue information and the analysis result of the current dialogue information are determined as new historical memory objects and stored in the historical dialogue database.
9. The method according to claim 8, further comprising: Determining, in the historical conversation database, a conversation information previous to the current conversation information; A preset logical identifier is marked in the current dialogue information and the previous dialogue information of the current dialogue information; wherein the preset logical identifier indicates that there is a logical structure and a time sequence between the two dialogue information.
10. The method according to any one of claims 1 to 9, wherein: The step of determining the reply information of the current dialogue information according to the target memory object includes: The target memory object and the current dialogue information are input into a preset large language model to obtain reply information of the current dialogue information; wherein the preset large language model is a neural network model, which is used to communicate with the user during human-computer interaction.
11. The method according to any one of claims 1 to 10, further comprising: According to a preset information update cycle, obtaining the timestamp of the historical memory object in the historical conversation database; If it is determined based on the timestamp of the historical memory object that the storage time of the historical memory object in the historical conversation database exceeds a preset time threshold, the historical memory object is deleted from the historical conversation database.
12. A human-computer interaction device based on historical dialogue, comprising: An acquisition unit, configured to acquire the user's current conversation information and a historical conversation database; wherein the historical conversation database includes a plurality of historical memory objects, wherein the historical memory objects represent the user's historical conversation information and an analysis result of the historical conversation information, wherein the analysis result includes a timestamp and semantic information of the historical conversation information; a target determination unit, configured to determine, from the historical conversation database, a historical memory object associated with the current conversation information as a target memory object; The reply determination unit is used to determine the reply information of the current dialogue information according to the target memory object.
13. The device according to claim 12, wherein: The target determination unit comprises: A first determination module is used to determine the association value between each historical memory object and the current dialogue information in the historical dialogue database; wherein the association value represents the degree of association between the historical memory object and the current dialogue information; The second determination module is used to determine the target memory object from the historical conversation database according to the associated value corresponding to each historical memory object.
14. The device according to claim 13, wherein: The first determining module includes: A first determination submodule is used to determine the distance value between the historical memory object and the current dialogue information according to the timestamp of the historical memory object; wherein the distance value represents the time distance between the historical memory object and the current dialogue information; A second determination submodule is used to determine a correlation value between the historical memory object and the current dialogue information according to the semantic information of the historical memory object; wherein the correlation value represents the degree of semantic correlation between the historical dialogue information represented by the historical memory object and the current dialogue information; The third determination submodule is used to determine the association value between the historical memory object and the current dialogue information according to the distance value and the correlation value corresponding to the historical memory object.
15. The device according to claim 14, wherein: The semantic information includes an emotion tag, and the emotion tag represents the emotion expressed by the historical conversation information represented by the historical memory object; the second determination submodule is specifically used to: Performing sentiment analysis on the current conversation information to obtain sentiment information of the current conversation information; Determining the similarity between the emotion information of the current conversation information and the emotion label of the historical memory object; According to the similarity, a correlation value between the historical memory object and the current dialogue information is determined.
16. The device according to claim 14 or 15, wherein: The third determining submodule is specifically used for: Determining the sentence structure of the historical conversation information represented by the historical memory object; wherein the sentence structure represents the grammar and word order of the historical conversation information; Determining the importance value of the historical memory object according to the sentence structure; wherein the importance value represents the grammatical fluency and contextual importance of the historical conversation information represented by the historical memory object; The association value between the historical memory object and the current dialog information is determined according to the distance value, the correlation value, and the importance value corresponding to the historical memory object.
17. The apparatus according to claim 16, further comprising: A number determination unit, used to determine the number of occurrences of the historical conversation information represented by the historical memory object in the historical conversation database; The importance value adjustment unit is used to adjust the importance value of the historical memory object according to the number of occurrences.
18. The device according to claim 17, wherein: The third determining submodule is specifically used for: The distance value, the correlation value, and the importance value corresponding to the historical memory object are weighted, and the result of the weighted processing is determined as the association value between the historical memory object and the current dialogue information.
19. The apparatus according to any one of claims 12 to 18, further comprising: A timestamp determination unit, used to determine the sending time of the current conversation information, and determine the sending time as the timestamp of the current conversation information; A semantic determination unit, configured to perform semantic analysis on the current dialogue information to obtain semantic information of the current dialogue information; A result determination unit, configured to determine the timestamp of the current conversation information and the semantic information of the current conversation information as the analysis result of the current conversation information; The storage unit is used to determine the current dialogue information and the analysis result of the current dialogue information as new historical memory objects, and store them in the historical dialogue database.
20. The apparatus according to claim 19, further comprising: A conversation determination unit, configured to determine, in the historical conversation database, a previous conversation information of the current conversation information; The identifier adding unit is used to mark the current dialogue information and the previous dialogue information of the current dialogue information with a preset logical identifier; wherein the preset logical identifier represents that there is a logical structure and time sequence between the two dialogue messages.
21. The device according to any one of claims 12 to 20, wherein: The reply determination unit comprises: The model reply module is used to input the target memory object and the current dialogue information into a preset large language model to obtain reply information of the current dialogue information; wherein the preset large language model is a neural network model, which is used to communicate with the user during human-computer interaction.
22. The apparatus according to any one of claims 12 to 21, further comprising: A timestamp acquisition unit, used to acquire the timestamp of the historical memory object in the historical conversation database according to a preset information update cycle; A database updating unit is used to delete the historical memory object from the historical conversation database if it is determined based on the timestamp of the historical memory object that the storage time of the historical memory object in the historical conversation database exceeds a preset time threshold.
23. An electronic device, comprising: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed 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 method according to any one of claims 1 to 11.
24. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to cause the computer to execute the method according to any one of claims 1-11.
25. A computer program product, wherein: The invention comprises a computer program, which implements the steps of the method according to any one of claims 1 to 11 when being executed by a processor.
Citation Information
Patent Citations
Man-machine interaction method, device and system and medium
CN116187346A
Conversation processing method and device and related equipment
CN117763123A
Conversation processing method and device, electronic equipment and storage medium
CN117932036A
Human-computer interaction method and device, electronic equipment and storage medium
CN118098217A
Cited By
Conversational interaction method, device and system based on large model
CN119311808A
Inference question and answer method and device based on logic mode prompt
CN120317357A
Commodity information global association method and system in multi-round dialogue process
CN120804275A
Method and system for globally associating commodity information in multi-round dialogue process
CN120804275B
Memory processing method based on intelligent agent, storage medium and electronic device
CN121168679A
