Method, device and equipment for generating visual text
By generating visual text and using visual encoding techniques to display the lexical prediction probabilities of large language models, the problem of the difficulty in interpreting the internal decision-making mechanisms of large language models is solved, thereby improving user understanding and model optimization efficiency.
Patent Information
- Application Number
- CN202510874296.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-26
- Publication Date
- 2025-11-11
AI Technical Summary
The internal decision-making mechanisms of large language models are difficult to explain, and users cannot understand the text generation process, which hinders trust in the model and its optimization.
Visual text is generated using visual encoding technology, and the segmentation and predicted probability of words are displayed using backgrounds with different transparency, providing interpretable text output.
It enhances users' understanding of the logic behind large model generation, improves the observability of model training results and R&D efficiency, and promotes the flexibility and quality of content creation.
Smart Images

Figure CN120929595A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer technology, and more specifically, to a method, apparatus, and device for generating visual text. Background Technology
[0002] With the rapid development of artificial intelligence, large language models (LLMs) involved in AI have also developed rapidly. The complexity of large language models is constantly increasing, and their internal decision-making mechanisms are like a mysterious "black box," making them difficult for users to understand. Especially in text generation applications, users cannot know how large language models determine the next token for each word in the text. They are only shown the final generated text, and the output text lacks interpretability. This not only hinders users from gaining deeper trust in large language models but also limits researchers from further optimizing them.
[0003] In conclusion, how to generate interpretable and visual text is a problem that needs to be solved. Summary of the Invention
[0004] In view of this, embodiments of the present invention provide a method, apparatus, and device for generating visual text, which can generate interpretable visual text through a large model, assisting users in understanding the generation logic of the large model and facilitating users in observing the results of model training.
[0005] In a first aspect, embodiments of the present invention provide a method for generating visual text, the method comprising: acquiring question information; inputting the question information into a large model to generate intermediate text corresponding to the question information; performing word segmentation on the intermediate text; performing visual encoding on the segmented intermediate text according to a pre-set visual encoding rule to generate result text, wherein the result text displays the division of multiple word units and the predicted probability of each word unit against a background of at least one color with different transparency; and outputting the result text.
[0006] Optionally, the pre-set visual encoding rules include: setting the background color and transparency of the word element according to the predicted probability of each word element; increasing the transparency of the background of the word element by the same color in response to an increase in the predicted probability; or, decreasing the transparency of the background of the word element by the same color in response to an increase in the predicted probability.
[0007] Optionally, the method further includes: obtaining word filtering conditions; filtering words in the intermediate text according to the word filtering conditions, and determining the special words that are filtered out.
[0008] Optionally, the method further includes setting the background color and transparency of the special word.
[0009] Optionally, the method further includes: receiving a viewing instruction for any word element in the result text, wherein the viewing instruction is used to query at least one alternative word element for the any word element and the predicted probability of each alternative word element.
[0010] Optionally, the method further includes: overlaying the viewing result corresponding to the viewing instruction onto the display interface of the result text, wherein the viewing result includes at least one replaceable word element of any word element and the predicted probability of each replaceable word element.
[0011] Optionally, the method further includes: receiving a word replacement instruction, wherein the word replacement instruction is used to replace the word with any replacement word in the viewing result of the word.
[0012] Optionally, the method further includes: replacing any word in the result text with any replacement word, regenerating all text following any word in the result text, and updating the result text.
[0013] Optionally, the method further includes: adjusting specific parameters in the large model to regenerate at least one partial result text, wherein the partial result text begins with the arbitrary lexical term.
[0014] Secondly, embodiments of the present invention provide an apparatus for generating visual text, the apparatus comprising: an acquisition unit for acquiring question information; a generation unit for inputting the question information into a large model to generate intermediate text corresponding to the question information; a processing unit for performing word segmentation on the intermediate text, and visually encoding the segmented intermediate text according to a pre-set visual encoding rule to generate result text, wherein the result text displays the division of multiple word units and the predicted probability of each word unit against a background of at least one color with different transparency; and an output unit for outputting the result text.
[0015] Optionally, the pre-set visual encoding rules include: setting the background color and transparency of the word element according to the predicted probability of each word element; increasing the transparency of the background of the word element by the same color in response to an increase in the predicted probability; or, decreasing the transparency of the background of the word element by the same color in response to an increase in the predicted probability.
[0016] Optionally, the acquisition unit is further configured to: acquire word filtering conditions; the device further includes: a filtering unit, configured to filter words in the intermediate text according to the word filtering conditions, and determine the special words that are filtered out.
[0017] Optionally, the device further includes a setting unit for setting the background color and transparency of the special word.
[0018] Optionally, the apparatus further includes: a receiving unit, configured to receive a viewing instruction for any word element in the result text, wherein the viewing instruction is used to query at least one alternative word element for the any word element and the predicted probability of each alternative word element.
[0019] Optionally, the device further includes: a display unit, configured to overlay and display the viewing result corresponding to the viewing instruction on the display interface of the result text, wherein the viewing result includes at least one replaceable word element of any word element and the predicted probability of each replaceable word element.
[0020] Optionally, the device further includes: a receiving unit, configured to receive a word substitution instruction, wherein the word substitution instruction is configured to replace the word with any substitution word in the viewing results of the word.
[0021] Optionally, the apparatus further includes: a replacement unit, configured to replace any word in the result text with any replacement word, and regenerate all text following any word in the result text, thereby updating the result text.
[0022] Optionally, the apparatus further includes: an adjustment unit for adjusting specific parameters in the large model to regenerate at least one partial result text, wherein the partial result text begins with the arbitrary lexical term.
[0023] Thirdly, embodiments of the present invention provide an electronic device, including a memory and a processor, wherein the memory is used to store one or more computer program instructions, wherein the one or more computer program instructions are executed by the processor to implement the method as described in the first aspect or any one of the possible methods of the first aspect.
[0024] Fourthly, embodiments of the present invention provide a computer-readable storage medium having stored thereon computer program instructions that, when executed by a processor, implement the method as described in the first aspect or any one of the possibilities of the first aspect.
[0025] In this embodiment of the invention, problem information is acquired; the problem information is input into a large model to generate intermediate text corresponding to the problem information; the intermediate text is segmented into words, and then visually encoded according to pre-set visual encoding rules to generate result text. The result text displays the segmentation of multiple word units and the predicted probability of each word unit against a background of at least one color with varying transparency; the result text is then output. Through this method, interpretable visual text can be generated from a large model, assisting users in understanding the generation logic of the large model and facilitating user observation of the model training results. Attached Figure Description
[0026] The above and other objects, features and advantages of the present invention will become clearer from the following description of embodiments of the invention with reference to the accompanying drawings, in which:
[0027] Figure 1 This is a schematic diagram of a question-and-answer result display in the prior art;
[0028] Figure 2 This is a flowchart of a method for generating visual text according to an embodiment of the present invention;
[0029] Figure 3 This is a schematic diagram of a visual encoding rule in an embodiment of the present invention;
[0030] Figure 4 This is a schematic diagram of the screen display of a terminal device according to an embodiment of the present invention;
[0031] Figure 5 This is a schematic diagram of the screen display of another terminal device in an embodiment of the present invention;
[0032] Figure 6 This is a schematic diagram of the screen display of another terminal device in an embodiment of the present invention;
[0033] Figure 7 This is a schematic diagram of the screen display of another terminal device in an embodiment of the present invention;
[0034] Figure 8 This is a schematic diagram of a device for generating visual text according to an embodiment of the present invention;
[0035] Figure 9 This is a schematic diagram of an electronic device according to an embodiment of the present invention. Detailed Implementation
[0036] The present application is described below based on embodiments, but it is not limited to these embodiments. In the detailed description of the present application below, certain specific details are described in detail. Those skilled in the art can fully understand the present application without these details. To avoid obscuring the substance of the present application, well-known methods, processes, flows, elements, and circuits are not described in detail.
[0037] Furthermore, those skilled in the art should understand that the accompanying drawings provided herein are for illustrative purposes only and are not necessarily drawn to scale.
[0038] Unless the context explicitly requires it, words such as "including" or "contains" throughout the application should be interpreted as including rather than exclusive or exhaustive; that is, meaning "including but not limited to".
[0039] In the description of this application, it should be understood that the terms "first," "second," etc., are used for descriptive purposes only and should not be construed as indicating or implying relative importance. Furthermore, in the description of this application, unless otherwise stated, "a plurality of" means two or more.
[0040] In existing technologies, the complexity of large language models is constantly increasing, and their internal decision-making mechanisms are like a mysterious "black box," making them difficult for users to understand. Especially in text generation applications, users cannot know how large language models determine the next word for each token in the text; they are only shown the final generated text. For example, if a user inputs the question "How to make yogurt?" into a large model, the model's answer (i.e., the final text) would be "Use a yogurt maker; Materials: 800-1000 ml pure milk, 1 small packet of yogurt starter (1 gram); Steps:..." Remove the milk and starter culture from the refrigerator and bring them to room temperature beforehand. Sterilize the yogurt maker's inner container by thoroughly rinsing it with boiling water. Add approximately 800-1000 ml of whole milk to the inner container. Add one small packet of yogurt starter culture and gently stir until well combined. Place the inner container into the yogurt maker, close the lid, turn on the power, and set the fermentation time to 6-10 hours, or until the milk solidifies into yogurt. The finished yogurt can be eaten directly or refrigerated for several hours for a better flavor. Sugar or other jams can be added to taste before serving. The above questions and answers are displayed on the screen of the terminal device with the large model set up. Figure 1 As shown, by the Figure 1 As can be seen, the final output text lacks interpretability, which not only hinders users' deeper trust in large language models but also limits developers' further optimization of these models. Therefore, how to create interpretable visual text to help users understand the generation logic of large models and facilitate their observation of model training results is a problem that needs to be solved.
[0041] In this embodiment of the invention, the large language model can also be called a large model or an artificial intelligence (AI) model. The large language model is a deep learning model based on a transformer architecture that can process and generate natural language text. It is usually trained on a large amount of text data and has the ability to understand and generate language. It is widely used in dialogue systems, text generation and other natural language processing tasks.
[0042] In this embodiment of the invention, the token refers to a basic unit used in text processing in the field of natural language processing.
[0043] In this embodiment of the invention, model training refers to the process of continuously adjusting model parameters using a large-scale dataset and specific algorithms and optimization strategies to gradually improve the model's performance on a given task.
[0044] In this embodiment of the invention, interpretability refers to a characteristic that enables people to understand how the model makes decisions.
[0045] In this embodiment of the invention, to solve the above problems, a method for generating visual text is proposed, specifically as follows: Figure 2 As shown, the method includes:
[0046] Step 201: Obtain problem information.
[0047] Specifically, the question information is the question information input by the user. The user inputs the question information into the screen of the terminal device that has the large model set. For example, the question information is "How to make bubble tea?", or it can be other question information. This is only an example for illustration.
[0048] Step 202: Input the problem information into the large model to generate the intermediate text corresponding to the problem information.
[0049] In one possible implementation, after receiving the user's input question information on the screen of the terminal device, the information is input into the large model of the terminal device to generate intermediate text. For example, the intermediate text is "Ingredients: 1. Black tea bags - 2 2. Water - 1 cup (about 250 ml) 3. Whole milk - 1 cup (about 250 ml) 4. White sugar - 2-3 tablespoons 5. Tapioca pearls (optional) - 1 / 4 cup 6. Hot water - as needed (for cooking tapioca pearls) 7. Ice cubes (optional) - as needed". This is only an example illustration.
[0050] Step 203: Perform word segmentation on the intermediate text, and perform visual encoding on the segmented intermediate text according to the preset visual encoding rules to generate the result text.
[0051] The resulting text displays the segmentation of multiple word units and the predicted probability of each word unit against a background of at least one color with varying transparency.
[0052] In this embodiment of the invention, the predicted probability can also be called probability prediction, which means that the large model gives the probability values of different candidate tokens for the next possible token. The above values reflect the large model's tendency to choose each candidate token when generating text, and are presented in the form of probability to help users understand the basis of the large model's decision.
[0053] In one possible implementation, the pre-set visual encoding rules include: setting the background color and transparency of the word element based on the predicted probability of each word element; increasing the transparency of the word element's background by the same color in response to an increase in the predicted probability; or, decreasing the transparency of the word element's background by the same color in response to an increase in the predicted probability; specifically as follows... Figure 3 As shown, the visual encoding rules include: when the prediction probability of the word element is 0 or it is a special word element that has been filtered out, the background color of the word element is set to #000000 and the transparency is set to 4%; when the prediction probability of the word element is 0.00x, the background color of the word element is set to #2F4FFF and the transparency is set to 4%; as the prediction probability increases, the transparency value increases; when the prediction probability of the word element is 1, the background color of the word element is set to #2F4FFF and the transparency is set to 60%; the transparency value is set correspondingly when the prediction probability of the word element is any value between 0 and 1, wherein #000000 and #2F4FFF are color labels, and the color can also be called the theme color. The specific color is determined according to the actual situation, and the correspondence between the prediction probability value and the transparency value is also determined according to the actual situation. This embodiment of the invention does not limit it.
[0054] Step 204: Output the result text.
[0055] Specifically, the result text is displayed on the screen of the terminal device, as follows: Figure 4 As shown, the resulting text is generated by segmenting the intermediate text into words, and then setting a background for each word. Different words have different transparency levels based on their prediction probabilities. The lower the prediction probability of a word, the lower the transparency value of its background; conversely, the higher the prediction probability, the higher the transparency value of its background. Figure 4In the resulting text, for example, words like "cup," "2," and "3" have low prediction probabilities, and their background color transparency is low, for example, 4%. Conversely, words like "use," "cook," and "appropriate amount" have high prediction probabilities, and their background color transparency is low, for example, 60%. This is merely an example of appropriateness; the specific color and transparency should be set according to the actual situation. The color can be set to blue, green, yellow, etc. This embodiment of the invention does not impose limitations on the color. Since the accompanying drawings can only consist of black and white lines and colors, therefore... Figure 4 The colors of each word segment are not displayed; instead, they are shown through transparency and grayscale background.
[0056] In one possible implementation, when generating the result text according to a pre-set visual encoding rule, the method further includes: obtaining a word filtering condition; filtering words in the intermediate text according to the word filtering condition to determine the special words that are filtered out; and then setting the background color and transparency of the special words; for example, setting the background color and transparency of the special words to the same as the background and transparency of words with a predicted probability of 0, depending on the actual situation.
[0057] In this embodiment of the invention, the filtering conditions can be set above the result text on the screen, specifically as follows: Figure 5 As shown, the filtering conditions include: top 1 > 0.8, 2-5 token distribution (top 1 < 0.8, top 5 > 0.8), and long tail (top 5 < 0.8). Top 1 > 0.8 means that during token generation, the predicted probability of the token with the highest probability exceeds 80%. In this case, the large model is extremely confident in a particular token and tends to choose that token, without considering the probability of other tokens. This is used when the large model needs to emphasize a specific word. 2-5 token distribution (top 1 < 0.8, top 5 > 0.8) means that in the generated token combination, the token with the highest predicted probability cannot exceed 80%, but the sum of the predicted probabilities of the top five tokens is greater than 80%. This ensures that the probability is not overly concentrated on a single token and that multiple tokens have high probabilities, promoting diversity while ensuring that the selected token is a more likely option. Long tail (top 5 < 0.8) means that the sum of the probabilities of the top five tokens is less than 80%. This means that no single token selection is entirely certain; all tokens have a relatively low probability of being chosen. This situation may involve significant uncertainty in the generated content, requiring consideration of multiple possible options.
[0058] In one possible implementation, the Figure 5 The filter criteria are followed by color examples to illustrate the concepts. Figure 3 Changes in the main theme color.
[0059] In this embodiment of the invention, by setting filtering conditions, users can quickly locate tokens with a certain degree of uncertainty or intense competition in the decision-making process of large models, and conduct in-depth research on the generation logic of large models in such cases.
[0060] In one possible implementation, after the terminal device displays the result text on its screen, it can also receive a viewing instruction for any word in the result text, wherein the viewing instruction is used to query at least one alternative word for the any word and the predicted probability of each alternative word; the viewing result corresponding to the viewing instruction is overlaid and displayed on the display interface of the result text, wherein the viewing result includes at least one alternative word for the any word and the predicted probability of each alternative word.
[0061] For example, if a user clicks on the word "appropriate amount" in the result text, a set of replacement words for "appropriate amount" and the predicted probability of each replacement word can be displayed, such as... Figure 6 As shown, the predicted probability of "replaceable word one" is 0.965423...; the predicted probability of "replaceable word two" is "0.786875..."; the predicted probability of "replaceable word three" is "0.668686e-7"; the predicted probability of "replaceable word four" is "0.78"; the predicted probability of "replaceable word five" is "0.668686"; the specific replacement words 1, 2, 3, 4, 5, etc. are determined according to the actual situation. For example, replacement word one can be "a few", and replacement word two can be "some". This embodiment of the invention does not limit them and is only an example.
[0062] In one possible implementation, the method further includes: receiving a word substitution instruction, wherein the word substitution instruction is used to replace the word with any substitution word in the viewing result of the word; replacing the word in the result text with the substitution word, and regenerating all the text following the word in the result text, and updating the result text.
[0063] For example, in the Figure 6The displayed results show a "Replace" option after the predicted probability of each replacement word. If the user clicks "Replace," the corresponding replacement word will be used to replace the viewed word in the result text. For example, clicking "Replace" for "a little" will replace "appropriate amount" with "a little" in the result text. After the replacement is completed, the large model regenerates the content of the subsequent text and compares the changes in the result text returned by the large model before and after the word replacement. This will not be elaborated further here.
[0064] In this embodiment of the invention, taking a writing scenario as an example, if a user has doubts about the word "economic growth" in the text generated by the large model, they can replace it with "economic downturn" and observe how the large model's description of market dynamics, suggestions, and other content will change. This allows the user to infer the internal logic of the large model in reverse and adjust the training parameters of the large model accordingly, thereby improving the development efficiency of the large model.
[0065] In one possible implementation, after determining the result text, the method further includes: adjusting specific parameters in the large model to regenerate at least one partial result text, wherein the partial result text begins with the arbitrary lexical term.
[0066] In embodiments of the present invention, for example, Figure 7 As shown, the user asked the question "How to make bubble tea," and the displayed answer is: "Ingredients: 1. 2 black tea bags 2. 1 cup (approx. 250 ml) water 3. 1 cup (approx. 250 ml) whole milk 4. 2-3 tablespoons white sugar 5. 1 / 4 cup tapioca pearls (optional) 6. Hot water (as needed, for cooking the pearls) 7. Ice cubes (optional) as needed Steps: 1. **Brewing the black tea:** In a small saucepan, add 1 cup of water and 2 black tea bags. Heat over medium-low heat until the water boils." Then turn the heat to low and continue simmering for 5 minutes. After that, turn off the heat and let the black tea steep in the hot water for about 10 minutes to allow the tea flavor to fully release. 2. **Filtering the black tea:** Use a tea strainer or fine mesh sieve to filter out the tea bag and pour the tea into a large cup or teapot. 3. **Adding sugar and milk:** Add 2-3 tablespoons of white sugar to the black tea, adjusting the sweetness to your taste. Then, slowly pour in 1 cup of whole milk, stirring constantly until the sugar is completely dissolved and the milk tea has a uniform color. Figure 7 In the result text, all words have been segmented, and each segment has a set background color and transparency. However, for display purposes, the background color and transparency of each segment are not shown. Assuming the selected word in the step is "milk," the display of the "milk" result includes a predicted probability of 0.98766232, and shows other replaceable words and their corresponding predicted probabilities. If the user is prompted to "view other sentences," then several other text contents related to "milk" will be regenerated. Assuming the user clicks "view other sentences," three types of content are generated, as follows:
[0067] 1 & 3. **Add Sugar and Milk**: Add 4-5 tablespoons of granulated sugar to the black tea, adjusting the sweetness to your taste. Then, slowly pour in 1 cup of whole milk, stirring constantly until the sugar is completely dissolved and the milk tea has a uniform color. 4. **Cook the Tapioca Pearls (if adding)**: In a separate pot, add enough water and add the tapioca pearls. Bring to a boil over high heat, then reduce to medium-low heat and cook for about 15-20 minutes, until the pearls become translucent and elastic. Then, turn off the heat, cover the pot, and let the pearls continue to soak in the hot water for about 10 minutes to absorb more water and improve their texture. 5. **Rinse the Tapioca Pearls in Cold Water (if adding)**: Remove the cooked tapioca pearls with a sieve and rinse them in cold water. This removes excess starch and makes the pearls more chewy. 6. **Mix and Garnish**: Add the cooked tapioca pearls to the milk tea. If you prefer iced milk tea, you can add ice cubes. Finally, you can sprinkle some chocolate powder, cinnamon powder, or chopped mint leaves on top as a garnish, depending on your personal preference.
[0068] 2 & 3. **Add Sugar and Milk**: Add 2-3 tablespoons of white sugar to the black tea, adjusting the sweetness to your taste. Then, slowly pour in 1 cup of whole milk, stirring constantly until the sugar is completely dissolved and the milk tea has a uniform color. 4. **Cook the Tapioca Pearls (if adding)**: In another pot, add enough water and add the tapioca pearls. Bring to a boil over high heat, then reduce to medium-low heat and cook for about 15-20 minutes, until the pearls become translucent and elastic. Then, turn off the heat, cover the pot, and let the pearls continue to cook in the hot water for about 20 minutes to absorb more water and improve their texture. 5. **Rinse the Tapioca Pearls with Cold Water (if using)**: Remove the cooked tapioca pearls with a sieve and rinse them in cold water. This removes excess starch and makes the pearls more chewy. 6. **Mix and Garnish**: Add the cooked tapioca pearls to the milk tea. If you prefer iced milk tea, add ice cubes as desired. Finally, you can sprinkle some chocolate powder, cinnamon powder, or chopped mint leaves on top as a garnish, depending on your personal preference.
[0069] 3. **Add Sugar and Milk**: Add 2-3 tablespoons of white sugar to the black tea, adjusting the sweetness to your taste. Then, slowly pour in 1 cup of whole milk, stirring constantly until the sugar is completely dissolved and the milk tea has a uniform color. 4. **Cook the Tapioca Pearls (if using)**: In another pot, add enough water and add the tapioca pearls. Bring to a boil over high heat, then reduce to medium-low heat and cook for about 15-20 minutes, until the pearls become translucent and elastic. Then, turn off the heat, cover the pot, and let the pearls continue to soak in the hot water for about 10 minutes to absorb more water and improve their texture. 5. **Rinse the Tapioca Pearls (if using)**: Remove the cooked tapioca pearls with a sieve and rinse them in cold water. This removes excess starch and makes the pearls more chewy. 6. **Mix and Garnish**: Add the cooked tapioca pearls to the milk tea. If you prefer iced milk tea, you can add ice cubes. Finally, you can sprinkle some chocolate powder, cinnamon powder, or chopped mint leaves on top as a garnish, depending on your personal preference.
[0070] In step 3 above, "milk" is the selected word element, which can be represented by a display box. Under normal circumstances, the content after "milk" should be generated, but for the sake of content coherence, "3, **add sugar and" are displayed together.
[0071] In one possible implementation, suppose that when a user is creating a novel using a large model, and is not satisfied with a key token "smile" in a dialogue scene of a certain character, the user can use the "view other sentences" function to see complete sentences with different styles and directions derived from "smile" in the large model, providing the user with more inspiration and creative directions.
[0072] Through the above embodiments, the generation logic of the large model is presented visually, enhancing the interpretability of the large model's output results. It displays the large model's probability prediction for the next possible token, observes different text generation results based on token content changes, helps users understand the large model's generation logic, and more intuitively observes the large model's training effect. For large model developers, it allows for intuitive observation of the large model's training effect, thereby improving the efficiency of large model development and increasing confidence in the large model's training results. For content creators, visualization aids in understanding the model-assisted creation approach, making them more willing to adopt model-generated ideas, thereby improving creation efficiency and quality.
[0073] In this embodiment of the invention, an apparatus for generating visual text is provided, such as... Figure 8 As shown, it specifically includes: an acquisition unit 801, a generation unit 802, a processing unit 803, and an output unit 804;
[0074] The acquisition unit 801 is used to acquire question information; the generation unit 802 is used to input the question information into a large model to generate intermediate text corresponding to the question information; the processing unit 803 is used to perform word segmentation on the intermediate text, and to perform visual encoding on the segmented intermediate text according to a pre-set visual encoding rule to generate result text, wherein the result text displays the division of multiple word units and the predicted probability of each word unit against a background of at least one color with different transparency; and the output unit 804 is used to output the result text.
[0075] Furthermore, the pre-set visual encoding rules include: setting the background color and transparency of the word element according to the predicted probability of each word element; increasing the transparency of the background of the word element by the same color in response to an increase in the predicted probability; or, decreasing the transparency of the background of the word element by the same color in response to an increase in the predicted probability.
[0076] Furthermore, the acquisition unit is also used to: acquire word filtering conditions; the device further includes: a filtering unit, used to filter words in the intermediate text according to the word filtering conditions, and determine the special words that are filtered out.
[0077] Furthermore, the device also includes a setting unit for setting the background color and transparency of the special word character.
[0078] Furthermore, the device further includes: a receiving unit, configured to receive a viewing instruction for any word element in the result text, wherein the viewing instruction is used to query at least one alternative word element for the any word element and the predicted probability of each alternative word element.
[0079] Furthermore, the device further includes: a display unit, used to overlay and display the viewing result corresponding to the viewing instruction on the display interface of the result text, wherein the viewing result includes at least one replaceable word element of any word element and the predicted probability of each replaceable word element.
[0080] Furthermore, the device further includes: a receiving unit, configured to receive a word substitution instruction, wherein the word substitution instruction is configured to replace the word with any substitution word in the viewing result of the word.
[0081] Furthermore, the apparatus further includes: a replacement unit, configured to replace any word in the result text with any replacement word, and regenerate all text following any word in the result text, thereby updating the result text.
[0082] Furthermore, the apparatus further includes: an adjustment unit for adjusting specific parameters in the large model to regenerate at least one partial result text, wherein the partial result text begins with the arbitrary lexical term.
[0083] Figure 9 This is a schematic diagram of the structure of the electronic device described in an embodiment of the present invention. Figure 9 As shown, it includes a general computer hardware architecture, which includes at least a processor 901 and a memory 902. The processor 901 and the memory 902 are connected via a bus 903. The memory 902 is adapted to store instructions or programs executable by the processor 901. The processor 901 can be a standalone microprocessor or a collection of one or more microprocessors. Thus, the processor 901 executes the instructions stored in the memory 902 to perform the method flow of the embodiments of the present invention as described above, thereby realizing data processing and control of other devices. The bus 903 connects the above-mentioned components together, and also connects the above-mentioned components to a display controller 904, a display device, and an input / output (I / O) device 905. The input / output (I / O) device 905 can be a mouse, keyboard, modem, network interface, touch input device, motion-sensing input device, printer, and other devices known in the art. Typically, the input / output device 905 is connected to the system via an input / output (I / O) controller 906.
[0084] The instructions stored in memory 902 are executed by at least one processor 901 to: acquire problem information; input the problem information into a large model to generate intermediate text corresponding to the problem information; perform word segmentation on the intermediate text, and perform visual encoding on the segmented intermediate text according to a pre-set visual encoding rule to generate result text, wherein the result text displays the division of multiple word units and the predicted probability of each word unit against a background of at least one color with different transparency; and output the result text.
[0085] Specifically, the electronic device includes: one or more processors 901 and a memory 902. Figure 9 Take processor 901 as an example. Processor 901 and memory 902 can be connected via a bus or other means. Figure 9 Taking a bus connection as an example, memory 902, as a non-volatile computer-readable storage medium, can be used to store non-volatile software programs, non-volatile computer-executable programs, and modules. Processor 901 executes various functional applications and data processing of the device by running the non-volatile software programs, instructions, and modules stored in memory 902, thereby realizing the aforementioned method for generating visual text.
[0086] Memory 902 may include a program storage area and a data storage area, wherein the program storage area may store the operating system and applications required for at least one function; the data storage area may store an option list, etc. Furthermore, memory 902 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other non-volatile solid-state storage device. In some embodiments, memory 902 may optionally include memory remotely located relative to processor 901, and these remote memories may be connected to external devices via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.
[0087] One or more modules are stored in memory 902, and when executed by one or more processors 901, they perform the method for generating visual text in any of the above method embodiments.
[0088] As those skilled in the art will recognize, various aspects of the embodiments of the present invention can be implemented as a system, method, or computer program product. Therefore, various aspects of the embodiments of the present invention can take the form of a completely hardware implementation, a completely software implementation (including firmware, resident software, microcode, etc.), or an implementation combining software and hardware aspects, which may generally be referred to herein as a "circuit," "module," or "system." Furthermore, various aspects of the embodiments of the present invention can take the form of a computer program product implemented in one or more computer-readable media having computer-readable program code implemented thereon.
[0089] Any combination of one or more computer-readable media can be used. A computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. A computer-readable storage medium can be, for example, (but not limited to) an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or apparatus, or any suitable combination thereof. More specific examples (not an exhaustive list) of computer-readable storage media will include: an electrical connection having one or more wires, a portable computer floppy disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable optical disc read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In the context of embodiments of the present invention, a computer-readable storage medium can be any tangible medium capable of containing or storing a program used by or in conjunction with an instruction execution system, device, or apparatus.
[0090] Computer-readable signal media may include propagated digital signals having computer-readable program code implemented therein, such as in baseband or as part of a carrier wave. Such propagated signals may take any of a variety of forms, including, but not limited to, electromagnetic, optical, or any suitable combination thereof. A computer-readable signal medium may be any computer-readable medium that is not a computer-readable storage medium and can communicate, propagate, or transmit a program used by or in conjunction with an instruction execution system, device, or apparatus.
[0091] Program code implemented on a computer-readable medium may be transmitted using any suitable medium, including but not limited to wireless, wired, fiber optic cable, RF, or any suitable combination thereof.
[0092] Computer program code for performing operations relating to various aspects of embodiments of the present invention can be written in any combination of one or more programming languages, including: object-oriented programming languages such as Java, Smalltalk, C++, etc.; and conventional procedural programming languages such as the "C" programming language or similar programming languages. The program code can be executed as a standalone software package entirely on the user's computer, partially on the user's computer, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the latter case, the remote computer can be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computer (e.g., via the Internet provided by an Internet service provider).
[0093] The flowchart illustrations and / or block diagrams of the methods, apparatus (systems), and computer program products according to embodiments of the present invention describe various aspects of the embodiments of the present invention. It will 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 program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, or other programmable data processing apparatus to produce a machine such that the instructions (executed via the processor of the computer or other programmable data processing apparatus) create means for implementing the functions / actions specified in the flowchart and / or block diagram blocks or blocks.
[0094] These computer program instructions may also be stored in a computer-readable medium that can direct a computer, other programmable data processing apparatus or other means to operate in a particular manner, such that the instructions stored in the computer-readable medium produce an article of writing that includes instructions that implement the functions / actions specified in flowchart and / or block diagram blocks or blocks.
[0095] Computer program instructions may also be loaded onto a computer, other programmable data processing apparatus or other device to cause a series of operable steps to be performed on the computer, other programmable apparatus or other device to produce a computer-implemented process, such that the instructions, which execute on the computer or other programmable apparatus, provide for implementing the functions / actions specified in flowchart and / or block diagram blocks or blocks.
[0096] The above description is merely a preferred embodiment of this application and is not intended to limit this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.
[0097] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, use, and processing of such data must comply with the relevant laws, regulations, and standards of the relevant countries and regions, and corresponding access points are provided for users to choose to authorize or refuse processing. A user's refusal to process personal information beyond what is necessary for basic functions will not affect the user's use of basic functions.
Claims
1. A method for generating visual text, characterized in that, The method includes: Obtain problem information; The problem information is input into the large model to generate intermediate text corresponding to the problem information; The intermediate text is segmented into words, and the segmented intermediate text is visually encoded according to a pre-set visual encoding rule to generate a result text. The result text displays the segmentation of multiple word units and the predicted probability of each word unit against a background of at least one color with different transparency. Output the resulting text.
2. The method according to claim 1, characterized in that, The pre-set visual encoding rules include: The background color and transparency of each word are set according to the predicted probability of each word; In response to an increase in the predicted probability, the background transparency of the word element is increased by the same color; or, in response to an increase in the predicted probability, the background transparency of the word element is decreased by the same color.
3. The method according to claim 1, characterized in that, The method further includes: Get the word filtering conditions; The intermediate text is filtered according to the lexical filtering conditions to identify the special lexical elements that are filtered out.
4. The method according to claim 3, characterized in that, The method further includes: Set the background color and transparency of the special word.
5. The method according to claim 1, characterized in that, The method further includes: The system receives a viewing instruction for any word element in the result text, wherein the viewing instruction is used to query at least one alternative word element for the given word element and the predicted probability of each alternative word element.
6. The method according to claim 5, characterized in that, The method further includes: The viewing results corresponding to the viewing command are overlaid on the display interface of the result text. The viewing results include at least one replaceable word for any word and the predicted probability of each replaceable word.
7. The method according to claim 6, characterized in that, The method further includes: A word replacement instruction is received, wherein the word replacement instruction is used to replace any word in the viewing result of any word.
8. The method according to claim 7, characterized in that, The method further includes: Replace any word in the result text with any replacement word, and regenerate all the text following any word in the result text, thus updating the result text.
9. The method according to claim 5, characterized in that, The method further includes: Adjust specific parameters in the large model to regenerate at least one partial result text, wherein the partial result text begins with the arbitrary lexical term.
10. An apparatus for generating visual text, characterized in that, The device includes: The acquisition unit is used to acquire problem information; The generation unit is used to input the problem information into the large model and generate the intermediate text corresponding to the problem information; The processing unit is used to perform word segmentation on the intermediate text, perform visual encoding on the segmented intermediate text according to a pre-set visual encoding rule, and generate result text. The result text displays the division of multiple word elements and the predicted probability of each word element against a background of at least one color with different transparency. The output unit is used to output the result text.
11. An electronic device comprising a memory and a processor, characterized in that, The memory is used to store one or more computer program instructions, wherein the one or more computer program instructions are executed by the processor to implement the method as described in any one of claims 1-9.
12. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the method as described in any one of claims 1-9.
Citation Information
Patent Citations
Generating digital design document variants using transformer-based generative language model
CN116644727A
Text generation method and device, computer equipment and storage medium
CN117973380A
System and method for assisting in the provision of algorithmic transparency
US20180121817A1