News generation method and related device
By combining a virtual knowledge base and event library with a large language model to generate news data, the problem of inefficient news generation in the game is solved, the game is aligned with the game context and player interaction behavior, and the gaming experience and player stickiness are improved.
Patent Information
- Application Number
- CN202410288951.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-03-13
- Publication Date
- 2025-09-16
AI Technical Summary
In the existing technology, the generation of in-game news information relies on manual writing, which is inefficient and difficult to ensure the real-time and accuracy of the information. It is also unable to effectively record player interaction behaviors, affecting the gaming experience.
By acquiring target events and related events, utilizing the virtual knowledge base and event library built based on the virtual worldview, and combining it with a large language model to generate news data, we ensure that the news content is consistent with the game background and player interaction behavior.
It improves the efficiency and accuracy of news generation, enhances the immersion and sense of involvement in the game, and improves the player's gaming experience and stickiness.
Smart Images

Figure CN120643915A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of artificial intelligence technology, and in particular to a news generation method and related devices. Background Art
[0002] Games are a primary form of leisure and entertainment. With the advancement of information technology, competition in the gaming industry is becoming increasingly fierce, forcing game developers to continuously improve the gaming experience to meet player needs. For games that require strong player-to-player interaction or human-computer interaction, publishing news to record these interactions can provide players with greater emotional value and motivate more players to participate. Currently, in-game news is manually compiled and published by game operators based on events occurring within the server, presumably based on their understanding of the game world. This is labor-intensive and expensive. Summary of the Invention
[0003] The embodiments of the present application provide a news generation method and related devices, which can automatically generate news information that conforms to the game background based on events within the game.
[0004] One aspect of the present application provides a news generation method, comprising:
[0005] Obtaining target events, which indicate the interactive behavior of target objects in a target scene. The target scene is a virtual scene, which is constructed based on a virtual worldview.
[0006] Based on the target scenario, the target background is retrieved in the virtual knowledge base, which is constructed based on the virtual world view;
[0007] Based on the target object, the associated events are retrieved from the event library, which is built based on the interactive behaviors in the virtual scene;
[0008] Input data including a target event, target background, and related events is input into the large language model through prompt words, and the prompt words are used to instruct the large language model to generate news data based on the input data;
[0009] Output news data through a large language model.
[0010] In a possible implementation method, obtaining a target event includes:
[0011] A target event is generated in response to the interactive behavior of the target object in the target scene.
[0012] In a possible implementation method, before retrieving the target context from the virtual knowledge base based on the target scenario, the method further includes:
[0013] Obtain textual materials of the virtual worldview;
[0014] Segmenting textual material into multiple text segments;
[0015] A virtual knowledge base is constructed based on multiple text fragments, and the target context belongs to multiple text fragments.
[0016] In one possible implementation method, based on the target scenario, the target background is retrieved from the virtual knowledge base, including:
[0017] Calculating similarities between the target event and the multiple text segments to obtain corresponding multiple first similarities;
[0018] Calculating similarities between the target scene and the plurality of text segments to obtain corresponding plurality of second similarities;
[0019] Calculating a weighted similarity between the first similarity and the second similarity based on a preset weight distribution;
[0020] The target context is determined based on the K text segments with the highest weighted similarity in the virtual knowledge base, where K is a natural number.
[0021] In one possible implementation method, the virtual knowledge base is an N-ary tree knowledge base; determining the target context based on K text segments with the highest weighted similarity in the virtual knowledge base includes:
[0022] Determine the K text segments with the highest weighted similarity in the virtual knowledge base as candidate contexts;
[0023] Determine relevant backgrounds based on the parent-child node relationship of candidate backgrounds in the N-ary tree knowledge base;
[0024] The candidate contexts and the related contexts are determined as the target contexts.
[0025] In a possible implementation method, before retrieving the associated event from the event library based on the target object, the method further includes:
[0026] Obtain each interactive behavior of the virtual object in each virtual scene and generate an interactive event. The target object belongs to the virtual object, and the associated event belongs to the interactive event.
[0027] Build an event library based on interaction events.
[0028] In a possible implementation method, based on the target object, related events are retrieved from the event library, including:
[0029] Calculate the degree of association between the target object and the interaction event. The degree of association is determined by the similarity, weight coefficient, and attenuation coefficient. The weight coefficient is determined by the type of interaction behavior in the interaction event. The attenuation coefficient is inversely proportional to the time interval between the interaction event and the target event.
[0030] The associated events are determined based on the M interaction events with the highest degree of association in the event library, where M is a natural number.
[0031] In a possible implementation method, determining associated events based on the M most highly associated interaction events in the event library includes:
[0032] Determine the M interactive events with the highest correlation in the event database as candidate events;
[0033] The M candidate events are filtered based on the target object to obtain associated events, where the associated events include the target object.
[0034] In a possible implementation method, after outputting the news data through the large language model, the following steps are further included:
[0035] Store target events and / or news data in the event library.
[0036] Another aspect of the present application provides a news generating device, comprising:
[0037] An acquisition module is used to acquire target events, which indicate the interactive behavior of the target object in the target scene. The target scene is a virtual scene, which is constructed based on the virtual world view.
[0038] A first retrieval module is used to retrieve a target context from a virtual knowledge base based on a target scenario, where the virtual knowledge base is constructed based on a virtual worldview;
[0039] The second retrieval module is used to retrieve related events in the event library based on the target object, and the event library is constructed based on the interactive behaviors in the virtual scene;
[0040] A generation module, configured to input input data including a target event, target context, and related events into a large language model through prompt words, wherein the prompt words are used to instruct the large language model to generate news data based on the input data;
[0041] The output module is used to output news data through the large language model.
[0042] In a possible implementation method, the acquisition module is specifically configured to generate a target event in response to an interactive behavior of a target object in a target scene.
[0043] In a possible implementation method, it also includes: a first construction module, which is used to obtain text materials of the virtual world view; divide the text materials into multiple text segments; and construct a virtual knowledge base based on the multiple text segments, where the target background belongs to the multiple text segments.
[0044] In one possible implementation method, the first retrieval module is specifically used to calculate the similarity between the target event and multiple text fragments to obtain corresponding multiple first similarities; calculate the similarity between the target scene and multiple text fragments to obtain corresponding multiple second similarities; calculate the weighted similarity of the first similarity and the second similarity based on a preset weight distribution; and determine the target background based on the K text fragments with the highest weighted similarity in the virtual knowledge base, where K is a natural number.
[0045] In one possible implementation method, the virtual knowledge base is an N-ary tree knowledge base; determining the target context based on K text segments with the highest weighted similarity in the virtual knowledge base includes: determining the K text segments with the highest weighted similarity in the virtual knowledge base as candidate contexts; determining related contexts based on parent-child node relationships of the candidate contexts in the N-ary tree knowledge base; and determining the candidate contexts and the related contexts as the target contexts.
[0046] In a possible implementation method, it also includes: a second construction module, which is used to obtain various interactive behaviors of virtual objects in various virtual scenes, generate interactive events, the target object belongs to the virtual object, and the associated event belongs to the interactive event; and construct an event library based on the interactive events.
[0047] In one possible implementation method, the second retrieval module is specifically used to calculate the degree of association between the target object and the interaction event, where the degree of association is determined by the similarity, weight coefficient and attenuation coefficient. The weight coefficient is determined by the type of interactive behavior in the interaction event, and the attenuation coefficient is inversely proportional to the time interval between the interaction event and the target event. The associated events are determined based on the M interaction events with the highest degree of association in the event library, where M is a natural number.
[0048] In a possible implementation method, related events are determined based on the M most highly correlated interaction events in an event library, including: determining the M most highly correlated interaction events in the event library as candidate events; filtering the M candidate events based on a target object to obtain related events, wherein the related events include the target object.
[0049] In a possible implementation method, it further includes: a storage module, which is used to store the target event and / or news data in an event library.
[0050] Another aspect of the present application provides a computer device, comprising:
[0051] memory, and processor;
[0052] The memory stores instructions, and when the instructions are executed on the processor, the above methods are executed.
[0053] Another aspect of the present application provides a computer-readable storage medium, wherein instructions are stored in the computer-readable storage medium. When the computer-readable storage medium is run on a computer, the computer is enabled to execute the above-mentioned methods.
[0054] Another aspect of the present application provides a computer program product or computer program, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device performs the methods provided by the above aspects.
[0055] It can be seen from the above technical solutions that the embodiments of the present application have the following advantages:
[0056] The present application provides a news generation method and related devices. First, a target event is obtained, which includes the interactive behavior of a target object in a target scene. Then, based on the target scene, a target background is retrieved from a virtual knowledge base built based on the virtual world view. In addition, related events are retrieved from the event library based on the target object. The target event, target background, and related events are input into a large language model through prompt words to obtain news data output by the large language model. The present application adopts a dual-library design, one of which is a virtual knowledge base built based on a virtual world view, and the other is used to record the historical interactive behavior of virtual objects in virtual scenes. The ability of the large language model is combined with the contents of the two libraries to generate news data related to the current target event. The generated news data not only fits the world view of the game and helps players fully understand the background of the game, but can also be associated with other interactive behaviors of players to enhance the immersion and sense of substitution of the game, which is conducive to implanting emotions and improving user stickiness. BRIEF DESCRIPTION OF THE DRAWINGS
[0057] Figure 1 This is an application environment diagram of the news generation method in the embodiment of the present application;
[0058] Figure 2a A flow chart of a news generation method provided in an embodiment of the present application;
[0059] Figure 2b A schematic diagram of a game interface when a player is playing a game;
[0060] Figure 2c to Figure 2e A schematic diagram of displaying news in a game interface is provided for an embodiment of the present application;
[0061] Figure 3 A flow chart of the news generation method provided in an embodiment of the present application;
[0062] Figure 4This is a flow chart of event storage in an event library based on memory stream design provided in an embodiment of the present application;
[0063] Figure 5 A processing flow chart corresponding to the news generation method provided in an embodiment of the present application;
[0064] Figure 6 This is an application interface diagram corresponding to the news generation method provided in the embodiment of the present application;
[0065] Figure 7 This is a schematic diagram of an embodiment of a news generating device in an embodiment of the present application;
[0066] Figure 8 This is a system architecture diagram corresponding to the news generation method provided in the embodiment of the present application;
[0067] Figure 9 This is a schematic diagram of a server structure provided in an embodiment of the present application. DETAILED DESCRIPTION
[0068] The terms "first", "second", "third", "fourth", etc. (if any) in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequential order. It should be understood that the numbers used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can, for example, be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "corresponding to" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0069] Artificial Intelligence (AI) refers to the theories, methods, techniques, and application systems that use digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, to perceive the environment, acquire knowledge, and use that knowledge to achieve optimal results. In other words, AI is a comprehensive technology within computer science that seeks to understand the essence of intelligence and produce new intelligent machines that can respond in a manner similar to human intelligence. AI also involves studying the design principles and implementation methods of various intelligent machines, enabling them to possess the capabilities of perception, reasoning, and decision-making.
[0070] Artificial intelligence (AI) technology is a comprehensive discipline encompassing a wide range of fields, encompassing both hardware and software technologies. Foundational AI technologies generally include sensors, specialized AI chips, cloud computing, distributed storage, big data processing, operating / interaction systems, and mechatronics. AI software technologies primarily encompass computer vision, speech processing, natural language processing, and machine learning / deep learning.
[0071] Natural language processing (NLP) is a key area of research in computer science and artificial intelligence. It studies the theories and methods that enable effective communication between humans and computers using natural language. Natural language processing (NLP) integrates linguistics, computer science, and mathematics. Therefore, research in this field involves natural language—the language we use in everyday life—and is closely linked to the study of linguistics. Natural language processing technologies typically include text processing, semantic understanding, machine translation, robotic question answering, and knowledge graphs.
[0072] With the research and advancement of artificial intelligence technology, artificial intelligence technology has been studied and applied in many fields, such as common smart homes, smart wearable devices, virtual assistants, smart speakers, smart marketing, unmanned driving, autonomous driving, drones, robots, smart medical care, games, smart customer service, etc. It is believed that with the development of technology, artificial intelligence technology will be applied in more fields and play an increasingly important role.
[0073] The solution provided in the embodiments of the present application relates to natural language processing technology, and specifically to the application of a large language model (LLM) based on natural language processing training.
[0074] Games are one of the main ways for people to relax and entertain themselves. With the development of information technology, competition in the gaming industry is indeed becoming increasingly fierce, forcing game developers to constantly innovate and improve the gaming experience to meet the growing needs of players.
[0075] For some games with strong player interaction or human-computer interaction, how to record and display these wonderful interactive behaviors becomes the key.
[0076] For example, in games like strategy simulations (which emphasize strategic planning and resource management, requiring players to develop power and battle strategies within realistic or fictional worlds) and role-playing games (where players assume the role of a character in a realistic or fictional world, developing their character through actions), players need to interact with other player characters and non-player characters (NPCs) within the corresponding game server. These games often construct maps based on the game worldview. Some of these maps may contain powerful bosses, requiring players to explore and defeat them. On the current game server, players who defeat a boss for the first time can record these precious moments by posting a news item, providing players with more memories and emotional value. This can also effectively motivate other players to participate, increasing game activity and engagement.
[0077] Currently, most in-game news releases are manually written. Game operators, relying on a deep understanding of the game world and based on events occurring within the server, expend considerable time and effort to craft news releases. This requires an understanding of the game world and the ability to monitor every event occurring on the server after the game launches in order to craft press releases tailored to the specific events occurring on that server. This approach is not only inefficient and difficult to ensure real-time information, but also inherently biased, often incorporating subjective thought and omissions from detailed descriptions of events. In short, human thought, judgment, and emotion can all influence the accuracy of the final press release.
[0078] In order to solve the above problems, the present application provides a news generation method and related devices, which can generate corresponding press releases by obtaining some key interactive behaviors of players in the game scene. The press release not only includes information about the interactive behavior itself, but also involves the game background and the player's historical game plot, which can enhance the immersion and sense of substitution of the game. At the same time, the automatic press release output method based on artificial intelligence improves the timeliness of news output, and can more comprehensively discover and broadcast exciting events in the game, thereby improving the player's gaming experience.
[0079] For easier understanding, see Figure 1 , Figure 1 FIG. 1 is an application environment diagram of the news generation method in the embodiment of the present application, such as Figure 1As shown, the news generation method in the embodiment of the present application is applied to a news generation system. The news generation system includes: a server and a terminal device; wherein the server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (Content Delivery Network, CDN), and big data and artificial intelligence platforms. The terminal can be a smart phone, tablet computer, laptop computer, desktop computer, smart speaker, smart watch, etc., but is not limited to this. The terminal and the server can be directly or indirectly connected by wired or wireless communication, and the embodiment of the present application is not limited here.
[0080] The server first obtains a target event, which refers to the target object's interactive behavior in the target scene. A target event is an event that occurs in the game, such as defeating a boss, capturing a city, initiating a war, or acquiring an item. A target object is a virtual object, which can be the player, a group they belong to, or other derivative objects. A target scene is a virtual scene constructed based on a virtual worldview and includes a geographic location, virtual weapons and equipment, and NPCs. Based on the target scene, a target context is retrieved from a virtual knowledge base constructed based on the virtual worldview. This context can be used to describe the target scene. For example, if the target scene includes a geographic location, the context can include the terrain at that location, past events, and related virtual objects involved. If the target scene includes virtual weapons and equipment, the context can include a description of the virtual weapons and equipment from their production, use, repair, to their final whereabouts. Based on the target object, associated events are retrieved from an event library. This library contains the interactive behaviors in the virtual scene, indicating past events that occurred in the virtual scene. Associated events are historical events related to the target object. The target event, target context, and related events are input into the large language model through prompt words to generate news data. This generated news data not only aligns with the game's worldview, helping players fully understand the game context, but also connects with other player interactions to enhance immersion and involvement, fostering nostalgia and increasing user engagement.
[0081] The following describes the news generation method in this application from the perspective of the server. Figure 2a , Figure 2a The method flow chart of the news generation method provided in the embodiment of the present application includes:
[0082] 201, obtaining a target event, where the target event indicates the interactive behavior of the target object in the target scene. The target scene is a virtual scene, which is constructed based on a virtual worldview.
[0083] In a game server, when a target event occurs and a press release needs to be generated based on it, the target event is first obtained. This target event refers to the interactive behavior of a virtual object in a specific virtual scene. These behaviors can be key moments in the game, such as a player successfully defeating a powerful boss, capturing an enemy city, engaging in a fierce battle with other players, or obtaining a valuable item. The occurrence of these target events has a significant impact on the game's progress and the player's experience, so corresponding press releases need to be generated based on these target events.
[0084] The target object is the virtual entity associated with these events. This can be a player, a team, or other related derivative objects. Player groups exist in different forms in different games, such as alliances, tribes, guilds, and clans.
[0085] The target scene is the virtual environment in which these events take place. It's built on the game's virtual worldview, including elements like geographic location, virtual weapons and equipment, and NPCs. The virtual worldview refers to the game world presented to players by game designers, including its world structure, character settings, and storyline.
[0086] For example, if the content of an event is: "Player B of Guild A defeated Leader D in Location C", then in this event, "Guild A" and "Player B" are target objects, and "Location C" and "Leader D" are target scenes.
[0087] 202, based on the target scenario, the target background is retrieved in the virtual knowledge base, and the virtual knowledge base is constructed based on the virtual world view.
[0088] After obtaining the target event, the target scene in the target event is searched in the virtual knowledge base to obtain the target background. This virtual knowledge base is built based on the virtual world view of the game and contains various information and data related to the game world.
[0089] This target background describes and supplements the target scene, providing deeper background knowledge and context. For example, if the target scene involves a specific geographical location, the target background may include a detailed description of the terrain, important events that have occurred there, and historical figures and stories related to the location. This information is usually used to help players better understand the importance and significance of this geographical location in the game world, increasing the explorability and fun of the game. For another example, if the target scene involves virtual weapons and equipment, the target background may include the production process, usage history, repair records, and the final whereabouts and ownership of the virtual weapons and equipment.
[0090] 203, based on the target object, the associated event is retrieved from the event library, and the event library is constructed based on the interactive behavior in the virtual scene.
[0091] After acquiring the target event, the event library is searched based on the target object to obtain related events. This event library is established to record various interactive behaviors that occur in the virtual scene and includes rich historical data and information.
[0092] Related events are historical events related to the target object. These events record the target object's behavior and experience in the virtual scene and can be used to understand the target object's background and story.
[0093] For example, if the target object is a player, then the related events may include the player's growth process, past combat experience, relationships with other players, etc. This information is used to understand the player's abilities and background, including the target object's creation time, the sect it belongs to, and the achievements it has obtained.
[0094] It's understandable that games typically offer name-changing services for players and groups, allowing them to change their names at will. Therefore, searching for the target object's identity document (ID) is possible. For example, a few days ago, a player named "Zhang San" experienced an event called "Zhang San announced victory in the battle of Guangmingding." However, today, Zhang San changed his name to "Li Si." If a direct search in the event library using "Li Si" is performed, no historical events related to Zhang San may be found. Therefore, the object ID can be used instead of the object name. For example, if Zhang San's UID is "0000000," then the event could be "0000000 announced victory in the battle of Guangmingding" or "UID_0000000 announced victory in the battle of Guangmingding." When searching the event library, historical events with the UID "0000000" can be found.
[0095] 204 , input data including the target event, target background, and related events is input into the large language model through prompt words, and the prompt words are used to instruct the large language model to generate news data based on the input data.
[0096] The Large Language Model (LLM) is a deep learning model trained on massive amounts of text data. It can generate natural language text, deeply understand the meaning of the text, and handle various natural language tasks. By inputting the target event, target context, and related events into the LLM through prompts, news data can be generated using the LLM's text understanding and natural language processing capabilities. Prompts are text or instructions that provide input to the model to guide it to generate specific outputs. For example, the prompt content can be as follows:
[0097] Please generate a game newsletter for me, the main content is:
[0098] [Text 1]
[0099] The following is related content, including introductions to the game background, event background, character background, etc. Some of them are irrelevant to the current news, while others are related. You need to make your own judgment:
[0100] [Text 2]
[0101] [Text 3]
[0102] Output requirements:
[0103] Based on the main content and related content, please focus on the characteristics of the parties involved and relevant records, and generate about 200 words.
[0104] remind:
[0105] No irrelevant content other than the relevant content may appear.”
[0106] In the above prompt words, [Text 1] corresponds to the target event, [Text 2] and [Text 3] correspond to the target background and related events.
[0107] Suppose in a game, a player successfully defeats the game's boss, and news data needs to be generated for this event. In this case, the text corresponding to the target event is: "Player A defeated boss C in location B."
[0108] Based on location B and leader C, the following target background is retrieved from the virtual knowledge base:
[0109] "In the southeast corner of the Fantasy Land, there is a mysterious place shrouded in thick fog, called Land A."
[0110] "Legend has it that an ancient evil dragon, Chief C, became enraged. It flew out from deep underground, spewing flames and reducing the entire Land A to ashes."
[0111] "Now, Land A has become a place full of mystery and danger. One day in the future, perhaps a brave adventurer will defeat Chief C and liberate this land."
[0112] Based on player A, the following related events are retrieved from the event library:
[0113] "Two days ago, player A obtained legendary weapon D."
[0114] "3 days ago, player A joined team E."
[0115] By inputting the above content into the large language model through the prompt word, we can get the following results:
[0116] "Game News:
[0117] Recently, in the southeastern corner of the Fantasy Land, the mysterious Land A witnessed an epic decisive battle. Player A, armed with legendary weapon D and supported by Team E, successfully defeated the raging dragon leader C. This victory not only demonstrated Player A's bravery and wisdom, but also highlighted Team E's teamwork and tacit understanding. With this victory, the mystery and danger of Land A dissipated, and Player A's heroic deeds will be recorded in history forever. This decisive battle not only liberated Land A but also established a new milestone for all adventurers.
[0118] 205, output news data through a large language model.
[0119] As you can understand, target events are key events in the game, such as boss defeats and city captures. News data generated based on target events can capture these precious moments, providing players with more memories and emotional value. Target context is descriptive text related to the game world, helping players better understand the game scenes and elements, enhancing their immersion. Related events are events related to the target object, specifically the target object's memories in the game, which can enhance players' sense of immersion. By using large-scale language models to generate news data, we can provide players with a richer and more in-depth gaming experience. This news data not only aligns with the game world, helping players fully understand the game context, but can also be linked to other player interactions to enhance immersion and involvement. Furthermore, this data helps instill nostalgia, improve user stickiness, foster a deeper love for the game, and increase its continued appeal and replayability.
[0120] The news data generated by the method provided in the embodiment of the present application can be displayed in a variety of forms in the game client. The following are some possible display forms and possible behaviors and interactions that players may generate, such as Figures 2b to 2e As shown, Figure 2b This is a schematic diagram of the game interface when a player is playing a game. When the game application is running, the game interface is used to display the game interface of the game application. Users can click different buttons in the game interface to control the game character, such as controlling the game character to "defend", "summon" (helper), "use" (props), "attack", etc.; users can also click different options in the game interface to make the game interface display accordingly, for example: when the user clicks "map", the game map appears in the game interface; when the user clicks "chat box", the interaction record between players appears in the game interface; when the user clicks buttons such as "settings", "mail", "task", and "news", the game interface displays the corresponding settings menu, mail list, task list, game news, etc.
[0121] 1) News data can be displayed through game pop-ups or news panels: See Figure 2c When important news is released during the game, a window with the news title and content can pop up to attract the player's attention. Furthermore, the window can also include pictures related to the news content (Picture 1, Picture 2, etc.) and a chat window, which can be used for players to discuss the news. Similarly, players can also click the "News" button in the interface to display the following information: Figure 2c The News window shown.
[0122] 2) News data can be displayed by scrolling news bars: see Figure 2d , set a scrolling news bar at the edge of the game interface (such as above the game interface), and display the latest game news through real-time updated game dynamics and announcements. Further, after the user clicks on the scrolling news bar, he can also enter the Figure 2c The news window shown can be discussed through the chat window.
[0123] 3) You can display news data in the chat box: Figure 2e As shown, the news release can be embedded in the chat window as a special message. For example, a specific color, font, or logo can be used to distinguish the news message from other messages. After players see the news in the chat window, they can directly comment or provide feedback in the chat box.
[0124] The news generation method provided in the embodiment of the present application first obtains the target event, which includes the interactive behavior of the target object in the target scene; then, based on the target scene, the target background is retrieved from the virtual knowledge base constructed based on the virtual world view; in addition, based on the target object, the related events are retrieved from the event library; the target event, target background and related events are input into the large language model through prompt words to obtain news data output by the large language model. The present application adopts a dual-library design, one of which is a virtual knowledge base constructed based on the virtual world view, and the other is used to record the historical interactive behavior of the virtual object in the virtual scene. The ability of the large language model is combined with the content of the two libraries to generate news data related to the current target event, so that the generated news data not only fits the world view of the game and helps players fully understand the background of the game, but can also be associated with other interactive behaviors of the players to enhance the immersion and sense of substitution of the game, which is conducive to implanting emotions and improving user stickiness.
[0125] In this application Figure 2a In an optional embodiment of the news generation method provided in the corresponding embodiment, please refer to Figure 3 , Figure 3 The method flow chart of the news generation method provided in the embodiment of the present application includes:
[0126] 3011, obtaining textual materials of virtual worldview;
[0127] 3012, segmenting text material into multiple text segments;
[0128] 3013,constructing a virtual knowledge base based on multiple text fragments, where the target context belongs to multiple text fragments.
[0129] It can be understood that steps 3011 to 3013 provide a method for pre-building a virtual knowledge base based on a virtual world view.
[0130] In the embodiments of this application, we first obtain textual materials related to the virtual worldview. These materials can come from novels, comics, game setting documents, developer interviews, etc. The virtual worldview refers to the complete background and rule system constructed for the fictional world, including various aspects such as geography, history, culture, social structure, and technological level. For example, detailed background information about the game world, such as land distribution, ethnic history, faction structure, and magic system, can be obtained from channels such as the game manual, official website, and developer interviews.
[0131] After obtaining the complete text materials of the virtual world view, these materials need to be divided into multiple text segments. These segments can be classified according to themes, locations, timelines or characters. The purpose of segmentation is to better organize and manage information for the subsequent construction of a virtual knowledge base. For example, the text materials of the virtual world view can be divided into the following text segments: an introduction to the land (such as the multiple regional divisions in the world), the development history of various virtual character groups (such as humans, magicians, animals, etc.), the camp structure (such as the relationship between the camps, such as opposition, competition, assistance, etc.), an introduction to the magic system, etc.
[0132] After segmenting the text fragments, we can start building a virtual knowledge base. This knowledge base will contain all text fragments about the virtual world, and these fragments are interconnected in some way (such as links, tags, etc.) to form a complete knowledge system. The target context may involve multiple text fragments, because any event or entity in the virtual world may be related to multiple other aspects (such as geography, history, culture, etc.). For example, when building a virtual knowledge base for a game, the various text fragments (such as land introductions, character group development history, etc.) can be interconnected to form a complete knowledge system. For example, when we look at a text fragment about the geographical location "Guangmingding" in a certain game, we can find information related to it in many aspects, such as historical background, geographical location, and cultural characteristics.
[0133] In one possible implementation, the virtual knowledge base is specifically an N-ary tree knowledge base. In an N-ary tree knowledge base, each node may represent a concept, entity, event, or location in the virtual world, while child nodes provide more detailed or specific information about the parent node. For example, the root node may represent the entire virtual world, while its child nodes may represent different regions or cultures. The child nodes of these child nodes may further describe specific aspects of these regions or cultures, such as history, social structure, and important figures.
[0134] In one possible implementation, text snippets can be stored in a virtual knowledge base as text vectors through feature extraction. It is understood that when subsequently searching the virtual knowledge base based on a target scenario, the target scenario can also be pre-converted into a text vector through feature extraction, and the target context can be retrieved using text word embedding and vector embedding search algorithms. Embedding refers to the process of mapping discrete categorical variables (such as words or item IDs) into a continuous vector space. Embedding can be used for dimensionality reduction or to capture semantic relationships between categories.
[0135] 3021, obtaining each interactive behavior of the virtual object in each virtual scene, generating an interactive event, wherein the target object belongs to the virtual object, and the associated event belongs to the interactive event;
[0136] 3022,Build an event library based on interactive events.
[0137] It can be understood that steps 3021 and 3022 provide a method for pre-building an event library based on interaction time.
[0138] In the embodiment of the present application, interactive behavior refers to the action or operation of a virtual object interacting with other objects (including other virtual objects, environmental elements, etc.) in a virtual scene. These behaviors can be implemented through programming or triggered by user input (such as the operation of a game player).
[0139] Based on these interaction events, an event library can be constructed. This refers to a database or system that stores and manages all interaction events. These events can be queried and retrieved through the event library. The event library can contain detailed information such as the event type, time, location, participants, and results, allowing for quick access when needed.
[0140] In one possible implementation, the interaction behavior in the event library can be similar to a memory stream system, and each server event is stored in the memory stream event library.
[0141] The interactive actions of virtual objects in the virtual scene can be stored in the memory stream vector library in the form of vectors. A weight coefficient can be determined based on the type of interaction. This weight coefficient can be used to indicate the importance of the interaction, and the specific parameters can be determined based on the game rules. For example, the interaction of killing a regional boss for the first time will have a higher weight coefficient, while the interaction of completing the main game mission will have a lower weight coefficient.
[0142] In addition, events based on the memory stream form will decay over time. Therefore, after performing an interactive behavior, the timestamp of the interactive behavior can be recorded, and the degree of decay of the event can be determined by the decay coefficient. For example, the decay coefficient of 0.99 / hour is multiplied by the weight coefficient, indicating that the longer the time, the lower the weight coefficient corresponding to the event.
[0143] In one possible implementation method, events corresponding to various interactive behaviors can be stored in the event library in the form of text vectors through feature extraction. It can be understood that when subsequently searching in the event library based on the target object, the target object can also be converted into a text vector in advance through feature extraction, and related events can be retrieved based on the text embedding search algorithm.
[0144] 303. In response to the interactive behavior of the target object in the target scene, a target event is generated. The target scene is a virtual scene, and the virtual scene is constructed based on a virtual world view.
[0145] In the embodiment of the present application, step 303 is the same as the above Figure 2a This corresponds to step 201 in the embodiment.
[0146] It is understood that games typically have an event response system for detecting interactive behaviors, determining trigger conditions, and generating and executing corresponding events. Therefore, in the embodiments of the present application, corresponding events can be generated based on various interactive behaviors of virtual objects in the virtual scene. Correspondingly, corresponding target events can be generated in response to the interactive behaviors of virtual objects in the target scene.
[0147] 3041, calculating similarities between the target event and the multiple text segments to obtain corresponding multiple first similarities;
[0148] 3042, calculating similarities between the target scene and the multiple text segments to obtain corresponding multiple second similarities;
[0149] 3043, calculating a weighted similarity of the first similarity and the second similarity based on a preset weight distribution;
[0150] 3044, determining the target context based on the K text segments with the highest weighted similarity in the virtual knowledge base, where K is a natural number.
[0151] It can be understood that steps 3041 to 3044 correspond to step 302 in the embodiment corresponding to FIG. 2 .
[0152] In an embodiment of the present application, the target background is retrieved from the virtual knowledge base based on the target scene, which is achieved based on the calculation of weighted similarity. The weighted similarity includes a first similarity and a second similarity, wherein the first similarity indicates the similarity between the target event and the text fragment, and the second similarity indicates the similarity between the target scene and the text fragment. It can be understood that calculating the first similarity between the target event and the text fragment is equivalent to keyword retrieval, which is used to retrieve the text fragment including the accurate target event in the virtual knowledge base; calculating the second similarity between the target event and the text fragment is equivalent to retrieving the relevant text fragment based on the understanding of the long text. In the case of the feature extraction adopted in the retrieval process and the text embedding search algorithm, there is a problem of decreased accuracy in the similarity matching of long and short texts between shorter target scenes and longer text materials. Combining the weighted similarity search can better solve the problem of missed recall of key target backgrounds.
[0153] Specifically, since there may be multiple target scenes in a target event, when assigning weights to the first similarity and the second similarity, the weight of the target scene can be made slightly lower than the weight of the target event. For example, the weight of the target scene is 0.7, and the weight of the target event is 1.0. After calculating the similarity of the target scene and target event with all the text vectors in the virtual knowledge base through the corresponding query statement distribution, they are multiplied by their respective weights and added together to obtain the final weighted similarity score. Finally, the target background is determined based on the text fragments corresponding to the K text vectors with the highest weighted similarity scores. The weighted similarity can make the retrieval results more inclined to find the target background related to the target scene.
[0154] In one possible case, when the virtual knowledge base is an N-ary tree knowledge base, step 3044 specifically includes:
[0155] Determine the K text segments with the highest weighted similarity in the virtual knowledge base as candidate contexts;
[0156] Determine relevant backgrounds based on the parent-child node relationship of candidate backgrounds in the N-ary tree knowledge base;
[0157] The candidate contexts and the related contexts are determined as the target contexts.
[0158] In an embodiment of the present application, when the virtual knowledge base is an N-ary tree knowledge base, the parent node includes the title and the child node includes the text content. First, K candidate contexts are obtained based on weighted similarity. Then, based on the parent-child node relationship in the N-ary tree knowledge base, more neighboring text fragments are captured as relevant contexts. For example, candidate contexts may belong to text fragments corresponding to other child nodes under the same parent node. To avoid missing important background knowledge, both the candidate contexts and the corresponding relevant contexts can be identified as target contexts.
[0159] 3051, calculate the correlation between the target object and the interaction event. The correlation is determined by the similarity, weight coefficient and attenuation coefficient. The weight coefficient is determined by the type of interaction behavior in the interaction event. The attenuation coefficient is inversely proportional to the time interval between the interaction event and the target event.
[0160] 3052. Determine associated events based on M interaction events with the highest degree of association in the event library, where M is a natural number.
[0161] It is understandable that step 3051 and step 3052 are the same as the above Figure 2a This corresponds to step 303 in the embodiment.
[0162] In the embodiment of the present application, the degree of association is calculated by combining multiple factors, including similarity, weight coefficient and attenuation coefficient. Similarity refers to the degree of similarity between the target object and the interaction event. This can be calculated by comparing the characteristics and behavior of the target object and the content and type of the interaction event. The weight coefficient is determined based on the type of interaction behavior in the interaction event. Different types of interaction behaviors may have different importance and influence, so the weight coefficient can reflect this difference. The attenuation coefficient is inversely proportional to the time interval between the interaction event and the target event. This means that over time, the degree of association between the interaction event and the target object will gradually weaken. The attenuation coefficient ensures that the most recent interaction event has a greater impact on the degree of association, while the impact of older interaction events gradually decreases. Then, when recalling interaction events in the event library, the closer the interaction event is to the current event, the less attenuation, and the algorithm will give priority to recalling interaction events that are closer to the current time.
[0163] Based on these factors, the degree of association between the target object and each interaction event can be calculated. The calculation formula for the degree of association can be as follows:
[0164] Degree of association = similarity × weight coefficient × attenuation coefficient
[0165] Next, the interaction events can be sorted according to the degree of correlation, and the M interaction events with the highest degree of correlation can be selected as the associated events. M can be adjusted according to specific needs. For example, the top 10 interaction events with the highest degree of correlation can be selected as the associated events.
[0166] In a possible implementation method, all interactive events in the event library can be periodically reflected upon, and summary content can be generated and then added to the event library.
[0167] See also Figure 4 , Figure 4 This is an event storage flow chart of the event library based on memory stream design provided in an embodiment of the present application.
[0168] Interaction events are first subjected to feature extraction. These extracted features are converted into text vectors through embedding and stored in the event library. The text vectors in the event library are stored as memory streams, including timestamps, events, and weight coefficients. Once the target object is determined, related events are retrieved from the event library. These related events are then summarized based on the language understanding and summarization capabilities of the large language model. Simultaneously, the latest interaction events in the event library are retrieved and merged with the summarized related events. Finally, the large language model is used to associate the merged results with the target context to generate news data. This news data is weighted using the LLM model, and features of the target object and timestamp are extracted. These data are then converted into text vectors through embedding and stored in the event library.
[0169] In a possible implementation method, a search may be performed in the virtual knowledge base based on the target event and the target object by weighted similarity. The specific description is similar to steps 3041 to 3044 and will not be repeated here.
[0170] In one possible implementation method, step 3052 specifically includes:
[0171] Determine the M interactive events with the highest correlation in the event database as candidate events;
[0172] The M candidate events are filtered based on the target object to obtain associated events, where the associated events include the target object.
[0173] In this embodiment, the M most highly correlated interaction events are determined as candidate events. These candidate events may be falsely recalled, meaning they do not include the target object. To avoid this, the M candidate events can be filtered to remove those that are not related to the target object. This ensures the accuracy of the search for the resulting correlated events.
[0174] 306 , inputting input data including the target event, target context, and related events into the large language model through prompt words, wherein the prompt words are used to instruct the large language model to generate news data based on the input data;
[0175] 307, output news data through a large language model.
[0176] It can be understood that step 306 and step 307 correspond to step 204 and step 205 in the embodiment corresponding to FIG. 2 , and are not described in detail here.
[0177] 308 , storing the target event and / or news data in the event library.
[0178] It is understandable that after the news data is generated, the target event and the news data are both interactive events that occur in the game, so they can be stored in the event library. When responding to other key events later, the target time and news data can also be used as associated events to generate news data corresponding to other subsequent events.
[0179] See also Figure 5 , Figure 5 This is a processing flow chart corresponding to the news generation method provided in the embodiment of the present application.
[0180] like Figure 5 As shown, the target event includes a target scene and a target object, wherein the target object is indicated by an identity identification number.
[0181] After extracting features from the target scene and event, a text embedding search algorithm was used to search the virtual knowledge base based on weighted similarity to obtain five target contexts. The virtual knowledge base consists of multiple text fragments that have been feature-extracted and segmented based on the text material of the virtual worldview. These fragments are then stored in the virtual knowledge base as text vectors using embedding.
[0182] After extracting features from the target event and target object, a text embedding search algorithm is used to search the event library based on weighted similarity to obtain 10 candidate events. These 10 candidate events are then filtered based on the target object, eliminating candidate events that do not contain the target object, resulting in 7 associated events. The event library is constructed based on multiple interactive events. After generating news data based on the target event, the target event can also be stored in the event library as a text vector using embedding after feature extraction.
[0183] After determining the target context and associated events, the corresponding prompt words are input into the Large Language Model (LLM), generating news data for output. Furthermore, this news data can be stored in the event library as text vectors using embedding after feature extraction.
[0184] See also Figure 6 , Figure 6 This is an application interface diagram corresponding to the news generation method provided in the embodiment of the present application, such as Figure 6 As shown, the application interface includes event library, virtual knowledge base, event management, prompt word tool, database import and database export options. The following is an introduction to the above options:
[0185] The event library stores the interactive events corresponding to each interactive behavior of the player in the virtual scene;
[0186] A virtual knowledge base storing a plurality of text fragments constructed based on text materials of the game's virtual worldview;
[0187] Event management is used to manage prompt word templates, including configuring parameters corresponding to virtual objects and virtual scenes in various types of interactive events, such as indicating virtual objects and virtual scenes in interactive events to the large language model.
[0188] The prompt word tool is used to input the target event, target context, and related events into the large language model based on specific prompt words, so that the large language model can generate corresponding news data. This interface visualizes the target event, target context, and related events, and displays the generated news data.
[0189] Importing and exporting databases are used to import and export various data and parameters on the prompt word tool interface so that operation and maintenance personnel can view and manage them.
[0190] The news generation method provided in the embodiment of the present application uses a dual-library approach, constructing a virtual knowledge base based on the background knowledge of the virtual world view, and constructing an event base based on the interactive events and press releases generated after the game is launched. The advantages of using a dual-library design are: first, it avoids confusion between the searched game background knowledge and server events, making it easier to distinguish between memory types in the prompt word project, thereby constructing high-quality prompt words; second, if the virtual knowledge base and the event base are unified into one database, since the amount of information searched each time is limited, then when searching, one type of information may be obliterated by another type of information. The dual-library design can avoid this problem.
[0191] The following is a detailed description of the news generation device in this application. Figure 7 . Figure 7 This is a schematic diagram of an embodiment of a news generating device 700 in an embodiment of the present application. The news generating device 700 includes:
[0192] An acquisition module 701 is used to acquire a target event, where the target event indicates an interactive behavior of a target object in a target scene. The target scene is a virtual scene, which is constructed based on a virtual worldview.
[0193] A first retrieval module 702 is configured to retrieve a target context from a virtual knowledge base based on a target scenario, where the virtual knowledge base is constructed based on a virtual worldview;
[0194] The second retrieval module 703 is used to retrieve related events in the event library based on the target object, and the event library is constructed based on the interactive behaviors in the virtual scene;
[0195] A generating module 704 is configured to input input data including a target event, target context, and related events into a large language model through prompt words, wherein the prompt words are used to instruct the large language model to generate news data based on the input data;
[0196] The output module 705 is used to output news data through the large language model.
[0197] In a possible implementation method, the acquisition module 701 is specifically configured to generate a target event in response to an interactive behavior of a target object in a target scene.
[0198] In a possible implementation method, it also includes: a first construction module, which is used to obtain text materials of the virtual world view; divide the text materials into multiple text segments; and construct a virtual knowledge base based on the multiple text segments, where the target background belongs to the multiple text segments.
[0199] In one possible implementation method, the first retrieval module 702 is specifically used to calculate the similarity between the target event and multiple text fragments to obtain corresponding multiple first similarities; calculate the similarity between the target scene and multiple text fragments to obtain corresponding multiple second similarities; calculate the weighted similarity of the first similarity and the second similarity based on a preset weight distribution; and determine the target background based on the K text fragments with the highest weighted similarity in the virtual knowledge base, where K is a natural number.
[0200] In one possible implementation method, the virtual knowledge base is an N-ary tree knowledge base; determining the target context based on K text segments with the highest weighted similarity in the virtual knowledge base includes: determining the K text segments with the highest weighted similarity in the virtual knowledge base as candidate contexts; determining related contexts based on parent-child node relationships of the candidate contexts in the N-ary tree knowledge base; and determining the candidate contexts and the related contexts as the target contexts.
[0201] In a possible implementation method, it also includes: a second construction module, which is used to obtain various interactive behaviors of virtual objects in various virtual scenes, generate interactive events, the target object belongs to the virtual object, and the associated event belongs to the interactive event; and construct an event library based on the interactive events.
[0202] In one possible implementation method, the second retrieval module 703 is specifically used to calculate the degree of association between the target object and the interaction event, where the degree of association is determined by the similarity, weight coefficient and attenuation coefficient, the weight coefficient is determined by the type of interactive behavior in the interaction event, and the attenuation coefficient is inversely proportional to the time interval between the interaction event and the target event; and the associated events are determined based on the M interaction events with the highest degree of association in the event library, where M is a natural number.
[0203] In a possible implementation method, related events are determined based on the M most highly correlated interaction events in an event library, including: determining the M most highly correlated interaction events in the event library as candidate events; filtering the M candidate events based on a target object to obtain related events, wherein the related events include the target object.
[0204] In a possible implementation method, it further includes: a storage module, which is used to store the target event and / or news data in an event library.
[0205] It is understandable that the news generating device provided in the embodiment of the present application is used to execute Figure 2a and Figure 3 For the corresponding news generation method, please refer to the above for a detailed description, which will not be repeated here.
[0206] See also Figure 8 , Figure 8 The system architecture diagram corresponding to the news generation method provided in the embodiment of this application includes a news generation algorithm backend, a Langchain framework, a model service, a database, and a model warehouse.
[0207] The news generation algorithm backend includes a memory stream module, prompt word management, news generation, and total token statistics. The memory stream module manages various interactive events occurring on the game server, providing event addition, deletion, modification, and search capabilities. Prompt word management is used to set up prompt word modules, such as to indicate virtual objects and scenes in interactive events to the large language model. News generation manages generated news data. Total token statistics count the number of characters used by each input and output text of the large language model, allowing for resource control when using a paid model to perform news generation tasks.
[0208] The Langchain framework is an open-source framework that easily manages interactions with language models, links multiple components together, and integrates additional resources such as APIs and databases. In the embodiments of the present application, the Langchain framework is used to manage interactions between the retrieval model, the vector model corresponding to the event library / virtual knowledge library, the feature extraction model, and the large language model.
[0209] The model service is packaged by the Langchain framework, and then the LLM service and Embedding service are called through http.
[0210] The database includes a vector database and a non-vector database. The vector database includes an event library and a virtual resource library. The non-vector database includes a prompt word management library for storing prompt word templates.
[0211] The model repository mainly contains two types of models: LLM and Embedding, including open source and paid models. Models can be switched at any time based on the business requirements for generation quality.
[0212] The hardware environment of the architecture provided by the embodiment of the present application is mainly divided into CPU environment and GPU environment on the technical side. The vector database used is the Faiss (Facebook AI Similarity Search) vector database, and the GPU environment is required when performing vector search; the deep learning model also runs in the GPU environment. The graphics card model of the GPU on the server is Nvidia-V100, CUDA version 12.0. Other algorithm modules use the CPU environment, and the CPU version is Intel (R) Xeon (R) Platinum 8255C CPU @ 2.50GHz.
[0213] The news generation method and related devices provided in the embodiments of the present application provide the following technical effects: 1. Through the dual-library design, the problem of game background knowledge and server events annihilating each other during the search can be avoided; 2. Based on the multi-label weighted search solution, the problem of low similarity in text embedding encoding calculation due to different text lengths can be solved; 3. The event library constructed based on the memory stream allows the generated news data to be closer to the content that has occurred on the game server, and generates press releases that are more in line with the current time and events.
[0214] Figure 9 : This is a schematic diagram of a server structure provided in an embodiment of the present application. The server 300 may have relatively large differences due to different configurations or performances, and may include one or more central processing units (CPUs) 322 (for example, one or more processors) and memories 332, and one or more storage media 330 (for example, one or more massive storage devices) for storing application programs 342 or data 344. Among them, the memories 332 and the storage media 330 may be temporary storage or permanent storage. The program stored in the storage medium 330 may include one or more modules (not shown in the figure), and each module may include a series of instruction operations on the server. Furthermore, the central processing unit 322 may be configured to communicate with the storage medium 330 to execute a series of instruction operations in the storage medium 330 on the server 300.
[0215] The server 300 may also include one or more power supplies 326, one or more wired or wireless network interfaces 350, one or more input and output interfaces 358, and / or one or more operating systems 341, such as Windows Server 2003 or Windows Server 2003R. TM, Mac OS X TM , Unix TM ,Linux TM , FreeBSD TM etc.
[0216] The steps performed by the server in the above embodiment can be based on the Figure 9 The server structure shown.
[0217] It is understandable that in the specific implementation of this application, when it comes to virtual object information, player interaction data, text data and other related data, when the above embodiments of this application are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards of relevant countries and regions.
[0218] Those skilled in the art will clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0219] In the embodiments of the present application, the term "module" or "unit" refers to a computer program or a part of a computer program that has a predetermined function and works together with other related parts to achieve a predetermined goal, and can be implemented in whole or in part by using software, hardware (such as processing circuits or memories) or a combination thereof. Similarly, a processor (or multiple processors or memories) can be used to implement one or more modules or units. In addition, each module or unit can be part of an overall module or unit that includes the function of the module or unit.
[0220] In the several embodiments provided in this application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of units is only a logical function division. In actual implementation, there may be other division methods, such as 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 an indirect coupling or communication connection through some interface, device or unit, which can be electrical, mechanical or other forms.
[0221] Units described as separate components may or may not be physically separate, and components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.
[0222] In addition, the functional units in the various embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.
[0223] If the integrated unit 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 application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the various embodiments of the present application. The aforementioned storage medium includes various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0224] The above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the above embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the above embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A news generation method, characterized in that: include: Acquire a target event, where the target event indicates an interactive behavior of a target object in a target scene, where the target scene is a virtual scene constructed based on a virtual worldview; Based on the target scenario, a target context is retrieved from a virtual knowledge base, wherein the virtual knowledge base is constructed based on the virtual worldview; Based on the target object, a related event is retrieved from an event library, where the event library is constructed based on interactive behaviors in the virtual scene; Inputting input data including the target event, the target context, and the associated events into a large language model through a prompt word, wherein the prompt word is used to instruct the large language model to generate news data based on the input data; The news data is outputted through the large language model.
2. The method according to claim 1, characterized in that The acquiring target event includes: The target event is generated in response to the interactive behavior of the target object in the target scene.
3. The method according to claim 1, characterized in that Before retrieving the target context from the virtual knowledge base based on the target scenario, the method further includes: Obtaining text materials of the virtual worldview; dividing the text material into a plurality of text segments; The virtual knowledge base is constructed based on the multiple text segments, and the target context belongs to the multiple text segments.
4. The method according to claim 3, characterized in that The step of retrieving a target context from a virtual knowledge base based on the target scenario includes: Calculating similarities between the target event and the multiple text segments to obtain corresponding multiple first similarities; Calculating similarities between the target scene and the multiple text segments to obtain corresponding multiple second similarities; Calculating a weighted similarity between the first similarity and the second similarity based on a preset weight distribution; The target context is determined based on the K text segments with the highest weighted similarities in the virtual knowledge base, where K is a natural number.
5. The method according to claim 4, characterized in that The virtual knowledge base is an N-ary tree knowledge base; The determining the target context based on the K text segments with the highest weighted similarities in the virtual knowledge base includes: Determine the K text segments with the highest weighted similarities in the virtual knowledge base as candidate contexts; Determining relevant contexts based on the parent-child node relationship of the candidate contexts in the N-ary tree knowledge base; The candidate context and the related context are determined as the target context.
6. The method according to claim 1, characterized in that Before retrieving the associated event from the event library based on the target object, the method further includes: Acquire each interactive behavior of the virtual object in each virtual scene, generate an interactive event, wherein the target object belongs to the virtual object, and the associated event belongs to the interactive event; The event library is constructed based on the interaction events.
7. The method according to claim 6, characterized in that The step of retrieving associated events from an event library based on the target object includes: Calculating the degree of association between the target object and the interaction event, where the degree of association is determined by similarity, a weight coefficient, and an attenuation coefficient. The weight coefficient is determined by the type of interaction behavior in the interaction event, and the attenuation coefficient is inversely proportional to the time interval between the interaction event and the target event. The associated event is determined based on M interaction events with the highest degree of association in the event library, where M is a natural number.
8. The method according to claim 7, characterized in that The determining the associated event based on the M interaction events with the highest degree of association in the event library includes: Determine the M interactive events with the highest correlation in the event library as candidate events; The M candidate events are filtered based on the target object to obtain the associated events, where the associated events include the target object.
9. The method according to claim 1, characterized in that After outputting the news data through the large language model, the method further includes: The target event and / or the news data are stored in the event library.
10. A news generating device, characterized in that: include: An acquisition module is used to acquire a target event, where the target event indicates an interactive behavior of a target object in a target scene, where the target scene is a virtual scene constructed based on a virtual worldview; A first retrieval module is configured to retrieve a target context from a virtual knowledge base based on the target scenario, wherein the virtual knowledge base is constructed based on the virtual worldview; A second retrieval module is configured to retrieve associated events from an event library based on the target object, where the event library is constructed based on interactive behaviors in the virtual scene; a generation module, configured to input input data including the target event, the target context, and the associated events into a large language model through a prompt word, wherein the prompt word is used to instruct the large language model to generate news data based on the input data; An output module is used to output the news data through the large language model.
11. A computer device, characterized in that: include: memory, and processor; The memory stores instructions, and when the instructions are executed on the processor, the news generating method according to any one of claims 1 to 9 is implemented.
12. A computer-readable storage medium comprising instructions, which, when executed on a computer, causes the computer to execute the news generating method according to any one of claims 1 to 9.
13. A computer program product comprising a computer program, characterized in that The computer program is used by a processor to execute the news generating method according to any one of claims 1 to 9.