Term Processing Method, Apparatus, Electronic Device, Storage Medium, and Program Product
By constructing a term operation tree and analyzing the semantics of the text to be matched using the raster matching model, the problem of unreasonable standard words in medical term standardization is solved, and efficient and accurate standard words determination is achieved.
Patent Information
- Application Number
- CN202210473830.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-29
- Publication Date
- 2025-08-01
- Estimated Expiration
- 2042-04-29
AI Technical Summary
The prior art ignores the medical meaning in the standardization of medical terms, resulting in the determined standard words not being reasonable, and the problem of mismatch in the word order of the text to be matched has not been effectively solved.
By constructing a term operation tree corresponding to the text to be matched, the node similarity in the term operation tree is determined, the semantics of the text to be matched are analyzed using the raster matching model to accurately determine the standard words.
It improves the determination efficiency and accuracy of standard words, adapts to the disorder and randomness of the text to be matched, and provides a standard word explanation of medical rationality.
Smart Images

Figure CN115132372B_ABST
Abstract
Description
Technical Field
[0001] This application relates to artificial intelligence technology, and in particular, to a method, device, electronic device, storage medium, and program product for term processing. Background Art
[0002] Artificial Intelligence (AI) is a comprehensive technology in computer science. By studying the design principles and implementation methods of various intelligent machines, machines are enabled to have functions of perception, reasoning, and decision-making. Artificial intelligence technology is an interdisciplinary subject with a wide range of fields involved, such as natural language processing technology and machine learning / deep learning. With the development of technology, artificial intelligence technology will be applied in more fields and play an increasingly important role.
[0003] Term standardization is an important application of artificial intelligence in natural language processing. Taking the application in the medical field as an example, in the medical term standardization schemes in related technologies, most adopt machine learning or deep learning model algorithms, understanding the medical term standardization task as an ordinary short text matching task, ignoring the medical meaning in the medical term standardization task, resulting in the determined standard words lacking medical rationality and thus having low accuracy. Moreover, for the problem of incorrect matching caused by the disordered word order of the text to be matched, related technologies have no effective solution. Summary of the Invention
[0004] Embodiments of this application provide a method, device, electronic device, computer-readable storage medium, and computer program product for term processing, which can accurately analyze the semantics expressed by the text to be matched, and thus accurately determine the standard word corresponding to the text to be matched.
[0005] The technical solution of the embodiments of this application is implemented as follows:
[0006] Embodiments of this application provide a method for term processing, including:
[0007] Obtain a text to be matched in a specific field and a plurality of first term operation trees; wherein, each of the first term operation trees is pre-constructed based on a standard text in the specific field, and each standard text corresponds to a standard word in the term standard table of the specific field;
[0008] Construct a second term operation tree corresponding to the text to be matched;
[0009] Perform the following processing for each of the first term operation trees:
[0010] Determine a first node in the first term operation tree and a second node of the same type as the first node in the second term operation tree;
[0011] Determine the similarity between the word corresponding to the first node and the word corresponding to the second node; wherein, the first node is any node in the first term operation tree;
[0012] When the value of the similarity meets the value condition, determine the word corresponding to the first node as the standard word of the word corresponding to the second node.
[0013] An embodiment of the present application provides a term processing device, including:
[0014] An acquisition module, configured to acquire a text to be matched in a specific field and a plurality of first term operation trees; wherein, each of the first term operation trees is pre-constructed based on a standard text in the specific field, and each standard text corresponds to a standard word in a term standard table in the specific field;
[0015] A construction module, configured to construct a second term operation tree corresponding to the text to be matched;
[0016] A first determination module, configured to perform the following processing for each of the first term operation trees: determine a first node in the first term operation tree and a second node of the same type as the first node in the second term operation tree;
[0017] A second determination module, configured to determine the similarity between the word corresponding to the first node and the word corresponding to the second node; wherein, the first node is any node in the first term operation tree;
[0018] A third determination module, configured to, when the value of the similarity meets the value condition, determine the word corresponding to the first node as the standard word of the word corresponding to the second node.
[0019] An embodiment of the present application provides an electronic device, including:
[0020] A memory, configured to store executable instructions;
[0021] A processor, configured to implement the term processing method provided by the embodiment of the present application when executing the executable instructions stored in the memory.
[0022] An embodiment of the present application provides a computer-readable storage medium, storing executable instructions, and the executable instructions are used to implement the term processing method provided by the embodiment of the present application when being executed by a processor.
[0023] An embodiment of the present application provides a computer program product, which includes computer instructions stored in a computer-readable storage medium. A processor of an electronic device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the electronic device executes the term processing method described above in the embodiments of the present application.
[0024] The embodiments of the present application have the following beneficial effects:
[0025] By constructing a term operation tree corresponding to the text to be matched, since the data structure of the term operation tree can fully extract the semantics expressed by the text to be matched, the text to be matched can be accurately understood and analyzed, which is convenient for accurately determining the corresponding standard word on the basis of fully understanding the text to be matched; by calculating the similarity between the word corresponding to the first node in the term operation tree corresponding to the text to be matched and the word corresponding to the second node of the same type in the term operation tree corresponding to the standard text, since the similarity of the words corresponding to the nodes of the same type is calculated each time, the efficiency of determining the standard word can be effectively improved; and, since the term operation tree can also adapt to the disorder and randomness of the expression of the text to be matched in different scenarios, the accuracy of the determined standard word can be effectively improved. Description of the Drawings
[0026] Figure 1 is a schematic structural diagram of a term processing system 100 provided by an embodiment of the present application;
[0027] Figure 2 is a schematic structural diagram of a server 200 provided by an embodiment of the present application;
[0028] Figures 3A - 3B is a schematic flowchart of a term processing method provided by an embodiment of the present application;
[0029] Figure 3C is a schematic flowchart of a training method for a grid matching model provided by an embodiment of the present application;
[0030] Figures 3D - 3G is a schematic flowchart of a term processing method provided by an embodiment of the present application;
[0031] Figure 4A is a schematic structural diagram of a grid matching model provided by an embodiment of the present application;
[0032] Figure 4B is a schematic structural diagram of a second term operation tree provided by an embodiment of the present application;
[0033] Figure 4C is a schematic structural diagram of an updated second term operation tree provided by an embodiment of the present application;
[0034] Figure 4DIt is a schematic diagram of the initial cross-operation tree matrix provided by an embodiment of the present application;
[0035] Figure 5A It is a schematic diagram of a medical informatization application scenario provided by an embodiment of the present application;
[0036] Figure 5B It is a schematic diagram of a term processing method provided by an embodiment of the present application;
[0037] Figure 5C It is a schematic structural diagram of a second term operation tree provided by an embodiment of the present application;
[0038] Figure 5D It is a schematic structural diagram of the updated second term operation tree provided by an embodiment of the present application;
[0039] Figure 5E It is a schematic diagram of decoding the second term operation tree provided by an embodiment of the present application;
[0040] Figure 6 It is a schematic diagram of the construction method of the second grid relative position matrix provided by an embodiment of the present application;
[0041] Figure 7 It is a schematic structural diagram of a grid matching model provided by an embodiment of the present application;
[0042] Figure 8 It is a schematic structural diagram of the cross-operation tree matrix provided by an embodiment of the present application. Detailed implementation manners
[0043] In order to make the objectives, technical solutions, and advantages of the present application clearer, the present application will be further described in detail below with reference to the accompanying drawings. The described embodiments should not be construed as limitations on the present application. All other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the scope of protection of the present application.
[0044] In the following description, reference is made to "some embodiments", which describe a subset of all possible embodiments. However, it can be understood that "some embodiments" can be the same subset or different subsets of all possible embodiments, and can be combined with each other without conflict.
[0045] In the following description, the terms "first / second / third" involved are only used to distinguish similar objects and do not represent a specific order for the objects. It can be understood that "first / second / third" can be interchanged with a specific order or sequence when allowed, so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein.
[0046] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those of ordinary skill in the technical field to which this application belongs. The terms used herein are for the purpose of describing embodiments of this application only and are not intended to limit this application.
[0047] It can be understood that in the embodiments of this application, when it comes to data such as user information, when the embodiments of this application are applied to specific products or technologies, user permission or consent needs to be obtained, and the collection, use, and processing of relevant data need to comply with relevant laws, regulations, and standards in relevant countries and regions.
[0048] Before further elaborating on the embodiments of this application, the nouns and terms involved in the embodiments of this application are explained. The nouns and terms involved in the embodiments of this application are subject to the following explanations.
[0049] 1) Term standardization: It is an essential task in medical statistics. Clinically, there are often hundreds or thousands of different expressions for the same diagnosis. The problem that term standardization aims to solve is to find the corresponding standard medical term expressions for various different expressions in clinical practice.
[0050] 2) International Classification Of Diseases (ICD): It is a system established by the World Health Organization (WHO) to classify diseases according to certain characteristics of the diseases and represent them in a coded manner. It is the basis for determining global health trends and statistical data, containing approximately 55,000 unique codes related to injuries, diseases, and causes of death, enabling health practitioners to exchange health information worldwide through a common language.
[0051] 3) Short text matching task: It refers to the task of using a Natural Language Processing (NLP) model to predict the semantic relevance of two short texts, generally using a distance metric in a vector space for matching.
[0052] 4) Calculate Tree: It is a data structure, which is a hierarchical set composed of n (n≥1) finite nodes. Each node in the Calculate Tree has zero or more child nodes. Among them, the node without a parent node is called the root node; each root node has and only has one parent node; except for the root node, each child node can be divided into multiple non-overlapping subtrees.
[0053] 5) Standard terms: Terms stored in the standard table are standard expression methods stipulated to describe a certain thing. They are unified normative expressions for repetitive things, based on the combined results of science and technology and practical experience, and are published in a specific form as the basis and criterion for common compliance. For example, in the medical scenario, standard terms can be the standard expression forms of medical terms in aspects such as diseases, injuries, and drugs. For example, the unified normative expressions published by the World Health Organization for medical terms in aspects such as diseases, injuries, and drugs in the International Classification of Diseases.
[0054] 6) Non-standard terms: Terms that are not yet stored in the standard table are expressions that are not yet unified. For example, in the medical scenario, non-standard terms can be non-standard expression forms of medical terms in aspects such as diseases, injuries, and drugs. For example, non-standard terms can be the colloquial expressions of medical terms in aspects such as diseases, injuries, and drugs by doctors, disease patients, etc.
[0055] The standardization of medical terms is an important technology in the process of medical informatization and also an important cornerstone of medical artificial intelligence. The standardization of medical terms aims to map / normalize the non-standard / mismatched text to be matched into the standard text in the medical standard system.
[0056] In related technologies, most are based on traditional feature engineering and the method of manually constructing features to achieve the standardization of medical terms. Currently, there are mainly the following three implementation methods for the standardization of medical terms.
[0057] 1) First, parse the input non-standard terms, and then perform fuzzy matching processing based on the parsing results. This method will cause the computational complexity of the standardization engine to be too high (the computational complexity is O(n)). Therefore, this method is difficult to meet the actual business scenarios and high-concurrency scenarios.
[0058] 2) Use a variety of literal features (such as word segmentation features, part-of-speech features, character features, context features, glossary features, etc.) to model the probability distribution from non-standard terms to standard terms. This method has poor scalability and has a poor recognition effect for non-standard terms that cannot effectively extract literal features.
[0059] 3) Using the recall sorting method in the short text matching task, first, through the dense semantic feature vectors of non-standard words and standard words, a round of similarity-based recall is performed (achieved based on the distance in the vector space); second, synonyms are added through prior knowledge; finally, a discriminant model is trained for fine sorting to determine the standard word corresponding to the non-standard word. This method ignores the premise that the model needs to meet medical rationality, and the modeling of non-standard words and standard words by the model is also too simple. Therefore, although this method can achieve a high recall rate, it cannot accurately distinguish similar concepts, and thus cannot accurately determine the standard word corresponding to the non-standard word.
[0060] During the implementation process of the embodiments of the present application, the applicant found that most of the medical term standardization solutions in the related art adopt model algorithms of machine learning or deep learning, and understand the medical term standardization task as an ordinary short text matching task, ignoring the medical meaning in the medical term standardization task, resulting in the determined standard words lacking medical rationality and having very low interpretability, and unable to be accepted by doctors or relevant practitioners.
[0061] In addition, the applicant also found that the disordered word order of the text to be matched easily leads to the problem of incorrect matching. For example, the text to be matched such as "chronic peritoneal hemorrhage with a mass" should be appropriately disassembled to meet medical rationality, resulting in "chronic peritoneal hemorrhage with peritoneal mass", and then the model algorithm-based standardization processing flow is performed based on "chronic peritoneal hemorrhage with peritoneal mass". However, in the related art, the standardization process is directly performed based on the original text to be matched. Therefore, it is easy to cause the problem that the determined standard words are inaccurate and unreasonable. That is to say, there is no effective solution to the problem of incorrect matching caused by the disordered word order of the text to be matched in the related art.
[0062] The embodiments of the present application provide a term processing method, device, electronic device, storage medium, and program product, which can accurately analyze the semantics expressed by the text to be matched, so as to accurately determine the standard word corresponding to the text to be matched. The following describes an exemplary application of the electronic device provided in the embodiments of the present application for term processing. The electronic device provided in the embodiments of the present application for term processing can be implemented as various types of user terminals such as a laptop computer, a tablet computer, a desktop computer, a set-top box, and a mobile device (for example, a mobile phone, a portable music player, a personal digital assistant, a dedicated messaging device, a portable game device), or can also be implemented as a server. The following will describe the exemplary application when the electronic device is implemented as a server.
[0063] The term processing method provided in the embodiments of the present application can be completed independently or cooperatively by the terminal or the server. See Figure 1 , Figure 1It is a schematic architecture diagram of the term processing system 100 provided by an embodiment of the present application, including a server 200 and a terminal 400. The terminal 400 is connected to the server 200 through a network 300. The network 300 can be a wide area network, a local area network, or a combination of the two.
[0064] As an example of the intelligent medical record database for the application of the present application in the medical informatization scenario, the terminal 400 can provide a term calibration service. After the terminal 400 receives the medical text to be matched input by the user, the terminal 400 sends the medical text to be matched to the server 200 through the network 300. After receiving the medical text to be matched, the server 200 constructs a second term operation tree corresponding to the medical text to be matched, obtains multiple first term operation trees, determines the similarity between the word corresponding to the first node in the first term operation tree and the word corresponding to the second node of the same type in the second term operation tree. When the value of the similarity meets the value condition, the server 200 determines the word corresponding to the first node as the standard word for the word corresponding to the second node. Then, the server 200 stores the determined medical standard word in the intelligent medical record database. When receiving the same medical text to be matched subsequently, the corresponding medical standard word can be directly obtained from the intelligent medical record database. Then, the server 200 returns the medical standard word to the terminal 400 through the network 300, and the terminal 400 can display the medical standard word corresponding to the medical text to be matched on the human-computer interaction interface.
[0065] In addition, the terminal 400 can also provide a term query service. After the terminal 400 receives the medical text to be queried input by the user, the terminal 400 sends the medical text to be queried to the server 200 through the network 300. After receiving the medical text to be queried, the server 200 first determines the medical standard word corresponding to the medical text to be queried, and then returns the query result related to the medical standard word to the terminal 400. The terminal 400 can display the medical standard word corresponding to the medical text to be queried and the query result related to the medical standard word on the human-computer interaction interface.
[0066] As an example of the unified annotation medical text data interface for the application of the present application in the medical informatization scenario, the terminal 400 can provide an annotation service. After the terminal 400 receives the medical text to be annotated input by the user, the terminal 400 sends the medical text to be annotated to the server 200 through the network 300. After receiving the medical text to be annotated, the server 200 determines the medical standard word actually corresponding to the medical text to be annotated (i.e., the annotation result), and then returns the annotation result to the terminal 400. The terminal 400 can display the annotation result corresponding to the medical text to be annotated on the human-computer interaction interface.
[0067] As an example of the real-time statistics of disease trends in the medical informatization scenario to which the present application is applied, the terminal 400 receives multiple medical texts to be matched input by a developer. The terminal 400 sends the multiple medical texts to be matched to the server 200 through the network 300. After receiving the multiple medical texts to be matched, the server 200 respectively determines the medical standard words corresponding to each medical text to be matched. Then, the server 200 analyzes and statistics the disease trends according to the determined multiple medical standard words to obtain a real-time disease trend analysis result. After that, the server 200 sends the real-time disease trend analysis result to the terminal 400, and the terminal 400 displays the real-time disease trend analysis result on the human-computer interaction interface for the developer to query and analyze.
[0068] As an example of standardizing professional terms in the education informatization scenario to which the present application is applied, the developer inputs a professional text in a specific field (such as architecture) to be matched by operating the human-computer interaction interface of the terminal 400. The terminal 400 sends the professional text in the specific field to be matched to the server 200 through the network 300. After receiving the professional text in the specific field to be matched, the server 200 constructs a second term operation tree corresponding to the professional text in the specific field to be matched, and obtains multiple first term operation trees, determines the similarity between the word corresponding to the first node in the first term operation tree and the word corresponding to the second node of the same type in the second term operation tree. When the value of the similarity meets the value condition, the server 200 determines the word corresponding to the first node as the standard word of the word corresponding to the second node. Then, the server 200 returns the professional standard words in the specific field to the terminal 400 through the network 300, and the terminal 400 can display the professional standard words in the specific field corresponding to the professional text in the specific field to be matched on the human-computer interaction interface.
[0069] As an example of standardizing search keywords in the network search scenario to which the present application is applied, the developer inputs a search key text to be matched by operating the human-computer interaction interface (such as a search engine client interface) of the terminal 400. The terminal 400 sends the search key text to be matched to the server 200 through the network 300. After receiving the search key text to be matched, the server 200 constructs a second term operation tree corresponding to the search key text to be matched, and obtains multiple first term operation trees, determines the similarity between the word corresponding to the first node in the first term operation tree and the word corresponding to the second node of the same type in the second term operation tree. When the value of the similarity meets the value condition, the server 200 determines the word corresponding to the first node as the standard word of the word corresponding to the second node. Then, the server 200 returns the search key standard words to the terminal 400 through the network 300, and the terminal 400 can display the search key standard words corresponding to the search key text to be matched on the human-computer interaction interface.
[0070] In some embodiments, the server 200 may be an independent physical server, a server cluster or a 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, CDN, and big data and artificial intelligence platforms. The terminal 400 may be a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart speaker, a smart watch, etc., but is not limited thereto. The terminal and the server may be directly or indirectly connected through wired or wireless communication means, which is not limited in the embodiments of the present application.
[0071] Next, referring to Figure 2 , Figure 2 is a schematic structural diagram of the server 200 provided by the embodiments of the present application. Figure 2 The server 200 shown includes at least one processor 210, a memory 230, and at least one network interface 220. Each component in the server 200 is coupled together through a bus system 240. It can be understood that the bus system 240 is used to realize the connection and communication between these components. In addition to the data bus, the bus system 240 also includes a power bus, a control bus, and a status signal bus. However, for the sake of clear illustration, in Figure 2 all kinds of buses are labeled as the bus system 240.
[0072] The processor 210 may be an integrated circuit chip with signal processing capabilities, such as a general-purpose processor, a digital signal processor (DSP, Digital Signal Processor), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Among them, the general-purpose processor may be a microprocessor or any conventional processor, etc.
[0073] The memory 230 may be removable, non-removable, or a combination thereof. Exemplary hardware devices include solid-state memories, hard disk drives, optical disc drives, etc. The memory 230 optionally includes one or more storage devices that are physically located far from the processor 210.
[0074] The memory 230 includes volatile memory or non-volatile memory, and may also include both volatile and non-volatile memory. The non-volatile memory may be a read-only memory (ROM, Read Only Memory), and the volatile memory may be a random access memory (RAM, Random Access Memory). The memory 230 described in the embodiments of the present application is intended to include any suitable type of memory.
[0075] In some embodiments, the memory 230 is capable of storing data to support various operations. Examples of such data include programs, modules, and data structures, or subsets or supersets thereof, which are exemplified below.
[0076] The operating system 231 includes system programs for processing various basic system services and performing hardware-related tasks, such as the framework layer, the core library layer, the driver layer, etc., for implementing various basic services and handling hardware-based tasks.
[0077] The network communication module 232 is used to reach other computing devices via one or more (wired or wireless) network interfaces 220. Exemplary network interfaces 220 include: Bluetooth, Wireless Fidelity (WiFi), and Universal Serial Bus (USB), etc.
[0078] In some embodiments, the term processing device provided in the embodiments of the present application may be implemented in software. Figure 2 Shown is the term processing device 233 stored in the memory 230, which may be software in the form of programs and plugins, etc., including the following software modules: an acquisition module 2331, a construction module 2332, a first determination module 2333, a second determination module 2334, and a third determination module 2335. These modules are logical, and thus can be arbitrarily combined or further split according to the functions to be implemented.
[0079] Next, the term processing method provided in the embodiments of the present application will be described in conjunction with the exemplary applications and implementations of the electronic device provided in the embodiments of the present application. It can be understood that the following methods can be executed independently or cooperatively by the terminal 400 or the server 200 described above.
[0080] Before describing the term processing method provided in the embodiments of the present application, first, the lattice matching model (Lattice Transformer based Classifier) used for term processing in the embodiments of the present application will be described. Refer to Figure 4A , Figure 4A is a schematic structural diagram of the lattice matching model provided in the embodiments of the present application.
[0081] As Figure 4A shown, the lattice matching model is a two-tower structure. Each tower structure includes an encoding network, a self-attention network, a first residual network, a feed forward neural network (FNN), and a second residual network; each tower structure constitutes a Transformer network; after the two-tower structure, a classifier is connected, thus constituting the lattice matching model.
[0082] The following will explain Figure 4A The training method of the grid matching model is shown.
[0083] See also Figure 3C , Figure 3C This is a flow chart of the training method of the grid matching model provided in the embodiment of the present application. Figure 3C Steps 201 to 208 are described.
[0084] In step 201, an encoding network is called based on a sample word corresponding to a sample node to perform encoding processing to obtain a sample feature representation of the sample word corresponding to the sample node.
[0085] As an example, a first sample node and a second sample node are respectively used as sample nodes, wherein the first sample node is any node in the first sample term operation tree, the second sample node is any node in the second sample term operation tree, and the first sample node and the second sample node are of the same type.
[0086] As an example, the first sample terminology operation tree is pre-built based on each sample standard text, each sample standard text corresponding to a sample standard word in the terminology standard table of a specific field. The second sample terminology operation tree is built based on the sample text to be matched.
[0087] For example, when the first sample node is used as the sample node, the encoding network is called based on the sample word corresponding to the first sample node to perform encoding processing to obtain the sample feature representation of the sample word corresponding to the first sample node. The encoding processing here can be embedding processing (Embedding), which is used to encode the sample word into a low-dimensional feature representation.
[0088] In some embodiments, the sample standard text corresponding to the first sample terminology operation tree and the sample text to be matched corresponding to the second sample terminology operation tree constitute a positive sample pair or a negative sample pair; wherein, the positive sample pair represents that the sample standard text is the standard text corresponding to the sample text to be matched; the negative sample pair represents that the sample standard text is not the standard text corresponding to the sample text to be matched, and in the terminology standard table, the standard words corresponding to the sample standard text and the standard words corresponding to the standard text corresponding to the sample text to be matched belong to the same level.
[0089] As an example, the sample standard text corresponding to the first sample term operation tree and the sample to-be-matched text corresponding to the second sample term operation tree form a positive sample pair or a negative sample pair.
[0090] When the sample standard text is the standard text corresponding to the sample text to be matched, the sample standard text and the sample text to be matched form a positive sample pair. As an example, the training label corresponding to the positive sample pair is 1, that is, the true similarity between the words in the sample standard text and the words in the sample text to be matched is 1.
[0091] As an example, when the sample text to be matched is a medical text, the standard text corresponding to the sample text to be matched is determined through the annotation of professional doctors, and the determined standard text and the sample text to be matched form a pair of positive sample pairs.
[0092] When the sample standard text is not the standard text corresponding to the sample text to be matched, and in the term standard table, the standard words corresponding to the sample standard text and the standard words corresponding to the standard text corresponding to the sample text to be matched belong to the same level, the sample standard text and the sample text to be matched form a negative sample pair. Among them, the same level can mean that the corresponding number of encoded digits in the term standard table is the same, for example, both are 4 digits.
[0093] As an example, the training label corresponding to the negative sample pair is 0, that is, the true similarity between the words in the sample standard text and the words in the sample text to be matched is 0.
[0094] As an example, see Table 1, which is a schematic diagram of a partial term standard table provided by an embodiment of the present application.
[0095] Table 1 Term Standard Table
[0096]
[0097] Referring to Table 1 above, when the sample text to be matched is "cryptococcosis of the lungs", the corresponding standard text is "pulmonary cryptococcosis". Therefore, the sample text to be matched and "pulmonary cryptococcosis" with the code B45.0 form a pair of positive sample pairs.
[0098] In the term standard table, the standard words belonging to the same level as "pulmonary cryptococcosis" with the code B45.0 include: "cryptococcosis of the brain" with the code B45.1, "coccidioidomycosis of the skin" with the code B45.2, "cryptococcosis of the bone" with the code B45.3, etc. Therefore, here, each sample standard text corresponding to the standard words at the level of the 4-digit code B45.X is respectively paired with the sample text to be matched to form a pair of negative sample pairs.
[0099] By determining positive sample pairs and negative sample pairs in the above manner, and constructing negative sample pairs based on the standard texts where the standard words corresponding to the sample texts to be matched and the standard words of the standard texts corresponding to the samples belong to the same level, rather than randomly selecting sample standard texts to construct negative sample pairs, the quality of negative sample pairs is improved, which is convenient for training a grid matching model with good performance based on high-quality negative samples. At the same time, since the model is trained based on positive sample pairs and negative sample pairs, the accuracy of the trained grid matching model is further improved.
[0100] In step 202, the self-attention network is called based on the sample feature representation for calculation processing to obtain the sample self-attention weights corresponding to the sample feature representation.
[0101] As an example, after obtaining the sample feature representation, the self-attention network is called based on the sample feature representation for calculation processing to obtain the sample self-attention weights corresponding to the sample feature representation. As an example, the self-attention network here can be a multi-head self-attention network.
[0102] In step 203, the first residual network is called based on the sample self-attention weights for calculation processing to obtain the calculation result of the first sample residual network corresponding to the sample feature representation.
[0103] As an example, after obtaining the sample self-attention weights corresponding to the sample feature representation, the first residual network is called based on the sample self-attention weights for calculation processing to obtain the calculation result of the first sample residual network corresponding to the sample feature representation.
[0104] As an example, the first residual network includes an addition module (Add) and a normalization module (Norm). When the first residual network is called based on the sample self-attention weights for calculation processing, first, through the addition module, the sample self-attention weights and the sample feature representation are added to obtain the first sample addition result; then, through the normalization module, the first sample addition result is normalized (for example, layer normalization) to obtain the calculation result of the first sample residual network corresponding to the sample feature representation.
[0105] In step 204, the feed-forward neural network is called based on the calculation result of the first sample residual network corresponding to the sample feature representation for calculation processing to obtain the calculation result of the sample feed-forward neural network corresponding to the sample feature representation.
[0106] As an example, after obtaining the calculation result of the first sample residual network, the feed-forward neural network is called based on the calculation result of the first sample residual network for calculation processing to obtain the calculation result of the sample feed-forward neural network.
[0107] As an example, the feedforward neural network includes a first fully connected layer and a second fully connected layer. The first fully connected layer includes an activation function (such as the rectified linear unit Relu function), and the second fully connected layer does not include an activation function.
[0108] When the feedforward neural network is called for calculation processing based on the calculation result of the first sample residual network, first, the first fully connected layer is called for calculation processing based on the calculation result of the first sample residual network, that is, the calculation result of the first sample residual network and the first weight parameter are multiplied to obtain the first sample multiplication result, and the first sample multiplication result and the second weight parameter are summed to obtain the second sample summation result, and the second sample summation result is used as the calculation result of the first fully connected layer sample.
[0109] Secondly, the second fully connected layer is called for calculation processing based on the calculation result of the first fully connected layer sample, that is, the maximum value between the second sample summation result and the second threshold (i.e., 0) is determined, and the maximum value is multiplied by the third weight parameter to obtain the second sample multiplication result; the second sample multiplication result and the fourth weight parameter are summed to obtain the third sample summation result (i.e., the calculation result of the second fully connected layer sample), and the third sample summation result is determined as the calculation result of the sample feedforward neural network. Among them, the first weight parameter and the second weight parameter are the parameters corresponding to the first fully connected layer; the third weight parameter and the fourth weight parameter are the parameters corresponding to the second fully connected layer.
[0110] In step 205, based on the calculation result of the sample feedforward neural network corresponding to the sample feature representation, the second residual network is called for calculation processing to obtain the calculation result of the second sample residual network corresponding to the sample feature representation.
[0111] As an example, after obtaining the calculation result of the sample feedforward neural network, the second residual network is called for calculation processing based on the calculation result of the sample feedforward neural network to obtain the calculation result of the second sample residual network corresponding to the sample feature representation.
[0112] As an example, the second residual network is the same as the first residual network and also includes a summation module and a normalization module. When the second residual network is called for calculation processing based on the calculation result of the sample feedforward neural network, first, the summation module sums the calculation result of the sample feedforward neural network and the calculation result of the first sample residual network to obtain the fourth sample summation result; then, the normalization module normalizes the fourth sample summation result (for example, layer normalization processing) to obtain the calculation result of the second sample residual network corresponding to the sample feature representation.
[0113] In step 206, a splicing process is performed on the calculation results of the second sample residual network corresponding to the sample feature representation, and a classifier is called based on the splicing result for classification processing to obtain the predicted similarity between the sample word corresponding to the first sample node and the sample word corresponding to the second sample node.
[0114] As an example, after obtaining the calculation results of the second sample residual network corresponding to the sample feature representation corresponding to the first sample node and the calculation results of the second sample residual network corresponding to the sample feature representation corresponding to the second sample node respectively through the above steps 201 - 205, the calculation results of the second sample residual network corresponding to these two sample feature representations are spliced, and a classifier is called based on the splicing result for classification processing to obtain the predicted similarity between the sample word corresponding to the first sample node and the sample word corresponding to the second sample node. Among them, the classifier can be a linear classifier (LinearClassifier) for binary classification processing.
[0115] In step 207, the predicted similarity and the corresponding true similarity are substituted into the loss function for calculation processing to obtain a loss value.
[0116] As an example, after obtaining the predicted similarity between the sample word corresponding to the first sample node and the sample word corresponding to the second sample node, the predicted similarity and the true similarity are substituted into the loss function for calculation to obtain a loss value.
[0117] Among them, when the sample standard text corresponding to the first sample term operation tree and the sample text to be matched corresponding to the second sample term operation tree form a positive sample pair, the true similarity between the sample word corresponding to the first sample node and the sample word corresponding to the second sample node is 1; when the sample standard text corresponding to the first sample term operation tree and the sample text to be matched corresponding to the second sample term operation tree form a negative sample pair, the true similarity between the sample word corresponding to the first sample node and the sample word corresponding to the second sample node is 0.
[0118] As an example, the loss function can be a binary cross - entropy loss function (Binary Cross - Entropy LossFunction), and the calculation formula is as follows:
[0119]
[0120] Among them, m represents the number of node pairs for training, where a first sample node and a second sample node form a node pair; y′ i represents the true similarity between the sample word corresponding to the first sample node and the sample word corresponding to the second sample node, y′ iThe value is 0 or 1. When the sample standard text corresponding to the first sample term operation tree and the sample to-be-matched text corresponding to the second sample term operation tree form a positive sample pair, y′ i The value is 1; when the sample standard text corresponding to the first sample term operation tree and the sample to be matched text corresponding to the second sample term operation tree form a negative sample pair, y′ i The value is 0; y i Indicates the predicted similarity between the sample word corresponding to the first sample node and the sample word corresponding to the second sample node.
[0121] In step 208, the parameters of the classifier, the parameters of the second residual network, the parameters of the feedforward neural network, the parameters of the first residual network, the parameters of the self-attention network, and the parameters of the encoding network are updated based on the loss value during the back propagation process.
[0122] As an example, after the loss value is determined by the above formula 1, during the back propagation process of the grid matching model, the parameters of the classifier, the parameters of the second residual network, the parameters of the feedforward neural network, the parameters of the first residual network, the parameters of the self-attention network, and the parameters of the encoding network are updated based on the loss value.
[0123] Repeat steps 201 to 208 until the loss value reaches a minimum or the maximum number of training times is reached, then terminate the training process and obtain a trained grid matching model.
[0124] By training the grid matching model in the above manner, the trained grid matching model can have good performance, which facilitates accurate term processing based on the grid matching model with good performance, thereby accurately determining the standard words corresponding to the text to be matched.
[0125] The term processing method provided in the embodiments of the present application will be described below with reference to the accompanying drawings.
[0126] See also Figure 3A , Figure 3A This is a flow chart of the term processing method provided in the embodiment of the present application, which will be combined with Figure 3A The steps shown are explained.
[0127] In step 101, a text to be matched in a specific field and a plurality of first term operation trees are obtained.
[0128] For example, specific fields may include medicine, education, and architecture. Taking medicine as an example, the text to be matched in the medical field may be the colloquial expressions of medical terms related to illness, injury, and medication by doctors and patients. Taking architecture as an example, the text to be matched in the architectural field may be the colloquial expressions of certain standard terms.
[0129] As an example, each first-term operation tree is pre-constructed based on a standard text in a specific domain, and each standard text corresponds to a standard word in the term standard table of the specific domain. Taking the medical field as an example, each standard text corresponds to a standard word in Table 1 above.
[0130] In step 102, a second-term operation tree corresponding to the text to be matched is constructed.
[0131] As an example, after obtaining the text to be matched, a second-term operation tree corresponding to the text to be matched is constructed.
[0132] See Figure 3B , Figure 3B is a schematic flowchart of the term processing method provided by the embodiments of the present application. Based on Figure 3A , Figure 3B shown, step 102 can be implemented by step 1021 and step 1022. The following will be described in conjunction with Figure 3B steps 1021 and 1022 shown.
[0133] In step 1021, the text to be matched is split and encoded to obtain the components of the text to be matched.
[0134] As an example, the text to be matched includes multiple semantic components. Therefore, first, the text to be matched is decomposed and encoded to obtain various components of the text to be matched. Among them, the components include adjective components, body part components, root components (for example, disease root components), and logical components.
[0135] As an example, first, the text to be matched is decomposed to obtain the logical component C of the text to be matched, that is, the linking logical component. The three types of logical components of "and / or / with" in the text to be matched can be determined by using a look-up table method. That is, a correspondence table between words and components is established in advance. After obtaining the text to be matched, the text to be matched is decomposed to obtain multiple words, and the components corresponding to the words are queried in the correspondence table according to the obtained words.
[0136] Secondly, the text to be matched is encoded to obtain the adjective component A, body part component B, and root component D of the text to be matched. Here, the adjective component, body part component, and root component of the text to be matched can also be determined by using a look-up table method, and the sequence labeling model can also be called based on the text to be matched for labeling processing to obtain multiple component labels corresponding to the text to be matched, and each component label corresponds to one of the adjective component, body part component, and root component.
[0137] It should be noted that these three components may be nested or partially overlapped. Therefore, they need to be separately and parallelly encoded and recognized to obtain.
[0138] As an example, for the text to be matched M = {m1, m2, m3,..., m n}, where n is the length of the text to be matched M, the following sequential component extraction process (i.e., encoding process) is performed:
[0139] First, taking the root component as the disease root component as an example, the disease root component D = {m n} is extracted from the text to be matched M = {m1, m2, m3,..., m k , m k+1 , m k+2 ,..., m k+l}, where l is the length of the disease root component, and k is the position of the starting word of the disease root component in the text to be matched, 1 ≤ k ≤ n, 0 ≤ l ≤ n - k, and the set {m k , m k+1 , m k+2 ,..., m k+l} represents a disease root component.
[0140] Second, the part component B = {m n} is extracted from the text to be matched M = {m1, m2, m3,..., m r , m r+1 , m r+2 ,..., m r+x}, where x is the length of the part component, and r is the position of the starting word of the part component in the text to be matched, 1 ≤ r ≤ n, 0 ≤ x ≤ n - r, and the set {m r , m r+1 , m r+2 ,..., m r+x} represents a part component.
[0141] Third, the modifying component A = {m n} is extracted from the text to be matched M = {m1, m2, m3,..., m q , m q+1 , m q+2 ,..., m q+w}, where w is the length of the modifying component, and q is the position of the starting word of the modifying component in the text to be matched, 1 ≤ q ≤ n, 0 ≤ w ≤ n - q, and the set {m q , m q+1 , m q+2 ,..., m q+w} represents a modifying component.
[0142] Finally, the obtained disease root component D, site component B, and modification component A are combined to obtain l D , l B , l A , where l D / l B / l A respectively represent the lengths of the D / B / A components, and k D / k B / k A respectively represent the positions of the starting words of the D / B / A components in the text to be matched.
[0143] In step 1022, based on the components of the text to be matched, a second term operation tree corresponding to the text to be matched is constructed.
[0144] As an example, after obtaining the components of the text to be matched, a second term operation tree corresponding to the text to be matched is constructed based on various components of the text to be matched.
[0145] By constructing the second term operation tree in the above manner, since the second term operation tree is constructed based on multiple components of the text to be matched, the constructed second term operation tree can accurately and comprehensively represent the multiple components of the text to be matched, so that the second term operation tree can accurately and comprehensively represent the semantics of the text to be matched.
[0146] See Figure 3B , step 1022 can also be implemented through steps 10221 - 10224. The following will describe steps 10221 - 10224 in conjunction with Figure 3B for illustration.
[0147] In step 10221, the logical component is determined as the root node of the second term operation tree.
[0148] As an example, see Figure 4B , Figure 4B is a schematic structural diagram of the second term operation tree provided by the embodiment of the present application.
[0149] The logical component C in the text to be matched is determined as the root node in the second term operation tree.
[0150] In step 10222, the root component is determined as the intermediate node of the second term operation tree.
[0151] As an example, the root component in the text to be matched is determined as the intermediate node in the second term operation tree. See Figure 4B , taking the root component as the disease root component D as an example, the disease root components D1 and D2 are determined as the intermediate nodes in the second term operation tree, and the intermediate nodes are the child nodes of the root node.
[0152] In step 10223, the part component and the modifying component are determined as the leaf nodes of the second term operation tree.
[0153] As an example, see Figure 4B , the modifying components A1, A2, and A3, as well as the partial component B1 in the text to be matched are determined as the leaf nodes in the second term operation tree, and the leaf nodes are the child nodes of the intermediate nodes.
[0154] In step 10224, the root node, the intermediate nodes, and the leaf nodes are connected according to their respective levels to obtain the second term operation tree corresponding to the text to be matched.
[0155] As an example, after determining the root node, the intermediate nodes, and the leaf nodes, they are connected according to the level of each node. For example, the root node is connected to the intermediate nodes, and the leaf nodes are connected to the intermediate nodes, thereby obtaining the second term operation tree.
[0156] See Figure 4B , the root node C is connected to the intermediate nodes D1 and D2, the intermediate node D1 is connected to the leaf nodes A1, A2, and A3 respectively, and the intermediate node D2 is connected to the leaf node B1, thereby obtaining the second term operation tree.
[0157] As an example, when the text to be matched is "diabetic progressive chronic bleeding with peritoneal mass", where the logical component C is "with"; the disease root components D include "bleeding" and "mass"; the modifying components A corresponding to the disease root component D1 "bleeding" include "diabetic", "progressive", "chronic"; the part component B corresponding to the disease root component D2 "mass" includes "peritoneal", so according to the above steps 10221 - 10224, the second term operation tree as shown on the Figure 4B right side is constructed.
[0158] The construction process of the first term operation tree is similar to that of the second term operation tree and will not be elaborated here. It should be noted that the first term operation tree may only include the root node and the intermediate nodes, and when the logical component is not included in the standard text, the logical component corresponding to the root node in the corresponding first term operation tree is empty.
[0159] By taking each component included in the text to be matched as a node in the second term operation tree and connecting the nodes according to the levels of the nodes, the second term operation tree is obtained, so that the second term operation tree can not only express each component included in the text to be matched, but also express the relationships between the components, thereby enabling the second term operation tree to completely and comprehensively express the semantics of the text to be matched and the associated relationships between the semantics.
[0160] In some embodiments, when the second term operation tree includes a first intermediate node and a second intermediate node, after obtaining the second term operation tree corresponding to the text to be matched, when there are multiple first leaf nodes in the first intermediate node, the multiple first leaf nodes are respectively connected to the second intermediate node to obtain an updated second term operation tree; wherein, the modifying component or part component corresponding to the first leaf node is not possessed by the root component corresponding to the second intermediate node.
[0161] As an example, after obtaining the second term operation tree, the second term operation tree can be expanded (Tree - expanding) to obtain an updated second term operation tree.
[0162] As an example, the updated second term operation tree is obtained in the following way: if the second term operation tree includes a first intermediate node and a second intermediate node, when there are multiple first leaf nodes in the first intermediate node, the multiple first leaf nodes are respectively connected to the second intermediate node to obtain an updated second term operation tree; wherein, the modifying component or part component corresponding to the first leaf node is not possessed by the root component corresponding to the second intermediate node.
[0163] See Figure 4C , Figure 4C is a schematic structural diagram of the updated second term operation tree provided by the embodiments of the present application.
[0164] Figure 4C The second term operation tree shown on the left is the same as Figure 4B the second term operation tree described on the left. The intermediate nodes of the second term operation tree include disease root components D1 and D2. Among them, there are 3 leaf nodes for D1, and these 3 leaf nodes all correspond to modifying components, while there is no modifying component for the disease root component D2. Therefore, these 3 leaf nodes can be transferred to D2, that is, these 3 leaf nodes are respectively connected to node D2. As an example, one or more of these 3 leaf nodes can also be connected to node D2. Figure 4C The situation shown on the right is that 2 leaf nodes A1 and A2 among them are connected to node D2 to obtain an updated second term operation tree.
[0165] By expanding the second term operation tree to obtain an updated second term operation tree, it can adapt to different writing norms of doctors or relevant workers in real scenarios, as well as the large number of ellipses in natural language, so as to be able to meet the business needs of real scenarios to the greatest extent and further explore the comprehensive semantics of the text to be matched.
[0166] In some embodiments, after obtaining the second term operation tree, the second term operation tree may be decoded to obtain the text to be matched. It should be noted that the order between sibling components is not considered for the text to be matched obtained through the decoding process.
[0167] For example, Figure 4B performing a decoding process on the second term operation tree shown on the right, the text to be matched obtained may be one of diabetic / progressive / chronic / bleeding / with / peritoneal / mass, diabetic / chronic / progressive / bleeding / with / peritoneal / mass, progressive / diabetic / chronic / bleeding / with / peritoneal / mass. Thus, since the order between sibling components is not considered for the text to be matched obtained by decoding the second term operation tree, converting the text to be matched into a term operation tree structure can effectively solve the problems of disorder and randomness in the expression of the text to be matched in different scenarios.
[0168] In step 103, determine the first node in the first term operation tree and the second node of the same type as the first node in the second term operation tree.
[0169] As an example, after obtaining the second term operation tree, for each first term operation tree, determine the first node in each first term operation tree and the second node of the same type as the first node in the second term operation tree. Here, the first node is any node in the first term operation tree.
[0170] As an example, the same type here may indicate that the types of the components corresponding to the first node and the second node are the same. For example, when the type of the component corresponding to the first node is the root component type, the type of the component corresponding to the second node is also the root component type.
[0171] In step 104, determine the similarity between the word corresponding to the first node and the word corresponding to the second node.
[0172] As an example, after determining the first node and the second node, determine the similarity between the word corresponding to the first node and the word corresponding to the second node.
[0173] It should be noted that the word corresponding to the first node is the component corresponding to the first node. As Figure 4B shown on the right, the component corresponding to an intermediate node is the disease root component "bleeding", which is equivalent to the word corresponding to this intermediate node being "bleeding".
[0174] In some embodiments, the similarity between the word corresponding to the first node and the word corresponding to the second node may be determined based on the grid matching model trained above. This will be described below with reference to the accompanying drawings.
[0175] SeeFigure 3D , Figure 3D is a schematic flowchart of a term processing method provided by an embodiment of the present application. In some embodiments, based on Figure 3A , Figure 3D the steps 104 shown can be implemented by steps 1041 - 1046. The following will be described in conjunction with Figure 3D the steps 1041 - 1046 shown.
[0176] In step 1041, based on the word corresponding to the target node, the encoding network is called for encoding processing to obtain the target feature representation of the word corresponding to the target node.
[0177] As an example, the first node and the second node are respectively used as the target nodes, and then based on the word corresponding to the target node, the encoding network is called for encoding processing to obtain the target feature representation of the word corresponding to the target node. That is to say, the word corresponding to the target node is encoded into a low-dimensional feature representation through the encoding network.
[0178] In step 1042, based on the target feature representation, the self-attention network is called for calculation processing to obtain the target self-attention weight corresponding to the target feature representation.
[0179] As an example, after obtaining the target feature representation of the word corresponding to the target node, the self-attention network is called for self-attention calculation processing based on the target feature representation to obtain the target self-attention weight corresponding to the target feature representation.
[0180] See Figure 3E , Figure 3E is a schematic flowchart of a term processing method provided by an embodiment of the present application. In some embodiments, based on Figure 3D , Figure 3E the steps 1042 shown can be implemented by steps 10421 - 10422. The following will be described in conjunction with Figure 3E the steps 10421 - 10422 shown.
[0181] In step 10421, based on the target feature representation and the target grid relative position matrix corresponding to the target feature representation, the self-attention network is called for calculation processing to obtain the first self-attention weight corresponding to the target feature representation.
[0182] As an example, when determining the target self-attention weight corresponding to the target feature representation, first, based on the target feature representation and the target grid relative position matrix (Lattice Relative Position Matrix) corresponding to the target feature representation, the self-attention network is called for self-attention calculation processing to obtain the first self-attention weight.
[0183] Among them, the target grid relative position matrix is determined based on the term operation tree corresponding to the target node. When the target node is the first node, the target grid relative position matrix is determined based on the first term operation tree; when the target node is the second node, the target grid relative position matrix is determined based on the second term operation tree.
[0184] In some embodiments, the target grid relative position matrix is constructed in the following manner: based on the hierarchical levels and path relationships of nodes i and j in the target term operation tree, determine the path distance between nodes i and j; determine the value of the matrix element (i, j) of the target grid relative position matrix as the path distance; where, when the target node is the first node, the target term operation tree is the first term operation tree, and when the target node is the second node, the target term operation tree is the second term operation tree; 1 ≤ i ≤ N, 1 ≤ j ≤ N, and N is the number of nodes included in the target term operation tree.
[0185] As an example, when the target node is the first node, the target term operation tree is the first term operation tree. Based on the hierarchical levels and path relationships of nodes i and j in the first term operation tree, determine the path distance between these two nodes, and determine the value of the matrix element (i, j) of the target grid relative position matrix as the path distance. Among them, 1 ≤ i ≤ N, 1 ≤ j ≤ N, and N is the number of nodes included in the first term operation tree.
[0186] When the target node is the second node, the target term operation tree is the second term operation tree. Based on the hierarchical levels and path relationships of nodes i and j in the second term operation tree, determine the path distance between these two nodes, and determine the value of the matrix element (i, j) of the target grid relative position matrix as the path distance. Among them, 1 ≤ i ≤ N, 1 ≤ j ≤ N, and N is the number of nodes included in the second term operation tree.
[0187] Since the matrix element of the target grid relative position matrix is the path distance between two nodes, and the path distance is determined based on the hierarchical levels and path relationships between nodes, the target grid relative position matrix can accurately reflect the structure of the corresponding target term operation tree and can effectively utilize the information of the target term operation tree.
[0188] In some embodiments, based on the levels and path relationships of nodes i and j in the target term operation tree, the path distance between nodes i and j is determined as follows: When nodes i and j belong to the same level, the first threshold is determined as the path distance between nodes i and j; when nodes i and j do not belong to the same level and have no path relationship, the first threshold is determined as the path distance between nodes i and j; when nodes i and j do not belong to the same level and have a path relationship, the number of levels between nodes i and j is determined as the path distance between nodes i and j.
[0189] As an example, when determining the path distance between nodes i and j, if nodes i and j belong to the same level, then there is no path relationship between nodes i and j, that is, nodes i and j are not reachable from each other. Therefore, the first threshold is determined as the path distance between nodes i and j. As an example, the first threshold can be infinity (INF).
[0190] For example, referring to Figure 4B the second term operation tree shown on the left, nodes D1 and D2 both belong to the intermediate node level. Therefore, there is no path relationship between these two nodes. Therefore, INF is determined as the path distance between nodes D1 and D2.
[0191] If nodes i and j do not belong to the same level and have no path relationship, it is equivalent to that nodes i and j are not reachable from each other. Therefore, the first threshold is determined as the path distance between nodes i and j.
[0192] For example, referring to Figure 4B the second term operation tree shown on the left, nodes D1 and B1 belong to the intermediate node level and the leaf node level respectively, but there is no path relationship between nodes D1 and B1. Therefore, INF is determined as the path distance between nodes D1 and B1.
[0193] If nodes i and j do not belong to the same level and have a path relationship, then the number of levels between nodes i and j is determined as the path distance between nodes i and j.
[0194] For example, referring to Figure 4B the second term operation tree shown on the left, nodes C and A1 belong to the root node level and the leaf node level respectively, and there is a path C->D1->A1 between nodes C and A1. Therefore, the number of levels 2 between nodes C and A1 is determined as the path distance between nodes C and A1.
[0195] It should be noted that if the target grid relative position matrix is determined based on the expanded term operation tree, then for the element (i, j) in the target grid relative position matrix, if there is no path relationship between node i and node j in the term operation tree before expansion, but there is a path relationship between node i and node j in the updated term operation tree obtained after expansion, then the third threshold is determined as the path distance between node i and node j. For example, the third threshold can be 0.5.
[0196] For example, refer to Figure 4C , Figure 4C In the second term operation tree before expansion shown on the left, there is no path relationship between node A2 and node D2, and these two nodes do not belong to the same level. Therefore, the first threshold (for example, INF) is used as the path distance between node A2 and node D2. In the updated second term operation tree obtained after expansion, there is a path relationship between node A2 and node D2. Therefore, the third threshold (for example, 0.5) is used as the path distance between node A2 and node D2.
[0197] By determining the path distance between nodes based on the level and path relationship between nodes, the path distance can accurately reflect the level and path relationship between each two nodes, so that the target grid relative position matrix with the path distance as the matrix element can accurately reflect the structural information of the corresponding target term operation tree.
[0198] Refer to Figure 3E , step 10421 can be implemented through steps 104211 - 104212. Below, it will be described in conjunction with Figure 3E Steps 104211 - 104212 will be described.
[0199] In step 104211, based on the target feature representation and the target grid relative position matrix corresponding to the target feature representation, a multi-head self-attention network is called to perform self-attention calculation processing to obtain the self-attention weight corresponding to each head.
[0200] As an example, the self-attention network in the embodiments of the present application is a multi-head self-attention network. When calculating the target self-attention weight corresponding to the target feature representation, first, based on the target feature representation and the target grid relative position matrix corresponding to the target feature representation, a multi-head self-attention network is called to perform self-attention calculation processing to obtain the self-attention weight corresponding to each head.
[0201] As an example, the calculation formula for the self-attention weight corresponding to each head is as follows:
[0202]
[0203] Where Denotes the transposed vector of the target feature representation, W k,E and W k,R as well as u and v all denote learnable weight parameters, Denotes the feature representation of the word corresponding to node j, R i-j Denotes the value of the matrix element (i, j) in the target grid relative position matrix, where nodes i and j are nodes in the same term operation tree.
[0204] In step 104212, the self-attention weights corresponding to each head are concatenated, and a linear transformation is performed on the obtained concatenated result, and the result of the linear transformation is determined as the first self-attention weight corresponding to the target feature representation.
[0205] As an example, after obtaining the self-attention weights corresponding to each head, the self-attention weights corresponding to each head are concatenated to obtain a concatenated result, and then a linear transformation is performed on the concatenated result, and the obtained result of the linear transformation is determined as the first self-attention weight corresponding to the target feature representation.
[0206] As an example, the calculation formula for the first self-attention weight is as follows:
[0207] Att1(A, V) = softmax(A)V Formula 3
[0208] where Att1(A, V) represents the first self-attention weight, A represents the concatenated result obtained by concatenating the self-attention weights of each head A ij after concatenation processing, softmax is an activation function used to perform a linear transformation on the concatenated result, and V is the weight parameter of the multi-head self-attention network, and its calculation formula is as follows:
[0209]
[0210] where, Denotes the target feature representation, W v Denotes a learnable weight parameter.
[0211] Determining the first self-attention weight corresponding to the target feature representation in the above manner can make the determined first self-attention weight more accurately measure the importance of the target feature representation, and at the same time facilitate accurately determining the target self-attention weight based on the accurate first self-attention weight.
[0212] In step 10422, based on the first self-attention weight and the initial cross-operation tree matrix, the self-attention network is called for calculation processing to obtain the target self-attention weight corresponding to the target feature representation.
[0213] As an example, after determining the first self-attention weight, based on the first self-attention weight and the initial cross-operation tree matrix, the self-attention network is called to perform self-attention calculation processing, so as to obtain the target self-attention weight corresponding to the target feature representation.
[0214] Among them, the cross-operation tree matrix includes a plurality of matrix elements corresponding one-to-one to a plurality of node pairs. The matrix elements represent the similarity between the words corresponding to the two nodes in the node pair. The types of the two nodes are the same, and one of the nodes comes from the first term operation tree, and the other node comes from the second term operation tree.
[0215] See Figure 4D , Figure 4D is a schematic diagram of the initial cross-operation tree matrix provided by the embodiments of the present application. Among them, the row coordinates of the initial cross-operation tree matrix are the nodes in the first term operation tree, the column coordinates are the nodes in the second term operation tree, and each matrix element in the matrix represents the similarity between the words corresponding to the corresponding two nodes. Among them, 0.0 represents the initialization value, which will be updated numerically as the model is calculated; NA means that the weight is artificially fixed at 0.0 and no longer updated. In this way, it can be ensured that only the words corresponding to the nodes of the same type between the two term operation trees will perform similarity calculation. For example, calculate the similarity of the C components corresponding to the term operation tree X (that is, the first term operation tree described above) and the term operation tree Y (that is, the second term operation tree described above), and calculate the similarity of the corresponding D components, such as calculating the similarities between XD1 / YD1, XD1 / YD2, XD2 / YD1, and XD2 / YD2 respectively.
[0216] As an example, the calculation formula of the target self-attention weight is as follows:
[0217]
[0218] Among them, Att(A, V) represents the target self-attention weight, softmax represents the activation function, Att1 represents the first self-attention weight, C represents the initial cross-operation tree matrix, represents the weight parameter corresponding to the initial cross-operation tree matrix, and V represents the weight parameter of the self-attention network.
[0219] By determining the target self-attention weight corresponding to the target feature representation based on the target grid relative position matrix corresponding to the target feature representation and the initial cross-operation tree matrix, since the target grid relative position matrix can reflect the hierarchy and connection relationship of the target term operation tree, and the initial cross-operation tree matrix can reflect the spatial similarity between the two term operation trees, therefore, the target self-attention weight calculated in this way can more accurately measure the importance degree of the target feature representation.
[0220] In step 1043, based on the target self-attention weights, the first residual network is called for computational processing to obtain the first target residual network calculation result corresponding to the target feature representation.
[0221] As an example, after obtaining the target self-attention weights, the first residual network is called based on the target self-attention weights for computational processing to obtain the first target residual network calculation result corresponding to the target feature representation.
[0222] See Figure 3F , Figure 3F is a schematic flowchart of the term processing method provided by an embodiment of the present application. In some embodiments, based on Figure 3D , Figure 3F The step 1043 shown can also be implemented through step 10431 and step 10432. The following will be described in conjunction with Figure 3F the steps 10431-10432 shown.
[0223] In step 10431, based on the target self-attention weights and the target feature representation, the first residual network is called for summation processing to obtain the first target summation result.
[0224] As an example, when determining the first target residual network calculation result, first, based on the target self-attention weights and the target feature representation, the first residual network is called for summation processing to obtain the first target summation result.
[0225] As an example, the first residual network includes a summation module and a normalization module. Therefore, here, the target self-attention weights and the target feature representation are summed through the summation module to obtain the first target summation result.
[0226] In step 10432, the first target summation result is normalized to obtain the first target residual network calculation result corresponding to the target feature representation.
[0227] As an example, after obtaining the first target summation result, the first target summation result is normalized (e.g., layer normalization processing) through the normalization module to obtain the first target residual network calculation result corresponding to the target feature representation.
[0228] Through the above method, the accuracy of the determined first target residual network calculation result can be improved, facilitating subsequent calculations based on the accurate first target residual network calculation result.
[0229] In step 1044, based on the first target residual network calculation result corresponding to the target feature representation, the feed-forward neural network is called for computational processing to obtain the target feed-forward neural network calculation result corresponding to the target feature representation.
[0230] As an example, after obtaining the calculation result of the first target residual network, based on the calculation result of the first target residual network, a feedforward neural network is called for calculation processing to obtain the calculation result of the target feedforward neural network corresponding to the target feature representation.
[0231] In some embodiments, the feedforward neural network includes a first fully connected layer and a second fully connected layer. Based on the calculation result of the first target residual network corresponding to the target feature representation, a feedforward neural network is called for calculation processing to obtain the calculation result of the target feedforward neural network corresponding to the target feature representation, which is implemented in the following manner: Based on the calculation result of the first target residual network, the first fully connected layer is called for calculation processing to obtain the target calculation result of the first fully connected layer; Based on the target calculation result of the first fully connected layer, the second fully connected layer is called for calculation processing, and the target calculation result of the second fully connected layer obtained is determined as the calculation result of the target feedforward neural network corresponding to the target feature representation.
[0232] As an example, when determining the calculation result of the target feedforward neural network, first, based on the calculation result of the first target residual network, the first fully connected layer is called for calculation processing, that is, the calculation result of the first target residual network and the first weight parameter are multiplied to obtain the first target multiplication result, and the first target multiplication result and the second weight parameter are summed to obtain the third target summation result, and the third target summation result is used as the target calculation result of the first fully connected layer.
[0233] Secondly, based on the target calculation result of the first fully connected layer, the second fully connected layer is called for calculation processing, that is, the maximum value between the third target summation result and the second threshold (i.e., 0) is determined, the maximum value is multiplied by the third weight parameter to obtain the second target multiplication result; the second target multiplication result and the fourth weight parameter are summed to obtain the fourth target summation result (i.e., the target calculation result of the second fully connected layer), and the fourth target summation result is determined as the calculation result of the target feedforward neural network. Wherein, the first weight parameter and the second weight parameter are the parameters corresponding to the first fully connected layer; the third weight parameter and the fourth weight parameter are the parameters corresponding to the second fully connected layer.
[0234] As an example, the calculation formula of the calculation result of the target feedforward neural network is as follows:
[0235] FNN(x)=max(0,xW1+b1)W2+b2 Formula 6
[0236] Wherein, x represents the calculation result of the first target residual network, W1 (i.e., the first weight parameter above) and b1 (i.e., the second weight parameter above) are the parameters of the first fully connected layer, and W2 (i.e., the third weight parameter above) and b2 (i.e., the fourth weight parameter above) are the parameters of the second fully connected layer.
[0237] In the above manner, the accuracy of the calculation result of the determined target feedforward neural network can be improved, facilitating subsequent calculations based on the accurate calculation result of the target feedforward neural network.
[0238] In step 1045, based on the calculation result of the target feedforward neural network corresponding to the target feature representation, the second residual network is called for calculation processing to obtain the calculation result of the second target residual network corresponding to the target feature representation.
[0239] As an example, after obtaining the calculation result of the target feedforward neural network, the second residual network is called for calculation processing based on the calculation result of the target feedforward neural network to obtain the calculation result of the second target residual network corresponding to the target feature representation.
[0240] See Figure 3G , Figure 3G is a schematic flowchart of the term processing method provided by the embodiments of the present application. In some embodiments, based on Figure 3D , Figure 3G shown, step 1045 can also be implemented through step 10451 and step 10452. The following will be described in conjunction with Figure 3G shown step 10451-step 10452.
[0241] In step 10451, based on the calculation result of the target feedforward neural network and the calculation result of the first target residual network, the second residual network is called for summation processing to obtain the second target summation result.
[0242] As an example, when determining the calculation result of the second target residual network, first, based on the calculation result of the target feedforward neural network and the calculation result of the first target residual network, the second residual network is called for summation processing to obtain the second target summation result.
[0243] Similar to the first residual network, the second residual network also includes a summation module and a normalization module. Therefore, here, the summation module is used to perform summation processing on the calculation result of the target feedforward neural network and the calculation result of the first target residual network to obtain the second target summation result.
[0244] In step 10452, the second target summation result is normalized to obtain the calculation result of the second target residual network corresponding to the target feature representation.
[0245] As an example, after obtaining the second target summation result, the second target summation result is normalized (for example, layer normalization processing) through the normalization module to obtain the calculation result of the second target residual network corresponding to the target feature representation.
[0246] The accuracy of the calculation result of the determined second target residual network can be improved through the above method, which is convenient for subsequent calculations based on the accurate calculation result of the second target residual network.
[0247] In step 1046, the calculation results of the second target residual network corresponding to the target feature representation are concatenated, and a classifier is called based on the concatenation result for classification processing to obtain the similarity between the word corresponding to the first node and the word corresponding to the second node.
[0248] As an example, after determining the calculation results of the second target residual network corresponding to the target feature representation corresponding to the first node and the calculation results of the second target residual network corresponding to the target feature representation corresponding to the second node through the above steps 1041 - 1045, the two calculation results of the second target residual network are concatenated to obtain a concatenation result, and a classifier is called based on the concatenation result for classification processing to obtain the similarity between the word corresponding to the first node and the word corresponding to the second node.
[0249] As an example, the classifier here is a binary classifier that only outputs two values, 0 or 1. When the output result of the classifier is 1, it indicates that the similarity between the word corresponding to the first node and the word corresponding to the second node is 1, that is, the word corresponding to the first node and the word corresponding to the second node match; when the output result of the classifier is 0, it indicates that the similarity between the word corresponding to the first node and the word corresponding to the second node is 0, that is, the word corresponding to the first node and the word corresponding to the second node do not match.
[0250] By determining the similarity between the word corresponding to the first node and the word corresponding to the second node based on the trained grid matching model, since the trained grid matching model effectively utilizes the correlation relationship between different components in the text to be matched, compared with the method of directly matching the original text to be matched, it can more effectively analyze and understand the semantics expressed in the text to be matched, so as to more accurately determine the standard word corresponding to the text to be matched, and can also make the determined standard word more reasonable.
[0251] In some embodiments, the similarity between the word corresponding to the first node and the word corresponding to the second node can also be determined by cosine similarity and literal edit distance.
[0252] As an example, the words corresponding to the first node and the second node are respectively encoded to obtain the word vector of the word corresponding to the first node and the word vector of the word corresponding to the second node. The similarity between the word corresponding to the first node and the word corresponding to the second node is determined by calculating the cosine distance between the two word vectors. Moreover, the greater the cosine distance between the two word vectors, the higher the corresponding similarity.
[0253] As an example, the literal edit distance represents the minimum number of operations required to convert one word into another, where the operations include insertion, substitution, and deletion. For example, if the word corresponding to the first node is "lung" and the word corresponding to the second node is "lungs", then the literal edit distance between the word corresponding to the first node and the word corresponding to the second node is 1, that is, adding one insertion operation to "lung" can obtain "lungs". Therefore, the similarity between the word corresponding to the first node and the word corresponding to the second node can be measured based on the literal edit distance, and the smaller the value of the literal edit distance, the higher the corresponding similarity.
[0254] In some embodiments, after obtaining the similarity between the word corresponding to the first node and the word corresponding to the second node, the matrix element at the first position in the initial cross-operation tree matrix is updated to the similarity; wherein, the row coordinate of the first position is the first node, and the column coordinate of the first position is the second node.
[0255] As an example, after determining the similarity between the word corresponding to the first node and the word corresponding to the second node, the matrix element at the first position in the initial cross-operation tree matrix is updated to the similarity, where the row coordinate of the first position is the first node, and the column coordinate of the first position is the second node.
[0256] For example, see Figure 4D , in the case where the first node is XD1 and the second node is YD1, if the determined similarity between the word corresponding to XD1 and the word corresponding to YD1 is 0, then the value of (XD1, YD1) in the initial cross-operation tree matrix is updated to 0.
[0257] It should be noted that the updated cross-operation tree matrix will be used to calculate the similarity of the words corresponding to the next node pair. After calculating the similarity of the words corresponding to the next node pair, the updated cross-operation tree matrix will also be updated again according to the similarity. This process is repeated until the updated cross-operation tree matrix is finally updated based on the similarity of the words corresponding to the last node pair to obtain the final cross-operation tree matrix. The final cross-operation tree matrix can intuitively reflect the spatial similarity between the first term operation tree and the second term operation tree, thus facilitating developers to intuitively judge which components in the first term operation tree and the second term operation tree match successfully based on the cross-operation tree matrix, and thus bringing better interpretability to the matching result.
[0258] By updating the matrix elements of the initial cross-operation tree matrix based on the similarity between the word corresponding to the first node and the word corresponding to the second node, it is convenient to intuitively determine the spatial similarity between the first term operation tree and the second term operation tree based on the updated cross-operation tree matrix.
[0259] In step 105, when the value of the similarity meets the value condition, the word corresponding to the first node is determined as the standard word for the word corresponding to the second node.
[0260] As an example, after determining the similarity between the word corresponding to the first node and the word corresponding to the second node, if it is determined that the similarity meets the value condition. For example, the value condition can be that the similarity value is 1. That is, if the similarity value is 1, then the word corresponding to the first node is determined as the standard word for the word corresponding to the second node.
[0261] In the embodiment of the present application, by constructing a term operation tree corresponding to the text to be matched, since this data structure of the term operation tree can fully extract the semantics expressed by the text to be matched, it can accurately understand and analyze the text to be matched, which is convenient for accurately determining the corresponding standard word on the basis of fully understanding the text to be matched; by calculating the similarity between the word corresponding to the first node in the term operation tree corresponding to the text to be matched and the word corresponding to the second node of the same type in the term operation tree corresponding to the standard text, since the similarity of the words corresponding to the same type of nodes is calculated each time, the efficiency of determining the standard word can be effectively improved; and, since the term operation tree can also adapt to the disorder and randomness of the expression of the text to be matched in different scenarios, the accuracy of the determined standard word can be effectively improved.
[0262] Next, taking the specific field as the medical field and the text to be matched as medical text as an example, the exemplary application of the embodiment of the present application in an actual term processing application scenario will be described.
[0263] Medical term standardization is an important cornerstone of medical artificial intelligence and plays a very important role in many scenarios. For example, in the data center of the health record scenario, medical term standardization can help hospitals greatly reduce the workload of medical record coders and help hospitals quickly and low-costly build an information storage and query data center. For another example, medical term standardization can also standardize and connect the data of hospitals at different levels and in different regions, thereby helping to build an intelligent and widely applicable medical system.
[0264] As an example, see Figure 5A , Figure 5A is a schematic diagram of the medical informatization application scenario provided by the embodiment of the present application. The clinical term standardization engine can be used for intelligent assisted underwriting and for connecting data from all parties and providing a unified labeled diagnosis data interface. As Figure 5A shown in the display interface, the subclasses corresponding to gastric cancer are shown, including pyloric antrum cancer and virus-related gastric cancer; the parent classes corresponding to gastric cancer include cancer and primary gastric malignant tumor; the morphological change of gastric cancer can be cancer; the occurrence site of gastric cancer is the stomach; the coding of gastric cancer is C16.9, etc., a series of professional term expressions about gastric cancer.
[0265] The construction process of the second term operation tree will be described below. Refer to Figure 5B , Figure 5B which is a schematic diagram of the term processing method provided by the embodiments of the present application.
[0266] In step 501, the text to be matched is obtained.
[0267] As an example, in response to the operation of obtaining the text to be matched, the text to be matched is received. Here, the text to be matched is a medical text.
[0268] In step 502, disassembling processing is performed to obtain word segmentation marks and logical components.
[0269] As an example, after obtaining the text to be matched, the text to be matched is disassembled, and word segmentation marks such as commas, semicolons, etc. in the text to be matched are identified, and the logical component C in the text to be matched, such as "accompanied by, and, or", is identified. For example, a table lookup method can be used to identify the logical component C.
[0270] In step 503, encoding processing is performed to obtain components A, B, and D included in the text to be matched.
[0271] As an example, encoding processing is performed on the text to be matched to obtain the modifying component A, the part component B, and the disease root component D included in the text to be matched. For example, these three components can be identified by using a table lookup method, or a sequence labeling model can be called based on the text to be matched for labeling processing to obtain multiple component labels corresponding to the text to be matched, and each component label corresponds to one of the modifying component, the part component, and the root component.
[0272] It should be noted that these three components may be nested or partially overlapped. Therefore, separate parallel encoding and recognition are required.
[0273] As an example, for the text to be matched M = {m1, m2, m3,..., m n}, where n is the length of the text to be matched M, the following sequential component extraction processing (i.e., encoding processing) is performed:
[0274] First, taking the root component as the disease root component as an example, the disease root component D = {m n} is extracted from the text to be matched M = {m1, m2, m3,..., m k , m k+1 , m k+2 ,..., m k+l}, where l is the length of the disease root component, and k is the position of the starting word of the disease root component in the text to be matched, 1 ≤ k ≤ n, 0 ≤ l ≤ n - k, and the set {m k , m k+1 , m k+2 ,..., m k+l} represents a disease root component.
[0275] Secondly, extract the part component B = {m n} from the text to be matched M = {m1, m2, m3,..., m r , m r+1 , m r+2 ,..., m r+x}, where x is the length of the part component, and r is the position of the starting word of the part component in the text to be matched, 1 ≤ r ≤ n, 0 ≤ x ≤ n - r, and the set {m r , m r+1 , m r+2 ,..., m r+x} represents a part component.
[0276] Thirdly, extract the modification component A = {m n} from the text to be matched M = {m1, m2, m3,..., m q , m q+1 , m q+2 ,..., m q+w}, where w is the length of the modification component, and q is the position of the starting word of the modification component in the text to be matched, 1 ≤ q ≤ n, 0 ≤ w ≤ n - q, and the set {m q , m q+1 , m q+2 ,..., m q+w} represents a modification component.
[0277] Finally, merge the obtained disease root component D, part component B, and modification component A to obtain l D , l B , l A , where l D / l B / l A represent the lengths of the D / B / A components respectively, and k D / k B / k A represent the positions of the starting words of the D / B / A components in the text to be matched respectively.
[0278] In step 504, construct the second term operation tree according to the logical component and A, B, D components.
[0279] As an example, after identifying the logical component C, the modifying component A, the site component B, and the disease root component D of the text to be matched, a second term operation tree is constructed based on these four components.
[0280] See Figure 5C , Figure 5C which is a schematic structural diagram of the second term operation tree provided by the embodiment of the present application.
[0281] As an example, as shown on the left side of Figure 5C , the logical component C is used as the root node of the second term operation tree, the disease root components D1 and D2 are used as the intermediate nodes of the second term operation tree, the modifying components A1, A2, and A3, and the site component B1 are used as the leaf nodes of the second term operation tree, and the nodes are connected according to the levels to which the nodes belong, so as to obtain the second term operation tree shown on the left side of Figure 5C .
[0282] As an example, when the text to be matched is "diabetic progressive chronic bleeding with peritoneal mass", among them, the logical component C is "with"; the disease root components D include "bleeding" and "mass"; the modifying components A corresponding to the disease root component D1 "bleeding" include "diabetic", "progressive", "chronic"; the site component B corresponding to the disease root component D2 "mass" includes "peritoneal", so a second term operation tree as shown on the Figure 5C right side is constructed.
[0283] In step 505, a second term operation tree is obtained.
[0284] As an example, after constructing the second term operation tree based on various components, a second term operation tree is obtained.
[0285] It should be noted that the process of constructing the corresponding first term operation tree based on the medical standard text is the same as that of steps 501 - 505, and will not be elaborated here.
[0286] In some embodiments, after obtaining the second term operation tree, the second term operation tree can be further processed to obtain an updated second term operation tree.
[0287] As an example, the updated second term operation tree is obtained in the following way: if the second term operation tree includes a first intermediate node and a second intermediate node, when there are multiple first leaf nodes at the first intermediate node, the multiple first leaf nodes are respectively connected to the second intermediate node to obtain the updated second term operation tree; among them, the modifying component or site component corresponding to the first leaf node is not possessed by the root component corresponding to the second intermediate node.
[0288] See Figure 5D ,Figure 5D It is a schematic diagram of the updated structure of the second term operation tree provided by an embodiment of the present application.
[0289] As Figure 5D The intermediate nodes of the second term operation tree shown on the left include disease root components D_{1} and D_{2}. Among them, there are 3 leaf nodes corresponding to D_{1}, and all of these 3 leaf nodes correspond to modifying components, while the disease root component D_{2} does not have corresponding modifying components. Therefore, these 3 leaf nodes can be transferred to D_{2}, that is, these 3 leaf nodes are respectively connected to node D_{2}. As an example, one or more of these 3 leaf nodes can also be connected to node D_{2}. Figure 5D The right side shows the situation of the updated second term operation tree obtained by connecting 2 of the leaf nodes A_{1} and A_{2} to node D_{2}.
[0290] As Figure 5C For the second term operation tree shown on the right, since the disease root component "bleeding" corresponds to 3 modifying components, namely "diabetic", "progressive", and "chronic", while another disease root component "neoplasm" does not have corresponding modifying components, one or more of these 3 modifying components can be transferred to "neoplasm". For example, only "chronic" is transferred to "neoplasm", so as to obtain "diabetic / progressive / chronic / bleeding / with / chronic / peritoneal / neoplasm".
[0291] Due to the different writing specifications of doctors or relevant workers in the real scenario, and there are also a large number of cases of ellipsis in natural language itself, the updated second term operation tree obtained by expanding the second term operation tree can better adapt to the real business scenario.
[0292] Through the construction process of the second term operation tree in the above steps 501 - 505, the medical terms in text form (such as diagnostic text) can be structured with a finer granularity, so as to construct a tree structure, and this tree structure is strictly defined, and each node in it corresponds to different medical meanings. Moreover, the flexibility and horizontal expandability of the tree structure also ensure to the greatest extent to meet the business requirements of the real scenario.
[0293] In step 506, the second term operation tree is decoded to obtain the text to be matched.
[0294] As an example, after obtaining the second term operation tree, the second term operation tree can be decoded to obtain the text to be matched.
[0295] See Figure 5E , Figure 5E It is a schematic diagram of decoding the second term operation tree provided by an embodiment of the present application.
[0296] As an example, for Figure 5E decoding the second term operation tree shown on the right, the text to be matched obtained can be one of diabetic / progressive / chronic / bleeding / with / peritoneal / mass, diabetic / chronic / progressive / bleeding / with / peritoneal / mass, progressive / diabetic / chronic / bleeding / with / peritoneal / mass. Thus, since the text to be matched obtained by decoding the second term operation tree does not consider the order between sibling components, therefore, converting the text to be matched into a term operation tree structure can effectively solve the problems of disorder and randomness existing in the expression of the text to be matched in different scenarios.
[0297] The grid has been proven by a large amount of work to be a structure that effectively utilizes word information and can avoid the error propagation of word segmentation. Therefore, in some embodiments, after obtaining the second term operation tree, a corresponding second grid relative position matrix can be constructed based on the second term operation tree. The construction method of the second grid relative position matrix will be described below.
[0298] Refer to Figure 6 , Figure 6 which is a schematic diagram of the construction method of the second grid relative position matrix provided by an embodiment of the present application.
[0299] Convert the Figure 6 second term operation tree shown on the left into Figure 6 the second grid relative position matrix structure shown on the right. Among them, the hierarchical structure information of the second term operation tree is also effectively retained in this matrix. For example, the value of the C / D1 cell is 1, indicating that the distance from node C to node D1 is 1; while the value of the D1 / D2 cell is INF, indicating that there is no path from node D1 to node D2; it should be noted that the values of the diagonal cells of the second grid relative position matrix are all 0.
[0300] In order to adapt to the updated second term operation tree obtained through expansion processing, the black cells in the second grid relative position matrix are set to paths that can be obtained through expansion processing. Therefore, the values in these cells are adjusted from INF to 0.5, thereby constructing the second grid relative position matrix.
[0301] The method for determining the similarity between the word corresponding to the first node and the word corresponding to the second node using the grid matching model will be described below. Refer to Figure 7 , Figure 7 which is a schematic diagram of the structure of the grid matching model provided by an embodiment of the present application.
[0302] As Figure 7As shown, the grid model consists of a Transformer model with two towers connected to a linear classifier. Each Transformer model includes an encoding network, a self-attention network, a first residual network, a feed-forward neural network, and a second residual network.
[0303] For the word corresponding to the first node in the first term operation tree, the grid matching model first encodes it using the encoding network to obtain the first feature representation of the word corresponding to the first node.
[0304] After obtaining the first feature representation, based on the obtained first feature representation and the first grid relative position matrix, the self-attention network is called for calculation to obtain the first self-attention weight.
[0305] Here, the self-attention network is a multi-head self-attention network. After performing self-attention calculation on each head to obtain the self-attention weight corresponding to each head, the self-attention weights corresponding to each head are concatenated, and a linear transformation is performed on the concatenated result to obtain the first self-attention weight. The calculation method of the first self-attention weight can refer to the method described in steps 104211 - 104212 above.
[0306] After obtaining the first self-attention weight, based on the first self-attention weight and the initial cross-operation tree matrix, the self-attention network is called for calculation to obtain the second self-attention weight corresponding to the first feature representation (i.e., the target self-attention weight above). The calculation method of the second self-attention weight can refer to the method described in steps 10421 - 10422 above.
[0307] Next, the cross-operation tree matrix will be described. Refer to Figure 8 , Figure 8 which is a schematic structural diagram of the cross-operation tree matrix provided by an embodiment of the present application.
[0308] As Figure 8 shown, the cross-operation tree matrix is used to model the similarity of words corresponding to corresponding nodes between two term operation trees. The matrix element 0.0 in the cross-operation tree matrix represents the initial value and will be numerically updated as the model calculates; while the matrix element NA means that the value is artificially fixed at 0.0 and no longer numerically updated. In this way, it is ensured that only the similarity of words corresponding to the same type of nodes between two term operation trees is calculated. For example, calculate the similarity of the C components corresponding to the term operation tree X (i.e., the first term operation tree described above) and the term operation tree Y (i.e., the second term operation tree described above), and calculate the similarity of the corresponding D components, such as calculating the similarities between XD1 / YD1, XD1 / YD2, XD2 / YD1, and XD2 / YD2 respectively.
[0309] It should be noted that after obtaining the similarity between the word corresponding to the first node and the word corresponding to the second node, the matrix element at the first position in the initial cross-operation tree matrix will be updated to the similarity; where the row coordinate of the first position is the first node and the column coordinate of the first position is the second node.
[0310] For example, referring to Figure 8 , when the first node is XD1 and the second node is YD1, if the determined similarity between the word corresponding to XD1 and the word corresponding to YD1 is 0, then the value of (XD1, YD1) in the initial cross-operation tree matrix is updated to 0.
[0311] It should be noted that the updated cross-operation tree matrix will be used to calculate the similarity between the words corresponding to the next node pair. After calculating the similarity between the words corresponding to the next node pair, the updated cross-operation tree matrix will also be updated again according to this similarity. This process is repeated until the updated cross-operation tree matrix is finally updated based on the similarity between the words corresponding to the last node pair to obtain the final cross-operation tree matrix. The final cross-operation tree matrix can intuitively reflect the spatial similarity between the first term operation tree and the second term operation tree, facilitating developers to intuitively judge which components in the first term operation tree and the second term operation tree match successfully based on the cross-operation tree matrix, thus bringing better interpretability to the matching results.
[0312] After obtaining the second self-attention weight, based on the second self-attention weight and the first feature representation, the first residual network is called for calculation processing to obtain the calculation result of the first residual network. The determination method of the calculation result of the first residual network can refer to steps 10431 - 10432 above.
[0313] After obtaining the calculation result of the first residual network, based on the calculation result of the first residual network, the feed-forward neural network is called for calculation processing to obtain the calculation result of the first feed-forward neural network.
[0314] After obtaining the calculation result of the first feed-forward neural network, based on the calculation result of the first feed-forward neural network and the calculation result of the first residual network, the second residual network calculation result is called for calculation processing to obtain the calculation result of the second residual network corresponding to the first feature representation. The determination method of the calculation result of the second residual network can refer to steps 10451 - 10452 above.
[0315] For the word corresponding to the second node in the second term operation tree, the above processing steps are also executed to obtain the calculation result of the second residual network corresponding to the second feature representation. Wherein, the type of the second node is the same as that of the first node.
[0316] After obtaining the calculation results of the second residual network corresponding to the first feature representation and the calculation results of the second residual network corresponding to the second feature representation, these two calculation results of the residual network are concatenated, and a linear classifier is called based on the concatenation result for classification processing to obtain the similarity between the word corresponding to the first node and the word corresponding to the second node.
[0317] As an example, the classifier here is a binary classifier, which only outputs two values, 0 or 1. When the output result of the classifier is 1, it indicates that the similarity between the word corresponding to the first node and the word corresponding to the second node is 1, that is, the word corresponding to the first node and the word corresponding to the second node match; when the output result of the classifier is 0, it indicates that the similarity between the word corresponding to the first node and the word corresponding to the second node is 0, that is, the word corresponding to the first node and the word corresponding to the second node do not match.
[0318] As an example, for the training method of the grid matching model, refer to steps 201 - 208 above.
[0319] It should be noted that during the training process, the sample standard text corresponding to the first sample term operation tree and the sample text to be matched corresponding to the second sample term operation tree form a positive sample pair or a negative sample pair; among them, the positive sample pair indicates that the sample standard text is the standard text corresponding to the sample text to be matched; the negative sample pair indicates that the sample standard text is not the standard text corresponding to the sample text to be matched, and in the term standard table, the standard word corresponding to the sample standard text and the standard word corresponding to the standard text corresponding to the sample text to be matched belong to the same level.
[0320] As an example, when the sample standard text is the standard text corresponding to the sample text to be matched, the sample standard text and the sample text to be matched form a positive sample pair. As an example, the training label corresponding to the positive sample pair is 1, that is, the true similarity between the words in the sample standard text and the words in the sample text to be matched is 1.
[0321] As an example, when the sample text to be matched is a medical text, the standard text corresponding to the sample text to be matched is determined through the annotation of professional doctors, and the determined standard text and the sample text to be matched form a pair of positive sample pairs.
[0322] When the sample standard text is not the standard text corresponding to the sample text to be matched, and in the term standard table, the standard word corresponding to the sample standard text and the standard word corresponding to the standard text corresponding to the sample text to be matched belong to the same level, the sample standard text and the sample text to be matched form a negative sample pair. Among them, the same level can indicate that the corresponding number of encoded digits in the term standard table is the same, for example, both are 4 digits.
[0323] As an example, the training label corresponding to the negative sample pair is 0, that is, the true similarity between the words in the sample standard text and the words in the sample text to be matched is 0.
[0324] As an example, refer to Table 2, which is a schematic diagram of a partial term standard table provided by an embodiment of the present application.
[0325] Table 2 Term Standard Table
[0326]
[0327] Referring to Table 2 above, when the sample text to be matched is "cryptococcosis of the lungs", the corresponding standard text is "pulmonary cryptococcosis". Therefore, the sample text to be matched and "pulmonary cryptococcosis" encoded as B45.0 form a pair of positive sample pairs.
[0328] In the term standard table, the standard words at the same level as "pulmonary cryptococcosis" of B45.0 include: "cryptococcosis of the brain" of B45.1, "dermatococcosis" of B45.2, "bone cryptococcosis" of B45.3, etc. Therefore, here, the sample standard text corresponding to each standard word at the level of the 4-digit code of B45.X is respectively formed into a pair of negative sample pairs with the sample text to be matched, rather than sampling the sample standard text corresponding to the standard words at other levels such as the B45 level or the B45.001 level.
[0329] To verify the effectiveness of the grid matching model trained by the embodiments of the present application, experiments were carried out using a large amount of real medical diagnosis data.
[0330] First, medical experts manually annotated the medical diagnosis data, and a total of 253 pieces of valid data were annotated. Then, this data was used to evaluate the new and old diagnosis standardization engines.
[0331] Table 3 Experimental Results
[0332]
[0333] It can be seen that the standardization performance of the grid matching model provided by the embodiments of the present application on the medical diagnosis data in the real scenario has been improved to a certain extent compared with the baseline model.
[0334] Therefore, the term operation tree specifically designed in the embodiments of the present application can make better use of medical information, and the grid matching model also effectively models the association relationships among different components in the text to be matched, so that compared with directly using the original text to be matched for matching processing, the embodiments of the present application can more effectively analyze and understand the medical meaning expressed by the text to be matched. Moreover, due to the introduction of the cross-operation tree matrix, the weight values therein can be visualized to reflect which components in the two term operation trees are successfully matched, thus bringing better interpretability to the model.
[0335] The following continues to describe the exemplary structure of the software module implementation of the term processing device 233 provided by the embodiments of the present application. In some embodiments, as Figure 2 shown, the software module in the term processing device 233 stored in the memory 230 may include: an acquisition module 2331, configured to acquire the text to be matched in a specific field and a plurality of first term operation trees; wherein each first term operation tree is pre-constructed based on a standard text in a specific field, and each standard text corresponds to a standard word in the term standard table of the specific field; a construction module 2332, configured to construct a second term operation tree corresponding to the text to be matched; a first determination module 2333, configured to perform the following processing for each first term operation tree: determine a first node in the first term operation tree and a second node of the same type as the first node in the second term operation tree; a second determination module 2334, configured to determine the similarity between the word corresponding to the first node and the word corresponding to the second node; wherein the first node is any node in the first term operation tree; a third determination module 2335, configured to, when the value of the similarity satisfies the value condition, determine the word corresponding to the first node as the standard word of the word corresponding to the second node.
[0336] In the above solution, the construction module 2332 is configured to perform splitting and encoding processing on the text to be matched to obtain the components of the text to be matched; and construct a second term operation tree corresponding to the text to be matched based on the components of the text to be matched.
[0337] In the above solution, the components include a modifying component, a location component, a root component, and a logical component; the construction module 2332 is configured to determine the logical component as the root node of the second term operation tree; determine the root component as the intermediate node of the second term operation tree; wherein the intermediate node is a child node of the root node; determine the location component and the modifying component as the leaf nodes of the second term operation tree; wherein the leaf nodes are child nodes of the intermediate node; and connect the root node, the intermediate node, and the leaf nodes according to their respective levels to obtain a second term operation tree corresponding to the text to be matched.
[0338] In the above solution, the above device further includes: a connection module, configured to connect multiple first leaf nodes to a second intermediate node respectively when there are multiple first leaf nodes in a first intermediate node, so as to obtain an updated second term operation tree; wherein, the modifying component or part component corresponding to the first leaf node is not possessed by the root component corresponding to the second intermediate node.
[0339] In the above solution, the second determination module 2334 is configured to use the first node and the second node as target nodes respectively, and perform the following processing: perform encoding processing on the word corresponding to the target node by invoking an encoding network to obtain a target feature representation of the word corresponding to the target node; perform calculation processing on the target feature representation by invoking a self-attention network to obtain a target self-attention weight corresponding to the target feature representation; perform calculation processing on the target feature representation by invoking a first residual network based on the target self-attention weight to obtain a first target residual network calculation result corresponding to the target feature representation; perform calculation processing on the target feature representation by invoking a feed-forward neural network based on the first target residual network calculation result corresponding to the target feature representation to obtain a target feed-forward neural network calculation result corresponding to the target feature representation; perform calculation processing on the target feature representation by invoking a second residual network based on the target feed-forward neural network calculation result corresponding to the target feature representation to obtain a second target residual network calculation result corresponding to the target feature representation; perform splicing processing on the second target residual network calculation result corresponding to the target feature representation, and perform classification processing by invoking a classifier based on the splicing result to obtain the similarity between the word corresponding to the first node and the word corresponding to the second node.
[0340] In the above solution, the second determination module 2334 is configured to perform calculation processing on the target feature representation by invoking a self-attention network based on the target feature representation and the target grid relative position matrix corresponding to the target feature representation to obtain a first self-attention weight corresponding to the target feature representation; wherein, the target grid relative position matrix is determined based on the term operation tree corresponding to the target node; perform calculation processing on the target feature representation by invoking a self-attention network based on the first self-attention weight and the initial cross-operation tree matrix to obtain a target self-attention weight corresponding to the target feature representation; wherein, the cross-operation tree matrix includes multiple matrix elements corresponding to multiple node pairs one by one, and the matrix element represents the similarity between the words corresponding to the two nodes in the node pair, the types of the two nodes are the same, and one of the nodes comes from the first term operation tree and the other node comes from the second term operation tree.
[0341] In the above solution, the self-attention network is a multi-head self-attention network; the second determination module 2334 is configured to perform self-attention calculation processing on the target feature representation by invoking the multi-head self-attention network based on the target feature representation and the target grid relative position matrix corresponding to the target feature representation to obtain the self-attention weight corresponding to each head.
[0342] Concatenate the self-attention weights corresponding to each head, perform a linear transformation on the resulting concatenated processing result, and determine the first self-attention weight corresponding to the target feature representation as the linear transformation processing result.
[0343] In the above solution, the construction module 2332 is further configured to construct the target grid relative position matrix in the following manner: based on the levels and path relationships of nodes i and j in the target term operation tree, determine the path distance between nodes i and j; determine the path distance as the value of the matrix element (i, j) of the target grid relative position matrix; where when the target node is the first node, the target term operation tree is the first term operation tree, and when the target node is the second node, the target term operation tree is the second term operation tree; 1 ≤ i ≤ N, 1 ≤ j ≤ N, and N is the number of nodes included in the target term operation tree.
[0344] In the above solution, the construction module 2332 is further configured to, when nodes i and j belong to the same level, determine the first threshold as the path distance between nodes i and j; when nodes i and j do not belong to the same level and do not have a path relationship, determine the first threshold as the path distance between nodes i and j; when nodes i and j do not belong to the same level and have a path relationship, determine the number of levels separated between nodes i and j as the path distance between nodes i and j.
[0345] In the above solution, the second determination module 2334 is configured to perform a summation process on the target self-attention weight and the target feature representation by invoking the first residual network to obtain a first target summation result; perform a normalization process on the first target summation result to obtain a first target residual network calculation result corresponding to the target feature representation.
[0346] In the above solution, the feedforward neural network includes a first fully connected layer and a second fully connected layer; the second determination module 2334 is configured to perform a calculation process on the first target residual network calculation result by invoking the first fully connected layer to obtain a first fully connected layer target calculation result; perform a calculation process on the first fully connected layer target calculation result by invoking the second fully connected layer, and determine the obtained second fully connected layer target calculation result as the target feedforward neural network calculation result corresponding to the target feature representation.
[0347] In the above solution, the second determination module 2334 is configured to perform a summation process on the target feedforward neural network calculation result and the first target residual network calculation result by invoking the second residual network to obtain a second target summation result; perform a normalization process on the second target summation result to obtain a second target residual network calculation result corresponding to the target feature representation.
[0348] In the above solution, the above device further includes an update module, configured to update the matrix element at the first position in the initial cross-operation tree matrix to a similarity; wherein, the row coordinate of the first position is the first node, and the column coordinate of the first position is the second node.
[0349] In the above solution, the above device further includes a parameter update module, configured to perform encoding processing on the sample word corresponding to the sample node by invoking an encoding network to obtain a sample feature representation of the sample word corresponding to the sample node; perform calculation processing on the sample feature representation by invoking a self-attention network to obtain a sample self-attention weight corresponding to the sample feature representation; perform calculation processing on the sample feature representation by invoking a first residual network to obtain a first sample residual network calculation result corresponding to the sample feature representation; perform calculation processing on the first sample residual network calculation result corresponding to the sample feature representation by invoking a feed-forward neural network to obtain a sample feed-forward neural network calculation result corresponding to the sample feature representation; perform calculation processing on the sample feed-forward neural network calculation result corresponding to the sample feature representation by invoking a second residual network to obtain a second sample residual network calculation result corresponding to the sample feature representation; perform splicing processing on the second sample residual network calculation result corresponding to the sample feature representation, and perform classification processing on the splicing result by invoking a classifier to obtain a predicted similarity between the sample word corresponding to the first sample node and the sample word corresponding to the second sample node; substitute the predicted similarity and the corresponding true similarity into a loss function for calculation processing to obtain a loss value; update the parameters of the classifier, the parameters of the second residual network, the parameters of the feed-forward neural network, the parameters of the first residual network, the parameters of the self-attention network, and the parameters of the encoding network based on the loss value during the backpropagation process; wherein, the first sample node is any node in the first sample term operation tree, the second sample node is any node in the second sample term operation tree, and the types of the first sample node and the second sample node are the same.
[0350] In the above solution, the sample standard text corresponding to the first sample term operation tree and the sample text to be matched corresponding to the second sample term operation tree form a positive sample pair or a negative sample pair; wherein, the positive sample pair indicates that the sample standard text is the standard text corresponding to the sample text to be matched; the negative sample pair indicates that the sample standard text is not the standard text corresponding to the sample text to be matched, and in the term standard table, the standard word corresponding to the sample standard text and the standard word corresponding to the standard text corresponding to the sample text to be matched belong to the same level.
[0351] Embodiments of the present application provide a computer program product or a computer program. The computer program product or the computer program includes computer instructions, and the computer instructions are stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the term processing method described above in the embodiments of the present application.
[0352] Embodiments of the present application provide a computer-readable storage medium storing executable instructions, where the executable instructions are stored, and when the executable instructions are executed by a processor, the processor will be caused to execute the term processing method provided by the embodiments of the present application.
[0353] In some embodiments, the computer-readable storage medium may be a memory such as FRAM, ROM, PROM, EPROM, EEPROM, flash memory, magnetic surface memory, optical disc, or CD-ROM; or may be various devices including one or any combination of the above memories.
[0354] In some embodiments, the executable instructions may be in the form of a program, software, software module, script, or code, and may be 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 being deployed as an independent program or being deployed as a module, component, subroutine, or other unit suitable for use in a computing environment.
[0355] As an example, the executable instructions may be deployed to execute on one computing device, or on multiple computing devices located at one location, or, on multiple computing devices distributed at multiple locations and interconnected by a communication network.
[0356] In summary, in the embodiments of the present application, by constructing a term operation tree corresponding to the text to be matched, since the data structure of the term operation tree can fully extract the semantics expressed by the text to be matched, the text to be matched can be accurately understood and analyzed, which is convenient for accurately determining the corresponding standard word on the basis of fully understanding the text to be matched; by calculating the similarity between the word corresponding to the first node in the term operation tree corresponding to the text to be matched and the word corresponding to the second node of the same type in the term operation tree corresponding to the standard text, since the similarity of the words corresponding to the nodes of the same type is calculated each time, the efficiency of determining the standard word can be effectively improved; and, since the term operation tree can also adapt to the disorder and randomness of the expression of the text to be matched in different scenarios, the accuracy of the determined standard word can be effectively improved.
[0357] As described above, the above are only embodiments of the present application and are not intended to limit the protection scope of the present application. Any modifications, equivalent replacements, improvements, etc. made within the spirit and scope of the present application are all included in the protection scope of the present application.
Claims
1. A method for term processing, characterized in that, The method includes: Obtaining the text to be matched in a specific field and multiple first term operation trees; wherein, each of the first term operation trees is pre-constructed based on a standard text in the specific field, and each standard text corresponds to a standard word in the term standard table of the specific field; Constructing a second term operation tree corresponding to the text to be matched; wherein, when the second term operation tree includes a first intermediate node and a second intermediate node, and there are multiple first leaf nodes for the first intermediate node, the multiple first leaf nodes are respectively connected to the second intermediate node, and the modifying component or part component corresponding to the first leaf node is not possessed by the root component corresponding to the second intermediate node; Performing the following processing for each of the first term operation trees: Determining a first node in the first term operation tree and a second node of the same type as the first node in the second term operation tree; wherein, the type of the component corresponding to the first node is the same as the type of the component corresponding to the second node; Determining the similarity between the word corresponding to the first node and the word corresponding to the second node; wherein, the first node is any node in the first term operation tree; When the value of the similarity meets the value condition, determining the word corresponding to the first node as the standard word of the word corresponding to the second node.
2. The method according to claim 1, wherein The constructing of the second term operation tree corresponding to the text to be matched includes: Performing split coding processing on the text to be matched to obtain the components of the text to be matched; Constructing a second term operation tree corresponding to the text to be matched based on the components of the text to be matched.
3. The method according to claim 2, wherein The components include the modifying component, the part component, the root component, and the logical component; the constructing of the second term operation tree corresponding to the text to be matched based on the components of the text to be matched includes: Determining the logical component as the root node of the second term operation tree; Determining the root component as the intermediate node of the second term operation tree; wherein, the intermediate node is a child node of the root node; Determining the part component and the modifying component as the leaf nodes of the second term operation tree; wherein, the leaf nodes are child nodes of the intermediate node; Connecting the root node, the intermediate node, and the leaf nodes according to their respective levels to obtain a second term operation tree corresponding to the text to be matched.
4. The method according to claim 1, wherein The determining of the similarity between the word corresponding to the first node and the word corresponding to the second node includes: Respectively taking the first node and the second node as target nodes and performing the following processing: Performing encoding processing on the word corresponding to the target node by invoking an encoding network to obtain a target feature representation of the word corresponding to the target node; Performing calculation processing on the target feature representation by invoking a self-attention network to obtain a target self-attention weight corresponding to the target feature representation; Based on the target self-attention weights, call the first residual network for calculation processing to obtain the first target residual network calculation result corresponding to the target feature representation; Based on the first target residual network calculation result corresponding to the target feature representation, call the feed-forward neural network for calculation processing to obtain the target feed-forward neural network calculation result corresponding to the target feature representation; Based on the target feed-forward neural network calculation result corresponding to the target feature representation, call the second residual network for calculation processing to obtain the second target residual network calculation result corresponding to the target feature representation; Perform splicing processing on the second target residual network calculation result corresponding to the target feature representation, and based on the splicing result, call the classifier for classification processing to obtain the similarity between the words corresponding to the first node and the words corresponding to the second node.
5. The method according to claim 4, wherein The calling the self-attention network for calculation processing based on the target feature representation to obtain the target self-attention weights corresponding to the target feature representation includes: Based on the target feature representation and the target grid relative position matrix corresponding to the target feature representation, call the self-attention network for calculation processing to obtain the first self-attention weights corresponding to the target feature representation; wherein, the target grid relative position matrix is determined based on the term operation tree corresponding to the target node; Based on the first self-attention weights and the initial cross-operation tree matrix, call the self-attention network for calculation processing to obtain the target self-attention weights corresponding to the target feature representation; Wherein, the cross-operation tree matrix includes a plurality of matrix elements corresponding one-to-one to a plurality of node pairs, and the matrix elements represent the similarity between the words corresponding to the two nodes in the node pair. The types of the two nodes are the same, and one of the nodes comes from the first term operation tree and the other node comes from the second term operation tree.
6. The method according to claim 5, wherein The self-attention network is a multi-head self-attention network; The calling the self-attention network for calculation processing based on the target feature representation and the target grid relative position matrix corresponding to the target feature representation to obtain the first self-attention weights corresponding to the target feature representation includes: Based on the target feature representation and the target grid relative position matrix corresponding to the target feature representation, call the multi-head self-attention network for self-attention calculation processing to obtain the self-attention weights corresponding to each head; Perform splicing processing on the self-attention weights corresponding to each head, and perform linear transformation processing on the obtained splicing processing result, and determine the linear transformation processing result as the first self-attention weights corresponding to the target feature representation.
7. The method according to claim 5, wherein Before the calling the self-attention network for calculation processing based on the target feature representation and the target grid relative position matrix corresponding to the target feature representation, the method further includes: Construct the target grid relative position matrix in the following manner: Determine the path distance between node i and node j based on the levels and path relationships of node i and node j in the target term operation tree; Determine the value of the matrix element (i, j) of the target grid relative position matrix as the path distance; wherein, when the target node is the first node, the target term operation tree is the first term operation tree, and when the target node is the second node, the target term operation tree is the second term operation tree; 1 ≤ i ≤ N, 1 ≤ j ≤ N, and N is the number of nodes included in the target term operation tree.
8. The method according to claim 7, wherein The determining the path distance between node i and node j based on the levels and path relationships of node i and node j in the target term operation tree includes: In the case where node i and node j belong to the same level, determine the first threshold as the path distance between node i and node j; In the case where node i and node j do not belong to the same level and do not have a path relationship, determine the first threshold as the path distance between node i and node j; In the case where node i and node j do not belong to the same level and have a path relationship, determine the number of levels separated between node i and node j as the path distance between node i and node j.
9. The method according to claim 4, wherein The calculating and processing the first target residual network calculation result corresponding to the target feature representation by invoking the first residual network based on the target self-attention weight includes: Based on the target self-attention weight and the target feature representation, invoke the first residual network for summation processing to obtain a first target summation result; Perform normalization processing on the first target summation result to obtain the first target residual network calculation result corresponding to the target feature representation.
10. The method according to claim 4, wherein The feed-forward neural network includes a first fully connected layer and a second fully connected layer; The calculating and processing the target feed-forward neural network calculation result corresponding to the target feature representation by invoking the feed-forward neural network based on the first target residual network calculation result corresponding to the target feature representation includes: Based on the first target residual network calculation result, invoke the first fully connected layer for calculation processing to obtain a first fully connected layer target calculation result; Based on the first fully connected layer target calculation result, invoke the second fully connected layer for calculation processing, and determine the obtained second fully connected layer target calculation result as the target feed-forward neural network calculation result corresponding to the target feature representation.
11. The method according to claim 4, wherein The calculating and processing the second target residual network calculation result corresponding to the target feature representation by invoking the second residual network based on the target feed-forward neural network calculation result corresponding to the target feature representation includes: Based on the calculation result of the target feedforward neural network and the calculation result of the first target residual network, call the second residual network to perform a summation process to obtain a second target summation result; Perform a normalization process on the second target summation result to obtain the calculation result of the second target residual network corresponding to the target feature representation.
12. The method according to claim 4, wherein after obtaining the similarity between the word corresponding to the first node and the word corresponding to the second node, the method further includes: updating the matrix element at the first position in the initial cross-operation tree matrix to the similarity; wherein, the row coordinate of the first position is the first node, and the column coordinate of the first position is the second node.
13. The method according to claim 1, wherein before determining the similarity between the word corresponding to the first node and the word corresponding to the second node, the method further includes: respectively taking the first sample node and the second sample node as sample nodes, and performing the following processing: calling an encoding network to perform an encoding process based on the sample word corresponding to the sample node to obtain a sample feature representation of the sample word corresponding to the sample node; calling a self-attention network to perform a calculation process based on the sample feature representation to obtain a sample self-attention weight corresponding to the sample feature representation; calling a first residual network to perform a calculation process based on the sample self-attention weight to obtain a calculation result of the first sample residual network corresponding to the sample feature representation; calling a feedforward neural network to perform a calculation process based on the calculation result of the first sample residual network corresponding to the sample feature representation to obtain a calculation result of the sample feedforward neural network corresponding to the sample feature representation; calling a second residual network to perform a calculation process based on the calculation result of the sample feedforward neural network corresponding to the sample feature representation to obtain a calculation result of the second sample residual network corresponding to the sample feature representation; performing a splicing process on the calculation result of the second sample residual network corresponding to the sample feature representation, and calling a classifier to perform a classification process based on the splicing result to obtain a predicted similarity between the sample word corresponding to the first sample node and the sample word corresponding to the second sample node; substituting the predicted similarity and the corresponding true similarity into a loss function to perform a calculation process to obtain a loss value; updating the parameters of the classifier, the parameters of the second residual network, the parameters of the feedforward neural network, the parameters of the first residual network, the parameters of the self-attention network, and the parameters of the encoding network based on the loss value during the backpropagation process; wherein, the first sample node is any node in the first sample term operation tree, the second sample node is any node in the second sample term operation tree, and the types of the first sample node and the second sample node are the same.
14. The method according to claim 13, wherein the sample standard text corresponding to the first sample term operation tree and the sample text to be matched corresponding to the second sample term operation tree form a positive sample pair or a negative sample pair; Among them, the positive sample pair represents that the sample standard text is the standard text corresponding to the sample text to be matched; the negative sample pair represents that the sample standard text is not the standard text corresponding to the sample text to be matched, and in the term standard table, the standard word corresponding to the sample standard text and the standard word corresponding to the standard text corresponding to the sample text to be matched belong to the same level.
15. A term processing device, characterized in that, The device includes: an acquisition module, configured to acquire a text to be matched in a specific field and a plurality of first term operation trees; wherein, each of the first term operation trees is pre-constructed based on a standard text in the specific field, and each of the standard texts corresponds to a standard word in the term standard table of the specific field; a construction module, configured to construct a second term operation tree corresponding to the text to be matched; wherein, when the second term operation tree includes a first intermediate node and a second intermediate node, and there are a plurality of first leaf nodes in the first intermediate node, the plurality of first leaf nodes are respectively connected to the second intermediate node, and the modifying component or part component corresponding to the first leaf node is not possessed by the root component corresponding to the second intermediate node; a first determination module, configured to perform the following processing for each of the first term operation trees: determine a first node in the first term operation tree and a second node of the same type as the first node in the second term operation tree; wherein, the type of the component corresponding to the first node is the same as the type of the component corresponding to the second node; a second determination module, configured to determine the similarity between the word corresponding to the first node and the word corresponding to the second node; wherein, the first node is any node in the first term operation tree; a third determination module, configured to, when the value of the similarity satisfies the value condition, determine the word corresponding to the first node as the standard word of the word corresponding to the second node.
16. The device according to claim 15, characterized in that The second determination module is further configured to: respectively use the first node and the second node as target nodes, and perform the following processing: perform an encoding process on the word corresponding to the target node by invoking an encoding network, to obtain a target feature representation of the word corresponding to the target node; perform a calculation process on the target feature representation by invoking a self-attention network, to obtain a target self-attention weight corresponding to the target feature representation; perform a calculation process on the target feature representation by invoking a first residual network based on the target self-attention weight, to obtain a first target residual network calculation result corresponding to the target feature representation; perform a calculation process on the first target residual network calculation result corresponding to the target feature representation by invoking a feedforward neural network, to obtain a target feedforward neural network calculation result corresponding to the target feature representation; perform a calculation process on the target feedforward neural network calculation result corresponding to the target feature representation by invoking a second residual network, to obtain a second target residual network calculation result corresponding to the target feature representation; Perform splicing processing on the calculation result of the second target residual network corresponding to the target feature representation, and call a classifier for classification processing based on the splicing result to obtain the similarity between the word corresponding to the first node and the word corresponding to the second node.
17. The device according to claim 16, characterized in that, The second determination module is further configured to: Based on the target feature representation and the target grid relative position matrix corresponding to the target feature representation, call the self-attention network for calculation processing to obtain the first self-attention weight corresponding to the target feature representation; wherein, the target grid relative position matrix is determined based on the term operation tree corresponding to the target node; based on the first self-attention weight and the initial cross-operation tree matrix, call the self-attention network for calculation processing to obtain the target self-attention weight corresponding to the target feature representation; wherein, the cross-operation tree matrix includes a plurality of matrix elements corresponding one-to-one to a plurality of node pairs, and the matrix element represents the similarity between the words corresponding to the two nodes in the node pair, the types of the two nodes are the same, and one of the nodes comes from the first term operation tree and the other node comes from the second term operation tree.
18. An electronic device, characterized in that, The electronic device includes: A memory for storing executable instructions; A processor, when executing the executable instructions stored in the memory, implements the term processing method according to any one of claims 1 to 14.
19. A computer-readable storage medium, characterized in that, Stored with executable instructions, the executable instructions are used to implement the term processing method according to any one of claims 1 to 14 when being executed by a processor.
20. A computer program product comprising a computer program or instructions, characterized in that, When the computer program or instruction is executed by a processor, it implements the term processing method according to any one of claims 1 to 14.
Citation Information
Patent Citations
Term processing method and device, equipment, storage medium and program product
CN114330309A