Medical word determination method and device, model training method and device, equipment and storage medium
By encoding the text to generate a graph network, the second feature of the text is obtained and fused with the first feature, which solves the problem of inaccurate feature extraction in the prior art and realizes the accurate determination of standard medical terms and detailed feature capture.
Patent Information
- Application Number
- CN202410813216.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-21
- Publication Date
- 2025-12-23
AI Technical Summary
Existing technologies suffer from poor accuracy in feature extraction, and the technical problem that cannot be effectively solved is how to obtain text features through graph networks.
By encoding the text to generate a graph network, and using the text and entity words to generate the graph network, the second feature of the text is obtained. The first feature and the second feature are then fused to generate the third feature. Based on the third feature, the standard medical terms corresponding to the text are determined.
It improves the accuracy of feature extraction, ensures the accuracy of the identified standard medical terms, can meticulously capture the hierarchical relationship between words in the text, and enriches the information expression of the features.
Smart Images

Figure CN121189313A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] Embodiments of the present application relate to the technical field of computer, in particular to a medical word determination method and device, a model training method and device, and a storage medium. BACKGROUND
[0002] Natural language processing technology is an important direction in the field of computer science and artificial intelligence. Text processing in natural language processing technology can be applied in various scenarios, such as text classification, intelligent question answering, etc. In the text processing scenario, feature extraction of the text is a crucial step that directly affects the processing effect. However, the accuracy of the current feature extraction method is poor. SUMMARY
[0003] Embodiments of the present application provide a medical word determination method, a model training method, a device, an apparatus and a storage medium, which can improve the accuracy of features. The technical solution is as follows:
[0004] In one aspect, a medical word determination method is provided, the method comprising:
[0005] encoding the text to obtain first features of the text, the text comprising non-standard medical words;
[0006] generating a graph network based on the text and a plurality of entity words in the text, nodes in the graph network being used to represent the text and entity words, and edges between any two nodes in the graph network being used to represent a containing relationship between contents represented by the two nodes;
[0007] obtaining second features of the text based on the graph network;
[0008] fusing the first features and the second features to obtain third features of the text, the third features being features obtained by feature extraction of the text;
[0009] determining a standard medical word corresponding to the text from a plurality of standard medical words based on the third features.
[0010] In another aspect, a model training method is provided, the method further comprising:
[0011] obtaining a sample text, a positive sample medical word and a negative sample medical word, the positive sample medical word being a standard medical word corresponding to the sample text, and the negative sample medical word being any standard medical word other than the positive sample medical word;
[0012] encoding the sample text based on a feature extraction model to obtain first sample features of the sample text;
[0013] generate a sample graph network based on the feature extraction model, the sample text, and a plurality of entity words in the sample text, wherein nodes in the sample graph network are used to represent the text and the entity words, and edges between any two nodes in the graph network are used to represent a containing relationship between contents represented by the two nodes;
[0014] obtain a second sample feature of the sample text based on the feature extraction model and the sample graph network;
[0015] fuse the first sample feature and the second sample feature based on the feature extraction model to obtain a third sample feature of the sample text, wherein the third sample feature is a feature obtained by performing feature extraction on the sample text;
[0016] train the feature extraction model based on the third sample feature of the sample text, the feature of the positive sample medical word, and the feature of the negative sample medical word.
[0017] In another aspect, a medical word determination apparatus is provided, and the apparatus includes:
[0018] an extraction module configured to encode a text to obtain a first feature of the text, wherein the text includes a non-standard medical word;
[0019] a generation module configured to generate a graph network based on the text and a plurality of entity words in the text, wherein nodes in the graph network are used to represent the text and the entity words, and edges between any two nodes in the graph network are used to represent a containing relationship between contents represented by the two nodes;
[0020] an obtaining module configured to obtain a second feature of the text based on the graph network;
[0021] a fusion module configured to fuse the first feature and the second feature to obtain a third feature of the text, wherein the third feature is a feature obtained by performing feature extraction on the text;
[0022] a determination module configured to determine a standard medical word corresponding to the text from a plurality of standard medical words based on the third feature.
[0023] In a possible implementation, the obtaining module is configured to, for each node in the graph network, obtain a feature of the node, update the feature of the node based on features of neighbor nodes, wherein the neighbor nodes have edges with the node, and the feature of the node indicates the text or the entity word represented by the node; and fuse features of a plurality of nodes in the graph network after being updated to obtain the second feature.
[0024] In a possible implementation, the obtaining module is configured to: obtain a first fused feature by fusing the feature of the node and the feature of the node; obtain a second fused feature by fusing the feature of the node and the feature of the neighbor node; obtain a third fused feature by fusing the first fused feature and the second fused feature; determine a weight of the node as a ratio of the first fused feature to the third fused feature, and determine a weight of the neighbor node as a ratio of the second fused feature to the third fused feature; and obtain an updated feature of the node by fusing the feature of the node and the feature of the neighbor node according to the weight of the node and the weight of the neighbor node.
[0025] In a possible implementation, the obtaining module is configured to: obtain the second fused feature by fusing the feature of the node and the feature of the neighbor node according to a first weight and a second weight, wherein the first weight is a weight corresponding to a first word type, the first word type is a word type to which content represented by the node belongs, and the second weight is a weight corresponding to a second word type, the second word type is a word type to which content represented by the neighbor node belongs.
[0026] In a possible implementation, the obtaining module is configured to: for each node in the graph network, update a current feature of the node according to a current feature of the neighbor node to obtain an i-th updated feature of the node, i is an integer greater than 0; and in a case where the i-th updated feature of each node is obtained, update the i-th updated feature of the node according to an i-th updated feature of the neighbor node to obtain an (i+1)-th updated feature of the node.
[0027] In a possible implementation, the apparatus further includes:
[0028] The updating module is configured to: for each node in the graph network, update a feature of the node according to a type feature corresponding to the node, the type feature indicating a word type to which content represented by the node belongs.
[0029] In a possible implementation, the extracting module is configured to: encode each character in the text to obtain a feature of the character; and fuse features of characters in the text to obtain the first feature.
[0030] The obtaining module is configured to determine the feature of the node according to a feature of a target character, the target character being a character included in content represented by the node.
[0031] In a possible implementation, the obtaining module is configured to, in a case where the content represented by the node comprises a plurality of target characters, fuse features of the plurality of target characters to obtain the feature of the node; or in a case where the content represented by the node comprises one target character, determine the feature of the target character as the feature of the node.
[0032] In a possible implementation, the extracting module is further configured to extract, based on each character quantity in the plurality of character quantities, an alternative word corresponding to the character quantity from the text, the alternative word comprising characters of the character quantity; and classify each alternative word to obtain a word type to which the alternative word belongs, the word type comprising an entity word type or a non-entity word type.
[0033] The generating module is configured to generate the graph network based on the text and the alternative word belonging to the entity word type.
[0034] In a possible implementation, the determining module is configured to determine, based on the third feature and features of a plurality of standard medical words, a similarity between the text and each standard medical word; and determine, as the standard medical word corresponding to the text, a standard medical word with the largest similarity in the plurality of standard medical words.
[0035] In another aspect, a model training apparatus is provided, and the apparatus further includes:
[0036] The obtaining module is configured to obtain a sample text, a positive sample medical word, and a negative sample medical word, the sample text comprising a non-standard medical word, the positive sample medical word being a standard medical word corresponding to the sample text, and the negative sample medical word being any standard medical word other than the positive sample medical word.
[0037] The extracting module is configured to encode the sample text based on a feature extraction model to obtain a first sample feature of the sample text.
[0038] The generating module is configured to generate, based on the feature extraction model, the sample text, and a plurality of entity words in the sample text, a sample graph network, a node in the sample graph network being configured to represent the text and an entity word, and an edge between any two nodes in the graph network being configured to represent a containing relationship between contents represented by the two nodes.
[0039] The obtaining module is further configured to obtain, based on the feature extraction model and the sample graph network, a second sample feature of the sample text.
[0040] a fusion module configured to fuse the first sample feature and the second sample feature based on the feature extraction model to obtain a third sample feature of the sample text, the third sample feature being a feature of the sample text obtained by feature extraction;
[0041] a training module configured to train the feature extraction model based on the third sample feature of the sample text, the feature of the positive sample medical word, and the feature of the negative sample medical word.
[0042] In a possible implementation, the training module is configured to determine a first similarity based on the third sample feature and the feature of the positive sample medical word, determine a second similarity based on the third sample feature of the sample text and the feature of the negative sample medical word, determine a loss value based on the first similarity and the second similarity, the loss value being negatively correlated with the first similarity and positively correlated with the second similarity, and train the feature extraction model based on the loss value.
[0043] In another aspect, a computer device is provided, which includes a processor and a memory, and the memory stores at least one computer program, which is loaded and executed by the processor to implement the operations performed by the medical word determination method or the model training method according to the above aspects.
[0044] In another aspect, a computer readable storage medium is provided, which stores at least one computer program, which is loaded and executed by a processor to implement the operations performed by the medical word determination method or the model training method according to the above aspects.
[0045] In yet another aspect, a computer program product is provided, which includes a computer program, and the computer program is executed by a processor to implement the operations performed by the medical word determination method or the model training method according to the above aspects.
[0046] In the scheme provided by the embodiments of the present application, it is considered that different standard medical words represent different meanings but may contain more same characters. For any text containing non-standard medical words, not only the text is directly coded to obtain the first feature of the text, but also a graph network is generated by using the text and entity words in the text to generate a graph network, the second feature of the text is obtained by using the graph network, and then the two features are fused as the final feature of the text. Then, based on the final feature of the text, the standard medical word corresponding to the text is determined from a plurality of standard medical words. In this way, since the graph network can reflect the inclusion relationship between the text and the entity words in the text, the hierarchical relationship between the words in the text can be captured more carefully, the information contained in the features of the text is enriched, the accuracy of the finally obtained features can be ensured to accurately express the meaning of the text, and the accuracy of the feature extraction is ensured. Then, based on the third feature, the standard medical word corresponding to the text can be distinguished from other standard medical words, so as to ensure the accuracy of the determined standard medical word. BRIEF DESCRIPTION OF DRAWINGS
[0047] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed in the embodiment description will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.
[0048] Figure 1 is a structural schematic diagram of an implementation environment provided by the embodiments of the present application;
[0049] Figure 2 is a flowchart of a medical word determination method provided by the embodiments of the present application;
[0050] Figure 3 is a flowchart of another medical word determination method provided by the embodiments of the present application;
[0051] Figure 4 is a schematic diagram of a graph network provided by the embodiments of the present application;
[0052] Figure 5 is a schematic diagram of classifying alternative words provided by the embodiments of the present application;
[0053] Figure 6 is a flowchart of another medical word determination method provided by the embodiments of the present application;
[0054] Figure 7 is a flowchart of another medical word determination method provided by the embodiments of the present application;
[0055] Figure 8is a schematic diagram of a mapping interface provided by an embodiment of the present application.
[0056] Figure 9 is a flowchart of a model training method provided by an embodiment of the present application.
[0057] Figure 10 is a flowchart of another medical word determination method provided by an embodiment of the present application.
[0058] Figure 11 is a structural schematic diagram of a medical word determination apparatus provided by an embodiment of the present application.
[0059] Figure 12 is a structural schematic diagram of another medical word determination apparatus provided by an embodiment of the present application.
[0060] Figure 13 is a structural schematic diagram of a model training apparatus provided by an embodiment of the present application.
[0061] Figure 14 is a structural schematic diagram of a terminal provided by an embodiment of the present application.
[0062] Figure 15 is a structural schematic diagram of a server provided by an embodiment of the present application. DETAILED DESCRIPTION
[0063] To make the objectives, technical solutions and advantages of embodiments of the present application clearer, the following will further describe the embodiments of the present application in detail with reference to the accompanying drawings.
[0064] The terms "first", "second", "third", and the like as used in this specification can be used to describe various concepts, but unless specifically stated, these concepts are not limited by these terms. These terms are only used to distinguish one concept from another concept. For example, without departing from the scope of the present application, a first feature can be referred to as a second feature, and similarly, a second feature can be referred to as a first feature.
[0065] The terms "at least one", "multiple", "each", "any", as used in this specification, include one, two or more than two, multiple includes two or more than two, and each refers to each of the corresponding multiple, and any refers to any one of the multiple. For example, multiple characters include 3 characters, and each refers to each of the 3 characters, and any refers to any one of the 3 characters, which can be the first character, or the second character, or the third character.
[0066] It should be noted that the information (including but not limited to user device information, user personal information, etc.), data (including but not limited to data for analysis, stored data, displayed data, etc.) and signals involved in the present application are authorized by the user or fully authorized by all parties, and the collection, use and processing of related data need to comply with relevant laws, regulations and standards of countries and regions. For example, the texts, standard medical words, etc. involved in the present application are obtained with full authorization.
[0067] Artificial Intelligence (AI) is the use of digital computers or digital computer-controlled machines to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results. In other words, artificial intelligence is a comprehensive technology of computer science, which tries to understand the essence of intelligence and produce a new intelligent machine that can react in a similar way to human intelligence. Artificial intelligence is to study the design principles and implementation methods of various intelligent machines, so that machines have the functions of perception, reasoning and decision-making.
[0068] Artificial intelligence technology is a comprehensive discipline, involving a wide range of fields, both hardware and software technologies. Artificial intelligence basic technologies generally include sensors, special artificial intelligence chips, cloud computing, distributed storage, big data processing technology, pre-training model technology, operation / interaction system, mechatronics, etc. Among them, the pre-training model is also called large model, basic model, which can be widely used in downstream tasks of artificial intelligence in various directions after fine-tuning. Artificial intelligence software technology mainly includes computer vision technology, speech processing technology, natural language processing technology and machine learning / deep learning, etc.
[0069] Computer Vision (CV) Computer vision is a science that studies how to make machines "see". More specifically, it refers to using cameras and computers to replace human eyes to identify and measure targets, and further process graphics to make computer processing more suitable for human eye observation or to transmit images to instruments for detection. As a scientific discipline, computer vision researches related theories and technologies, and attempts to establish artificial intelligence systems that can obtain information from images or multidimensional data. Large model technology brings important changes to the development of computer vision technology. SwinTransformer (a deep learning model), ViT (Vision Transformer, a deep learning model), V-MOE (a visual model), and MAE (Masked Auto Encoders, automatic encoder) are pre-training models in the field of vision. After fine tuning, they can be quickly and widely applied to specific downstream tasks. Computer vision technology usually includes image processing, image recognition, image semantic understanding, image retrieval, OCR (Optical Character Recognition, optical character recognition), video processing, video semantic understanding, video content / behavior recognition, three-dimensional object reconstruction, 3D (3Dimensions, three-dimensional) technology, virtual reality, augmented reality, and other technologies.
[0070] The key technologies of speech technology include automatic speech recognition technology (ASR) and speech synthesis technology (TTS) as well as voiceprint recognition technology. Making computers able to hear, see, speak, and feel is the future direction of human-computer interaction, and voice has become one of the most promising human-computer interaction methods in the future.
[0071] Natural Language Processing (NLP) is an important direction in the field of computer science and artificial intelligence. It studies various theories and methods that can enable effective communication between humans and computers using natural language. NLP involves natural language, which is the language used in daily life, and is closely related to linguistic research. At the same time, it involves important techniques for model training in the field of artificial intelligence such as computer science and mathematics. Pre-trained Models (PTM) are developed from Large Language Models (LLM) in the field of NLP. Pre-trained models, also known as cornerstone models or large models, refer to deep neural networks (DNN) with large parameters. These models are trained on a large amount of unlabeled data, and the function approximation capability of large parameter DNNs enables PTM to extract common features from the data. Through techniques such as Fine Tune, Parameter Efficient Fine-Tuning (PEFT), and Prompt-Tuning, PTM can be adapted to downstream tasks. Therefore, pre-trained models can achieve ideal results in few-shot or zero-shot scenarios. PTM can be divided into language models, visual models, speech models, and multi-modal models according to the data modality they process. For example, language models include ELMO (Embeddings from Language Model), BERT (Bidirectional Encoder Representations from Transformers), and GPT (Generative Pre-trained Transformer). Among them, multi-modal models refer to models that establish feature representations for two or more data modalities. Pre-trained models are important tools for outputting Artificial Intelligence Generated Content (AIGC) and can also serve as a general interface connecting multiple specific task models. After fine-tuning, large language models can be widely applied to downstream tasks. Natural language processing techniques typically include text processing, semantic understanding, machine translation, robot question answering, knowledge graph, and other techniques.
[0072] Machine Learning (ML) is a multi-disciplinary subject, involving probability theory, statistics, approximation theory, convex analysis, algorithmic complexity theory, etc. It is a specialized study of how computers simulate or implement human learning behavior to acquire new knowledge or skills, reorganize existing knowledge structure, and continuously improve their performance. Machine learning is the core of artificial intelligence and the fundamental approach to making computers intelligent. Its applications are widespread in various fields of artificial intelligence. Machine learning and deep learning usually include artificial neural networks, belief networks, reinforcement learning, transfer learning, inductive learning, and teaching learning. Pre-trained models are the latest development of deep learning, integrating the above technologies.
[0073] The scheme provided by the embodiments of the present application can train a feature extraction model based on the machine learning technology of artificial intelligence, and realize the medical word determination method by using the trained feature extraction model.
[0074] The medical word determination method or model training method provided by the embodiments of the present application can be executed by a computer device. Optionally, the computer device is a terminal or a server. Optionally, the server is an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server providing cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN (Content Delivery Network), and basic cloud computing services such as big data and artificial intelligence platforms. Optionally, the terminal is a smartphone, a tablet computer, a notebook computer, a desktop computer, a smart speaker, a smart watch, a smart voice interaction device, a smart home appliance, a vehicle terminal, etc., but is not limited thereto.
[0075] In some embodiments, the computer program related to the embodiments of the present application can be deployed to execute on one computer device, or on multiple computer devices located in one place, or on multiple computer devices distributed in multiple places and interconnected through a communication network, which can constitute a blockchain system.
[0076] In some embodiments, the computer device is provided as a server. Figure 1 FIG. 1 is a schematic diagram of an implementation environment provided by the embodiments of the present application. Referring to FIG. 1, Figure 1 The implementation environment includes a terminal 101 and a server 102. The terminal 101 and the server 102 are connected through a wireless or wired network.
[0077] The terminal 101 is configured to acquire a text, and send the text to the server 102 through a connection between the terminal 101 and the server 102. The server 102 is configured to receive the text sent by the terminal 101, extract a feature of the text, and determine a standard medical word corresponding to the text based on the feature of the text.
[0078] In a possible implementation, the server 102 is deployed with a feature extraction model, and the server 102 is configured to extract the feature of the text based on the feature extraction model.
[0079] Optionally, the feature extraction model is trained by the server 102 or by another server.
[0080] In the embodiments of the present application, the server 102 can train the feature extraction model, and then the server 102 stores the trained feature extraction model. Alternatively, another server trains the feature extraction model, and then sends the trained feature extraction model to the server 102, and the server 102 stores the trained feature extraction model. In this way, the server 102 uses the stored feature extraction model to extract the feature of the text sent by the terminal 101.
[0081] In a possible implementation, the terminal 101 is installed with an application provided by the server 102, and the terminal 101 can implement functions such as data transmission and message interaction through the application. Optionally, the application is an application in the operating system of the terminal 101, or an application provided by a third party. For example, the application is a guide application, which has a guide function. Of course, the guide application can also have other functions, such as a comment function, a shopping function, a navigation function, a game function, and the like.
[0082] Taking the guide application as an example, the terminal 101 is configured to log in to the guide application based on an account, acquire the input text through the guide application, and send the text to the server 102 through the guide application. The server 102 is configured to receive the text sent by the terminal 101, extract the feature of the text, determine the standard medical word corresponding to the text based on the feature of the text and the plurality of standard medical words, send the medical department corresponding to the standard medical word to the terminal 101, and display the medical department through the guide application.
[0083] Figure 2 is a flowchart of a medical word determination method provided by the embodiments of the present application. The method is executed by a computer device, as shown in Figure 2 The method comprises the following steps.
[0084] 201. The computer device encodes a text to obtain a first feature of the text, and the text comprises a non-standard medical word.
[0085] Wherein, the text is any text, for example, the text is a dialogue text containing non-standard medical words, or is any non-standard medical word. The first feature can be represented in any form, for example, the first feature is represented in the form of a vector. The standard medical word refers to a professional term in the medical field for describing diseases, examinations, operations, medications, anatomical structures, etc., and the non-standard medical word refers to a non-professional term for describing diseases, examinations, operations, medications, anatomical structures, etc.
[0086] In the embodiment of the present application, the first feature of the text is obtained in an encoded manner, so as to ensure that the obtained first text can represent the text.
[0087] 202. The computer device generates a graph network based on the text and the plurality of entity words in the text, wherein a node in the graph network is used to represent the text and the entity words, and an edge between any two nodes in the graph network is used to represent a containing relationship between the contents represented by the two nodes.
[0088] In the embodiment of the present application, the text includes entity words, and the containing relationship between the text and the entity words in the text can reflect the information of the text at different levels. Therefore, the graph network is generated based on the text and the plurality of entity words in the text, so that the nodes in the graph network can represent the text and the entity words, and the edges between the nodes in the graph network can represent the containing relationship between the contents represented by the nodes. In this way, when the graph network is used to obtain the feature of the text subsequently, the hierarchical relationship between the words in the text can be captured more carefully, and the accuracy of the feature can be ensured.
[0089] The entity word refers to a word with an entity meaning, that is, the entity word is important information in the text and can affect the meaning expressed by the text. In the plurality of entity words, the non-standard medical word can include one or more entity words, or the non-standard medical word is an entity word. Each entity word includes one or more characters, and in the case of multiple characters, the multiple characters are consecutive characters in the text. For example, any entity word includes 3 characters, and the 3 characters are consecutive in the text, such as the entity word including the 1st to 3rd characters in the text, or the entity word including the 2nd to 4th characters in the text. In the plurality of entity words, different entity words contain different characters, and different entity words can or can not overlap. Any two entity words have overlapping characters, for example, the first entity word and the second entity word have overlapping characters, the first entity word includes the 1st and 2nd characters in the text; the second entity word includes the 2nd, 3rd and 4th characters in the text; the first entity word and the second entity word have overlapping characters, which are the 2nd characters in the text. In the plurality of entity words, there can be entity words with a containing relationship, and the two entity words with a containing relationship are also called nested entity words, one of the two entity words is nested in the other. For example, the entity word 1 in the text is "paralytic intestinal obstruction", the entity word 2 is "paralytic", the entity word 3 is "intestine", and the entity word 4 is "blockage". The entity word 1 includes the entity word 2, the entity word 3 and the entity word 4, that is, the entity word 1 and the entity word 2 have a containing relationship, the entity word 1 and the entity word 3 have a containing relationship, and the entity word 1 and the entity word 4 have a containing relationship.
[0090] In the embodiments of the present application, the content represented by the node is the text or the entity word represented by the node, and the graph network includes nodes for representing the text and nodes for representing each entity word. In the graph network, there is an edge between the node for representing the text and at least one node for representing the entity word, and there can be an edge between the node for representing any entity word and the node for representing another entity word. The edge between any two nodes means that the two nodes are connected in the graph network.
[0091] 203, the computer device acquires the second feature of the text based on the graph network.
[0092] In the embodiments of the present application, the nodes in the graph network are used to represent the text and the entity word, and the edges between any two nodes in the graph network are used to represent the containing relationship between the contents represented by the two nodes. Based on the graph network, the second feature of the text can be acquired, the hierarchical relationship between the words in the text can be captured more carefully, and the accuracy of the second feature can be ensured.
[0093] The second feature is used to represent the text, and the second feature can be represented in any form, for example, the second feature is represented in the form of a vector.
[0094] 204, the computer device fuses the first feature and the second feature to obtain a third feature of the text, and the third feature is a feature obtained by performing feature extraction on the text.
[0095] In the embodiments of the present application, the first feature is obtained by encoding the text, and the second feature is obtained based on the graph network, the fusion of the first feature and the second feature enriches the information contained in the third feature, and can improve the accuracy of the third feature, thereby ensuring the accuracy of feature extraction.
[0096] The fusion refers to any feature fusion method, for example, the fusion refers to summation, weighted summation, weighted average, etc.
[0097] 205, the computer device determines the standard medical word corresponding to the text from a plurality of standard medical words based on the third feature.
[0098] In the embodiments of the present application, the third feature is a feature obtained by performing feature extraction on the text, and the third feature can accurately express the meaning of the text, so that the standard medical word corresponding to the text can be distinguished from other standard medical words based on the third feature, thereby ensuring the accuracy of the determined standard medical word.
[0099] In the scheme provided by the embodiments of the present application, it is considered that different standard medical words represent different meanings but may contain many same characters, for any text containing a non-standard medical word, not only the text is directly encoded to obtain the first feature of the text, but also a graph network is generated by using the text and the entity words in the text to generate a graph network, and the second feature of the text is obtained by using the graph network, and then the two features are fused as the final feature of the text, and then the standard medical word corresponding to the text is determined from a plurality of standard medical words based on the final feature of the text. Since the graph network can reflect the inclusion relationship between the text and the entity words in the text, the hierarchical relationship between the words in the text can be captured more carefully, the information contained in the feature of the text is enriched, the final feature obtained can accurately express the meaning of the text, the accuracy of the final feature is ensured, and the accuracy of feature extraction is ensured. Therefore, the standard medical word corresponding to the text can be distinguished from other standard medical words based on the third feature, thereby ensuring the accuracy of the determined standard medical word.
[0100] In Figure 2 Based on the embodiments shown in the embodiments of the present application, the entity words can be extracted from the text according to the number of characters to generate a graph network, and the second feature is obtained by using the features of the nodes in the network graph. The specific process is described in the following embodiments.
[0101] Figure 3 is a flowchart of a medical word determination method provided by an embodiment of the present application, which is executed by a computer device, as shown in the figure, the method comprises the following steps. Figure 3
[0102] 301. The computer device encodes the text to obtain a first feature of the text, the text comprising a non-standard medical word.
[0103] In a possible implementation manner, the step 301 comprises: encoding each character in the text to obtain a feature of each character; and fusing the features of the characters in the text to obtain the first feature.
[0104] In the embodiment of the present application, the text comprises one or more characters, the features of the characters are extracted first, and then the features of the characters in the text are fused, so as to ensure that the obtained first feature matches the characters included in the text, and further ensure the accuracy of the first feature.
[0105] The features of the characters can be represented in any form, for example, the features of the characters are represented in the form of vectors.
[0106] Optionally, taking the text comprising multiple characters as an example, the process of obtaining the first feature comprises: encoding each character in the text to obtain a first encoding feature of each character, updating the first encoding feature of each character based on the first encoding features of the multiple characters to obtain a second encoding feature of each character, and fusing the second encoding features of the multiple characters in the text to obtain the first feature.
[0107] In the embodiment of the present application, in the medical scenario, considering that different standard medical words represent different meanings but may contain many same characters, the encoding manner is adopted, each character in the text is encoded first, and then the first encoding features of the multiple characters in the text are used to update the first encoding feature of each character, so that the second encoding feature of each character incorporates the features of other characters in the text, and then the fusion manner is adopted to obtain the first feature for representing the text. In this way, the relevance between different characters in the text is considered, the context information of the text is incorporated into the first feature, so that the first feature matches the characters included in the text, the first feature can accurately represent the meaning of the text, even if the medical word corresponding to the text contains many same characters with other medical words, the first feature can distinguish the standard medical word corresponding to the text from other standard medical words, and the accuracy of the first feature is ensured.
[0108] The first encoding feature and the second encoding feature can be represented in any form, for example, in the form of a vector. In the embodiments of the present application, for any character, the first encoding feature and the second encoding feature of the character are the features of the character described above.
[0109] Optionally, the process of updating the first encoding feature of each character includes: determining the similarity between each character and the first character based on the first encoding features of the plurality of characters and the first encoding feature of the first character; and performing weighted fusion on the first encoding features of the plurality of characters based on the similarity between each character and the first character to obtain the second encoding feature of the first character.
[0110] The first character is any character in the plurality of characters. In the embodiments of the present application, the similarity can be obtained in any manner, for example, in the form of Euclidean distance, based on the first encoding features of the plurality of characters and the first encoding feature of the first character.
[0111] In the embodiments of the present application, the first character is any character in the plurality of characters. When updating the first encoding feature of the first character, the similarity between the first encoding feature of the first character and the first encoding features of the plurality of characters is used as a weight, the first encoding features of the plurality of characters are weighted and fused, and the fused feature is taken as the second encoding feature of the first character. The second encoding feature of the first character not only contains the first encoding feature of the first character, but also considers the relationship between different characters in the text, and the first encoding features of other characters are fused according to the relevance between different characters in the text. The features of each character contain context information, which enriches the information contained in the second encoding feature and ensures the accuracy of the second encoding feature.
[0112] Optionally, the first encoding feature is represented in the form of a feature vector, and the process of determining the similarity includes: determining the product of the first encoding feature of each character and the first encoding feature of the first character, determining the sum of the plurality of products, and determining the similarity between each character and the first character based on the ratio of the product corresponding to each character to the sum.
[0113] For example, the text includes 5 characters, in the case of obtaining the first encoding feature of the 5 characters, taking the first character in the text as an example, the product of the first encoding feature of each character and the first encoding feature of the first character is called the first product, the product of the first encoding feature of each character and the first encoding feature of the first character is determined, that is, 5 first products are obtained, the sum value of the 5 first products is determined, the ratio of each product to the sum value is determined as the similarity between each character and the first character, that is, 5 similarities are obtained. The product of the first encoding feature of each character and the corresponding similarity is taken as the second product, the product of the first encoding feature of each character and the corresponding similarity is determined, 5 second products are obtained, and the sum of the 5 second products is determined as the second encoding feature of the first character.
[0114] It should be noted that the present application embodiment is only illustrated by taking the first character in the plurality of characters as an example, and in another embodiment, the second encoding feature of each character can be obtained in the above manner.
[0115] In a possible implementation manner, the process of obtaining the first feature can be implemented based on the first network model, and at the same time, the process of obtaining the first feature includes: encoding the text based on the first network model to obtain the first feature of the text.
[0116] The first network model has the function of encoding the input text, and the first network model is any network model, for example, the first network model is BERT.
[0117] In the present application embodiment, since the first network model is used to encode the input text to output the obtained feature, the first feature of the text is obtained based on the first network model to ensure the accuracy of the first feature.
[0118] Optionally, the process of obtaining the first feature based on the first network model includes: generating a character sequence based on the text, the character sequence including a start character, each character in the text and an end character; inputting the character sequence into the first network model; encoding each character in the character sequence based on the first network model to obtain a first feature sequence, the first feature sequence including a first encoding feature of the start character, a first encoding feature of each character in the text and a first encoding feature of the end character, updating each first encoding feature based on the first feature sequence to obtain a second feature sequence, the second feature sequence including a second encoding feature of the start character, a second encoding feature of each character in the text and a second encoding feature of the end character, and determining the second encoding feature of the start character as the first feature of the text.
[0119] wherein the start character and the end character are special characters, the start character is used to represent the beginning of the text, and the end character is used to represent the end of the text. For example, the start character is CLS (Classification), and the end character is SEP (Separator). The process of updating each first encoding feature based on the first feature sequence is the same as the process of updating the first encoding feature of each character based on the first encoding feature of the character, which will not be repeated here.
[0120] In the embodiments of the present application, the start character is only used to represent the beginning of the text, regardless of the characters contained in the text, and the feature of the start character is obtained by weighted fusion of the first encoding features of the plurality of characters in the text. Therefore, the second encoding feature of the start character is determined as the first feature of the text to ensure the accuracy of the first feature.
[0121] For example, the first network model is BERT, the text is X, and the text X = {x1, x2, …, xt}, where t is the number of characters contained in the text, t is an integer greater than 2, x1, x2, …, xt respectively represent the 1st character, the 2nd character, and the tth character in the text. t} is input into BERT, and BERT encodes each character in the character sequence to obtain a first feature sequence, the first feature sequence being {υ'0, υ'1, υ'2, …, υ't}, where υ'0 is used to represent the first encoding feature of the start character, υ'1, υ'2, …, υ't respectively represent the first encoding feature of the 1st character, the first encoding feature of the 2nd character, and the first encoding feature of the tth character in the text. t t} is input into BERT, and BERT encodes each character in the character sequence to obtain a first feature sequence, the first feature sequence being {υ'0, υ'1, υ'2, …, υ't}, where υ'0 is used to represent the first encoding feature of the start character, υ'1, υ'2, …, υ't respectively represent the first encoding feature of the 1st character, the first encoding feature of the 2nd character, and the first encoding feature of the tth character in the text. t t+1} is input into BERT, and BERT encodes each character in the character sequence to obtain a first feature sequence, the first feature sequence being {υ'0, υ'1, υ'2, …, υ't}, where υ'0 is used to represent the first encoding feature of the start character, υ'1, υ'2, …, υ't respectively represent the first encoding feature of the 1st character, the first encoding feature of the 2nd character, and the first encoding feature of the tth character in the text. t t+1} is input into BERT, and BERT encodes each character in the character sequence to obtain a first feature sequence, the first feature sequence being {υ'0, υ'1, υ'2, …, υ't}, where υ'0 is used to represent the first encoding feature of the start character, υ'1, υ'2, …, υ't respectively represent the first encoding feature of the 1st character, the first encoding feature of the 2nd character, and the first encoding feature of the tth character in the text. t t+1} is input into BERT, and BERT encodes each character in the character sequence to obtain a first feature sequence, the first feature sequence being {υ'0, υ'1, υ'2, …, υ't}, where υ'0 is used to represent the first encoding feature of the start character, υ'1, υ'2, …, υ't respectively represent the first encoding feature of the 1st character, the first encoding feature of the 2nd character, and the first encoding feature of the tth character in the text. t respectively represent the second encoding features of the first character, the second character, and the tth character in the text, and υ t+1 is used to represent the second encoding feature corresponding to the termination character. That is, the process of obtaining the second feature sequence based on the BERT satisfies the following relationship:{υ0, υ1, υ2, …, υ t , υ t+1}=BERT{[CLS, x1, x2, …, x t , SEP]}.
[0122] Optionally, in the case of obtaining the second feature sequence, based on the first network model, based on the second feature sequence, each second encoding feature is updated respectively to obtain a third feature sequence, the third feature sequence includes a third encoding feature of the starting character, a third encoding feature of each character in the text, and a third encoding feature of the termination character; the third encoding feature of the starting character is determined as the first feature of the text.
[0123] In the embodiments of the present application, each character in the text is first encoded, and then the first encoding feature of each character is updated based on the first encoding features of multiple characters in the text, so that the second encoding feature of each character incorporates the features of other characters in the text, considering the relevance of different characters in the text, which can ensure the accuracy of the character features, and then the second encoding features of different characters are fused in a fusion manner to obtain the first feature for representing the text, so as to ensure that the first feature matches the characters included in the text, and further ensure the accuracy of the first feature.
[0124] 302、The computer device extracts a candidate word corresponding to the character quantity from the text based on each character quantity in the multiple character quantities, and the candidate word includes the characters of the character quantity.
[0125] In the embodiments of the present application, the character quantity refers to the number of characters contained in the candidate word extracted from the text, and the multiple character quantities are used to extract candidate words containing different numbers of characters from the text, so as to extract as many candidate words as possible from the text to ensure that the entity words in the text can be screened from the candidate words in the subsequent process, and further ensure the accuracy of the entity words determined in the subsequent process.
[0126] Different character quantities correspond to different numerical values, for example, the multiple character quantities are 1, 2, 3, or 4. In the case that the candidate word includes multiple characters, the multiple characters are consecutive characters in the text.
[0127] In a possible implementation, the process of extracting the candidate words includes: starting from the first character of the text, traversing each character in the text according to any character quantity, and determining the character currently traversed and the first quantity of characters after the character currently traversed as the candidate words corresponding to the character quantity in the process of traversing the characters.
[0128] The first quantity is the difference between the character quantity and 1. For example, the character quantity is 2, and the first quantity is 1.
[0129] For example, the text includes 10 characters, and the character quantity is 2. Starting from the first character of the text, each character in the text is traversed according to any character quantity, and in the process of traversing the characters, the first character and the second character are determined as a candidate word, the second character and the third character are determined as a candidate word, and the third character and the fourth character are determined as a candidate word. In this way, nine candidate words including two characters can be extracted from the text.
[0130] In a possible implementation, the process of obtaining the plurality of character quantities includes: determining the plurality of character quantities based on the number of characters in the text.
[0131] The maximum character quantity in the plurality of character quantities is the difference between the number of characters included in the text and 1, and the plurality of character quantities are a plurality of character quantities from 1 to the maximum character quantity.
[0132] In the embodiment of the present application, considering that the number of characters included in different texts may be different, the plurality of character quantities are determined based on the number of characters in the text, so that as many candidate words as possible can be extracted from the text according to the plurality of character quantities, so as to subsequently screen out accurate candidate words from the candidate words.
[0133] For example, the text includes 5 characters, and the maximum character quantity in the plurality of character quantities is 4, so the plurality of character quantities include 4, which are 1, 2, 3, and 4.
[0134] It should be noted that the above is only an example of any character quantity, and in another embodiment, for each character quantity, the candidate words corresponding to each character quantity can be extracted from the text according to the above method.
[0135] 303, the computer device classifies each candidate word to obtain a word type to which each candidate word belongs, and the word type includes an entity word type or a non-entity word type.
[0136] In the embodiment of the present application, since the candidate words are extracted from the text according to the plurality of character quantities, there may be words without entity meaning in the extracted candidate words, and therefore, each candidate word is classified to determine whether the candidate word has entity meaning, so that the entity words can be screened from the candidate words subsequently.
[0137] The entity word type indicates that the word type has an entity meaning, and the non-entity word type indicates that the word type does not have an entity meaning. For example, the text is "abdominal pain", and the extracted candidate words "abdominal" and "pain" have entity meanings, and the candidate word "department" does not have an entity meaning.
[0138] In a possible implementation, the classification process includes: classifying the feature of each candidate word to obtain the word type to which each candidate word belongs.
[0139] The feature of the candidate word can represent the candidate word. The feature of the candidate word can be represented in any form, for example, the feature of the candidate word is represented in the form of a vector.
[0140] In the embodiment of the application, the feature of the candidate word is used to represent the candidate word, and the classification of the feature of the candidate word is used to obtain the word type to which the candidate word belongs, thereby ensuring the accuracy of the word type.
[0141] Optionally, the classification process includes: performing feature transformation on the feature of the candidate word to obtain a classification vector, the classification vector including values of multiple dimensions, and determining the word type corresponding to the dimension corresponding to the maximum value in the classification vector as the word type to which the candidate word belongs.
[0142] The multiple dimensions correspond to the word types one by one.
[0143] In the embodiment of the application, each value in the classification vector is used to represent the possibility of the candidate word belonging to each word type, and therefore, the word type corresponding to the dimension corresponding to the maximum value in the classification vector is determined as the word type to which the candidate word belongs, thereby ensuring the accuracy of the determined word type.
[0144] Optionally, the entity word type includes multiple types, and the multiple dimensions in the classification vector correspond to the multiple entity word types and non-entity word types one by one.
[0145] For example, in the medical field, the entity word type includes four types, which are disease type, operation type, modification type, and relationship type, and the classification vector includes values of five dimensions.
[0146] Optionally, the process of obtaining the feature of the candidate word includes: obtaining the feature of each character in the text, and for any candidate word, fusing the features of the characters included in the candidate word to obtain the feature of the candidate word.
[0147] In the embodiment of the application, for each candidate word, the features of the characters included in the candidate word are fused, so that the fused feature can match the characters included in the candidate word, thereby ensuring the accuracy of the feature of the candidate word.
[0148] Wherein, the feature of each character is the first encoding feature of each character in step 301 or the second encoding feature of each character or the third encoding feature of each character, and the feature of each character is obtained in the same way as step 301, which is not repeated here.
[0149] 304. The computer device generates a graph network based on the text and the candidate words belonging to the entity word type, wherein nodes in the graph network are used to represent the text and the entity words, and edges between any two nodes in the graph network are used to represent the containing relationship between the contents represented by the two nodes.
[0150] In the embodiment of the present application, the number of characters refers to the number of characters contained in the candidate words extracted from the text. Based on the number of characters, candidate words containing different numbers of characters are extracted from the text, as many candidate words as possible are extracted from the text, each candidate word is classified to determine whether the candidate word has an entity meaning, and candidate words belonging to the entity word type can be determined from the entity meaning. Then, based on the text and the candidate words belonging to the entity word type, a graph network is generated. In this way, accurate entity words can be extracted from the text, and the graph network can reflect the containing relationship between the text and the entity words in the text, so that the hierarchical relationship between the text and the entity words can be more detailed and the accuracy of the graph network can be ensured.
[0151] In a possible implementation, the process of generating the graph network includes: creating text nodes and entity word nodes in the graph network based on the text and the candidate words belonging to the entity word type, and determining the candidate words belonging to the entity word type in the text as multi-level entity words based on the containing relationship of the candidate words belonging to the entity word type in the text, connecting the text nodes with the first-level entity word nodes, and connecting each level of entity word nodes with the next level of entity word nodes contained, to obtain the graph network.
[0152] Wherein, the text node is used to represent the text, and the entity word node is used to represent the candidate word belonging to the entity word type. In the multi-level entity word, the next level of entity word of the first-level entity word is the second-level entity word, and the next level of entity word of the second-level entity word is the third-level entity word. Similarly, the upper level of entity word of the third-level entity word is the second-level entity word, and the upper level of entity word of the second-level entity word is the first-level entity word. The first-level entity word is only contained in the text and not contained in other entity words, the second-level entity word is only contained in the text and the first-level entity word and not contained in other levels of entity words, and the third-level entity word is contained in the text, the first-level entity word and the second-level entity word, and so on. Any first-level entity word can only be contained in any upper level of entity word. For example, the text includes three first-level entity words, and any second-level entity word in the text can only be contained in any of the three first-level entity words.
[0153] In the embodiment of the present application, based on the inclusion relationship of the candidate words belonging to the entity word type in the text, the candidate words belonging to the entity word type in the text are determined as multi-level entity words, the text node is connected with the first-level entity word node, and each level entity word node is connected with the contained next level entity word node, so as to obtain the graph network, so that the graph network can reflect the inclusion relationship of the entity words in the text, and further can more detailedly reflect the hierarchical relationship between the words in the text, thereby ensuring the accuracy of the graph network.
[0154] In the embodiment of the present application, by constructing a hierarchical graph network, the text node in the graph network is the root node, and the text is finely divided according to the text node and the multi-level word node, so that the key information can be extracted from the graph network subsequently, which helps to further enhance the richness and depth of the text content, and ensures the accuracy of the obtained second feature subsequently.
[0155] For example, taking the medical scene as an example, the word types include entity word types and non-entity word types, the entity word types include disease types, operation types, anatomical types, position types, modification types, relationship types, etc., and the nodes of different word types can be matched to form complete medical words, the node for representing the text in the graph network is the root node in the graph network, the root node is the parent node of the first-level entity word node, the first-level entity word node is the parent node of the second-level word node, the text is "paralytic ileus with puncture erosion", the entity words belonging to the entity word type in the text are "paralytic ileus", "with", "puncture erosion", "paralytic", "ileus", "ileus", "puncture", "erosion", based on the inclusion relationship of the entity words, the entity words are divided into multi-level entity words, the first-level entity words are "paralytic ileus", "with", "puncture erosion", the second-level entity words are "paralytic", "ileus", "ileus", "puncture", "erosion", the text node is connected with the first-level entity word node, and the first-level entity word node is connected with the contained second-level entity node, and a hierarchical graph network is formed through the dependency and nesting relationship, and the obtained graph network is as shown in Figure 4 .
[0156] It should be noted that the embodiment of the present application takes extracting entity words from the text according to the number of characters and generating a graph network as an example for description, and in another embodiment, the steps 302-304 are not performed, but other ways are adopted to generate a graph network based on the text and the multiple entity words in the text.
[0157] 305、The computer device obtains the feature of each node in the graph network, updates the feature of the node based on the feature of the neighbor node, the neighbor node and the node have an edge between them, and the feature of the node indicates the text or entity word represented by the node.
[0158] In the embodiments of the present application, the features of the nodes are equivalent to the features of the text or entity words represented by the nodes, and the edges between any two nodes are equivalent to the connection of the two nodes. The existence of the edges between any two nodes in the graph network indicates that the contents represented by the two nodes have a containing relationship. Therefore, the features of the nodes are updated based on the features of the neighbor nodes, so that the updated features of each node incorporate the features of the contents represented by the neighbor nodes, thereby ensuring the accuracy of the updated features of the nodes.
[0159] In the embodiments of the present application, for any node in the graph network, the content represented by the node contains the contents represented by the neighbor nodes, or the contents represented by the neighbor nodes contain the content represented by the node.
[0160] In a possible implementation, the first feature is obtained by fusing the features of the characters in the text, and the feature of a character is obtained by encoding each character in the text. The process of obtaining the feature of the node includes: determining the feature of the node based on the feature of a target character, the target character being a character included in the content represented by the node.
[0161] In the embodiments of the present application, since the features of each character in the text have been obtained in the process of obtaining the first feature, when obtaining the feature of the node in the graph network, the features of each character can be reused to determine the feature of the node according to the characters included in the content represented by the node, so as to ensure the accuracy of the feature of the node and avoid repeatedly obtaining the features of the characters in the text, thereby ensuring the efficiency of obtaining the feature of the node.
[0162] Optionally, the process of determining the feature of the node based on the feature of the target character includes: in the case where the content represented by the node includes a plurality of target characters, fusing the features of the plurality of target characters to obtain the feature of the node; or in the case where the content represented by the node includes one target character, determining the feature of the target character as the feature of the node.
[0163] In the embodiments of the present application, in the case where the content represented by the node includes a plurality of target characters, the features of the plurality of target characters are fused; and in the case where the content represented by the node includes one target character, the feature of the target character is directly taken as the feature of the node, so that the feature of the node can represent the included target characters, thereby ensuring the accuracy of the feature of the node.
[0164] Optionally, the process of fusing the features of the plurality of target characters includes: determining the sum of the features of the plurality of target characters, and determining the ratio of the sum to the number of the target characters as the feature of the node.
[0165] In the embodiments of the present application, the average pooling is adopted to determine the feature of the node, so that the plurality of target characters included in the node have the same proportion in the feature of the node, thereby ensuring the accuracy of the feature of the node.
[0166] 306、The computer device fuses the updated features of the plurality of nodes in the graph network to obtain a second feature.
[0167] In the embodiment of the present application, considering that the edges between any two nodes in the graph network indicate that the contents represented by the two nodes have a containment relationship, the graph network can reflect the hierarchical relationship between the words in the text, therefore, the feature of the node is updated based on the features of the neighbor nodes, so that the updated feature of each node incorporates the features of the contents represented by the adjacent nodes, ensuring the accuracy of the updated feature of the node, and then fusing the updated features of the plurality of nodes in the graph network can take into account the containment relationship between the text and the entity words in the text, and take into account the context information of the text, enriching the information contained in the second feature and ensuring the accuracy of the second feature.
[0168] In a possible implementation manner, the step 306 includes: determining a sum value of the updated features of the plurality of nodes in the graph network, and determining a ratio of the sum value to the number of nodes in the graph network as the second feature; or determining the sum value of the updated features of the pluralityity of nodes in the graph network as the second feature.
[0169] In the embodiment of the present application, the average pooling manner or the summation manner is adopted to determine the second feature, so that the second feature can reflect the features of the nodes, ensuring the accuracy of the second feature.
[0170] Optionally, the second feature satisfies the following relationship:
[0171]
[0172] wherein g is used to represent the second feature, is used to represent the updated feature of the i th node in the graph network, i is a Z integer greater than 0 and less than or equal to Z, and Z is used to represent the number of nodes in the graph network, Z is an integer greater than 1.
[0173] It should be noted that the embodiment of the present application adopts the manner of updating first and then fusing, and uses the features of the nodes in the network graph to obtain the second feature, while in another embodiment, the steps 305-306 are not required to be performed, but other manners are adopted to obtain the second feature of the text based on the graph network.
[0174] 307、The computer device fuses the first feature and the second feature to obtain a third feature of the text, and the third feature is a feature obtained by performing feature extraction on the text.
[0175] In a possible implementation manner, the step 307 includes: performing weighted fusion on the first feature and the second feature to obtain the third feature of the text.
[0176] In the embodiment of the present application, since the first feature is obtained by directly encoding the text, and the second feature is obtained based on the graph network, the first feature and the second feature are fused into the third feature in a weighted fusion manner, so as to adjust the proportion of the first feature and the second feature in the third feature, and to ensure the accuracy of the third feature.
[0177] Optionally, the first feature, the second feature and the third feature satisfy the following relationship:
[0178] m = a * u0 + (1-a) * g
[0179] wherein m is used to represent the third feature, u0 is used to represent the first feature, a is used to represent the weight of the first feature, a is a hyperparameter not less than 0 and not more than 1, g is used to represent the second feature, and 1-a is used to represent the weight of the second feature.
[0180] 308. The computer device determines the standard medical word corresponding to the text from the plurality of standard medical words based on the third feature.
[0181] In a possible implementation manner, the step 308 comprises: determining the similarity between the text and each standard medical word based on the third feature and the features of the plurality of standard medical words; and determining the standard medical word with the maximum similarity from the plurality of standard medical words as the standard medical word corresponding to the text.
[0182] In the embodiment of the present application, in the medical scenario, it is considered that different standard medical words represent different meanings but may contain more same characters, that is, the similarity of medical words representing different meanings may be large, and if only the first feature is obtained by encoding the text, the text is directly matched with the standard medical word according to the first feature, it is easy to determine that the similarity with the text is large but the expressed meaning is different. Therefore, the feature extraction manner provided in the present application is adopted to extract the entity word from the text, and then the graph network is constructed according to the inclusion relationship between the text and the entity word, and then the third feature of the text is obtained in combination with the graph network, so as to capture the inclusion relationship between nodes, so as to be able to obtain different levels of information in the text, and to ensure that the third feature can accurately represent the text. In this way, the third feature of the text and the features of the plurality of standard medical words are used to determine the standard medical word corresponding to the text from the plurality of standard medical words, so as to be able to consider the fine-grained difference between different standard medical words, to be able to distinguish the text from the standard medical word with similar text but different expressed meaning, to ensure the accuracy of the determined standard medical word corresponding to the text, and to ensure the accuracy of the standard medical word mapping.
[0183] For example, the text is "left lung upper lobe tubercle", the standard medical word corresponding to the text is "pulmonary tuberculosis nodules", the standard medical word similar to the text but expressing different meanings is "brain tubercle", if the first feature is used to determine the standard medical word corresponding to the text from multiple standard medical words, "brain tubercle" may be determined as the standard medical word corresponding to "left lung upper lobe tubercle", and according to the feature extraction manner provided in the application, the third feature of the text is obtained, and the standard medical word corresponding to the text is determined as "pulmonary tuberculosis nodules" from multiple standard medical words according to the third feature.
[0184] In the scheme provided in the application embodiment, it is considered that different standard medical words represent different meanings but may contain more same characters, for any text containing a non-standard medical word, not only the text is directly encoded to obtain the first feature of the text, but also a graph network is generated by using the text and entity words in the text to generate a graph network, the second feature of the text is obtained by using the graph network, and then the two features are fused as the final feature of the text, and then based on the final feature of the text, the standard medical word corresponding to the text is determined from multiple standard medical words, so that the graph network can reflect the containing relationship between the text and the entity words in the text, so that the hierarchical relationship between the words in the text can be captured more carefully, the information contained in the feature of the text is enriched, and the accuracy of the final feature obtained can accurately express the meaning of the text, ensuring the accuracy of the final feature obtained, and then ensuring the accuracy of the feature extraction, so that the standard medical word corresponding to the text can be distinguished from other standard medical words based on the third feature, to ensure the accuracy of the determined standard medical word.
[0185] It should be noted that, in the above Figure 3 Based on the embodiment shown in the above, the candidate words are extracted from the text based on the number of characters and the word type to which the candidate words belong is determined based on an entity recognition model, that is, the steps 302 and 303 are performed based on the entity recognition model. The entity recognition model is any neural network model, for example, the entity recognition model is a named entity recognition (NER) model.
[0186] In a possible implementation manner, the entity recognition model includes a word extraction sub-model, a feature extraction sub-model and a classification sub-model, and the process of determining the candidate words in the text includes: encoding each character in the text based on the feature extraction sub-model to obtain the feature of each character; extracting the candidate words corresponding to the number of characters from the text according to the number of characters in the plurality of character numbers based on the word extraction sub-model, determining the feature of each candidate word based on the feature of each character in the text; and classifying the feature of each candidate word based on the classification sub-model to obtain the word type to which each candidate word belongs.
[0187] wherein the feature extraction sub-model is configured to obtain features of each character in the text, the feature extraction sub-model is any neural network model, for example, the feature extraction sub-model is BERT. The process of obtaining features of each character in the text by the feature extraction sub-model is the same as the process of obtaining features of each character in the text by the first network model described above, and will not be repeated here. The word extraction sub-model is configured to extract candidate words corresponding to each number of characters from the text according to the number of characters, and the word extraction sub-model is any neural network model. Optionally, the word extraction sub-model determines the number of characters based on the number of characters in the text. The classification sub-model is configured to classify the features of the candidate words to determine the word type to which the candidate words belong. The classification sub-model is any neural network model, for example, the classification sub-model is Softmax (normalization function).
[0188] For example, the text is X, the text X = {x1, x2, …, xt}, where x1, x2, x t t represent the 1st character, the 2nd character, the tth character in the text respectively; t is the number of characters contained in the text, t is an integer greater than 1, the candidate word extracted from the text based on the entity recognition model is h t , e and f are used to represent the span of the candidate word h e,f to represent that the candidate word h e,f contains the e-th character to the f-th character in the text, e ≤ f ≤ t, t is the number of characters contained in the text, t is an integer greater than 1, e is an integer greater than 0 and not greater than f, f is an integer not greater than t; each candidate word h e,f is classified by the entity recognition model to obtain the word type to which each candidate word h e,f belongs, the word type includes an entity word type and a non-entity word type, the entity word type includes a disease type, an operation type, an anatomy type, a position type, a modification type, a relationship type, etc., the disease type, the operation type, the anatomy type, the position type, the modification type, the relationship type, and the non-entity word type are represented by the letters {D, O, B, I, J, R, N} respectively. The process of classifying the candidate word is equivalent to a 7-classification process, as shown in Figure 5 , Figure 5 wherein e is greater than f in the black part of the word, Figure 5 the black part in is an invalid result, Figure 5 the blank part in is used to represent that the corresponding candidate word belongs to N, Figure 5 the blank part in is used to represent that the corresponding candidate word is a non-entity word type; the candidate word h e,f is "paralysis", the word type to which the candidate word h 1,3 belongs is J, i.e., the candidate word h 1,3 belongs to the modification type; the candidate word h 1,3 is "disease", the word type to which the candidate word h 4,4For "intestine", alternative word h 4,4 The word type of the alternative word h is B 4,4 The alternative word h belongs to the anatomical type. Taking the feature extraction sub-model in the entity recognition model as an example, the character sequence input into the BERT is [CLS, x1, x2, …, x t , SEP], where CLS is the start character and SEP is the end character. The feature sequence output by the BERT satisfies the following relationship: {υ0, υ1, υ2, …, υ t , υ t+1} = BERT{[CLS, x1, x2, …, x t , SEP]}, where υ0 is used to represent the feature corresponding to the start character, and υ1, υ2, and υ t represent the features of the 1st character, the 2nd character, and the tth character in the text, respectively, and υ t+1 is used to represent the feature corresponding to the end character. The feature of the alternative word h e,f obtained based on the entity recognition model satisfies the following relationship: where υ e,f is used to represent the feature of the alternative word h e,f , and υ m is used to represent the feature of the mth character in the text, m is an integer not less than e and not greater than f, t is the number of characters contained in the text, t is an integer greater than 1, e is an integer greater than 0 and not greater than f, and f is an integer not greater than t.
[0189] In a possible implementation, before obtaining the type to which the alternative word in the text belongs by using the entity recognition model, the entity recognition model needs to be trained. The training process of the entity recognition model includes: obtaining a sample text, a plurality of character quantities in the sample text, alternative words corresponding to the character quantities, and sample word types to which the alternative words belong; encoding each character in the sample text based on the entity recognition model to obtain the feature of each character; extracting the alternative word corresponding to the character quantity from the sample text according to each character quantity in the plurality of character quantities; determining the feature of each alternative word based on the feature of each character in the sample text; classifying the feature of each alternative word to obtain the predicted word type to which each alternative word belongs; and training the entity recognition model based on the predicted word type to which each alternative word belongs and the sample word type to which each alternative word belongs.
[0190] In the embodiment of the present application, the sample word type to which the alternative word belongs is the real word type to which the alternative word belongs, the sample word type includes an entity word type or a non-entity word type, the predicted word type to which each alternative word belongs is obtained based on the entity recognition model, and the difference between the predicted word type to which each alternative word belongs and the sample word type to which each alternative word belongs can reflect the accuracy of the entity recognition model. Therefore, the entity recognition model is trained based on the predicted word type to which each alternative word belongs and the sample word type to which each alternative word belongs, so as to improve the accuracy of the entity recognition model.
[0191] Optionally, the process of training the entity recognition model includes: determining a loss value based on the predicted word type to which each alternative word belongs and the sample word type to which each alternative word belongs, and training the entity recognition model based on the loss value.
[0192] Optionally, the loss value satisfies the following relationship:
[0193]
[0194] wherein B is a weight that the entity recognition model focuses on learning, υ e,f is used to represent the predicted word type of the alternative word containing the e th to f th character in the text, y e,f is used to represent the sample word type of the alternative word containing the e th to f th character in the text. e,f
[0195] On the basis of the above Figure 3 indicated embodiment, the embodiment of the present application can also adopt an attention mechanism to update the features of the nodes, and the specific process is described in the following embodiment.
[0196] Figure 6 is a flowchart of a medical word determination method provided by an embodiment of the present application. The method is executed by a computer device, as shown in Figure 6 , the method includes:
[0197] 601. The computer device encodes the text to obtain first features of the text, and the text includes non-standard medical words.
[0198] 602. The computer device extracts an alternative word corresponding to each character quantity from the text based on each character quantity in the plurality of character quantities, and the alternative word includes the characters of the character quantity.
[0199] 603、The computer device classifies each candidate word to obtain a word type to which each candidate word belongs, the word type including an entity word type or a non-entity word type.
[0200] 604、The computer device generates a graph network based on the text and the candidate words belonging to the entity word type, nodes in the graph network being used to represent the text and the entity words, and edges between any two nodes in the graph network being used to represent a containing relationship between contents represented by the two nodes.
[0201] 605、The computer device obtains, for each node in the graph network, a feature of the node.
[0202] The steps 601-605 are the same as the steps 301-305 described above, and thus are not described herein again.
[0203] 606、The computer device fuses the features of the nodes and the features of the nodes to obtain first fused features of the nodes, the features of the nodes indicating the text or the entity words represented by the nodes.
[0204] In an embodiment of the present application, for each node in the graph network, an attention mechanism is adopted to update the feature of any node based on the features of multiple nodes in the graph network, and the feature of any node is fused with itself to obtain the first fused features, so that the first fused features can be used to obtain the weights used in feature updating subsequently.
[0205] The first fused features can be represented in any form, for example, in the form of a vector.
[0206] In a possible implementation manner, the step 606 includes: splicing the features of the nodes with themselves to obtain the first fused features of the nodes; or summing the features of the nodes with themselves to obtain the first fused features.
[0207] In the embodiment of the present application, the features of the nodes can be fused with themselves in the splicing or summing manner to ensure the accuracy of the first fused features.
[0208] In a possible implementation manner, the step 607 includes: determining the first fused features of the nodes by fusing the features of the nodes with the features of the nodes based on first weights, the first weights being weights corresponding to first word types, and the first word types being word types to which contents represented by the nodes belong.
[0209] In the embodiment of the present application, the weights corresponding to different word types can be different, and the features of the nodes are fused with themselves according to the weights corresponding to the word types to which the contents represented by the nodes belong, so as to consider the influence of the word types to which the contents represented by the nodes belong and ensure the accuracy of the first fused features.
[0210] The word type includes an entity word type or a non-entity word type. The word type to which the text belongs is the non-entity word type, and the word type to which the entity word belongs is the entity word type. In the case where the entity word type includes multiple types, the entity word type belongs to any one of the prompt word types.
[0211] Optionally, the process of obtaining the first fusion feature of the node includes: determining a product of the first weight and the feature of the node, and fusing the product to obtain the first fusion feature of the node.
[0212] Optionally, the first fusion feature of the node satisfies the following relationship:
[0213]
[0214] wherein D1 is used to represent the first fusion feature, exp(·) is used to represent a natural exponential function, η is used to represent a Leaky ReLU (a kind of linear rectification function) activation function, a is used to represent a weight matrix, the weight matrix is a constant matrix, T is used to represent the transpose of a matrix, W1 is used to represent the first weight, the first weight is a constant matrix, h i is used to represent the feature of the node, i is used to represent the serial number of the node, i is an integer greater than 0, W1h i is used to represent the product of the first weight and the feature of the node, is used to represent splicing.
[0215] 607, the computer device fuses the feature of the node and the feature of the neighbor node to obtain a second fusion feature of the neighbor node, and the neighbor node and the node have an edge.
[0216] In the embodiment of the application, for each node in the graph network, an attention mechanism is adopted, the feature of any node is updated based on the features of multiple nodes in the graph network, the feature of any node is fused with the features of neighbor nodes to obtain a second fusion feature of the neighbor node, so that the second fusion feature can be used to obtain the weight used for feature updating subsequently.
[0217] wherein the second fusion feature can be represented in any form, for example, the second fusion feature is represented in the form of a vector.
[0218] In a possible implementation manner, the step 607 includes: based on the first weight and the second weight, the feature of the node and the feature of the neighbor node are weighted fused to obtain the second fusion feature, the first weight is a weight corresponding to a first word type, the first word type is a word type to which the content represented by the node belongs, and the second weight is a weight corresponding to a second word type, the second word type is a word type to which the content represented by the neighbor node belongs.
[0219] In the embodiments of the present application, the weights corresponding to different word types can be different, and the feature of the node and the feature of the neighbor node are fused according to the weight corresponding to the word type to which the content represented by the node belongs, so as to consider the influence of the word type to which the content represented by the node belongs and ensure the accuracy of the second fused feature.
[0220] The word type to which the node of the graph network belongs includes an entity word type or a non-entity word type, and the word type to which the node belongs can be the same as or different from the word type to which the neighbor node belongs.
[0221] Optionally, the process of obtaining the second fused feature of the neighbor node includes: determining a third product and a fourth product, fusing the third product and the fourth product to obtain the second fused feature of the neighbor node, where the third product is a product of the first weight and the feature of the node, and the fourth product is a product of the second weight and the feature of the neighbor node.
[0222] Optionally, the second fused feature satisfies the following relationship:
[0223]
[0224] where D2 is used to represent the second fused feature, exp(·) is used to represent a natural exponential function, η is used to represent a Leaky ReLU activation function, a is used to represent a weight matrix, the weight matrix is a constant matrix, T is used to represent a transpose of a matrix, W1 is used to represent the first weight, the first weight is a constant matrix, h i is used to represent the feature of the node, i is used to represent a serial number of the node, i is an integer greater than 0, W1h i is used to represent a product of the first weight and the feature of the node, is used to represent splicing, W2 is used to represent the second weight, the second weight is a constant matrix, h j is used to represent the feature of the neighbor node, j is used to represent a serial number of the node, j is an integer greater than 0, W2h j is used to represent a product of the second weight and the feature of the neighbor node.
[0225] It should be noted that the above is only an example of one neighbor node of the node, and in the case where the node has multiple neighbor nodes, the second fused feature of each neighbor node is determined in the above manner.
[0226] 608, the computer device fuses the first fused feature and the second fused feature to obtain a third fused feature.
[0227] The third fused feature can be represented in any form, for example, the third fused feature is represented in the form of a vector.
[0228] In a possible implementation, the step 608 includes: determining, as the third fusion feature, a sum value of the first fusion feature and the second fusion feature.
[0229] In the embodiments of the present application, the fusion feature corresponding to the node and the fusion feature corresponding to the neighbor node are fused in a summing manner, so as to ensure the accuracy of the third fusion feature.
[0230] Optionally, in the case where the node has multiple neighbor nodes, the second fusion features are obtained according to the step 607, that is, the second fusion feature corresponding to each neighbor node is obtained, and the process of obtaining the third fusion feature includes: determining, as the third fusion feature, a sum value of the first fusion feature and the multiple second fusion features.
[0231] In the embodiments of the present application, in the case where the node has multiple neighbor nodes, the multiple second fusion features can be obtained, and the fusion feature corresponding to the node and the fusion feature corresponding to the neighbor node are fused in a summing manner, so as to ensure the accuracy of the third fusion feature.
[0232] 609, the computer device determines, as the weight of the node, a ratio of the first fusion feature to the third fusion feature, and determines, as the weight of the neighbor node, a ratio of the second fusion feature to the third fusion feature.
[0233] In the embodiments of the present application, for any fusion feature in the first fusion feature or the second fusion feature, the ratio of the fusion feature to the third fusion feature can reflect the proportion of the fusion feature in the third fusion feature, and therefore, the ratio of the first fusion feature to the third fusion feature is determined as the weight of the node, and the ratio of the second fusion feature to the third fusion feature is determined as the weight of the neighbor node, so that the weight can reflect the importance of the neighbor node and the node itself to the node, and the accuracy of the weight is ensured.
[0234] It should be noted that the embodiments of the present application are described by taking any neighbor node of the node as an example, and in the case where the node has multiple neighbor nodes, the ratio of the second fusion feature to the third fusion feature of each neighbor node is determined as the weight of each neighbor node.
[0235] 610, the computer device performs weighted fusion on the features of the node and the features of the neighbor node based on the weight of the node and the weight of the neighbor node, to obtain the updated features of the node.
[0236] In the embodiment of the present application, the attention mechanism is adopted, the feature of any node is updated based on the features of multiple nodes in the graph network, the feature of any node is fused with itself to obtain a first fused feature, the feature of the node is fused with the features of neighbor nodes to obtain a second fused feature, the first fused feature is fused with the second fused feature to obtain a third fused feature, the ratio of the first fused feature to the third fused feature is determined as the weight of the node, and the ratio of the second fused feature to the third fused feature is determined as the weight of the neighbor node, so that the weights can reflect the importance of the neighbor nodes and the node itself to the node, and then the features of the node and the neighbor nodes are weighted and fused according to the weights, so as to fuse the features according to the importance of the neighbor nodes and the node itself to the node, to ensure the accuracy of the updated features of the node.
[0237] In a possible implementation manner, the step 610 comprises: determining a fifth product and a sixth product, the fifth product being a product of the weight of the node and the feature of the node, the sixth product being a product of the weight of the neighbor node and the feature of the neighbor node, and a sum of the fifth product and the sixth product being determined as the updated feature of the node.
[0238] In the embodiment of the present application, according to the importance of the neighbor nodes and the node itself to the node, the features of the neighbor nodes or the node are first multiplied by the respective weights, and then the sum of the obtained products is taken as the updated feature of the node, so as to ensure that the feature of the node can be updated according to the importance of the neighbor nodes and the node itself to the node, to ensure the accuracy of the updated feature of the node.
[0239] Optionally, the updated feature of the node satisfies the following relationship:
[0240]
[0241] wherein, is used to represent the updated feature of the i th node in the graph network, i is an integer greater than 0; σ (·) is used to represent a RELU activation function, is used to represent a node set corresponding to the i th node, the node set comprising the i th node and neighbor nodes of the i th node, h j is used to represent the feature of the j th node in the node set corresponding to the i th node, j is an integer greater than 0, and α ij is used to represent the weight of the j th node in the node set corresponding to the i th node; exp (·) is used to represent a natural exponential function, η is used to represent a Leaky ReLU activation function, a and W are both used to represent a weight matrix, the weight matrix being a constant matrix, and T is used to represent the transpose of a matrix, is used to represent concatenation, h uis used to represent the feature of the jth node in the node set corresponding to the ith node, and j is an integer greater than 0. Optionally, the third feature of the text is obtained based on the feature extraction model, and the weight matrix W is a diagonal matrix. In the embodiment of the present application, the weight matrix W is a diagonal matrix, which can reduce the parameter amount of the feature extraction model and improve flexibility.
[0242] Optionally, the feature of the jth node in the node set corresponding to the ith node satisfies the following relationship:
[0243]
[0244] wherein h j is used to represent the feature of the jth node in the node set corresponding to the ith node, and the jth node in the node set corresponding to the ith node includes the cth character to the bth character in the text, and u k is used to represent the kth character in the text, k is an integer not less than c and not greater than b, c≤b≤t, t is the number of characters contained in the text, t is an integer greater than 1, c is an integer greater than 0 and not greater than b, and b is an integer not greater than t.
[0245] Optionally, on the basis of the above-mentioned embodiments, in the case of obtaining the third feature of the text based on the feature extraction model, R independent attention mechanisms can be used to calculate the updated features of the nodes in parallel to ensure the stability of the attention learning of the feature extraction model. Then the updated features of the nodes satisfy the following relationship:
[0246]
[0247] wherein, is used to represent the updated feature of the ith node in the graph network, and i is an integer greater than 0; σ(·) is used to represent the RELU activation function, is used to represent the node set corresponding to the ith node, and the node set includes the ith node and the neighbor nodes of the ith node, and h i is used to represent the feature of the jth node in the node set corresponding to the ith node, and j is an integer greater than 0, is used to represent the weight of the jth node in the node set corresponding to the ith node under the kth attention mechanism; k is an integer greater than 0 and not greater than R, R is an integer greater than 1, exp(·) is used to represent the natural exponential function, η is used to represent the Leaky ReLU activation function, and a k and W k are both used to represent the weight matrix under the kth attention mechanism, the weight matrix is a constant matrix, and T is used to represent the transpose of the matrix, is used to represent concatenation, and h uis used to represent the feature of the u-th node in the node set corresponding to the i-th node, u is an integer greater than 0.
[0248] Optionally, the weight matrix W in the above relationship is a weight corresponding to a word type to which the content represented by the node belongs, and the weight of the j-th node in the node set corresponding to the i-th node satisfies the following relationship:
[0249]
[0250] wherein h i is used to represent the feature of the i-th node in the graph network, i is an integer greater than 0. is used to represent the node set corresponding to the i-th node, the node set including the i-th node and neighbor nodes of the i-th node, h j is used to represent the feature of the j-th node in the node set corresponding to the i-th node, j is an integer greater than 0, and a ij is used to represent the weight of the j-th node in the node set corresponding to the i-th node; exp(·) is used to represent a natural exponential function, η is used to represent a Leaky ReLU activation function, a is used to represent a weight matrix, the weight matrix is a constant matrix, T is used to represent the transpose of a matrix, W1 is used to represent a weight corresponding to a word type to which the content represented by the i-th node in the graph network belongs, and W2 is used to represent a weight corresponding to a word type to which the content represented by the j-th node in the node set corresponding to the i-th node belongs. is used to represent concatenation, h u is used to represent the feature of the u-th node in the node set corresponding to the i-th node, u is an integer greater than 0, and W3 is used to represent a weight corresponding to a word type to which the content represented by the u-th node in the node set corresponding to the i-th node belongs.
[0251] It should be noted that the embodiments of the present application are used to update the feature of any node in the graph network, and in another embodiment, for each node in the graph network, the feature of each node is updated according to the above steps 606-610 to obtain the updated feature of each node in the graph network. Moreover, in the process of updating the feature of each node, the feature of the node and the feature of the neighbor node are the features before updating.
[0252] It should be noted that the embodiments of the present application are used to update the feature of any node in the graph network, and in another embodiment, for each node in the graph network, the feature of each node is updated according to the above steps 606-610 to obtain the updated feature of each node in the graph network. Moreover, in the process of updating the feature of each node, the feature of the node and the feature of the neighbor node are the features before updating.
[0253] 611, the computer device fuses the updated features of the plurality of nodes in the graph network to obtain a second feature.
[0254] 612、The computer device fuses the first feature and the second feature to obtain a third feature of the text, and the third feature is a feature extracted from the text.
[0255] 613、The computer device determines a standard medical word corresponding to the text from a plurality of standard medical words based on the third feature.
[0256] The steps 611-613 are the same as the steps 306-308 described above, and will not be described here.
[0257] In the scheme provided by the embodiments of the present application, it is considered that different standard medical words represent different meanings but may contain more same characters. For any text containing a non-standard medical word, not only is the text directly encoded to obtain a first feature of the text, but also a graph network is generated using the text and entity words in the text to generate a graph network, and the second feature of the text is obtained using the graph network. Then, the two features are fused as the final feature of the text, and then the standard medical word corresponding to the text is determined from a plurality of standard medical words based on the final feature of the text. In this way, since the graph network can reflect the inclusion relationship between the text and the entity words in the text, the hierarchical relationship between the words in the text can be captured in more detail, the information contained in the feature of the text is enriched, the final feature obtained can accurately express the meaning of the text, the accuracy of the final feature is ensured, and then the accuracy of the feature extraction is ensured. In this way, based on the third feature, the standard medical word corresponding to the text can be distinguished from other standard medical words to ensure the accuracy of the determined standard medical word.
[0258] On the basis of the embodiments shown in the above Figure 3 On the basis of the embodiments shown in the above
[0259] Figure 7 is a flowchart of a medical word determination method provided by an embodiment of the present application. The method is executed by a computer device, as shown in Figure 7 The method comprises the following steps.
[0260] 701、The computer device encodes the text to obtain a first feature of the text, and the text comprises a non-standard medical word.
[0261] 702、The computer device extracts a candidate word corresponding to the character quantity from the text based on each character quantity in the plurality of character quantities, and the candidate word comprises characters of the character quantity.
[0262] 703、The computer device classifies each candidate word to obtain a word type to which each candidate word belongs, and the word type comprises an entity word type or a non-entity word type.
[0263] 704、The computer device generates a graph network based on the text and the candidate words belonging to the entity word type, nodes in the graph network are used to represent the text and the entity words, and edges between any two nodes in the graph network are used to represent an inclusion relationship between contents represented by the two nodes.
[0264] 705、The computer device obtains features of each node in the graph network.
[0265] The steps 701-705 are the same as the steps 301-305 described above, and thus will not be described here.
[0266] 706、The computer device updates, for each node in the graph network, a current feature of the node based on current features of neighbor nodes, to obtain an i-th updated feature of the node, where i is an integer greater than 0.
[0267] In the embodiments of the present application, for each node in the graph network, the features of the node can be updated based on the features of the neighbor nodes in multiple times, so that the updated features of the node incorporate the features of the neighbor nodes, and the updated features of the node incorporate the features of the neighbor nodes after each update, so that the updated features of the node incorporate the features of the neighbor nodes and the features of the neighbor nodes of the neighbor nodes after multiple updates, that is, the updated features of each node also incorporate the features of the indirectly connected nodes, so as to enrich the information contained in the updated features of each node and ensure the accuracy of the updated features of each node.
[0268] The current features of the neighbor nodes refer to the features of the neighbor nodes before the i-th update, and the current features of the node refer to the features of the node before the i-th update. For example, i is 1, the current features of the neighbor nodes are the initial features of the neighbor nodes, and the current features of the node are the initial features of the node, which are the features obtained according to the step 705. For another example, i is an integer greater than 1, the current features of the neighbor nodes are the i-1-th updated features of the node, and the current features of the node are the i-1-th updated features of the node.
[0269] It should be noted that the process of updating the features of the node for the i-th time is the same as the steps 606-610 described above, and thus will not be described here.
[0270] 707、The computer device updates, for each node in the graph network, the i-th updated features of the node based on the i-th updated features of the neighbor nodes, to obtain i+1-th updated features of the node.
[0271] In the embodiment of the present application, in the process of updating the features of the nodes in the graph network for multiple times, the initial features of each node in the graph network are used to update the features of each node for the first time according to the steps 706 or 707, to obtain the features of each node after the first update, and in the case where the features of each node after the first update in the graph network are obtained, the features of each node after the first update are updated for the second time according to the steps 706 or 707, to obtain the features of each node after the second update, and so on. After the features of the nodes in the graph network are updated for multiple times, the features of each node after the nth update in the graph network can be obtained, where n represents the total number of updates, and n is an integer greater than 1.
[0272] For example, the neighbor nodes of node 1 in the graph network include node 2, node 3 and node 4, and the neighbor nodes of node 3 include node 1, node 5 and node 6. The features of node 1 after the first update include not only the features of node 1, but also the features of node 2, node 3 and node 4. The features of node 3 after the first update include not only the features of node 3, but also the features of node 1, node 5 and node 6. Then, when the features of node 1 in the graph network are updated for the second time according to the step 707, the features of node 1 after the first update are updated based on the features of node 2 after the first update, the features of node 3 after the first update and the features of node 4 after the first update, to obtain the features of node 1 after the second update. Since the features of node 3 after the first update include the features of node 5 and node 6, the features of node 1 after the second update also include the features of node 5 and node 6, which is equivalent to that the features of node 1 after the second update include the features of the indirectly connected nodes, thereby enriching the information contained in the features of node 1.
[0273] It should be noted that the process of updating the features of the nodes for the i+1th time is the same as the steps 606-610, which will not be repeated here.
[0274] It should be noted that the embodiment of the present application is described by taking the updating of the features of the nodes in the graph network for multiple times as an example, and in another embodiment, the steps 706-707 are not performed, but other ways are adopted to update the features of the nodes based on the features of the neighbor nodes.
[0275] 708, the computer device fuses the updated features of the multiple nodes in the graph network to obtain second features.
[0276] 709, the computer device fuses the first features and the second features to obtain third features of the text, and the third features are the features obtained by performing feature extraction on the text.
[0277] 710、The computer device determines the standard medical word corresponding to the text from the plurality of standard medical words based on the third feature.
[0278] The steps 708-710 are the same as the steps 306-308 described above, and thus are not described again here.
[0279] In the scheme provided by the embodiments of the present application, it is considered that different standard medical words represent different meanings but may contain more same characters. For any text containing a non-standard medical word, not only is the text directly encoded to obtain the first feature of the text, but also a graph network is generated by using the text and the entity words in the text to generate the graph network, the second feature of the text is obtained by using the graph network, and then the two features are fused as the final feature of the text. Then, the standard medical word corresponding to the text is determined from the plurality of standard medical words based on the final feature of the text. In this way, since the graph network can reflect the containing relationship between the text and the entity words in the text, the hierarchical relationship between the words in the text can be captured in more detail, the information contained in the feature of the text is enriched, the final feature obtained can accurately express the meaning of the text, the accuracy of the final feature is ensured, and then the accuracy of the feature extraction is ensured. In this way, the standard medical word corresponding to the text can be distinguished from other standard medical words based on the third feature, so as to ensure the accuracy of the determined standard medical word.
[0280] It should be noted that, in the above Figures 2 to 7 On the basis of the embodiments shown in the above, before the features of the plurality of nodes in the graph network are fused, the features of the nodes can also be updated based on the type features corresponding to the nodes. In this case, the method further includes: for each node in the graph network, updating the feature of the node based on the type feature corresponding to the node, and the type feature indicates the word type to which the content represented by the node belongs.
[0281] In the embodiments of the present application, for each node in the graph network, the type feature corresponding to the node is used to update the feature of the node, so that the updated feature of the node can be integrated into the feature of the word type to which the content represented by the node belongs. The influence of the word type to which the content represented by the node belongs is considered, and the accuracy of the updated feature of the node is ensured.
[0282] The type feature can be represented in any form, for example, the type feature is represented in the form of a vector.
[0283] In a possible implementation, the timing of updating the node features based on the type features includes: updating the features of each node based on the type features corresponding to each node before updating each feature, and then updating the updated features of each node again according to the steps 305, 606-610 or 706-707; or updating the updated features of each node based on the type features corresponding to the node after obtaining the updated features of each node in the graph network according to the steps 305, 606-610 or 706-707.
[0284] For example, in combination with the above-described Figure 3 embodiment, the above-described steps 301-304 are performed first, then the features of each node in the graph network are obtained, the features of each node are updated based on the type features corresponding to each node, and the updated features of each node are obtained; for each node in the graph network, the updated features of the node are updated based on the updated features of the neighbor nodes, and then the above-described steps 306-307 are performed again.
[0285] For another example, in combination with the above-described Figure 3 embodiment, the above-described steps 301-305 are performed first, and then the updated features of each node are updated again based on the type features corresponding to each node after the updated features of each node in the graph network are obtained, the features of the nodes in the graph network are fused again according to the step 306, and the second features are obtained, and then the above-described step 307 is performed again.
[0286] In the above-described Figures 2 to 7 embodiment, the standard medical words corresponding to the text can be used for subsequent processing after the standard medical words corresponding to the text are obtained.
[0287] In a possible implementation, in the inquiry scene, the text is an input inquiry text, and the inquiry text includes a non-standard medical word. The method further includes: in a case where the standard medical word corresponding to the text is determined, determining a treatment department corresponding to the standard medical word, and outputting the treatment department; or in a case where the standard medical word corresponding to the text is determined, outputting detail information corresponding to the standard medical word.
[0288] The treatment department corresponding to the standard medical word indicates a department required for treatment of a disease corresponding to the standard medical word. The detail information corresponding to the standard medical word is used to describe the disease corresponding to the standard medical word in detail. The inquiry text is used to inquire about the treatment department or the detail information of a certain disease, for example, the inquiry text is "where to go for abdominal pain", or the inquiry text is "what is pulmonary tuberculosis".
[0289] In this embodiment of the application, when the standard medical term corresponding to the text is determined, the department to be treated can be output, or the detailed information corresponding to the standard medical term can be output, so as to realize the treatment guidance plan or realize the symptom viewing, which facilitates the user's treatment or understanding of certain symptoms and facilitates the user's operation. While ensuring the accuracy of the determined standard medical term, the accuracy of the output department to be treated or detailed information is also guaranteed.
[0290] It is important to note that medical diagnostic standardization plays a crucial role in the process of medical informatization. Its aim is to ensure the accurate transmission and effective communication of medical information by establishing a unified medical terminology and coding system. In medical settings, the same medical concepts are often expressed in multiple different ways, leading to inconsistencies and difficulties in communication. The core objective of diagnostic standardization is to convert non-standardized terms and expressions used in medical settings into standardized terms that conform to a specific medical standard system (i.e., standardized medical terms). For example, by mapping clinical diagnoses, surgical procedures, medications, and examination results to standardized medical terms within the medical standard system, the recording, storage, retrieval, and analysis of medical information can be made more accurate and efficient.
[0291] Diagnostic standardization involves the standardized processing of medical information, enabling seamless integration and sharing between different medical information systems. This helps improve the quality of care, support clinical decision-making, strengthen medical oversight, and promote medical research. Through a unified medical language, healthcare professionals can better understand and apply medical information, thereby providing patients with more precise and personalized medical services. Simultaneously, standardized medical terminology lays the foundation for medical information analysis and the application of artificial intelligence in the medical field, propelling medical informatization to a higher level.
[0292] For example, a user accesses the mapped interface through a terminal, and the terminal displays the mapped interface, which looks like... Figure 8 As shown, the mapping interface includes an input area, a mode selection area, and a results display area. The input area is used to input the word to be mapped. For example, the input area may display "abdominal pain". The mode selection area can specify the standard medical thesaurus to be searched. The mode selection area displays an "unrestricted" label to indicate that the standard medical thesaurus to be searched is not limited. When the user clicks the search option on the terminal, if there are 3 standard medical thesauruses, the results display area will display 3 search results to indicate the standard medical terms corresponding to "abdominal pain" in the 3 standard medical thesauruses.
[0293] The embodiment of the application provides a diagnosis standardization method based on a graph network, extracts candidate words belonging to different entity word types from a text, and builds a graph network based on the text and the candidate words belonging to different entity word types. In the process of creating the graph network, a text node and an entity word node of the candidate words belonging to the entity word types are created, the text node is taken as a root node, the nodes in the graph network are connected according to the containing relationship between the plurality of entity word nodes, and when the graph network is constructed, the entity word types to which each candidate word belongs, such as a disease type, an operation type, an anatomical type, a position type, a modification type and a relationship type, are considered to form a graph network with rich semantics. The graph network is processed by a graph neural network to capture the complex relationship between the nodes, so that more detailed information of the text can be extracted, and then the features of each node are obtained, the accuracy of the features of the nodes is ensured, the influence of different entity word types is considered, the accuracy of the features of each node is further ensured, and then a second feature of the text is obtained based on the features of the nodes in the graph network. In this way, not only the local keywords are focused on, but also the hierarchical relationship and interaction of different keywords are associated and understood, the medical terms and the context relationship thereof can be more comprehensively understood and represented, the fine-grained differences between different medical words can be considered, the understanding ability of the complex context and polysemy in the medical text is enhanced, the problem that the local information is excessively focused on and the overall context is ignored is helped to ensure the accuracy of the third feature, so that the text and a standard medical word similar to the text but expressing different meanings can be distinguished based on the third feature, the accuracy of the determined standard medical word corresponding to the text is ensured, and then the accuracy of the standard medical word mapping is ensured, so that more accurate diagnosis standardization mapping is realized, and the effect of diagnosis standardization is improved.
[0294] Taking a text including a non-standard medical word as an example, on the basis of the above-mentioned embodiment, the medical word determination method can be realized based on the feature extraction model in the embodiment of the application, and before that, the feature extraction model needs to be trained. The process of training the feature extraction model is described in detail in the following embodiment.
[0295] Figure 9 A flowchart of a model training method provided by the embodiment of the application, which is executed by a computer device, as shown in Figure 9 The method comprises the following steps.
[0296] 901. The computer device obtains a sample text, a positive sample medical word and a negative sample medical word. The sample text includes a non-standard medical word, the positive sample medical word is a standard medical word corresponding to the sample text, and the negative sample medical word is any standard medical word except the positive sample medical word.
[0297] The sample text is any text including a non-standard medical word, for example, a sample text is a non-standard medical word or an inquiry text containing a non-standard medical word.
[0298] 902. The computer device encodes the sample text based on the feature extraction model to obtain first sample features of the sample text.
[0299] The feature extraction model is any network model.
[0300] In a possible implementation, the feature extraction model includes a first sub-model, and the step 902 includes: encoding the sample text based on the first sub-model to obtain the first sample features of the sample text.
[0301] The first sub-model is used to encode the text. The first sub-model is any network model, for example, the first sub-model is BERT. In the embodiments of the present application, the first sub-model is the same as the first network model in the above-described embodiments, and details are not described herein again. Figure 3 The first sub-model is used to encode the text. The first sub-model is any network model, for example, the first sub-model is BERT. In the embodiments of the present application, the first sub-model is the same as the first network model in the above-described embodiments, and details are not described herein again.
[0302] 903. The computer device generates a sample graph network based on the feature extraction model, the sample text, and the multiple entity words in the sample text, wherein a node in the sample graph network is used to represent the text and the entity words, and an edge between any two nodes in the graph network is used to represent a containing relationship between contents represented by the two nodes.
[0303] 904. The computer device obtains second sample features of the sample text based on the feature extraction model and the sample graph network.
[0304] In a possible implementation, the feature extraction model includes a second sub-model and a first pooling layer, and the step 904 includes: obtaining, based on the second sub-model, a feature of each node in the graph network, updating the feature of the node based on features of neighbor nodes, fusing, based on the first pooling layer, multiple updated features of the nodes in the graph network to obtain the second features.
[0305] The second sub-model is any graph neural network model, for example, the second sub-model is a graph attention network (GAT). The graph neural network model is a kind of model used to process the graph network, which can capture complex relationships and dependencies between nodes to obtain features of the nodes and map the features of the nodes to the same feature space. The first pooling layer is any type of network layer, for example, the first pooling layer is an average pooling layer.
[0306] In a possible implementation, the feature extraction model comprises a plurality of second sub-models, and step 904 comprises: based on the ith second sub-model, updating, for each node in the graph network, the current feature of the node based on the current features of the neighbor nodes to obtain an ith updated feature of the node; based on the (i+1)th second sub-model, updating, based on the ith updated features of the neighbor nodes, the ith updated feature of the node to obtain an (i+1)th updated feature of the node, based on the n th updated features of the plurality of nodes, fusing, based on the first pooling layer, the n th updated features of the plurality of nodes to obtain the second features.
[0307] wherein i is an integer greater than 0, n is the number of the second sub-models, and n is an integer greater than 1.
[0308] 905. The computer device fuses the first sample features and the second sample features based on the feature extraction model to obtain third sample features of the sample text, wherein the third sample features are features obtained by performing feature extraction on the sample text.
[0309] In a possible implementation, the feature extraction model comprises a second pooling layer, and step 905 comprises: fusing the first sample features and the second sample features based on the second pooling layer to obtain the third sample features of the sample text.
[0310] wherein the second pooling layer is any type of network layer, for example, the second pooling layer is an average pooling layer.
[0311] Steps 902-905 are the same as steps 201-204 described above, and will not be described here.
[0312] 906. The computer device trains the feature extraction model based on the third sample features of the sample text, the features of the positive sample medical words, and the features of the negative sample medical words.
[0313] In the embodiments of the present application, since the positive sample medical word is the standard medical word corresponding to the sample text, and the negative sample medical word is any standard medical word other than the standard medical word corresponding to the sample text, the third sample feature is the feature obtained based on the feature extraction model, and the accuracy of the third feature can reflect the accuracy of the feature extraction model; the more similar the third sample feature is to the feature of the positive sample medical word, the more accurate the feature extraction model is, and the less similar the third sample feature is to the feature of the positive sample medical word, the less accurate the feature extraction model is; and the more similar the third sample feature is to the feature of the negative sample medical word, the less accurate the feature extraction model is, and the less similar the third sample feature is to the feature of the negative sample medical word, the more accurate the feature extraction model is. Therefore, after obtaining the third sample feature of the sample text based on the feature extraction model, the feature extraction model is trained based on the third sample feature of the sample text, the feature of the positive sample medical word, and the feature of the negative sample medical word. Not only does the third sample feature extracted by the feature extraction model become more similar to the feature of the positive sample medical word, but also the third sample feature extracted by the feature extraction model becomes less similar to the feature of the negative sample medical word, thereby retaining the similarity between the sample text and the positive sample medical word and distinguishing the sample text from the negative sample medical word, so that the standard medical word corresponding to the sample text can be accurately determined based on the third sample feature, and the accuracy of the feature extraction model is ensured.
[0314] In a possible implementation manner, the step 906 includes: determining a first similarity based on the third sample feature and the feature of the positive sample medical word; determining a second similarity based on the third feature of the sample text and the feature of the negative sample medical word; determining a loss value based on the first similarity and the second similarity, the loss value being negatively correlated with the first similarity and positively correlated with the second similarity; and training the feature extraction model based on the loss value.
[0315] The first similarity or the second similarity can be obtained in any manner, for example, the first similarity or the second similarity is determined in the manner of Euclidean distance.
[0316] In the embodiments of the present application, the first similarity is the similarity between the third sample feature and the feature of the positive sample medical word, and the second similarity is the similarity between the third feature of the sample text and the feature of the negative sample medical word. The loss value is determined based on the first similarity and the second similarity, the loss value being negatively correlated with the first similarity and positively correlated with the second similarity. The feature extraction model is trained based on the loss value, so that the first similarity is increased and the second similarity is decreased, thereby retaining the similarity between the sample text and the positive sample medical word and distinguishing the sample text from the negative sample medical word, so that the standard medical word corresponding to the sample text can be accurately determined based on the third sample feature, and the accuracy of the feature extraction model is ensured.
[0317] Optionally, the process of determining the loss value comprises: determining a sum value of the first similarity and the second similarity, determining a ratio of the first similarity and the sum value, determining a product of the ratio and -1 as the loss value.
[0318] It should be noted that the above embodiment is described by taking one sample text, one positive sample medical word and one negative sample medical word as an example, and in another embodiment, the feature extraction model is trained based on the sample text, the positive sample medical word and the plurality of negative sample medical words according to the steps 901-906. Then, the process of determining the loss value comprises: determining the first similarity based on the third sample feature of the sample text and the feature of the positive sample medical word; determining the second similarity corresponding to each negative sample medical word based on the third feature of the sample text and the feature of each negative sample medical word; determining a sum value of the first similarity and the plurality of second similarities, determining a ratio of the first similarity and the sum value, determining a product of the ratio and -1 as the loss value.
[0319] It should be noted that the above embodiment is described by taking one sample text, one positive sample medical word and one negative sample medical word as an example, and in another embodiment, the feature extraction model is trained based on the sample text, the positive sample medical word and the plurality of negative sample medical words according to the steps 901-906. Then, the process of determining the loss value comprises: determining the first similarity based on the third sample feature of the sample text and the feature of the positive sample medical word; determining the second similarity corresponding to each negative sample medical word based on the third feature of the sample text and the feature of each negative sample medical word; determining a sum value of the first similarity and the plurality of second similarities, determining a ratio of the first similarity and the sum value, determining a product of the ratio and -1 as the loss value.
[0320] For each sample text, the first similarity corresponding to the sample text is determined based on the third sample feature of the sample text and the feature of the positive sample medical word corresponding to the sample text; the plurality of second similarities corresponding to the sample text are determined based on the third feature of the sample text and the feature of each negative sample medical word corresponding to the sample text; the loss value corresponding to the sample text is determined based on the first similarity corresponding to the sample text and the second similarity corresponding to the sample text; and the feature extraction model is trained based on a sum value of the loss values corresponding to the plurality of sample texts.
[0321] Optionally, the sum value of the loss values corresponding to the plurality of sample texts satisfies the following relationship:
[0322]
[0323] Wherein, L is used to represent the sum value of the loss values corresponding to the plurality of sample texts, I is used to represent a sample text set, the sample text set comprises the plurality of sample texts, p is used to represent the serial number of the sample text in the sample text set, and p is an integer greater than 0; m pa third sample feature for representing the pth sample text, m q a feature for representing the positive sample standard word corresponding to the pth sample text, f(·) is a function for obtaining similarity, such as an Euclidean distance function; f(m p , m q ) represents the first similarity corresponding to the pth sample text, J p a negative sample medical word set for representing the pth sample text, the negative sample medical word set includes a plurality of negative sample medical words corresponding to the pth sample text; q' represents the serial number of the negative sample medical word in the negative sample medical word set corresponding to the pth sample text, m q′ a feature for representing the q'th negative sample medical word in the negative sample medical word set corresponding to the pth sample text, a loss value for representing the pth sample text.
[0324] On the basis of the above-mentioned embodiments, the feature extraction model includes a first sub-model, a second sub-model, a first pooling layer and a second pooling layer. For example, the first sub-model is BERT, the second sub-model is GNN (Graph Neural Network), and the first and second pooling layers are both average pooling layers. As shown in Figure 10 , the input of the first sub-model is a character sequence, which includes a start character and characters in the text. The first sub-model outputs a feature sequence, which includes a feature of the start character and features of each character in the text. The feature of the start character is the first feature of the text. After the entity recognition model filters out candidate words belonging to the entity word type from the text, the feature extraction model generates a graph network based on the candidate words belonging to the entity word type and the text. The second sub-model processes the graph network to obtain updated features of each node in the graph network. The first pooling layer fuses the updated features of multiple nodes in the graph network to obtain the second feature. The second pooling layer fuses the first sample feature and the second sample feature to obtain the third sample feature of the sample text. Optionally, the feature extraction model further includes a construction sub-model, which is used to construct the graph network, i.e., the construction sub-model generates the graph network based on the candidate words belonging to the entity word type and the text.
[0325] It should be noted that the embodiments of the present application are described by taking application in the medical field as an example, and in another embodiment, it can also be applied to other scenarios, so as to utilize the third feature of the text for other subsequent processing.
[0326] For example, in the intelligent dialogue scenario, the text is an input dialogue sentence. According to the scheme provided in the above embodiment, the third feature of the dialogue sentence can be obtained, and then the third feature is processed based on the question and answer model to obtain a reply sentence, so as to output the reply sentence to the terminal.
[0327] It should be noted that the third feature of the text can also be obtained based on the feature extraction model in the intelligent dialogue scenario. As for the training method of the feature extraction model in the intelligent dialogue scenario, the sample text, the positive sample reply sentence and the negative sample reply sentence are obtained, the third feature of the sample text is obtained according to the above steps 902-905, and then the feature extraction model is trained based on the third sample feature of the sample text, the feature of the positive sample reply sentence and the feature of the negative sample reply sentence.
[0328] It should be noted that the process of training the feature extraction model based on the third sample feature of the sample text, the feature of the positive sample reply sentence and the feature of the negative sample reply sentence is the same as the process of training the feature extraction model based on the third sample feature of the sample text, the feature of the positive sample medical word and the feature of the negative sample medical word, which will not be repeated here.
[0329] Figure 11 is a structural schematic diagram of a medical word determination apparatus provided by an embodiment of the present application, as shown in Figure 11 The apparatus comprises:
[0330] The extraction module 1101 is configured to encode the text to obtain the first feature of the text, wherein the text comprises non-standard medical words.
[0331] The generation module 1102 is configured to generate a graph network based on the text and the plurality of entity words in the text, wherein a node in the graph network is used to represent the text and the entity words, and an edge between any two nodes in the graph network is used to represent the containing relationship between the contents represented by the two nodes.
[0332] The acquisition module 1103 is configured to acquire the second feature of the text based on the graph network.
[0333] The fusion module 1104 is configured to fuse the first feature and the second feature to obtain the third feature of the text, wherein the third feature is a feature obtained by feature extraction on the text.
[0334] The determination module 1105 is configured to determine the standard medical word corresponding to the text from the plurality of standard medical words based on the third feature.
[0335] In a possible implementation, the acquisition module 1103 is configured to, for each node in the graph network, acquire a feature of the node, update the feature of the node based on features of neighbor nodes, the neighbor nodes having edges with the node, the feature of the node indicating a text or an entity word represented by the node, and fuse the features of the plurality of nodes in the graph network to obtain a second feature.
[0336] In another possible implementation, the acquisition module 1103 is configured to fuse the feature of the node and the feature of the node to obtain a first fused feature of the node, fuse the feature of the node and the feature of the neighbor node to obtain a second fused feature of the neighbor node, fuse the first fused feature and the second fused feature to obtain a third fused feature, determine a weight of the node as a ratio of the first fused feature to the third fused feature, and determine a weight of the neighbor node as a ratio of the second fused feature to the third fused feature, and perform weighted fusion on the feature of the node and the feature of the neighbor node based on the weight of the node and the weight of the neighbor node to obtain the updated feature of the node.
[0337] In another possible implementation, the acquisition module 1103 is configured to perform weighted fusion on the feature of the node and the feature of the neighbor node based on a first weight and a second weight to obtain the second fused feature, where the first weight is a weight corresponding to a first word type, the first word type being a word type to which content represented by the node belongs, and the second weight is a weight corresponding to a second word type, the second word type being a word type to which content represented by the neighbor node belongs.
[0338] In another possible implementation, the acquisition module 1103 is configured to, for each node in the graph network, update a current feature of the node based on a current feature of a neighbor node to obtain an i th updated feature of the node, i being an integer greater than 0, and update the i th updated feature of the node based on an (i+1) th updated feature of the neighbor node to obtain an (i+1) th updated feature of the node, in a case where the i th updated feature of each node is obtained.
[0339] In another possible implementation, as shown in FIG. 11, Figure 12 the apparatus further includes:
[0340] The update module 1106 is configured to, for each node in the graph network, update a feature of the node based on a type feature corresponding to the node, the type feature indicating a word type to which content represented by the node belongs.
[0341] In another possible implementation, the extraction module 1101 is configured to encode each character in the text to obtain a feature of each character, and fuse the features of the characters in the text to obtain a first feature.
[0342] The acquisition module 1103 is configured to determine the feature of the node based on the feature of the target character, the target character being a character included in the content represented by the node.
[0343] In another possible implementation, the acquisition module 1103 is configured to, in a case where the content represented by the node includes a plurality of target characters, fuse the features of the plurality of target characters to obtain the feature of the node; or in a case where the content represented by the node includes one target character, determine the feature of the target character as the feature of the node.
[0344] In another possible implementation, the extraction module 1101 is further configured to extract, based on each character quantity in the plurality of character quantities, an alternative word corresponding to the character quantity from the text, the alternative word including the characters in the character quantity; and classify each alternative word to obtain a word type to which each alternative word belongs, the word type including an entity word type or a non-entity word type.
[0345] The generation module 1102 is configured to generate a graph network based on the text and the alternative word belonging to the entity word type.
[0346] In another possible implementation, the determination module 1105 is configured to determine, based on the third feature and the features of the plurality of standard medical words, a similarity between the text and each standard medical word; and determine, as the standard medical word corresponding to the text, a standard medical word with the maximum similarity in the plurality of standard medical words.
[0347] It should be noted that the medical word determination apparatus provided in the above embodiments is only used as an example for the division of the above functional modules, and in actual applications, the above functions can be completed by different functional modules according to needs, that is, the internal structure of the computer device is divided into different functional modules to complete all or part of the functions described above. In addition, the medical word determination apparatus and the medical word determination method provided in the above embodiments belong to the same concept, and the specific implementation process is described in the method embodiments, which will not be repeated here.
[0348] Figure 13 is a structural schematic diagram of a model training apparatus provided by an embodiment of the present application, as shown in Figure 13 The apparatus includes:
[0349] The acquisition module 1301 is configured to acquire a sample text, a positive sample medical word, and a negative sample medical word, the sample text including a non-standard medical word, the positive sample medical word being a standard medical word corresponding to the sample text, and the negative sample medical word being any standard medical word other than the positive sample medical word.
[0350] The extraction module 1302 is configured to encode the sample text based on a feature extraction model to obtain a first sample feature of the sample text.
[0351] The generating module 1303 is configured to generate a sample graph network based on the feature extraction model, the sample text, and the plurality of entity words in the sample text, wherein nodes in the sample graph network are used to represent texts and entity words, and edges between any two nodes in the graph network are used to represent a containing relationship between contents represented by the two nodes.
[0352] The obtaining module 1301 is further configured to obtain a second sample feature of the sample text based on the feature extraction model and the sample graph network.
[0353] The fusion module 1304 is configured to fuse the first sample feature and the second sample feature based on the feature extraction model to obtain a third sample feature of the sample text, wherein the third sample feature is a feature obtained by performing feature extraction on the sample text.
[0354] The training module 1305 is configured to train the feature extraction model based on the third sample feature of the sample text, the feature of the positive sample medical word, and the feature of the negative sample medical word.
[0355] In a possible implementation, the training module 1305 is configured to determine a first similarity based on the third sample feature and the feature of the positive sample medical word, determine a second similarity based on the third sample feature of the sample text and the feature of the negative sample medical word, determine a loss value based on the first similarity and the second similarity, wherein the loss value is negatively correlated with the first similarity and positively correlated with the second similarity, and train the feature extraction model based on the loss value.
[0356] It should be noted that the model training apparatus provided in the above embodiments is only exemplified by the division of the above functional modules, and in actual applications, the above functions can be completed by different functional modules according to needs, that is, the internal structure of the computer device is divided into different functional modules to complete all or part of the functions described above. In addition, the model training apparatus and the model training method provided in the above embodiments belong to the same concept, and the specific implementation process is detailed in the method embodiments, which will not be repeated here.
[0357] The computer device provided in the embodiments of the present application includes a processor and a memory, and the memory stores at least one computer program, which is loaded and executed by the processor to implement the operations performed by the medical word determination method or the model training method of the above embodiments.
[0358] Optionally, the computer device is provided as a terminal. Figure 14A structure block diagram of a terminal 1400 provided by an example embodiment of the present application is shown. The terminal 1400 can be a smartphone, a tablet computer, a notebook computer, a desktop computer, a smart speaker, a smart watch, a smart voice interaction device, a smart home appliance, a vehicle-mounted terminal, etc. The terminal 1400 can also be referred to as a user equipment, a portable terminal, a laptop terminal, a desktop terminal, etc.
[0359] The terminal 1400 includes a processor 1401 and a memory 1402.
[0360] The processor 1401 can include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 1401 can be implemented in at least one of a hardware form of a DSP (Digital Signal Processing), an FPGA (Field-Programmable Gate Array), a PLA (Programmable Logic Array). The processor 1401 can also include a main processor and a coprocessor. The main processor is a processor for processing data in an awake state, also referred to as a CPU (Central Processing Unit). The coprocessor is a low-power processor for processing data in a standby state. In some embodiments, the processor 1401 can be integrated with a GPU (Graphics Processing Unit) for rendering and drawing content required to be displayed by a display screen. In some embodiments, the processor 1401 can further include an AI (Artificial Intelligence) processor for processing machine learning related computing operations.
[0361] The memory 1402 can include one or more computer-readable storage media, which can be non-transitory. The memory 1402 can also include a high-speed random access memory, and a non-volatile memory such as one or more disk storage devices, flash storage devices. In some embodiments, the non-transitory computer-readable storage medium in the memory 1402 is used to store at least one computer program for being executed by the processor 1401 to implement a medical word determination method or a model training method provided by the method embodiments of the present application.
[0362] In some embodiments, the terminal 1400 can further optionally include a peripheral device interface 1403 and at least one peripheral device. The processor 1401, the memory 1402 and the peripheral device interface 1403 can be connected through a bus or a signal line. Each peripheral device can be connected to the peripheral device interface 1403 through a bus, a signal line or a circuit board. Specifically, the peripheral device includes at least one of a radio frequency circuit 1404, a display screen 1405, a camera assembly 1406, an audio circuit 1407 and a power supply 1408.
[0363] The peripheral device interface 1403 can be used to connect at least one peripheral device related to I / O (Input / Output) to the processor 1401 and the memory 1402. In some embodiments, the processor 1401, the memory 1402 and the peripheral device interface 1403 are integrated on the same chip or circuit board; in some other embodiments, any one or two of the processor 1401, the memory 1402 and the peripheral device interface 1403 can be implemented on a separate chip or circuit board, and the present embodiments are not limited thereto.
[0364] The radio frequency circuit 1404 is used to receive and transmit RF (Radio Frequency) signals, also known as electromagnetic signals. The radio frequency circuit 1404 communicates with a communication network and other communication devices through electromagnetic signals. The radio frequency circuit 1404 converts electrical signals into electromagnetic signals for transmission, or converts received electromagnetic signals into electrical signals. Optionally, the radio frequency circuit 1404 includes an antenna system, an RF transceiver, one or more amplifiers, a tuner, an oscillator, a digital signal processor, a codec chipset, a subscriber identity module card, and the like. The radio frequency circuit 1404 can communicate with other terminals through at least one wireless communication protocol. The wireless communication protocol includes but is not limited to the World Wide Web, a metropolitan area network, an intranet, various generations of mobile communication networks (2G, 3G, 4G and 5G), a wireless local area network and / or a WiFi (Wireless Fidelity) network. In some embodiments, the radio frequency circuit 1404 can also include NFC (Near Field Communication) related circuitry, and the present application is not limited thereto.
[0365] The display screen 1405 is configured to display a UI (User Interface). The UI can include graphics, text, icons, video, and any combination thereof. When the display screen 1405 is a touch display screen, the display screen 1405 is further configured to capture touch signals on or above the surface of the display screen 1405. The touch signals can be input to the processor 1401 as control signals for processing. In this case, the display screen 1405 can also be configured to provide virtual buttons and / or virtual keyboard, also known as soft buttons and / or soft keyboard. In some embodiments, the display screen 1405 can be one, disposed on the front panel of the terminal 1400; in other embodiments, the display screen 1405 can be at least two, respectively disposed on different surfaces of the terminal 1400 or in a folding design; in other embodiments, the display screen 1405 can be a flexible display screen, disposed on a curved surface or a folding surface of the terminal 1400. Even, the display screen 1405 can also be disposed in an irregular shape, i.e., a special-shaped screen. The display screen 1405 can be made of LCD (Liquid Crystal Display), OLED (Organic Light-Emitting Diode), etc.
[0366] The camera assembly 1406 is configured to capture images or videos. Optionally, the camera assembly 1406 includes a front-facing camera and a rear-facing camera. The front-facing camera is disposed on the front panel of the terminal, and the rear-facing camera is disposed on the back of the terminal. In some embodiments, the rear-facing camera is at least two, which is any one of a main camera, a depth-of-field camera, a wide-angle camera, and a telephoto camera, to realize the background blur function of the main camera and the depth-of-field camera, the panoramic shooting and VR (Virtual Reality) shooting function of the main camera and the wide-angle camera, or other fusion shooting functions. In some embodiments, the camera assembly 1406 can further include a flash. The flash can be a single-color temperature flash or a dual-color temperature flash. The dual-color temperature flash refers to the combination of a warm light flash and a cold light flash, which can be used for light compensation under different color temperatures.
[0367] The audio circuit 1407 can include a microphone and a speaker. The microphone is used to collect sound waves of a user and an environment, and convert the sound waves into an electrical signal input to the processor 1401 for processing, or input to the radio frequency circuit 1404 to realize voice communication. For the purpose of stereo sound collection or noise reduction, the microphone can be multiple, respectively arranged at different parts of the terminal 1400. The microphone can also be an array microphone or an omnidirectional collection type microphone. The speaker is used to convert an electrical signal from the processor 1401 or the radio frequency circuit 1404 into sound waves. The speaker can be a conventional diaphragm speaker, or a piezoelectric ceramic speaker. When the speaker is a piezoelectric ceramic speaker, not only can the electrical signal be converted into a sound wave audible to humans, but also can be converted into a sound wave inaudible to humans for ranging purposes. In some embodiments, the audio circuit 1407 can also include a headphone jack.
[0368] The power supply 1408 is used to supply power to each component in the terminal 1400. The power supply 1408 can be alternating current, direct current, disposable battery or rechargeable battery. When the power supply 1408 includes a rechargeable battery, the rechargeable battery can be a wired charging battery or a wireless charging battery. The wired charging battery is a battery charged through a wired line, and the wireless charging battery is a battery charged through a wireless coil. The rechargeable battery can also be used to support fast charging technology.
[0369] Those skilled in the art can understand that the structure shown in the foregoing embodiments is not a limitation on the terminal 1400, and the terminal 1400 can include more or fewer components than those shown in the drawings, or combine certain components, or use different component arrangements. Figure 14 The structure shown in the foregoing embodiments is not a limitation on the terminal 1400, and the terminal 1400 can include more or fewer components than those shown in the drawings, or combine certain components, or use different component arrangements.
[0370] Optionally, the computer device is provided as a server. Figure 15 The server 1500 provided by the embodiments of the present application can have a large difference due to different configurations or performances, and can include one or more processors (Central Processing Units, CPUs) 1501 and one or more memories 1502, wherein the memory 1502 stores at least one computer program, and the at least one computer program is loaded and executed by the processor 1501 to implement the method provided by the above-mentioned various method embodiments. Of course, the server can also have a wired or wireless network interface, a keyboard and an input / output interface, etc., so as to perform input / output, and the server can also include other components for realizing device functions, which are not described here.
[0371] The embodiment of the present application further provides a computer readable storage medium, and at least one computer program is stored in the computer readable storage medium, the at least one computer program is loaded and executed by a processor to implement the operation performed by the medical word determination method or the model training method of the above-mentioned embodiment.
[0372] The embodiment of the present application further provides a computer program product, comprising a computer program, the computer program is executed by a processor to implement the operation performed by the medical word determination method or the model training method of the above-mentioned embodiment.
[0373] Those skilled in the art can understand that all or part of the steps of the above-mentioned embodiments can be completed by hardware, or by a program instructing relevant hardware to complete, and the program can be stored in a computer readable storage medium. The storage medium mentioned above can be a read-only memory, a magnetic disk or an optical disk.
[0374] The above-mentioned is only the optional embodiment of the present application, and does not limit the present application, and any modification, equivalent replacement, improvement, etc. within the spirit and principle of the present application should be included in the protection scope of the present application.
Claims
1. A method for determining medical terms, characterized in that, The method includes: The text is encoded to obtain a first feature of the text, which includes non-standard medical terms; Based on the text and multiple entity words in the text, a graph network is generated. The nodes in the graph network are used to represent the text and the entity words. The edge between any two nodes in the graph network is used to represent the inclusion relationship between the contents represented by the two nodes. Based on the graph network, the second feature of the text is obtained; The first feature and the second feature are fused to obtain the third feature of the text, which is a feature obtained by feature extraction of the text; Based on the third feature, the standard medical term corresponding to the text is determined from multiple standard medical terms.
2. The method according to claim 1, characterized in that, The process of obtaining the second feature of the text based on the graph network includes: For each node in the graph network, the features of the node are obtained, and the features of the node are updated based on the features of the neighboring nodes. There are edges between the neighboring nodes and the node. The features of the node indicate the text or entity word represented by the node. The updated features of multiple nodes in the graph network are fused to obtain the second feature.
3. The method according to claim 2, characterized in that, The step of updating the features of a node based on the features of its neighboring nodes includes: The features of the node and the features of the node are fused together to obtain the first fused feature of the node; The features of the node and the features of the neighboring nodes are fused to obtain the second fused feature of the neighboring node; The first fusion feature and the second fusion feature are fused together to obtain the third fusion feature; The ratio of the first fusion feature to the third fusion feature is determined as the weight of the node, and the ratio of the second fusion feature to the third fusion feature is determined as the weight of the neighboring node. Based on the weight of the node and the weight of the neighboring nodes, the features of the node and the features of the neighboring nodes are weighted and fused to obtain the updated features of the node.
4. The method according to claim 3, characterized in that, The process of fusing the features of the node and the features of the neighboring nodes to obtain the second fused feature of the neighboring node includes: Based on the first weight and the second weight, the features of the node and the features of the neighboring nodes are weighted and fused to obtain the second fused feature; Wherein, the first weight is the weight corresponding to the first word type, the first word type is the word type to which the content represented by the node belongs, the second weight is the weight corresponding to the second word type, the second word type is the word type to which the content represented by the neighboring node belongs.
5. The method according to claim 2, characterized in that, The step of updating the features of a node based on the features of its neighboring nodes includes: For each node in the graph network, the current features of the node are updated based on the current features of its neighboring nodes to obtain the i-th updated features of the node. Given the features of each node after the i-th update, the features of the node after the i-th update are updated based on the features of the neighboring nodes after the i-th update, to obtain the features of the node after the (i+1)-th update, where i is an integer greater than 0.
6. The method according to claim 2, characterized in that, Before fusing the updated features of multiple nodes in the graph network to obtain the second feature, the method further includes: For each node in the graph network, the node's features are updated based on the type features corresponding to the node, where the type features indicate the word type to which the content represented by the node belongs.
7. The method according to claim 2, characterized in that, The process of encoding the text to obtain the first feature of the text includes: Encode each character in the text to obtain the feature of each character; The features of the characters in the text are fused to obtain the first feature; The process of obtaining the features of the node includes: Based on the characteristics of the target character, the characteristics of the node are determined, wherein the target character is the character included in the content represented by the node.
8. The method according to claim 7, characterized in that, The process of determining the features of the node based on the features of the target character includes: When the content represented by the node includes multiple target characters, the features of the multiple target characters are fused to obtain the features of the node; or, If the content represented by the node includes a target character, the characteristics of the target character are determined as the characteristics of the node.
9. The method according to claim 1, characterized in that, Before generating the graph network based on the text and multiple entity words in the text, the method further includes: Based on each character count among multiple character counts, candidate words corresponding to the character count are extracted from the text, and the candidate words include the characters of the specified character count; Each candidate word is classified to obtain the word type to which each candidate word belongs, and the word type includes entity word type or non-entity word type; The generation of a graph network based on the text and multiple entity words in the text includes: The graph network is generated based on the text and candidate words belonging to the entity word type.
10. The method according to claim 1, characterized in that, The step of determining the standard medical term corresponding to the text from multiple standard medical terms based on the third feature includes: Based on the third feature and the features of each standard medical term, the similarity between the text and each standard medical term is determined; The standard medical term with the highest similarity among the multiple standard medical terms is determined as the standard medical term corresponding to the text.
11. A model training method, characterized in that, The method further includes: Obtain sample text, positive sample medical terms, and negative sample medical terms. The sample text includes non-standard medical terms, the positive sample medical terms are the standard medical terms corresponding to the sample text, and the negative sample medical terms are any standard medical terms other than the positive sample medical terms. Based on the feature extraction model, the sample text is encoded to obtain the first sample feature of the sample text; Based on the feature extraction model, the sample text, and multiple entity words in the sample text, a sample graph network is generated. The nodes in the sample graph network are used to represent the text and the entity words. The edge between any two nodes in the graph network is used to represent the inclusion relationship between the contents represented by the two nodes. Based on the feature extraction model and the sample graph network, the second sample features of the sample text are obtained; Based on the feature extraction model, the first sample features and the second sample features are fused to obtain the third sample features of the sample text. The third sample features are features obtained by feature extraction from the sample text. The feature extraction model is trained based on the third sample features of the sample text, the features of the positive sample medical words, and the features of the negative sample medical words.
12. The method according to claim 11, characterized in that, The feature extraction model is trained based on the third sample features of the sample text, the features of the positive sample medical words, and the features of the negative sample medical words, including: Based on the features of the third sample and the features of the positive sample medical terms, a first similarity is determined; A second similarity is determined based on the third feature of the sample text and the features of the medical words in the negative sample; Based on the first similarity and the second similarity, a loss value is determined, wherein the loss value is negatively correlated with the first similarity and positively correlated with the second similarity; The feature extraction model is trained based on the loss value.
13. A medical term determination device, characterized in that, The device includes: An extraction module is used to encode the text to obtain a first feature of the text, wherein the text includes non-standard medical terms; The generation module is used to generate a graph network based on the text and multiple entity words in the text. The nodes in the graph network are used to represent the text and the entity words, and the edge between any two nodes in the graph network is used to represent the inclusion relationship between the contents represented by the two nodes. The acquisition module is used to acquire the second feature of the text based on the graph network; A fusion module is used to fuse the first feature and the second feature to obtain a third feature of the text, wherein the third feature is a feature obtained by feature extraction of the text; The determination module is used to determine the standard medical term corresponding to the text from a plurality of standard medical terms based on the third feature.
14. A model training device, characterized in that, The device further includes: The acquisition module is used to acquire sample text, positive sample medical terms, and negative sample medical terms. The sample text includes non-standard medical terms, the positive sample medical terms are the standard medical terms corresponding to the sample text, and the negative sample medical terms are any standard medical terms other than the positive sample medical terms. The extraction module is used to encode the sample text based on a feature extraction model to obtain the first sample features; The generation module is used to generate a sample graph network based on the feature extraction model, the sample text, and multiple entity words in the sample text. The nodes in the sample graph network are used to represent the text and the entity words, and the edge between any two nodes in the graph network is used to represent the inclusion relationship between the contents represented by the two nodes. The acquisition module is further configured to acquire second sample features based on the feature extraction model and the sample graph network; The fusion module is used to fuse the first sample features and the second sample features based on the feature extraction model to obtain the third sample features of the sample text, wherein the third sample features are features obtained by feature extraction of the sample text; The training module is used to train the feature extraction model based on the third sample features of the sample text, the features of the positive sample medical words, and the features of the negative sample medical words.
15. A computer device, characterized in that, The computer device includes a processor and a memory, the memory storing at least one computer program, the at least one computer program being loaded and executed by the processor to perform the operations performed by the medical term determination method as claimed in any one of claims 1 to 10, or to perform the operations performed by the model training method as claimed in any one of claims 11 to 12.
16. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores at least one computer program, which is loaded and executed by a processor to perform the operations performed by the medical term determination method as claimed in any one of claims 1 to 10, or to perform the operations performed by the model training method as claimed in any one of claims 11 to 12.
17. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it performs the operations performed by the medical term determination method as described in any one of claims 1 to 10, or performs the operations performed by the model training method as described in any one of claims 11 to 12.