Text processing method, device, equipment, storage medium and product

By extracting and expanding the target component words in the text, and using the term operation tree structure for standardized matching, the problem of low word normalization processing efficiency and poor accuracy in the existing technology is solved, and efficient and accurate text processing effects are achieved.

CN118313376BActive Publication Date: 2024-08-27TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410739540.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-07
Publication Date
2024-08-27
Estimated Expiration
2044-06-07

AI Technical Summary

Technical Problem

Existing text processing technology has low efficiency and poor accuracy in word normalization processing, especially when processing large-scale text data. Manual processing costs are high and multi-label classification methods based on deep learning rely on a large amount of annotated data. The training model is in application Performance degrades with new data sets.

Method used

By extracting the target component words from the text to be processed, gradually extending adjacent characters to obtain the expanded words, and performing standardized matching, using the term operation tree structure under the target field for normalization processing, ensuring the accuracy and efficiency of word normalization .

Benefits of technology

Improves the efficiency and accuracy of text processing, reduces unnecessary processing, and ensures the accuracy of terminology normalization, especially in fields with large contextual differences such as medicine and law, allowing for a more accurate understanding of word meanings and uses.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118313376B
    Figure CN118313376B
Patent Text Reader

Abstract

The present application provides a text processing method, device, equipment, storage medium and product. The method includes: in response to a text processing request, extracting words of a target type from a text to be processed to obtain a target component word; subscripting all characters of the text to be processed to obtain a target component word subscript sequence corresponding to the target component word; performing at least one subscript extension on the target component word subscript sequence based on a preset extended subscript number threshold; after each subscript extension to obtain an extended word subscript sequence, normalizing the target component extended word to obtain a normalized term containing the target component word and a target standardized word corresponding to the normalized term; based on the normalized term and the target standardized word, performing text processing on the text to be processed to obtain a processed text. The present application can improve the processing efficiency and accuracy of word normalization by targeted extraction of words of the target type and term normalization and other processing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a text processing method, device, equipment, storage medium and product. Background Art

[0002] With the rapid growth of digital information, text processing is increasingly being used in all walks of life, from search algorithms to intelligent customer service to natural language processing. However, with the specialized application of text processing in different fields of all walks of life, a large number of non-standard colloquial words make it difficult to fully apply text processing technology.

[0003] The text processing for word normalization in the related technology can be mainly divided into two categories: manual processing and multi-label classification based on deep learning. On the one hand, manual processing usually relies on experts or annotators to read, understand and annotate the text, but this method is inefficient and costly, especially when processing large-scale text data. On the other hand, multi-label classification methods based on deep learning often rely on a large amount of annotated data for training, and the acquisition and annotation of annotated data is itself a time-consuming and labor-intensive process. In addition, due to the differences between different data sets, the performance of the trained model will degrade when applied to a new data set. That is, when the related technology performs text processing for word normalization, there are technical problems of low efficiency and poor accuracy of word normalization processing. Summary of the invention

[0004] The embodiments of the present application provide a text processing method, apparatus, device, storage medium and product. The embodiments of the present application extract target component words from the text to be processed, gradually expand the characters adjacent to the target component words to obtain extended words, match the extended words with standardized words, and then obtain the final professional terms. Text processing is performed based on the professional terms, thereby achieving the technical effect of improving the processing efficiency and accuracy of word normalization.

[0005] The technical solution of the embodiment of the present application is implemented as follows:

[0006] An embodiment of the present application provides a text processing method, the method comprising: in response to a text processing request, extracting words of a target type from a text to be processed to obtain target component words; marking all characters of the text to be processed according to the position of each character in the text to be processed in the text to be processed to obtain a target component word subscript sequence corresponding to the target component word; performing at least one subscript extension on the target component word subscript sequence based on a preset extended subscript number threshold; after each subscript extension to obtain an extended word subscript sequence, normalizing the target component extended words corresponding to the extended word subscript sequence to obtain a normalized term containing the target component word and a target standardized word corresponding to the normalized term; the normalized term comprises: a term component word corresponding to at least one child node in a term operation tree structure under a target domain; performing text processing on the text to be processed based on the normalized term and the target standardized word to obtain a processed text.

[0007] The embodiment of the present application provides a text processing device, including: an extraction module, which is used to extract target type words from a text to be processed in response to a text processing request, and obtain target component words; a subscript sequence acquisition module, which is used to perform subscript marking on all characters of the text to be processed according to the position of each character in the text to be processed in the text to be processed, and obtain a target component word subscript sequence corresponding to the target component word; a subscript extension module, which is used to perform at least one subscript extension on the target component word subscript sequence based on a preset extension subscript quantity threshold; a normalization module, which is used to perform normalization processing on the target component extended words corresponding to the extended word subscript sequence after each subscript extension to obtain an extended word subscript sequence, and obtain a normalized term containing the target component word and a target standardized word corresponding to the normalized term; the normalized term includes: a term component word corresponding to at least one child node in the term operation tree structure under the target domain; a text processing module, which is used to perform text processing on the text to be processed based on the normalized term and the target standardized word to obtain a processed text.

[0008] In the above scheme, the normalization module is also used to: extract the target component extended words corresponding to the extended word subscript sequence from the text to be processed; perform standardized matching on the target component extended words to obtain alternative standardized words for the target component extended words; when the alternative standardized words are the same as the initial standardized words, the initial standardized words are determined as the target standardized words, and the target component words are determined as the normalized terms; wherein the initial standardized words are standardized words obtained by performing the standardized matching on the target component words; when the alternative standardized words are different from the initial standardized words, the alternative standardized words are determined as the target standardized words, and the target component extended words are determined as the normalized terms.

[0009] In the above scheme, the normalization module is also used to: obtain the current number of subscript extensions; when the alternative standardized word is different from the initial standardized word and the current number is less than the extended subscript quantity threshold, the alternative standardized word is determined as the target standardized word, and the target component expanded word is determined as the normalized term, and the subscript extension of the target component word subscript sequence is terminated; or, when the alternative standardized word is different from the initial standardized word and the current number is less than the extended subscript quantity threshold, the alternative standardized word is determined as the target standardized word, and the target component expanded word is determined as the normalized term, and the next subscript extension of the target component word subscript sequence is continued until the current number is equal to the extended subscript quantity threshold, and the subscript extension of the target component word subscript sequence is terminated.

[0010] In the above scheme, the normalization module is also used to: perform an operation tree decomposition on the target component expansion word to obtain at least one first decomposition component word; perform an operation tree decomposition on the standardized words in a preset standard vocabulary to obtain at least one second decomposition component word; based on the first decomposition component words and the second decomposition component words, determine the word similarity between the target component expansion word and the standardized words in the standard vocabulary; and determine the standardized word with the highest word similarity as the alternative standardized word for the target component expansion word.

[0011] In the above scheme, the normalization module is also used to: obtain the component type of the first decomposition component word and the component type of the second decomposition component word; based on the component type, perform text matching on the first decomposition component word and the second decomposition component word to obtain the decomposition word text similarity; based on the component type, perform semantic matching on the first decomposition component word and the second decomposition component word to obtain the decomposition word semantic similarity; perform weighted summation of the decomposition word text similarity and the decomposition word semantic similarity to obtain the word similarity between the target component expanded word and the standardized word.

[0012] In the above scheme, the normalization module is further used to: determine the synonymous extension words of the first decomposition component words based on a preset semantic similarity word set; and perform text matching on the first decomposition component words and the second decomposition component words based on the component type to obtain the decomposition word text similarity, including:

[0013] Determine a first edit distance between the first decomposed component word and the second decomposed component word having the same component type; determine a second edit distance between the synonymous extended word and the second decomposed component word having the same component type; and determine the text similarity of the decomposed words based on the smallest edit distance between the first edit distance and the second edit distance.

[0014] In the above scheme, the normalization module is also used to: perform feature extraction on the first decomposition component words, the second decomposition component words and the synonymous extended words with the same component type, respectively, to obtain the first feature vector of the first decomposition component words, the second feature vector of the second decomposition component words and the third feature vector of the synonymous extended words; determine the first cosine distance between the first feature vector and the second feature vector; determine the second cosine distance between the third feature vector and the second feature vector; and determine the semantic similarity of the decomposed words based on the first cosine distance and the second cosine distance.

[0015] In the above scheme, the normalization module is also used to: store the target component expansion words and the alternative standardized words corresponding to the target component expansion words into a preset word cache table; query the alternative standardized words of the target component expansion words from the word cache table; when the alternative standardized words are not found, perform standardized matching on the target component expansion words to obtain the alternative standardized words.

[0016] In the above scheme, the normalization module is also used to: obtain a preset set of blocked words; when the target component expansion word belongs to a blocked word in the set of blocked words, the initial standardized word is determined as the target standardized word, the target component word is determined as the normalized term, and the current subscript expansion step of the target component word subscript sequence is skipped.

[0017] In the above scheme, the text processing module is also used to: determine a first preset format for writing the target standardized words; write the target standardized words into the text to be processed according to the first preset format to obtain a first intermediate text; use a preset first rendering effect to render the normalized terms in the first intermediate text and the target standardized words corresponding to the normalized terms to obtain the processed text.

[0018] In the above scheme, the text processing module is also used to: replace the normalized terms in the text to be processed with the target standardized words corresponding to the normalized terms to obtain a second intermediate text; and render the target standardized words in the second intermediate text using a preset second rendering effect to obtain the processed text.

[0019] In the above scheme, the text processing module is also used to: determine a second preset format of the input text for generating a pre-trained large language model; write the target standardized words into the text to be processed according to the second preset format to obtain a third intermediate text; input the third intermediate text into the large language model, and predict the processed text through the large language model.

[0020] An embodiment of the present application provides an electronic device, which includes: a memory for storing computer-executable instructions; and a processor for implementing the text processing method provided in the embodiment of the present application when executing the computer-executable instructions stored in the memory.

[0021] An embodiment of the present application provides a computer-readable storage medium storing a computer program or computer-executable instructions for implementing the text processing method provided in the embodiment of the present application when executed by a processor.

[0022] An embodiment of the present 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, the text processing method provided by the embodiment of the present application is implemented.

[0023] The embodiments of the present application have the following beneficial effects:

[0024] The embodiment of the present application is to extract target component words from the text to be processed, gradually expand the characters adjacent to the target component words to obtain extended words, match the extended words with standardized words, and then obtain the final professional terms, and perform text processing based on the professional terms. Since the target type of words are directly extracted from the text to be processed by responding to the text processing request, meaningless traversal and analysis are avoided, thereby improving the efficiency of text processing; in the process of term normalization, the entire text is not traversed blindly, but only the characters adjacent to the target component words are traversed according to the position of the target component words in the text to be processed, which greatly reduces unnecessary processing and further improves the efficiency of text processing; by using the term operation tree structure under the target field as the basis for term normalization, and the term operation tree structure contains the component types of the terms under the target field, this makes the term normalization process more accurate; by corresponding the target component words with the child nodes in the term operation tree structure, the accuracy of term normalization can be ensured; by performing multiple subscript expansions according to the position of the target component words in the text to be processed to obtain the corresponding target component expansion words, the context information of the target component words can be taken into account, and the context information is crucial for accurately understanding the meaning and use of the words, especially in some fields (such as medicine, law, etc.), the same word may have different meanings in different contexts, thereby further improving the accuracy of term normalization. BRIEF DESCRIPTION OF THE DRAWINGS

[0025] Figure 1 is a structural diagram of a text processing system provided in an embodiment of the present application;

[0026] Figure 2 is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application;

[0027] Figure 3 It is a flowchart of a text processing method provided in an embodiment of the present application;

[0028] Figure 4 It is a flowchart of the normalization process provided by the embodiment of the present application;

[0029] Figure 5 is a flowchart of a standardized matching process provided in an embodiment of the present application;

[0030] Figure 6 is a flowchart of a process for determining word similarity provided in an embodiment of the present application;

[0031] Figure 7 It is a flowchart of a process for determining the similarity of decomposed word texts provided in an embodiment of the present application;

[0032] Figure 8is a flowchart of a process for determining semantic similarity of decomposed words provided in an embodiment of the present application;

[0033] Fig. 9 is a flowchart of a process for determining normalized terms provided in an embodiment of the present application;

[0034] Fig.10 This is an optional flowchart of text processing provided in an embodiment of the present application;

[0035] Fig.11 is another optional flowchart for text processing provided in an embodiment of the present application;

[0036] Fig.12 It is another optional flowchart for text processing provided in an embodiment of the present application;

[0037] Fig.13 It is a schematic diagram of the application effect of the general version of the question-and-answer system provided in the embodiment of the present application;

[0038] Fig.14 It is a schematic diagram of the application effect of the word normalization mark provided in the embodiment of the present application;

[0039] Fig.15 It is a schematic diagram of the application effect of the normalized replacement of words provided in the embodiment of the present application;

[0040] Fig.16 It is a structural diagram of the text processing version question answering system provided in the embodiment of the present application;

[0041] Fig.17 It is a schematic diagram of the effect of the interface application of the term normalization algorithm provided in the embodiment of the present application;

[0042] Fig.18 It is a schematic diagram of the term operation tree structure of the sample words provided in the embodiment of the present application;

[0043] Fig.19 This is a sample display diagram of word similarity calculation provided in an embodiment of the present application;

[0044] Fig. 20 It is a flowchart of the term normalization process provided in the embodiment of the present application. DETAILED DESCRIPTION

[0045] In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings. The described embodiments should not be regarded as limiting the present application. All other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of this application.

[0046] In the following description, reference is made to “some embodiments”, which describe a subset of all possible embodiments, but it will be 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.

[0047] If similar descriptions of "first / second" appear in the application documents, the following description is added. In the following description, the terms "first / second / third" involved are merely used to distinguish similar objects and do not represent a specific ordering of the objects. It is understandable that "first / second / third" can be interchanged in a specific order or sequence where permitted, so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein.

[0048] In the embodiments of the present application, the term "module" or "unit" refers to a computer program or a part of a computer program that has a predetermined function and works together with other related parts to achieve a predetermined goal, and can be implemented in whole or in part by using software, hardware (such as processing circuits or memories), or a combination thereof. Similarly, a processor (or multiple processors or memories) can be used to implement one or more modules or units. In addition, each module or unit can be part of an overall module or unit that includes the function of the module or unit.

[0049] Unless otherwise defined, all technical and scientific terms used in the embodiments of the present application have the same meanings as those commonly understood by those skilled in the art. The terms used in the embodiments of the present application are only for the purpose of describing the embodiments of the present application and are not intended to limit the present application.

[0050] The relevant data collection and processing in the embodiments of this application should be strictly in accordance with the requirements of relevant laws and regulations when applied in examples, obtain the informed consent or separate consent of the personal information subject, and carry out subsequent data use and processing within the scope of authorization of laws and regulations and the personal information subject.

[0051] Before further describing the embodiments of the present application in detail, the nouns and terms involved in the embodiments of the present application are explained. The nouns and terms involved in the embodiments of the present application are subject to the following interpretations.

[0052] 1) Word Normalization refers to the process of converting words in a text into a standard form to facilitate subsequent processing and analysis. In natural language processing, due to the diversity of text and the complexity of language, the same word may appear in multiple forms. The purpose of word normalization is to reduce this diversity so that different variants of the same word can be uniformly identified and processed.

[0053] 2) In response, it is used to indicate the conditions or states on which the executed operations depend. When the dependent conditions or states are met, one or more operations executed may be in real time or have a set delay. Unless otherwise specified, there is no restriction on the order in which the multiple operations executed are executed.

[0054] 3) International Classification of Diseases (ICD), which is used to classify and code various medical conditions and diseases. The main purpose of ICD is to provide a standardized method to record, compare and analyze diseases and health-related issues, which is essential for epidemiology, health statistics, medical planning, resource allocation, and the provision and quality assessment of medical services. ICD standard terms refer to the professional terms used in the ICD system to describe and name various diseases, symptoms, injuries, etc.; ICD standard codes are a specific set of letters and numbers assigned to each ICD standard word, which are used to uniquely identify specific diseases or health conditions in medical records and databases. In order to keep pace with medical developments, ICD is regularly updated and revised. The 10th Revision of the International Classification of Diseases (ICD-10) is currently commonly used.

[0055] 4) Large Language Models (LLMs) refer to a type of natural language processing model based on deep learning. Large language models learn the statistical characteristics and laws of language by training large amounts of text data, so that they can understand and generate natural language text. Large language models usually have billions to hundreds of billions of parameters and can capture complex relationships and patterns in language text.

[0056] 5) Prompt refers to a piece of text input to the large language model to guide the large language model to generate corresponding output. Prompts are usually used to stimulate the large language model to express specific topics or tasks. Prompts are a way for humans to interact with large language models and can be regarded as "hints" or "inquiries" to the large language model.

[0057] 6) Edit distance is a measure of the difference between two strings. Edit distance refers to the minimum number of edit operations required to convert one string into another.

[0058] 7) Cosine distance is a method to measure the difference between two vectors in multidimensional space. It expresses the similarity between them by calculating the cosine value of the angle between the two vectors. Cosine distance is often used in fields such as text processing, information retrieval, and machine learning, especially when dealing with high-dimensional data.

[0059] 8) Bidirectional Encoder Representations from Transformers (BERT) is a pre-trained natural language processing model. This model is based on the Transformer architecture and learns language expressions through a bidirectional training mechanism. It can achieve excellent performance in various natural language processing tasks.

[0060] In the related art, text processing for word normalization can be mainly divided into two categories: manual processing and multi-label classification based on deep learning. On the one hand, manual processing usually relies on experts or annotators to read, understand and annotate the text, but this method is inefficient and costly, especially when processing large-scale text data. On the other hand, multi-label classification methods based on deep learning often rely on a large amount of annotated data for training, and the acquisition and annotation of annotated data is itself a time-consuming and labor-intensive process. In addition, due to the differences between different data sets, the performance of the trained model will degrade when applied to a new data set. That is, when the related art performs text processing for word normalization, there are technical problems of low efficiency and poor accuracy of word normalization processing.

[0061] Based on at least one of the above-mentioned problems existing in the related technology, an embodiment of the present application provides a text processing method, which extracts target component words from the text to be processed, and gradually expands the adjacent characters of the target component words to obtain extended words, matches the extended words with standardized words, and then obtains the final professional terms, and performs text processing based on the professional terms. Since the target type of words are directly extracted from the text to be processed by responding to the text processing request, meaningless traversal and analysis are avoided, thereby improving the efficiency of text processing; in the process of term normalization, the entire text is not traversed blindly, but only the characters adjacent to the target component words are traversed according to the position of the target component words in the text to be processed, which greatly reduces the amount of unnecessary processing and further improves the efficiency of text processing; by using the term operation tree structure under the target field as the basis for term normalization, and the term operation tree structure contains the component types of the terms under the field, this makes the term normalization process more accurate; by corresponding the target component words with the child nodes in the term operation tree structure, the accuracy of term normalization can be ensured; by performing multiple subscript expansions according to the position of the target component words in the text to be processed to obtain the corresponding target component expansion words, the context information of the target component words can be taken into account, and the context information is crucial for accurately understanding the meaning and use of the words, especially in some fields (such as medicine, law, etc.), the same word may have different meanings in different contexts, thereby further improving the accuracy of term normalization.

[0062] Before explaining the text processing method of the embodiment of the present application, here, first explain the exemplary application of the text processing device of the embodiment of the present application, and the text processing device is an electronic device for implementing the text processing method. In one implementation, the text processing device (i.e., electronic device) provided in the embodiment of the present application can be implemented as a server. The server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (Content Delivery Network, CDN), and big data and artificial intelligence platforms. Multiple servers can be directly or indirectly connected by wired or wireless communication, which is not limited in the embodiment of the present application. The electronic device provided in the embodiment of the present application can also be implemented as a terminal device. The terminal device can be various types of terminals such as a laptop, a tablet computer, a desktop computer, a smart phone, a smart watch, a smart TV, and a car terminal. The electronic device provided in the embodiment of the present application can also be implemented as a combination of a terminal device and a server.

[0063] See also Figure 1 , Figure 1 3 is a schematic diagram of the structure of the text processing system 10 provided in the embodiment of the present application. The terminal 100 and the server 200 can be connected and interacted through the network 300. The terminal 100 can be used to provide a user interface, receive a user's text processing request, and present the text processing result to the user. The server 200 can be used to process the text to be processed in response to the text processing request. The network 300 can be a wide area network or a local area network, or a combination of the two.

[0064] See also Figure 2 , Figure 2 is a schematic diagram of the structure of an electronic device 400 provided in an embodiment of the present application, Figure 2 The electronic device 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 electronic device 400 are coupled together via a bus system 440. It is understood that the bus system 440 is used to achieve connection and communication between these components. In addition to the data bus, the bus system 440 also includes a power bus, a control bus and a status signal bus. However, for the sake of clarity, the bus system 440 is not described in detail. Figure 2 Various buses are labeled as bus system 440 .

[0065] The processor 410 may be an integrated circuit chip having 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., wherein the general-purpose processor may be a microprocessor or any conventional processor, etc.

[0066] The user interface 430 includes one or more output devices 431 that enable presentation of media content, including one or more speakers and one or more visual display screens. The 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.

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

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

[0069] In some embodiments, memory 450 can store data to support various operations, examples of which include programs, modules, and data structures, or a subset or superset thereof, as exemplarily described below.

[0070] The operating system 451 includes system programs for processing various basic system services and performing hardware-related tasks, such as a framework layer, a core library layer, a driver layer, etc., which are used to implement various basic businesses and process hardware-based tasks.

[0071] 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 include: Bluetooth, Wireless LAN (WiFi), and Universal Serial Bus (USB).

[0072] The presentation module 453 is used to enable presentation of information (eg, a user interface for operating peripheral devices and displaying content and information) via one or more output devices 431 (eg, a display screen, a speaker, etc.) associated with the user interface 430 .

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

[0074] In some embodiments, the device provided in the embodiments of the present application can be implemented in software. Figure 2 The text processing device 455 stored in the memory 450 is shown, which can be software in the form of a program and a plug-in, etc., including the following software modules: an extraction module 4551, a subscript sequence acquisition module 4552, a subscript expansion module 4553, a normalization module 4554 and a text processing module 4555. These modules are logical, so they can be arbitrarily combined or further split according to the functions implemented. The functions of each module will be explained below.

[0075] In other embodiments, the device provided in the embodiments of the present application can be implemented in hardware. As an example, the device provided in the embodiments of the present application can be a processor in the form of a hardware decoding processor, which is programmed to execute the text processing method provided in the embodiments of the present application. For example, the processor in the form of a hardware decoding processor can adopt one or more application specific integrated circuits (Application Specific Integrated Circuit, ASIC), digital signal processors (Digital Signal Processor, DSP), programmable logic devices (Programmable Logic Device, PLD), complex programmable logic devices (Complex Programmable Logic Device, CPLD), field programmable gate arrays (Field-Programmable Gate Array, FPGA) or other electronic components.

[0076] See also Figure 3 , Figure 3 This is an optional flow chart of the text processing method provided in the embodiment of the present application. Figure 3 The steps shown are explained as Figure 3 As shown, the text processing method is described by taking the execution subject of the electronic device as an example, and the method includes the following steps 101 to 105:

[0077] Step 101, in response to a text processing request, extract target type words from the text to be processed to obtain target component words.

[0078] In some embodiments, a text processing request refers to a request from a user, application, or system to analyze or operate on text data. The text processing request includes the text to be processed and the expectation for the processing result, such as the expectation of obtaining a text standardization result or the expectation of obtaining a text rewriting result. The text to be processed refers to the original text data that needs to be processed, is the main body of the text processing request, and is the text content that needs to be analyzed and operated. The target type is a specific type of words that need to be paid attention to and extracted during the text processing process; if the purpose of text processing is medical research, the target type can be a disease name, drug ingredient, or anatomical term, etc.; in legal text processing, the target type can be a legal term, case number, or regulatory clause, etc. Target component words refer to words that meet the target type extracted from the text to be processed.

[0079] For example, in text processing in the medical field, step 101 can be implemented by using a medical terminology recognition model to extract target type words such as medical terms, disease names or drug names from the text to be processed after receiving a text processing request containing medical literature or patient disease descriptions.

[0080] Through step 101, words of the target type can be quickly and accurately extracted from the text to be processed, providing effective input for subsequent text processing tasks.

[0081] Step 102, according to the position of each character in the text to be processed, all characters in the text to be processed are marked with subscripts to obtain a target component word subscript sequence corresponding to the target component word.

[0082] In some embodiments, in text processing, subscript marking is a technique for associating each character with its position in the text, and after text marking, each character (including spaces, punctuation marks, etc.) is assigned a unique subscript, which can be counted starting from 0. For example, in the text to be processed "Acute bronchitis is a common respiratory disease" (18 characters), the subscript of the first character "acute" is 0, the subscript of the second character "type" is 1, and so on, until the subscript of the last character is 17.

[0083] The target component word subscript sequence refers to the character subscript list of the target component words identified in the text to be processed. The target component word subscript sequence includes the subscripts of the starting character and the ending character of the target component word, or it can also include the subscripts of a series of consecutive characters from the starting character to the ending character. The subscripts in the target component word subscript sequence indicate the specific position of the target component word in the text to be processed. For example, in the text to be processed "Acute bronchitis is a common respiratory disease", the target component word subscript sequence of the target component word "bronchitis" is [2,5] or [2,3,4,5].

[0084] Step 103: perform at least one subscript extension on the target component word subscript sequence based on a preset extension subscript quantity threshold.

[0085] In some embodiments, the preset extended subscript quantity threshold is a numerical standard set to ensure the contextual integrity of the target component word or to capture a wider range of contextual information, and is used to determine the scope of subscript extension. Subscript extension refers to extending the starting subscript, the ending subscript, or both of the subscript sequence of the target component word outward by a subscript value, that is, the subscript extension can be extended to one side or to both sides.

[0086] For example, if the target component word subscript sequence is [2,5], and the threshold for the number of extended subscripts is 3, then the extended word subscript sequence obtained by expanding to the left for the first time is [1,5], and the extended word subscript sequence obtained by expanding to the left for the second time is [0,5]. When expanding to the left for the third time, the subscript expansion operation is terminated.

[0087] Step 103 can expand the scope of attention to the target component word, take into account more context information related to the target component word in the text, improve the efficiency and accuracy of text processing, and help to more accurately understand the meaning and context of the text. At the same time, through the preset extension subscript quantity threshold, the scope and degree of expansion can be controlled to avoid information redundancy or misunderstanding caused by excessive expansion.

[0088] Step 104, after each subscript expansion obtains an extended word subscript sequence, the target component extended words corresponding to the extended word subscript sequence are normalized to obtain normalized terms containing the target component words and target standardized words corresponding to the normalized terms; the normalized terms include: term component words corresponding to at least one child node in the term operation tree structure under the target domain.

[0089] In some embodiments, normalized terms refer to colloquial or non-standard words that appear in the text to be processed; normalized terms can be words that appear due to dialects, industry terms, spelling errors, or personal language habits. Target standardized words refer to standard words or codes corresponding to normalized terms; target standardized words are the result of standardization processing, representing the unified and standardized expression of normalized terms; target standardized words are not limited to only standard words or standard codes, but can also be a combination of the two.

[0090] The term operation tree structure is a data structure used to represent terms in a specific field and the relationship between them. The terms in a specific field are term components. The relationship between term components can be associated (related), parallel, and selective. For example, in the medical field, "chest pain with dyspnea" indicates that the two symptoms of chest pain and dyspnea exist at the same time and are related, so the term component "chest pain" and the term component "dyspnea" are in an associated (related) relationship; "hypertension and diabetes" indicates that the patient suffers from both diseases, so the term component "hypertension" and the term component "diabetes" are in a parallel relationship; "headache or dizziness" indicates that the patient may suffer from headache or dizziness, so the term component "headache" and the term component "dizziness" are in a selective relationship. The term operation tree structure contains the component type of the term.

[0091] Normalization processing refers to the process of obtaining a normalized term containing a target component word and a target standardized word corresponding to the normalized term. The extended word subscript sequence refers to a new subscript sequence obtained by subscript extension of the target component word subscript sequence in step 1022. The extended word subscript sequence includes not only the subscript of the target component word, but also the subscript of the context character added due to the extension. For example, if the target component word subscript sequence is [2,5], and is extended to the left by 2 characters based on a preset extended subscript quantity threshold, then the extended word subscript sequence may become [0,5]. The target component extended word is a word in the text to be processed identified by the extended word subscript sequence.

[0092] For example, in text processing in the medical field, step 102 can be used to normalize the terminology of disease names. Assuming that the text to be processed contains a disease name "bronchitis", first identify "bronchitis" as the target component word; then, traverse the characters adjacent to "bronchitis" to determine its complete boundary and obtain "acute bronchitis"; finally, use "acute bronchitis" as the normalized term and find the corresponding target standardized word, such as the standard expression (acute bronchitis) in the ICD-10 code or the corresponding disease code (J20).

[0093] By matching the normalized terms with the target standardized words in step 104, the semantic categories represented by these words can be further clarified, the accuracy and efficiency of text processing can be improved, and the errors and ambiguities caused by differences in word forms can be reduced.

[0094] The implementation process of step 102 to step 104 is to perform term normalization processing on the target component word according to the position of the target component word in the text to be processed, by traversing the characters adjacent to the target component word in the text to be processed in turn, and obtain the normalized term containing the target component word and the target standardized word corresponding to the normalized term. Term normalization processing refers to the process of obtaining normalized terms and target standardized words. After the term normalization processing, each normalized term will have a corresponding target standardized word. Through steps 102 to step 104, term normalization processing can be accurately performed according to the position of the target component word in the text to be processed, avoiding unnecessary traversal and redundant operations, and improving the efficiency of text processing. At the same time, the term operation tree structure under the target field is used to match and normalize the terms, ensuring the accuracy and consistency of the terms and improving the quality of text processing. In addition, by obtaining the normalized terms and the corresponding target standardized words, a more reliable and standardized data foundation is provided for subsequent text analysis and related tasks of processing.

[0095] In some embodiments, see Figure 4 , Figure 3The illustrated step 104 may be implemented through steps 1041 to 1044, which are described in detail below.

[0096] Step 1041, extracting target component expansion words corresponding to the expansion word subscript sequence from the text to be processed.

[0097] For example, the text to be processed is "Acute bronchitis is a common respiratory disease", and the expansion word subscript sequence is [1,2,3,4,5], then the target component expansion word is "acute bronchitis".

[0098] Step 1042, perform standardized matching on the target component expansion word to obtain candidate standardized words for the target component expansion word.

[0099] In some embodiments, the candidate standardized word is a standardized word that may be used as the target standardized word after standardized matching of the target component expanded word. Standardized matching refers to the process of matching the target component expanded word with a predefined standardized vocabulary to obtain the candidate standardized word.

[0100] In some embodiments, see Figure 5 , Figure 4 The illustrated step 1042 may be implemented through steps A1 to A4, which are described in detail below.

[0101] Step A1, performing operation tree decomposition on the target component expansion word to obtain at least one first decomposition component word.

[0102] In some embodiments, operation tree decomposition is a method for analyzing word structure, and a tree can be constructed to represent the semantic relationship between smaller components in a word. Operation tree decomposition for a target type can obtain the component type of the component unit represented by each node in the word. For example, operation tree decomposition in the medical field can obtain the component type of the component unit represented by each node as anatomical type (such as "neck", "abdomen", "ankle", etc.), disease type (such as "fever", "bleeding", "infection", etc.), operation type (such as "surgery", "operation", etc.), modification type (such as "acute", "paralytic", etc.), orientation type (such as "left", "right", etc.) or relationship type (such as "with", "or", "and", etc.).

[0103] The decomposed component words refer to the smaller component units identified after the operation tree decomposition, and the first decomposed component words are at least one basic unit of the structure of the target component expansion word. The first decomposed component words help to understand the meaning and structure of the target component expansion word because the first decomposed component words reveal the component types contained in the target component expansion word.

[0104] Step A2, performing operation tree decomposition on the standardized words in the preset standard word library to obtain at least one second decomposition component word.

[0105] A standard vocabulary is a predefined vocabulary that contains standardized terms (standardized words). Standardized words in a standard vocabulary are verified and recognized, and are considered accurate and authoritative in a specific field or industry. For example, a standard vocabulary in the medical field can be ICD-10, and standardized words can be ICD-10 standard words.

[0106] The decomposed component words refer to the smaller component units identified after the operation tree decomposition, and the second decomposed component words are at least one basic unit of the structure of the standardized word. The second decomposed component words help to understand the meaning and structure of the standardized word because the second decomposed component words reveal the component types contained in the standardized word.

[0107] Step A3, based on the first decomposed component words and the second decomposed component words, determine the word similarity between the target component expanded word and the standardized words in the standard word library.

[0108] In some embodiments, the first decomposed component word and the second decomposed component word may be subjected to part of speech and semantic analysis, and the analysis result may be used as a basis for calculating word similarity. Word similarity is a quantitative indicator for measuring the degree of similarity between two words in semantics, structure or usage.

[0109] In some embodiments, see Figure 6 , Figure 5 The illustrated step A3 can be implemented through steps A31 to A34, which are described in detail below.

[0110] Step A31, obtaining the component type of the first decomposed component word and the component type of the second decomposed component word.

[0111] In some embodiments, the component type is the type obtained when the word is classified, which can be obtained when the word is decomposed into a computational tree. For example, in the medical field, the component type can be an anatomical type, a disease type, an operation type, a modification type, a position type, or a relationship type.

[0112] Step A32: Based on the component type, text matching is performed on the first decomposed component word and the second decomposed component word to obtain the decomposed word text similarity.

[0113] In some embodiments, the decomposed word text similarity is a quantitative index for determining the degree of similarity between the first decomposed component word and the second decomposed component word by comparing their text representations. In step A32, firstly, the first decomposed component word and the second decomposed component word of the same component type can be text matched, and the degree of similarity between the first decomposed component word and the second decomposed component word in text representation can be determined by comparing the features such as word form, root, affix, meaning or context of the first decomposed component word and the second decomposed component word, and quantified as the decomposed word text similarity. The larger the value of the decomposed word text similarity, the more similar the first decomposed component word and the second decomposed component word are in text form.

[0114] Through step A32, second decomposition component words similar to the first decomposition component words can be more accurately identified and matched, thereby improving the accuracy of text processing.

[0115] In some embodiments, see Figure 7 , Figure 6 Before step A32 shown, step A320 may be included, and step A32 may be implemented through steps A321 to A323, which are described in detail below.

[0116] Step A320: Determine the synonymous extended words of the first decomposed component words based on a preset semantically similar word set.

[0117] In some embodiments, the preset semantically similar word set is a predefined data set that includes words with similar semantics. The preset semantically similar word set can be set by a domain expert or system administrator according to specific application requirements or contextual environments to assist in identifying and matching words with similar semantics during text processing. The synonymous extended words are words in the preset semantically similar word set that have similar semantics to the first decomposed component words.

[0118] Step A321, determining a first edit distance between a first decomposed component word and a second decomposed component word having the same component type.

[0119] In some embodiments, the first edit distance is an edit distance calculated based on the first decomposed component word and the second decomposed component word having the same component type.

[0120] Step A322: determining a second edit distance between the synonymous expanded word and the second decomposed component word of the same component type.

[0121] In some embodiments, the second edit distance is an edit distance calculated based on a synonymous expanded word and a second decomposed component word having the same component type.

[0122] Step A323: Determine the decomposed word text similarity based on the smallest edit distance between the first edit distance and the second edit distance.

[0123] In some embodiments, the smallest edit distance between the first edit distance and the second edit distance may be used as a basis for calculating the decomposed word text similarity. For example, if the first edit distance is 0.5 and the second edit distance is 0.3, the decomposed word text similarity may be determined as 1-0.3=0.7.

[0124] See below for more information Figure 6 , continue with the description of step A32 above.

[0125] Step A33, based on the component type, semantic matching is performed on the first decomposed component words and the second decomposed component words to obtain the semantic similarity of the decomposed words.

[0126] In some embodiments, the semantic similarity of decomposed words is a quantitative index for determining the degree of similarity between the first decomposed component word and the second decomposed component word by comparing the semantic content of the two. In step A33, firstly, the first decomposed component word and the second decomposed component word of the same component type can be semantically matched, and the degree of similarity between the first decomposed component word and the second decomposed component word at the semantic level can be determined by comparing the semantic roles, contextual meanings, or relationships with other words of the first decomposed component word and the second decomposed component word, and quantified as the semantic similarity of the decomposed words. The larger the value of the semantic similarity of the decomposed words, the more similar the first decomposed component word and the second decomposed component word are in terms of semantic content.

[0127] Through step A33, second decomposition component words similar to the first decomposition component words can be further accurately identified and matched, thereby improving the accuracy of text processing.

[0128] In some embodiments, see Figure 8 , Figure 6 The illustrated step A33 can be implemented through steps A331 to A334, which are described in detail below.

[0129] Step A331, perform feature extraction on the first decomposition component words, the second decomposition component words and the synonymous expansion words with the same component type, and obtain the first feature vector of the first decomposition component words, the second feature vector of the second decomposition component words and the third feature vector of the synonymous expansion words.

[0130] In some embodiments, the first feature vector, the second feature vector, and the third feature vector are used to represent multi-dimensional numerical vectors of the first decomposition component words, the second decomposition component words, and the synonymous extension words, respectively. Subsequent text analysis and processing can be performed based on the first feature vector, the second feature vector, and the third feature vector.

[0131] Step A332: determine a first cosine distance between the first eigenvector and the second eigenvector.

[0132] In some embodiments, the cosine value of the angle between the first eigenvector and the second eigenvector may be calculated to obtain the similarity between the first eigenvector and the second eigenvector, that is, the first cosine distance.

[0133] Step A333: determine the second cosine distance between the third eigenvector and the second eigenvector.

[0134] In some embodiments, the cosine value of the angle between the third eigenvector and the second eigenvector may be calculated to obtain the degree of similarity between the third eigenvector and the second eigenvector, that is, the second cosine distance.

[0135] Step A334, determining the semantic similarity of the decomposed words based on the first cosine distance and the second cosine distance.

[0136] In some embodiments, the smallest cosine distance between the first cosine distance and the second cosine distance can be used as a basis for calculating the semantic similarity of the decomposed words. For example, if the first cosine distance is 0.65 and the second cosine distance is 0.41, the semantic similarity of the decomposed words can be determined as 1-0.41=0.59.

[0137] See below for more information Figure 6 , continue with the above step A33 for explanation.

[0138] Step A34, performing weighted summation on the decomposed word text similarity and the decomposed word semantic similarity to obtain the word similarity between the target component expanded word and the standardized word.

[0139] In some embodiments, the word similarity refers to the comprehensive similarity between the target component expanded word and the standardized word in terms of text representation and semantic content. In step A34, the decomposed word text similarity and the decomposed word semantic similarity can be weighted and summed according to a preset weight to obtain the word similarity between the target component expanded word and the standardized word. The preset weight can be the same for both.

[0140] Through step A34, the matching relationship between the target component expanded words and the standardized words can be more accurately evaluated, thereby achieving more accurate term normalization in text processing.

[0141] See below for more information Figure 5 , and the description continues with step A3 above.

[0142] Step A4, determining the standardized word with the highest word similarity as the candidate standardized word for the target component expansion word.

[0143] Through step A4, the alternative standardized word that is semantically closest to the target component expanded word can be accurately found, thereby improving the accuracy of text processing and information matching.

[0144] In some embodiments, after step A4, the target component expansion words and the alternative standardized words corresponding to the target component expansion words can also be stored in a preset word cache table; accordingly, step 1042 can be implemented in the following way: query the alternative standardized words of the target component expansion words from the word cache table; when the alternative standardized words are not found, perform standardized matching on the target component expansion words to obtain the alternative standardized words.

[0145] The preset word cache table is used to temporarily store the target component expansion words and their corresponding alternative standardized words that have been identified and matched after step A4. In step 1042, you can first try to query the alternative standardized words of the target component expansion words from the word cache table. If the query is successful, that is, the previously stored matching results (corresponding alternative standardized words) are found, then this matching result can be used directly. If the query fails, that is, no matching results are found, then it is necessary to perform standardized matching on the target component expansion words to determine its alternative standardized words, and store this new matching result in the word cache table for subsequent query and use.

[0146] Through the embodiments of the present application, it is possible to avoid repeating the same standardized matching process through a word cache table, thereby saving computing resources and time and improving processing efficiency.

[0147] In some embodiments, before step 1042, a preset set of blocked words can also be obtained; when the target component expansion word belongs to a blocked word in the blocked word set, the initial standardized word is determined as the target standardized word, the target component word is determined as the normalized term, and the current subscript expansion step of the target component word subscript sequence is skipped.

[0148] The preset blocked word set is a predefined vocabulary set that contains words (blocked words) that do not need or do not want to be normalized in text processing. The blocked word set can be set by a domain expert or system administrator according to specific application requirements or contextual environments. For example, in the medical field, "3 hypertension" may pass step 1042 and obtain the alternative standardized word "hypertension stage 3", and "3" can only define the stage of hypertension when it is placed after "hypertension", so "3 hypertension" is a blocked word in the blocked word set.

[0149] Through the embodiments of the present application, the additional processing of words that do not require standardized matching can be reduced, while also ensuring the correct processing of these words that do not require standardized matching during the analysis process, thereby improving the efficiency of text processing.

[0150] See below for more information Figure 4 , and the description continues with step 1042 above.

[0151] Step 1043, when the candidate standardized word is the same as the initial standardized word, the initial standardized word is determined as the target standardized word, and the target component word is determined as the normalized term; wherein the initial standardized word is a standardized word obtained by performing standardized matching on the target component word.

[0152] In some embodiments, the initial standardized word refers to the standardized word initially determined after the target component word is standardized and matched. For example, if the target component word extracted from the text to be processed is "bronchitis", then the initial standardized word obtained after the standardized matching can be "bronchitis".

[0153] Step 1043 can verify and confirm the correctness of the initial matching result, thus avoiding processing deviations caused by matching errors or ambiguities.

[0154] Step 1044, when the candidate standardized word is different from the initial standardized word, the candidate standardized word is determined as the target standardized word, and the target component expansion word is determined as the normalized term.

[0155] Through step 1044, the candidate standardized words are obtained by performing standardized matching on the target component expanded words, and the candidate standardized words that provide more accurate and comprehensive standardized information can be determined as the target standardized words, ensuring accurate communication of text information.

[0156] In some embodiments, see Fig. 9 , Figure 4 The shown step 1044 can be implemented through steps 10441 to 10442A or steps 10441 to 10442B, which are described in detail below.

[0157] Step 10441, obtain the current number of subscript extensions.

[0158] In some embodiments, the current number of subscript extensions is obtained by recording each subscript extension operation. After each subscript extension operation is performed, a counter or variable is updated to reflect the current number of extensions.

[0159] Step 10442A, when the alternative standardized word is different from the initial standardized word and the current number of times is less than the extended subscript quantity threshold, the alternative standardized word is determined as the target standardized word, and the target component extended word is determined as the normalized term, and the subscript expansion of the target component word subscript sequence is terminated.

[0160] In some embodiments, when it is detected that the candidate standardized word is inconsistent with the initial standardized word, and the current subscript extension times have not reached the preset extension subscript number threshold, the candidate standardized word will be regarded as the current best choice, that is, the new target standardized word. At the same time, the target component extension word will be set as a normalized term. Finally, further subscript extension of the target component word subscript sequence will be stopped to avoid unnecessary calculations or errors.

[0161] Through step 10442A, unnecessary subscript expansion can be avoided, the correct standardized word can be found more quickly, and the waste of computing resources can be reduced.

[0162] Step 10442B, when the alternative standardized word is different from the initial standardized word and the current number of times is less than the extension subscript quantity threshold, the alternative standardized word is determined as the target standardized word, and the target component expansion term is determined as the normalized term, and the next subscript expansion of the target component word subscript sequence is continued until the current number of times is equal to the extension subscript quantity threshold, and the subscript expansion of the target component word subscript sequence is terminated.

[0163] In some embodiments, when it is detected that the candidate standardized word is inconsistent with the initial standardized word, and the current number of subscript extensions has not reached the preset extended subscript number threshold, the candidate standardized word will be regarded as the current best choice, that is, the new target standardized word. At the same time, the target component extended word will be set as a normalized term. Then, the next subscript extension will be continued for the target component word subscript sequence instead of terminating immediately. This process will be repeated until the current number of subscript extensions reaches the preset extended subscript number threshold.

[0164] Through step 10442B, possible candidate standardized words can be explored more comprehensively, thereby increasing the chance of finding the correct target standardized word and improving the accuracy of determining the standardized word.

[0165] See below for more information Figure 3, and the description continues with step 104 above.

[0166] Step 105 , based on the normalized terms and the target standardized words, text processing is performed on the text to be processed to obtain a processed text.

[0167] In some embodiments, see Fig.10 , Figure 3 The illustrated step 105 may be implemented through steps 1051A to 1053A, which are described in detail below.

[0168] Step 1051A, determining a first preset format for writing the target standardized word.

[0169] In some embodiments, the first preset format is a set of rules or styles predefined to integrate the target standardized words into the text to be processed, so as to ensure the consistency and readability of the target standardized words in the text to be processed, and also make the processed text easier to understand and analyze. The first preset format can be a way of adding the target standardized words to the text to be processed in a symbolic way.

[0170] Step 1052A, write the target standardized word into the text to be processed according to the first preset format to obtain a first intermediate text.

[0171] For example, the format-modified target standardized word "[Acute bronchitis (J20)]" can be added after the normalized term "Acute bronchitis" in the text to be processed "Acute bronchitis is a common respiratory disease" to obtain the first intermediate text "Acute bronchitis [Acute bronchitis (J20)] is a common respiratory disease".

[0172] Step 1053A, using a preset first rendering effect, renders the normalized terms in the first intermediate text and the target standardized words corresponding to the normalized terms to obtain a processed text.

[0173] In some embodiments, the first rendering effect refers to a visual effect applied to some or all characters in the processed text, and is set to enhance the readability, aesthetics or functionality of the processed text. The first rendering effect changes include but is not limited to font color, font style, font size, special effects (such as shadows, glows and reliefs) and interactive design (interactions such as hyperlinks).

[0174] Through steps 1051A to 1053A, the processed text is made more visually attractive. The final processed text not only includes formatted and standardized content, but also looks more professional and easy to understand, which can improve the efficiency and accuracy of information communication.

[0175] In some embodiments, see Fig.11 , Figure 3 The illustrated step 105 may be implemented through steps 1051B to 1052B, which are described in detail below.

[0176] Step 1051B, replace the normalized terms in the text to be processed with target standardized words corresponding to the normalized terms to obtain a second intermediate text.

[0177] For example, the normalized term "acute bronchitis" in the text to be processed "Acute bronchitis is a common respiratory disease" can be replaced with the target standardized word "Acute bronchitis (J20)" to obtain the second intermediate text "Acute bronchitis (J20) is a common respiratory disease".

[0178] Step 1052B, using a preset second rendering effect, renders the target standardized words in the second intermediate text to obtain a processed text.

[0179] In some embodiments, the second rendering effect refers to a visual effect applied to some or all characters in the processed text, which is set to enhance the readability, aesthetics or functionality of the processed text, and the second rendering effect can be the same as the first rendering effect. The second rendering effect changes include but is not limited to font color, font style, font size, special effects (such as shadows, glows and reliefs) and interactive design (interactions such as hyperlinks).

[0180] In some embodiments, see Fig.12 , Figure 3 The illustrated step 105 may be implemented through steps 1051C to 1053C, which are described in detail below.

[0181] Step 1051C, determining a second preset format of input text for generating a pre-trained large language model.

[0182] In some embodiments, the second preset format is a set of specific structures and organizational rules used when preparing input text for pre-training a large language model. The second preset format is designed for the input requirements of the large language model to ensure the quality and consistency of the input data so that the large language model can learn and optimize effectively. For example, a preset prompt text (Prompt) is added to the beginning of the original text. A pre-trained large language model refers to a large language model that is pre-trained on a large-scale text corpus (containing billions of text samples) to obtain a broad understanding of natural language.

[0183] Step 1052C: write the target standardized word into the text to be processed according to the second preset format to obtain a third intermediate text.

[0184] For example, the format-modified target standardized word "(standard word: acute bronchitis)" can be added after the normalized term "acute bronchitis" in the text to be processed "Acute bronchitis is a common respiratory disease", and then the text to be processed can be added with a quotation symbol, and finally "Optimize the following statement:" is added to the beginning of the text to be processed to obtain the third intermediate text "Optimize the following statement: 'Acute bronchitis (standard word: acute bronchitis) is a common respiratory disease'".

[0185] Step 1053C: input the third intermediate text into the large language model, and use the large language model to predict and process the text.

[0186] In some embodiments, after the third intermediate text is input into the large language model, the text returned (predicted) by the large language model can be directly used as the final processed text.

[0187] Through step 105, the text to be processed can be accurately and efficiently processed based on the normalized terms and the target standardized words, which can not only improve the accuracy and efficiency of text processing, but also make the processed text more in line with specific needs or standards. In some application fields such as medicine, finance and law, the processed text obtained after processing can improve the accuracy and consistency of professional terms, thereby reducing misunderstandings and ambiguities, making it easier to understand and retrieve, and helping professionals in related fields to quickly obtain relevant information.

[0188] The following is an explanation of an exemplary application of the embodiments of the present application in a practical application scenario.

[0189] The embodiment of the present application proposes a text processing method, and the embodiment of the present application is mainly used in the field of medical text processing. The application of artificial intelligence technology in the medical field is becoming more and more extensive, especially the application of large language models in the medical field is becoming more and more popular. Large language models can help doctors quickly obtain information and make decisions, improving medical efficiency and quality. For example, large language models can assist doctors in tasks such as disease diagnosis and treatment planning; they can also help patients obtain accurate medical information and guidance, and reduce unnecessary examination and treatment costs. In these scenarios, large language models are faced with the problem of requiring word normalization output. The text processing method proposed in the embodiment of the present application is applied to a question-and-answer system built on a large language model (obtaining a text processing version of the question-and-answer system), and word normalization marking and word normalization replacement can be performed.

[0190] like Fig.13As shown in the figure, when the text processing method provided in the embodiment of the present application is not applied to the question-answering system built based on the large language model (general version question-answering system), the question-answering system can answer the user's questions, but the words used in the reply text are not standard. After the text processing method provided in the embodiment of the present application is applied to the large language model, the effect of the word normalization mark is as follows Fig.14 As shown, it can be seen that the text processing method provided in the embodiment of the present application normalizes the reply text (i.e., the text to be processed) of the question-answering system built based on the large language model, that is, the target standardized words (ICD-10 standard words and ICD-10 standard codes) of all disease / symptom entities are attached to the normalized terms (entity words), which improves the usability of the reply text and facilitates the direct circulation of the reply text in the medical information system. The effect of word normalization replacement is shown in FIG. Fig.15 As shown, Fig.15 The figure also shows the replacement of two standard words. It can be seen that the text processing method provided in the embodiment of the present application rewrites the reply text (i.e., the text to be processed) of the question and answer system built based on the large language model based on the result of word normalization marking. The disease / symptom expressions in the rewritten processed text are replaced with ICD-10 standard words. This improves the professionalism of the reply effect of the question and answer system built based on the large language model, and also improves the user experience of professional doctors when using the question and answer system.

[0191] Fig.16 The schematic diagram of the structure of the text processing version of the question and answer system provided in the embodiment of the present application is shown. The text processing version of the question and answer system first inputs the user question 21 into the general version of the question and answer system 22 for processing, and obtains the output result, that is, the original reply text 23; then the original reply text 23 is input into the term normalization algorithm 24 provided in the embodiment of the present application, and the normalized term and ICD-10 standard word 25 are obtained. The application of this term normalization algorithm 24 to the term cache table 28 can refer to the previous description to reduce the number of times the algorithm is run to improve the efficiency of the algorithm. Thereafter, the subsequent process is carried out according to different usage requirements: according to the usage requirements of the term normalization mark, the normalized term and ICD-10 standard word 25 are directly attached to the first reply text of the general version of the question and answer system 22 for output, and the reply text 26 after the term normalization mark is obtained (such as Fig.14 The effect shown); according to the use requirements of the word normalization mark, the reply text 26 after the word normalization mark is input into the general version question and answer system 22 again for secondary rewriting, and the reply text 27 after the word normalization replacement can be obtained (such as Fig.15 effect shown).

[0192] Fig.17 The effect of the interface application of the term normalization algorithm provided by the embodiment of the present application is shown. Fig.17 The text content shown in the left part of the middle interface is the text to be processed. The "Extract" button corresponds to the aforementioned process of determining the normalized terms, and the "Normalize" button corresponds to the aforementioned process of determining the target standardized words. The right part shows the results of the term normalization algorithm, including the serial number (ID) of the normalized term, the normalized term, the subscript position of the normalized term, the execution result of the term normalization algorithm and the target standardized word.

[0193] The standardized matching process in the embodiment of the present application is applied to the term operation tree. The purpose of the term operation tree is to identify the main components of the terms in the sentence and the relationship between the components. Compared with the syntactic parsing in the general field in the relevant technology, the structure of the term operation tree in the embodiment of the present application is constructed by combining a large number of medical logic rules and terminology vocabularies, and has certain medical rationality in the organizational hierarchical structure. Fig.18 The term operation tree corresponding to the normalized term "paralytic ileus" is shown, and its root node is composed of normalized terms, and the nodes under the root node represent relationship nodes, which represent the relationship between the children under different nodes, and the leaf nodes represent the different analytical components contained in different diseases. For example, "paralytic ileus" contains the anatomical component "intestine", the disease component "obstruction" and the modifying component "paralysis". Since the text to be processed contains a large number of medical professional terms, the embodiment of the present application uses a standard vocabulary to perform standardized matching on the recognized normalized terms, in order to improve the recognition effect and recall rate of the standardized matching process for standardized words. For example, the standardized word corresponding to "obstruction" is "blockage", and the standardized word corresponding to "paralysis" is "paralysis causes".

[0194] The specific construction process of the term operation tree is as follows:

[0195] For any word, it is first necessary to fully parse it and construct a tree structure that conforms to medical rationality (that is, the term operation tree). The embodiment of the present application defines the component types in the term operation tree as: anatomical component (bod), disease component (dis), operation component (ope), modification component (adj), orientation component (dir) and relationship component (rel). Then the target type of word extraction is first performed to identify and locate the relationship components of each word in the text to be processed. The three types of splitting basis of companion / and / or can be identified by dictionary search. Then identify other component types in the text to be processed. Here, the embodiment of the present application can also use the dictionary search method to traverse the disease / anatomy / operation / modification / orientation component types in turn. After obtaining the operation tree structure corresponding to each target component word, the embodiment of the present application can realize term normalization processing by matching the operation tree structure. Therefore, the term normalization processing is transformed from serialized text structure matching to a tree structure matching problem, which can dynamically consider the relationship between different fine-grained components. At the same time, the preset semantically similar word set can also be used to further enrich the text semantics. The standardized matching process is as follows Fig.19 As shown, firstly, leaf nodes of the operation tree decomposition of the normalized term and leaf nodes of the operation tree decomposition of the standardized word are matched one by one, that is, the node granularity is matched to measure the similarity between the two nodes. The embodiment of the present application adopts a matching method based on set traversal comparison, which includes word text similarity based on literal matching and word semantic similarity based on semantic matching.

[0196] For literal matching, the embodiment of the present application enumerates the synonyms contained in the two nodes to calculate the edit distance between the two words, and uses the calculated minimum edit distance as the basis for measuring the text similarity of the two node words. For example, for the two node combinations {tumor, tumor} and {malignant tumor}, the process of enumerating any two node combinations and calculating their edit distance is implemented by the following formula (1):

[0197] (1)

[0198] in, Indicates calculating the edit distance between two words. represents the text similarity of two nodes in the literal text, and min{} represents the minimum value operation. Formula (1) can alleviate the semantic gap problem in literal matching.

[0199] In order to further capture the similarity of nodes at the semantic level, BERT is further used to extract the semantic vector of each node, and the semantic vectors of multiple synonyms are averaged as the semantic vector of each node. The cosine similarity of two node vectors is calculated as the semantic similarity. Finally, the similarity between the two nodes is obtained by averaging the literal score and the semantic score.

[0200] Through the above method, the embodiment of the present application can construct a similarity matrix ,in Represents the normalized term The node pair is the standardized word The similarity matrix of nodes, a represents the number of nodes of normalized terms, b represents the number of nodes of standardized words, R represents the set of real numbers, represents a set of real number matrices with a rows and b columns. In medical scenarios, the same word can act as different components. For example, "hypertension" itself is a disease component, but in the term "hypertensive diabetes" it is a modifying component. Different modifying components represent different meanings and cannot be used as equivalents. That is, "hypertension" and "hypertensive diabetes" represent two completely different diseases. Therefore, in constructing the matrix In the process of integrating medical knowledge, only nodes with the same component type are matched, while nodes with different component types cannot be matched (such as Fig.19 The gray squares in the matrix have a corresponding value of 0, which means the similarity is 0), making the matching results more medically reasonable and more practical.

[0201] Then the matrix is ​​compressed along two dimensions to obtain the eigenvector of each dimension. and , respectively represent the similarity in different directions. This process can be implemented by the following formulas (2) to (5):

[0202] (2)

[0203] (3)

[0204] (4)

[0205] (5)

[0206] in, represents the similarity of the standardized word to the normalized term, The subscript of indicates the number of standardized words, and a indicates the total number of standardized words. represents the similarity of the normalized term to the standard word, The subscript of indicates the number of normalized terms, b indicates the total number of normalized terms, max() indicates the maximum value operation, M indicates the similarity matrix, the first subscript of M indicates the number of normalized terms, and the second subscript of M indicates the number of standardized terms. In the embodiment of the present application, only the similarity of the standardized terms to the normalized terms is considered. Fig.19 As shown, the embodiment of the present application focuses on whether each component / element in the standardized word has a corresponding one in the normalized term.

[0207] Therefore, it can be seen that different corresponding relationships can be observed from the interpretation of different dimensions. In order to comprehensively consider the amount of information in different dimensions, the embodiment of the present application normalizes the similarity of the normalized terms. The average operation is performed to obtain the final word similarity score. This process can be implemented by the following formula (6):

[0208] (6)

[0209] Among them, s represents the normalized term, d represents the standardized word, a represents the total number of standardized words, and score() represents the final word similarity score calculated. Indicates the similarity of the ith standardized word to the normalized term. The embodiment of the present application can adopt the above-mentioned word similarity calculation method to obtain the final target standardized word ranking result by arranging the words from large to small in terms of similarity.

[0210] The embodiment of the present application also provides a term normalization algorithm when implementing the text processing method. The architecture diagram of the term normalization algorithm is as follows: Fig. 20 As shown, the term normalization algorithm includes two components: target component word extraction and term normalization processing.

[0211] The target component word extraction process uses a term operation tree construction method and only identifies disease component types as target component words. , where n is the input text The length of m is the subscript sequence value, and the subscript of m indicates the number of subscript sequence values. The following order of term principal component extraction is performed: Extract the word set of the disease component type , each word in the obtained word set is the length of the target component word, and is the position of the target component word in the normalized term. Fig. 20 As shown, in the exemplary text to be processed "Primary hypertension refers to hypertension without a clear cause", the term operation tree construction method is used to extract "hypertension" in subscripts T4-T6 and "hypertension" in subscripts T16-T18 from the text to be processed.

[0212] The term normalization process adopts an iterative manner to normalize the text to be processed. As Fig. 20 shown, in the embodiments of the present application, two iterative traversal directions, left / right, are first defined, and the left iterative traversal is taken as an example for illustration here.

[0213] Perform the first subscript expansion on the currently obtained target component words. For example, the target component words with subscripts T4-T6 obtain the initial standardized word "hypertension" (S1_1) through standardized matching, and the target component words "hypertension" with subscripts T16-T18 obtain the initial standardized word (S1_2) in the same way.

[0214] Expand one character position to the left to obtain "essential hypertension" corresponding to subscripts T3-T6 and "hypertension" corresponding to subscripts T15-T18, and then perform standardized matching to obtain the corresponding alternative standardized words "hypertension" (S2_1) and "hypertension" (S2_2) respectively.

[0215] If S1_1 is equal to S2_1 or S2_2 is equal to S1_2, it means that the characters added in this subscript expansion do not actually change the standardized matching result, so this alternative standardized word is useless, and the subscript expansion continues to traverse more characters.

[0216] If S1_1 is not equal to S2_1 or S2_2 is not equal to S1_2, it means that the characters added in this subscript expansion actually change the standardized matching result. For example, when expanding to "essential hypertension" with subscripts T1-T6, the standardized matching result changes, and then update the extracted string subscript (the subscript corresponding to the normalized term) and the target standardized word.

[0217] In the embodiments of the present application, the expansion times are set to 3 times (that is, the subscript expansion quantity threshold is preferably 4), and the iteration times can also be adjusted according to the actual application scenario. Take Fig. 20 as an example. After iterating 3 character positions to the left, the embodiments of the present application can obtain the normalized term corresponding to subscripts T1-T6 and the corresponding target standardized word "essential hypertension I10", and the normalized term corresponding to subscripts T16-T18 and the corresponding target standardized word "hypertension".

[0218] In order to avoid additional processing or erroneous processing of words that do not require standardized matching during actual application, an embodiment of the present application provides a set of blocked words, which accumulates words that need to be blocked through user feedback. For example, "3 hypertension" may obtain an alternative standardized word "hypertension stage 3" through the standardized matching process, and "3" can only define the stage of hypertension when it is placed after "hypertension", so "3 hypertension" is a blocked word in the blocked word set. Through the blocked word set, in the above-mentioned term normalization process, when it is expanded to the character string corresponding to the subscript Tn-Tm (n and m are arbitrary values), if the character string already exists in the blocked word set, the standardized matching of this position is skipped. By constructing such a blocked word set, the embodiment of the present application can achieve the shielding of erroneous standardized words faster and at a lower cost.

[0219] In order to improve the efficiency of term normalization processing, the embodiment of the present application also provides a word cache table, which records the mapping relationship between the target component expansion words (the character string corresponding to the expanded subscript position) that do not belong to the set of blocked words and the alternative standardized words corresponding to the target component expansion words. For example, the target component expansion word "high blood pressure" and the alternative standardized word "high blood pressure". When the target component expansion word "high blood pressure" is extracted later, the alternative standardized word can be directly located through the mapping relationship recorded in the word cache table without having to re-perform the standardization matching process. Moreover, as the scale of the word cache table grows, in theory, all possible target component expansion words can be pre-stored, thereby efficiently calculating and calling the term normalization processing.

[0220] The embodiment of the present application also provides a question-and-answer system based on a large language model that applies the above-mentioned text processing method. The question-and-answer system can realize secondary generation of the reply text of the general version of the question-and-answer system using standardized expressions. The embodiment of the present application uses a secondary rewriting generation method based on prompt text (Prompt) to splice the first reply text of the general version of the question-and-answer system with the target standardized words and let the general version of the question-and-answer system regenerate the reply. For example, the second preset format can be designed as follows:

[0221] "You are a medical expert. Please modify the following reply to make it more fluent: <Reply text of the general version of the question-answering system + target standardized words>"

[0222] Among them, the reply text of the general version of the question-and-answer system is the text to be processed.

[0223] If Fig.15For example, the prompt is: "You are a medical expert. Please modify the following response to make it smoother: Based on the symptom information you provided, the most likely diagnosis is [wrist fracture]. In this case, [wrist swelling] [swelling and pain] are common symptoms. The 'bayonet' deformity is a typical manifestation of [body fracture], usually due to [dislocation, injury and strain] of the [body fracture] end. It is recommended that you take this patient to see a doctor as soon as possible for appropriate treatment."

[0224] Depend on Fig.15 It can be seen that the second reply text of the general version of the question-answering system has been replaced with the target standardized words in the corresponding normalized terms.

[0225] The text processing method provided in the embodiment of the present application promotes the question-and-answer system built based on a large language model to provide more professional text replies, improves doctors' acceptance of the medical question-and-answer system built based on a large language model, and improves the user experience.

[0226] The following is a description of an exemplary structure of a text processing device 455 provided in an embodiment of the present application implemented as a software module. In some embodiments, Figure 2 As shown, the software modules stored in the text processing device 455 of the memory 450 may include: an extraction module 4551, which is used to extract words of the target type for the text to be processed in response to a text processing request to obtain a target component word; a subscript sequence acquisition module 4552, which is used to perform subscript marking on all characters of the text to be processed according to the position of each character in the text to be processed in the text to be processed, and obtain a target component word subscript sequence corresponding to the target component word; a subscript extension module 4553, which is used to perform at least one subscript extension on the target component word subscript sequence based on a preset extension subscript number threshold; a normalization module 4554, which is used to perform normalization processing on the target component extension word corresponding to the extension word subscript sequence after each subscript extension to obtain an extension word subscript sequence, and obtain a normalized term containing the target component word and a target standardized word corresponding to the normalized term; the normalized term includes: a term component word corresponding to at least one child node in the term operation tree structure under the target domain; a text processing module 4555, which is used to perform text processing on the text to be processed based on the normalized term and the target standardized word to obtain a processed text.

[0227] In some embodiments, the normalization module 4554 is also used to: extract target component expansion words corresponding to the expansion word subscript sequence from the text to be processed; perform standardized matching on the target component expansion words to obtain alternative standardized words for the target component expansion words; when the alternative standardized words are the same as the initial standardized words, the initial standardized words are determined as the target standardized words, and the target component words are determined as normalized terms; wherein the initial standardized words are standardized words obtained by performing standardized matching on the target component words; when the alternative standardized words are different from the initial standardized words, the alternative standardized words are determined as the target standardized words, and the target component expansion words are determined as normalized terms.

[0228] In some embodiments, the normalization module 4554 is also used to: obtain the current number of subscript extensions; when the alternative standardized word is different from the initial standardized word and the current number is less than the extended subscript number threshold, the alternative standardized word is determined as the target standardized word, and the target component expanded word is determined as the normalized term, and the subscript extension of the target component word subscript sequence is terminated; or, when the alternative standardized word is different from the initial standardized word and the current number is less than the extended subscript number threshold, the alternative standardized word is determined as the target standardized word, and the target component expanded word is determined as the normalized term, and the next subscript extension of the target component word subscript sequence is continued until the current number is equal to the extended subscript number threshold, and the subscript extension of the target component word subscript sequence is terminated.

[0229] In some embodiments, the normalization module 4554 is also used to: perform an operation tree decomposition on the target component expansion word to obtain at least one first decomposition component word; perform an operation tree decomposition on the standardized words in a preset standard vocabulary to obtain at least one second decomposition component word; determine the word similarity between the target component expansion word and the standardized words in the standard vocabulary based on the first decomposition component word and the second decomposition component word; and determine the standardized word with the highest word similarity as the alternative standardized word for the target component expansion word.

[0230] In some embodiments, the normalization module 4554 is also used to: obtain the component type of the first decomposed component word and the component type of the second decomposed component word; based on the component type, perform text matching on the first decomposed component word and the second decomposed component word to obtain the decomposed word text similarity; based on the component type, perform semantic matching on the first decomposed component word and the second decomposed component word to obtain the decomposed word semantic similarity; perform weighted summation on the decomposed word text similarity and the decomposed word semantic similarity to obtain the word similarity between the target component expanded word and the standardized word.

[0231] In some embodiments, the normalization module 4554 is further used to: determine the synonymous extension words of the first decomposed component words based on a preset semantic similarity word set; perform text matching on the first decomposed component words and the second decomposed component words based on the component type to obtain the decomposed word text similarity, including:

[0232] Determine a first edit distance between a first decomposed component word and a second decomposed component word having the same component type; determine a second edit distance between a synonymous extended word and the second decomposed component word having the same component type; and determine the text similarity of the decomposed words based on the smallest edit distance between the first edit distance and the second edit distance.

[0233] In some embodiments, the normalization module 4554 is also used to: perform feature extraction on the first decomposition component words, the second decomposition component words and the synonymous extended words with the same component type, respectively, to obtain the first feature vector of the first decomposition component words, the second feature vector of the second decomposition component words and the third feature vector of the synonymous extended words; determine the first cosine distance between the first feature vector and the second feature vector; determine the second cosine distance between the third feature vector and the second feature vector; and determine the semantic similarity of the decomposed words based on the first cosine distance and the second cosine distance.

[0234] In some embodiments, the normalization module 4554 is also used to: store the target component expansion words and the alternative standardized words corresponding to the target component expansion words in a preset word cache table; query the alternative standardized words of the target component expansion words from the word cache table; when the alternative standardized words are not found, perform standardized matching on the target component expansion words to obtain the alternative standardized words.

[0235] In some embodiments, the normalization module 4554 is also used to: obtain a preset set of blocked words; when the target component expansion word belongs to a blocked word in the blocked word set, determine the initial standardized word as the target standardized word, determine the target component word as the normalized term, and skip the current subscript expansion step of the target component word subscript sequence.

[0236] In some embodiments, the text processing module 4555 is also used to: determine a first preset format for writing target standardized words; write the target standardized words into the text to be processed according to the first preset format to obtain a first intermediate text; use a preset first rendering effect to render the normalized terms in the first intermediate text and the target standardized words corresponding to the normalized terms to obtain a processed text.

[0237] In some embodiments, the text processing module 4555 is also used to: replace the normalized terms in the text to be processed with target standardized words corresponding to the normalized terms to obtain a second intermediate text; use a preset second rendering effect to render the target standardized words in the second intermediate text to obtain a processed text.

[0238] In some embodiments, the text processing module 4555 is also used to: determine a second preset format of the input text for generating a pre-trained large language model; write the target standardized words into the text to be processed according to the second preset format to obtain a third intermediate text; input the third intermediate text into the large language model, and predict the processed text through the large language model.

[0239] The embodiment of the present application provides a computer program product, which includes a computer program or a computer executable instruction, and the computer program or the computer executable instruction is stored in a computer-readable storage medium. The processor of the electronic device reads the computer executable instruction from the computer-readable storage medium, and the processor executes the computer executable instruction, so that the electronic device executes the text processing method described in the embodiment of the present application.

[0240] The present application embodiment provides a computer-readable storage medium in which computer executable instructions or computer programs are stored. When the computer executable instructions or computer programs are executed by a processor, the processor will be caused to execute the text processing method provided by the present application embodiment, for example, Figure 3 The text processing method shown.

[0241] 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 may be various devices including one or any combination of the above memories.

[0242] In some embodiments, computer executable instructions may be in the form of a program, software, software module, script 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 a stand-alone program or as a module, component, subroutine or other unit suitable for use in a computing environment.

[0243] As an example, computer-executable instructions may, but need not, correspond to a file in a file system, may be stored as part of a file storing other programs or data, such as in one or more scripts in a HyperText Markup Language (HTML) document, in a single file dedicated to the program in question, or in multiple coordinated files (e.g., files storing one or more modules, subroutines, or code portions).

[0244] As an example, computer executable instructions may be deployed to be executed on one electronic device, or on multiple electronic devices located at one site, or on multiple electronic devices distributed at multiple sites and interconnected by a communication network.

[0245] To summarize, the embodiment of the present application is to extract target component words from the text to be processed, gradually expand the adjacent characters of the target component words to obtain extended words, match the extended words with standardized words, and then obtain the final professional terms, and perform text processing based on the professional terms. Since the target type of words are directly extracted from the text to be processed by responding to the text processing request, meaningless traversal and analysis are avoided, thereby improving the efficiency of text processing; in the process of term normalization, the entire text is not traversed blindly, but only the characters adjacent to the target component words are traversed according to the position of the target component words in the text to be processed, which greatly reduces the amount of unnecessary processing and further improves the efficiency of text processing; by using the term operation tree structure under the target field as the basis for term normalization, and the term operation tree structure contains the component types of the terms under the field, this makes the term normalization process more accurate; by corresponding the target component words with the child nodes in the term operation tree structure, the accuracy of term normalization can be ensured; by performing multiple subscript expansions according to the position of the target component words in the text to be processed to obtain the corresponding target component expansion words, the context information of the target component words can be taken into account, and the context information is crucial for accurately understanding the meaning and use of the words, especially in some fields (such as medicine, law, etc.), the same word may have different meanings in different contexts, thereby further improving the accuracy of term normalization.

[0246] The above is only an embodiment of the present application and is not intended to limit the protection scope of the present application. Any modifications, equivalent substitutions and improvements made within the spirit and scope of the present application are included in the protection scope of the present application.

Claims

1. A text processing method, characterized in that: include: In response to a text processing request, extracting target-type words from the text to be processed to obtain target component words; According to the position of each character in the text to be processed in the text to be processed, all characters in the text to be processed are subscripted to obtain a target component word subscript sequence corresponding to the target component word; Based on a preset extended subscript quantity threshold, performing at least one subscript extension on the target component word subscript sequence; After each subscript expansion obtains an extended word subscript sequence, extracting a target component extended word corresponding to the extended word subscript sequence from the text to be processed; performing standardized matching on the target component extended word to obtain a candidate standardized word for the target component extended word; When the candidate standardized word is the same as the initial standardized word, the initial standardized word is determined as the target standardized word, and the target component word is determined as the normalized term; wherein the initial standardized word is a standardized word obtained by performing the standardized matching on the target component word; when the candidate standardized word is different from the initial standardized word, the candidate standardized word is determined as the target standardized word, and the target component extended word is determined as the normalized term; the normalized term includes: a term component word corresponding to at least one child node in the term operation tree structure under the target domain; Based on the normalized terms and the target standardized words, text processing is performed on the text to be processed to obtain a processed text.

2. The method according to claim 1, characterized in that When the candidate standardized word is different from the initial standardized word, determining the candidate standardized word as the target standardized word, and determining the target component expanded word as the normalized term, comprises: Get the current number of times the subscript is extended; When the candidate standardized word is different from the initial standardized word and the current number is less than the extended subscript quantity threshold, the candidate standardized word is determined as the target standardized word, the target component extended word is determined as the normalized term, and the subscript extension of the target component word subscript sequence is terminated; or, When the candidate standardized word is different from the initial standardized word and the current number of times is less than the extended subscript quantity threshold, the candidate standardized word is determined as the target standardized word, and the target component expanded word is determined as the normalized term, and the next subscript expansion of the target component word subscript sequence is continued until the current number of times is equal to the extended subscript quantity threshold, and the subscript expansion of the target component word subscript sequence is terminated.

3. The method according to claim 1, characterized in that: The step of performing standardized matching on the target component expanded words to obtain candidate standardized words for the target component expanded words includes: Performing operation tree decomposition on the target component expansion word to obtain at least one first decomposition component word; Performing operation tree decomposition on the standardized words in the preset standard word library to obtain at least one second decomposition component word; Determining the word similarity between the target component expansion word and the standardized words in the standard word library based on the first decomposition component word and the second decomposition component word; The standardized word with the highest word similarity is determined as the candidate standardized word for the target component expansion word.

4. The method according to claim 3, characterized in that The determining, based on the first decomposed component words and the second decomposed component words, the word similarity between the target component expanded words and the standardized words in the standard word library comprises: Obtaining the component type of the first decomposed component word and the component type of the second decomposed component word; Based on the component type, text matching is performed on the first decomposed component word and the second decomposed component word to obtain decomposed word text similarity; Based on the component type, semantic matching is performed on the first decomposed component word and the second decomposed component word to obtain semantic similarity of the decomposed words; The text similarity of the decomposed words and the semantic similarity of the decomposed words are weightedly summed to obtain the word similarity between the target component expanded words and the standardized words.

5. The method according to claim 4, characterized in that Before performing text matching on the first decomposed component words and the second decomposed component words based on the component type to obtain the decomposed word text similarity, the method further includes: Determining, based on a preset semantically similar word set, similarly extending words of the first decomposed component words; The step of performing text matching on the first decomposed component words and the second decomposed component words based on the component type to obtain the decomposed word text similarity includes: determining a first edit distance between the first decomposed component word and the second decomposed component word having the same component type; determining a second edit distance between the synonymous expanded word and the second decomposed component word of the same component type; The decomposed word text similarity is determined based on the smallest edit distance between the first edit distance and the second edit distance.

6. The method according to claim 5, characterized in that The performing semantic matching on the first decomposed component words and the second decomposed component words based on the component type to obtain semantic similarity of the decomposed words includes: Performing feature extraction on the first decomposed component words, the second decomposed component words and the synonymous extended words having the same component type, respectively, to obtain a first feature vector of the first decomposed component words, a second feature vector of the second decomposed component words and a third feature vector of the synonymous extended words; determining a first cosine distance between the first eigenvector and the second eigenvector; determining a second cosine distance between the third eigenvector and the second eigenvector; The semantic similarity of the decomposed words is determined based on the first cosine distance and the second cosine distance.

7. The method according to claim 3, characterized in that After determining the standardized word with the highest word similarity as the candidate standardized word for the target component expansion word, the method further includes: Storing the target component expanded word and the candidate standardized words corresponding to the target component expanded word in a preset word cache table; The step of performing standardized matching on the target component expanded words to obtain candidate standardized words for the target component expanded words includes: Querying the candidate standardized words of the target component extended words from the word cache table; When the candidate standardized word is not found, the target component expanded word is subjected to standardized matching to obtain the candidate standardized word.

8. The method according to claim 1, characterized in that Before performing standardized matching on the target component expanded word to obtain a candidate standardized word for the target component expanded word, the method further includes: Get the preset blocked word set; When the target component expansion word belongs to the blocked word set, the initial standardized word is determined as the target standardized word, the target component word is determined as the normalized term, and the current subscript expansion step of the target component word subscript sequence is skipped.

9. The method according to any one of claims 1 to 8, characterized in that: The step of performing text processing on the text to be processed based on the normalized term and the target standardized word to obtain a processed text includes: determining a first preset format for writing the target standardized word; Writing the target standardized word into the text to be processed according to the first preset format to obtain a first intermediate text; The normalized term in the first intermediate text and the target standardized word corresponding to the normalized term are rendered using a preset first rendering effect to obtain the processed text.

10. The method according to any one of claims 1 to 8, characterized in that: The step of performing text processing on the text to be processed based on the normalized term and the target standardized word to obtain a processed text includes: Replacing the normalized term in the to-be-processed text with the target standardized word corresponding to the normalized term to obtain a second intermediate text; The target standardized words in the second intermediate text are rendered using a preset second rendering effect to obtain the processed text.

11. The method according to any one of claims 1 to 8, characterized in that: The step of performing text processing on the text to be processed based on the normalized term and the target standardized word to obtain a processed text includes: Determining a second preset format of input text for generating a pre-trained large language model; Writing the target standardized word into the text to be processed according to the second preset format to obtain a third intermediate text; The third intermediate text is input into the large language model, and the processed text is predicted by the large language model.

12. A text processing device, characterized in that: The device comprises: An extraction module is used to extract target-type words from the text to be processed in response to a text processing request to obtain target component words; A subscript sequence acquisition module is used to perform subscript marking on all characters of the text to be processed according to the position of each character in the text to be processed in the text to be processed, so as to obtain a target component word subscript sequence corresponding to the target component word; A subscript extension module, configured to perform at least one subscript extension on the target component word subscript sequence based on a preset extended subscript quantity threshold; A normalization module is used to extract target component expansion words corresponding to the expansion word subscript sequence from the text to be processed after each subscript expansion obtains the expansion word subscript sequence; perform standardized matching on the target component expansion words to obtain candidate standardized words for the target component expansion words; when the candidate standardized words are the same as the initial standardized words, the initial standardized words are determined as the target standardized words, and the target component words are determined as the normalized terms; wherein the initial standardized words are standardized words obtained by performing the standardized matching on the target component words; when the candidate standardized words are different from the initial standardized words, the candidate standardized words are determined as the target standardized words, and the target component expansion words are determined as the normalized terms; the normalized terms include: term component words corresponding to at least one child node in the term operation tree structure under the target domain; The text processing module is used to perform text processing on the text to be processed based on the normalized term and the target standardized word to obtain a processed text.

13. An electronic device, characterized in that: include: A memory for storing computer executable instructions; A processor, configured to implement the text processing method according to any one of claims 1 to 11 when executing the computer executable instructions stored in the memory.

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, the text processing method according to any one of claims 1 to 11 is implemented.