Text generation method, device, and medium
Patent Information
- Application Number
- CN202610606560.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-04-30
- Publication Date
- 2026-08-07
AI Technical Summary
该方式不仅生成效率低下,还易造成输出文本不一致且叙事风格不统一的缺陷,难以满足游戏史记所需的专业性和严谨性要求
[0015]本公开实施例的一个有益效果在于,通过本公开的实施例,其可以基于设定游戏事件的事件数据构建包含全局约束、风格约束及事件约束的结构化提示词,并以此结构化提示词约束文本生成模型生成对应的游戏史记文本,该方式可统一生成规范、适配事件风格并保证文本事实依据,克服了人工撰写游戏史记文本效率低、文本不一致及叙事风格不统一的问题,显著提升游戏史记文本的专业性、严谨性与生成效率。
Smart Images

Figure CN122530356A_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of computer technology, and more specifically, to a text generation method, apparatus, and medium. Background Technology
[0002] During game operation, various key game events will occur, such as server merges, sieges, alliances, and season settlements. These key game events can increase player engagement and enhance the game's fun. However, currently, players' awareness and participation in these key game events are weak, making it difficult to form effective discussions among players and fully leverage the role of key game events in driving game activity.
[0003] In related technologies, the generation of game historical texts often relies on manual editing, typically involving manual writing. This method is not only inefficient but also prone to inconsistencies in output text and narrative style, making it difficult to meet the professional and rigorous requirements of game historical records. Summary of the Invention
[0004] One objective of this disclosure is to provide a new technical solution for content generation.
[0005] According to a first aspect of this disclosure, a text generation method is provided, comprising: Acquire event data of specific game events generated during the operation of the target game; wherein, the event data includes event types; Based on the event data, structured prompt words are constructed to constrain the output of the text generation model; wherein, the structured prompt words include global constraint prompt words for setting basic generation rules, style constraint prompt words for matching narrative style according to the event type, and event constraint prompt words for determining text organization strategy according to the event type and converting the event data into factual material according to the text organization strategy; The text generation model is invoked, and the structured prompt words are used as generation constraints to perform the text generation task, thereby obtaining the game history text corresponding to the set game event.
[0006] Optionally, the step of calling the text generation model, using the structured prompt words as generation constraints, to perform a text generation task and obtain game history text corresponding to the set game event includes: The text generation model is invoked, and the structured prompt words are used as generation constraints to perform the text generation task, resulting in at least two candidate historical records texts; Each candidate historical record text is scored according to the set scoring dimensions to obtain a score result for each candidate historical record text. Based on the scoring results corresponding to each of the candidate historical records texts, the target historical record text is determined as the content of the game's historical record text.
[0007] Optionally, the set scoring dimensions include at least one of the following: historical sense scoring dimension, narrative coherence scoring dimension, and style fit scoring dimension.
[0008] Optionally, the method further includes: Based on the event type, determine an image style template that matches the event type; Extract event elements from the event data; The image generation model is invoked, and the event elements are used as generation constraints. Based on the image style template, the image generation task is performed to generate game history illustrations corresponding to the set game events.
[0009] Optionally, the method further includes: Based on the game history illustrations and the game history text, generate game history display information corresponding to the set game events.
[0010] Optionally, the style constraint cue words may also include generation control parameters bound to the narrative style; The generation control parameters include at least one of the following: a temperature coefficient for controlling generation randomness, a kernel sampling threshold for limiting cumulative probability, and a candidate word count parameter for limiting the number of candidate words sampled per step.
[0011] Optionally, the method further includes: Receive editing instructions for the game's historical text; In response to the editing command, the game history text is corrected to obtain the corrected game history text; First feedback data is generated based on the revised game history text and the event data, and the first feedback data is used to optimize the structured prompt words.
[0012] Optionally, the method further includes: The game's historical text was subjected to a content security audit, and the content security audit results were obtained. If the content security audit result indicates that the game history text has not passed the audit, second feedback data is generated based on the content security audit result and the event data. The second feedback data is used to optimize the structured prompt words.
[0013] According to a second aspect of this disclosure, an electronic device is provided, including a memory and a processor, the memory being configured to store a computer program, and the processor being configured to execute the method described according to the first aspect of this disclosure under the control of the computer program.
[0014] According to a third aspect of this disclosure, a computer-readable storage medium is provided, wherein a computer program is stored on the computer-readable storage medium, the computer program implementing the method according to the first aspect above when executed by a processor.
[0015] One beneficial effect of this disclosure is that, through the embodiments of this disclosure, a structured prompt word containing global constraints, style constraints, and event constraints can be constructed based on the event data of the set game events. The structured prompt word is used to constrain the text generation model to generate the corresponding game history text. This method can unify the generation standards, adapt to the event style, and ensure the factual basis of the text. It overcomes the problems of low efficiency, inconsistent text, and inconsistent narrative style in manually writing game history texts, and significantly improves the professionalism, rigor, and generation efficiency of game history texts.
[0016] The features and advantages of the embodiments of this specification will become clear from the following detailed description of exemplary embodiments with reference to the accompanying drawings. Attached Figure Description
[0017] The accompanying drawings, which are incorporated in and form a part of this specification, illustrate embodiments of this specification and, together with their description, serve to explain the principles of these embodiments.
[0018] Figure 1 A schematic diagram of the hardware structure of an electronic device according to a text generation method according to some embodiments is shown; Figure 2 A schematic diagram illustrating an application scenario of a text generation method according to some embodiments is shown; Figure 3 A flowchart illustrating a text generation method according to some embodiments is shown; Figure 4 A flowchart illustrating a text generation method according to some embodiments is shown; Figure 5 A flowchart illustrating a text generation method according to some embodiments is shown; Figure 6 A flowchart illustrating a text generation method according to some embodiments is shown; Figure 7 A flowchart illustrating a text generation method according to some embodiments is shown; Figure 8 A flowchart illustrating a text generation method according to some embodiments is shown; Figure 9 A block diagram of an electronic device according to some embodiments is shown. Detailed Implementation
[0019] Various exemplary embodiments of this specification will now be described in detail with reference to the accompanying drawings.
[0020] The following description of at least one exemplary embodiment is merely illustrative and is in no way intended to limit the embodiments of this specification or their application or use.
[0021] It should be noted that similar labels and letters in the following figures indicate similar items; therefore, once an item is defined in one figure, it does not need to be discussed further in subsequent figures.
[0022] It should be noted that all actions involving the acquisition of signals, information, or data in this embodiment are carried out in compliance with the relevant data protection laws and regulations of the country where the location is situated, and with authorization from the owner of the relevant equipment.
[0023] Figure 1 A schematic diagram of the hardware structure of an electronic device according to a text generation method based on some embodiments is shown.
[0024] In one example, the electronic device 1000 can be a terminal device, such as a mobile phone, tablet computer, or PC.
[0025] In another example, the electronic device 1000 could also be a server, which could be a monolithic server or a distributed server spanning multiple computers or computer data centers. For example, the server could be a server deployed in the cloud.
[0026] In another example, the electronic device 1000 may also include a terminal device and a server connected to the terminal device via a network.
[0027] like Figure 1 As shown, the electronic device 1000 may include a processor 1101, a memory 1102, an interface device 1103, a communication device 1104, an output device 1105, an input device 1106, etc. Figure 1 The hardware configuration shown is illustrative only and is not intended to limit this disclosure, its application, or its use.
[0028] The processor 1101 executes computer programs, which can be written using instruction sets of architectures such as x86, Arm, RISC, MIPS, and SSE. The memory 1102 includes, for example, ROM (Read-Only Memory), RAM (Random Access Memory), and non-volatile memory such as a hard disk. The interface device 1103 includes, for example, a USB interface, a network cable interface, and a headphone jack. The communication device 1104 is capable of wired or wireless communication. The communication device 1104 may include at least one short-range communication module, such as any module for short-range wireless communication based on short-range wireless communication protocols such as Hilink, WiFi (IEEE 802.11), Mesh, Bluetooth, ZigBee, Thread, Z-Wave, NFC, UWB, and LiFi. The communication device 1104 may also include a long-range communication module, such as any module for WLAN, GPRS, or 2G / 3G / 4G / 5G long-range communication. The output device 1105 may include, for example, an LCD screen or touch screen, and a speaker. Input device 1106 may include, for example, a touch screen, a keyboard, a microphone, various sensors, etc.
[0029] In this embodiment, the memory 1102 of the electronic device 1000 is used to store a computer program that controls the processor 1101 to perform a text generation method according to any embodiment of this disclosure.
[0030] Figure 2 The illustration shows application scenarios of text generation methods according to some embodiments. For example... Figure 2 As shown, the event data of key game events generated by the project team, after authentication, data reception, filtering, splitting, storage, and distribution at the gateway layer, is transmitted to the service layer. Based on this event data, the service layer constructs structured prompts for the corresponding key game events using the AI Prompt Engineering system. These structured prompts can be formed by combining multi-level, functional constraint prompts. Specifically, these include global constraint prompts generated by the M1 general module to set basic generation constraints; style constraint prompts generated by the M2 style module to match the narrative style according to the event type of the key game event; and event constraint prompts generated by the M3 event module to determine the text organization strategy based on the event type and convert the event data into factual material according to the text organization strategy.
[0031] The service layer outputs the structured prompts to the text generation model. The text generation model uses these structured prompts as the sole generation constraint to perform the text generation task, generating at least two candidate historical texts corresponding to the set game events in parallel. Simultaneously, the M4 self-checking module embeds scoring rules into the text generation model. The text generation model scores each candidate historical text according to these scoring rules, and finally selects the best target historical text based on the scoring results, which becomes the final output game historical text.
[0032] Meanwhile, the service layer can also call an image generation model to generate game history illustrations that match the game's historical text based on event data. The service layer integrates the generated game history content and illustrations after security verification, and publishes them together as game history-themed posts, pushing them to the application layer's game server for player visibility. The operations backend can manually edit the generated game history-themed posts, ultimately achieving automated and standardized post generation for key game events. This effectively enhances players' awareness and participation in key game events such as server merges, sieges, alliances, and season settlements, fully leveraging the driving effect of key game events on game activity.
[0033] <First Embodiment> Figure 3 The diagram illustrates a flow chart of a text generation method according to some embodiments, which is implemented by an electronic device, for example, the electronic device may be as follows: Figure 1 The electronic device 1000. The text generation method may include the following steps S310 to S330: Step S310: Obtain event data of the set game events generated during the operation of the target game; wherein, the event data includes event types.
[0034] The target game is the online game to which this disclosed text generation method is applied. It typically includes multiple regions or servers and triggers key game events that have a significant impact on the game ecosystem and player experience, such as server merging, siege warfare, alliance formation, and season settlement during operation.
[0035] Among them, setting game events refers to key game events that are predefined in the game and need to be recorded and displayed in the form of historical records to enhance players' perception and sense of participation. Setting game events includes, but is not limited to, server merge events, siege events, alliance events, season settlement events, large-scale event events, faction battles, and cross-server battle events.
[0036] Event data refers to structured business data automatically collected and generated by the target game when the aforementioned game events are triggered. It is used to objectively record the true information of the corresponding game events. Event data includes at least the event type, and may further include the event occurrence time, participating player information, participating faction / guild information, event process information, event result information, server identifier information, and season identifier information. Event data is used to objectively and truthfully record the actual situation of game events, providing factual basis for the subsequent generation of accurate and authentic game historical texts, and avoiding content illusions and factual deviations in the text generation model.
[0037] In this embodiment, when each server of the target game detects a designated game event, it generates structured event data corresponding to that event in real time. The gateway layer can perform data processing operations on the event data. Specifically, the gateway layer first performs legality authentication and source verification on the event data. After successful verification, it receives, parses, and normalizes the event data, and then filters, splits, and classifies the event data according to the event type and the server it belongs to. The processed valid event data is then cached and persistently stored, and simultaneously distributed to the service layer according to preset routing rules. The service layer can obtain the event data corresponding to the designated game event from the gateway layer for use in the subsequent construction of structured prompts.
[0038] Step S320: Construct structured prompt words to constrain the output of the text generation model based on the event data; wherein, the structured prompt words include global constraint prompt words for setting basic generation rules, style constraint prompt words for matching narrative style according to the event type, and event constraint prompt words for determining text organization strategy according to the event type and converting the event data into factual material according to the text organization strategy.
[0039] In this embodiment, the structured prompts are constructed by combining a general fixed part with an event-related part.
[0040] The aforementioned global constraint prompts are a general, fixed part used to set basic generation rules for the output behavior of the text generation model. Through unified basic rule constraints, the professionalism, standardization, and consistency of the generated game history content are ensured. These global constraint prompts can be pre-configured within the AI Prompt Engineering system of the service layer and generated by the M1 general module of the service layer. Furthermore, their generation process does not depend on the specific event data corresponding to the set game events; that is, a unified global constraint prompt can be used for basic constraints for all types of set game events.
[0041] This global constraint prompt controls the generation behavior through basic generation rules, specifically including narrative role constraints, output format constraints, and content generation specification constraints. Narrative role constraints define the generation identity of the text generation model, such as setting it as a "professional game history writer," to ensure a consistent narrative perspective and professional tone in the generated text. Output format constraints standardize the presentation of game history texts, such as explicitly limiting paragraph structure, length, and language style, ensuring consistent formatting across different game events. Content generation specification constraints include at least one of placeholder rules and a prohibition on fabrication rules, and may further include basic fact-checking rules and a content taboo list. Placeholder rules standardize the formatting of event data-related information; prohibition on fabrication rules prevent the text generation model from generating fictitious text that does not match the event data; basic fact-checking rules guide the text generation model to verify the factual accuracy of the generated text; and the content taboo list explicitly prohibits violations, thereby ensuring the compliance and authenticity of the generated text.
[0042] The aforementioned style constraint prompts belong to the event-related part and are used to match the appropriate narrative style for the text generation model based on the event type in the event data. These prompts are generated by the M2 style module in the service layer. Specifically, the M2 style module has a pre-configured mapping table of different event types and corresponding narrative styles. For example, a "siege event" corresponds to an "epic and exciting, full of combat tension" style, a "season settlement event" corresponds to a "solemn and composed, highly summarizing" style, and an "alliance event" corresponds to a "warm and harmonious, emphasizing cooperation" style. The M2 style module retrieves the event type from the event data, matches and extracts the corresponding style description text from the mapping table, thus forming style constraint prompts to ensure that the style of the generated text highly matches the atmosphere of the event.
[0043] The aforementioned event constraint prompts also fall under the category of event-related content. They are used to determine specific text organization strategies based on the event type and convert event data into factual material that can be directly used by the text generation model, generated by the M3 event module in the service layer. Specifically, the M3 event module first matches and determines the corresponding text organization strategy from a preset strategy library based on the event type. For example, for a "server merge event," it adopts an organization strategy of "background introduction + process review + future outlook," while for a "siege event," it adopts an organization strategy of "pre-battle situation + battle process + victory or defeat." Subsequently, the M3 event module extracts event data (including event occurrence time, participating players / factions, event process, and results) according to the determined text organization strategy, removes invalid event information, and fills the valid event information into the content framework corresponding to the text organization strategy, ultimately forming factual material composed of real event data, i.e., event constraint prompts.
[0044] In this embodiment, the service layer first calls the M1 general module to generate global constraint prompts; then, based on the acquired event data, it calls the M2 style module to match and generate style constraint prompts according to the event type; finally, it calls the M3 event module to analyze the event type to determine the text organization strategy, and converts the event data into factual material according to the text organization strategy to generate event constraint prompts. The service layer combines the above global constraint prompts, style constraint prompts, and event constraint prompts to form a complete structured prompt, which is then input into the text generation model as a constraint condition for subsequent text generation tasks.
[0045] Step S330: Invoke the text generation model, use the structured prompt words as generation constraints, and perform the text generation task to obtain the game history content corresponding to the set game event.
[0046] Among them, the text generation model is a large language model (LLM) that can respond to structured prompts and generate game history text. It is pre-deployed in the service layer and runs in conjunction with the AI Prompt system.
[0047] In this embodiment, the service layer outputs the structured prompts to the text generation model. Based on the global constraint prompts within the structured prompts, the text generation model follows basic generation principles, combines the narrative style matched by style constraint prompts, and the factual material provided by event constraint prompts to automatically generate the game's historical text. After the generation task is completed, the text generation model outputs the game's historical text corresponding to the specified game event.
[0048] Through the embodiments of this disclosure, a structured prompt word containing global constraints, style constraints, and event constraints can be constructed based on the event data of the set game events. This structured prompt word constrains the text generation model to generate the corresponding game history text. This method can unify the generation specifications, adapt to the event style, and ensure the factual basis of the text. It overcomes the problems of low generation efficiency, inconsistent text, and inconsistent narrative style caused by manually writing game history texts, and significantly improves the professionalism, rigor, and generation efficiency of game history texts.
[0049] <Second Embodiment> Figure 4 The diagram illustrates a flow chart of a text generation method according to some embodiments, which is implemented by an electronic device, for example, the electronic device may be as follows: Figure 1 The text generation method for the electronic device 1000 shown may include the following steps S410 to S450: Step S410: Obtain event data of the set game events generated during the operation of the target game; wherein, the event data includes event type.
[0050] Step S420: Construct structured prompts for constraining the output of the text generation model based on the event data; wherein, the structured prompts include global constraint prompts for setting basic generation constraints, style constraint prompts for matching narrative styles according to event types, and event constraint prompts for determining text organization strategies according to event types and converting event data into factual material according to the text organization strategies.
[0051] Step S430: Invoke the text generation model, use structured prompt words as generation constraints, and perform the text generation task to obtain at least two candidate historical records texts.
[0052] In this embodiment, the service layer outputs the aforementioned structured prompts to the text generation model. Based on the global constraint prompts within the structured prompts, the text generation model follows basic generation principles, combining the narrative style matched by style constraint prompts and the factual material provided by event constraint prompts to automatically generate game historical texts. After the generation task is completed, the text generation model outputs at least two candidate historical texts corresponding to the given game event.
[0053] Step S440: Score at least two candidate historical texts according to the set scoring dimensions to obtain the score result corresponding to each candidate historical text.
[0054] The scoring dimensions can include at least one of the following: historical sense scoring dimension, narrative coherence scoring dimension, and style fit scoring dimension.
[0055] This historical feel scoring dimension is used to evaluate whether the candidate historical texts possess the solemn and rigorous narrative tone that game historical records should have, and whether they can convey the historical weight of game events through standardized expression.
[0056] This narrative coherence scoring dimension is used to evaluate the logical integrity and sentence fluency of candidate historical texts.
[0057] This style fit scoring dimension is used to evaluate the degree of fit between the narrative style of the candidate historical text and the narrative style matched by the style constraint prompts in the structured prompts.
[0058] In this embodiment, the service layer pre-configures scoring rules, which may include setting scoring dimensions and rules for selecting target historical texts based on those dimensions. After acquiring at least two candidate historical texts, the M4 self-checking module embeds these scoring rules into the text generation model. For each candidate historical text, the text generation model first quantifies and scores it under each scoring dimension, obtaining individual scoring results for each dimension. Then, based on the weights corresponding to each scoring dimension, it performs a weighted sum of all individual scoring results to obtain a comprehensive score for the candidate historical text. This comprehensive score is the final score of the candidate historical text.
[0059] Step S450: Based on the scoring results corresponding to each candidate historical record text, determine the target historical record text as the game's historical record text.
[0060] In this embodiment, the text generation model sorts the scores of all candidate historical records texts in descending order based on the scores of each candidate historical record text. Then, the candidate historical record text with the highest score after sorting is determined as the target historical record text, which is the game historical record text corresponding to the set game event.
[0061] Through the embodiments of this disclosure, by generating multiple candidate historical records texts and scoring the generated multiple candidate historical records texts to select the best target historical records text, the quality and accuracy of the game's historical records texts can be further improved, ensuring that the output text is more in line with the actual events and improving the reliability of the generation effect.
[0062] <Third Embodiment> Figure 5 The diagram illustrates a flow chart of a text generation method according to some embodiments, which is implemented by an electronic device, for example, the electronic device may be as follows: Figure 1 The text generation method for the electronic device 1000 shown may include the following steps S510 to S540: Step S510: Obtain event data of the set game events generated during the operation of the target game; wherein, the event data includes event type.
[0063] Step S520: Determine the image style template that matches the event type based on the event type.
[0064] In this embodiment, the service layer pre-configures image style templates that match various game events. The image style templates are image style specifications set according to the overall art style of the game and matched with different event types. They may include unified visual standards such as composition, color tone, element proportion, art style, border style and background texture, to ensure that the generated game history illustrations are consistent in style and fit the game world view and event atmosphere.
[0065] Step S530: Extract event elements from the event data.
[0066] Among them, event elements refer to key feature information extracted from event data that is suitable for visual expression, such as core participating roles, faction identifiers, key scenes, etc., which are used as generation constraints for image generation models so that the accompanying images can intuitively present the core content of game events.
[0067] Step S540: Invoke the image generation model, use event elements as generation constraints, and perform the image generation task based on the image style template to generate game history illustrations corresponding to the set game events.
[0068] The image generation model can be a general image generation service model.
[0069] In this embodiment, the service layer calls the image generation model. The image generation model uses event elements as generation constraints and generates images according to the image style template. Finally, it generates game history illustrations corresponding to the set game events, providing image materials for subsequent visualization display information.
[0070] Through the embodiments of this disclosure, by matching style templates according to event types and generating illustrations with event elements as constraints, the illustration style can be unified and the content can fit the event, thereby improving the accuracy and visual consistency of the illustrations.
[0071] <Fourth Embodiment> Figure 6 The diagram illustrates a flow chart of a text generation method according to some embodiments, which is implemented by an electronic device, for example, the electronic device may be as follows: Figure 1 The text generation method for the electronic device 1000 shown may include the following steps S610 to S660: Step S610: Obtain event data of the set game events generated during the operation of the target game; wherein, the event data includes event type.
[0072] Step S620: Construct structured prompts for constraining the output of the text generation model based on the event data; wherein, the structured prompts include global constraint prompts for setting basic generation constraints, style constraint prompts for matching narrative styles according to event types, and event constraint prompts for determining text organization strategies according to event types and converting event data into factual material according to the text organization strategies.
[0073] Step S630: Call the text generation model, use structured prompts as generation constraints, execute the text generation task, and obtain the game history text corresponding to the set game events.
[0074] Step S640: Based on the event type, determine the image style template that matches the event type, and extract the event elements from the event data.
[0075] It should be noted that after executing step S610, steps S620 and S640 can be executed simultaneously, that is, the generation of game history text and game history illustrations can be performed simultaneously.
[0076] Step S650: Invoke the image generation model, use event elements as generation constraints, and perform the image generation task based on the image style template to generate game history illustrations corresponding to the set game events.
[0077] Step S660: Generate game history display information corresponding to the set game events based on the game history illustrations and game history content.
[0078] Among them, the game history display information is a visual display content that integrates the game history text and game history illustrations. It is used to present the recorded information of game events to players intuitively on the game front end, and has both readability and visual effects.
[0079] In this embodiment, the service layer integrates the game history text with corresponding game history illustrations according to preset layout specifications and display formats, unifying the layout and display style to ultimately form a combined text and image game history display information, which can then be directly pushed to the application layer for display. The application layer includes the client of the target game. After receiving the game history display information, the client displays the game history display information in the game interface. The client also responds to player interactions with the game history display information by performing at least one of the following: entering the details page to display the complete text, sharing the game history display information, or liking or commenting on the game history display information.
[0080] Through the embodiments of this disclosure, by integrating game historical records illustrations with game historical records text to form game historical records display information, the presentation form of game historical records can be enriched, the visual expressiveness and user reading experience can be improved, and the publicity and commemorative effects of game events can be enhanced.
[0081] <Fifth Embodiment> Figure 7 The diagram illustrates a flow chart of a text generation method according to some embodiments, which is implemented by an electronic device, for example, the electronic device may be as follows: Figure 1 The text generation method for the electronic device 1000 shown may include the following steps S710 to S760: Step S710: Obtain event data of the set game events generated during the operation of the target game; wherein, the event data includes event type.
[0082] Step S720: Construct structured prompt words to constrain the output of the text generation model based on the event data; wherein, the structured prompt words include global constraint prompt words for setting basic generation constraints, style constraint prompt words for matching narrative style according to event type, and event constraint prompt words for determining text organization strategy according to event type and converting event data into factual material according to the text organization strategy.
[0083] Step S730: Call the text generation model, use structured prompts as generation constraints, execute the text generation task, and obtain the game history text corresponding to the set game events.
[0084] Step S740: Receive editing instructions for the game's historical content.
[0085] This editing command can be triggered by operators or reviewers in the management backend to adjust, modify, or supplement the automatically generated game history content.
[0086] In step S750, in response to the editing command, the game history content is modified to obtain the modified game history content.
[0087] In this embodiment, the original game history content can be updated and corrected according to the modifications in the editing instructions, resulting in revised content that better meets actual needs and the facts of the events.
[0088] Step S760: Generate first feedback data based on the revised game history content and event data. The first feedback data is used to optimize structured prompts.
[0089] In this embodiment, the corrected content can be compared with the original event data, and the difference information and optimization direction can be extracted to form feedback data. Based on this feedback data, the global constraint prompts and style constraint prompts can be adjusted to improve the quality of subsequent content generation.
[0090] It should be noted that the illustrations in the game's historical records can also be modified using editing commands, as can the information displayed in the game's historical records. This embodiment does not limit this.
[0091] Through the embodiments of this disclosure, the game's historical content is modified by receiving editing instructions, and feedback data is generated based on the modified content and event data. This allows for continuous optimization of structured prompts and constant improvement in the accuracy and relevance of subsequent content generation.
[0092] <Sixth Embodiment> Figure 8 The diagram illustrates a flow chart of a text generation method according to some embodiments, which is implemented by an electronic device, for example, the electronic device may be as follows: Figure 1The text generation method for the electronic device 1000 shown may include the following steps S810 to S850: Step S810: Obtain event data of the set game events generated during the operation of the target game; wherein, the event data includes event type.
[0093] Step S820: Construct structured prompts for constraining the output of the text generation model based on the event data; wherein, the structured prompts include global constraint prompts for setting basic generation constraints, style constraint prompts for matching narrative styles according to event types, and event constraint prompts for determining text organization strategies according to event types and converting event data into factual material according to the text organization strategies.
[0094] Step S830: Call the text generation model, use structured prompts as generation constraints, execute the text generation task, and obtain the game history text corresponding to the set game events.
[0095] Step S840: Perform content security audit on the game's historical text and obtain the content security audit results.
[0096] In this embodiment, a security audit model can be used to audit the game's historical content in terms of compliance, legality, and public order and good morals, to determine whether it contains any illegal, sensitive, or inappropriate information, thereby obtaining the corresponding content security audit results.
[0097] In step S850, if the content security audit result is that the game history text fails the audit, second feedback data is generated based on the content security audit result and event data. The second feedback data is used to optimize the structured prompt words.
[0098] In this embodiment, if the game's historical content fails the security review, the reasons for the failure and the original event data can be compared to extract violation risk information and security optimization directions to form feedback data. Based on this feedback data, the security-related rules in the global constraint prompts can be strengthened to improve the compliance and security of the generated text.
[0099] It should be noted that the illustrations used in the game's historical records can also be reviewed through a security review model.
[0100] Through the embodiments of this disclosure, by performing security audits on the game's historical text and generating feedback data based on the audit results to optimize prompts, the compliance and security of automatically generated text can be improved.
[0101] <Seventh Embodiment> Unlike the above embodiments, in this embodiment, the style constraint prompts may also include generation control parameters that are tied to the narrative style.
[0102] The generation control parameters may include at least one of the following: a temperature coefficient for controlling generation randomness, a kernel sampling threshold for limiting cumulative probability, and a candidate word count parameter for limiting the number of candidate words sampled per step.
[0103] Through the embodiments of this disclosure, by flexibly configuring the above-mentioned generation control parameters, the diversity and accuracy of the generated text can be effectively balanced, and the fluency, standardization and controllability of the game's historical text can be improved.
[0104] <Eighth Embodiment> Figure 9 A block diagram of an electronic device according to some embodiments is shown. Figure 9 The basic hardware components of this electronic device are shown. For example... Figure 9 As shown, the electronic device 900 includes a processor 910 and a memory 920. The memory 920 stores a computer program that controls the processor 910 to operate in order to control the electronic device 900 to execute a text generation method according to any embodiment of the present disclosure.
[0105] This disclosure also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements a text generation method according to any embodiment of this disclosure.
[0106] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other.
[0107] This disclosure may be a system, method, and / or computer program product. A computer program product may include a computer-readable storage medium having computer-readable program instructions loaded thereon for causing a processor to implement any of the methods in the foregoing embodiments of this disclosure.
[0108] Computer-readable storage media can be tangible devices capable of holding and storing instructions for use by an instruction execution device. Computer-readable storage media may include, for example, electrical storage devices, magnetic storage devices, optical storage devices, electromagnetic storage devices, semiconductor storage devices, or any suitable combination thereof. More specific examples (a non-exhaustive list) of computer-readable storage media include: portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), static random access memory (SRAM), compact disc-read-only memory (CD-ROM), digital versatile disc (DVD), memory sticks, floppy disks, mechanical encoding devices, such as punch cards or recessed protrusions storing instructions thereon, and any combination thereof. The computer-readable storage medium used herein is not to be interpreted as a transient signal itself, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through waveguides or other transmission media (e.g., light pulses through fiber optic cables), or electrical signals transmitted through wires.
[0109] The computer-readable program instructions described herein can be downloaded from computer-readable storage media to various computing / processing devices, or downloaded via a network, such as the Internet, local area network, wide area network, and / or wireless network, to an external computer or external storage device. The network may include one or more of copper transmission cables, fiber optic transmission, wireless transmission, routers, firewalls, switches, gateway computers, and edge servers. A network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards them to computer-readable storage media in the respective computing / processing device.
[0110] The computer program instructions used to perform the operations of this disclosure may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-dependent instructions, microcode, firmware instructions, state setting data, or source or object programs written in any combination of one or more programming languages, including object-oriented programming languages (such as Smalltalk, C++, etc.) and conventional procedural programming languages (such as the "C" language or similar programming languages). The computer-readable program instructions may be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer via any type of network (e.g., a local area network or a wide area network), or it may be connected to an external computer (e.g., via the Internet using an Internet service provider). In some embodiments, electronic circuitry, such as programmable logic circuitry, field-programmable gate arrays, or programmable logic arrays, can execute computer-readable program instructions to implement various aspects of the embodiments of this disclosure by utilizing state information from the computer-readable program instructions.
[0111] Various aspects of this disclosure are described herein with reference to flowchart illustrations and / or block diagrams of methods, apparatus, and computer program products according to embodiments of this disclosure. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer-readable program instructions.
[0112] These computer-readable program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing apparatus to produce a machine such that, when executed by the processor of the computer or other programmable data processing apparatus, they create means for implementing the functions / actions specified in one or more blocks of the flowchart and / or block diagram. These computer-readable program instructions can also be stored in a computer-readable storage medium that causes a computer, programmable data processing apparatus, and / or other device to operate in a particular manner; thus, the computer-readable medium storing the instructions comprises an article of manufacture that includes instructions for implementing aspects of the functions / actions specified in one or more blocks of the flowchart and / or block diagram.
[0113] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device to cause a series of operational steps to be performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions that execute on the computer, other programmable data processing apparatus, or other device to perform the functions / actions specified in one or more boxes of a flowchart and / or block diagram.
[0114] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of an instruction containing one or more executable instructions for implementing a specified logical function. In some alternative implementations, the functions marked in the blocks may occur in a different order than those marked in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions. It should be noted that implementation in hardware, implementation in software, and implementation using a combination of software and hardware are all equivalent.
[0115] The various embodiments of this disclosure have been described above. These descriptions are exemplary and not exhaustive, and are not limited to the disclosed embodiments. Many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the described embodiments. The terminology used herein is chosen to best explain the principles, practical application, or improvement of the technology in the market, or to enable others skilled in the art to understand the embodiments disclosed herein. The scope of this disclosure is defined by the appended claims.
Claims
1. A text generation method, wherein, include: Acquire event data of specific game events generated during the operation of the target game; wherein, the event data includes event types; Based on the event data, structured prompt words are constructed to constrain the output of the text generation model; wherein, the structured prompt words include global constraint prompt words for setting basic generation rules, style constraint prompt words for matching narrative style according to the event type, and event constraint prompt words for determining text organization strategy according to the event type and converting the event data into factual material according to the text organization strategy; The text generation model is invoked, and the structured prompt words are used as generation constraints to perform the text generation task, thereby obtaining the game history text corresponding to the set game event.
2. The method according to claim 1, wherein, The text generation model is invoked, using the structured prompts as generation constraints, to perform a text generation task and obtain game history content corresponding to the set game events, including: The text generation model is invoked, and the structured prompt words are used as generation constraints to perform the text generation task, resulting in at least two candidate historical records texts; Each candidate historical record text is scored according to the set scoring dimensions to obtain a score result for each candidate historical record text. Based on the scoring results corresponding to each of the candidate historical records texts, the target historical record text is determined as the game's historical record text.
3. The method according to claim 2, wherein, The scoring dimensions include at least one of the following: historical sense scoring dimension, narrative coherence scoring dimension, and style fit scoring dimension.
4. The method according to claim 1, wherein, The method further includes: Based on the event type, determine an image style template that matches the event type; Extract event elements from the event data; The image generation model is invoked, and the event elements are used as generation constraints. Based on the image style template, the image generation task is performed to generate game history illustrations corresponding to the set game events.
5. The method according to claim 4, wherein, The method further includes: Based on the game history illustrations and the game history text, generate game history display information corresponding to the set game events.
6. The method according to claim 1, wherein, The style constraint prompts also include generation control parameters that are bound to the narrative style; The generation control parameters include at least one of the following: a temperature coefficient for controlling generation randomness, a kernel sampling threshold for limiting cumulative probability, and a candidate word count parameter for limiting the number of candidate words sampled per step.
7. The method according to any one of claims 1 to 6, wherein, The method further includes: Receive editing instructions for the game's historical text; In response to the editing command, the game history text is corrected to obtain the corrected game history text; First feedback data is generated based on the revised game history text and the event data, and the first feedback data is used to optimize the structured prompt words.
8. The method according to any one of claims 1 to 6, wherein, The method further includes: The game's historical text was subjected to a content security audit, and the content security audit results were obtained. If the content security audit result indicates that the game history text has not passed the audit, second feedback data is generated based on the content security audit result and the event data. The second feedback data is used to optimize the structured prompt words.
9. An electronic device, wherein, It includes a memory and a processor, the memory being used to store a computer program, and the processor being used, under the control of the computer program, to execute the method according to any one of claims 1 to 8.
10. A computer-readable storage medium, wherein, A computer program is stored on the computer-readable storage medium, which, when executed by a processor, implements the method according to any one of claims 1 to 8.