Text processing method and device, electronic equipment, computer readable storage medium and computer program product

By querying candidate texts in a terminology corpus of the target knowledge domain and generating task prompts, and combining positive and negative task examples, the Large Language Model (LLM) is used for text conversion, which solves the problem of low accuracy after text conversion and achieves higher accuracy and consistency.

CN121659893APending Publication Date: 2026-03-13TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-10
Publication Date
2026-03-13

AI Technical Summary

Technical Problem

In existing technologies, the accuracy of text after conversion is low, resulting in insufficient accuracy in data transmission and management within the knowledge domain.

Method used

By querying candidate texts in a terminology corpus of the target knowledge domain, task prompts are generated. Combined with positive and negative task examples, the text to be converted is converted. Context learning is performed using a Large Language Model (LLM) to enhance the utilization of contextual information during the conversion process.

Benefits of technology

It improves the accuracy of the converted text, making the difference between the converted text and the actual context smaller, and enhances the accurate transmission and management of data within the knowledge domain.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121659893A_ABST
    Figure CN121659893A_ABST
Patent Text Reader

Abstract

The invention provides a text processing method and device, electronic equipment, a computer program product and a computer readable storage medium. The embodiment of the invention can be applied to scenes for carrying out standardization processing on non-standard texts in the fields of medicine, chemistry, geographic information systems and the like; the method comprises the steps of querying a plurality of candidate texts from a term library of a target knowledge domain based on a to-be-converted text of the target knowledge domain; generating a task prompt instruction based on a to-be-converted text and the plurality of candidate texts; obtaining a positive task example and a negative task example based on the to-be-converted text; and based on the positive task example, the negative task example and the task prompt instruction, converting the to-be-converted text to obtain a converted text including the term of the target knowledge domain. Through the method and the device, the accuracy of the converted text can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to artificial intelligence technology, and more particularly to a text processing method, apparatus, electronic device, computer-readable storage medium, and computer program product. Background Technology

[0002] In some knowledge domains, a single standardized term may have multiple informal or non-standardized expressions. To facilitate data statistics within these domains, or to accurately transmit and manage data, it is necessary to convert these non-standard texts to obtain standardized converted text. However, related technologies suffer from the problem of low accuracy in the converted text. Summary of the Invention

[0003] This application provides a text processing method, apparatus, electronic device, computer-readable storage medium, and computer program product that can improve the accuracy of the converted text.

[0004] The technical solution of this application embodiment is implemented as follows:

[0005] This application provides a text processing method, the method comprising:

[0006] Based on the text to be converted in the target knowledge domain, multiple candidate texts are queried from the terminology database of the target knowledge domain;

[0007] Based on the text to be converted and multiple candidate texts, generate task prompt instructions;

[0008] Based on the text to be converted, positive task examples and negative task examples are obtained, wherein the positive task examples are examples obtained by positive conversion based on the target knowledge domain, and the negative task examples are examples obtained by negative conversion based on the target knowledge domain;

[0009] Based on the positive task example, the negative task example, and the task prompt instructions, the text to be converted is converted to obtain the converted text including the terminology of the target knowledge domain.

[0010] This application provides a text processing apparatus, including:

[0011] The candidate query module is used to query multiple candidate texts from the terminology database of the target knowledge domain based on the text to be converted in the target knowledge domain.

[0012] The instruction generation module is used to generate task prompt instructions based on the text to be converted and multiple candidate texts;

[0013] The example acquisition module is used to acquire positive task examples and negative task examples based on the text to be converted, wherein the positive task examples are examples obtained by positive conversion based on the target knowledge domain, and the negative task examples are examples obtained by negative conversion based on the target knowledge domain;

[0014] The text conversion module is used to convert the text to be converted based on the positive task example, the negative task example, and the task prompt instruction, to obtain converted text including the terminology of the target knowledge domain.

[0015] In the above scheme, the task prompt instruction includes: a task prompt question, and multiple option entities corresponding to the multiple candidate texts;

[0016] The text conversion module is further configured to determine a matching option from multiple option entities based on the positive task example, the negative task example, and the task prompt question; and to convert the text to be converted using the candidate text corresponding to the matching option to obtain the converted text including the terminology of the target knowledge domain.

[0017] In the above scheme, the text conversion module is further configured to determine the corresponding selection probability for each option entity based on the positive task example, the negative task example, and the task prompt question; and to determine the matching option of the task prompt question from multiple option entities based on the selection probability corresponding to each option entity.

[0018] In the above scheme, the text conversion module is further configured to: determine a first predicted probability of each option entity from the task prompt question; fuse the task prompt question and the positive task example to obtain a first fusion result, and determine a second predicted probability of each option entity from the first fusion result; fuse the task prompt question and the negative task example to obtain a second fusion result, and determine a third predicted probability of each option entity from the second fusion result; and determine the selection probability of each option entity based on the first predicted probability, the second predicted probability, and the third predicted probability of each option entity.

[0019] In the above scheme, the text conversion module is further configured to determine the probability difference between the second predicted probability and the third predicted probability for each option entity; and to determine the selection probability of each option entity by summing the probability difference with the first predicted probability.

[0020] In the above scheme, the example acquisition module is further configured to determine, from multiple pre-conversion texts, the first pre-conversion text related to the text to be converted, and the second pre-conversion text unrelated to the text to be converted; acquire candidate task examples including the first pre-conversion text from the example library as positive task examples; and acquire candidate task examples including the second pre-conversion text from the example library as negative task examples.

[0021] In the above scheme, the example acquisition module is further configured to extract features from the text to be converted to obtain a first text feature; use the second text feature corresponding to each of the pre-conversion texts and the first text feature to determine the text similarity between the text to be converted and each of the pre-conversion texts; based on the text similarity, determine the first pre-conversion text related to the text to be converted and the second pre-conversion text unrelated to the text to be converted from the multiple pre-conversion texts.

[0022] In the above scheme, the example acquisition module is further configured to sort the multiple pre-conversion texts in descending order of text similarity to obtain a text sequence; determine at least one pre-conversion text located at the beginning of the text sequence as the first pre-conversion text; and determine at least one pre-conversion text located at the end of the text sequence as the second pre-conversion text.

[0023] In the above scheme, the example acquisition module is further configured to, for the text to be converted, determine a first pre-conversion text and a second pre-conversion text that are both related to the text to be converted from a plurality of pre-conversion texts; for the first pre-conversion text, acquire a correct first post-conversion text, and use the first pre-conversion text and the first post-conversion text to generate the positive task example; for the second pre-conversion text, acquire an incorrect second post-conversion text, and use the second pre-conversion text and the second post-conversion text to generate the negative task example.

[0024] In the above scheme, the candidate query module is further used to calculate the similarity between the text to be converted and each standard term in the terminology library of the target knowledge domain to obtain semantic similarity; based on the semantic similarity, to query multiple candidate texts corresponding to the text to be converted from multiple standard terms in the terminology library.

[0025] In the above scheme, the instruction generation module is further used to obtain a multiple-choice question template; wherein, the multiple-choice question template includes: a question stem filling position and multiple option filling positions; the text to be converted is filled into the question stem filling position, and multiple candidate texts are sequentially filled into multiple option filling positions to obtain the task prompt instruction.

[0026] This application provides an electronic device, the electronic device comprising:

[0027] Memory is used to store executable instructions or computer programs.

[0028] The processor, when executing computer-executable instructions or computer programs stored in the memory, implements the text processing method provided in the embodiments of this application.

[0029] This application provides a computer-readable storage medium storing a computer program or computer-executable instructions for implementing the text processing method provided in this application when executed by a processor.

[0030] This application provides a computer program product, including a computer program or computer executable instructions. When the computer program or computer executable instructions are executed by a processor, they implement the text processing method provided in this application.

[0031] The embodiments of this application have the following beneficial effects: First, for the text to be converted, multiple candidate texts are queried from the terminology database of the target knowledge domain to limit the options of the converted text to the range of professional terms. Then, task prompts are generated using the queried candidate texts and the original text to be converted. Based on the task prompts, positive task examples that help identify knowledge related to the conversion process of the text to be converted, and negative task examples that help identify knowledge that is unrelated to or interferes with the conversion process of the text to be converted, are combined. This can enhance the influence of related knowledge in the conversion process and reduce the influence of irrelevant or interfering knowledge in the conversion process, so that the provided contextual information is fully utilized. In this way, the gap between the converted text and the actual situation can be reduced, and the accuracy of the converted text can be improved. Attached Figure Description

[0032] Figure 1 This is a schematic diagram of the architecture of the text processing system provided in the embodiments of this application;

[0033] Figure 2 This is provided by the embodiments of this application. Figure 1 A schematic diagram of the terminal structure in the diagram;

[0034] Figure 3 This is a flowchart illustrating the text processing method provided in the embodiments of this application. Figure 1 ;

[0035] Figure 4 This is a schematic diagram illustrating the generation of task prompt instructions using a multiple-choice question template, as provided in an embodiment of this application.

[0036] Figure 5 This is a flowchart illustrating the text processing method provided in the embodiments of this application. Figure 2 ;

[0037] Figure 6 This is a flowchart illustrating the text processing method provided in the embodiments of this application. Figure 3 ;

[0038] Figure 7 This is a flowchart illustrating the text processing method provided in the embodiments of this application. Figure 4 ;

[0039] Figure 8 This is a schematic diagram of the text conversion interface provided in an embodiment of this application;

[0040] Figure 9 This is a schematic diagram illustrating the process of standardizing clinical terminology provided in the embodiments of this application;

[0041] Figure 10 These are schematic diagrams illustrating relevant examples provided in the embodiments of this application;

[0042] Figure 11 This is a schematic diagram illustrating an incorrect selection made by the lower-level language model provided in an embodiment of this application;

[0043] Figure 12 This is a schematic diagram of the comparison decoding provided in the embodiments of this application. Detailed Implementation

[0044] To make the objectives, technical solutions, and advantages of this application clearer, the application will be further described in detail below with reference to the accompanying drawings. The described embodiments should not be regarded as limitations on this application. All other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0045] In the following description, references are made to “some embodiments,” which describe a subset of all possible embodiments. However, it is understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.

[0046] In the following description, the terms "first, second, third" are used merely to distinguish similar objects and do not represent a specific ordering of objects. It is understood that "first, second, third" may be interchanged in a specific order or sequence where permitted, so that the embodiments of this application described herein can be implemented in an order other than that illustrated or described herein.

[0047] In this application embodiment, the terms "module" or "unit" refer to a computer program or part of a computer program that has a predetermined function and works with other related parts to achieve a predetermined goal, and can be implemented wholly or partially using software, hardware (such as processing circuitry or memory), or a combination thereof. Similarly, a processor (or multiple processors or memory) can be used to implement one or more modules or units. Furthermore, each module or unit can be part of an overall module or unit that includes the functionality of that module or unit.

[0048] Unless otherwise defined, all technical and scientific terms used in the embodiments of this application have the same meaning as commonly understood by one of ordinary skill in the art. The terminology used in the embodiments of this application is for the purpose of describing the embodiments of this application only and is not intended to limit this application.

[0049] In the implementation of this application, the collection and processing of relevant data should strictly comply with the requirements of relevant laws and regulations, obtain the informed consent or separate consent of the personal information subject, and carry out subsequent data use and processing within the scope of laws and regulations and the authorization of the personal information subject.

[0050] Before providing a further detailed description of the embodiments of this application, the nouns and terms involved in the embodiments of this application will be explained, and the nouns and terms involved in the embodiments of this application shall be interpreted as follows.

[0051] 1) Text processing refers to the process of processing non-standard text to be converted within a target knowledge domain to obtain standard converted text. Here, standard converted text refers to text that uses standardized naming and definitions for terms and entities within the knowledge domain to ensure accurate transmission and unified data management. For example, in the medical field, medical entities such as diseases, symptoms, signs, examinations, and surgeries can be uniformly named to facilitate accurate transmission and unified management of medical data. Converting non-standard text, such as terms specific to medical institutions, into uniformly named medical entities is the text processing process described in this application embodiment.

[0052] 2) The text to be converted is an informal or non-standard expression in the target knowledge domain; it is the text input by the user that has not yet undergone standardized conversion (it can be understood as the text before conversion). For example, in the medical field, there are some medical terms that do not conform to predefined definitions (such as disease description terms specific to medical institutions, colloquial medical terms, etc.). These non-standard medical terms are the text to be converted. After text processing, these non-standard medical terms can be transformed into standard medical terms.

[0053] 3) Large Language Model (LLM) is a deep learning-based artificial intelligence model that can understand and generate human language. LLM has a huge parameter scale, pre-training and fine-tuning learning methods, context-aware capabilities, and multilingual and multimodal support, so it can be applied in multiple fields, such as text generation, dialogue systems, and machine translation.

[0054] 4) A task prompt is text input into the LLM to guide it in generating specific outputs or performing specific tasks. A prompt can be considered a way to interact with the LLM, effectively guiding model torque and executing complex instructions. In this embodiment, the task prompt may include a task prompt question and multiple option entities.

[0055] 5) Contextual Learning is a machine learning paradigm. In LLM (Low-Level Machine Learning), contextual learning refers to the LLM learning to acquire knowledge within a given context, rather than through traditional supervised training. In contextual learning, task examples can be used to provide contextual information to the LLM.

[0056] 6) A knowledge domain refers to a knowledge system within a discipline or industry, which includes concepts, terminology, principles, and other content within the domain. The target knowledge domain in this application embodiment can be any knowledge domain.

[0057] 7) Positive task examples are examples of correctly converting non-standard text that is similar to the text to be converted. For example, a positive task example could be an example of correctly converting non-standard disease names into standard medical terms based on knowledge in the medical field.

[0058] 8) Negative task examples are examples of correctly converting non-standard text that is not similar to the text to be converted, or examples of incorrectly converting non-standard text that is similar to the text to be converted.

[0059] 9) The converted text refers to the standardized text corresponding to the non-standard text to be converted. Compared to the text to be converted, the converted text is more in line with the norms of the target knowledge domain. For example, when the text to be converted is "heart pain", the converted text can be "angina pectoris".

[0060] 10) Matching option refers to the correct answer determined from multiple option entities for the task prompt question, that is, the option entity that best matches the task prompt question among multiple option entities.

[0061] In some knowledge domains, a single standardized term may have multiple informal or non-standardized expressions. For example, in the medical field, the medical term "fungal otitis externa" may be written as "bilateral ear canal fungal infection." To facilitate data statistics within the knowledge domain, or to accurately transmit and manage data, it is necessary to convert these non-standard texts into standard texts.

[0062] Methods for processing non-standard text to obtain standard converted text can be mainly divided into two categories: rule-based processing and deep learning-based processing.

[0063] Rule-based processing relies on the experience and knowledge of experts in the knowledge domain to formulate a series of rules and logic. These rules and logic are then used to process non-standard text to be converted into standard converted text. The advantages of this approach are its simplicity, ease of understanding and interpretation, and clear reflection of the expert's decision-making process. However, non-standard text is complex and variable, and using predefined rules for processing requires significant time and effort to develop the conversion rules.

[0064] Deep learning-based processing involves using deep learning models to learn relevant knowledge from text data within a specific knowledge domain. This knowledge is then used to process non-standard text to obtain the converted text. However, deep learning models require a large amount of high-quality text data for training to avoid overfitting.

[0065] Compared to ordinary deep learning models, Large Language Models (LLMs) have superior text processing capabilities, making deep learning-based text processing possible through LLMs. Text conversion techniques utilizing LLMs primarily involve two stages. The first stage uses a recall model to select a small number of candidate texts from a standard terminology corpus. The second stage uses prompts to instruct the LLM to generate the most suitable converted text based on the selected candidate texts, thus completing the text processing. During this process, rich contextual information is provided to the LLM, enabling it to learn the context and quickly adapt to tasks involving converting non-standard text into standard text.

[0066] In the aforementioned methods, although contextual information is provided to the LLM through prompts, enabling it to rely on both the parametric knowledge acquired during pre-training and the knowledge from the contextual information when generating the converted text, the LLM often fails to fully utilize the knowledge from the input contextual information when generating standard text. Instead, it over-relies on the parametric knowledge acquired during pre-training. This leads to the generated text being inconsistent with the actual context or lacking contextual consistency. Therefore, it is evident that related technologies have a low utilization rate of contextual information when converting text, resulting in a significant discrepancy between the generated standard text and the actual context, ultimately leading to low accuracy of the converted text.

[0067] This application provides a text processing method, apparatus, electronic device, computer-readable storage medium, and computer program product, which can improve the accuracy of converted text. The following describes exemplary applications of the electronic device provided in this application. The electronic device provided in this application can be implemented as various types of terminals such as laptops, tablets, desktop computers, set-top boxes, smartphones, smartwatches, smart TVs, and in-vehicle terminals, or it can be implemented as a server. The following will describe exemplary applications when the electronic device is implemented as a server.

[0068] See Figure 1 , Figure 1 This is a schematic diagram of the architecture of a text processing system provided in an embodiment of this application. To support a text processing application, in the text processing system 100, a terminal 400 (terminals 400-1 and 400-2 are shown as examples) connects to a server 200 via a network 300. The network 300 can be a wide area network (WAN), a local area network (LAN), or a combination of both. The text processing system 100 also includes a database 500 to provide data support to the server 200. The database 500 can be independent of the server 200 or integrated into the server 200. Figure 1 This illustrates the scenario where database 500 is independent of server 200.

[0069] Terminal 400 is used to respond to the user's input operation in the text input area of ​​the text conversion interface displayed in the graphical interface (graphical interfaces 400-11 and 400-21 are shown as examples), obtain the text to be converted from the text input area, and send the text to be converted to the server 200 through network 300.

[0070] Server 200 is used to query multiple candidate texts from a terminology database of the target knowledge domain based on the text to be converted; generate task prompt instructions based on the text to be converted and the multiple candidate texts; obtain positive task examples and negative task examples based on the text to be converted; convert the text to be converted based on the positive task examples, negative task examples and task prompt instructions to obtain the converted text including terms of the target knowledge domain; and send the converted text to terminal 400.

[0071] Terminal 400 is also used to display the converted text corresponding to the text to be converted in the text display area of ​​the text conversion interface.

[0072] In some embodiments, server 200 may be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms. Terminals and servers can be connected directly or indirectly via wired or wireless communication, which is not limited in this embodiment.

[0073] See Figure 2 , Figure 2 This is provided by the embodiments of this application. Figure 1 A schematic diagram of the structure of a terminal (an embodiment of an electronic device) in the diagram. Figure 2 The terminal 400 shown includes at least one processor 410, a memory 450, at least one network interface 420, and a user interface 430. The various components in the terminal 400 are coupled together via a bus system 440. It is understood that the bus system 440 is used to implement communication between these components. In addition to a data bus, the bus system 440 also includes a power bus, a control bus, and a status signal bus. However, for clarity, ... Figure 2 The general labeled all buses as Bus System 440.

[0074] The processor 410 can be an integrated circuit chip with signal processing capabilities, such as a general-purpose processor, a digital signal processor (DSP), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or any conventional processor, etc.

[0075] User interface 430 includes one or more output devices 431 that enable the presentation of media content, including one or more speakers and / or one or more visual displays. User interface 430 also includes one or more input devices 432, including user interface components that facilitate user input, such as a keyboard, mouse, microphone, touch screen display, camera, other input buttons and controls.

[0076] The memory 450 may be removable, non-removable, or a combination thereof. Exemplary hardware devices include solid-state storage, hard disk drives, optical disk drives, etc. The memory 450 may optionally include one or more storage devices physically located away from the processor 410.

[0077] The memory 450 may include volatile memory or non-volatile memory, or both. The non-volatile memory may be read-only memory (ROM), and the volatile memory may be random access memory (RAM). The memory 450 described in this application embodiment is intended to include any suitable type of memory.

[0078] In some embodiments, memory 450 is capable of storing data to support various operations, examples of which include programs, modules, and data structures or subsets or supersets thereof, as illustrated below.

[0079] Operating system 451 includes system programs for handling various basic system services and performing hardware-related tasks, such as the framework layer, core library layer, driver layer, etc., for implementing various basic business functions and handling hardware-based tasks;

[0080] The network communication module 452 is used to reach other electronic devices via one or more (wired or wireless) network interfaces 420, exemplary network interfaces 420 including: Bluetooth, WiFi, and Universal Serial Bus (USB), etc.

[0081] Presentation module 453 is configured to enable the presentation of information (e.g., a user interface for operating peripheral devices and displaying content and information) via one or more output devices 431 (e.g., a display screen, a speaker, etc.) associated with user interface 430;

[0082] The input processing module 454 is used to detect and translate one or more user inputs or interactions from one or more input devices 432.

[0083] In some embodiments, the text processing apparatus provided in this application can be implemented in software. Figure 2 A text processing device 455 stored in memory 450 is shown. This device can be software in the form of programs and plug-ins, and includes the following software modules: a candidate query module 4551, an instruction generation module 4552, an example acquisition module 4553, and a text conversion module 4554. These modules are logically linked and can therefore be arbitrarily combined or further separated according to the functions they implement. The functions of each module will be described below.

[0084] In other embodiments, the text processing apparatus provided in this application can be implemented in hardware. As an example, the text processing apparatus provided in this application can be a processor in the form of a hardware decoding processor, which is programmed to execute the text processing method provided in this application. For example, the processor in the form of a hardware decoding processor can be one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), programmable logic devices (PLDs), complex programmable logic devices (CPLDs), field-programmable gate arrays (FPGAs), or other electronic components.

[0085] In some embodiments, a terminal or server (both possible implementations of electronic devices) can implement the text processing method provided in this application by running various computer-executable instructions or computer programs. For example, computer-executable instructions can be microprogram-level commands, machine instructions, or software instructions. Computer programs can be native programs or software modules in an operating system; they can be native applications (APPs), i.e., programs that need to be installed in the operating system to run, such as a medical data standardization APP; or they can be applets that can be embedded in any APP, i.e., programs that only need to be downloaded to a browser environment to run. In summary, the aforementioned computer-executable instructions can be any form of instruction, and the aforementioned computer programs can be any form of application, module, or plugin.

[0086] The text processing method provided in this application will be described below with reference to exemplary applications and implementations of the electronic device provided in the embodiments of this application. As mentioned above, the electronic device implementing the image processing method of the embodiments of this application can be a terminal, a server, or a combination of both. Therefore, the executing entity of each step will not be described again below.

[0087] See Figure 3 , Figure 3 This is a flowchart illustrating the text processing method provided in the embodiments of this application. Figure 1 , will combine Figure 3 The steps shown are explained below. Figure 3 The main component of the process is electronic equipment.

[0088] Step 101: Based on the text to be converted in the target knowledge domain, query multiple candidate texts from the terminology database of the target knowledge domain.

[0089] This application embodiment is implemented in a scenario where non-standard text to be converted in a target knowledge domain is processed to obtain standard converted text, thereby standardizing the expressions in the target knowledge domain. For example, non-standard entities in the medical field are converted into professional entities, or non-standard colloquial terms in the transportation and logistics field are converted into professional transportation terms, etc. Here, non-standard terms or non-standard text in the target knowledge domain are the text to be converted. For the current text to be converted, the electronic device first queries a terminology database of the target knowledge domain to obtain candidate texts that can serve as the corresponding converted text. The retrieved candidate texts are the candidate texts. Therefore, in subsequent processing, the electronic device can determine the converted text corresponding to the text to be converted based on the multiple candidate texts obtained.

[0090] A knowledge domain refers to a knowledge system within a discipline or industry, which includes concepts, terminology, principles, and other content within the domain. A target knowledge domain refers to any knowledge domain capable of converting non-standard text into standard text. For example, a target knowledge domain could be a field such as medicine, bioinformatics, chemistry, geographic information systems, or linguistics; however, this application does not limit the scope of the target knowledge domain.

[0091] The text to be converted can refer to any non-standard text within the target knowledge domain that needs to be standardized. This non-standard text can refer to text that does not follow the naming conventions or definitions of the target knowledge domain, and can include entities, technical terms, etc. For example, in this embodiment, the text to be converted could be common terms used by medical institutions for certain diagnoses in the medical field, common names for chemical substances in the chemical field, or customary names for a region in geographical information, etc. This embodiment does not impose any limitations on these aspects. The text to be converted can be text input by the user or text obtained from publicly available online resources.

[0092] In some embodiments of this application, Figure 3 Step 101, which is to query multiple candidate texts from the terminology library of the target knowledge domain based on the text to be converted, can be achieved through the following process: calculate the similarity between the text to be converted and each standard term in the terminology library of the target knowledge domain to obtain semantic similarity; based on semantic similarity, query multiple candidate texts corresponding to the text to be converted from multiple standard terms in the terminology library.

[0093] The electronic device first extracts features, mapping the text to be converted onto a feature space to obtain features that uniquely represent the text. Simultaneously, it acquires the terminology features corresponding to each standard term in a terminology database. Since the database contains multiple standard terms, the device obtains multiple terminology features. Next, the device calculates the similarity between the features to be converted and each terminology feature, using the resulting similarity as the semantic similarity between the text to be converted and each standard term. Finally, based on the multiple semantic similarities corresponding to these standard terms, the device filters them to obtain multiple candidate texts. Here, the number of candidate texts should be less than the number of standard terms.

[0094] In some embodiments, an electronic device can extract the features to be converted from the text to be converted using a feature extraction model. In this case, the electronic device can read the text to be converted using a feature extraction model, then convert the text into word vectors using the feature extraction model, and then further extract the features to be converted from the word vectors.

[0095] The feature extraction model here can be a deep learning model composed of a word embedding network and an embedding processing network; the word embedding network can be implemented as a Word2Vec network or a Global Vectors for Word Representation (GloVe) network, etc., and this application embodiment is not limited thereto; the embedding processing network can be implemented as a Text Convolutional Neural Network (TextCNN) or a Bidirectional Encoder Representations from Transformers (BERT) network based on a transformer architecture, etc., and this application embodiment is not limited thereto.

[0096] It should be noted that the feature extraction model described above can acquire the ability to extract features from the text to be converted through model training. During training, a fully connected layer (FC) or a softmax layer can be connected to the output of the feature extraction model to perform a classification task, and supervised learning can be carried out using labels. In this case, the training data can consist of training text and the category labels of the training text (e.g., the disease category to which the training text belongs in the medical field, the process category to which the training text corresponds in the engineering field, etc.). Of course, the feature extraction model described above can also be trained in an unsupervised manner. For example, some words or characters in the training data can be masked, and then the feature extraction model can be used to extract their features. Based on these features, the mask can be predicted, and the loss between the predicted and actual values ​​can be calculated. The parameters can then be adjusted based on the loss.

[0097] In other embodiments, the electronic device may also use the frequency of occurrence of phrases consisting of a series of consecutive characters as the feature to be converted, for example, by using the frequency of occurrence of combinations of N adjacent characters through the N-gram model.

[0098] In this embodiment, the electronic device can use the same feature extraction method as the feature to be converted to extract features from the standard terms. That is, when the feature to be converted is obtained through a feature extraction model, the electronic device will also use the feature extraction model to extract features from the standard terms. The term features of each standard term can be obtained by the electronic device performing feature extraction on each standard term in real time, or it can be extracted by the electronic device from a feature library (in this case, the electronic device can perform feature extraction on each standard term during idle time, such as 1 a.m. every day, and store the extracted term features in the feature library. When the text to be converted is processed, the term features can be directly extracted from the feature library and used, which can speed up the processing speed of the text to be converted). This embodiment does not limit this.

[0099] In this embodiment of the application, the electronic device can obtain the semantic similarity between each standard term and the text to be converted by calculating the cosine similarity between the feature to be converted and the term feature, or it can obtain the semantic similarity between each standard term and the text to be converted by calculating the Euclidean distance between the feature to be converted and the term feature.

[0100] When electronic devices query multiple candidate texts corresponding to the text to be converted from multiple standard terms in a terminology database based on feature similarity, they can first sort the multiple feature similarities corresponding to the multiple standard terms in descending order to obtain a similarity sequence. Then, the standard terms corresponding to the first few feature similarities in the similarity sequence are taken as candidate texts, thus obtaining multiple candidate texts.

[0101] Electronic devices can also compare multiple feature similarities with a similarity threshold separately, and identify the standard terms corresponding to feature similarities greater than the similarity threshold as candidate texts. The similarity threshold can be adjusted based on the number of feature similarities greater than it. For example, when the number of feature similarities greater than the similarity threshold is less than the required number of candidate texts, the electronic device can appropriately reduce the similarity threshold; when the number of feature similarities greater than the similarity threshold is greater than the required number of candidate texts, the electronic device can appropriately increase the similarity threshold. This ensures that the number of candidate texts reaches the required number as much as possible. The required number can be set according to actual conditions, such as 3 or 5, but this embodiment does not limit the specific number.

[0102] In other embodiments of this application, Figure 3Step 101 therein, that is, based on the text to be converted in the target knowledge domain, query multiple candidate texts from the term library in the target knowledge domain, can also be implemented through the following processing: Determine query keywords based on the text to be converted; query the term library in the target knowledge domain through the query keywords to obtain multiple candidate texts.

[0103] The query keywords here can be determined by the frequency of each word in the text to be converted in the text to be converted. For example, the electronic device calculates the frequency of each word (which can refer to the words after excluding some words without practical significance, such as "de", "le", etc.) in the text to be converted, and then uses the words with a frequency higher than the threshold as query keywords; the query keywords here can also be determined by the formulated keyword extraction rules. For example, identify the words with practical significance such as verbs and nouns from the text to be converted, and use these words as query keywords to search in the term library.

[0104] The electronic device can use the terms in the term library that contain the query keywords as candidate texts, or can also use the terms with similar meanings to the query keywords (which can be obtained by analyzing the semantic similarity through a semantic model. If the semantic similarity reaches the threshold, it is considered a term with a similar meaning to the query keyword) as candidate texts.

[0105] So far, the electronic device has completed the process of determining multiple candidate texts for the text to be converted.

[0106] Step 102, generate a task prompt instruction based on the text to be converted and multiple candidate texts.

[0107] The electronic device generates a task prompt instruction for input into the target language model based on the obtained candidate texts and the text to be converted that needs to be converted. Among them, the task prompt instruction can be regarded as a kind of guiding information input into the target language model, and this guiding information is used to guide the target language model to generate the expected output content. In the embodiments of the present application, the expected output content is the converted text.

[0108] [[ID=1)]]Here, the target language model can be implemented as a large language model of any structure, such as a large language model based on Transformer, or a large language model based on BERT. The embodiments of the present application do not limit this here.

[0109] It should be noted that the electronic device can integrate the text to be converted and multiple candidate texts into a task prompt template to obtain a task prompt instruction. In this case, Figure 3Step 102, which is to generate task prompt instructions based on the text to be converted and multiple candidate texts, can be achieved through the following process: obtaining a multiple-choice question template; wherein, the multiple-choice question template includes: a question stem filling position and multiple option filling positions; filling the question stem filling position with the text to be converted, and filling the multiple candidate texts into the multiple option filling positions in sequence to obtain the task prompt instructions.

[0110] The electronic device can retrieve a pre-stored multiple-choice template and fill in the text to be converted and multiple candidate texts into the corresponding reserved positions in the template to obtain a complete multiple-choice text. The multiple-choice text after filling in the relevant content serves as the task prompt instruction, guiding the target language model to select an answer from the multiple options provided in the multiple-choice text, i.e., the question stem in the task prompt instruction. This answer can be the converted text, or text containing the key information of the converted text.

[0111] The multiple-choice question template in this embodiment can be in the form of single-choice questions or multiple-choice questions. The template can be manually created or generated automatically by an electronic device after analyzing some multiple-choice questions to learn their structure. This embodiment does not impose specific limitations on this. The number of option slots in the multiple-choice question template should be greater than or equal to 2, but can be set according to actual needs, such as 3 or 5. This embodiment does not impose limitations on this.

[0112] For example, Figure 4 This is a schematic diagram illustrating the generation of task prompt instructions using a multiple-choice question template, as provided in an embodiment of this application. See also... Figure 4 The multiple-choice template 4-1 includes a question stem filler 4-11 for filling the text to be converted, a statement 4-12 for prompting the user to make a selection from the options, and three option filler 4-13 for filling the candidate text. The electronic device fills the question stem filler 4-11 with the text to be converted, namely "external auditory canal fungal infection," and fills the three option filler 4-13 with the three candidate texts, namely "fungal otitis externa," "external auditory canal aspergillosis," and "fungal external otitis," respectively, thus obtaining the task prompt instruction 4-2.

[0113] It is understood that, in the embodiments of this application, the task prompts generated by the multiple-choice question template can limit the answer output by the target language model to a range of multiple candidate texts, thereby avoiding the phenomenon that the answer output by the target language model is far from the meaning of the text to be converted, and helping to ensure the accuracy of the converted text.

[0114] Of course, electronic devices can also generate task prompts in other ways. In some embodiments of this application, Figure 3 Step 102, which is to generate task prompt instructions based on the text to be converted and multiple candidate texts, can also be achieved through the following processing: obtaining multiple example prompt instructions; extracting features from the multiple example prompt instructions through the instruction generation model, and generating task prompt instructions based on the extracted features, the text to be converted and multiple candidate texts.

[0115] In other words, electronic devices can learn the relevant knowledge needed to generate prompts from multiple example prompts obtained through an instruction generation model. Then, they read in the text to be converted and multiple candidate texts, and combine the learned knowledge to integrate the text to be converted and the multiple candidate texts into a task prompt instruction. The instruction generation model can be implemented as a generative language model, such as Transformer or BERT. It can be trained using large-scale unlabeled text data to acquire the ability to process text (prompt instructions can be considered a type of text). In this embodiment, the instruction generation model can be designed to automatically begin generating task prompt instructions when example prompts, the text to be converted, and multiple candidate texts are read in.

[0116] At this point, the electronic device has completed the generation of the task prompt instructions.

[0117] Step 103: Based on the text to be converted, obtain positive task examples and negative task examples. The positive task examples are examples obtained by performing positive conversion based on the target knowledge domain, and the negative task examples are examples obtained by performing negative conversion based on the target knowledge domain.

[0118] In this embodiment, in addition to task prompts, the electronic device can also combine positive and negative task examples simultaneously to process the text to be converted. Both positive and negative task examples can be understood as additional contextual information about text conversion provided to the target language model (rich contextual information helps the target language model quickly adapt to the text conversion task and output the desired content).

[0119] It should be noted that the positive task examples include a first-before-conversion text and a first-after-conversion text. The first-before-conversion text can be text from the target knowledge domain that has a high degree of similarity to the text to be converted (i.e., the similarity is greater than a threshold). The first-after-conversion text is the converted text obtained by correctly converting the first-before-conversion text according to the target knowledge domain. For example, if the target knowledge domain is the medical field, then the positive task example can be an example of correctly converting non-standard disease names that are relatively similar to the text to be converted into standard medical terms based on knowledge from the medical field (for example, when the text to be converted is "heart pain", converting "heartache" to "angina" can be considered a positive task example). Therefore, the positive task examples can provide knowledge on how to correctly convert the text to be converted according to the target knowledge domain. Providing the positive task examples to the target language model can guide the target language model to pay more attention to the knowledge in the parameter knowledge related to the conversion process of the text to be converted when processing the text to be converted.

[0120] The negative task example includes the second pre-conversion text and the corresponding second post-conversion text. The second pre-conversion text can be text from the target knowledge domain that has a low degree of similarity to the text to be converted, or the post-conversion text obtained by correctly converting the second pre-conversion text according to the target knowledge domain. For example, when the target knowledge domain is the medical field, the negative task example could be an example of correctly converting a non-standard disease name unrelated to the text to be converted into a standard medical term (e.g., when the text to be converted is "heart pain," converting "gingival swelling" into "periodontitis" can be considered a negative task example). The second pre-conversion text can also be the same as the first pre-conversion text, or the post-conversion text obtained by incorrectly converting the second pre-conversion text. For example, when the target knowledge domain is the medical field, the negative task example could be an example of incorrectly converting a disease name similar to the text to be converted into an irrelevant medical term or a common-sense error (e.g., when the text to be converted is "heart pain," converting "heartache" into "periodontitis" can be considered a negative task example). It is evident that the knowledge provided by negative task examples is knowledge that conflicts with the processing of the text to be converted. Therefore, providing negative task examples to the target language model helps the target language model identify which knowledge is irrelevant to or interferes with the conversion process when processing the text to be converted.

[0121] Electronic devices can obtain positive and negative task examples from the example library, or they can generate positive and negative task examples based on the text to be converted using the example generation model.

[0122] See Figure 5 , Figure 5This is a flowchart illustrating the text processing method provided in the embodiments of this application. Figure 2 In some embodiments of this application, Figure 3 Step 103, which involves obtaining positive and negative task examples based on the text to be converted, may include the following processing:

[0123] Step 1031A: Determine the first pre-conversion text that is related to the text to be converted and the second pre-conversion text that is not related to the text to be converted from multiple pre-conversion texts.

[0124] The electronic device can first acquire multiple texts before conversion, and then identify the texts that are sufficiently relevant to the text to be converted (e.g., the text similarity is higher than the similarity threshold) as the first text before conversion, and identify the texts that are significantly different from the text to be converted, i.e., irrelevant (e.g., the text similarity is lower than the similarity threshold), as the second text before conversion.

[0125] It should be noted that the multiple unconverted texts here can be the original non-standard text contained in the candidate task examples provided by the example library (i.e., a database storing candidates for positive and negative task examples). Essentially, the candidate task examples demonstrate how to transform the unconverted text to obtain the corresponding transformed text. In other words, the multiple unconverted texts here are the source samples used to build the example library.

[0126] In some embodiments, Figure 5 Step 1031A, namely determining the first pre-conversion text related to the text to be converted and the second pre-conversion text unrelated to the text to be converted from multiple pre-conversion texts, can be achieved through the following processing: extracting features from the text to be converted to obtain the first text features; using the second text features and the first text features corresponding to each pre-conversion text to determine the text similarity between the text to be converted and each pre-conversion text; based on the text similarity, determining the first pre-conversion text related to the text to be converted and the second pre-conversion text unrelated to the text to be converted from multiple pre-conversion texts.

[0127] The electronic device first extracts the first text feature from the text to be converted. Then, it acquires the feature corresponding to each text before conversion, designating this feature as the second text feature. It then calculates the similarity between these second text features, which correspond one-to-one with the text before conversion, and the resulting similarity score is the text similarity between the text to be converted and each text before conversion. Next, based on the text similarity score between each text before conversion and the text to be converted, the electronic device selects texts before conversion that are sufficiently similar to the text to be converted, designating them as the first text before conversion related to the text to be converted. It then filters out texts before conversion that are significantly different from the text to be converted, designating them as the second text before conversion that are not related to the text to be converted.

[0128] The feature extraction process here can be accomplished using the feature extraction model described above, or it can be accomplished using predefined rules such as named entity recognition and part-of-speech tagging. Electronic devices can obtain the text similarity between the text to be converted and the text before conversion by calculating the cosine similarity between the first and second text features, or by calculating the Euclidean distance between the first and second text features. This embodiment of the application does not impose any limitations on this.

[0129] It should be noted that electronic devices can sort multiple texts before conversion by ranking multiple text similarities, and determine the first and second texts before conversion based on this ranking; electronic devices can also determine the first and second texts before conversion by the relationship between multiple text similarities and similarity thresholds.

[0130] In some embodiments, determining a first pre-conversion text related to the text to be converted and a second pre-conversion text unrelated to the text to be converted from multiple pre-conversion texts based on text similarity can be achieved through the following process: sorting the multiple pre-conversion texts in descending order of text similarity to obtain a text sequence; determining at least one pre-conversion text located at the beginning of the text sequence as the first pre-conversion text; and determining at least one pre-conversion text located at the end of the text sequence as the second pre-conversion text.

[0131] In this sequence, at least one pre-conversion text located at the beginning of the text sequence is a pre-conversion text that is relatively close to the text to be converted. The electronic device uses these pre-conversion texts as first pre-conversion texts so that subsequent electronic devices can identify candidate task examples containing pre-conversion texts that are even closer to the text to be converted as positive task examples. At least one pre-conversion text located at the end of the text sequence is a pre-conversion text that is significantly different from the text to be converted. The electronic device uses these pre-conversion texts as second pre-conversion texts so that subsequent electronic devices can identify candidate task examples containing pre-conversion texts that are completely different from the text to be converted as negative task examples.

[0132] In other embodiments, based on text similarity, determining a first pre-conversion text related to the text to be converted and a second pre-conversion text unrelated to the text to be converted from multiple pre-conversion texts can also be achieved through the following processing: taking the pre-conversion texts with a text similarity greater than a similarity threshold from multiple pre-conversion samples as the first pre-conversion texts; and taking the pre-conversion texts with a text similarity less than a similarity threshold from multiple pre-conversion samples as the second pre-conversion texts.

[0133] The electronic device can also directly compare the text similarity of each pre-conversion text with a similarity threshold. When the text similarity of the pre-conversion text is greater than or equal to the similarity threshold, it means that it is relatively close to the text to be converted, and the electronic device will identify it as the first pre-conversion text (if there are multiple pre-conversion texts with text similarity greater than or equal to the similarity threshold, the electronic device can randomly select one, or select the pre-conversion text corresponding to the largest text similarity as the first pre-conversion text); when the text similarity of the pre-conversion text is less than the similarity threshold, it means that it is significantly different from the text to be converted, and the electronic device will identify it as the second pre-conversion text (similarly, if there are multiple pre-conversion texts with text similarity less than the similarity threshold, the electronic device can randomly select one, or select the pre-conversion text corresponding to the smallest text similarity as the second pre-conversion text).

[0134] Step 1032A: Obtain candidate task examples, including the text before the first transformation, from the example library to serve as positive task examples.

[0135] After obtaining the first text before conversion, the electronic device will check whether each of the multiple candidate task examples in the example library contains the first text before conversion; that is, it will check whether the first text sample is the same as the text before conversion in the candidate task examples. If they are the same, the electronic device will extract the candidate task example to obtain the positive task example.

[0136] Step 1033A: Obtain candidate task examples from the example library, including the text before the second transformation, as negative task examples.

[0137] After obtaining the second text before conversion, the electronic device will determine whether the second text before conversion is contained in multiple candidate task examples in the example library; that is, whether the second text before conversion is the same as the text before conversion in the candidate task examples. If they are the same, the electronic device will extract the candidate task example to obtain the negative task example.

[0138] See Figure 6 , Figure 6 This is a flowchart illustrating the text processing method provided in the embodiments of this application. Figure 3 In other embodiments of this application, Figure 3 Step 103, which involves obtaining positive and negative task examples based on the text to be converted, can also be achieved through the following processing:

[0139] Step 1031B: For the text to be converted, determine the first and second texts that are both related to the text to be converted from multiple texts before conversion.

[0140] It should be noted that the first text before conversion is related to the text to be converted, and the second text before conversion is also related to the text to be converted. The electronic device can extract features from the text to be converted to obtain the corresponding first text features, and simultaneously obtain the second text features of each text before conversion. Then, the electronic device calculates the Euclidean distance between the second and first text features of each text before conversion, or the cosine similarity between the second and first text features, to obtain the text similarity between the text before conversion and the text to be converted. Next, the electronic device first filters out texts with a text similarity greater than a similarity threshold from multiple texts before conversion, and then randomly selects two texts from the selected texts as the first and second texts before conversion, respectively, or uses the texts with the highest text similarity as both the first and second texts before conversion. In this way, the electronic device can obtain the first and second texts before conversion.

[0141] Step 1032B: For the text before the first conversion, obtain the correct text after the first conversion, and use the text before the first conversion and the text after the first conversion to generate a positive task example.

[0142] After obtaining the initial unconverted text, the electronic device can provide it to researchers in the target knowledge domain and acquire the correct terminology generated by them, using this terminology as the initial converted text. The electronic device then integrates the initial text sample and the initial converted text according to a task example template to generate a positive task example. The task example template can be pre-written and stored by the researchers, and the initial converted text corresponding to the initial unconverted text can also be pre-written and stored by the researchers.

[0143] For example, if the text before the first conversion is "heart pain", the electronic device can retrieve the correct term "angina pectoris" that the researchers have pre-generated for "heart pain" from its storage space or database. Then, the electronic device can fill in "heart pain" in the question stem fill position of the multiple choice template, fill in "angina pectoris" in any one of the multiple option fill positions, and at the same time use other medical terms with the same lesion as "angina pectoris" to supplement the remaining option fill positions to obtain a positive task example.

[0144] Step 1033B: For the text before the second conversion, obtain the erroneous text after the second conversion, and use the text before the second conversion and the text after the second conversion to generate a negative task example.

[0145] When the first and second pre-conversion texts are arbitrarily selected from pre-conversion texts with a similarity greater than a similarity threshold, the electronic device can first obtain terms pre-written and stored by researchers in the target knowledge domain for the second pre-conversion text. These terms can be considered as the result of correctly converting the second pre-conversion text. Then, errors are introduced into this result, i.e., replacing the original term with other unrelated terms, to obtain the second converted text. When the first and second pre-conversion texts are the same pre-conversion sample, the electronic device can directly use other terms from the target knowledge domain to replace the correct terms in the first converted text, thereby obtaining the incorrect second converted text. Next, the electronic device will generate negative task examples using the same generation method as the positive task examples.

[0146] For example, if the text before the second conversion is also "heartburn", the electronic device can replace "angina" in the term "gastroesophageal reflux" in the text after the first conversion with "gastroesophageal reflux", thus obtaining an incorrect text after the second conversion. Next, the electronic device will fill in "heartburn" in the question stem fill-in position of the multiple-choice template, fill in "gastroesophageal reflux" in any one of the multiple option fill-in positions, and at the same time use other medical terms with the same lesion as "gastroesophageal reflux", such as "chronic gastritis" or "superficial gastritis", to fill in the remaining option fill-in positions to obtain a negative task example.

[0147] At this point, the electronic device has completed the acquisition of positive and negative task examples.

[0148] Step 104: Based on the positive task examples, negative task examples, and task prompts, the text to be converted is converted to obtain the converted text including terms from the target knowledge domain.

[0149] When an electronic device uses a target language model to generate the converted text corresponding to the text to be converted, positive task examples can guide the processing of the text to focus more on the knowledge related to the conversion process within the parameter knowledge. Conversely, negative task examples help identify information irrelevant or interfering with the processing of the text to be converted, thus reducing the focus on such information. Therefore, combining positive and negative task examples with task prompts can guide the target language model to focus more on knowledge related to the conversion process of the text to be converted, while excluding knowledge in the target language model that is irrelevant to the task or even conflicting with it, thereby contributing to a more accurate converted text.

[0150] See Figure 7 , Figure 7 This is a flowchart illustrating the text processing method provided in the embodiments of this application. Figure 4 In some embodiments of this application, the task prompt instruction includes: a task prompt question, and multiple option entities corresponding to multiple candidate texts, thereby, Figure 3 Step 104, which involves converting the text to be converted based on positive task examples, negative task examples, and task prompts to obtain converted text including terms from the target knowledge domain, may include the following processing:

[0151] Step 1041: Based on positive task examples, negative task examples, and task prompt questions, determine the matching options from multiple option entities.

[0152] The electronic device simultaneously generates input information for the target language model from positive task examples, negative task examples, and the task prompt question itself. The target language model then reads this input information and selects the correct option entity from multiple option entities for the task prompt question based on this input information. This option entity is the matching option corresponding to the task prompt question.

[0153] In some embodiments, Figure 7 Step 1041, namely determining the matching option from multiple option entities based on positive task examples, negative task examples, and task hint questions, can be achieved through the following processing: determining the selection probability of each option entity based on positive task examples, negative task examples, and task hint questions; and determining the matching option for the task hint question from multiple option entities based on the selection probability of each option entity.

[0154] The electronic device generates input information for a target language model using positive task examples, negative task examples, and the task prompt question itself. Based on the information provided by this input, the target language model analyzes the probability that each option entity is selected as the correct option for the task prompt question; the resulting probability is the selection probability corresponding to the option entity. Next, the electronic device can choose the option entity with the highest selection probability among multiple option entities as the matching option for the task prompt question, or it can choose the option entity with a selection probability greater than a probability threshold as the matching option for the task prompt question. The probability threshold can be set according to actual conditions, and this embodiment does not limit its setting.

[0155] It should be noted that since there may be more than one selection probability greater than the probability threshold, in this case, the electronic device can determine all option entities corresponding to the selection probabilities greater than the probability threshold as matching options, or it can choose any one option entity as the matching option.

[0156] In some embodiments, determining the selection probability of each option entity based on positive task examples, negative task examples, and task prompt questions can be achieved through the following processes: determining a first predicted probability of each option entity from the task prompt questions; fusing the task prompt questions and positive task examples to obtain a first fusion result, and determining a second predicted probability of each option entity from the first fusion result; fusing the task prompt questions and negative task examples to obtain a second fusion result, and determining a third predicted probability of each option entity from the second fusion result; and determining the selection probability of each option entity based on the first predicted probability, second predicted probability, and third predicted probability of each option entity.

[0157] In other words, the electronic device processes the task prompt question itself, the fusion result of the task prompt question and positive task examples, and the fusion result of the task prompt question and negative task examples through the target language model. For each option entity, it outputs three different prediction probabilities: a first prediction probability, a second prediction probability, and a third prediction probability. Finally, it uses the second prediction probability obtained by combining positive task examples and the third prediction probability obtained by combining negative task examples to adjust the first prediction probability obtained based solely on the original task prompt instruction. The final adjusted result is the selection probability of each option entity.

[0158] The selection probability of each option entity is determined based on the first, second, and third predicted probabilities of each option entity. This can be achieved through the following process: for each option entity, determine the probability difference between the second and third predicted probabilities; and sum the probability difference with the first predicted probability to determine the selection probability of the option entity.

[0159] It should be noted that the probability difference between the second and third predicted probabilities can be understood as the difference in the output of the target language model when there are positive task examples and negative task examples. Therefore, by summing the first predicted probability with this probability difference, the weight of option entities whose probability increases with the presence of positive task examples can be increased, while the weight of option entities whose probability increases with the presence of negative task examples can be decreased, thus making the selection probability of option entities more accurate. Here, when the sum of the probability difference and the first predicted probability is greater than 1, the sum can be normalized to obtain the selection probability.

[0160] In addition, the selection probability of each option entity can be determined based on the first predicted probability, the second predicted probability, and the third predicted probability of each option entity through the following process: the second predicted probability and the third predicted probability are weighted and averaged to obtain the probability mean; the first predicted probability and the probability mean are multiplied to obtain the adjustment result, and the adjustment result is determined as the selection probability of each option entity.

[0161] Here, a larger weight can be assigned to the second prediction probability, such as a weight greater than the weight threshold (if the weight threshold can be set to 0.5, the weight of the second prediction probability can be 0.8), and a smaller weight can be assigned to the third prediction probability, such as a weight less than the weight threshold (if the weight threshold is 0.5, the weight of the third prediction probability can be 0.2). This ensures that the influence of positive task examples is greater than that of negative task examples in the process of determining the selection probability, thereby achieving the goal of avoiding the knowledge provided by negative task examples.

[0162] It should be noted that, in some other embodiments, determining the selection probability of each option entity based on positive task examples, negative task examples, and task prompt questions can also be achieved through the following processing: fusing the positive task examples, negative task examples, and task prompt questions to obtain a fusion result; and using a target language model to predict the selection probability of each option entity from the fusion result.

[0163] In other words, in addition to fusing task prompts with positive and negative task examples to obtain input information for the target language model, electronic devices can also directly fuse all content to obtain input information for the target language model and directly output the selection probability of each option entity through the target language model.

[0164] Step 1042: Using the candidate text corresponding to the matching options, transform the text to be transformed to obtain the transformed text including terms from the target knowledge domain.

[0165] After determining the matching option, the electronic device selects candidate texts from multiple candidate texts that correspond to the matching option as terms in the target knowledge domain of the text to be converted. Then, based on these terms, it generates the converted text. The electronic device can either directly use the term as the converted text, or it can obtain relevant information about the term, such as its encoding in a target knowledge domain encoding library (e.g., ICD-10), and information about the chapter and segment where the term is located in that library. This information is then integrated with the term to form the converted text.

[0166] Of course, electronic devices can also use other methods to generate the converted text corresponding to the text to be converted.

[0167] In some embodiments of this application, Figure 3 Step 104, which involves converting the text to be converted based on the positive task example, the negative task example, and the task prompt instructions to obtain the converted text including terms from the target knowledge domain, can also be achieved through the following processing: For each candidate text in the task prompt instructions, calculate the similarity between it and the first converted text in the positive task example, and the similarity between it and the second converted text in the negative task example; take the candidate text with the highest similarity to the first converted text as the text to be confirmed, and when the similarity between the text to be compared and the second converted text is less than a threshold, generate the converted text using the text to be confirmed.

[0168] In other words, since the text before the first conversion is similar to the text to be converted, the text after the first conversion may also have a certain degree of similarity to the converted text of the text to be converted. Therefore, the electronic device searches for candidate texts from multiple candidate texts that are similar to the correct first converted text as texts that need to be further confirmed in conjunction with negative task examples, i.e., texts to be confirmed. Next, the electronic device determines whether the text to be confirmed is similar to the second converted text that incorrectly converted the second text before the second conversion. If they are not similar, the text to be confirmed is identified as the standard term corresponding to the text to be converted, and the converted text is obtained based on this term.

[0169] Understandably, compared to related technologies, which suffer from low accuracy of converted text due to low utilization of contextual information during text conversion, this embodiment addresses this issue by having the electronic device first query multiple candidate texts from a terminology database of the target knowledge domain to limit the options for the converted text to specialized terminology. Then, it generates task prompts using the queried candidate texts and the original text to be converted. Based on these prompts, it combines positive task examples for identifying knowledge related to the conversion process of the text in the parameter knowledge, and negative task examples for identifying knowledge irrelevant or interfering with the conversion process. This enhances the influence of relevant knowledge during the conversion process and reduces the influence of irrelevant or interfering knowledge, ensuring full utilization of the provided contextual information. Consequently, the difference between the converted text and the actual context is minimized, ultimately improving the accuracy of the converted text.

[0170] The following describes the process of acquiring the text to be converted and the process of displaying the converted text in the embodiments of this application, in conjunction with the specific implementation of the electronic device.

[0171] When an electronic device is implemented as a terminal, Figure 3 Before step 101, that is, before querying multiple candidate texts from the terminology database of the target knowledge domain based on the text to be converted in the target knowledge domain, the method may further include the following processing: in response to an input operation in the text input operation of the text conversion interface, obtaining the text to be converted from the text input area.

[0172] In this embodiment, the terminal can display a text conversion interface on its graphical interface, which includes a text input area. When the terminal detects that the user has entered text in the text input area, it acquires the user's input to obtain the text to be converted. The size and position of the text input area can be set according to actual needs.

[0173] In this case Figure 3 In step 101, that is, based on the text to be converted in the target knowledge domain, querying multiple candidate texts from the term library of the target knowledge domain can be achieved through the following processing: in response to a trigger operation for the conversion start identifier in the text conversion interface, querying multiple candidate texts from the term library of the target knowledge domain based on the text to be converted in the target knowledge domain.

[0174] In the embodiments of the present application, a conversion start identifier is set in the text conversion interface. When the terminal detects that the user has performed a trigger operation (such as a single click, double click, etc.) on the conversion start identifier, the conversion process of the text to be converted will be started, thereby starting to determine multiple candidate texts for the text to be converted and performing subsequent processing.

[0175] In some embodiments of the present application, after converting the text to be converted based on positive task examples, negative task examples, and task prompt instructions to obtain a converted text including terms in the target knowledge domain, the method may further include the following processing: displaying the converted text in the text display area of the text display interface.

[0176] Among them, the converted text here may include: terms in the target knowledge domain and the associated information of the terms in the coding library, such as the codes of the terms, the chapter segments of the terms in the coding library, and the name of the coding library, etc.

[0177] Exemplarily, Figure 8 is a schematic diagram of the text conversion interface provided by the embodiments of the present application. In the text conversion interface 8-1, a text input area 8-11 (with a prompt for entering a diagnostic word shown above), a conversion start identifier 8-12 (displaying the words 'normalize') and a text display area 8-13 are provided. When the user enters 'bilateral lower eyelid ptosis' in the text input area 8-11 and clicks the conversion start identifier 8-12, the terminal will display the converted text under different versions of the coding library (such as ICD-10 clinical version, ICD-10 institutional version, and ICD-10 regional version) in the text display area 8-13, such as the standard word (term): lower eyelid bag, and the standard code, the chapter and segment where the standard word is located in the coding library, etc.

[0178] When the electronic device is implemented as a server, before Figure 3 step 101, that is, before querying multiple candidate texts from the term library of the target knowledge domain based on the text to be converted in the target knowledge domain, the method may further include the following processing: receiving the text to be converted sent by the terminal; wherein, the text to be converted is obtained by the terminal from the text input area in response to an input operation in the text input operation in the text conversion interface.

[0179] It should be noted that the terminal at this time can be regarded as the front end of the server, used to interact with the user.

[0180] In this case Figure 3 Step 101, namely, querying multiple candidate texts from the terminology database of the target knowledge domain based on the text to be converted in the target knowledge domain, can be achieved through the following process: responding to the start conversion command sent by the terminal, querying multiple candidate texts from the terminology database of the target knowledge domain based on the text to be converted in the target knowledge domain, wherein the start conversion command is sent by the terminal in response to the trigger operation of the conversion start identifier in the text conversion interface.

[0181] In some embodiments of this application, after converting the text to be converted based on positive task examples, negative task examples, and task prompt instructions to obtain converted text including terms from the target knowledge domain, the method may further include the following processing: sending the converted text to a terminal; the terminal is used to display the converted text in the text display area of ​​the text display interface.

[0182] The following describes the specific application scenarios of the text processing method according to the embodiments of this application.

[0183] The text processing method of this application embodiment can be applied to the standardization processing scenario of medical entities, where the target knowledge domain is the medical field. In this scenario, the electronic device queries multiple candidate entities from a medical terminology database based on non-standard medical entities (text to be converted); generates task prompt instructions based on the non-standard medical entities and multiple candidate entities; obtains positive task examples and negative task examples based on the non-standard medical entities; and converts the non-standard medical entities based on the positive task examples, negative task examples, and task prompt instructions to obtain standard medical entities (converted text).

[0184] The text processing method of this application embodiment can be applied to the standardization of place names, where the target knowledge domain is the geographic information system (GIS) domain. In this scenario, the electronic device queries multiple candidate names from a place name database based on the common name of the region (the text to be converted) within the GIS domain; generates task prompts based on the common name of the region and the multiple candidate names; obtains positive and negative task examples based on the common name of the region; and converts the common name of the region based on the positive and negative task examples and the task prompts to obtain the correct place name (the converted text).

[0185] The text processing method of this application embodiment can be applied to scenarios involving assisting in thesis writing, where the target knowledge domain is the domain to which the thesis to be written belongs. In this scenario, the electronic device queries multiple candidate terms from a terminology database based on a non-standard description within the domain to which the thesis belongs; based on the description and the multiple candidate terms, it generates task prompts; based on the non-standard description, it obtains positive and negative task examples; and based on the positive and negative task examples and the task prompts, it transforms the non-standard description to obtain a standard description.

[0186] The following will describe an exemplary application of the embodiments of this application in a real-world application scenario.

[0187] The embodiments of this application are implemented in the context of standardizing clinical terminology, that is, converting non-standard clinical terminology into standard clinical terminology.

[0188] Figure 9 This is a schematic diagram illustrating the process of standardizing clinical terminology provided in an embodiment of this application. The process includes:

[0189] Step 201: Obtain non-standard clinical terminology (text to be converted).

[0190] For example, obtaining the user's input "external auditory canal fungal infection".

[0191] Step 202: Candidate entity (candidate text) selection.

[0192] For example, select "fungal otitis externa", "external auditory canal aspergillosis", or "fungal otitis externa".

[0193] In this step, a retrieval tool is needed to retrieve a set of candidate entities related to the input non-standard clinical terms from the standard terminology database. Here, the commonly used pre-trained model BERT can be used to extract the similarity (semantic similarity) between the non-standard clinical terms and all entities in the standard terminology database, and return the K most similar entities as the retrieval tool's recall results, i.e., candidate entities (candidate text). Cosine similarity can be used to measure the similarity between the non-standard clinical terms and entities in the standard terminology database.

[0194] It's important to note that the reason for selecting candidate entities before further processing is that standard terminology databases typically contain a large number of entities; for example, ICD-10 can contain approximately 30,000 entities. However, large language models have limited input length, making it impossible to input all these entities at once. Furthermore, excessively long inputs can lead to forgetting or inaccurate generation by the large language model. Therefore, it's necessary to first select candidate entities from the standard terminology database for subsequent processing.

[0195] Step 203: Generate multiple-choice instructions (task prompt instructions). For example, generate a multiple-choice question:

[0196] Which of the following entities best describes "external auditory canal fungal infection"?

[0197] (A) Fungal otitis externa (B) Aspergillosis of the external auditory canal (C) Fungal otitis externa

[0198] Answer:

[0199] In this step, due to the given non-standard term 'a' and the obtained candidate entities {e1,…,e...} k The goal of a large language model is to select candidate entities {e1,…,e}. k In this context, we can select the entity that best matches 'a'. Therefore, a multiple-choice template can be used, for example... Figure 4 The goal is to construct multiple-choice instructions.

[0200] Step 204: Identify relevant and irrelevant examples.

[0201] In step 204, by providing a set of input-output contextual information, the large language model generates the corresponding output based on this contextual information and the new input. This approach allows the large language model to quickly adapt to the task of standardizing non-standard clinical terminology without additional training. Therefore, suitable examples can be selected from relevant corpora to provide to the large language model. These examples include both relevant and irrelevant examples.

[0202] The relevant examples are used to help the large language model perform better inference and generation. This is because if two non-standard clinical terms are highly similar, then the probability that their corresponding standard clinical terms are the same is also high. Therefore, relevant examples can be provided to the large language model.

[0203] Figure 10 This is a schematic diagram illustrating relevant examples provided in the embodiments of this application. For the multiple-choice question 10-1 generated in step 203 (i.e., which entity best describes "external auditory canal fungal infection"), two relevant examples can be selected: relevant example 10-2 and relevant example 10-3. Relevant example 10-2 asks, "Which entity best describes 'bilateral auditory canal fungal infection'?", and relevant example 10-3 asks, "Which entity best describes 'bilateral auditory canal fungal infection'?". If the large language model has never encountered these two examples when processing "external auditory canal fungal infection," it may easily misclassify "external auditory canal aspergillosis" as the correct result (external auditory canal fungal infection and external auditory canal aspergillosis have high character similarity but completely different semantics). Therefore, relevant examples 10-2 and 10-3 need to be provided to the large language model.

[0204] The following section explains the selection of relevant examples.

[0205] For a given standardized corpus (x) i ,y i )∈D,x i y represents the i-th non-standard term. i x represents i Based on the corresponding standard entities, a database can be constructed, which can be represented as Equation (1):

[0206] S={(x i ,h i ,y i ,g i )|h i =f(x) i ),(x i ,y i )∈D} (1)

[0207] Among them, h i =f(x) i f(*) represents the feature vector obtained through the BERT model; g i Non-standard terminology x i The candidate entity set. For the non-standard term 'a' to be predicted, firstly, obtain its corresponding feature vector f(x) (first text feature) according to BERT, and then compare f(x) with all h in the database. i (Second text feature) Calculate cosine similarity (text similarity) and retrieve the L most similar relevant examples (L is a hyperparameter). Simply put, it recalls relevant examples by comparing the similarity between the input non-standard terms and non-standard terms in the corpus.

[0208] Because large language models may ignore the context in the prompts (such as the relevant examples provided) and rely on prior knowledge (i.e., the parameters of the large language model), there may be situations where the large language model makes an incorrect choice even when relevant examples are provided. Figure 11 This is a schematic diagram illustrating an incorrect selection made by the lower-level language model provided in an embodiment of this application. For example... Figure 11 As shown, even with relevant examples 11-1 and 11-2 provided, the large language model still made an incorrect choice for multiple-choice question 11-3, selecting B as the final result, when the correct result should have been C.

[0209] In this embodiment, in addition to relevant examples, irrelevant examples are also provided to the large language model to facilitate subsequent comparison and decoding. The selection of irrelevant examples is similar to that of relevant examples, except that relevant examples are the L examples with high similarity, while irrelevant examples are the L examples with low similarity. These selected irrelevant examples can serve as negative samples (negative task examples) to help the large language model distinguish and reinforce task-related information. In some cases, the parameter knowledge of the large language model and the provided contextual knowledge conflict. Introducing irrelevant examples can help the large language model better resolve this conflict, i.e., through comparative learning, identify which knowledge supports the correct answer and which is irrelevant and sets up interference. By comparing relevant and irrelevant examples, the large language model can learn how to identify and filter unimportant or misleading knowledge.

[0210] Step 205: Combine the multiple-choice instructions, relevant examples, and irrelevant examples to determine the standard clinical terminology.

[0211] This involves simultaneously inputting multiple-choice instructions, relevant examples, and irrelevant examples into a large language model (target language model) to obtain standard clinical terms (included in the converted text). In this step, we assume that for the large language model θ, inputting non-standard terms yields multiple-choice instructions q and relevant examples c. + And unrelated example c - For the t-th time step, the large language model will make three predictions for q: one relying solely on q, one relying on q and the relevant example c. + To predict, and to depend on q and unrelated example c - To make predictions. The output probability distributions of these three predictions can be written as equations (2) to (4), respectively:

[0212] z t ~p θ (y t |q,y <t (2)

[0213]

[0214] Among them, y <t p represents the output up to the t-th time step. θ y represents the probability output by the large language model θ. t It is the output of the large language model at the t-th time step, i.e., the candidate entity.

[0215] Thus, at time step t, the final probability of each candidate entity can be written as equation (5):

[0216]

[0217] Here, softmax is the normalization function, and α is a hyperparameter used to control the intensity of the contrast. When α = 0, it degenerates into a decoding method that relies solely on the parameter knowledge of the large language model. The larger the value of α, the more emphasis is placed on the difference between relevant and irrelevant examples in the output. This can be understood as the large language model prioritizing outputs that are more likely to appear in relevant examples during the generation process, while avoiding incorrect answers generated by irrelevant examples. As a result, the output of the large language model relies more on the knowledge provided by the current relevant examples, rather than solely on the prior knowledge of the large language model.

[0218] Figure 12 This is a schematic diagram of the comparison decoding provided in an embodiment of this application. See also... Figure 12 Although the answer in relevant example 12-1 is "fungal otitis externa," this answer contradicts the prior knowledge of the large language model (because the probability distribution z obtained by relying solely on q has the highest probability of "aspergillosis of the external auditory canal"). This means that even with relevant example 12-1 provided, the large language model might still output option B, i.e., aspergillosis of the external auditory canal, for multiple-choice question 12-2. However, by introducing irrelevant example 12-3, we can distinguish between the probability distribution z obtained by the large language model relying solely on q (i.e., (A) 0.3, (B) 0.4, (C) 0.3), and the probability distribution z obtained by relying solely on q and relevant example c. + The obtained probability distribution (i.e., (A) 0.1, (B) 0.5, (C) 0.4), and dependencies q and irrelevant examples c. - The obtained probability distribution (i.e., (A) 0.2, (B) 0.6, (C) 0.2), which are substituted into equation (5) for calculation. The process is shown in equations (6) to (8):

[0219] p A =0.3+(0.1-0.2)=0.2 (6)

[0220] p B =0.4+(0.5-0.6)=0.3 (7)

[0221] p C =0.3+(0.4-0.2)=0.5 (8)

[0222] Thus, we obtain the final probability distribution ((A) 0.2, (B) 0.3, (C) 0.5).

[0223] Therefore, by comparing and decoding, we can increase the weight of answers with higher probabilities when there are relevant examples and decrease the weight of answers with higher probabilities when there are irrelevant examples. This allows the large language model to focus on answers that are relevant and ignore answers that are irrelevant, thus enabling the large language model to output more accurate answers.

[0224] It is understood that in the embodiments of this application, user information, such as data related to the text to be converted, is involved. When the embodiments of this application are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of related data must comply with relevant laws, regulations and standards.

[0225] The following description continues to illustrate the exemplary structure of the text processing device 455 provided in the embodiments of this application as a software module. In some embodiments, such as Figure 2 As shown, the software modules stored in the text processing device 455 of the memory 450 may include:

[0226] The candidate query module 4551 is used to query multiple candidate texts from the terminology database of the target knowledge domain based on the text to be converted in the target knowledge domain.

[0227] The instruction generation module 4552 is used to generate task prompt instructions based on the text to be converted and multiple candidate texts;

[0228] Example acquisition module 4553 is used to acquire positive task examples and negative task examples based on the text to be converted, wherein the positive task examples are examples obtained by positive conversion based on the target knowledge domain, and the negative task examples are examples obtained by negative conversion based on the target knowledge domain;

[0229] The text conversion module 4554 is used to convert the text to be converted based on the positive task example, the negative task example, and the task prompt instruction to obtain the converted text including the terminology of the target knowledge domain.

[0230] In the above scheme, the task prompt instruction includes: a task prompt question, and multiple option entities corresponding to the multiple candidate texts;

[0231] The text conversion module 4554 is further configured to determine a matching option from multiple option entities based on the positive task example, the negative task example, and the task prompt question; and to convert the text to be converted using the candidate text corresponding to the matching option to obtain the converted text including the terminology of the target knowledge domain.

[0232] In the above scheme, the text conversion module 4554 is further configured to determine the selection probability of each of the option entities based on the positive task example, the negative task example, and the task prompt question; and to determine the matching option of the task prompt question from the plurality of option entities based on the selection probability of each of the option entities.

[0233] In the above scheme, the text conversion module 4554 is further configured to: determine a first predicted probability of each option entity from the task prompt question; fuse the task prompt question and the positive task example to obtain a first fusion result, and determine a second predicted probability of each option entity from the first fusion result; fuse the task prompt question and the negative task example to obtain a second fusion result, and determine a third predicted probability of each option entity from the second fusion result; and determine the selection probability of each option entity based on the first predicted probability, the second predicted probability, and the third predicted probability of each option entity.

[0234] In the above scheme, the text conversion module 4554 is further configured to determine the probability difference between the second predicted probability and the third predicted probability for each option entity; and to determine the selection probability of the option entity by summing the probability difference with the first predicted probability.

[0235] In the above scheme, the example acquisition module 4553 is further configured to determine, from multiple pre-conversion texts, the first pre-conversion text related to the text to be converted, and the second pre-conversion text unrelated to the text to be converted; acquire candidate task examples including the first pre-conversion text from the example library as positive task examples; and acquire candidate task examples including the second pre-conversion text from the example library as negative task examples.

[0236] In the above scheme, the example acquisition module 4553 is further configured to extract features from the text to be converted to obtain a first text feature; use the second text feature corresponding to each of the pre-conversion texts and the first text feature to determine the text similarity between the text to be converted and each of the pre-conversion texts; based on the text similarity, determine the first pre-conversion text related to the text to be converted and the second pre-conversion text unrelated to the text to be converted from the multiple pre-conversion texts.

[0237] In the above scheme, the example acquisition module 4553 is further configured to sort the multiple pre-conversion texts in descending order of text similarity to obtain a text sequence; determine at least one pre-conversion text located at the beginning of the text sequence as the first pre-conversion text; and determine at least one pre-conversion text located at the end of the text sequence as the second pre-conversion text.

[0238] In the above scheme, the example acquisition module 4553 is further configured to, for the text to be converted, determine a first pre-conversion text and a second pre-conversion text that are both related to the text to be converted from a plurality of pre-conversion texts; for the first pre-conversion text, acquire a correct first post-conversion text, and use the first pre-conversion text and the first post-conversion text to generate the positive task example; for the second pre-conversion text, acquire an incorrect second post-conversion text, and use the second pre-conversion text and the second post-conversion text to generate the negative task example.

[0239] In the above scheme, the candidate query module 4551 is further used to calculate the similarity between the text to be converted and each standard term in the terminology library of the target knowledge domain to obtain semantic similarity; based on the semantic similarity, to query multiple candidate texts corresponding to the text to be converted from multiple standard terms in the terminology library.

[0240] In the above scheme, the instruction generation module 4552 is further used to obtain a multiple-choice question template; wherein, the multiple-choice question template includes: a question stem filling position and multiple option filling positions; the text to be converted is filled into the question stem filling position, and multiple candidate texts are sequentially filled into multiple option filling positions to obtain the task prompt instruction.

[0241] This application provides a computer program product comprising a computer program or computer-executable instructions stored in a computer-readable storage medium. A processor of an electronic device reads the computer-executable instructions from the computer-readable storage medium and executes the computer-executable instructions, causing the electronic device to perform the text processing method described above in this application.

[0242] This application provides a computer-readable storage medium storing computer-executable instructions or a computer program. When the computer-executable instructions or the computer program are executed by a processor, the processor will execute the text processing method provided in this application, for example, such as... Figure 3 The text processing method shown.

[0243] In some embodiments, the computer-readable storage medium may be a memory such as RAM, ROM, flash memory, magnetic surface memory, optical disk, or CD-ROM; or it may be a variety of devices including one or any combination of the above-mentioned memories.

[0244] In some embodiments, computer-executable instructions may take the form of programs, software, software modules, scripts, or code, written in any form of programming language (including compiled or interpreted languages, or declarative or procedural languages), and may be deployed in any form, including as stand-alone programs or as modules, components, subroutines, or other units suitable for use in a computing environment.

[0245] As an example, computer-executable instructions may, but do not necessarily, correspond to files in a file system. They may be stored as part of a file that holds other programs or data, for example, in one or more scripts in a Hyper Text Markup Language (HTML) document, in a single file dedicated to the program in question, or in multiple co-located files (e.g., files that store one or more modules, subroutines, or code sections).

[0246] As an example, computer-executable instructions can be deployed to execute on a single electronic device, or on multiple electronic devices located at one location, or on multiple electronic devices distributed across multiple locations and interconnected via a communication network.

[0247] In summary, through the embodiments of this application, multiple candidate texts are first queried from the terminology database of the target knowledge domain for the text to be converted, thus limiting the options for the converted text to the range of professional terms. Then, task prompts are generated using the queried candidate texts and the original text to be converted. Based on the task prompts, positive task examples for identifying knowledge related to the conversion process of the text to be converted in the parameter knowledge, and negative task examples for identifying knowledge irrelevant to or interfering with the conversion process of the text to be converted, are combined to enhance the influence of relevant knowledge in the conversion process and reduce the influence of irrelevant or interfering knowledge. This ensures that the provided contextual information is fully utilized, thereby reducing the gap between the converted text and the actual situation and ultimately improving the accuracy of the converted text.

[0248] The above description is merely an embodiment of this application and is not intended to limit the scope of protection of this application. Any modifications, equivalent substitutions, and improvements made within the spirit and scope of this application are included within the scope of protection of this application.

Claims

1. A text processing method, characterized in that, The method includes: Based on the text to be converted in the target knowledge domain, multiple candidate texts are queried from the terminology database of the target knowledge domain; Based on the text to be converted and multiple candidate texts, generate task prompt instructions; Based on the text to be converted, positive task examples and negative task examples are obtained, wherein the positive task examples are examples obtained by positive conversion based on the target knowledge domain, and the negative task examples are examples obtained by negative conversion based on the target knowledge domain; Based on the positive task example, the negative task example, and the task prompt instructions, the text to be converted is converted to obtain the converted text including the terminology of the target knowledge domain.

2. The method according to claim 1, characterized in that, The task prompt instruction includes: a task prompt question, and multiple option entities corresponding to the multiple candidate texts; The process of converting the text to be converted based on the positive task example, the negative task example, and the task prompt instructions to obtain converted text including terms from the target knowledge domain includes: Based on the positive task example, the negative task example, and the task prompt question, a matching option is determined from the multiple option entities; The candidate text corresponding to the matching option is used to convert the text to be converted, resulting in the converted text that includes the terms of the target knowledge domain.

3. The method according to claim 2, characterized in that, The step of determining matching options from multiple option entities based on the positive task example, the negative task example, and the task prompt question includes: Based on the positive task example, the negative task example, and the task prompt question, determine the selection probability of each option entity; Based on the selection probability of each of the option entities, the matching option for the task prompt question is determined from the plurality of option entities.

4. The method according to claim 3, characterized in that, The step of determining the selection probability of each option entity based on the positive task example, the negative task example, and the task prompt question includes: From the task prompt question, determine a first predicted probability for each of the option entities; The task prompt question and the positive task example are fused to obtain a first fusion result, and a second predicted probability of each option entity is determined from the first fusion result; The task prompt question and the negative task example are fused to obtain a second fusion result, and a third predicted probability of each option entity is determined from the second fusion result; The selection probability of each option entity is determined based on the first predicted probability, the second predicted probability, and the third predicted probability of each option entity.

5. The method according to claim 4, characterized in that, Determining the selection probability of each option entity based on the first predicted probability, the second predicted probability, and the third predicted probability of each option entity includes: For each of the option entities, determine the probability difference between the second predicted probability and the third predicted probability; The sum of the probability difference and the first predicted probability is determined as the selection probability of the option entity.

6. The method according to any one of claims 1 to 5, characterized in that, The step of obtaining positive and negative task examples based on the text to be converted includes: From a plurality of pre-conversion texts, determine a first pre-conversion text that is related to the text to be converted, and a second pre-conversion text that is not related to the text to be converted; Obtain candidate task examples including the first pre-conversion text from the example library to serve as examples of the forward task; Obtain candidate task examples, including the text before the second transformation, from the example library to serve as negative task examples.

7. The method according to claim 6, characterized in that, The step of determining, from a plurality of pre-conversion texts, a first pre-conversion text related to the text to be converted, and a second pre-conversion text unrelated to the text to be converted, includes: Feature extraction is performed on the text to be converted to obtain the first text feature; By using the second text feature and the first text feature corresponding to each of the original texts, the text similarity between the text to be converted and each of the original texts is determined; Based on the text similarity, from the plurality of texts before conversion, the first text before conversion that is related to the text to be converted, and the second text before conversion that is not related to the text to be converted, are determined.

8. The method according to claim 7, characterized in that, The step of determining, based on the text similarity, the first pre-conversion text related to the text to be converted and the second pre-conversion text unrelated to the text to be converted from a plurality of pre-conversion texts includes: The texts are sorted in descending order of similarity to obtain a text sequence. At least one of the original texts located at the beginning of the text sequence is identified as the first original text. At least one of the original texts located at the end of the text sequence is identified as the second original text.

9. The method according to any one of claims 1 to 5, characterized in that, The step of obtaining positive and negative task examples based on the text to be converted includes: For the text to be converted, a first text and a second text that are both related to the text to be converted are determined from a plurality of texts before conversion; For the first text before conversion, obtain the correct first text after conversion, and use the first text before conversion and the first text after conversion to generate the positive task example; For the text before the second conversion, obtain the erroneous text after the second conversion, and use the text before the second conversion and the text after the second conversion to generate the negative task example.

10. The method according to any one of claims 1 to 5, characterized in that, The text to be converted, based on the target knowledge domain, queries multiple candidate texts from the terminology database of the target knowledge domain, including: The semantic similarity is obtained by calculating the similarity between the text to be converted and each standard term in the terminology library of the target knowledge domain. Based on the semantic similarity, multiple candidate texts corresponding to the text to be converted are queried from multiple standard terms in the terminology database.

11. The method according to any one of claims 1 to 5, characterized in that, The step of generating task prompt instructions based on the text to be converted and multiple candidate texts includes: Obtain a multiple-choice question template; wherein, the multiple-choice question template includes: a question stem filler and multiple option filler; The text to be converted is filled into the question stem filling position, and multiple candidate texts are sequentially filled into multiple option filling positions to obtain the task prompt instruction.

12. A text processing device, characterized in that, The device includes: The candidate query module is used to query multiple candidate texts from the terminology database of the target knowledge domain based on the text to be converted in the target knowledge domain. The instruction generation module is used to generate task prompt instructions based on the text to be converted and multiple candidate texts; The example acquisition module is used to acquire positive task examples and negative task examples based on the text to be converted, wherein the positive task examples are examples obtained by positive conversion based on the target knowledge domain, and the negative task examples are examples obtained by negative conversion based on the target knowledge domain; The text conversion module is used to convert the text to be converted based on the positive task example, the negative task example, and the task prompt instruction, to obtain converted text including the terminology of the target knowledge domain.

13. An electronic device, characterized in that, The electronic device includes: Memory is used to store executable instructions or computer programs. A processor, when executing computer-executable instructions or computer programs stored in the memory, implements the method according to any one of claims 1 to 11.

14. A computer-readable storage medium storing computer-executable instructions or a computer program, characterized in that, When the computer-executable instructions or computer program are executed by a processor, they implement the method described in any one of claims 1 to 11.

15. A computer program product comprising computer-executable instructions or a computer program, characterized in that, When the computer-executable instructions or computer program are executed by a processor, they implement the method according to any one of claims 1 to 11.