Method and device for outputting text containing symbol combination

By adding prompt words and preset conversion logic to the large language model, the problem of differences in symbol combination formats is solved, achieving efficient automatic conversion and accurate output of symbol combinations, thus meeting users' daily reading habits.

CN121615596APending Publication Date: 2026-03-06BAIRONG ZHIXIN (BEIJING) TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511555847.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-10-29
Publication Date
2026-03-06

AI Technical Summary

Technical Problem

The symbol combination format output by the large language model differs from users' daily habits, resulting in low efficiency in formula transmission and requiring professional translation.

Method used

Add prompts to user requirements and use preset conversion logic to convert computer language symbol combinations output by the large language model into a format that conforms to preset display rules. Use identifiers to distinguish between symbol combinations and non-symbol combinations to improve accuracy and efficiency.

Benefits of technology

It reduces the need for manual translation, improves the efficiency and accuracy of symbol combination transmission, and allows users to directly understand the output symbol combinations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121615596A_ABST
    Figure CN121615596A_ABST
Patent Text Reader

Abstract

The invention provides a method and device for outputting a text containing a symbol combination, and the method comprises the steps: obtaining a demand of a user, the demand being used for indicating to obtain the text containing the symbol combination; adding a cue word for the demand, wherein the cue word is used for indicating the large language model to output a symbol combination corresponding to the target computer language; inputting the demand added with the cue word into a large language model to obtain an intermediate text which is output by the large language model and comprises a symbol combination corresponding to the target computer language; performing format conversion on the symbol combination in the intermediate text by adopting a preset conversion logic to obtain a target text, the symbol combination in the target text conforming to a preset display rule, and the preset conversion logic being used for converting the symbol combination into a format conforming to the preset display rule from the target computer language; and outputting the target text to the user. The transmission efficiency of the symbol combination can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of artificial intelligence technology, and in particular to a method for outputting text containing symbol combinations, a device for outputting text containing symbol combinations, an electronic device, a computer-readable storage medium, and a computer program product. Background Technology

[0002] With the rapid development of artificial intelligence, Large Language Models (LLMs) have also made significant breakthroughs in natural language processing. Large language models are not only capable of everyday question answering, summary extraction, and text translation, but they can also play a role in fields such as mathematics, physics, and engineering.

[0003] When a user needs to retrieve certain information (such as information containing symbols, like formulas) through a large language model, the user inputs their request into the model. The large language model then generates the corresponding content based on the user's input and displays it to the user. For example, if a user needs to query Euler's identity through the large language model, the user first inputs "Euler's identity" into the model, and the model outputs "e^{i\pi} + 1 = 0" based on that.

[0004] In reality, users are accustomed to using the formatted Euler identity e. iΠ +1=0. The output of the large language model, e^{i\pi} + 1 = 0, is the formula for solving a quadratic function in computer language. The formula output by the large language model differs significantly in format from the formulas users are accustomed to using in their daily lives. After the large language model outputs the formula, it still requires professional translation. This increases the time it takes for the formula to travel from the requester to the end user, thus reducing the efficiency of formula transmission. Summary of the Invention

[0005] The purpose of this application is to provide a method, device, electronic device, computer-readable storage medium, and computer program product for outputting text containing symbol combinations, which enables the symbol combinations in the output text to directly conform to the user's daily habits, thereby improving the transmission efficiency of symbol combinations.

[0006] To address the aforementioned technical problems, this application provides the following technical solutions: The first aspect of this application provides a method for outputting text containing symbol combinations. The method includes: obtaining a user's request, which instructs the user to obtain text containing symbol combinations; adding a prompt word to the request, which instructs a large language model to output symbol combinations corresponding to a target computer language; inputting the request with the added prompt word into the large language model to obtain intermediate text output by the large language model, which includes symbol combinations corresponding to the target computer language; converting the symbol combinations in the intermediate text using a preset conversion logic to obtain target text, wherein the symbol combinations in the target text conform to preset display rules, and the preset conversion logic is used to convert the symbol combinations from the target computer language to a format conforming to the preset display rules; and outputting the target text to the user.

[0007] Compared to existing technologies, the text output method containing symbol combinations provided in the first aspect of this application adds prompt words to the user's input requirements, which are then input into a large language model. The large language model outputs text containing symbol combinations corresponding to the target computer language. Then, a preset conversion logic is used to convert the symbol combinations of the target computer language in the text into symbol combinations required for typesetting. This reduces the need for manual translation of non-typesetting symbol combinations output by the model. Furthermore, the preset conversion logic automatically converts the symbol combinations corresponding to the specified computer language into symbol combinations required for typesetting, resulting in higher conversion efficiency and thus improving the transmission efficiency of symbol combinations.

[0008] In other embodiments provided in this application, before inputting the requirements with added prompt words into the large language model, the method further includes: identifying the natural language fields corresponding to symbol combinations in the requirements; adding identifiers at the start and end positions of the natural language fields corresponding to symbol combinations in the requirements, the identifiers being used to distinguish the natural language fields corresponding to symbol combinations in the requirements from the natural language fields corresponding to non-symbol combinations, thereby enabling the large language model to distinguish the computer language fields corresponding to symbol combinations from the computer language fields corresponding to non-symbol combinations in the intermediate text; inputting the requirements with added prompt words into the large language model includes: inputting the requirements with added prompt words and identifiers into the large language model.

[0009] By adding identifiers to the requirements, large language models can more accurately identify symbol combinations, improving the accuracy of the symbol combinations output by the large model, and thus improving the accuracy of text output.

[0010] In other embodiments provided in this application, the identifier includes a first identifier and a second identifier. The first identifier is used to represent that the large language model represents the computer language field corresponding to the symbol combination as an inline element in the intermediate text, and the second identifier is used to represent that the large language model represents the computer language field corresponding to the symbol combination as a block-level element in the intermediate text. Adding identifiers at the start and end positions of the natural language field corresponding to the symbol combination includes: if the relevance of the natural language field corresponding to the symbol combination to the overall content of the requirement is lower than a preset relevance, then adding the first identifier at the start and end positions of the natural language field corresponding to the symbol combination; if the relevance of the natural language field corresponding to the symbol combination to the overall content of the requirement is not lower than a preset relevance, then adding the second identifier at the start and end positions of the natural language field corresponding to the symbol combination.

[0011] By determining the importance of symbol combinations in the requirements, different identifiers can be added to the requirements to make the symbol combinations in the final output text more consistent with the user's actual needs and improve the user's text viewing experience.

[0012] In other embodiments provided in this application, identifying the natural language field corresponding to the symbol combination in the requirement includes: splitting the requirement into multiple single characters; if there is a single character among the multiple single characters that matches a field in a preset table, then the field within the semantic range of the matching single character in the requirement is determined as the natural language field corresponding to the symbol combination, and the preset table includes natural language corresponding to various symbol combinations; if there is no single character among the multiple single characters that matches a field in the preset table, then the step of inputting the requirement with added prompt words into the large language model is performed.

[0013] By matching single characters in the requirements with fields in a preset table, and then using the fields within the semantic range of the successfully matched single characters in the requirements as the natural language fields corresponding to the symbol combinations in the requirements, the search efficiency of the natural language fields corresponding to the symbol combinations in the requirements can be improved, thereby improving the labeling efficiency of identifiers.

[0014] In other embodiments provided in this application, the symbol combination in the intermediate text is formatted using a preset conversion logic, including: determining a target field in the intermediate text that includes the symbol combination; adding identifiers at the start and end positions of the target field, the identifiers being used to characterize the start and end positions of the target field; and performing a format conversion on the intermediate text after adding the identifiers using the preset conversion logic, the preset conversion logic being able to determine the start and end positions of the conversion based on the identifiers.

[0015] The beginning and end of fields containing symbol combinations in the text output by the large language model are marked, and the marked symbol combinations are formatted using a preset conversion logic. This allows the preset conversion logic to more accurately determine the range of content to be converted, thereby improving the accuracy of symbol combination conversion.

[0016] In other embodiments provided in this application, determining a target field including symbol combinations in intermediate text includes: if the intermediate text includes a consecutive number of symbol combinations greater than a first preset number, then the consecutive number of symbol combinations greater than the first preset number in the intermediate text is determined as the target field, wherein the first preset number is determined based on the minimum number of bytes of fields including symbol combinations obtained historically; if the intermediate text does not include a consecutive number of symbol combinations greater than the first preset number, then a consecutive number of symbol combinations greater than a second preset number is extracted from the intermediate text as the target field, wherein the second preset number is less than the first preset number.

[0017] Identifying consecutive symbol combinations exceeding a first preset number in the intermediate text as target fields containing such symbol combinations improves the efficiency of extracting these fields. Furthermore, if no consecutive symbol combinations exceeding the first preset number exist in the intermediate text, reducing the first preset number to a second preset number allows for the effective extraction of target fields containing symbol combinations from the intermediate text.

[0018] In other embodiments provided in this application, before outputting the target text to the user, the method further includes: performing character similarity matching between the symbol combination of the target computer language and the symbol combination that conforms to the preset display rules; if the matched character similarity is greater than the preset similarity, then performing the step of outputting the target text to the user; if the matched character similarity is less than or equal to the preset similarity, then performing the step of inputting the requirements after adding prompt words into the large language model.

[0019] Before outputting text to the user, the system matches the symbol combinations of the target computer language with symbol combinations that conform to preset display rules to determine whether the symbol combinations in the output text are correct. If incorrect, the system regenerates the text using a large language model, thereby achieving automatic error correction in the text output and improving the accuracy of the symbol combinations in the text output.

[0020] A second aspect of this application provides an output device for text containing symbol combinations. The device includes: an acquisition module for acquiring a user's request, the request indicating the acquisition of text containing symbol combinations; an adding module for adding prompt words to the request, the prompt words instructing a large language model to output symbol combinations in a target computer language; a processing module for inputting the request with added prompt words into the large language model to obtain intermediate text output by the large language model containing symbol combinations of the target computer language; a conversion module for converting the symbol combinations in the intermediate text using a preset conversion logic to obtain target text, the symbol combinations in the target text conforming to preset display rules, the preset conversion logic being used to convert the symbol combinations from the target computer language to a format conforming to the preset display rules; and an output module for outputting the target text to the user.

[0021] A third aspect of this application provides an electronic device, which includes a processor, a memory, and a bus; wherein the processor and the memory communicate with each other via the bus, and the processor is used to call program instructions in the memory to execute the method in the first aspect.

[0022] A fourth aspect of this application provides a computer-readable storage medium comprising: a stored program; wherein, when the program is executed, it controls the device on which the computer-readable storage medium is located to perform the method of the first aspect.

[0023] The fifth aspect of this application provides a computer program product, which includes a computer program or instructions; wherein, when the computer program or instructions are executed by the device, the method in the first aspect is implemented.

[0024] The text output device containing symbol combinations provided in the second aspect of this application, the electronic device provided in the third aspect, the computer-readable storage medium provided in the fourth aspect, and the computer program product provided in the fifth aspect have the same or similar beneficial effects as the text output method containing symbol combinations provided in the first aspect. Attached Figure Description

[0025] The above and other objects, features, and advantages of exemplary embodiments of this application will become readily understood by reading the following detailed description with reference to the accompanying drawings. In the drawings, several embodiments of this application are illustrated by way of example and not limitation, with the same or corresponding reference numerals denoteing the same or corresponding parts, wherein: Figure 1 This is a schematic diagram illustrating an application scenario of a text output method containing symbol combinations, as described in the embodiments of this application. Figure 2 This is a flowchart illustrating the method for outputting text containing symbol combinations in the embodiments of this application. Figure 1 ; Figure 3 This is a flowchart illustrating the method for outputting text containing symbol combinations in the embodiments of this application. Figure 2 ; Figure 4 This is a flowchart illustrating the method for outputting text containing symbol combinations in the embodiments of this application. Figure 3 ; Figure 5 This is a flowchart illustrating the method for outputting text containing symbol combinations in the embodiments of this application. Figure 4 ; Figure 6 This is a schematic diagram showing the text containing symbol combinations output by the large language model before and after using the text output method for text containing symbol combinations provided in the embodiments of this application; Figure 7 This is a schematic diagram of the structure of a text output device containing symbol combinations in the embodiments of this application. Figure 1 ; Figure 8 This is a schematic diagram of the structure of a text output device containing symbol combinations in the embodiments of this application. Figure 2 ; Figure 9 This is a schematic diagram of the structure of the electronic device in the embodiments of this application. Detailed Implementation

[0026] Exemplary embodiments of this application will now be described in more detail with reference to the accompanying drawings. While exemplary embodiments of this application are shown in the drawings, it should be understood that this application may be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided to enable a more thorough understanding of this application and to fully convey the scope of this application to those skilled in the art.

[0027] It should be noted that, unless otherwise stated, the technical or scientific terms used in this application shall have the ordinary meaning as understood by one of ordinary skill in the art to which this application pertains.

[0028] Current large language models output symbol combinations in computer language, which is not easy for users to understand directly. The operators need to be manually converted from computer language into a layout format that is easy for people to read and understand, which reduces the efficiency of transmitting symbol combinations to the end user.

[0029] In view of this, embodiments of this application provide a method for outputting text containing symbol combinations, a device for outputting text containing symbol combinations, an electronic device, a computer-readable storage medium, and a computer program product. These methods add prompts to the user's request for symbol combinations, enabling the large model to output symbol combinations of the target computer language. Furthermore, preset conversion logic is used to convert the symbol combinations of the target computer language into symbol combinations that conform to preset display rules, thereby achieving automatic conversion of the model's output symbol combinations. This reduces the steps of manually translating symbol combinations and improves the transmission efficiency of symbol combinations.

[0030] It should be noted that all components, data, and related processing methods involved in this application are authorized by the user or fully authorized by all parties, and the collection, use, and processing of related data comply with the relevant laws, regulations, and standards of the relevant countries and regions.

[0031] First, the application scenarios of the text output method containing symbol combinations provided in the embodiments of this application will be described.

[0032] Figure 1 This is a schematic diagram illustrating an application scenario of the text output method involving symbol combinations in this application embodiment. See [link to relevant documentation]. Figure 1 As shown, the scenario may include: interactive page 11, large language model 12, and cloud 13.

[0033] When a user needs to query a certain symbol combination, the user inputs their query request into the interactive page 11. The interactive page 11 adds a prompt word to the query and inputs the query with the prompt word into the large language model 12. The large language model 12 outputs the symbol combination in the target computer language based on the query with the prompt word and transmits the symbol combination in the target computer language to the cloud 13 via a preset Application Programming Interface (API). The cloud 13 uses preset conversion logic to convert the symbol combination in the target computer language into a symbol combination that conforms to preset display rules, and sends the symbol combination conforming to the preset display rules to the interactive page 11, so that the user can intuitively see the symbol combination that matches their daily usage habits through the interactive page 11.

[0034] The symbol combinations here can refer to combinations of operation symbols (such as mathematical formulas, physical formulas, etc.), combinations of pinyin, combinations of phonetic symbols, combinations of radicals, etc.

[0035] The preset display rules here refer to the visualization format specifications that the symbol combination should follow when it is finally presented to the user. In some embodiments, these visualization format specifications can be the publicly available format of textbooks, open documents, etc. For example, Euler's identity is presented according to the preset display rules as: e iΠ +1=0.

[0036] The preset conversion logic here refers to the logic that converts operator combinations from the target computer language to a format that conforms to preset display rules. This logic needs to be determined based on the specific type of the target computer language and the preset display rules. For example, if the target computer language is LaTeX and the preset display rule is HTML format rendered by KaTeX, the preset conversion logic would be the logic to convert from LaTeX to HTML format. In practical applications, this logic can be implemented using plugins such as markdown-it-katex.

[0037] From the user's perspective, the user inputs the need to obtain symbol combinations into the large language model 12 through the interactive page 11, and the large language model 12 displays symbol combinations that conform to preset display rules on the interactive page 11.

[0038] Of course, user requests can also be processed without going through the cloud 13. Specifically, a preset conversion logic can be installed locally to convert the symbol combinations of the target computer language output by the large language model 12 into symbol combinations that conform to preset display rules, which are then displayed through the interactive page 11. Alternatively, the interactive page 11, the large language model 12, and the preset conversion logic can be integrated into a toolkit. Users input their requests into the toolkit through the interactive page 11. The large language model 12 and the preset conversion logic in the toolkit process the requests and generate symbol combinations that conform to preset display rules, which are then displayed through the interactive page 11. The toolkit is flexible and portable, improving the flexibility of symbol combination queries. Specific interactive scenarios for symbol combination queries are not limited here.

[0039] Next, the method for outputting text containing symbol combinations provided in the embodiments of this application will be described in detail.

[0040] Figure 2 This is a flowchart illustrating the method for outputting text containing symbol combinations in the embodiments of this application. Figure 1 See Figure 2 As shown, the method may include S21-S25.

[0041] S21: Obtain the user's request, which indicates the need to obtain text containing combinations of symbols.

[0042] When a user needs to query symbol combinations through the large language model, the user needs to input their query for symbol combinations into the large language model. Specifically, the user can input their query into the corresponding interactive page of the large language model.

[0043] The requirement here is to enable the large language model to understand which symbol combination the user needs, and then generate text containing that symbol combination. For example, when a user needs to query Euler's identity through the large language model, the user's input could be: Euler's identity, what is Euler's identity, query Euler's identity, etc. The specific content and language expression of the requirement are not limited here.

[0044] The aforementioned symbol combinations refer to the precise and indirect expression of content through combinations of symbols in fields such as mathematics, physics, and engineering. For example, in mathematics, symbol combinations can be various mathematical formulas, such as the Pythagorean theorem. 2 +b 2 =c 2 In physics, combinations of symbols can represent various physical formulas, such as the intelligent equation E=mc². 2 In the field of engineering, combinations of symbols can represent various engineering formulas, such as the earth pressure formula P=γ⋅h⋅K. a .

[0045] S22: Add prompt words to the requirements. Prompt words are used to instruct the large language model to output the symbol combination corresponding to the target computer language.

[0046] If the requirements are directly input into a large language model, the model will output the symbol combinations of its default computer language. However, different large language models use different default computer languages ​​for the output symbol combinations. For example, some models output symbol combinations for LaTeX, while others output symbol combinations for KaTeX. This increases the complexity of subsequent symbol combination format conversion, requiring the selection of different conversion tools based on the computer language of the symbol combinations output by the large language model.

[0047] Adding prompts to the requirements allows large models to output symbol combinations of the target computer language. Subsequently, a single conversion tool can be used to perform a format conversion to present symbol combinations that conform to preset display rules, thus improving the efficiency of outputting intuitively viewable symbol combinations.

[0048] When adding prompts to requirements, it's necessary to select simple, accurate prompts that enable the large language model to output the target computer language, based on its capabilities. For example, for a typical large language model, the prompt could be "Prompt." "Prompt" allows the large language model to output data in LaTeX format. The prompts must correspond to the requirements of the target computer language. The specific content of the prompts and the target computer language is not limited here.

[0049] The prompt can be added before, after, or inserted into the relevant content of the requirement. For example, when retrieving a formula is only one part of the requirement, the prompt can be inserted at the corresponding position in the requirement where the formula is retrieved. There are no restrictions on the specific insertion position of the prompt within the requirement.

[0050] S23: Input the requirements after adding prompt words into the large language model, and obtain the intermediate text output by the large language model, which includes the symbol combination corresponding to the target computer language.

[0051] Large language models are natural language processing models based on deep learning that can understand and generate human language. They are trained on large amounts of text data to learn the statistical patterns and semantic relationships of language, thereby enabling them to perform various language tasks such as text generation, translation, question answering, and summarization.

[0052] Input the requirements after adding prompt words into the large language model, and the large language model will generate and output intermediate text including the symbol combination corresponding to the target computer language according to the requirements.

[0053] Specifically, when the requirement is simply to obtain symbol combinations, the intermediate text output by the large language model is the symbol combination itself. For example, when the requirement is "obtain Euler's identity", the intermediate text output by the large language model is "e^{i\pi} + 1= 0". However, when the requirement is to obtain both symbol combinations and other unsigned combinations, the intermediate text output by the large language model includes not only symbol combinations but also other non-symbolic combinations such as text. For example, when the requirement is "generate an introduction to the origin of Euler's identity", the intermediate text output by the large language model is: the historical story of the generation of Euler's identity and e^{i\pi}+ 1 = 0.

[0054] S24: The symbol combination in the intermediate text is converted into a format using a preset conversion logic to obtain the target text. The symbol combination in the target text conforms to the preset display rules. The preset conversion logic is used to convert the symbol combination from the target computer language into a format that conforms to the preset display rules.

[0055] Although the symbol combinations in the intermediate text generated and output by the large language model meet a unified requirement—namely, generating symbol combinations in the target computer language—the symbol combinations generated by the large language model still use the computer language itself. To facilitate intuitive understanding of these symbol combinations by users, a preset conversion logic is needed to convert the target computer language symbol combinations in the intermediate text into symbol combinations that conform to preset display rules, thus obtaining the final target text provided to the user.

[0056] The preset conversion logic and preset display rules have been explained previously and will not be repeated here.

[0057] S25: Output the target text to the user.

[0058] The symbol combinations in the target text adopt preset display rules. The symbol combinations under the preset display rules conform to the user's daily reading habits. Therefore, outputting the target text to the user can make it easy for the user to understand the symbol combinations intuitively and clearly, and make it easy for the user to use the symbol combinations they need.

[0059] In the process of outputting target text to the user, the symbol combination that conforms to the preset display rules is first rendered in order to fix the form of the symbol combination. Then, the rendered symbol combination replaces the symbol combination of the target computer language in the intermediate text to accurately obtain the target text. Finally, the target text is displayed to the user through the interactive page, realizing the accurate output of text containing symbol combinations.

[0060] As described above, the text output method containing symbol combinations provided in this application adds prompts based on user input requirements, then inputs them into a large language model. The large language model outputs text containing symbol combinations corresponding to the target computer language. Then, a preset conversion logic is used to convert the symbol combinations of the target computer language in the text into symbol combinations required for typesetting. This reduces the need for manual translation of non-typesetting symbol combinations output by the model. Furthermore, the preset conversion logic automatically converts the symbol combinations corresponding to the specified computer language into symbol combinations required for typesetting, resulting in higher conversion efficiency and improved transmission efficiency of symbol combinations.

[0061] Furthermore, as Figure 2 As a refinement and extension of the method shown, this application embodiment also provides a method for outputting text containing symbol combinations.

[0062] Figure 3 This is a flowchart illustrating the method for outputting text containing symbol combinations in the embodiments of this application. Figure 2 See Figure 3 As shown, the method may include S31-S36.

[0063] S31: Obtain the user's request, which is used to instruct the retrieval of text containing combinations of symbols.

[0064] S32: Add prompt words to the requirements. Prompt words are used to instruct the large language model to output symbol combinations in the target computer language.

[0065] Steps S31 and S32 here are implemented in the same way as steps S21 and S22 in the previous embodiments. Please refer to the relevant descriptions in the previous embodiments, and they will not be repeated here.

[0066] S33: Add an identifier to the requirement. The identifier is used to distinguish the natural language fields corresponding to symbol combinations and the natural language fields corresponding to non-symbol combinations in the requirement.

[0067] Step S33 here and step S32 above can be executed simultaneously to improve the efficiency of processing requirements, thereby improving text output efficiency. Of course, step S33 here and step S32 above can also be executed asynchronously to ensure the accuracy of processing requirements, thereby improving the accuracy of text output.

[0068] By using identifiers to separate the natural language fields corresponding to symbolic combinations and non-symbolic combinations in the requirements, we can avoid large language models from understanding and generating symbolic combinations by obtaining only some of the natural language fields corresponding to symbolic combinations, thereby improving the accuracy of symbolic combinations generated by large language models.

[0069] Specifically, step S33 above may include: Step S33a: Identify the natural language fields corresponding to the symbol combinations in the requirements.

[0070] On one hand, the natural language corresponding to various symbol combinations can be statistically analyzed, and then the statistically analyzed natural language corresponding to various symbol combinations can be stored. For example, names such as "Pythagorean theorem" and "Euler's identity" can be stored in a list. In this way, after obtaining the user's input requirements, the requirements are matched with the contents of the stored list. If a match is successful, the field in the requirements that matches successfully is the natural language field corresponding to the symbol combination in the requirements.

[0071] On the other hand, common features of natural language corresponding to various symbol combinations can also be stored. These common features can be formulas, equations, expressions, theorems, and so on. This makes the stored content more concise, reduces the amount of data required for subsequent matching, and improves matching efficiency.

[0072] Specifically, step S33a above may include: Step S33aa: Break down the requirement into multiple words.

[0073] In other words, the content of the requirement is broken down into individual words. For example, if the requirement is "What is Euler's identity?", the individual words after breaking down the requirement are "Euler", "Euler", "identity", "equality", "is", "what", and "what".

[0074] Step S33ab: Determine if any of the multiple words matches a field in a preset table, which includes natural language corresponding to various symbol combinations. If yes, execute S33ac; otherwise, execute S33ad.

[0075] Match each single character with the fields in the preset table in sequence. As long as there is a single character in the requirement that matches the fields in the preset table, it is determined that there are single characters in the multiple single characters that match the fields in the preset table. However, each single character in the requirement needs to be matched with the fields in the preset table.

[0076] Continuing with the above example, assume that the preset table stores: formula, equation, expression, theorem. The characters "欧", "拉", "恒", "是", "什", "么" in the above requirement do not match the fields in the preset table, and the characters "等", "式" in the above requirement match the fields in the preset table. At this time, it is determined that there are single characters in the multiple single characters that match the fields in the preset table.

[0077] Step S33ac: Determine the fields within the semantic range of the matching single characters in the requirement as the natural language fields corresponding to the symbol combination.

[0078] If there are single characters in the requirement that match the preset table, it means that the fields near the matching single characters are the natural language fields corresponding to the symbol combination. Determining the fields within the semantic range of the matching single characters in the requirement as the natural language fields corresponding to the symbol combination can quickly and accurately determine the natural language fields corresponding to the symbol combination in the requirement.

[0079] The above semantic range refers to the field range that can form a phrase with practical meaning with the matching single characters. For example: the requirement is "欧拉恒等式是什么", and the matching single characters are "等", "式". The characters "等", "式" cannot form a phrase with practical meaning with the subsequent characters "是", "什", "么" in the requirement, but the characters "等", "式" can form the phrase "欧拉恒等式" with practical meaning with the previous characters "欧", "拉", "恒" in the requirement. Therefore, "欧拉恒等式" in the requirement is determined as the natural language field corresponding to the symbol combination in the requirement.

[0080] Step S33ad: Skip adding an identifier to the requirement.

[0081] If there are no single characters in the requirement that match the preset table, it means that there may be no content in the requirement that needs to obtain the symbol combination, or it may be that the fields in the preset table are not fully counted. Therefore, the step of adding an identifier to the requirement can be skipped, and the requirement after adding prompt words can be directly input into the large language model.

[0082] After identifying the natural language fields corresponding to the symbol combination from the requirement, the field can be marked to distinguish it from the natural language fields in the requirement that do not correspond to the symbol combination.

[0083] Step S33b: Add identifiers at the start and end positions of the natural language fields corresponding to the symbol combinations, thereby enabling the large language model to distinguish the computer language fields corresponding to the symbol combinations and the computer language fields corresponding to the non-symbol combinations in the intermediate text.

[0084] In practical applications, identifiers can be any symbol, such as $, $$, / , etc. The specific content of the identifier is not limited here.

[0085] The purpose of identifiers is to distinguish between the natural language fields corresponding to symbolic combinations and non-symbolic combinations in the requirements. Therefore, two identifiers can be used: one set at the beginning of the natural language field corresponding to the symbolic combination, and the other set at the end. In this way, the large language model can more clearly identify the natural language fields corresponding to symbolic combinations based on the requirements, and accurately generate the corresponding symbolic combinations.

[0086] In some embodiments, the requirements may include not only symbol combinations but also other textual content. To make the text output by the large model easier for users to view, different identifiers can be added to the natural language fields corresponding to the symbol combinations in the requirements, so that the large model can display the symbol combinations in the output text in the appropriate format, making it easier for users to view.

[0087] Specifically, the identifiers include a first identifier and a second identifier. The first identifier represents the computer language field corresponding to the symbol combination as an inline element in the intermediate text by the large language model. The second identifier represents the computer language field corresponding to the symbol combination as a block-level element in the intermediate text by the large language model.

[0088] Inline elements and block-level elements are two basic display types that describe how they occupy space and are arranged in the normal document flow.

[0089] Inline elements and their context content are on the same line, and they will only move to the next line when there is no more space on that line.

[0090] In practical applications, the first identifier corresponding to an inline element can be represented by a single dollar sign $. The element enclosed in a series of dollar signs $...$ is the inline element.

[0091] For example, in a line of content containing a formula $E=mc^2$, where the formula and its context content are on the same line, the formula enclosed in $...$ within that line of content is an inline element.

[0092] Block-level elements, on the other hand, occupy an entire line. Within their own line, block-level elements will occupy as much of the available width of their parent container as possible, forcing subsequent elements to be displayed on a new line, thus making the block-level element occupy the entire line.

[0093] In practical applications, the second identifier corresponding to a block-level element can be represented by double dollar signs $$. The element enclosed in double dollar signs $$...$$ is the block-level element.

[0094] For example, when the model outputs $$x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}$$, this formula will be displayed as a separate block, occupying a single line, and is usually centered. Therefore, the formula enclosed in $$...$$ symbols is a block-level element.

[0095] For example, suppose the intermediate text is: abc$E=mc^2$def The intermediate text undergoes format conversion using preset conversion logic, resulting in target text that conforms to preset display rules: abcE=mc 2 def For another example, suppose the intermediate text is: abc$$x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}$$def The intermediate text undergoes format conversion using preset conversion logic, resulting in target text that conforms to preset display rules: abc x = [-b±√(b²-4ac)] / 2a def For unimportant or simple symbol combinations, a first identifier can be used to mark them, causing them to appear on the same line as other content in the text. For important or complex symbol combinations, a second identifier can be used to mark them, causing them to appear on a separate line in the text to highlight them.

[0096] Of course, you can also choose the first identifier or the second identifier based on the relevance of the natural language field corresponding to the symbol combination to the overall content of the requirements.

[0097] Specifically, step S33b above may include: Step S33ba: Determine whether the relevance of the natural language field corresponding to the symbol combination to the overall content of the requirement is lower than the preset relevance. If yes, execute S33bb; otherwise, execute S33bc.

[0098] In specific judgments, semantic similarity analysis can be performed between the natural language field corresponding to the symbol combination and the overall content of the requirement. The analyzed similarity is the relevance between the natural language field corresponding to the symbol combination and the overall content of the requirement. Then, the relevance of the natural language field corresponding to the symbol combination and the overall content of the requirement is compared with a preset relevance.

[0099] Any semantic similarity analysis tool can be used when performing semantic similarity analysis. The specific process of semantic similarity analysis will not be elaborated here.

[0100] The preset relevance can be set according to the actual situation, and its specific value is not limited here.

[0101] Step S33bb: Add the first identifier at the start and end positions of the natural language field corresponding to the symbol combination.

[0102] For example, suppose the requirement is "What are Euler's identity and the Pythagorean theorem respectively?" The natural language fields corresponding to the symbol combination are "Euler's identity" and "Pythagorean theorem". The relevance of "Euler's identity" and "Pythagorean theorem" to "What are Euler's identity and the Pythagorean theorem respectively?" is low. In this case, we choose to add the first identifier, namely "What are $Euler's identity$ and $Pythagorean theorem$ respectively?"

[0103] Step S33bc: Add a second identifier at the start and end positions of the natural language field corresponding to the symbol combination.

[0104] For example, suppose the requirement is "What is the Euler identity?", and the natural language field corresponding to the symbol combination is "Euler identity". "Euler identity" is highly relevant to "What is the Euler identity?". In this case, we choose to add a second identifier, namely "What is $$Euler identity $$?".

[0105] After adding prompts and identifiers to the requirements, the requirements with added prompts and identifiers can be input into the large language model, which will then output intermediate text containing combinations of symbols of the target computer language.

[0106] S34: Input the requirements after adding prompt words and identifiers into the large language model to obtain the intermediate text output by the large language model, which includes the symbol combination of the target computer language.

[0107] After obtaining the requirements, the large language model can accurately generate symbol combinations based on the identifiers carried by the requirements, and generate symbol combinations of the target computer language based on the prompt words carried by the requirements, thereby generating intermediate text.

[0108] S35: The symbol combination in the intermediate text is converted into a format using a preset conversion logic to obtain the target text. The symbol combination in the target text conforms to the preset display rules. The preset conversion logic is used to convert the symbol combination from the target computer language into a format that conforms to the preset display rules.

[0109] S36: Output the target text to the user.

[0110] Steps S35 and S36 here are implemented in the same way as steps S24 and S25 in the previous embodiments. Please refer to the relevant descriptions in the previous embodiments, and they will not be repeated here.

[0111] Furthermore, as Figure 2 As a refinement and extension of the method shown, this application embodiment also provides a method for outputting text containing symbol combinations.

[0112] Figure 4 This is a flowchart illustrating the method for outputting text containing symbol combinations in the embodiments of this application. Figure 3 See Figure 4 As shown, the method may include S41-S47.

[0113] S41: Obtain the user's request, which indicates the need to obtain text containing combinations of symbols.

[0114] S42: Add prompt words to the requirements. Prompt words are used to instruct the large language model to output symbol combinations in the target computer language.

[0115] S43: Input the requirements after adding prompt words into the large language model to obtain the intermediate text output by the large language model, which includes the symbol combination of the target computer language.

[0116] Steps S41, S42, and S43 here are implemented in the same way as steps S21, S22, and S23 in the aforementioned embodiments. Please refer to the relevant descriptions in the aforementioned embodiments, which will not be repeated here.

[0117] S44: Identify the target field in the intermediate text that includes combinations of symbols.

[0118] After the large language model outputs intermediate text containing symbol combinations based on the requirements and prompts, the symbol combinations in the intermediate text are expressed in the target computer language. To avoid errors in the recognition of symbol combinations in the intermediate text by the preset conversion logic (missed or over-recognized), the symbol combinations in the intermediate text can be marked first. At this point, it is necessary to extract the target field containing symbol combinations from the intermediate text.

[0119] Specifically, the symbols can be identified in the intermediate text first. When a symbol is identified, the identified symbol and the mathematical symbols before and after it are identified as the target field in the intermediate text that includes the symbol combination.

[0120] In specific determination, multiple consecutive symbol combinations can be obtained from the intermediate text and used as target fields including symbol combinations determined from the intermediate text to improve the accuracy of target field determination.

[0121] Specifically, step S44 above may include: S44a: Determine whether the intermediate text contains consecutive symbol combinations greater than a first preset number, where the first preset number is determined based on the minimum number of bytes in the fields containing symbol combinations obtained historically. If yes, execute S44b; otherwise, execute S44c.

[0122] The number of bytes in a symbol combination is generally fixed, falling within a specific range. Therefore, we can pre-calculate the number of bytes for various symbol combinations and use the smallest number among these as the first preset quantity. Alternatively, we can calculate the number of bytes for each symbol combination generated from a previously large model and use the smallest number among these as the first preset quantity.

[0123] In specific judgment, consecutive symbol combinations greater than the first preset number can be extracted directly from the intermediate text. If they can be extracted, it means that the intermediate text contains consecutive symbol combinations greater than the first preset number. If they cannot be extracted, it means that the intermediate text does not contain consecutive symbol combinations greater than the first preset number.

[0124] S44b: Determine the target field as a consecutive combination of symbols in the intermediate text that is greater than a first preset number.

[0125] S44c: Extract consecutive combinations of symbols from the intermediate text that are greater than a second preset number as the target field, where the second preset number is less than the first preset number.

[0126] If the intermediate text does not contain consecutive symbol combinations greater than the first preset number, it may be because the number of bytes of the symbol combinations obtained this time is small. Therefore, the first preset number can be reduced to the second preset number, and then consecutive symbol combinations greater than the second preset number can be extracted from the intermediate text as the target field.

[0127] If it is still not possible to extract consecutive symbol combinations greater than the second preset number from the intermediate text, it may be because the current reduction is insufficient. The second preset number can be further reduced to extract consecutive symbol combinations greater than the reduced second preset number from the intermediate text. This process can be repeated until consecutive symbol combinations greater than the preset number are extracted from the intermediate text, and the extracted symbol combinations are used as the target field.

[0128] S45: Add identifiers at the start and end positions of the target field. The identifiers are used to represent the start and end positions of the target field.

[0129] Once the symbol combination, i.e. the target field, is identified from the intermediate text, identifiers can be added at the start and end positions of the target field. This allows the pre-defined conversion logic to see the intermediate text and determine the start and end positions of the symbol combination using the first and second identifiers, thus achieving precise typesetting of the symbol combination.

[0130] The specific implementation of the identifier here is the same as that of the identifier in step S33b of the aforementioned embodiment. Please refer to the relevant description in the aforementioned embodiment, which will not be repeated here.

[0131] S46: The intermediate text after adding the identifier is formatted using a preset conversion logic to obtain the target text. The symbol combination in the target text conforms to the preset display rules. The preset conversion logic is used to convert the symbol combination from the target computer language to a format that conforms to the preset display rules. The preset conversion logic can determine the start and end positions of the conversion based on the identifier.

[0132] Starting from the first character of the middle text, identifier recognition is performed. When an identifier is recognized, the preset conversion logic determines the subsequent characters as a symbol combination and continues identifier recognition. When an identifier is recognized again, the preset conversion logic ends the determination of symbol combinations, takes the characters between the two recognized identifiers as a symbol combination, and converts the determined symbol combination into a symbol combination that conforms to preset display rules.

[0133] The preset conversion logic for format conversion has been explained in the previous text and will not be repeated here.

[0134] S47: Output the target text to the user.

[0135] Step S47 here is implemented in the same way as step S25 in the previous embodiment. Please refer to the relevant description in the previous embodiment. It will not be repeated here.

[0136] Furthermore, as Figure 2As a refinement and extension of the method shown, this application embodiment also provides a method for outputting text containing symbol combinations.

[0137] It should be noted that the method provided in this embodiment can be applied to any of the foregoing embodiments.

[0138] Figure 5 This is a flowchart illustrating the method for outputting text containing symbol combinations in the embodiments of this application. Figure 4 See Figure 5 As shown, the method may include S51-S57.

[0139] S51: Obtain the user's request, which is used to instruct the retrieval of text containing combinations of symbols.

[0140] S52: Add prompt words to the requirements. Prompt words are used to instruct the large language model to output symbol combinations in the target computer language.

[0141] S53: Input the requirements after adding prompt words into the large language model, and obtain the intermediate text output by the large language model, which includes the symbol combination of the target computer language.

[0142] Steps S51, S52, and S53 here are implemented in the same way as steps S21, S22, and S23 in the aforementioned embodiments. Please refer to the relevant descriptions in the aforementioned embodiments, which will not be repeated here.

[0143] S54: The symbol combination in the intermediate text is converted into a format using a preset conversion logic to obtain the target text. The symbol combination in the target text conforms to the preset display rules. The preset conversion logic is used to convert the symbol combination from the target computer language into a format that conforms to the preset display rules.

[0144] In practical applications, the content of large model responses is usually in Markdown syntax. Therefore, the markdown-it plugin can be used to render the output of large models. The markdown-it plugin is a Markdown parsing library used to convert Markdown text into HTML. The markdown-it plugin can parse text into individual tokens, which can then be CRUD operations performed on the tokens to finally generate the text. Therefore, a plugin can be written using the plugin interface provided by markdown-it to obtain the markdown-it-katex plugin, which is a preset format conversion tool. The markdown-it-katex plugin can extract formula expressions from the text output by large models, and then convert the text output by large models, along with the formula expressions, into HTML with formatted styles, achieving a visual output of the formula expressions.

[0145] To enhance the user experience, the default KaTeX rendering options in the markdown-it-katex plugin can be customized. Besides error handling strategies, the custom configuration allows defining two rendering functions, katexInline and katexBlock, for rendering inline and block-level mathematical formulas, respectively. These functions use KaTeX's renderToString method to convert LaTeX strings to HTML and provide error handling logic when conversion fails, allowing users to either throw an error or return HTML with error messages.

[0146] The default settings mentioned above are all registered in the Markdown parser (markdown-it). Specifically, the `math_inline` and `math_block` rules are inserted into the parser's rule chain, and the execution order of these two functions after other rules is specified. Additionally, custom rendering rules are set for inline and block-level mathematical formulas, namely the previously defined `katexInline` and `katexBlock` functions, ensuring that the parsed mathematical content is correctly converted into HTML.

[0147] During the processing of intermediate text, the markdown-it-katex plugin uses the `math_inline` function to identify and process inline mathematical formulas in Markdown text. These formulas are enclosed in a pair of dollar signs ($). The `math_inline` function skips escaped dollar signs, checks the validity of potential formula start and end positions, and ensures there are no unnecessary whitespace characters between formulas. Once a valid mathematical formula is detected, the `math_inline` function creates a new token of type `math_inline` and adds its content and tag information to the Markdown parsing state for subsequent conversion.

[0148] During the processing of intermediate text, the markdown-it-katex plugin uses the `math_block` function to identify and process block-level mathematical contexts within Markdown text. These are mathematical expressions enclosed in two pairs of dollar signs ($$). The `math_block` function also checks the correctness of the formula's start and end points, supports mathematical expressions spanning multiple lines, and stops searching after finding a matching closing character. The found mathematical blocks are encapsulated in a `math_block` token and recorded at their start and end positions within the document.

[0149] In this way, after the markdown-it-katex plugin obtains the intermediate text output by the large language model, it can extract symbol combinations from the intermediate text based on identifiers, then render the symbol combinations into the layout style that users usually see, and then generate the target text by connecting the layout symbol combinations with other content in the intermediate file except for the symbol combinations.

[0150] S55: Perform character similarity matching between the symbol combination of the target computer language and the symbol combination that conforms to the preset display rules.

[0151] Since some occasional errors may occur when converting symbol combinations, checking the symbol combinations in the target text again before outputting it to the user, and outputting the target text only if the check is correct, can improve the accuracy of the output text of large models.

[0152] In specific checks, the symbol combinations of the target computer language in the intermediate text output by the large language model can be compared with the typed symbol combinations in the target text output by the preset format conversion tool. This involves calculating the character similarity between the symbol combinations of the target computer language and the symbol combinations that conform to preset display rules. The closer the content and number of characters are, the higher the character similarity score.

[0153] S56: Determine whether the similarity of the matched characters is greater than the preset similarity. If yes, execute S57; otherwise, execute S53.

[0154] S57: Output the target text to the user.

[0155] If the matched character similarity is greater than the preset similarity, it means that the preset format conversion tool has only made adjustments to the layout of the symbol combination, and the actual content of the symbol combination has not been modified. The symbol combination in the target text is correct, and the target text can be directly output to the user.

[0156] If the matched character similarity is less than or equal to the preset similarity, it indicates that the preset format conversion tool has not only adjusted the layout of the symbol combination but also made significant modifications to the symbols within the combination. To ensure the accuracy of the text seen by the user, the requirements after adding prompt words need to be input into the large language model, causing the large language model to re-output the intermediate text and the preset format conversion tool to re-output the target text. The target text is then checked again until it passes the check before being displayed to the user.

[0157] Figure 6 For illustrations of the text containing symbol combinations output by the large language model before and after using the text output method for text containing symbol combinations provided in the embodiments of this application, see [link to illustration]. Figure 6As shown, 6a directly inputs the user's requirements into the large language model, which then outputs text containing symbol combinations. It's easy to see that the formula output in 6a is not the formula style people are used to seeing. 6b, on the other hand, inputs the user's requirements combined with prompts into the large language model. The model outputs intermediate text based on the requirements and prompts, which is then processed by a preset format conversion tool to output text containing symbol combinations. It can be seen that the formula output in 6b conforms to people's daily usage habits.

[0158] Therefore, the text output method containing symbol combinations provided in this application can enhance user experience and comprehension: by providing an instant and intuitive visualization of mathematical formulas, even complex mathematical expressions can be presented in a clear and standardized graphical form, which greatly improves the understanding and acceptance of formulas by non-professional users, optimizes the interactive experience, and promotes the efficient dissemination and learning of knowledge, especially in the fields of education, scientific research and engineering applications.

[0159] Furthermore, it smoothed out the differences in formula display content among various models, and achieved automatic conversion of formulas output by different large language models to a unified visualization format, solving the problem of inconsistent formula representation and ensuring seamless connection and accurate transmission of information across different platforms and models.

[0160] Furthermore, it lowers the technical threshold and usage costs, allowing users to enjoy high-quality formula rendering services without needing to master professional typesetting languages ​​such as LaTeX. This reduces the barrier to entry for technical applications, enabling a wider range of users to easily utilize large language models for discussions and work related to mathematical formulas, thus promoting the popularization of the technology and expanding its application scope.

[0161] This concludes the description of the text output method containing symbol combinations provided in the embodiments of this application.

[0162] Based on the same inventive concept, embodiments of this application also provide a text output device that includes combinations of symbols.

[0163] Figure 7 This is a schematic diagram of the structure of a text output device containing symbol combinations in the embodiments of this application. Figure 1 See Figure 7 As shown, the device may include: The acquisition module 71 is used to acquire the user's requirements, which are used to instruct the acquisition of text containing combinations of symbols.

[0164] Add module 72 to add prompt words for requirements. The prompt words are used to instruct the large language model to output the symbol combination corresponding to the target computer language.

[0165] The processing module 73 inputs the requirements after adding prompt words into the large language model and obtains the intermediate text output by the large language model, which includes the symbol combination corresponding to the target computer language.

[0166] The conversion module 74 converts the symbol combinations in the intermediate text using a preset conversion logic to obtain the target text. The symbol combinations in the target text conform to preset display rules. The preset conversion logic is used to convert the symbol combinations from the target computer language to a format that conforms to the preset display rules.

[0167] Output module 75 is used to output the target text to the user.

[0168] Furthermore, as Figure 7 In a refinement and extension of the illustrated device, embodiments of this application also provide a text output device that includes combinations of symbols.

[0169] Figure 8 This is a schematic diagram of the structure of a text output device containing symbol combinations in the embodiments of this application. Figure 2 See Figure 8 As shown, the device may include: The acquisition module 81 is used to acquire the user's requirements, which are used to instruct the acquisition of text containing combinations of symbols.

[0170] Add module 82 to add prompt words for requirements. Prompt words are used to instruct the large language model to output symbol combinations in the target computer language.

[0171] The segmentation module 83 is used to identify the natural language fields corresponding to symbol combinations in the requirements; it adds identifiers at the start and end positions of the natural language fields corresponding to symbol combinations in the requirements, and the identifiers are used to separate the natural language fields corresponding to symbol combinations in the requirements from the natural language fields corresponding to non-symbol combinations, thereby enabling the large language model to separate the computer language fields corresponding to symbol combinations in the intermediate text from the computer language fields corresponding to non-symbol combinations.

[0172] The segmentation module 83 is specifically used to split the requirement into multiple single characters; if there is a single character among the multiple single characters that matches a field in the preset table, then the field within the semantic range of the single character that matches the requirement is determined as the natural language field corresponding to the symbol combination. The preset table includes the natural language corresponding to various symbol combinations; if there is no single character among the multiple single characters that matches a field in the preset table, then it enters the processing module 84.

[0173] In the case where the identifiers include a first identifier and a second identifier, the first identifier is used to represent the computer language field corresponding to the symbol combination as an inline element in the intermediate text, and the second identifier is used to represent the computer language field corresponding to the symbol combination as a block-level element in the intermediate text. Specifically, if the relevance of the natural language field corresponding to the symbol combination to the overall content of the requirement is lower than a preset relevance, then the first identifier is added to the start and end positions of the natural language field corresponding to the symbol combination; if the relevance of the natural language field corresponding to the symbol combination to the overall content of the requirement is not lower than a preset relevance, then the second identifier is added to the start and end positions of the natural language field corresponding to the symbol combination.

[0174] Processing module 84 is used to input the requirements after adding prompt words and identifiers into the large language model, and obtain the intermediate text output by the large language model, which includes the symbol combination of the target computer language.

[0175] The conversion module 85 is used to identify the target field, which includes symbol combinations, in the intermediate text; add identifiers at the start and end positions of the target field, the identifiers being used to characterize the start and end positions of the target field; and perform format conversion on the intermediate text after adding identifiers using preset conversion logic to obtain the target text, the symbol combinations in the target text conforming to preset display rules, the preset conversion logic being used to convert the symbol combinations from the target computer language to a format conforming to preset display rules, and the preset conversion logic being able to determine the start and end positions of the conversion based on the identifiers.

[0176] The conversion module 85 is specifically used to determine the consecutive symbol combinations in the intermediate text that are greater than the first preset number as the target field if the intermediate text contains consecutive symbol combinations that are greater than the first preset number. The first preset number is determined based on the minimum number of bytes of the field containing symbol combinations obtained in the past. If the intermediate text does not contain consecutive symbol combinations that are greater than the first preset number, then consecutive symbol combinations that are greater than the second preset number are extracted from the intermediate text as the target field. The second preset number is less than the first preset number.

[0177] The inspection module 86 is used to perform character similarity matching between the symbol combination of the target computer language and the symbol combination that conforms to the preset display rules; if the matched character similarity is greater than the preset similarity, it enters the output module 87; if the matched character similarity is less than or equal to the preset similarity, it enters the processing module 84.

[0178] Output module 87 is used to output the target text to the user.

[0179] It should be noted that the description of the above device embodiments is similar to the description of the above method embodiments, and has similar beneficial effects. For technical details not disclosed in the device embodiments of this application, please refer to the description of the method embodiments of this application for understanding.

[0180] Based on the same inventive concept, embodiments of this application also provide an electronic device.

[0181] Figure 9 This is a schematic diagram of the electronic device in an embodiment of this application. See also... Figure 9 As shown, the electronic device may include: a processor 91, a memory 92, and a bus 93. The processor 91 and the memory 92 communicate with each other through the bus 93. The processor 91 is used to call program instructions in the memory 92 to execute the methods in one or more of the above embodiments.

[0182] It should be noted that the descriptions of the above electronic device embodiments are similar to those of the above method embodiments, and have similar beneficial effects. For technical details not disclosed in the electronic device embodiments of this application, please refer to the descriptions of the method embodiments of this application for understanding.

[0183] Based on the same inventive concept, embodiments of this application also provide a computer-readable storage medium, which may include: a stored program that, when the program is running, controls the device where the storage medium is located to execute the methods described in one or more of the above embodiments.

[0184] It should be noted that the description of the above computer-readable storage medium embodiments is similar to the description of the above method embodiments, and has similar beneficial effects. For technical details not disclosed in the computer-readable storage medium embodiments of this application, please refer to the description of the method embodiments of this application for understanding.

[0185] Based on the same inventive concept, this application also provides a computer program product, which includes a computer program or instructions that, when executed by the device, implement the methods in one or more of the above embodiments.

[0186] It should be noted that the descriptions of the above computer program product embodiments are similar to those of the above method embodiments, and have similar beneficial effects. For technical details not disclosed in the computer program product embodiments of this application, please refer to the descriptions of the method embodiments of this application for understanding.

[0187] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. An output method of text comprising a combination of symbols, characterized by, The method comprises: obtaining a demand of a user, the demand being used to indicate obtaining a text containing a symbol combination; adding a prompt word to the demand, the prompt word being used to indicate that a large language model outputs a symbol combination corresponding to a target computer language; inputting the demand after adding the prompt word into the large language model to obtain intermediate text output by the large language model, the intermediate text including the symbol combination corresponding to the target computer language; performing format conversion on the symbol combination in the intermediate text by using a preset conversion logic to obtain target text, the symbol combination in the target text conforming to a preset display rule, the preset conversion logic being used to convert the symbol combination from the target computer language into a format conforming to the preset display rule; outputting the target text to the user.

2. The method of claim 1, wherein, Before inputting the demand after adding the prompt word into the large language model, the method further comprises: identifying a natural language field corresponding to a symbol combination in the demand; adding identifiers at a starting position and an ending position of the natural language field corresponding to the symbol combination, the identifiers being used to divide the natural language field corresponding to the symbol combination from a natural language field corresponding to a non-symbol combination in the demand; the inputting the demand after adding the prompt word into the large language model comprises: inputting the demand after adding the prompt word and the identifiers into the large language model.

3. The method of claim 2, wherein, The identifiers include a first identifier and a second identifier, the first identifier being used to indicate that the large language model takes a computer language field corresponding to a symbol combination as an inline-level element in the intermediate text, and the second identifier being used to indicate that the large language model takes the computer language field corresponding to the symbol combination as a block-level element in the intermediate text; the adding the identifiers at the starting position and the ending position of the natural language field corresponding to the symbol combination comprises: if a correlation degree of the natural language field corresponding to the symbol combination with overall content in the demand is lower than a preset correlation degree, adding the first identifier at the starting position and the ending position of the natural language field corresponding to the symbol combination; if the correlation degree of the natural language field corresponding to the symbol combination with the overall content in the demand is not lower than the preset correlation degree, adding the second identifier at the starting position and the ending position of the natural language field corresponding to the symbol combination.

4. The method of claim 2, wherein, The identifying the natural language field corresponding to the symbol combination in the demand comprises: splitting the demand into a plurality of single characters; if there is a single character matching a field in a preset table in the plurality of single characters, determining a field within a semantic range of the matching single character in the demand as the natural language field corresponding to the symbol combination, the preset table including natural languages corresponding to various symbol combinations; if there is no single character matching a field in the preset table in the plurality of single characters, performing the step of inputting the demand after adding the prompt word into the large language model.

5. The method of claim 1, wherein, The performing format conversion on the symbol combination in the intermediate text by using the preset conversion logic comprises: determining a target field including a symbol combination in the intermediate text; adding identifiers at the start position and the end position of the target field, the identifiers being used to represent the start position and the end position of the target field; performing format conversion on the intermediate text after adding the identifiers by using preset conversion logic, the preset conversion logic being capable of determining the start position and the end position of conversion according to the identifiers.

6. The method of claim 5, wherein, The method further includes: if the intermediate text does not include continuous symbol combinations greater than the first preset number, extracting continuous symbol combinations greater than a second preset number from the intermediate text as the target field, the second preset number being less than the first preset number. Before outputting the target text to the user, the method further includes:

7. The method according to any one of claims 1 to 6, characterized in that, performing character similarity matching on the symbol combinations of the target computer language and the symbol combinations conforming to the preset display rule; if the matched character similarity is greater than a preset similarity, performing the step of outputting the target text to the user; if the matched character similarity is less than or equal to the preset similarity, performing the step of inputting the requirement input after adding the prompt word into the large language model. The device includes:

8. An output device comprising text containing symbol combinations, characterized in that, an obtaining module configured to obtain a requirement of a user, the requirement being used to indicate to obtain text containing symbol combinations; an adding module configured to add a prompt word to the requirement, the prompt word being used to indicate a large language model to output symbol combinations in a target computer language; a processing module configured to input the requirement after adding the prompt word into the large language model, to obtain intermediate text output by the large language model, the intermediate text containing symbol combinations in the target computer language; a conversion module configured to perform format conversion on the symbol combinations in the intermediate text by using preset conversion logic, to obtain target text, the symbol combinations in the target text conforming to a preset display rule, the preset conversion logic being used to convert symbol combinations from the target computer language into a format conforming to the preset display rule; an output module configured to output the target text to the user. The electronic device includes a processor, a memory and a bus; wherein the processor and the memory complete mutual communication through the bus, the processor is used to call program instructions in the memory, to execute the method in any one of claims 1 to 7.

9. An electronic device, comprising: The computer-readable storage medium includes a stored program; wherein the program controls the device where the computer-readable storage medium is located to execute the method in any one of claims 1 to 7 when running.

10. A computer-readable storage medium, characterized in that, The computer program product includes a computer program or instructions; wherein when the computer program or instructions are executed by the device where the computer program or instructions are located, the method in any one of claims 1 to 7 is implemented.

11. A computer program product, characterised in that, ​