Game dialogue processing method and device, equipment and storage medium
By using the game dialogue double tower model to perform feature fusion and semantic coding processing of the current game state and historical dialogue in the game field, the problems of dialogue mismatch and dissolution in the existing technology are solved, and more efficient game dialogue replies are achieved and better interactive experience.
Patent Information
- Application Number
- CN202411387108.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-30
- Publication Date
- 2025-02-18
AI Technical Summary
Existing dialogue robots have difficulty understanding the game intentions in the gaming field, resulting in unfit and unsmooth dialogue reply, affecting the interactive experience of gamers.
The game dialogue double tower model is adopted to fusion the current game state features and historical dialogues through the left tower network to generate multimodal fusion coded vectors; the right tower network is used to vectorize candidate statements in the preset dialogue library to obtain Semantically encoded vectors; then filter out appropriate conversation replies based on similarity.
It improves the adaptability and fluency of game conversation replies, enhances the understanding of players' game intentions, and improves the game interactive experience.
Smart Images

Figure CN119474264A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of artificial intelligence technology, and in particular to a game dialogue processing method, device, equipment and storage medium. Background Art
[0002] With the in-depth research of artificial intelligence, conversational robot technology has been widely used in vertical fields. For example, conversational robots are applied to the medical field to help patients answer questions about diseases, drugs, treatment plans, etc., and conversational robots are applied to the financial field to provide customers with investment consulting, financial advice and other services. Conversational robots are applied to the education field to help students answer learning problems and provide personalized learning suggestions. Applying conversational robots to the game field is also an important research direction.
[0003] At present, conversational robots generate dialogue responses based on single-modal dialogue text. When applied to the gaming field, they have the defect of difficulty in understanding the game intention in terms of game interaction, and are unable to generate smooth dialogue responses that fit the game scene, affecting the game interaction experience of game players.
[0004] Therefore, how to improve the adaptability and fluency of game dialogue responses to enhance the game interaction experience has become a technical problem that needs to be solved urgently. Summary of the invention
[0005] The main purpose of the embodiments of the present application is to propose a game dialogue processing method, device, equipment and storage medium, aiming to improve the adaptability and fluency of game dialogue replies to improve the game interaction experience.
[0006] To achieve the above-mentioned purpose, a first aspect of an embodiment of the present application proposes a game dialogue processing method, the method comprising:
[0007] Get the current game state characteristics and historical dialogue of the target game;
[0008] Calling a game dialogue dual-tower model pre-trained for the target game, wherein the trained game dialogue dual-tower model includes a trained left tower network and a trained right tower network;
[0009] Through the trained Zuota network, feature fusion processing is performed on the current game state features and historical dialogues to obtain a multimodal fusion coding vector;
[0010] Using the trained right tower network, vectorizing each candidate sentence in the preset dialogue library of the target game to obtain a semantic encoding vector of each candidate sentence;
[0011] Obtaining the similarity between the multimodal fusion encoding vector and the semantic encoding vector;
[0012] According to the similarity, a target candidate sentence is screened out from the preset candidate dialogue library, and the target candidate sentence is used as a dialogue reply of the historical dialogue.
[0013] To achieve the above-mentioned purpose, a second aspect of an embodiment of the present application provides a game dialogue processing device, the device comprising:
[0014] The data acquisition module is used to obtain the current game status characteristics and historical dialogues of the target game;
[0015] A model calling module, used to call a game dialogue dual-tower model pre-trained for the target game, wherein the trained game dialogue dual-tower model includes a trained left tower network and a trained right tower network;
[0016] A feature fusion module is used to perform feature fusion processing on the current game state features and historical dialogues through the trained Zuota network to obtain a multimodal fusion coding vector;
[0017] A sentence vectorization module, used to perform vectorization processing on each candidate sentence in the preset dialogue library of the target game through the trained right tower network, so as to obtain a semantic encoding vector of each candidate sentence;
[0018] A similarity acquisition module, used to acquire the similarity between the multimodal fusion encoding vector and the semantic encoding vector;
[0019] The dialogue reply screening module is used to screen out target candidate sentences from the preset candidate dialogue library according to the similarity, and use the target candidate sentences as dialogue replies for the historical dialogue.
[0020] To achieve the above-mentioned purpose, the third aspect of an embodiment of the present application proposes a computer device, which includes a memory and a processor, the memory stores a computer program, and the processor implements the method described in the first aspect when executing the computer program.
[0021] To achieve the above-mentioned purpose, the fourth aspect of an embodiment of the present application proposes a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method described in the first aspect is implemented.
[0022] The game dialogue processing method, device, equipment and storage medium proposed in the present application, the game dialogue processing method obtains the current game state features and historical dialogues of the target game; calls the game dialogue dual-tower model pre-trained for the target game, wherein the trained game dialogue dual-tower model includes a trained left-tower network and a trained right-tower network; performs feature fusion processing on the current game state features and historical dialogues through the trained left-tower network to obtain a multimodal fusion coding vector; performs vectorization processing on each candidate sentence in the preset dialogue library of the target game through the trained right-tower network to obtain a semantic coding vector for each candidate sentence; obtains the similarity between the multimodal fusion coding vector and the semantic coding vector; based on the similarity, screens out the target candidate sentence from the preset candidate dialogue library, and uses the target candidate sentence as a dialogue reply for the historical dialogue. In this way, through the trained game dialogue dual-tower model, the current game state features and historical dialogues are cross-modally fused to represent and obtain a multimodal fusion coding vector. This can make full use of the contextual information provided by the current game state features and historical dialogues, and realize the fusion of the understanding of the current game state features and historical dialogues. It provides more comprehensive and richer information for better understanding the player's game intentions, so that based on the multimodal fusion coding vector, dialogue replies that meet the game intentions can be quickly screened out from the preset dialogue library, thereby improving the adaptability and fluency of the game dialogue replies, and thus improving the player's game interaction experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] Figure 1 is a flowchart of a game dialogue processing method provided by an embodiment of the present application;
[0024] Figure 2 It is a schematic diagram of the training architecture of the preset game dialogue twin tower model provided in the embodiment of the present application;
[0025] Figure 3 It is a schematic diagram of the architecture of the game dialogue processing system provided in an embodiment of the present application;
[0026] Figure 4 is a schematic block diagram of a game dialogue processing device provided in an embodiment of the present application;
[0027] Figure 5 It is a schematic block diagram of the structure of the computer device provided in the embodiment of the present application. DETAILED DESCRIPTION
[0028] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0029] It should be noted that, although the functional modules are divided in the device schematic diagram and the logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than the module division in the device or the order in the flowchart. The terms "first", "second", etc. in the specification, claims and the above drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.
[0030] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.
[0031] First, some nouns involved in this application are analyzed:
[0032] Artificial intelligence (AI) is a new technical science that studies and develops theories, methods, technologies and application systems for simulating, extending and expanding human intelligence. AI is a branch of computer science that attempts to understand the essence of intelligence and produce a new type of intelligent machine that can respond in a similar way to human intelligence. Research in this field includes robotics, speech recognition, image recognition, natural language processing and expert systems. AI can simulate the information process of human consciousness and thinking. AI is also a theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results.
[0033] Natural language processing (NLP): NLP uses computers to process, understand and apply human languages (such as Chinese, English, etc.). NLP is a branch of artificial intelligence and an interdisciplinary subject between computer science and linguistics. It is often referred to as computational linguistics. Natural language processing includes grammatical analysis, semantic analysis, and text understanding. Natural language processing is often used in technical fields such as machine translation, handwritten and printed character recognition, speech recognition and text-to-speech conversion, information intent recognition, information extraction and filtering, text classification and clustering, public opinion analysis and opinion mining. It involves data mining related to language processing, machine learning, knowledge acquisition, knowledge engineering, artificial intelligence research, and linguistic research related to language computing.
[0034] Target game: can be a multiplayer game, such as a Multiplayer Online Battle Arena (MOBA) game. MOBA games are a type of electronic game, usually based on teams, where multiple players compete in a virtual arena, so there is a need for dialogue and interaction between teammates among multiple players.
[0035] Game dialogue dual-tower model: It can be a multimodal pre-training model based on contrastive learning (Contrastive Language-Image Pretraining, CLIP). The CLIP model is a dual-tower structure, including a left-tower network and a right-tower network. The left-tower network is based on the multimodal Transformer architecture, and the right-tower network is based on the lightweight BERT (Distil-Bidirectional Encoder Representations from Transformers, Distil-BERT) architecture.
[0036] Distil-BERT: is a lightweight variant based on BERT (Bidirectional Encoder Representations from Transformers), which provides similar functions to BERT, but is optimized in terms of speed and resource usage, with a smaller size and faster inference speed.
[0037] Preset dialogue library: It is a dialogue library designed for the target game during the target game design phase. The preset dialogue library covers dialogue sentences that are consistent with various possible game scenarios. These dialogue sentences serve as candidate sentences for game dialogues.
[0038] In the related technology, the conversation robot applied to the game field is equipped with a game conversation model. The training of the game conversation model often requires a large amount of real conversation corpus in the game field as training data. However, in reality, there is relatively little real conversation corpus, and there is no relevant open source data. The quality of the training data is not high, resulting in poor training results for the game conversation model, affecting the adaptability and fluency of the game conversation responses.
[0039] Based on this, the embodiments of the present application provide a game dialogue processing method, device, equipment and storage medium, which aim to improve the adaptability and fluency of game dialogue replies to improve the game interaction experience.
[0040] The game dialogue processing method, device, equipment and storage medium provided in the embodiments of the present application are specifically illustrated through the following embodiments. First, the game dialogue processing method in the embodiments of the present application is described.
[0041] The embodiments of the present application can acquire and process relevant data based on artificial intelligence technology. Among them, artificial intelligence (AI) is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results.
[0042] AI basic technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing technology, operation / interaction systems, mechatronics, etc. AI software technologies mainly include computer vision technology, robotics technology, biometrics technology, speech processing technology, natural language processing technology, and machine learning / deep learning.
[0043] The game dialogue processing method provided in the embodiment of the present application relates to the field of artificial intelligence technology. The game dialogue processing method provided in the embodiment of the present application can be applied to the terminal, can also be applied to the server side, and can also be software running in the terminal or the server side. In some embodiments, the terminal can be a vehicle-mounted terminal, a smart phone, a tablet computer, a laptop computer, a desktop computer, etc.; the server side can be configured as an independent physical server, or a server cluster or distributed system composed of multiple physical servers, and can also be configured as a cloud server that provides cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms and other basic cloud computing services; the software can be an application that implements the game dialogue processing method, etc., but is not limited to the above forms.
[0044] The present application can be used in many general or special computer system environments or configurations. For example: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer computer devices, network PCs, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, etc. The present application can be described in the general context of computer executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. The present application can also be practiced in distributed computing environments, in which tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media including storage devices.
[0045] It should be noted that in each specific implementation of the present application, when it comes to the need to perform relevant processing based on data related to user identity or characteristics such as user information, user behavior data, user historical data, and user location information, the user's permission or consent will be obtained first, and the collection, use, and processing of these data will comply with relevant laws, regulations, and standards. In addition, when the embodiment of the present application needs to obtain the user's sensitive personal information, the user's separate permission or consent will be obtained through a pop-up window or by jumping to a confirmation page. After clearly obtaining the user's separate permission or consent, the necessary user-related data for the normal operation of the embodiment of the present application will be obtained.
[0046] Figure 1 is an optional flowchart of the game dialogue processing method provided in an embodiment of the present application. Figure 1 The method may include but is not limited to steps S101 to S106.
[0047] Step S101, obtaining the current game status characteristics and historical dialogues of the target game.
[0048] Respond to a dialog service request in the target game and obtain the current game state and historical dialogs.
[0049] Among them, the current game status covers specific status data such as the character status, game environment, game progress, etc. at the current moment, such as the values of key elements such as heroes, wild monsters, towers, and military lines, as well as values such as health and position.
[0050] The feature extraction can be performed on the current game state of the target game to obtain the current game state feature.
[0051] The historical conversation can be a conversation record of the player within a time window before the previous moment, wherein the size of the time window can be flexibly set according to actual needs, such as the conversation record within the past 5 minutes. It is understandable that the historical conversation provides context information for the conversation reply.
[0052] Step S102, calling a game dialogue dual-tower model pre-trained for a target game, wherein the trained game dialogue dual-tower model includes a trained left tower network and a trained right tower network.
[0053] The trained game dialogue twin tower model can be a trained CLIP model.
[0054] Among them, the trained CLIP model includes a trained left tower network based on the multimodal Transformer architecture and a trained right tower network based on the Distil-BERT architecture.
[0055] Step S103, through the trained Zuota network, feature fusion processing is performed on the current game state features and historical dialogues to obtain a multimodal fusion coding vector.
[0056] In order to better understand the player's gaming intentions, the current game state features and historical conversations are input into the trained Zuota network. Through the self-attention mechanism of the multimodal Transformer architecture, the current game state features and historical conversations of the target game are fused to obtain a multimodal fusion encoding vector.
[0057] The multimodal fusion encoding vector is a joint representation of the current game state features and contextual information. In this way, the trained Zuota network can capture the semantic correlation information between the two different modalities of the current game state features and contextual information, thereby integrating the current game state features with the understanding of historical conversations.
[0058] Step S104, using the trained right tower network, vectorize each candidate sentence in the preset dialogue library of the target game to obtain a semantic encoding vector of each candidate sentence.
[0059] Through the trained right tower network, each candidate sentence in the preset dialogue library is vectorized to obtain the semantic encoding vector of each candidate sentence.
[0060] Step S105, obtaining the similarity between the multimodal fusion coding vector and the semantic coding vector.
[0061] Afterwards, the cosine distance between the multimodal fusion encoding vector and the semantic encoding vector of each candidate sentence is calculated, and the cosine distance is used as the similarity between the multimodal fusion encoding vector and the semantic encoding vector, providing an accurate basis for screening out target candidate sentences that fit the game intent from the preset dialogue library.
[0062] Step S106, based on the similarity, select the target candidate sentence from the preset candidate dialogue library, and use the target candidate sentence as a dialogue reply of the historical dialogue.
[0063] Finally, based on the similarity, the target candidate sentence is filtered out from the preset candidate dialogue library, and the target candidate sentence is used as the dialogue response of the historical dialogue.
[0064] The game dialogue processing method provided in the above embodiment obtains the current game state features and historical dialogues of the target game; calls a game dialogue dual-tower model pre-trained for the target game, wherein the trained game dialogue dual-tower model includes a trained left-tower network and a trained right-tower network; performs feature fusion processing on the current game state features and historical dialogues through the trained left-tower network to obtain a multimodal fusion coding vector; performs vectorization processing on each candidate sentence in the preset dialogue library of the target game through the trained right-tower network to obtain a semantic coding vector for each candidate sentence; obtains the similarity between the multimodal fusion coding vector and the semantic coding vector; based on the similarity, screens out the target candidate sentence from the preset candidate dialogue library, and uses the target candidate sentence as a dialogue reply to the historical dialogue. In this way, through the trained game dialogue dual-tower model, the current game state features and historical dialogues are cross-modally fused to represent and obtain a multimodal fusion coding vector. This can make full use of the contextual information provided by the current game state features and historical dialogues, and realize the fusion of the understanding of the current game state features and historical dialogues. It provides more comprehensive and richer information for better understanding the player's game intentions, so that based on the multimodal fusion coding vector, dialogue replies that meet the game intentions can be quickly screened out from the preset dialogue library, thereby improving the adaptability and fluency of the game dialogue replies, and thus improving the player's game interaction experience.
[0065] In step S103 of some embodiments, the current game state features and historical conversations can be used as inputs of the trained Zuota network; the current game state features are embedded to obtain a state block feature vector, and the historical conversations are embedded to obtain a text feature vector; the state block feature vector and the text feature vector are fused through the multimodal Transformer architecture of the trained Zuota network to obtain a multimodal fusion encoding vector.
[0066] The current game state features and historical dialogues are input into the trained Zuota network. In the trained Zuota network, the current game state features are subjected to patch embedding processing (Patch Embeddings) to convert the current game state features into state block feature vectors, which helps to capture the deep information of the current game state features.
[0067] In addition, in the trained Zuota network, text embedding is performed on the historical conversations to convert them into text feature vectors, which helps capture the contextual information of the historical conversations.
[0068] Then, through the multimodal Transformer architecture, the self-attention mechanism is used to perform cross-modal fusion processing on the state block feature vector and the text feature vector to obtain a multimodal fusion encoding vector, providing more comprehensive and richer information for subsequent dialogue responses.
[0069] In step S106 of some embodiments, candidate sentences having a similarity greater than a preset similarity threshold may be screened out from a preset dialogue library; the screened out candidate sentences may be filtered to obtain recommended candidate sentences; and target candidate sentences may be screened out from the recommended candidate sentences.
[0070] The similarity between the multimodal fusion encoding vector and the semantic encoding vector of each candidate sentence is compared with a preset similarity threshold, and the candidate sentences with similarity greater than the preset similarity threshold are screened out. The screened candidate sentences are then filtered to obtain recommended candidate sentences.
[0071] Among them, the selected candidate sentences can be filtered according to the preset dialogue filtering rules, which include: filtering out sentences in the player's blacklist; filtering out sentences of heroes that do not exist in the current game; filtering out sentences similar to past historical dialogues; filtering out sentences that mention the name and profession of the main hero; filtering out the name and profession of a hero that are frequently mentioned (to prevent negative emotions from being expressed against the hero); filtering according to the emotional polarity of the sentence, filtering out sentences with frequently occurring negative emotions, thereby obtaining recommended candidate sentences, which can further narrow the screening range of the dialogue replies. It is understandable that the number of candidate recommended sentences is multiple.
[0072] Afterwards, the target candidate sentence is selected from the recommended candidate sentences with a smaller screening range as a dialogue response, thereby improving the efficiency of screening dialogue responses.
[0073] In some embodiments, filtering out target candidate sentences from recommended candidate sentences may be by obtaining correlation scores between current game state features and historical conversations and recommended candidate sentences; arranging the recommended candidate sentences in descending order according to the correlation scores to obtain a sequence of recommended candidate sentences; and taking the first recommended candidate sentence in the sequence of recommended candidate sentences as the target candidate sentence.
[0074] The trained re-ranking model can be used to obtain the correlation scores between the current game state features and historical dialogues and the recommended candidate sentences.
[0075] The architecture of the reordering model is the same as that of the right tower network, which is the Distil-BERT architecture, but the inputs of the two are different. Specifically, the recommended candidate sentences can be spliced after the current game state features and historical dialogues, and separated by a separator " <sep>"The historical dialogue is separated from the recommended candidate sentences. In this way, the spliced current game state features, historical dialogues and recommended candidate sentences are used as the input of the trained re-ranking model. The trained re-ranking model performs feature fusion processing on the current game state features and historical dialogues to obtain a multimodal fusion encoding vector, and vectorizes the recommended candidate sentences to obtain the semantic encoding vector of the recommended candidate sentences, and then calculates a more accurate correlation score between the multimodal fusion encoding vector and the semantic encoding vector of the recommended candidate sentences.
[0076] Afterwards, the recommended candidate sentences can be sorted in descending order according to the relevance scores to obtain a recommended candidate sentence sequence, and finally the recommended candidate sentence ranked first is used as the target candidate sentence, thereby quickly screening out more reasonable target candidate sentences as replies to historical conversations.
[0077] In some embodiments, after step S101, the method may also include: determining whether to trigger a reply to the historical conversation based on the current game state characteristics through a trigger model pre-trained for the target game; and executing step S102 if it is determined that a reply to the historical conversation is triggered.
[0078] The trained trigger model may be a trained support vector machine (SVM) or a trained decision tree. The trained trigger model can determine whether a dialogue is triggered under specific game state characteristics.
[0079] The current game state features are input into the trained trigger model. The trained trigger model analyzes the current game state features to determine whether to trigger a reply to the historical dialogue. The trained game dialogue dual-tower model is called only when the trained trigger model determines that a reply to the historical dialogue is triggered.
[0080] When the trained trigger model determines that there is no need to trigger a reply to a historical conversation, it returns directly. This brings two benefits: first, the conversation service is called periodically in the target game. If a conversation reply is required for each conversation service request, more resources will be consumed and latency will increase exponentially. Second, in reality, there are not many conversations between real players. Therefore, the trained trigger model discards most of the conversation service requests and returns directly, which is more in line with the speaking frequency of real players and has better anthropomorphism. Otherwise, frequent conversation replies will bring a very bad experience to real players.
[0081] In some embodiments, before step S101, it may also include: obtaining game state feature samples and historical dialogue samples of the target game, as well as actual dialogue responses of the historical dialogue samples; training a preset game dialogue twin-tower model according to the game state feature samples, historical dialogue samples and actual dialogue responses until the preset game dialogue twin-tower model converges to obtain a trained game dialogue twin-tower model.
[0082] Among them, the preset game dialogue twin-tower model refers to a game dialogue twin-tower model that has not yet been trained.
[0083] The game state at a specific moment in a MOBA game can be collected in advance as a game state sample, the conversations of real players in a period of time before the specific moment can be collected as historical conversation samples, and the actual conversation responses of real players to the historical conversation samples at a specific moment can be collected.
[0084] The game state samples are subjected to feature extraction processing to obtain game state feature samples, so that the game state feature samples, historical dialogue samples and actual dialogue responses can be used as high-quality training data to train the preset game dialogue twin-tower model until the preset game dialogue twin-tower model converges to obtain a trained game dialogue twin-tower model. In this way, the game dialogue twin-tower model is trained using multimodal training data. Compared with the existing training using a single text modality, the training effect of the trained game dialogue twin-tower model can be improved, thereby improving the performance of the trained game dialogue twin-tower model.
[0085] In some embodiments, the preset game dialogue twin-tower model is trained according to the game state feature samples, historical dialogue samples and actual dialogue replies until the preset game dialogue twin-tower model converges, and the trained game dialogue twin-tower model can be obtained by inputting the game state feature samples and the historical dialogue samples into the left tower network of the preset game dialogue twin-tower model for training to obtain the predicted multimodal fusion coding vector; inputting the actual dialogue replies into the right tower network of the preset game dialogue twin-tower model for training to obtain the semantic coding vector of the actual dialogue replies; calculating the cosine distance between the predicted multimodal fusion coding vector and the semantic coding vector of the actual dialogue reply; according to the cosine distance, obtaining the loss function of the preset game dialogue twin-tower model; according to the loss function, performing iterative update based on contrastive learning on the parameters of the preset game dialogue twin-tower model until the number of iterations is greater than the preset number threshold, determining that the preset game dialogue twin-tower model converges, and obtaining the trained game dialogue twin-tower model.
[0086] See also Figure 2 , Figure 2 The diagram of the training architecture for training the preset game dialogue twin tower model is shown in Figure 1. Specifically, the game state feature samples and historical dialogue samples are first input into the left tower network of the preset game dialogue twin tower model for training, so that in the left tower network, the game state feature samples are subjected to patch embedding processing (Patch Embeddings) to obtain the predicted state patch feature vector, and the historical dialogue samples are subjected to text embedding processing (Text Embedding) to obtain the predicted text feature vector.
[0087] Then, the multi-modal Transformer Encoder of the Zuota network is used to perform cross-modal fusion processing on the predicted state block feature vector and the predicted text feature vector using the self-attention mechanism to obtain the predicted multi-modal fusion encoding vector.
[0088] The actual dialogue replies of the historical dialogue samples are also input into the right tower network of the preset game dialogue dual-tower model for training, so that the actual dialogue replies are subjected to text embedding processing (Text Embedding) in the right tower network to obtain the embedding vector of the actual dialogue replies; then the embedding vector of the actual dialogue replies is encoded through the text encoder (Text Encoder) of the right tower network to obtain the semantic encoding vector of the actual dialogue replies.
[0089] Afterwards, the cosine distance between the predicted multimodal fusion coding vector and the semantic coding vector of the actual dialogue response is calculated, and then the loss function (CLIP loss) of the preset game dialogue twin tower model is obtained according to the cosine distance.
[0090] CLIP loss is mainly based on the principle of contrastive learning, which aims to effectively learn to maximize the similarity between the predicted multimodal fusion encoding vector and the semantic encoding vector of the actual dialogue response. Therefore, according to CLIP loss, the parameters of the preset game dialogue twin tower model are iteratively updated based on contrastive learning until the number of iterations exceeds the preset threshold, and the preset game dialogue twin tower model is determined to converge, and a trained game dialogue twin tower model is obtained.
[0091] Therefore, through comparative learning, the preset game dialogue twin-tower model can effectively learn the similarity between the predicted multimodal fusion encoding vector and the semantic encoding vector of the actual dialogue response, thereby improving the preset game dialogue twin-tower model's understanding of the relationship between game state feature samples and historical dialogue samples and actual dialogue responses, thereby improving the performance of the trained game dialogue twin-tower model, so that the trained game dialogue twin-tower model can more accurately understand the relationship between the current game state features and historical dialogues and candidate sentences, thereby improving the response efficiency of the dialogue service.
[0092] In some embodiments, before step S101, a trigger model may also be trained, and the training process of the trigger model includes: collecting game states of game frames in which real players speak from a MOBA game as positive examples of the trigger model, and collecting game states of game frames in which real players do not speak as negative examples of the trigger model, thereby training the trigger model based on the positive examples and the negative examples, so that the trained trigger model can accurately determine whether a dialogue reply is triggered under specific game state characteristics.
[0093] See also Figure 3 In some embodiments, the above method can be applied in a game dialogue processing system. Figure 3 This is a schematic diagram of the game dialogue processing system architecture.
[0094] like Figure 3 As shown, the game dialogue processing system includes but is not limited to a trained trigger model, a multi-way searcher (the multi-way searcher is equipped with a trained game dialogue twin tower model), a vector search library, a dialogue filter, and a trained reordering model. Figure 3 The illustrated game dialogue processing system obtains dialogue responses for historical dialogues.
[0095] Specifically, in response to a dialogue service request in the target game, the current game state features and historical dialogues of the target game are first obtained. Then, the current game state features are analyzed through the trained trigger model to determine whether to trigger a reply to the historical dialogue. The multi-path retriever is called only when the trained trigger model determines that a reply to the historical dialogue is triggered.
[0096] In order to improve the response efficiency of online dialogue services, each candidate sentence in the preset dialogue library can be vectorized through the trained right tower network to obtain the semantic encoding vector of each candidate sentence, and the semantic encoding vector of each candidate sentence is stored in the vector retrieval library. Among them, the vector retrieval library can be Faiss (Facebook AI Similarity Search), which is a powerful and efficient vector retrieval library, mainly used for large-scale vector retrieval, which can quickly find similar vectors.
[0097] Then, the current game state features and historical conversations are input into the trained Zuota network for cross-modal feature fusion processing to obtain a multimodal fusion encoding vector.
[0098] Then, through a multi-way retriever, based on the multimodal fusion coding vector, a semantic coding vector whose similarity with the multimodal fusion coding vector is greater than a preset similarity threshold is retrieved in the vector retrieval library, thereby screening out the candidate sentences corresponding to the retrieved semantic coding vector.
[0099] Next, the selected candidate sentences are filtered through the dialogue filter according to the preset dialogue filtering rules in the dialogue filter to obtain the candidate recommendation sentences.
[0100] Finally, the candidate recommendation sentences are input into the trained re-ranking model, and the recommended candidate sentences are sorted in descending order through the trained re-ranking model. Finally, the recommended candidate sentence ranked first is used as the target candidate sentence. In this way, the target candidate sentence that is more in line with the current game situation and the player's game intention can be quickly screened out as a reply to the historical dialogue.
[0101] See also Figure 4 , Figure 4 It is a schematic block diagram of a game dialogue processing device provided in an embodiment of the present application. The game dialogue processing device can be configured in a computer device to execute the aforementioned game dialogue processing method.
[0102] like Figure 4 As shown, the game dialogue processing device 400 includes: a data acquisition module 401, a model calling module 402, a feature fusion module 403, a sentence vectorization module 404, a similarity acquisition module 405 and a dialogue response screening module 406.
[0103] Data acquisition module 401, used to obtain the current game status characteristics and historical dialogues of the target game;
[0104] A model calling module 402 is used to call a game dialogue dual-tower model pre-trained for the target game, wherein the trained game dialogue dual-tower model includes a trained left tower network and a trained right tower network;
[0105] The feature fusion module 403 is used to perform feature fusion processing on the current game state features and historical dialogues through the trained Zuota network to obtain a multimodal fusion coding vector;
[0106] A sentence vectorization module 404 is used to perform vectorization processing on each candidate sentence in the preset dialogue library of the target game through the trained right tower network to obtain a semantic encoding vector of each candidate sentence;
[0107] A similarity acquisition module 405 is used to acquire the similarity between the multimodal fusion encoding vector and the semantic encoding vector;
[0108] The dialogue reply screening module 406 is used to screen out target candidate sentences from the preset candidate dialogue library according to the similarity, and use the target candidate sentences as dialogue replies for the historical dialogue.
[0109] In one embodiment, the feature fusion module 403 is further used for:
[0110] Using the current game state features and the historical dialogue as inputs of the trained left tower network;
[0111] Embedding the current game state feature to obtain a state block feature vector, and embedding the historical dialogue to obtain a text feature vector;
[0112] The state block feature vector and the text feature vector are fused through the multimodal Transformer architecture of the trained Zuota network to obtain the multimodal fusion encoding vector.
[0113] In one embodiment, the conversation reply screening module 406 is further used to:
[0114] Filtering candidate sentences whose similarity is greater than a preset similarity threshold from the preset dialogue library;
[0115] Filtering the selected candidate sentences to obtain recommended candidate sentences;
[0116] The target candidate sentence is selected from the recommended candidate sentences.
[0117] In one embodiment, the conversation reply screening module 406 is further used to:
[0118] Obtaining a correlation score between the current game state feature and the historical dialogue and the recommended candidate sentence;
[0119] Arrange the recommended candidate sentences in descending order according to the relevance scores to obtain a recommended candidate sentence sequence;
[0120] The first recommended candidate sentence in the recommended candidate sentence sequence is used as the target candidate sentence.
[0121] In one embodiment, the game dialogue processing device 400 further includes a dialogue reply trigger module, and the dialogue reply trigger module is used to:
[0122] Determining whether to trigger a reply to the historical conversation according to the current game state characteristics by using a trigger model pre-trained for the target game;
[0123] In the case of determining that a reply to the historical conversation is triggered, the step of calling the game conversation dual-tower model pre-trained for the target game is executed.
[0124] In one embodiment, the game dialogue processing device 400 further includes a model training module, and the model training module is used to:
[0125] Obtaining game state feature samples and historical dialogue samples of the target game, as well as actual dialogue responses of the historical dialogue samples;
[0126] The preset game dialogue twin-tower model is trained according to the game state feature samples, the historical dialogue samples and the actual dialogue replies until the preset game dialogue twin-tower model converges to obtain the trained game dialogue twin-tower model.
[0127] In one embodiment, the model training module is further used to:
[0128] Input the game state feature samples and the historical dialogue samples into the left tower network of the preset game dialogue dual-tower model for training to obtain a predicted multimodal fusion coding vector;
[0129] Input the actual dialogue response into the right tower network of the preset game dialogue double tower model for training, and obtain the semantic encoding vector of the actual dialogue response;
[0130] Calculating the cosine distance between the predicted multimodal fusion encoding vector and the semantic encoding vector of the actual dialogue response;
[0131] According to the cosine distance, obtaining the loss function of the preset game dialogue twin tower model;
[0132] According to the contrastive learning loss function, the parameters of the preset game dialogue twin-tower model are iteratively updated based on contrastive learning until the number of iterations is greater than a preset threshold, and it is determined that the preset game dialogue twin-tower model converges to obtain the trained game dialogue twin-tower model.
[0133] Among them, each module in the above-mentioned game dialogue processing device 400 corresponds to each step in the above-mentioned game dialogue processing method embodiment, and its functions and implementation processes are no longer repeated here one by one.
[0134] The game conversation processing device 400 can execute the game conversation processing method provided in the embodiment of the present application, and therefore can achieve the beneficial effects that can be achieved by the game conversation processing method provided in the embodiment of the present application. Please refer to the previous embodiment for details and will not be repeated here.
[0135] The method and apparatus of the present application can be used in many general or special computer system environments or configurations. For example: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronic devices, network PCs, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, etc. The present application can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. The present application can also be practiced in distributed computing environments, in which tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media including storage devices.
[0136] Exemplarily, the above method and apparatus may be implemented in the form of a computer program. The computer program may be implemented in the form of a computer program. Figure 5 Runs on the computer device shown.
[0137] See also Figure 5 , Figure 5 It is a schematic block diagram of the structure of a computer device provided in an embodiment of the present application.
[0138] See also Figure 5 The computer device includes a processor and a memory connected via a system bus, wherein the memory may include a non-volatile storage medium and an internal memory.
[0139] The processor is used to provide computing and control capabilities and support the operation of the entire computer equipment.
[0140] The internal memory provides an environment for the operation of the computer program in the non-volatile storage medium. When the computer program is executed by the processor, the processor can execute any game dialogue processing method.
[0141] It should be understood that the processor may be a central processing unit (CPU), and the processor may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Among them, the general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.
[0142] In one embodiment, the processor is used to run a computer program stored in the memory to implement the following steps:
[0143] Get the current game state characteristics and historical dialogue of the target game;
[0144] Calling a game dialogue dual-tower model pre-trained for the target game, wherein the trained game dialogue dual-tower model includes a trained left tower network and a trained right tower network;
[0145] Through the trained Zuota network, feature fusion processing is performed on the current game state features and historical dialogues to obtain a multimodal fusion coding vector;
[0146] Using the trained right tower network, vectorizing each candidate sentence in the preset dialogue library of the target game to obtain a semantic encoding vector of each candidate sentence;
[0147] Obtaining the similarity between the multimodal fusion encoding vector and the semantic encoding vector;
[0148] According to the similarity, a target candidate sentence is screened out from the preset candidate dialogue library, and the target candidate sentence is used as a dialogue reply of the historical dialogue.
[0149] In one embodiment, when the processor implements the feature fusion processing of the current game state feature and the historical dialogue through the trained left tower network, it is used to implement:
[0150] Using the current game state features and the historical dialogue as inputs of the trained left tower network;
[0151] Embedding the current game state feature to obtain a state block feature vector, and embedding the historical dialogue to obtain a text feature vector;
[0152] The state block feature vector and the text feature vector are fused through the multimodal Transformer architecture of the trained Zuota network to obtain the multimodal fusion encoding vector.
[0153] In one embodiment, when the processor implements the step of filtering out target candidate sentences from the preset candidate dialogue library according to the similarity, the processor is configured to implement:
[0154] Filtering candidate sentences whose similarity is greater than a preset similarity threshold from the preset dialogue library;
[0155] Filtering the selected candidate sentences to obtain recommended candidate sentences;
[0156] The target candidate sentence is selected from the recommended candidate sentences.
[0157] In one embodiment, when implementing the step of filtering out the target candidate sentence from the recommended candidate sentences, the processor is configured to implement:
[0158] Obtaining a correlation score between the current game state feature and the historical dialogue and the recommended candidate sentence;
[0159] Arrange the recommended candidate sentences in descending order according to the relevance scores to obtain a recommended candidate sentence sequence;
[0160] The first recommended candidate sentence in the recommended candidate sentence sequence is used as the target candidate sentence.
[0161] In one embodiment, after obtaining the current game state characteristics and historical dialogues of the target game, the processor is further configured to:
[0162] Determining whether to trigger a reply to the historical conversation according to the current game state characteristics by using a trigger model pre-trained for the target game;
[0163] In the case of determining that a reply to the historical conversation is triggered, the step of calling the game conversation dual-tower model pre-trained for the target game is executed.
[0164] In one embodiment, before obtaining the current game state characteristics and historical dialogues of the target game, the processor is further configured to:
[0165] Obtaining game state feature samples and historical dialogue samples of the target game, as well as actual dialogue responses of the historical dialogue samples;
[0166] The preset game dialogue twin-tower model is trained according to the game state feature samples, the historical dialogue samples and the actual dialogue replies until the preset game dialogue twin-tower model converges to obtain the trained game dialogue twin-tower model.
[0167] In one embodiment, when the processor implements the training of the preset game dialogue twin-tower model according to the game state feature sample, the historical dialogue sample and the actual dialogue reply until the preset game dialogue twin-tower model converges to obtain the trained game dialogue twin-tower model, it is used to implement:
[0168] Input the game state feature samples and the historical dialogue samples into the left tower network of the preset game dialogue dual-tower model for training to obtain a predicted multimodal fusion coding vector;
[0169] Input the actual dialogue response into the right tower network of the preset game dialogue double tower model for training, and obtain the semantic encoding vector of the actual dialogue response;
[0170] Calculating the cosine distance between the predicted multimodal fusion encoding vector and the semantic encoding vector of the actual dialogue response;
[0171] According to the cosine distance, obtaining the loss function of the preset game dialogue twin tower model;
[0172] According to the contrastive learning loss function, the parameters of the preset game dialogue twin-tower model are iteratively updated based on contrastive learning until the number of iterations is greater than a preset threshold, and it is determined that the preset game dialogue twin-tower model converges to obtain the trained game dialogue twin-tower model.
[0173] The computer device can execute the game dialogue processing method provided in the embodiment of the present application, and therefore can achieve the beneficial effects that can be achieved by the game dialogue processing method provided in the embodiment of the present application. Please refer to the previous embodiment for details and will not be repeated here.
[0174] An embodiment of the present application also provides a computer-readable storage medium.
[0175] The computer-readable storage medium of the present application stores a computer program, and when the computer program is executed by a processor, the steps of the game dialogue processing method as described above are implemented.
[0176] The computer-readable storage medium may be an internal storage unit of the game dialogue processing device or computer device described in the above embodiments, such as a hard disk or memory of the game dialogue processing device or computer device. The computer-readable storage medium may also be an external storage device of the game dialogue processing device or computer device, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital card (Secure Digital Card, SD Card), a flash card (Flash Card), etc., equipped on the game dialogue processing device or computer device.
[0177] Since the computer program stored in the computer-readable storage medium can execute any one of the game dialogue processing methods provided in the embodiments of the present application, the beneficial effects that can be achieved by any one of the game dialogue processing methods provided in the embodiments of the present application can be achieved. Please refer to the previous embodiments for details and will not be repeated here.
[0178] Furthermore, the computer-readable storage medium may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function, etc.; the data storage area may store data created according to the use of the blockchain node, etc.
[0179] The blockchain referred to in this application is a new application model of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanism, encryption algorithm, etc. Blockchain is essentially a decentralized database, a string of data blocks generated by cryptographic methods. Each data block contains a batch of network transaction information, which is used to verify the validity of its information (anti-counterfeiting) and generate the next block. Blockchain can include the underlying blockchain platform, platform product service layer, and application service layer.
[0180] It should be noted that, in this article, the term "includes", "comprising" or any other variation thereof is intended to cover non-exclusive inclusion, so that a process, method, article or system including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or system. In the absence of further restrictions, an element defined by the sentence "comprising a ..." does not exclude the existence of other identical elements in the process, method, article or system including the element.
[0181] The above description is only a specific implementation mode of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or substitutions within the technical scope disclosed in the present application, and these modifications or substitutions should be included in the protection scope of the present application.< / sep>
Claims
1. A game dialogue processing method, characterized in that: The method comprises: Get the current game state characteristics and historical dialogue of the target game; Calling a game dialogue dual-tower model pre-trained for the target game, wherein the trained game dialogue dual-tower model includes a trained left tower network and a trained right tower network; Through the trained Zuota network, feature fusion processing is performed on the current game state features and historical dialogues to obtain a multimodal fusion coding vector; Using the trained right tower network, vectorizing each candidate sentence in the preset dialogue library of the target game to obtain a semantic encoding vector of each candidate sentence; Obtaining the similarity between the multimodal fusion encoding vector and the semantic encoding vector; According to the similarity, a target candidate sentence is screened out from the preset candidate dialogue library, and the target candidate sentence is used as a dialogue reply of the historical dialogue.
2. The method according to claim 1, characterized in that The trained left tower network is used to perform feature fusion processing on the current game state features and historical dialogues to obtain a multimodal fusion coding vector, including: Using the current game state features and the historical dialogue as inputs of the trained left tower network; Embedding the current game state feature to obtain a state block feature vector, and embedding the historical dialogue to obtain a text feature vector; The state block feature vector and the text feature vector are fused through the multimodal Transformer architecture of the trained Zuota network to obtain the multimodal fusion encoding vector.
3. The method according to claim 1, characterized in that: The step of selecting target candidate sentences from the preset candidate dialogue library according to the similarity includes: Filtering candidate sentences whose similarity is greater than a preset similarity threshold from the preset dialogue library; Filtering the selected candidate sentences to obtain recommended candidate sentences; The target candidate sentence is selected from the recommended candidate sentences.
4. The method according to claim 3, characterized in that The step of filtering out the target candidate sentence from the recommended candidate sentences includes: Obtaining a correlation score between the current game state feature and the historical dialogue and the recommended candidate sentence; Arrange the recommended candidate sentences in descending order according to the relevance scores to obtain a recommended candidate sentence sequence; The first recommended candidate sentence in the recommended candidate sentence sequence is used as the target candidate sentence.
5. The method according to any one of claims 1 to 4, characterized in that: After obtaining the current game status characteristics and historical dialogues of the target game, the method further includes: Determining whether to trigger a reply to the historical conversation according to the current game state characteristics by using a trigger model pre-trained for the target game; In the case of determining that a reply to the historical conversation is triggered, the step of calling the game conversation dual-tower model pre-trained for the target game is executed.
6. The method according to any one of claims 1 to 4, characterized in that: Before obtaining the current game state characteristics and historical dialogues of the target game, the method further includes: Obtaining game state feature samples and historical dialogue samples of the target game, as well as actual dialogue responses of the historical dialogue samples; The preset game dialogue twin-tower model is trained according to the game state feature samples, the historical dialogue samples and the actual dialogue replies until the preset game dialogue twin-tower model converges to obtain the trained game dialogue twin-tower model.
7. The method according to claim 6, characterized in that The method further comprises: training the preset game dialogue twin-tower model according to the game state feature sample, the historical dialogue sample and the actual dialogue reply until the preset game dialogue twin-tower model converges to obtain the trained game dialogue twin-tower model, including: Input the game state feature samples and the historical dialogue samples into the left tower network of the preset game dialogue dual-tower model for training to obtain a predicted multimodal fusion coding vector; Input the actual dialogue response into the right tower network of the preset game dialogue double tower model for training, and obtain the semantic encoding vector of the actual dialogue response; Calculating the cosine distance between the predicted multimodal fusion encoding vector and the semantic encoding vector of the actual dialogue response; According to the cosine distance, obtaining the loss function of the preset game dialogue twin tower model; According to the contrastive learning loss function, the parameters of the preset game dialogue twin-tower model are iteratively updated based on contrastive learning until the number of iterations is greater than a preset threshold, and it is determined that the preset game dialogue twin-tower model converges to obtain the trained game dialogue twin-tower model.
8. A game dialogue processing device, characterized in that: The device comprises: The data acquisition module is used to obtain the current game status characteristics and historical dialogues of the target game; A model calling module, used to call a game dialogue dual-tower model pre-trained for the target game, wherein the trained game dialogue dual-tower model includes a trained left tower network and a trained right tower network; A feature fusion module is used to perform feature fusion processing on the current game state features and historical dialogues through the trained Zuota network to obtain a multimodal fusion coding vector; A sentence vectorization module, used to perform vectorization processing on each candidate sentence in the preset dialogue library of the target game through the trained right tower network, so as to obtain a semantic encoding vector of each candidate sentence; A similarity acquisition module, used to acquire the similarity between the multimodal fusion encoding vector and the semantic encoding vector; The dialogue reply screening module is used to screen out target candidate sentences from the preset candidate dialogue library according to the similarity, and use the target candidate sentences as dialogue replies for the historical dialogue.
9. A computer device, characterized in that: The computer device includes a memory and a processor, the memory stores a computer program, and the processor implements the game dialogue processing method according to any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the game dialogue processing method according to any one of claims 1 to 7 is implemented.
Citation Information
Cited By
Object recommendation method and device, electronic equipment and storage medium
CN121614674A