Training method and device for intelligent role in game and electronic equipment
By using negative feedback in user comment data and combining error tag data in game scenarios, the training methods of game intelligent characters are improved, and the problem of poor adaptability of smart characters is solved, and the game performance and user interaction experience are improved.
Patent Information
- Application Number
- CN202411718402.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-27
- Publication Date
- 2025-02-28
Smart Images

Figure CN119524430A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of game technology, and in particular to a training method, device and electronic equipment for intelligent characters in games. Background Art
[0002] At present, with the development of artificial intelligence technology, the role of artificial intelligence (AI) characters in games in improving user interaction experience is more significant. In particular, through the machine learning technology of imitation learning, the capabilities of intelligent characters in games have been greatly expanded. Imitation learning technology is to conduct precise and in-depth training of intelligent characters through detailed analysis of human user behavior patterns, so that the intelligent characters in the game are not only simple programs, but also able to learn and imitate human user operation skills, and even show similar real human behavior characteristics in the game, so that users in the game are no longer facing an unchanging algorithm, but an intelligent opponent or intelligent teammate who can learn and adapt.
[0003] Currently, the training of intelligent characters mainly relies on two methods: reinforcement learning (RL) and imitation learning (IL). These training methods usually rely on a large number of labeled data sets. These data sets are derived from the game behaviors of users with higher game skills. Such user-operated game behaviors are regarded as standard and optimized behavior patterns. Intelligent characters can improve their game level by learning these patterns. However, this intelligent character training method focuses on the behavior patterns of a small number of highly skilled users. This single training model limits the learning scope of AI characters, which in turn makes the trained intelligent characters less adaptable, affecting the user's interactive experience with the intelligent characters in the game. Summary of the invention
[0004] The purpose of the present disclosure is to provide a method, device and electronic device for training an intelligent character in a game, so as to alleviate the technical problem of poor interaction experience between a user and the intelligent character in the game.
[0005] In a first aspect, an embodiment of the present disclosure provides a method for training an intelligent character in a game, the method comprising:
[0006] Obtaining user review data for the game; wherein the game scene of the game includes an initial intelligent character, the initial intelligent character is an initial model generated by training with a first game data sample, and the first game data sample corresponds to a correct label;
[0007] Performing language recognition on the user comment data to obtain negative user comment data for the initial intelligent character;
[0008] Determine the game data corresponding to the negative user comment data in the game scene as a second game data sample; wherein the second game data sample corresponds to an error label;
[0009] The initial model is trained using the first game data sample and the second game data sample to obtain a target model; wherein the target model serves as a target intelligent character that replaces the initial intelligent character in the game scene.
[0010] In a second aspect, a training device for an intelligent character in a game is provided, comprising:
[0011] An acquisition module, used to acquire user comment data for the game; wherein the game scene of the game includes an initial intelligent character, the initial intelligent character is an initial model generated by training with a first game data sample, and the first game data sample corresponds to a correct label;
[0012] an identification module, configured to perform language identification on the user comment data to obtain negative user comment data for the initial intelligent character;
[0013] A determination module, configured to determine game data corresponding to the negative user comment data in the game scene as a second game data sample; wherein the second game data sample corresponds to an error label;
[0014] A training module is used to train the initial model using the first game data sample and the second game data sample to obtain a target model; wherein the target model serves as a target intelligent character that replaces the initial intelligent character in the game scene.
[0015] In a third aspect, an embodiment of the present disclosure provides an electronic device, including a memory and a processor, wherein the memory stores a computer program that can be executed on the processor, and when the processor executes the computer program, the method described in the first aspect is implemented.
[0016] In a fourth aspect, an embodiment of the present disclosure further provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions. When the computer-executable instructions are called and executed by a processor, the computer-executable instructions cause the processor to execute the method described in the first aspect.
[0017] The embodiments of the present disclosure bring the following beneficial effects:
[0018] The embodiments of the present disclosure provide a method, device and electronic device for training an intelligent character in a game, which can obtain user comment data for the game; wherein the game scene of the game includes an initial intelligent character, and the initial intelligent character is an initial model generated by training with a first game data sample, and the first game data sample corresponds to a correct label; language recognition is performed on the user comment data to obtain negative user comment data for the initial intelligent character; the game data corresponding to the negative user comment data in the game scene is determined as a second game data sample; wherein the second game data sample corresponds to an incorrect label; the initial model is trained with the first game data sample and the second game data sample to obtain a target model; wherein the target model serves as a target intelligent character that replaces the initial intelligent character in the game scene. In this solution, by identifying negative user comments on the intelligent character, and using the game data corresponding to the negative user comments in the game scene as the second game data sample with an incorrect label, the second sample with the incorrect label is mixed with the conventional first game data sample with a correct label for training to improve the intelligent character. Not only can it process samples with correct labels, but it can also process samples with incorrect labels at the same time, so that the intelligent character can be adjusted and optimized according to the actual needs of users, and it is achieved that not only the correct game strategy is taught to the intelligent character, but also the intelligent character can effectively learn how to identify and avoid incorrect game behaviors, thereby expanding the learning scope of the intelligent character, and enabling the improved intelligent character to adapt to a variety of game situations, thereby improving the adaptability of the intelligent character, thereby improving the game performance of the intelligent character and the user's interactive experience, and alleviating the technical problem of poor interactive experience between users and intelligent characters in the game.
[0019] In order to make the above-mentioned objectives, features and advantages of the present disclosure more obvious and easy to understand, preferred embodiments are specifically cited below and described in detail with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] In order to more clearly illustrate the specific embodiments of the present disclosure or the technical solutions in the prior art, the drawings required for use in the specific embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0021] Figure 1 A schematic diagram of an application scenario provided by an embodiment of the present disclosure is shown;
[0022] Figure 2 A schematic diagram of the structure of a computer device provided by an embodiment of the present disclosure is shown;
[0023] Figure 3 A flowchart of a method for training an intelligent character in a game provided by an embodiment of the present disclosure;
[0024] Figure 4 Another schematic diagram of a process for training an intelligent character in a game provided by an embodiment of the present disclosure;
[0025] Figure 5 A schematic diagram of the structure of a training device for an intelligent character in a game provided by an embodiment of the present disclosure;
[0026] Figure 6 A schematic structural diagram of an electronic device provided by an embodiment of the present disclosure is shown. DETAILED DESCRIPTION
[0027] In order to make the purpose, technical solution and advantages of the embodiments of the present disclosure clearer, the technical solution of the present disclosure will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the described embodiments are part of the embodiments of the present disclosure, rather than all of the embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present disclosure.
[0028] The terms "including" and "having" and any variations thereof mentioned in the embodiments of the present disclosure are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device including a series of steps or units is not limited to the listed steps or units, but may optionally include other steps or units that are not listed, or may optionally include other steps or units that are inherent to these processes, methods, products or devices.
[0029] At present, AI characters in games can not only enrich the interactivity of games, but also make the gaming experience closer to reality. Through imitation learning, AI characters in games can better understand the strategies and intentions of users, and thus make more reasonable and humane responses in the game. This makes every confrontation in the game full of challenges for users, because they are no longer facing an unchanging algorithm, but an intelligent opponent that can learn and adapt.
[0030] The core of existing AI character training methods in games is to teach AI characters how to make correct decisions through a large amount of data. However, this approach that relies solely on expert data means that the training process may require a lot of time and resources, and also limits the breadth and depth of AI learning because it mainly focuses on the behavior patterns of a small number of highly skilled users. Existing AI character training methods in games generally ignore the negative experiences of ordinary users in the process of interacting with AI characters. This neglect leads to substandard performance of AI characters in real game environments. Ordinary users may encounter unreasonable behaviors or decisions of AI characters, and these experiences are not fully considered, making AI characters less effective in dealing with diverse game situations, resulting in a poor interaction experience between users and AI characters in the game.
[0031] Moreover, the construction of existing training data sets generally only focuses on positive examples, that is, correct operations and successful strategies, but ignores the identification and correction of wrong behaviors. This single training model limits the learning scope of AI, making it difficult to identify and avoid wrong behaviors, which in turn affects the overall performance and adaptability of AI, and also makes the user's interaction experience with AI characters in the game poor.
[0032] Furthermore, in existing technical solutions, the value of user feedback has not been fully utilized to improve AI characters. User experience and evaluation in the game are important resources for improving AI characters, but the lack of this resource makes it impossible for AI characters to be adjusted and optimized according to actual user needs, resulting in a gradual widening of the gap between AI characters and user expectations, resulting in a poor interaction experience between users and AI characters in the game.
[0033] Based on this, the embodiments of the present disclosure provide a method, device, and electronic device for training an intelligent character in a game, by which the technical problem of poor interaction experience between the user and the intelligent character in the game can be alleviated.
[0034] In one embodiment of the present disclosure, the method for training an intelligent character in a game can be run on a local terminal device or a server. When the method for training an intelligent character in a game is run on a server, the method can be implemented and executed based on a cloud interaction system, wherein the cloud interaction system includes a server and a client device.
[0035] In an optional implementation, various cloud applications can be run under the cloud interaction system, such as cloud games. Taking cloud games as an example, cloud games refer to a game mode based on cloud computing. In the operation mode of cloud games, the operating body of the game program and the main body of the game screen presentation are separated. The storage and operation of the training method of the intelligent character in the game are completed on the cloud game server. The role of the client device is used for receiving and sending data and presenting the game screen. For example, the client device can be a display device with data transmission function close to the user side, such as a mobile terminal, a TV, a computer, a handheld computer, etc.; but the cloud game server in the cloud is used for information processing. When playing the game, the user operates the client device to send an operation instruction to the cloud game server. The cloud game server runs the game according to the operation instruction, encodes and compresses the game screen and other data, and returns it to the client device through the network. Finally, the client device decodes and outputs the game screen.
[0036] In an optional embodiment, taking a game as an example, a local terminal device stores a game program and is used to present a game screen. The local terminal device is used to interact with the user through a graphical user interface, that is, the game program is downloaded and installed by an electronic device and run conventionally. The local terminal device may provide the graphical user interface to the user in a variety of ways, for example, it may be rendered and displayed on a display screen of the terminal, or provided to the user through a holographic projection. For example, the local terminal device may include a display screen and a processor, the display screen is used to present a graphical user interface, the graphical user interface includes a game screen, and the processor is used to run the game, generate a graphical user interface, and control the display of the graphical user interface on the display screen.
[0037] In a possible implementation, an embodiment of the present disclosure provides a method for training an intelligent character in a game, providing a graphical user interface through a terminal device, wherein the terminal device can be the local terminal device mentioned above, or can be a client device in the cloud interaction system mentioned above.
[0038] For example, Figure 1 As shown, Figure 1 A schematic diagram of an application scenario provided by an embodiment of the present disclosure. The application scenario may include a terminal device (such as a computer device 102) and a server 101, and the terminal device may communicate with the server 101 via a wired network or a wireless network. The terminal device is used to run a virtual desktop, and through the virtual desktop, it can interact with the server 101 to edit the content in the server 101.
[0039] The terminal device of this embodiment is described by taking a computer device 102 as an example. The computer device 102 includes components such as a radio frequency (RF) circuit 110, a memory 120, and a processor 130. Those skilled in the art can understand that Figure 2 The computer device structure shown in the figure does not constitute a limitation on the computer device, and may include more or fewer components than shown in the figure, or combine some components, or separate some components, or arrange the components differently.
[0040] The RF circuit 110 can also communicate with the network and other devices through wireless communication. The wireless communication can use any communication standard or protocol, including but not limited to Global System of Mobilecommunication (GSM), General Packet Radio Service (GPRS), Code Division Multiple Access (CDMA), Wideband Code Division Multiple Access (WCDMA), Long Term Evolution (LTE), email, Short Messaging Service (SMS), etc.
[0041] The memory 120 can be used to store software programs and modules. The processor 130 executes various functional applications and data processing of the computer device 102 by running the software programs and modules stored in the memory 120. The memory 120 can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, an application required for at least one function, etc.; the data storage area can store data created according to the use of the computer device 102, etc. In addition, the memory 120 can include a high-speed random access memory, and can also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.
[0042] The processor 130 is the control center of the computer device 102. It uses various interfaces and lines to connect various parts of the entire computer device. It executes various functions of the computer device 102 and processes data by running or executing software programs and / or modules stored in the memory 120 and calling data stored in the memory 120, thereby monitoring the computer device as a whole.
[0043] The embodiments of the present disclosure are further described below in conjunction with the accompanying drawings.
[0044] Figure 3 The present invention provides a flow chart of a method for training an intelligent character in a game according to an embodiment of the present invention. The method can be applied to a computer device. Figure 3 As shown, the method includes:
[0045] Step S310, obtaining user comment data on the game.
[0046] Among them, the game scene of the game includes an initial intelligent character, and the initial intelligent character is an initial model generated by training using a first game data sample, and the first game data sample corresponds to a correct label.
[0047] The intelligent characters trained in the embodiments of the present disclosure can be used to participate in human-computer games, for example, robots playing chess games with users, enemy virtual characters and friendly virtual characters in game scenes, etc. The intelligent characters can play the roles controlled by other users in the game.
[0048] In practical applications, the user review data for a game may be review data for a game by any user, such as a user in the game or a user outside the game. Figure 4 As shown, during the process of collecting negative samples, the speech of players in the game is obtained.
[0049] Step S320: Perform language recognition on the user comment data to obtain negative user comment data for the initial intelligent character.
[0050] As an optional implementation, a large language model can be used to identify critical comments made by online users in a game against an existing AI model (initial intelligent character). The large language model can accurately capture the user's negative feedback on the behavior of the initial intelligent character, thereby providing valuable information for the subsequent training of the AI model (intelligent character). Exemplarily, the above step S320 may specifically include the following process: performing language analysis on the user comment data through a large language model to obtain a language analysis result; based on the language analysis result, filtering negative user comment data for the initial intelligent character from the user comment data.
[0051] For example, Figure 3 As shown in the figure, in the process of identifying negative feedback, firstly, the large language model is used to analyze the user's speech in the game through natural language processing (NLP), so as to automatically identify those critical comments against the behavior of the AI model. Through deep learning algorithms, the large language model can understand the context of user comments and accurately filter out comments that are dissatisfied with the behavior of the AI model, laying the foundation for subsequent data processing.
[0052] The language analysis results may include data from many aspects, so that the negative user comment data subsequently screened out can be more comprehensive. Exemplarily, the language analysis results may include any one or more of the following: the role behavior commented on by the user comment data, the role data that performs the role behavior, the execution location of the role behavior, and the negative behavior determination result or positive behavior determination result corresponding to the role behavior.
[0053] For example, if the user comment data is "Is the goldfish girl a human-machine? She threw her skills directly into the bushes", the language analysis results output by the large language model may include: "Hero": "Goldfish Girl"; "Atmosphere": "Negative" (which means it does not meet the requirements); "Position": "Bush"; "Action": "Throw skills". From the language analysis results, it can be analyzed that the behavior of the goldfish girl throwing her skills directly into the bushes was judged by the user as a human-machine behavior that does not meet the requirements.
[0054] Step S330: determine the game data corresponding to the negative user comment data in the game scene as the second game data sample.
[0055] Among them, the second game data sample corresponds to an error label. In an optional embodiment, the game data may include various data to make the second game data sample corresponding to the error label more comprehensive, thereby improving the training effect of the intelligent character. Exemplarily, the game data includes any one or more of the following: the behavior data and state data of the initial intelligent character in the game scene, the execution position of the behavior corresponding to the behavior data, the game situation data of the game, and the state data of other virtual characters in the game scene except the initial intelligent character. Among them, the state data may include health, skills, defense and other states.
[0056] As an optional implementation, the system can obtain game data from the game operation logs corresponding to the negative user speech data in the game scene. The game operation logs can completely restore the game scene of each frame, so the behavior and position of the initial intelligent character corresponding to the negative user speech data can be extracted from it, including specific game features and inferred behavior labels. This process not only involves in-depth analysis of text data, but also requires matching user feedback with the actual behavior of the initial intelligent character to ensure that the extracted data can accurately reflect the performance of the initial intelligent character in the game.
[0057] For the extraction process of the game data corresponding to the negative user review data, for example, Figure 3As shown, the output information of the user's critical comments (negative user comment data) through the large language model is associated with the corresponding game playback data (i.e., the above-mentioned game operation log) through data matching to ensure that each critical comment can query the corresponding game scene. As an optional implementation method, the data information of the initial intelligent character that can match the user's comments can be found in this time interval half a minute before the feedback time of the user's critical comments. The data information mainly includes the situation characteristics of the initial intelligent character in the game, such as the health, skills, defense and other information of all units on the field, as well as the behavior data of the initial intelligent character.
[0058] For example, the information output by the large language model through the critical remarks such as "goldfish girl", "bush", "throw skills", etc. can be matched to the action data made by the corresponding initial intelligent character at that moment. The action data is judged as negative behavior that does not meet the requirements through user feedback.
[0059] Step S340: train the initial model using the first game data sample and the second game data sample to obtain a target model.
[0060] Among them, the target model serves as the target intelligent character that replaces the initial intelligent character in the game scene.
[0061] In an optional implementation, the negative behaviors determined as not meeting the requirements through user feedback may be used as second game data samples with incorrect labels.
[0062] For the mixed sample training process, for example, Figure 3 As shown, the initial intelligent character can be trained into a target intelligent character by using the first game data sample with the correct label in the above step S310 and the second game data sample with the wrong label in the above step S330.
[0063] As an example, the training process of the above-mentioned initial intelligent character can be implemented by an optimized cross entropy loss function to simultaneously process data with correct and incorrect labels, making the model training process more efficient. Exemplarily, the above-mentioned step S340 may specifically include the following process: based on the first game data sample and the second game data sample, the initial model is trained by the optimized cross entropy loss function to obtain the target model; wherein the optimized cross entropy loss function is used to simultaneously process the first game data sample with the correct label and the second game data sample with the incorrect label.
[0064] The optimized cross entropy loss function may include: cross entropy loss data corresponding to the correct label and additional penalty data corresponding to the wrong label. The cross entropy loss data corresponding to the correct label and the additional penalty data corresponding to the wrong label can improve the model training effect.
[0065] As an optional implementation, the cross entropy loss data corresponding to the correct label is determined based on the sample number of the first game data sample and the probability that the current training object sample is predicted to belong to the correct label; the additional penalty data corresponding to the wrong label is determined based on the sample number of the second game data sample and the probability that the current training object sample is predicted to belong to the correct label. Exemplarily, the expression of the optimized cross entropy loss function is as follows:
[0066] L=αL positive +βL negative ;in,
[0067] It should be noted that L represents the optimized cross entropy loss function; α and β are preset weight coefficients, which are used to adjust the contribution of positive examples corresponding to correct labels and negative examples corresponding to incorrect labels to the total loss respectively; N positive is the number of samples of the first game data sample with the correct label, N negative is the number of samples of the second game data with wrong labels; p i is the probability that the model predicts that the i-th sample belongs to the correct label.
[0068] Through the sample number of the first game data samples with correct labels, the sample number of the second game data samples with incorrect labels, and the probability that the current training object sample is predicted to belong to the correct label, the optimized cross entropy loss function can be calculated more accurately, making the data of the optimized cross entropy loss function more precise.
[0069] In the disclosed embodiment, for a mixed sample of the extracted wrongly labeled sample (the second game data sample) and the conventional training sample with the correct label (the first game data sample), the above-mentioned optimized cross entropy loss function can be used for training, and the optimized cross entropy loss function can process the data with correct and wrong labels at the same time. During the training process, the model must not only learn how to imitate the correct game behavior pattern, but also learn to recognize and avoid the wrong game behavior pattern.
[0070] As an example, the specific improved training process can use softmax (normalized exponential function) to output the predicted probability distribution, that is, update the parameters of the target model as the target intelligent role through the following optimization algorithm: Among them, θ represents the parameter to be optimized, a represents the learning rate, which determines the step size of the update in the gradient direction, is the gradient of the objective function J(θ) with respect to θ, which represents the direction of fastest growth of the function in the direction of θ. J(θ) is the objective function that you want to minimize, for example, it may be a loss function in machine learning.
[0071] The solution provided by the disclosed embodiment can be used as an imitation learning AI model (intelligent role) training method based on large language model discrimination negative sample enhancement, which solves the key defects in the existing game AI model training method, avoids the neglect of the negative experience of users, and realizes the identification of wrong behaviors of AI models and the correction of deficiencies. These defects make it difficult for AI to meet the expectations of users in real game interactions, and it is impossible to effectively learn and avoid inappropriate game behaviors. Through the solution provided by the disclosed embodiment, user feedback can be effectively used to optimize the AI model, improve the sensitivity of AI to user feedback, ensure that it can identify and correct wrong behaviors during the training process, and reduce the negative experience of users in the game. Moreover, it can also improve the game performance and user satisfaction of AI. Moreover, it can also improve the robustness and accuracy of the game AI model.
[0072] By identifying negative user comments targeting the intelligent character, and using the game data corresponding to the negative user comments in the game scene as the second game data sample with an incorrect label, the second sample with the incorrect label is mixed with the conventional first game data sample with a correct label for training to improve the intelligent character. Not only can it process samples with correct labels, but it can also process samples with incorrect labels at the same time, so that the intelligent character can be adjusted and optimized according to the actual needs of users, and it is achieved that not only the correct game strategy is taught to the intelligent character, but also the intelligent character can effectively learn how to identify and avoid incorrect game behaviors, thereby expanding the learning scope of the intelligent character, allowing the improved intelligent character to adapt to a variety of game situations, thereby improving the adaptability of the intelligent character, thereby enhancing the game performance of the intelligent character and the user's interactive experience.
[0073] The above steps are described in detail below.
[0074] In some embodiments, the target game record data corresponding to the target scene that matches the negative user comment data can be extracted from the game record data corresponding to the game scene, so that the acquisition of the game data corresponding to the negative user comment data in the game scene is more comprehensive and efficient. As an example, before step S330, the method can also include the following steps:
[0075] Determine a target scene that matches the negative user comment data in the game scene, where the game scene corresponds to game record data; extract target game record data corresponding to the target scene from the game record data corresponding to the game scene; and determine the target game record data as the game data corresponding to the negative user comment data in the game scene.
[0076] For the process of extracting game data corresponding to negative user comment data, illustratively, after determining the part of the game scene that matches the negative user comment data in the game scene, the game record data corresponding to this part of the game scene is extracted from the existing game record data (such as the game operation log recorded in real time during the game operation), for example, the behavior data performed by a certain character, the status data of a certain character's health skills, and the game data such as the execution location of a certain character's behavior.
[0077] In the disclosed embodiment, target game record data corresponding to the target scene that matches the negative user comment data can be extracted from the game record data corresponding to the game scene, thereby making the acquisition of the game data corresponding to the negative user comment data in the game scene more efficient, accurate and comprehensive.
[0078] In some embodiments, the target scene that can be matched with the negative user comment can be determined by the time when the comment was posted and the time corresponding to the game playback, so as to make the matching result more accurate. As an example, the above-mentioned determination of the target scene that matches the negative user comment data in the game scene can specifically include the following steps:
[0079] According to the release time of the negative user comment data, the scene time in the game scene that matches the release time is determined; according to the scene time, the target scene that matches the negative user comment data is determined in the game scene.
[0080] Exemplarily, the system can find data information of the initial intelligent character that can match the user's remarks in the time interval half a minute before the feedback time of the user's critical remarks. The data information mainly includes the situation characteristics of the initial intelligent character in the game, such as the health, skills, defense and other information of all units on the field, as well as the behavioral data of the initial intelligent character.
[0081] In the disclosed embodiment, the target scene that matches the negative user comment is determined by the corresponding time of the negative user comment release time in the game playback, so that the matched target scene is more accurate.
[0082] In some embodiments, the scene time in the game scene that matches the release time can be determined based on the target time period within a preset time period before the negative user comment is released, so that the matched target scene is more accurate. As an example, the above-mentioned determination of the scene time in the game scene that matches the release time based on the release time of the negative user comment data may specifically include the following steps:
[0083] Determine the release time of negative user comment data; determine a target time period within a preset time period before the release time; and determine the scene time period corresponding to the target time period in the game scene as the scene time in the game scene that matches the release time.
[0084] For example, the system can find the data information of the initial intelligent role that can match the user's speech 50 seconds before the feedback time of the user's critical speech (preset time before the release time) in this time interval (target time period). In this way, the data of the target scene matched later can be more accurate.
[0085] Figure 5 A schematic diagram of the structure of a training device for an intelligent character in a game is provided. Figure 5 As shown, the training device 500 for the intelligent character in the game includes:
[0086] The acquisition module 501 is used to acquire user comment data for the game; wherein the game scene of the game includes an initial intelligent character, and the initial intelligent character is an initial model generated by training with a first game data sample, and the first game data sample corresponds to a correct label;
[0087] An identification module 502 is used to perform language identification on the user comment data to obtain negative user comment data for the initial intelligent character;
[0088] A determination module 503 is used to determine the game data corresponding to the negative user comment data in the game scene as a second game data sample; wherein the second game data sample corresponds to an error label;
[0089] The training module 504 is used to train the initial model using the first game data sample and the second game data sample to obtain a target model; wherein the target model serves as a target intelligent character replacing the initial intelligent character in the game scene.
[0090] Through the above method, by identifying negative user comments on the intelligent character, and using the game data corresponding to the negative user comments in the game scene as the second sample with an incorrect label, the second sample is mixed with the conventional first positive sample with a correct label for training to improve the intelligent character, so that the intelligent character can be adjusted and optimized according to the actual needs of users, not only teaching the intelligent character the correct game behavior, but also enabling the intelligent character to effectively learn how to identify and avoid incorrect game behavior, thereby expanding the learning scope of the intelligent character, allowing the improved intelligent character to adapt to a variety of game situations, thereby improving the adaptability of the intelligent character, thereby enhancing the game performance of the intelligent character and the user's interactive experience.
[0091] In a feasible implementation scheme, the identification module is specifically used for:
[0092] Performing language analysis on the user comment data by using a large language model to obtain a language analysis result;
[0093] According to the language analysis result, negative user comment data for the initial intelligent character is filtered out from the user comment data.
[0094] In a feasible implementation manner, the language analysis result includes any one or more of the following:
[0095] The user comment data corresponds to the commented character behavior, the character data for executing the character behavior, the execution location of the character behavior, and the negative behavior determination result or the positive behavior determination result corresponding to the character behavior.
[0096] In a feasible embodiment, the device further comprises:
[0097] An extraction module is used to determine a target scene matching the negative user comment data in the game scene before determining the game data corresponding to the negative user comment data in the game scene as a second game data sample; the game scene corresponds to game record data; extract target game record data corresponding to the target scene from the game record data corresponding to the game scene; and determine the target game record data as the game data corresponding to the negative user comment data in the game scene.
[0098] In a feasible implementation scheme, the extraction module is specifically used to: determine, based on the release time of the negative user comment data, a scene time in the game scene that matches the release time; and determine, based on the scene time, a target scene in the game scene that matches the negative user comment data.
[0099] In a feasible implementation scheme, the extraction module is further used to:
[0100] Determining a release time of the negative user review data;
[0101] Determine a target time period within a preset time period before the release time;
[0102] The scene time period corresponding to the target time period in the game scene is determined as the scene time in the game scene that matches the release time.
[0103] In a feasible implementation manner, the game data includes any one or more of the following:
[0104] The behavior data and status data of the initial intelligent character in the game scene, the execution position of the behavior corresponding to the behavior data, the game situation data of the game, and the status data of other virtual characters in the game scene except the initial intelligent character.
[0105] In a feasible implementation scheme, the training module is specifically used to:
[0106] Based on the first game data sample and the second game data sample, the initial model is trained by an optimized cross entropy loss function to obtain a target model; wherein the optimized cross entropy loss function is used to simultaneously process the first game data sample with the correct label and the second game data sample with the incorrect label.
[0107] In a feasible implementation scheme, the optimized cross entropy loss function includes: cross entropy loss data corresponding to the correct label and additional penalty data corresponding to the incorrect label.
[0108] In a feasible implementation manner, the cross entropy loss data corresponding to the correct label is determined according to the sample quantity of the first game data sample and the probability that the current training object sample is predicted to belong to the correct label;
[0109] The additional penalty data corresponding to the wrong label is determined according to the sample quantity of the second game data sample and the probability that the current training object sample is predicted to belong to the correct label.
[0110] The training device for intelligent characters in games provided by the embodiments of the present disclosure has the same technical features as the training method for intelligent characters in games provided by the above embodiments, and therefore can solve the same technical problems and achieve the same technical effects.
[0111] Figure 6 A schematic diagram of the structure of an electronic device provided by an embodiment of the present disclosure is shown, including: a memory 601, a processor 602 and a bus 603, wherein the memory 601 stores machine-readable instructions executable by the processor 602, and when the electronic device runs a method for training an intelligent character in a game in an embodiment, the processor 602 communicates with the memory 601 via the bus 603, and the processor 602 executes the machine-readable instructions, and the processor 602 executes the preamble of the method item to perform the following steps:
[0112] Obtaining user review data for the game; wherein the game scene of the game includes an initial intelligent character, the initial intelligent character is an initial model generated by training with a first game data sample, and the first game data sample corresponds to a correct label;
[0113] Performing language recognition on the user comment data to obtain negative user comment data for the initial intelligent character;
[0114] Determine the game data corresponding to the negative user comment data in the game scene as a second game data sample; wherein the second game data sample corresponds to an error label;
[0115] The initial model is trained using the first game data sample and the second game data sample to obtain a target model; wherein the target model serves as a target intelligent character that replaces the initial intelligent character in the game scene.
[0116] In a feasible implementation manner, when the processor performs language recognition on the user comment data to obtain negative user comment data for the initial intelligent character, it is specifically used to:
[0117] Performing language analysis on the user comment data by using a large language model to obtain a language analysis result;
[0118] According to the language analysis result, negative user comment data for the initial intelligent character is filtered out from the user comment data.
[0119] In a feasible implementation manner, the language analysis result includes any one or more of the following:
[0120] The user comment data corresponds to the commented character behavior, the character data for executing the character behavior, the execution location of the character behavior, and the negative behavior determination result or the positive behavior determination result corresponding to the character behavior.
[0121] In a feasible implementation manner, before determining the game data corresponding to the negative user comment data in the game scene as the second game data sample, the processor is further configured to:
[0122] Determining a target scene matching the negative user review data in the game scene; the game scene corresponds to game record data;
[0123] Extracting target game record data corresponding to the target scene from the game record data corresponding to the game scene;
[0124] The target game record data is determined as game data corresponding to the negative user comment data in the game scene.
[0125] In a feasible implementation manner, when the processor determines the target scene matching the negative user review data in the game scene, it is specifically used to:
[0126] According to the release time of the negative user comment data, determining a scene time in the game scene that matches the release time;
[0127] According to the scene time, a target scene matching the negative user comment data is determined in the game scene.
[0128] In a feasible implementation manner, when the processor determines the scene time in the game scene that matches the release time according to the release time of the negative user comment data, it is specifically used to:
[0129] Determining a release time of the negative user review data;
[0130] Determine a target time period within a preset time period before the release time;
[0131] The scene time period corresponding to the target time period in the game scene is determined as the scene time in the game scene that matches the release time.
[0132] In a feasible implementation manner, the game data includes any one or more of the following:
[0133] The behavior data and status data of the initial intelligent character in the game scene, the execution position of the behavior corresponding to the behavior data, the game situation data of the game, and the status data of other virtual characters in the game scene except the initial intelligent character.
[0134] In a feasible implementation manner, when the processor trains the initial model using the first game data sample and the second game data sample to obtain the target model, the processor is specifically configured to:
[0135] Based on the first game data sample and the second game data sample, the initial model is trained by an optimized cross entropy loss function to obtain a target model; wherein the optimized cross entropy loss function is used to simultaneously process the first game data sample with the correct label and the second game data sample with the incorrect label.
[0136] In a feasible implementation scheme, the optimized cross entropy loss function includes: cross entropy loss data corresponding to the correct label and additional penalty data corresponding to the incorrect label.
[0137] In a feasible implementation manner, the cross entropy loss data corresponding to the correct label is determined according to the sample quantity of the first game data sample and the probability that the current training object sample is predicted to belong to the correct label;
[0138] The additional penalty data corresponding to the wrong label is determined according to the sample quantity of the second game data sample and the probability that the current training object sample is predicted to belong to the correct label.
[0139] Through the above method, by identifying negative user comments on the intelligent character, and using the game data corresponding to the negative user comments in the game scene as the second sample with an incorrect label, the second sample is mixed with the conventional first positive sample with a correct label for training to improve the intelligent character, so that the intelligent character can be adjusted and optimized according to the actual needs of users, not only teaching the intelligent character the correct game behavior, but also enabling the intelligent character to effectively learn how to identify and avoid incorrect game behavior, thereby expanding the learning scope of the intelligent character, allowing the improved intelligent character to adapt to a variety of game situations, thereby improving the adaptability of the intelligent character, thereby enhancing the game performance of the intelligent character and the user's interactive experience.
[0140] In practical applications, the memory 601 may include a high-speed random access memory (RAM), and may also include a non-volatile memory, such as at least one disk storage. The communication connection between the system network element and at least one other network element is realized through at least one communication interface 604 (which may be wired or wireless), and the Internet, wide area network, local area network, metropolitan area network, etc. may be used.
[0141] The bus 603 may be an ISA bus, a PCI bus, or an EISA bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 6 Only one bidirectional arrow is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0142] Among them, the memory 601 is used to store programs, and the processor 602 executes the program after receiving the execution instruction. The method executed by the device defined by the process disclosed in any embodiment of the present disclosure can be applied to the processor 602 or implemented by the processor 602.
[0143] The processor 602 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the hardware integrated logic circuit or software instructions in the processor 602. The above processor 602 can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The disclosed methods, steps and logic block diagrams in the embodiments of the present disclosure can be implemented or executed. The general processor can be a microprocessor or the processor can also be any conventional processor, etc. The steps of the method disclosed in conjunction with the embodiments of the present disclosure can be directly embodied as a hardware decoding processor for execution, or a combination of hardware and software modules in the decoding processor for execution. The software module can be located in a storage medium mature in the art, such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory 601, and the processor 602 reads the information in the memory 601 and completes the steps of the above method in combination with its hardware.
[0144] The present disclosure also provides a computer-readable storage medium, on which a computer program is stored. The computer program is executed when a processor is running, and the processor performs the following steps:
[0145] Obtaining user review data for the game; wherein the game scene of the game includes an initial intelligent character, the initial intelligent character is an initial model generated by training with a first game data sample, and the first game data sample corresponds to a correct label;
[0146] Performing language recognition on the user comment data to obtain negative user comment data for the initial intelligent character;
[0147] Determine the game data corresponding to the negative user comment data in the game scene as a second game data sample; wherein the second game data sample corresponds to an error label;
[0148] The initial model is trained using the first game data sample and the second game data sample to obtain a target model; wherein the target model serves as a target intelligent character that replaces the initial intelligent character in the game scene.
[0149] In a feasible implementation manner, when the processor performs language recognition on the user comment data to obtain negative user comment data for the initial intelligent character, it is specifically used to:
[0150] Performing language analysis on the user comment data by using a large language model to obtain a language analysis result;
[0151] According to the language analysis result, negative user comment data for the initial intelligent character is filtered out from the user comment data.
[0152] In a feasible implementation manner, the language analysis result includes any one or more of the following:
[0153] The user comment data corresponds to the commented character behavior, the character data for executing the character behavior, the execution location of the character behavior, and the negative behavior determination result or the positive behavior determination result corresponding to the character behavior.
[0154] In a feasible implementation manner, before determining the game data corresponding to the negative user comment data in the game scene as the second game data sample, the processor is further configured to:
[0155] Determining a target scene matching the negative user review data in the game scene; the game scene corresponds to game record data;
[0156] Extracting target game record data corresponding to the target scene from the game record data corresponding to the game scene;
[0157] The target game record data is determined as game data corresponding to the negative user comment data in the game scene.
[0158] In a feasible implementation manner, when the processor determines the target scene matching the negative user review data in the game scene, it is specifically used to:
[0159] According to the release time of the negative user comment data, determining a scene time in the game scene that matches the release time;
[0160] According to the scene time, a target scene matching the negative user comment data is determined in the game scene.
[0161] In a feasible implementation manner, when the processor determines the scene time in the game scene that matches the release time according to the release time of the negative user comment data, it is specifically used to:
[0162] Determining a release time of the negative user review data;
[0163] Determine a target time period within a preset time period before the release time;
[0164] The scene time period corresponding to the target time period in the game scene is determined as the scene time in the game scene that matches the release time.
[0165] In a feasible implementation manner, the game data includes any one or more of the following:
[0166] The behavior data and status data of the initial intelligent character in the game scene, the execution position of the behavior corresponding to the behavior data, the game situation data of the game, and the status data of other virtual characters in the game scene except the initial intelligent character.
[0167] In a feasible implementation manner, when the processor trains the initial model using the first game data sample and the second game data sample to obtain the target model, the processor is specifically configured to:
[0168] Based on the first game data sample and the second game data sample, the initial model is trained by an optimized cross entropy loss function to obtain a target model; wherein the optimized cross entropy loss function is used to simultaneously process the first game data sample with the correct label and the second game data sample with the incorrect label.
[0169] In a feasible implementation scheme, the optimized cross entropy loss function includes: cross entropy loss data corresponding to the correct label and additional penalty data corresponding to the incorrect label.
[0170] In a feasible implementation manner, the cross entropy loss data corresponding to the correct label is determined according to the sample quantity of the first game data sample and the probability that the current training object sample is predicted to belong to the correct label;
[0171] The additional penalty data corresponding to the wrong label is determined according to the sample quantity of the second game data sample and the probability that the current training object sample is predicted to belong to the correct label.
[0172] Through the above method, by identifying negative user comments on the intelligent character, and using the game data corresponding to the negative user comments in the game scene as the second sample with an incorrect label, the second sample is mixed with the conventional first positive sample with a correct label for training to improve the intelligent character, so that the intelligent character can be adjusted and optimized according to the actual needs of users, not only teaching the intelligent character the correct game behavior, but also enabling the intelligent character to effectively learn how to identify and avoid incorrect game behavior, thereby expanding the learning scope of the intelligent character, allowing the improved intelligent character to adapt to a variety of game situations, thereby improving the adaptability of the intelligent character, thereby enhancing the game performance of the intelligent character and the user's interactive experience.
[0173] In the embodiments of the present disclosure, the computer program can also execute other machine-readable instructions when run by the processor to execute other methods described in the embodiments. For the specific execution method steps and principles, please refer to the description of the embodiments, which will not be repeated here.
[0174] In the embodiments provided in the present disclosure, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interfaces, and the indirect coupling or communication connection of devices or units can be electrical, mechanical or other forms.
[0175] For another example, the flowcharts and block diagrams in the accompanying drawings show the possible architecture, functions and operations of the devices, methods and computer program products according to multiple embodiments of the present disclosure. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of a code, and the module, a program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of the boxes in the block diagram and / or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.
[0176] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0177] In addition, each functional unit in the embodiments provided in the present disclosure may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0178] If the function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present disclosure can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the training method of the intelligent character in the game described in each embodiment of the present disclosure. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, referred to as ROM), random access memory (Random Access Memory, referred to as RAM), disk or optical disk and other media that can store program codes.
[0179] It should be noted that similar numbers and letters represent similar items in the following figures. Therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures. In addition, the terms "first", "second", "third", etc. are only used to distinguish the description and are not to be understood as indicating or implying relative importance.
[0180] Finally, it should be noted that the above-described embodiments are only specific implementation methods of the present disclosure, which are used to illustrate the technical solutions of the present disclosure, rather than to limit them. The protection scope of the present disclosure is not limited thereto. Although the present disclosure is described in detail with reference to the aforementioned embodiments, ordinary technicians in the field should understand that any technician familiar with the technical field can still modify the technical solutions recorded in the aforementioned embodiments within the technical scope disclosed in the present disclosure, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the scope of the technical solutions of the embodiments of the present disclosure. They should all be included in the protection scope of the present disclosure. Therefore, the protection scope of the present disclosure shall be based on the protection scope of the claims.
Claims
1. A method for training an intelligent character in a game, characterized in that: The method comprises: Obtaining user review data for the game; wherein the game scene of the game includes an initial intelligent character, the initial intelligent character is an initial model generated by training with a first game data sample, and the first game data sample corresponds to a correct label; Performing language recognition on the user comment data to obtain negative user comment data for the initial intelligent character; Determine the game data corresponding to the negative user comment data in the game scene as a second game data sample; wherein the second game data sample corresponds to an error label; The initial model is trained using the first game data sample and the second game data sample to obtain a target model; wherein the target model serves as a target intelligent character that replaces the initial intelligent character in the game scene.
2. The method according to claim 1, characterized in that The performing language recognition on the user comment data to obtain negative user comment data for the initial intelligent character includes: Performing language analysis on the user comment data by using a large language model to obtain a language analysis result; According to the language analysis result, negative user comment data for the initial intelligent character is filtered out from the user comment data.
3. The method according to claim 2, characterized in that The language analysis results include any one or more of the following: The user comment data corresponds to the commented character behavior, the character data for executing the character behavior, the execution location of the character behavior, and the negative behavior determination result or the positive behavior determination result corresponding to the character behavior.
4. The method according to claim 1, characterized in that Before determining the game data corresponding to the negative user comment data in the game scene as the second game data sample, the method further includes: Determining a target scene matching the negative user review data in the game scene; the game scene corresponds to game record data; Extracting target game record data corresponding to the target scene from the game record data corresponding to the game scene; The target game record data is determined as game data corresponding to the negative user comment data in the game scene.
5. The method according to claim 4, characterized in that The determining of a target scene matching the negative user review data in the game scene includes: According to the release time of the negative user comment data, determining a scene time in the game scene that matches the release time; According to the scene time, a target scene matching the negative user comment data is determined in the game scene.
6. The method according to claim 5, characterized in that The step of determining, according to the release time of the negative user comment data, a scene time in the game scene that matches the release time comprises: Determining a release time of the negative user review data; Determine a target time period within a preset time period before the release time; The scene time period corresponding to the target time period in the game scene is determined as the scene time in the game scene that matches the release time.
7. The method according to claim 4, characterized in that The game data includes any one or more of the following: The behavior data and status data of the initial intelligent character in the game scene, the execution position of the behavior corresponding to the behavior data, the game situation data of the game, and the status data of other virtual characters in the game scene except the initial intelligent character.
8. The method according to claim 1, characterized in that The using the first game data sample and the second game data sample to train the initial model to obtain a target model includes: Based on the first game data sample and the second game data sample, the initial model is trained by an optimized cross entropy loss function to obtain a target model; wherein the optimized cross entropy loss function is used to simultaneously process the first game data sample with the correct label and the second game data sample with the incorrect label.
9. The method according to claim 8, characterized in that The optimized cross entropy loss function includes: cross entropy loss data corresponding to the correct label and additional penalty data corresponding to the wrong label.
10. The method according to claim 9, characterized in that The cross entropy loss data corresponding to the correct label is determined according to the sample quantity of the first game data sample and the probability that the current training object sample is predicted to belong to the correct label; The additional penalty data corresponding to the wrong label is determined according to the sample quantity of the second game data sample and the probability that the current training object sample is predicted to belong to the correct label.
11. A training device for an intelligent character in a game, characterized in that: include: An acquisition module, used to acquire user comment data for the game; wherein the game scene of the game includes an initial intelligent character, the initial intelligent character is an initial model generated by training with a first game data sample, and the first game data sample corresponds to a correct label; an identification module, configured to perform language identification on the user comment data to obtain negative user comment data for the initial intelligent character; A determination module, configured to determine game data corresponding to the negative user comment data in the game scene as a second game data sample; wherein the second game data sample corresponds to an error label; A training module is used to train the initial model using the first game data sample and the second game data sample to obtain a target model; wherein the target model serves as a target intelligent character that replaces the initial intelligent character in the game scene.
12. An electronic device comprising a memory and a processor, wherein the memory stores a computer program that can be run on the processor, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 10 are implemented.
13. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions. When the computer-executable instructions are called and executed by a processor, the computer-executable instructions prompt the processor to execute the method according to any one of claims 1 to 10.