Medical term mapping method, device, computer equipment and storage medium
By segmenting and encoding the symptom description statements, the weight of each statement fragment is determined, and the maximum weighted statement fragment is output as an argument for medical words, the problem of insufficient information in the existing technology is solved, and the interpretability and accuracy of the medical word mapping process is realized.
Patent Information
- Application Number
- CN202110431507.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-04-21
- Publication Date
- 2025-08-12
- Estimated Expiration
- 2041-04-21
AI Technical Summary
In the prior art, semantic recognition technology can only output medical words corresponding to symptom description statements, with less information and lack of explanatory ability.
By calling the word mapping model, the symptom description statement is segmented and encoded, the weight of each statement fragment is determined, and the maximum weighted statement fragment is output as an argument for medical words, increasing the output amount of information.
The interpretability of the medical word mapping process is realized, the amount of output information is improved, and the determined arguments are more accurate.
Smart Images

Figure CN113761116B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of computer technology, and in particular to a medical term mapping method, apparatus, computer equipment, and storage medium. Background Art
[0002] With the development of computer technology, semantic recognition technology is increasingly being used. For example, in medical scenarios, semantic recognition technology can be used to map user-entered, colloquial symptom descriptions into medical terms, enabling subsequent medical services to be provided based on these terms. However, because it only outputs the medical terms corresponding to the symptom description, the amount of information output is limited. Summary of the Invention
[0003] The present invention provides a method, apparatus, computer device, and storage medium for medical term mapping, which can increase the amount of information output during the medical term mapping process. The technical solution is as follows:
[0004] In one aspect, a medical term mapping method is provided, the method comprising:
[0005] Calling a word mapping model to map the symptom description sentence to obtain the medical terms corresponding to the symptom description sentence and the weight of each word in the symptom description sentence;
[0006] Segmenting the symptom description statement into a plurality of sentence segments, each sentence segment including a plurality of words;
[0007] Determining the weight of each sentence fragment based on the weight of the words in each sentence fragment;
[0008] determining the sentence segment corresponding to the maximum weight among the multiple sentence segments as the target sentence segment that causes the symptom description sentence to be mapped to the medical term;
[0009] The medical term and the target sentence segment are output.
[0010] Optionally, before continuing to select words starting with the second word and the number of which is the first number to form a sentence fragment, the method further includes:
[0011] The second number is determined to be smaller than the difference between a third number and the first number, the third number being the number of words in the symptom description sentence.
[0012] Optionally, calling a word encoding network in the word mapping model to encode each word in the symptom description sentence to obtain a word vector for each word in the symptom description sentence includes:
[0013] Calling the word encoding network to segment the symptom description sentence to obtain each word in the symptom description sentence;
[0014] The word encoding network is called to encode each word to obtain a word vector for each word.
[0015] Optionally, calling the feature mapping network to map the sample sentence features to obtain sample prediction probabilities corresponding to the multiple reference medical terms includes:
[0016] Calling the word mapping model to perform feature transformation on the sample sentence features to obtain sample reference features, wherein the sample reference features include sample feature values of multiple dimensions, each dimension corresponding to a reference medical term;
[0017] The sample feature value of each dimension in the sample reference feature is respectively determined as the sample prediction probability corresponding to the reference medical term corresponding to each dimension.
[0018] In another aspect, a medical term mapping device is provided, the device comprising:
[0019] A mapping module is used to call a word mapping model to map the symptom description sentence to obtain the medical terms corresponding to the symptom description sentence and the weight of each term in the symptom description sentence;
[0020] A sentence segmentation module, configured to segment the symptom description sentence into a plurality of sentence segments, each sentence segment including a plurality of words;
[0021] A weight determination module, configured to determine the weight of each sentence fragment based on the weight of the words in each sentence fragment;
[0022] a sentence segment determination module, configured to determine the sentence segment corresponding to the largest weight among the multiple sentence segments as the target sentence segment that causes the symptom description sentence to be mapped to the medical term;
[0023] An output module is used to output the medical terms and the target sentence fragments.
[0024] Optionally, the sentence segmentation module is used to:
[0025] According to the order of words in the symptom description sentence, a plurality of words starting with a first word and having a first number are selected to form a sentence fragment, wherein the first word is any word in the symptom description sentence, and the first number is an integer greater than 1;
[0026] Continue to select multiple words starting with the second word and the first number to form a sentence fragment, wherein the second word is located after the first word and is separated from the first word by a second number of words, until a sentence fragment including the last word in the symptom description sentence is formed, and the second number is an integer not less than 0.
[0027] Optionally, the device further comprises:
[0028] The first quantity determination module is used to determine the product of a third quantity and a target ratio as the first quantity, where the third quantity is the number of words in the symptom description sentence, and the target ratio is greater than 0 and less than 1.
[0029] Optionally, the device further comprises:
[0030] The second quantity determination module is used to determine the second quantity which is smaller than the difference between a third quantity and the first quantity, where the third quantity is the number of words in the symptom description statement.
[0031] Optionally, the sentence segmentation module includes:
[0032] a punctuation mark determination unit, configured to determine each target punctuation mark in the symptom description sentence, wherein the target punctuation mark is a punctuation mark indicating the end of a sentence;
[0033] The sentence segmentation unit is used to segment the position of each target punctuation mark determined in the symptom description sentence to obtain the multiple sentence fragments.
[0034] Optionally, the weight determination module is used to determine the sum of the weights of multiple words in each sentence fragment as the weight of each sentence fragment.
[0035] Optionally, the mapping module is used to:
[0036] A first encoding unit is configured to call a word encoding network in the word mapping model to encode each word in the symptom description sentence to obtain a word vector for each word in the symptom description sentence;
[0037] a first feature extraction unit, configured to call a feature extraction network in the word mapping model, perform feature extraction on word vectors of a plurality of words in the symptom description sentence, and obtain a weight of each word;
[0038] a first weighted fusion unit, configured to call a weighted fusion network in the word mapping model, and perform weighted fusion on the word vectors of the multiple words based on the weights of the multiple words to obtain a sentence feature of the symptom description sentence;
[0039] The first mapping unit is configured to call a feature mapping network in the word mapping model to map the sentence features to obtain the medical terms.
[0040] Optionally, the first encoding unit is configured to:
[0041] Calling the word encoding network to segment the symptom description sentence to obtain each word in the symptom description sentence;
[0042] The word encoding network is called to encode each word to obtain a word vector for each word.
[0043] Optionally, the feature mapping network includes a plurality of reference medical terms, each of which is used to describe a symptom; and the first mapping unit is configured to:
[0044] calling the feature mapping network to map the sentence features to obtain prediction probabilities corresponding to the multiple reference medical terms, wherein the prediction probability corresponding to each reference medical term is used to indicate the likelihood that the reference medical term is the medical term corresponding to the symptom description sentence;
[0045] Among the plurality of reference medical terms, a reference medical term corresponding to a maximum prediction probability is determined.
[0046] Optionally, the first mapping unit is configured to:
[0047] Calling the feature mapping network to perform feature transformation on the sentence features to obtain reference features, wherein the reference features include feature values of multiple dimensions, each dimension corresponding to a reference medical term;
[0048] The feature value of each dimension in the reference feature is respectively determined as the predicted probability corresponding to the reference medical term corresponding to each dimension.
[0049] Optionally, the device further comprises:
[0050] an acquisition module, configured to acquire a sample symptom description sentence and annotation information of the sample symptom description sentence, wherein the annotation information includes medical terms associated with the symptoms described in the sample symptom description sentence;
[0051] A training module is used to train the word mapping model based on the sample symptom description sentences and the annotation information.
[0052] Optionally, the feature mapping network in the word mapping model includes a plurality of reference medical terms, and the training module includes:
[0053] A second encoding unit is used to call the word encoding network in the word mapping model to encode each sample word in the sample symptom description sentence to obtain a word vector for each sample word in the sample symptom description sentence;
[0054] a second feature extraction unit, configured to call a feature extraction network in the word mapping model, perform feature extraction on word vectors of a plurality of sample words in the sample symptom description sentence, and obtain a weight of each sample word;
[0055] a second weighted fusion unit, configured to call a weighted fusion network in the word mapping model, and perform weighted fusion on the word vectors of the multiple sample words based on the weights of the multiple sample words to obtain a sample sentence feature of the sample symptom description sentence;
[0056] a second mapping unit, configured to call the feature mapping network to map the sample sentence features to obtain sample prediction probabilities corresponding to the multiple reference medical terms;
[0057] A training unit is configured to train the term mapping model based on the sample prediction probabilities corresponding to the plurality of reference medical terms and the medical terms in the annotation information.
[0058] Optionally, the second mapping unit is configured to:
[0059] Calling the word mapping model to perform feature transformation on the sample sentence features to obtain sample reference features, wherein the sample reference features include sample feature values of multiple dimensions, each dimension corresponding to a reference medical term;
[0060] The sample feature value of each dimension in the sample reference feature is respectively determined as the sample prediction probability corresponding to the reference medical term corresponding to each dimension.
[0061] Optionally, the training unit is used to:
[0062] Determining the first target value as a true probability of the medical term in the annotation information;
[0063] For any medical term in the annotation information, determining the sample prediction probability corresponding to the reference medical term identical to the medical term as the sample prediction probability corresponding to the medical term;
[0064] Determining a loss value of the word mapping model based on a sample prediction probability and a true probability corresponding to each medical word in the annotation information;
[0065] The word mapping model is trained according to the loss value.
[0066] Optionally, the device further comprises:
[0067] a probability determination module, configured to determine the second target value as a true probability corresponding to a reference medical term among the plurality of reference medical terms that is not included in the annotation information;
[0068] The training unit is used to:
[0069] The loss value of the word mapping model is determined based on the sample prediction probability and true probability corresponding to each medical term in the annotation information and the sample prediction probability and true probability corresponding to reference medical terms not included in the annotation information.
[0070] On the other hand, a computer device is provided, comprising a processor and a memory, wherein the memory stores at least one computer program, and the at least one computer program is loaded and executed by the processor to implement the operations performed in the medical term mapping method as described in the above aspects.
[0071] On the other hand, a computer-readable storage medium is provided, wherein at least one computer program is stored in the computer-readable storage medium, and the at least one computer program is loaded and executed by a processor to implement the operations performed in the medical term mapping method as described in the above aspects.
[0072] On the other hand, a computer program product or computer program is provided, wherein the computer program product or computer program includes computer program code, wherein the computer program code is stored in a computer-readable storage medium, and a processor of a computer device reads the computer program code from the computer-readable storage medium and executes the computer program code, so that the computer device implements the operations performed in the medical term mapping method described in the above aspects.
[0073] The method, apparatus, computer device, and storage medium provided in the embodiments of the present application simultaneously obtain the weight of each word in the symptom description sentence during the process of mapping the corresponding medical term. Based on the weight of the word, the weight of each sentence fragment is determined. The target sentence fragment with the largest weight serves as the evidence for mapping the symptom description sentence to a medical term, thereby achieving interpretability in the medical term mapping process. Furthermore, if this evidence is determined within a single word, the evidence may be inaccurate due to the excessive dispersion of the words. However, the present application determines the evidence for mapping the symptom description sentence to a medical term within a sentence fragment comprising multiple words, thereby making the medical term mapping process more interpretable. BRIEF DESCRIPTION OF THE DRAWINGS
[0074] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0075] Figure 1 It is a schematic diagram of an implementation environment provided by an embodiment of the present application.
[0076] Figure 2 This is a flowchart of a medical term mapping method provided in an embodiment of the present application.
[0077] Figure 3 This is a flowchart of a medical term mapping method provided in an embodiment of the present application.
[0078] Figure 4 This is a flowchart of a medical term mapping method provided in an embodiment of the present application.
[0079] Figure 5 This is a flowchart of a method for training a word mapping model provided in an embodiment of the present application.
[0080] Figure 6 This is a schematic diagram of obtaining annotation information provided in an embodiment of the present application.
[0081] Figure 7 This is a schematic diagram of the structure of a medical term mapping device provided in an embodiment of the present application.
[0082] Figure 8 This is a structural diagram of another medical term mapping device provided in an embodiment of the present application.
[0083] Figure 9 This is a schematic diagram of the structure of a terminal provided in an embodiment of the present application.
[0084] Figure 10 This is a structural diagram of a server provided in an embodiment of the present application. DETAILED DESCRIPTION
[0085] In order to make the objectives, technical solutions and advantages of the embodiments of the present application clearer, the implementation methods of the present application will be further described in detail below with reference to the accompanying drawings.
[0086] It is understood that the terms "first," "second," and the like used herein may be used to describe various concepts, but unless otherwise specified, these concepts are not limited by these terms. These terms are merely used to distinguish one concept from another. For example, a first term may be referred to as a second term, and similarly, a second term may be referred to as a first term without departing from the scope of this application.
[0087] Here, at least one means one or more than one. For example, at least one word can be one word, two words, three words, or any other integer greater than or equal to one. Multiple means two or more than two. For example, multiple words can be two words, three words, or any other integer greater than or equal to two. Each means each of at least one. For example, each word refers to each word in the multiple words. If the multiple words are three words, each word refers to each of the three words.
[0088] Artificial Intelligence (AI) refers to the theories, methods, techniques, and application systems that use digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, to perceive the environment, acquire knowledge, and use that knowledge to achieve optimal results. In other words, AI is a comprehensive technology within computer science that seeks to understand the essence of intelligence and produce new intelligent machines that can respond in a manner similar to human intelligence. AI also involves studying the design principles and implementation methods of various intelligent machines, enabling them to possess the capabilities of perception, reasoning, and decision-making.
[0089] Artificial intelligence (AI) technology is a comprehensive discipline encompassing a wide range of fields, encompassing both hardware and software technologies. Foundational AI technologies generally include sensors, specialized AI chips, cloud computing, distributed storage, big data processing, operating / interaction systems, and mechatronics. AI software technologies primarily encompass computer vision, speech processing, natural language processing, and machine learning / deep learning.
[0090] Natural language processing (NLP) is a key area of research in computer science and artificial intelligence. It studies the theories and methods that enable effective communication between humans and computers using natural language. Natural language processing (NLP) integrates linguistics, computer science, and mathematics. Therefore, research in this field involves natural language—the language we use in everyday life—and is closely linked to the study of linguistics. Natural language processing technologies typically include text processing, semantic understanding, machine translation, robotic question answering, and knowledge graphs.
[0091] Machine learning (ML) is a multidisciplinary field that encompasses probability theory, statistics, approximation theory, convex analysis, and algorithmic complexity theory. It specifically studies how computers can simulate or implement human learning behaviors to acquire new knowledge or skills and reorganize existing knowledge structures to continuously improve their performance. Machine learning is at the core of artificial intelligence and the fundamental way to make computers intelligent. Its applications span all areas of AI. Machine learning and deep learning typically include techniques such as artificial neural networks, belief networks, reinforcement learning, transfer learning, inductive learning, and learning through demonstration.
[0092] The solution provided in the embodiment of the present application, based on artificial intelligence natural language processing, machine learning and other technologies, utilizes a word mapping model to map symptom description sentences into medical terms and obtain target sentence fragments that cause the symptom description sentences to be mapped into medical terms.
[0093] The medical term mapping method provided in the embodiment of the present application can be used in 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 that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms. Optionally, the terminal is a smart phone, tablet computer, laptop computer, desktop computer, smart speaker, smart watch, etc., but is not limited to this.
[0094] In one possible implementation, the computer program involved in the embodiments of the present application can be deployed and executed on a computer device, or on multiple computer devices located at one location, or on multiple computer devices distributed at multiple locations and interconnected through a communication network. Multiple computer devices distributed at multiple locations and interconnected through a communication network can constitute a blockchain system.
[0095] Blockchain is a new application model for computer technologies, including distributed data storage, peer-to-peer transmission, consensus mechanisms, and encryption algorithms. Essentially, a blockchain is a decentralized database, a series of data blocks linked using cryptographic methods. Each block contains information about a batch of online transactions, used to verify the validity of this information (to prevent counterfeiting) and generate the next block. Blockchain can include the underlying blockchain platform, the platform product and service layer, and the application service layer.
[0096] The underlying blockchain platform can include processing modules such as user management, basic services, smart contracts, and operational testing. Among them, the user management module is responsible for the identity information management of all blockchain participants, including maintaining public and private key generation (account management), key management, and maintaining the corresponding relationship between the user's real identity and the blockchain address (authority management), etc., and under authorization, it supervises and audits the transactions of certain real identities and provides risk control rule configuration (risk control audit); the basic service module is deployed on all blockchain node devices to verify the validity of business requests, and records valid requests to storage after consensus is reached. For a new business request, the basic service first adapts the interface for parsing and authentication (interface adaptation), and then encrypts the business information through the consensus algorithm (consensus management). The smart contract module is responsible for the registration, issuance, triggering and execution of contracts. Developers can define the contract logic in a programming language and publish it to the blockchain (contract registration). According to the logic of the contract terms, the contract logic is triggered by calling keys or other events to trigger execution. The contract logic is completed, and the contract upgrade and cancellation functions are also provided. The operation detection module is mainly responsible for the deployment, configuration modification, contract setting, cloud adaptation and real-time status visualization output of the product during the product release process, such as alarms, network status detection, node device health status detection, etc.
[0097] The platform's product service layer provides the basic capabilities and implementation framework for typical applications. Developers can build on these basic capabilities, overlay business features, and complete the blockchain implementation of business logic. The application service layer provides application services based on blockchain solutions for business participants to use.
[0098] Figure 1 Schematic diagram of an implementation environment provided by an embodiment of the present application. The implementation environment includes multiple terminals 101 ( Figure 1 In the figure, three terminals 101 are taken as an example) and a server 102. The terminal 101 and the server 102 are connected via a wireless or wired network. The target application served by the server 102 is installed on the terminal 101, and the terminal 101 can realize functions such as data transmission and message interaction through the target application. Optionally, the target application is a target application in the operating system of the terminal 101, or a target application provided by a third party. For example, the target application is a medical treatment guidance application, and the medical treatment guidance application has a guidance function. Of course, the medical treatment guidance application can also have other functions, such as a review function, a content sharing function, a navigation function, etc.
[0099] Each terminal 101 is used to log in to the target application according to the user identification, and send the symptom description sentence input by the user to the server 102 through the target application. The server 102 receives the symptom description sentences sent by multiple terminals 101, and calls the word mapping model to map each symptom description sentence, obtain the medical terms corresponding to each symptom description sentence, and determine the target sentence fragment that causes the symptom description sentence to be mapped to the medical term, and then return the medical term and the target sentence fragment to the corresponding terminal 101, so as to realize the mapping of the symptom description sentence sent by any terminal 101.
[0100] The medical term mapping method provided in the embodiments of the present application can be applied to a variety of scenarios.
[0101] For example, in a doctor's consultation scenario: a medical consultation guide application is installed in the terminal, and a word mapping model is configured in the server corresponding to the medical consultation guide application. The terminal logs in to the medical consultation guide application based on the user ID and sends the input symptom description statement to the server. After receiving the symptom description statement, the server uses the method provided in the embodiment of the present application to call the word mapping model, maps the symptom description statement, obtains the medical term corresponding to the symptom description statement, and determines the target sentence segment that causes the symptom description statement to be mapped to the medical term. The doctor can then judge the accuracy of mapping the symptom description statement to the medical term based on the target sentence segment. The doctor can also determine the user's physical condition based on the medical term in combination with other information about the user.
[0102] For example, in the medical guidance scenario: a medical guidance application is installed in the terminal, and a word mapping model is configured in the server corresponding to the medical guidance application. The terminal logs in to the medical guidance application based on the user ID and sends the input symptom description statement to the server. After receiving the symptom description statement, the server calls the word mapping model to map the symptom description statement, obtains the medical term corresponding to the symptom description statement, and determines the target sentence segment that causes the symptom description statement to be mapped to the medical term, as well as the department to which the disease with the symptoms described by the medical term belongs. The medical term, target sentence segment, and the department or the doctor of the department are returned to the medical guidance application, and the terminal displays them through the medical guidance application, so that the user can have a preliminary understanding of his or her physical condition based on the medical term, understand the arguments leading to the medical term based on the target sentence segment, and seek medical treatment based on the displayed department or doctor.
[0103] Figure 2 This is a flowchart of a medical term mapping method provided by an embodiment of the present application. The execution subject of the embodiment of the present application is a computer device, see Figure 2 , the method comprising:
[0104] 201. The computer device calls a word mapping model to map the symptom description sentence to obtain the medical terms corresponding to the symptom description sentence and the weight of each term in the symptom description sentence.
[0105] A symptom description statement is a statement used to describe a symptom. A term mapping model is stored in the computer device. The term mapping model is used to map any symptom description statement to a corresponding medical term. The medical term mapped to the symptom description statement is a medical term associated with the symptom described by the symptom description statement.
[0106] The weight of each word in the symptom description sentence indicates the degree of association between the corresponding word and the symptom described in the symptom description sentence. The larger the word weight, the greater the degree of association between the word and the symptom described in the symptom description sentence; the smaller the word weight, the smaller the degree of association between the word and the symptom described in the symptom description sentence.
[0107] 202. The computer device divides the symptom description statement into multiple sentence segments.
[0108] Each sentence fragment includes multiple words.
[0109] 203. The computer device determines the weight of each sentence fragment based on the weight of the words in each sentence fragment.
[0110] The weight of each sentence fragment represents the degree of association between the corresponding sentence fragment and the symptom described in the symptom description. The larger the sentence fragment weight, the greater the degree of association between the sentence fragment and the symptom described in the symptom description; the smaller the sentence fragment weight, the smaller the degree of association between the sentence fragment and the symptom described in the symptom description.
[0111] 204. The computer device determines the sentence segment corresponding to the maximum weight among the multiple sentence segments as the target sentence segment that causes the symptom description sentence to be mapped to a medical term.
[0112] Since the weight of a sentence segment represents the degree of association between the sentence segment and the symptom described in the symptom description sentence, the sentence segment corresponding to the maximum weight is the sentence segment that has the greatest degree of association with the symptom described in the symptom description sentence among the multiple sentence segments, and the medical term mapped to the symptom description sentence is a medical term associated with the symptom described in the symptom description sentence, the sentence segment corresponding to the maximum weight can be determined as the target sentence segment that causes the symptom description sentence to be mapped to a medical term.
[0113] 205. The computer device outputs medical terms and target sentence fragments.
[0114] After determining the medical term and target sentence fragment, the computer device outputs the medical term and target sentence fragment. The target sentence fragment serves as evidence that the symptom description sentence is mapped to the medical term. Therefore, by outputting the target sentence fragment, the amount of output information is increased, making the medical term mapping process interpretable.
[0115] The method provided in the embodiments of the present application simultaneously obtains the weight of each word in the symptom description sentence during the process of mapping it to the corresponding medical term. Based on the weight of the word, the weight of each sentence fragment is determined. The target sentence fragment with the largest weight serves as the evidence for the symptom description sentence being mapped to the medical term, thus achieving interpretability in the medical term mapping process. Furthermore, if this evidence is determined within a single word, the resulting evidence may be inaccurate due to the excessive dispersion of the words. However, the present application determines the evidence for the symptom description sentence being mapped to the medical term within a sentence fragment comprising multiple words, thereby making the medical term mapping process more interpretable.
[0116] Figure 3 This is a flowchart of a medical term mapping method provided by an embodiment of the present application. The execution subject of the embodiment of the present application is a computer device, see Figure 3 , the method comprising:
[0117] 301. The computer device calls the word encoding network in the word mapping model to encode each word in the symptom description sentence to obtain a word vector for each word in the symptom description sentence.
[0118] The computer device stores a word mapping model, which is used to map any symptom description statement to a corresponding medical term. In the embodiment of the present application, the word mapping model includes a word encoding network, a feature extraction network, a weighted fusion network and a feature mapping network. Among them, the word encoding network is used to encode the word and obtain the word vector of the word. Optionally, the word mapping model used in the embodiment of the present application is based on the following Figure 5 The word mapping model is trained by the method provided in the embodiment.
[0119] The computer device obtains a symptom description statement, where the symptom description statement is a statement used to describe the symptoms. Optionally, the symptom description statement is a colloquial description statement, for example, the symptom description statement is "I have a stomachache." The symptom description statement includes multiple words. The computer device invokes a word encoding network in a word mapping model to encode each word in the symptom description statement and obtain a weight for each word. The word vector of the word is used to represent the characteristics of the word.
[0120] In one possible implementation, a computer device calls a word encoding network to segment the symptom description sentence to obtain each word in the symptom description sentence, calls the word encoding network to encode each word, and obtains a word vector for each word.
[0121] 302. The computer device calls the feature extraction network in the word mapping model to perform feature extraction on the word vectors of multiple words in the symptom description sentence to obtain the weight of each word.
[0122] The feature extraction network in the word mapping model is used to extract features from word vectors to obtain word weights. After the computer device obtains the word vectors of multiple words in the symptom description sentence, it calls the feature extraction network to extract features from the word vectors of the multiple words to obtain the weight of each word. The weight of each word is used to represent the degree of association between the corresponding word and the symptoms described in the symptom description sentence. The larger the weight, the greater the degree of association between the corresponding word and the symptoms described in the symptom description sentence, and the smaller the weight, the smaller the degree of association between the corresponding word and the symptoms described in the symptom description sentence.
[0123] Optionally, the feature extraction network in the word mapping model is Enc-Gen (Encoder-Generator) or Soft Atten (Soft Attention Mechanism).
[0124] In one possible implementation, the computer device determines a target vector based on the word vectors of multiple words, and determines the similarity between the word vector of each word and the target vector as the weight of each word.
[0125] Optionally, the computer device determines the target vector using any one of the following first, second, or third methods.
[0126] The first method is to determine the target vector as the sum of the word vectors of multiple words.
[0127] The second method is to perform a weighted fusion of the word vectors of multiple words based on their initial weights to obtain the target vector. The initial weights are arbitrarily set, for example, each word has an initial weight of 0.5, or the weights corresponding to different words in the multiple words are all values greater than 0 and less than 1.
[0128] The third method is to determine a target word based on the positions of multiple words in the symptom description sentence, and determine the vector of the target word as the target vector. The target word is any word among the multiple words, for example, the target word is the first word among the multiple words, or the target word is the last word among the multiple words.
[0129] Optionally, the computer device adopts any one of the following fourth, fifth or sixth methods to determine the similarity between the word vector of any word and the target vector.
[0130] The fourth method: Use the following formula to determine the similarity:
[0131] Among them, q is used to represent the target vector, k is used to represent the vector of the word, and a(q,k) represents the similarity between the target vector and the vector of the word, which is also the weight of the word. and W1 are used to represent two different weight matrices, [q;k] is used to represent the concatenation of the target vector and the word vector, and tanh(·) is used to represent the hyperbolic tangent function.
[0132] The fifth method: Use the following formula to determine the similarity: a(q,k)=q T ·W·k;
[0133] Among them, q is used to represent the target vector, k is used to represent the vector of the word, and a(q,k) represents the similarity between the target vector and the vector of the word, which is also the weight of the word. T It is used to indicate the transposition of the target vector, and W is used to indicate the weight matrix.
[0134] The sixth method: Use the following formula to determine the similarity: a(q,k)=q T k;
[0135] Among them, q is used to represent the target vector, k is used to represent the vector of the word, and a(q,k) represents the similarity between the target vector and the vector of the word, which is also the weight of the word.
[0136] In addition, the computer device can also use a self-supervised attention mechanism to determine the weight of each word. The embodiment of the present application does not limit the method for determining the weight of the word.
[0137] 303. The computer device calls the weighted fusion network in the word mapping model, performs weighted fusion on the word vectors of multiple words based on the weights of multiple words, and obtains the sentence features of the symptom description sentence.
[0138] The weighted fusion network in the word mapping model is used to perform weighted fusion on the word vectors to obtain sentence features. The computer device obtains the word vector of each word and the weight of each word, and then calls the weighted fusion network in the word mapping model to perform weighted fusion on the word vectors of multiple words based on the weights of multiple words to obtain the sentence features of the symptom description sentence, so that the sentence features of the symptom description sentence are fused with the word vectors of multiple words. Among them, the sentence features of the symptom description sentence are used to represent the features contained in the symptom description sentence. Optionally, the sentence features are sentence feature matrices or sentence feature vectors.
[0139] Since the weight of a word can represent the degree of association between the word and the symptoms described in the symptom description sentence, the sentence features obtained by weighted fusion based on the weights of multiple words highlight the influence of words that are highly associated with the symptoms described in the symptom description sentence in the sentence features, and weaken the influence of words that are less associated with the symptoms described in the symptom description sentence in the sentence features, thereby improving the accuracy of the sentence features of the symptom description sentence.
[0140] 304. The computer device calls the feature mapping network in the word mapping model to map the sentence features to obtain medical terms.
[0141] The feature mapping network in the term mapping model is used to map sentence features to medical terms. After obtaining the sentence features of a symptom description sentence, the computer device invokes the feature mapping network in the term mapping model to map the sentence features and obtain the medical terms corresponding to the symptom description sentence. These medical terms are medical terms associated with the symptoms described in the symptom description sentence. For example, if the symptom description sentence is "I have a stomachache," the corresponding medical terms for this symptom description sentence are "abdominal pain" or "gastrointestinal disease."
[0142] Optionally, the feature mapping network in the word mapping model is WordCNN (Word Convolutional Neural Networks) or WordGRU (Word Gate Recurrent Unit).
[0143] In one possible implementation, a computer device calls a feature mapping network to map sentence features, obtain prediction probabilities corresponding to multiple reference medical terms, and determines the reference medical term corresponding to the maximum prediction probability among the multiple reference medical terms. The feature mapping network in the term mapping model includes multiple reference medical terms, each of which is used to describe a symptom. The prediction probability corresponding to each reference medical term is used to indicate the likelihood that the reference medical term is the medical term corresponding to the symptom description statement. The greater the prediction probability, the greater the likelihood that the corresponding reference medical term is the medical term corresponding to the symptom description statement, and the smaller the prediction probability, the smaller the likelihood that the corresponding reference medical term is the medical term corresponding to the symptom description statement. Therefore, the computer device determines the reference medical term corresponding to the maximum prediction probability among the multiple reference medical terms. The reference medical term corresponding to the maximum prediction probability is the medical term corresponding to the symptom description statement, and the symptom description statement is mapped to the medical term.
[0144] Optionally, the computer device calls a feature mapping network to perform feature transformation on the sentence features to obtain reference features. The reference features include feature values of multiple dimensions, each dimension corresponding to a reference medical term, and the feature value of each dimension in the reference features is determined as the predicted probability corresponding to the reference medical term corresponding to each dimension.
[0145] The reference feature includes feature values of multiple dimensions. Optionally, the reference feature is a reference feature matrix or a reference feature vector. Each dimension in the reference feature corresponds to a reference medical term. Optionally, the multiple reference medical terms are arranged in sequence in the term mapping model, and the multiple dimensions included in the reference feature correspond one-to-one with the multiple reference medical terms in sequence. For example, the first dimension in the reference feature corresponds to the first medical term in the multiple reference medical terms arranged in sequence, and the second dimension in the reference feature corresponds to the second medical term in the multiple reference medical terms arranged in sequence.
[0146] Since the sentence features include the features contained in the symptom description sentence, and the symptom description sentence is used to describe symptoms, and each reference medical term is used to describe a symptom, the sentence features are transformed to determine the similarity between the features described by the symptom description sentence and the symptoms described by each reference medical term, and the feature values of multiple dimensions included in the reference features are obtained. The feature value of each dimension is the possibility that the corresponding reference medical term is the medical term corresponding to the symptom description sentence, that is, the predicted probability of multiple reference medical terms is obtained.
[0147] In steps 301-304, taking the word mapping model including the word encoding network, the feature extraction network, the weighted fusion network and the feature mapping network as an example, the process of calling the word mapping model, mapping the symptom description sentence, obtaining the medical terms corresponding to the symptom description sentence, and the weight of each word in the symptom description sentence is described. In another embodiment, the structure of the word mapping model can also be in other forms, and the computer device can use other methods to call the word mapping model, map the symptom description sentence, obtain the medical terms corresponding to the symptom description sentence, and the weight of each word. Since the scheme of the embodiment of the present application does not limit the structure of the word mapping model, it is decoupled from the word mapping model, that is, any trained word mapping model can be directly obtained to implement the scheme of the embodiment of the present application. In addition, the scheme of the embodiment of the present application will not increase the parameter amount of the word mapping model. Even if a new word mapping model is retrained, there will be no additional time overhead during the training process, and the running speed of the word mapping model will not be affected.
[0148] 305. The computer device divides the symptom description statement into multiple sentence segments.
[0149] Each sentence fragment includes multiple words. In the embodiment of the present application, by dividing the symptom description sentence into multiple sentence fragments, since each sentence fragment includes multiple words, and a single word is relatively scattered, compared with a single word, the sentence fragment includes more information and the information in the sentence fragment is more concentrated. Using sentence fragments to express the symptoms described by the symptom description sentence will be more accurate.
[0150] In one possible implementation, the computer device selects a first number of words starting with a first word according to the order of words in the symptom description sentence to form a sentence segment, where the first word is any word in the symptom description sentence. The computer device continues to select a second word starting with the first number of words to form a sentence segment, where the second word is located after the first word and is separated from the first word by a second number, until a sentence segment including the last word in the symptom description sentence is formed.
[0151] The first number is an integer greater than 1, and the second number is an integer not less than 0. Then, among the multiple sentence segments obtained by the computer device, each sentence segment includes multiple consecutive words. Optionally, adjacent sentence segments include at least one identical word.
[0152] For example, the first word is the first word in the symptom description sentence, and the second number is 0, that is, the first word is adjacent to the second word, and there is no other word between the first word and the second word. The computer device selects a plurality of words starting with the first word and the first number to form a first sentence segment. Then, the computer device continues to select a plurality of words starting with the second word and the first number to form a second sentence segment, and continues to select a plurality of words starting with the third word and the first number to form a third sentence segment, until a sentence segment including the last word in the symptom description sentence is formed, that is, the last word in the last sentence segment is the last word in the symptom description sentence.
[0153] Optionally, before selecting words starting with the first word and with the first number as the order of word arrangement in the symptom description sentence to form a sentence fragment, the computer device determines the product of the third number and the target ratio as the first number, and the third number is the number of words in the symptom description sentence, and the target ratio is greater than 0 and less than 1. In an embodiment of the present application, the computer device determines the number of words in each sentence fragment based on the number of words in the symptom description sentence to ensure that the ratio between the number of words in the sentence fragment and the number of words in the symptom description sentence is the target ratio. For example, if the target ratio is 20%, and the number of words in the symptom description sentence is 10, that is, the third number is 10, then the product of the third number and the target ratio is 2, that is, the first number is 2, and therefore each sentence fragment segmented by the computer device includes 2 words.
[0154] Optionally, before continuing to select words starting with the second word and having the first number as the word to form a sentence fragment, the computer device determines a second number that is less than the difference between the third number and the first number, and the third number is the number of words in the symptom description sentence. In order to ensure that the symptom description sentence is segmented to obtain at least two sentence fragments, and each sentence fragment includes the first number of words, it is necessary to ensure that the second number is less than the difference between the third number and the first number, that is, the number of words between the starting words in two adjacent sentence fragments is less than the difference between the third number and the first number. For example, the number of words in the symptom description sentence is 10, that is, the third number is 10, and the number of words in each sentence fragment is 3, that is, the first number is 3, then the second number is less than 7.
[0155] Optionally, a sliding window is used to segment the symptom description sentence. A sliding window is determined, where the length of the sliding window is equal to the length of a fourth number of words; when the first word in the sliding window is the first word in the symptom description sentence, the words in the sliding window are selected to form a sentence segment; the sliding window is moved backward by a target length, where the target length is equal to the length of a fifth number of words, and the words in the sliding window are continued to be selected to form a sentence segment until a sentence segment including the last word in the symptom description sentence is formed. The fourth number is an integer greater than 1, and the fifth number is an integer greater than 0.
[0156] For example, if the fourth quantity is 2 and the fifth quantity is 1, the length of the sliding window is equal to the length of two words. Each sentence segment includes two words. Moving the sliding window backward by one word will form another sentence segment. For example, if the symptom description sentence includes the following words: word 1, word 2, word 3, word 4, and word 5, the four sentence segments obtained by segmentation are: word 1 and word 2, word 2 and word 3, word 3 and word 4, and word 4 and word 5.
[0157] Using a sliding window approach to segment symptom descriptions creates sentence fragments consisting of multiple consecutive words. This allows for more information to be included and more concentrated, making it more accurate for describing the symptoms described using sentence fragments. By setting the length of the sliding window and its shift, you can adjust the number of words in a sentence fragment and the distance between each fragment, increasing the flexibility of symptom description segmentation.
[0158] In another possible implementation, the computer device determines each target punctuation mark in the symptom description sentence, and segments the sentence at the position of each target punctuation mark determined in the symptom description sentence to obtain multiple sentence fragments. The target punctuation mark is a punctuation mark that indicates the end of a sentence, for example, the target punctuation mark is a period, an exclamation mark, a question mark, a combination of a quotation mark and a period, a combination of a quotation mark and an exclamation mark, a combination of a quotation mark and a question mark, etc. That is, each sentence fragment segmented by the computer device is a complete sentence, and each sentence includes multiple consecutive words, so that each sentence fragment includes multiple consecutive words. The symptom description sentence is segmented by using target punctuation marks, and the sentence fragments obtained include a complete sentence, so the information in the sentence fragments is more coherent and concentrated, further improving the accuracy of using sentence fragments to represent the symptoms described by the symptom description sentence. By identifying the target punctuation marks in the symptom description sentence, the symptom description sentence can be segmented according to the position of the target punctuation marks, thereby improving the convenience of segmenting the symptom description sentence.
[0159] For example, consider a symptom description sentence like this: "I woke up this morning feeling dizzy and nauseous. I had a cold a week ago and have thick phlegm in my throat, which I suspect is chronic pharyngitis. I've had stomach discomfort for the past two days and haven't eaten much." The three resulting sentence fragments are: "I woke up this morning feeling dizzy and nauseous," "I had a cold a week ago and have thick phlegm in my throat, which I suspect is chronic pharyngitis," and "I've had stomach discomfort for the past two days and haven't eaten much."
[0160] 306. The computer device determines the weight of each sentence segment based on the weight of the words in each sentence segment.
[0161] After determining the weight of each word and the multiple sentence fragments, the computer device determines a weight for each sentence fragment based on the weights of the words in each sentence fragment. The weight of each sentence fragment represents the degree of association between the corresponding sentence fragment and the symptom described in the symptom description sentence. A greater weight for a sentence fragment indicates a greater degree of association between the sentence fragment and the symptom described in the symptom description sentence, and a smaller weight for a sentence fragment indicates a smaller degree of association between the sentence fragment and the symptom described in the symptom description sentence.
[0162] In a possible implementation, the computer device determines the sum of the weights of multiple words in each sentence segment as the weight of each sentence segment.
[0163] Optionally, the weights of multiple sentence fragments satisfy the following relationship:
[0164]
[0165] Among them, P i It is used to represent the weight corresponding to the i-th sentence fragment in multiple sentence fragments, i is used to represent the sequence number of multiple sentence fragments, and the sequence number i is a positive integer greater than or equal to 1; k is used to represent the sequence number of each word in the i-th sentence fragment in the symptom description sentence, l is used to represent the number of words contained in each sentence fragment, and w k Used to indicate the weight corresponding to the k-th word.
[0166] Optionally, the computer device segments the symptom description sentence using target punctuation marks, and the weights of the multiple sentence segments satisfy the following relationship:
[0167]
[0168] Among them, P i It is used to represent the weight corresponding to the i-th sentence fragment in multiple sentence fragments, i is used to represent the sequence number of multiple sentence fragments, and the sequence number i is a positive integer greater than or equal to 1; k is used to represent the sequence number of each word in the i-th sentence fragment in the symptom description sentence, k iIt is used to indicate the sequence number of the first word in the symptom description sentence in the i-th sentence fragment, l i Used to indicate the number of words contained in the th sentence fragment, w k Used to indicate the weight corresponding to the k-th word.
[0169] 307. The computer device determines the sentence segment corresponding to the maximum weight among the multiple sentence segments as the target sentence segment that causes the symptom description sentence to be mapped to a medical term.
[0170] Since the weight of a sentence segment represents the degree of association between the sentence segment and the symptom described in the symptom description sentence, the sentence segment corresponding to the maximum weight is the sentence segment that has the greatest degree of association with the symptom described in the symptom description sentence among the multiple sentence segments, and the medical term mapped to the symptom description sentence is a medical term associated with the symptom described in the symptom description sentence, the sentence segment corresponding to the maximum weight can be determined as the target sentence segment that causes the symptom description sentence to be mapped to a medical term.
[0171] 308. The computer device outputs the medical terms and the target sentence fragment.
[0172] After determining the medical term and target sentence fragment, the computer device outputs the medical term and target sentence fragment. The target sentence fragment serves as evidence that the symptom description sentence is mapped to the medical term. Therefore, by outputting the target sentence fragment, the amount of output information is increased, making the medical term mapping process interpretable.
[0173] In one possible implementation, after a computer device determines a medical term and a target sentence fragment, it displays the medical term and the target sentence fragment. For example, if the computer device is a terminal, the symptom description statement in step 301 is input by a doctor or user, and the symptom description statement is used to describe the user's symptoms. After the terminal determines the medical term and the target sentence fragment, it displays the medical term and the target sentence fragment. The doctor can then determine the user's physical condition based on the displayed medical term and other information about the user. Furthermore, since the target sentence fragment is the evidence that causes the symptom description statement to be mapped to the medical term, the doctor can also judge the accuracy of the medical term corresponding to the symptom description statement based on the displayed target sentence fragment. Alternatively, if the computer device is a server, and the symptom description statement in step 301 is sent by a terminal, then after the server determines the medical term and the target sentence fragment, it sends the medical term and the target sentence fragment to the terminal, which then displays the medical term and the target sentence fragment.
[0174] In another possible implementation, after the computer device determines the medical term and target sentence fragment, it outputs the medical term and target sentence fragment and uses them as input for the next stage for subsequent processing. For example, if the medical term is a second medical term used to describe a symptom, the computer device determines a first medical term corresponding to the second medical term based on the second medical term, where the first medical term is a medical term describing a disease, and then displays the first medical term. The doctor then determines the user's physical condition based on the displayed first medical term and other information about the user. Alternatively, the computer device continues to query a knowledge database that includes correspondences between the first medical term and department information, determines department information that matches the first medical term, and then displays the department information, so that the user can visit the department indicated by the department information, thereby implementing a medical guidance function. The department information is used to indicate the department that diagnosed the first medical term, and optionally, the department information includes information about doctors belonging to that department.
[0175] In the embodiment of the present application, the symptom description sentence is a colloquial description sentence, that is, the symptom is described in a colloquial sentence, and the medical term is a standard medical entity. Through the word mapping model provided in the embodiment of the present application, the symptom description sentence can be mapped to a standard medical term to achieve accurate conversion from colloquial to standardized, and achieve medical entity standardization (Medical Concept Normalization), so that subsequent processing can be performed based on the standardized medical terms obtained by mapping. For example, the method provided in the embodiment of the present application is applied to a medical pre-consultation system, and the colloquial or unclear symptom description sentence input by the user can be accurately mapped to the corresponding medical term. Moreover, while mapping the symptom description sentence to a medical term, a target sentence segment is extracted from the symptom description sentence that causes the symptom description sentence to be mapped to a medical term. The target sentence segment plays a decisive role in the mapping process. Therefore, by performing argument extraction (Rationale Extraction), the interpretability of the medical term mapping process is achieved.
[0176] In an embodiment of the present application, extracting target sentence fragments from the symptom description sentence as the argument of the mapping process can avoid the situation where the determined argument is not accurate due to the excessive dispersion of words, compared to extracting a single word as the argument of the mapping process, and can improve the accuracy of argument extraction. For example, the symptom description sentence is "The skin has been a little itchy recently, and it has lasted for a week." If the method of extracting a single word is adopted, the extracted argument is "itching", which is unclear. In the embodiment of the present application, the method of extracting sentence fragments is adopted, and the extracted argument is "The skin is a little itchy", which is more accurate.
[0177] Figure 4 This is a flowchart of a medical term mapping method provided in an embodiment of the present application, the method comprising:
[0178] 1. Segment the symptom description sentence in the word mapping model to obtain multiple words;
[0179] 2. Call the word encoding network in the word mapping model to encode multiple words and obtain the word vector of each word;
[0180] 3. Call the feature extraction network in the word mapping model to extract features from multiple word vectors and obtain the weight of each word;
[0181] 4. Call the weighted fusion network in the word mapping model to perform weighted fusion on the word vectors of multiple words based on their weights to obtain sentence features;
[0182] 5. Call the feature mapping network in the word mapping model to map the sentence features to obtain the predicted probabilities of multiple medical terms, and select the medical term corresponding to the maximum predicted probability as the medical term corresponding to the symptom description sentence;
[0183] 6. Determine the weights of multiple sentence fragments based on the weights of the multiple words, and select the sentence fragment corresponding to the maximum weight as the target sentence fragment that causes the symptom description sentence to be mapped to the medical term;
[0184] 7. Output the medical terms corresponding to the symptom description sentence and the target sentence fragment.
[0185] The method provided in the embodiment of the present application, in the process of mapping the symptom description sentence to obtain the corresponding medical term, simultaneously obtains the weight of each word in the symptom description sentence, and determines the weight of each sentence fragment based on the weight of the word. The target sentence fragment with the largest weight is the argument for the symptom description sentence to be mapped to the medical term, thereby realizing the explainability of the medical term mapping process.
[0186] Moreover, if the argument is determined in a single word, the determined argument will be inaccurate because the words are too scattered. However, the present application determines the argument that the symptom description statement is mapped to a medical term in a sentence segment including multiple words, which can make the interpretability of the medical term mapping process more accurate.
[0187] Furthermore, using a sliding window approach to segment symptom descriptions results in sentence fragments consisting of multiple consecutive words. Compared to single words, sentence fragments contain more information and are more concentrated, making them more accurate in representing the symptoms described in symptom descriptions. By setting the length of the sliding window and the distance it moves, the number of words in a sentence fragment and the distance between each sentence fragment can be adjusted, improving the flexibility of symptom description segmentation.
[0188] Furthermore, by using target punctuation to segment symptom descriptions, the resulting sentence fragments contain complete sentences, making the information in the sentence fragments more coherent and focused, further improving the accuracy of using sentence fragments to represent the symptoms described in symptom descriptions. By identifying target punctuation in symptom descriptions, the symptom descriptions can be segmented based on their position, making segmentation more convenient.
[0189] Moreover, since the weight of a word can represent the degree of association between the word and the symptoms described in the symptom description sentence, the sentence features obtained by weighted fusion based on the weights of multiple words highlight the influence of words with a high degree of association with the symptoms described in the symptom description sentence in the sentence features, and weaken the influence of words with a low degree of association with the symptoms described in the symptom description sentence in the sentence features, thereby improving the accuracy of the sentence features of the symptom description sentence.
[0190] In order to compare the argument extraction mechanism of this solution, a comparative test was conducted on three sets of data, and 700, 900 and 1137 annotated data were selected as training data, 500 annotated data were selected as development data, and 1000 annotated data were selected as test data. For the feature mapping network in the word mapping model is WordCNN or WordGRU, and the feature extraction network in the word mapping model is Enc-Gen or Soft Atten, by adopting the pre-training method of this application and the method without pre-training, and adopting the argument extraction mechanism of sliding window and the argument extraction mechanism of punctuation, Mi (micro accuracy) and Ma (macro accuracy) are determined respectively, as shown in Table 1. The window in Table 1 represents the argument extraction mechanism using sliding window, and the sentence in Table 1 represents the argument extraction mechanism using punctuation. It can be seen from Table 1 that after pre-training, the WordGRU using the sliding window argument extraction mechanism improves Mi by 2% and Ma by 1% compared with the WordGRU using the punctuation argument extraction mechanism.
[0191] Table 1
[0192]
[0193]
[0194] Figure 5 This is a flowchart of a method for training a word mapping model provided in an embodiment of the present application, wherein the word mapping model trained by the method provided in an embodiment of the present application can be applied to the above Figure 2 or Figure 3 The embodiment of the present application provides a medical term mapping method. The execution subject of the embodiment of the present application is a computer device, see Figure 5 , the method comprising:
[0195] 501. The computer device obtains a sample symptom description sentence and annotation information of the sample symptom description sentence.
[0196] The sample symptom description statement is a statement used to describe the symptoms. The sample symptom description statement is the same as the above Figure 3 The annotation information includes medical terms associated with the symptoms described in the sample symptom description sentence. Optionally, the annotation information includes at least one of a first medical term or a second medical term, where the first medical term is a term used to describe the disease and the second medical term is a term used to describe the symptom. For example, if the sample symptom description sentence is "I have a stomachache," the medical term included in the annotation information is "abdominal pain."
[0197] In one possible implementation, a computer device stores a term annotation model that is used to annotate corresponding medical terms for any symptom description sentence. After obtaining a sample symptom description sentence, the computer device invokes the term annotation model to annotate the sample symptom description sentence, obtain the medical terms corresponding to the sample symptom description sentence, and use the obtained medical terms as annotation information.
[0198] Through the word tagging model, automatic tagging of symptom description sentences can be achieved without the need for manual tagging, which saves manual tagging time and improves tagging efficiency.
[0199] In another possible implementation, a computer device obtains a sample symptom description sentence and a reply sentence to the sample symptom description sentence, and generates annotation information of the symptom description sentence based on medical terms included in the reply sentence.
[0200] The reply statement to the sample symptom description statement is a statement used to reply to the sample symptom description statement, and the medical terms contained in the reply statement are associated with the symptoms described in the sample symptom description statement. Optionally, the reply statement is a reply from a doctor to the sample symptom description statement, for example, the reply statement is "Abdominal pain may be caused by a variety of reasons."
[0201] Among them, the reply statement to the sample symptom description statement contains medical terms, and the medical terms contained in the reply statement are associated with the sample symptom description statement. Optionally, the medical terms contained in the reply statement are first medical terms, and the symptoms described in the sample symptom description statement are the symptoms of the disease described by the first medical terms. For example, the medical terms contained in the reply statement are "gastrointestinal disease", and the sample symptom description statement is "I have a stomachache", that is, the medical terms contained in the reply statement are first medical terms, and the symptoms described in the sample symptom description statement are the symptoms of the disease indicated by the first medical terms. Optionally, the medical terms contained in the reply statement are second medical terms, and the symptoms described by the second medical terms are the same as the symptoms described in the sample symptom description statement. For example, the medical terms contained in the reply statement are "abdominal pain", and the sample symptom description statement is "I have a stomachache".
[0202] There are three ways to generate annotation information for symptom description sentences based on the medical terms contained in the reply sentences:
[0203] The first method involves a computer device performing keyword extraction on the reply sentence to obtain medical terms in the reply sentence, and then using the obtained medical terms to form annotation information. In this embodiment of the present application, the reply sentence contains medical terms, and keyword extraction is used to extract the medical terms from the reply sentence, and the extracted medical terms are used to form annotation information for the symptom description sentence.
[0204] Optionally, the computer device performs word segmentation on the reply statement to obtain at least one word, and searches a knowledge database for medical terms contained in the at least one word. The knowledge database includes at least one medical term. By performing word segmentation processing, the at least one word contained in the reply statement is obtained, and each word is compared with the medical terms contained in the knowledge database to determine which words in the at least one word are identical to the medical terms contained in the knowledge database, thereby determining the medical terms contained in the at least one word, thereby ensuring the accuracy of the determined medical terms.
[0205] The second method: the computer device extracts keywords from the reply sentence to obtain the first medical term and the second medical term in the reply sentence, and queries at least one second medical term corresponding to the first medical term from the knowledge database based on the first medical term, and the extracted second medical term and the queried second medical term constitute annotation information. In an embodiment of the present application, the knowledge database includes a correspondence between the first medical term and the second medical term, which is used to represent the symptoms of a certain disease. Optionally, the knowledge database is a medical knowledge graph. For example, in the knowledge database, any first medical term is "fungal infection", and the second term corresponding to the first medical term is "redness and swelling". The reply sentence contains the first medical term and the second medical term, the first medical term is a term used to describe the disease, and the second medical term is a term used to describe the symptoms.
[0206] Figure 6 This is a schematic diagram of obtaining annotation information provided by an embodiment of the present application. Figure 6 As shown, for a response sentence such as "The rash may be caused by a fungal infection," keyword extraction is performed on the response sentence to obtain the first medical term "fungal infection" and the second medical term "rash." Based on the first medical term, the knowledge database is queried to determine the second medical term corresponding to the first medical term "fungal infection." All the obtained second medical terms constitute the annotation information for the symptom description sentence corresponding to the response sentence. Furthermore, in the knowledge database, the first and second medical terms are stored as triples: the first medical term, a term representing the relationship, and the second medical term. For example, "fungal infection, symptom, redness" indicates that a symptom of the first medical term "fungal infection" is the second medical term "redness."
[0207] Optionally, the computer device performs word segmentation on the reply statement to obtain at least one word, and based on the at least one word, searches a knowledge database for a first medical term and a second medical term included in the at least one word. By performing word segmentation, at least one word included in the reply statement is obtained, and each word is compared with the medical terms included in the knowledge database to determine words in the at least one word that are identical to the medical terms included in the knowledge database, thereby determining the first medical term and the second medical term included in the at least one word, thereby ensuring the accuracy of the determined medical terms.
[0208] Method 3: The computer performs keyword extraction on the reply sentence to obtain a first medical term in the reply sentence. Based on the first medical term, the computer searches the knowledge database for at least one second medical term corresponding to the first medical term. The retrieved second medical term is used to form annotation information. This process is similar to the second method described above and will not be further described here.
[0209] In another possible implementation, a computer device obtains a sample symptom description sentence and annotation information obtained by manually annotating the sample symptom description sentence.
[0210] 502. The computer device calls the word encoding network in the word mapping model to encode each sample word in the sample symptom description sentence to obtain a word vector for each sample word in the sample symptom description sentence.
[0211] 503. The computer device calls the feature extraction network in the word mapping model to perform feature extraction on the word vectors of multiple sample words in the sample symptom description sentence to obtain the weight of each sample word.
[0212] 504. The computer device calls the weighted fusion network in the word mapping model, performs weighted fusion on the word vectors of the multiple sample words based on the weights of the multiple sample words, and obtains the sample sentence features of the sample symptom description sentence.
[0213] The processes of steps 502-504 are similar to those of steps 301-303, and are not described in detail here.
[0214] 505. The computer device calls the feature mapping network in the word mapping model to map the sample sentence features to obtain sample prediction probabilities corresponding to multiple reference medical terms.
[0215] The feature mapping network in the term mapping model includes multiple reference medical terms, each of which is used to describe a symptom. The sample prediction probability corresponding to each reference medical term indicates the likelihood that the reference medical term is the medical term corresponding to the sample symptom description sentence. A greater sample prediction probability indicates a greater likelihood that the corresponding reference medical term is the medical term corresponding to the sample symptom description sentence, while a smaller sample prediction probability indicates a lower likelihood that the corresponding reference medical term is the medical term corresponding to the sample symptom description sentence.
[0216] In one possible implementation, a computer device invokes a term mapping model to perform feature transformation on sample sentence features to obtain sample reference features. The sample reference features include sample feature values in multiple dimensions, each dimension corresponding to a reference medical term. The sample feature values in each dimension of the sample reference features are then used to determine the sample prediction probability corresponding to the reference medical term corresponding to each dimension. The process of determining the sample prediction probability in step 505 is similar to the process of determining the prediction probability in step 304 above and will not be further elaborated here.
[0217] 506. The computer device trains the word mapping model based on the sample prediction probabilities corresponding to the multiple reference medical terms and the medical terms in the annotation information.
[0218] Since the sample prediction probabilities corresponding to multiple reference medical terms are used to indicate the possibility that the corresponding reference medical terms are the medical terms corresponding to the sample symptom description sentences, and the medical terms in the annotation information are the medical terms corresponding to the sample symptom description sentences, the accuracy of the term mapping model can be determined through the sample prediction probabilities of the multiple reference medical terms and the medical terms in the annotation information, thereby training the term mapping model to improve the accuracy of the term mapping model.
[0219] In one possible implementation, a computer device determines a first target value as the true probability of a medical term in the annotation information, and for any medical term in the annotation information, determines a sample prediction probability corresponding to a reference medical term that is identical to the medical term as the sample prediction probability corresponding to the medical term, and determines a loss value of a word mapping model based on the sample prediction probability and the true probability corresponding to each medical term in the annotation information, and trains the word mapping model based on the loss value.
[0220] Among them, the first target value is an arbitrary value. For example, the first target value is 1. The annotation information includes at least one medical term, and each medical term may be the same as a reference medical term. Then, for any medical term in the annotation information, the sample prediction probability corresponding to the reference medical term that is the same as the medical term is determined as the sample prediction probability corresponding to the medical term to indicate the possibility that the medical term is the medical term corresponding to the symptom description statement.
[0221] After obtaining the true probability and sample prediction probability corresponding to each medical term in the annotation information, the true probability of each medical term indicates that the corresponding medical term is the medical term corresponding to the sample symptom description sentence. Then, through the true probability and sample prediction probability corresponding to the medical terms in the annotation information, the difference between the true probability and the sample prediction probability corresponding to each medical term can be determined, thereby determining the loss value of the word mapping model. The word mapping model is trained through the loss value to improve the accuracy of the word mapping model.
[0222] Optionally, the process of obtaining the loss value of the word mapping model includes: after obtaining the sample prediction probability corresponding to each medical term in the annotation information, determining the second target value as the true probability corresponding to the reference medical terms not included in the annotation information among multiple reference medical terms, and determining the loss value of the word mapping model based on the sample prediction probability and true probability corresponding to each medical term in the annotation information, and the sample prediction probability and true probability corresponding to the reference medical terms not included in the annotation information.
[0223] The second target value is an arbitrary value, for example, the second target value is 0. Among the multiple reference medical terms, the symptoms described by the reference medical terms not included in the annotation information are unrelated to the symptoms described by the sample symptom description sentence. After determining the true probability of the reference medical terms not included in the annotation information, that is, determining the sample prediction probability and true probability corresponding to each medical term in the annotation information, and the sample prediction probability and true probability corresponding to the reference medical terms not included in the annotation information, then according to the difference between the sample prediction probability and the true probability corresponding to each medical term, and the difference between the sample prediction probability and the true probability corresponding to each reference medical term, the loss value of the word mapping model can be determined.
[0224] Optionally, after determining the sample prediction probability and true probability corresponding to each medical term in the annotation information, and the sample prediction probability and true probability corresponding to the reference medical terms not included in the annotation information, that is, determining the sample prediction probability and true probability corresponding to multiple reference medical terms, the true probabilities corresponding to the multiple reference medical terms are used to form a real feature. Optionally, the real feature is a real feature vector or a real feature matrix. The real feature includes feature values of multiple dimensions, each dimension corresponding to a reference medical term, and the feature value of each dimension is the true probability for a reference medical term. Then, the loss value of the word mapping model satisfies the following relationship:
[0225]
[0226] in, Used to represent the loss value of the word mapping model, is used to represent the real features, σ(·) is used to represent the Sigmoid (logistic regression) function, which is used to map the numerical value to (0, 1); v is used to represent the sentence features of the sample symptom description sentence; W is used to represent the feature transformation matrix in the word mapping model; T is used to represent the transpose of the matrix; v·W T Used to indicate reference features.
[0227] The above steps 502-505 illustrate the process of training the word mapping model based on the sample symptom description sentences and the annotation information. It should be noted that the embodiment of the present application only illustrates the training process of the word mapping model with one round, and in another embodiment, multiple sample symptom description sentences and the annotation information of each sample symptom description sentence are obtained, and the above steps 502-506 are repeated to iteratively train the word mapping model. In response to the iteration round reaching the first threshold, the word mapping model is stopped for training; or, in response to the loss value obtained in the current iteration round being not greater than the second threshold, the word mapping model is stopped for training. Wherein, the first threshold and the second threshold are both arbitrary values, for example, the first threshold is 10 or 15, etc., and the second threshold is 0.4 or 0.3, etc.
[0228] It should be noted that the above-mentioned process of training the word mapping model based on the sample prediction probabilities corresponding to multiple reference medical terms and the medical terms in the annotation information is described under the condition that the multiple reference medical terms include the medical terms in the annotation information. In another embodiment, after obtaining the annotation information of the sample symptom description sentence, in response to any medical term in the annotation information not being included in the multiple reference medical terms, the medical term is determined as a reference medical term, the multiple reference medical terms included in the word mapping model are updated, and after the reference medical terms included in the word mapping model are updated, the word mapping model is retrained according to the above-mentioned steps 301-304.
[0229] The method provided in the embodiment of the present application uses sample symptom description sentences and corresponding annotation information to train a word mapping model, and subsequently uses the trained word mapping model to achieve mapping of symptom description sentences, obtain medical terms corresponding to the symptom description sentences, and achieve standardized mapping of symptom description sentences.
[0230] Moreover, the labeling information of the sample symptom description sentences is automatically determined through the sample symptom description sentences and the reply sentences to the sample symptom description sentences, and the word mapping model is trained based on the sample symptom description sentences and the labeling information. During this training process, there is no need to manually label the symptom description sentences, thus realizing unsupervised training of the word mapping model, reducing the dependence of the word mapping model on manually labeled data, and improving the accuracy of the word mapping model.
[0231] Figure 7 This is a schematic diagram of the structure of a medical term mapping device provided in an embodiment of the present application. Figure 7 , the device comprises:
[0232] A mapping module 701 is configured to call a word mapping model to map the symptom description sentence to obtain the medical terms corresponding to the symptom description sentence and the weight of each term in the symptom description sentence;
[0233] A sentence segmentation module 702 is used to segment the symptom description sentence into multiple sentence segments, each sentence segment includes multiple words;
[0234] A weight determination module 703 is configured to determine the weight of each sentence segment based on the weights of the words in each sentence segment;
[0235] A sentence segment determination module 704 is configured to determine the sentence segment corresponding to the maximum weight among the multiple sentence segments as the target sentence segment that causes the symptom description sentence to be mapped to a medical term;
[0236] The output module 705 is used to output medical terms and target sentence segments.
[0237] The medical term mapping device provided in the embodiments of the present application simultaneously obtains the weight of each word in the symptom description sentence during the process of mapping the corresponding medical term. Based on the weight of each word, the weight of each sentence fragment is determined. The target sentence fragment with the largest weight serves as the evidence for the symptom description sentence being mapped to a medical term, thereby achieving interpretability in the medical term mapping process. Furthermore, if this evidence is determined within a single word, the evidence may be inaccurate due to the excessive dispersion of the words. However, the present application determines the evidence for the symptom description sentence being mapped to a medical term within a sentence fragment comprising multiple words, thereby making the medical term mapping process more interpretable.
[0238] Alternatively, see Figure 8 , the sentence segmentation module 702 is used to:
[0239] According to the order of words in the symptom description sentence, a plurality of words starting with the first word and having a first number are selected to form a sentence fragment, wherein the first word is any word in the symptom description sentence, and the first number is an integer greater than 1;
[0240] Continue to select multiple words starting with the second word and the first number to form a sentence fragment, wherein the second word is located after the first word and is separated from the first word by the second number of words, until a sentence fragment including the last word in the symptom description sentence is formed, and the second number is an integer not less than 0.
[0241] Alternatively, see Figure 8 , the device further comprises:
[0242] The first quantity determination module 706 is configured to determine the product of the third quantity and the target ratio as the first quantity, where the third quantity is the number of words in the symptom description sentence, and the target ratio is greater than 0 and less than 1.
[0243] Alternatively, see Figure 8 , the device further comprises:
[0244] The second quantity determination module 707 is configured to determine a second quantity that is smaller than the difference between the third quantity and the first quantity, where the third quantity is the quantity of words in the symptom description sentence.
[0245] Alternatively, see Figure 8 , the sentence segmentation module 702 includes:
[0246] a punctuation mark determination unit 712, configured to determine each target punctuation mark in the symptom description sentence, wherein the target punctuation mark is a punctuation mark indicating the end of a sentence;
[0247] The sentence segmentation unit 722 is used to segment the symptom description sentence at the position of each target punctuation mark determined in the symptom description sentence to obtain multiple sentence fragments.
[0248] Alternatively, see Figure 8 The weight determination module 703 is used to determine the sum of the weights of multiple words in each sentence segment as the weight of each sentence segment.
[0249] Alternatively, see Figure 8 , mapping module 701, for:
[0250] A first encoding unit 711 is configured to call a word encoding network in a word mapping model to encode each word in the symptom description sentence to obtain a word vector for each word in the symptom description sentence;
[0251] The first feature extraction unit 721 is used to call the feature extraction network in the word mapping model to perform feature extraction on the word vectors of multiple words in the symptom description sentence to obtain the weight of each word;
[0252] The first weighted fusion unit 731 is used to call the weighted fusion network in the word mapping model to perform weighted fusion on the word vectors of multiple words based on the weights of the multiple words to obtain the sentence features of the symptom description sentence;
[0253] The first mapping unit 741 is used to call the feature mapping network in the word mapping model to map the sentence features to obtain medical terms.
[0254] Alternatively, see Figure 8 , the first encoding unit 711 is used to:
[0255] Call the word encoding network to segment the symptom description sentence and obtain each word in the symptom description sentence;
[0256] Call the word encoding network to encode each word and obtain the word vector of each word.
[0257] Alternatively, see Figure 8 The feature mapping network includes a plurality of reference medical terms, each of which is used to describe a symptom; a first mapping unit 741 is used to:
[0258] Calling a feature mapping network to map sentence features and obtain prediction probabilities corresponding to multiple reference medical terms. The prediction probability corresponding to each reference medical term is used to indicate the likelihood that the reference medical term is the medical term corresponding to the symptom description sentence.
[0259] Among the plurality of reference medical terms, a reference medical term corresponding to the maximum prediction probability is determined.
[0260] Alternatively, see Figure 8 , a first mapping unit 741 is configured to:
[0261] Calling the feature mapping network to perform feature transformation on the sentence features to obtain reference features. The reference features include feature values of multiple dimensions, each dimension corresponding to a reference medical term.
[0262] The feature value of each dimension in the reference feature is determined as the predicted probability corresponding to the reference medical term corresponding to each dimension.
[0263] Alternatively, see Figure 8 , the device further comprises:
[0264] An acquisition module 708 is configured to acquire a sample symptom description sentence and annotation information of the sample symptom description sentence, wherein the annotation information includes medical terms associated with the symptoms described in the sample symptom description sentence;
[0265] The training module 709 is used to train the word mapping model based on sample symptom description sentences and annotation information.
[0266] Alternatively, see Figure 8 The feature mapping network in the word mapping model includes multiple reference medical words. The training module 709 includes:
[0267] The second encoding unit 719 is used to call the word encoding network in the word mapping model to encode each sample word in the sample symptom description sentence to obtain a word vector for each sample word in the sample symptom description sentence;
[0268] A second feature extraction unit 729 is configured to call a feature extraction network in the word mapping model to perform feature extraction on the word vectors of multiple sample words in the sample symptom description sentence to obtain a weight for each sample word;
[0269] The second weighted fusion unit 739 is configured to call the weighted fusion network in the word mapping model and perform weighted fusion on the word vectors of the multiple sample words based on the weights of the multiple sample words to obtain the sample sentence features of the sample symptom description sentence;
[0270] The second mapping unit 749 is used to call the feature mapping network to map the sample sentence features to obtain sample prediction probabilities corresponding to multiple reference medical terms;
[0271] The training unit 759 is configured to train the word mapping model based on the sample prediction probabilities corresponding to the plurality of reference medical terms and the medical terms in the annotation information.
[0272] Alternatively, see Figure 8 , the second mapping unit 749 is used to:
[0273] Calling the word mapping model to perform feature transformation on the sample sentence features to obtain sample reference features. The sample reference features include sample feature values of multiple dimensions, each dimension corresponding to a reference medical term;
[0274] The sample feature value of each dimension in the sample reference feature is respectively determined as the sample prediction probability corresponding to the reference medical term corresponding to each dimension.
[0275] Alternatively, see Figure 8 , training unit 759, for:
[0276] Determining the first target value as the true probability of the medical term in the annotation information;
[0277] For any medical term in the annotation information, the sample prediction probability corresponding to the reference medical term identical to the medical term is determined as the sample prediction probability corresponding to the medical term;
[0278] Determine the loss value of the word mapping model based on the sample prediction probability and true probability corresponding to each medical word in the annotation information;
[0279] According to the loss value, the word mapping model is trained.
[0280] Alternatively, see Figure 8 , the device further comprises:
[0281] The probability determination module 710 is configured to determine the second target value as a true probability corresponding to a reference medical term not included in the annotation information among the plurality of reference medical terms;
[0282] The training unit 759 is used to:
[0283] The loss value of the word mapping model is determined based on the sample prediction probability and true probability corresponding to each medical term in the annotation information, and the sample prediction probability and true probability corresponding to the reference medical terms not included in the annotation information.
[0284] It should be noted that the medical term mapping device provided in the above embodiment only uses the aforementioned functional modules as an example for illustration. In actual applications, the aforementioned functions can be assigned to different functional modules as needed, i.e., the internal structure of a computer device can be divided into different functional modules to perform all or part of the functions described above. Furthermore, the medical term mapping device provided in the above embodiment and the medical term mapping method embodiment are based on the same concept. The specific implementation process is detailed in the method embodiment and will not be repeated here.
[0285] An embodiment of the present application further provides a computer device comprising a processor and a memory, wherein the memory stores at least one computer program, which is loaded and executed by the processor to implement the operations performed in the medical term mapping method of the above embodiment.
[0286] Optionally, the computer device is provided as a terminal. Figure 9 FIG2 is a schematic diagram showing the structure of a terminal 900 provided by an exemplary embodiment of the present application. The terminal 900 includes a processor 901 and a memory 902 .
[0287] The processor 901 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 901 may be implemented in at least one hardware form of DSP (Digital Signal Processing), FPGA (Field Programmable Gate Array), or PLA (Programmable Logic Array). The processor 901 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a CPU (Central Processing Unit); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 901 may be integrated with a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 901 may also include an AI (Artificial Intelligence) processor, which is used to process computing operations related to machine learning.
[0288] The memory 902 may include one or more computer-readable storage media, which may be non-transitory. The memory 902 may also include high-speed random access memory and non-volatile memory, such as one or more disk storage devices and flash memory storage devices. In some embodiments, the non-transitory computer-readable storage medium in the memory 902 is used to store at least one computer program, which is used to be executed by the processor 901 to implement the medical term mapping method provided in the method embodiment of the present application.
[0289] In some embodiments, terminal 900 may also optionally include a peripheral device interface 903 and at least one peripheral device. Processor 901, memory 902, and peripheral device interface 903 may be connected via a bus or signal lines. Each peripheral device may be connected to peripheral device interface 903 via a bus, signal lines, or circuit boards. Optionally, the peripheral device includes at least one of a radio frequency circuit 904, a display screen 905, a camera assembly 906, an audio circuit 907, and a power supply 909.
[0290] The peripheral device interface 903 can be used to connect at least one I / O (Input / Output)-related peripheral device to the processor 901 and the memory 902. In some embodiments, the processor 901, the memory 902, and the peripheral device interface 903 are integrated on the same chip or circuit board; in some other embodiments, any one or two of the processor 901, the memory 902, and the peripheral device interface 903 can be implemented on separate chips or circuit boards, which is not limited in this embodiment.
[0291] The RF circuit 904 is used to receive and transmit RF (Radio Frequency) signals, also known as electromagnetic signals. The RF circuit 904 communicates with communication networks and other communication devices via electromagnetic signals. The RF circuit 904 converts electrical signals into electromagnetic signals for transmission, or converts received electromagnetic signals into electrical signals. Optionally, the RF circuit 904 includes: an antenna system, an RF transceiver, one or more amplifiers, a tuner, an oscillator, a digital signal processor, a codec chipset, a user identity module card, and the like. The RF circuit 904 can communicate with other devices via at least one wireless communication protocol. Such wireless communication protocols include, but are not limited to, metropolitan area networks, various generations of mobile communication networks (2G, 3G, 4G, and 5G), wireless local area networks, and / or WiFi (Wireless Fidelity) networks. In some embodiments, the RF circuit 904 may also include circuits related to NFC (Near Field Communication), which is not limited in this application.
[0292] The display screen 905 is used to display a user interface (UI). This UI may include graphics, text, icons, videos, or any combination thereof. If the display screen 905 is a touchscreen display, it is also capable of collecting touch signals on or above the surface of the display screen 905. These touch signals can be input as control signals to the processor 901 for processing. In this case, the display screen 905 can also be used to provide virtual buttons and / or a virtual keyboard, also known as soft buttons and / or a soft keyboard. In some embodiments, there can be a single display screen 905, located on the front panel of the terminal 900. In other embodiments, there can be at least two display screens 905, located on different surfaces of the terminal 900 or in a foldable design. In still other embodiments, the display screen 905 can be a flexible display screen, located on a curved or foldable surface of the terminal 900. Furthermore, the display screen 905 can be configured as a non-rectangular, irregular shape, also known as a special-shaped screen. The display screen 905 can be made of materials such as LCD (Liquid Crystal Display) and OLED (Organic Light-Emitting Diode).
[0293] The camera assembly 906 is used to capture images or videos. Optionally, the camera assembly 906 includes a front camera and a rear camera. The front camera is arranged on the front panel of the terminal 900, and the rear camera is arranged on the back of the terminal 900. In some embodiments, there are at least two rear cameras, which are any one of a main camera, a depth of field camera, a wide-angle camera, and a telephoto camera, so as to realize the fusion of the main camera and the depth of field camera to realize the background blur function, the fusion of the main camera and the wide-angle camera to realize panoramic shooting and VR (Virtual Reality) shooting function or other fusion shooting functions. In some embodiments, the camera assembly 906 may also include a flash. The flash can be a monochrome temperature flash or a dual-color temperature flash. The dual-color temperature flash refers to a combination of a warm light flash and a cold light flash, which can be used for light compensation under different color temperatures.
[0294] The audio circuit 907 may include a microphone and a speaker. The microphone is used to collect sound waves from the user and the environment, and convert the sound waves into electrical signals to be input into the processor 901 for processing, or input into the radio frequency circuit 904 to achieve voice communication. For the purpose of stereo sound collection or noise reduction, there may be multiple microphones, each located in different parts of the terminal 900. The microphone may also be an array microphone or an omnidirectional collection microphone. The speaker is used to convert electrical signals from the processor 901 or the radio frequency circuit 904 into sound waves. The speaker may be a traditional thin film speaker or a piezoelectric ceramic speaker. When the speaker is a piezoelectric ceramic speaker, it can not only convert electrical signals into sound waves audible to humans, but also convert electrical signals into sound waves inaudible to humans for purposes such as ranging. In some embodiments, the audio circuit 907 may also include a headphone jack.
[0295] Power supply 909 is used to power various components in terminal 900. Power supply 909 can be AC power, DC power, disposable batteries, or rechargeable batteries. When power supply 909 includes a rechargeable battery, the rechargeable battery can support wired charging or wireless charging. The rechargeable battery can also be used to support fast charging technology.
[0296] In some embodiments, the terminal 900 further includes one or more sensors 910 , including but not limited to: an acceleration sensor 911 , a gyroscope sensor 912 , a pressure sensor 913 , an optical sensor 915 , and a proximity sensor 916 .
[0297] The accelerometer 911 can detect the magnitude of acceleration along the three coordinate axes of the coordinate system established by the terminal 900. For example, the accelerometer 911 can be used to detect the components of gravity acceleration along the three coordinate axes. The processor 901 can control the display screen 905 to display the user interface in a landscape or portrait view based on the gravity acceleration signal collected by the accelerometer 911. The accelerometer 911 can also be used to collect game or user motion data.
[0298] The gyroscope sensor 912 can detect the orientation and rotation angle of the terminal 900. It can work with the accelerometer 911 to collect the user's 3D movements on the terminal 900. Based on the data collected by the gyroscope sensor 912, the processor 901 can implement the following functions: motion sensing (for example, changing the UI based on the user's tilt operation), image stabilization during shooting, game control, and inertial navigation.
[0299] The pressure sensor 913 can be set on the side frame of the terminal 900 and / or the lower layer of the display screen 905. When the pressure sensor 913 is set on the side frame of the terminal 900, it can detect the user's grip signal of the terminal 900, and the processor 901 performs left and right hand recognition or shortcut operations based on the grip signal collected by the pressure sensor 913. When the pressure sensor 913 is set on the lower layer of the display screen 905, the processor 901 controls the operable controls on the UI interface based on the user's pressure operation on the display screen 905. The operable controls include at least one of button controls, scroll bar controls, icon controls, and menu controls.
[0300] The optical sensor 915 is used to detect ambient light intensity. In one embodiment, the processor 901 can control the display brightness of the display screen 905 based on the ambient light intensity detected by the optical sensor 915. Optionally, when the ambient light intensity is high, the display brightness of the display screen 905 is increased; when the ambient light intensity is low, the display brightness of the display screen 905 is decreased. In another embodiment, the processor 901 can also dynamically adjust the shooting parameters of the camera assembly 906 based on the ambient light intensity detected by the optical sensor 915.
[0301] Proximity sensor 916, also known as a distance sensor, is provided on the front panel of terminal 900. Proximity sensor 916 is used to detect the distance between the user and the front of terminal 900. In one embodiment, when proximity sensor 916 detects that the distance between the user and the front of terminal 900 is gradually decreasing, processor 901 controls display screen 905 to switch from the screen-on state to the screen-off state. When proximity sensor 916 detects that the distance between the user and the front of terminal 900 is gradually increasing, processor 901 controls display screen 905 to switch from the screen-off state to the screen-on state.
[0302] Those skilled in the art will understand that Figure 9 The structure shown in the figure does not constitute a limitation on the terminal 900, and the terminal 900 may include more or fewer components than shown in the figure, or combine certain components, or adopt a different component arrangement.
[0303] Optionally, the computer device is provided as a server. Figure 10This is a schematic diagram of the structure of a server provided in an embodiment of the present application. The server 1000 may have relatively large differences due to different configurations or performances, and may include one or more processors (Central Processing Units, CPU) 1001 and one or more memories 1002, wherein the memory 1002 stores at least one computer program, and the at least one computer program is loaded and executed by the processor 1001 to implement the methods provided in the above-mentioned various method embodiments. Of course, the server may also have components such as a wired or wireless network interface, a keyboard, and an input and output interface for input and output. The server may also include other components for implementing device functions, which will not be described in detail here.
[0304] An embodiment of the present application further provides a computer-readable storage medium storing at least one computer program, which is loaded and executed by a processor to implement the operations performed in the medical term mapping method of the above embodiment.
[0305] An embodiment of the present application also provides a computer program product or computer program, which includes computer program code. The computer program code is stored in a computer-readable storage medium. A processor of a computer device reads the computer program code from the computer-readable storage medium, and the processor executes the computer program code, so that the computer device implements the operations performed in the medical term mapping method of the above embodiment.
[0306] Those skilled in the art will understand that all or part of the steps to implement the above embodiments may be accomplished by hardware, or by a program to instruct the relevant hardware, and the program may be stored in a computer-readable storage medium, which may be a read-only memory, a disk, or an optical disk, etc.
[0307] The above description is merely an optional embodiment of the embodiments of the present application and is not intended to limit the embodiments of the present application. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the embodiments of the present application shall be included in the scope of protection of the present application.
Claims
1. A medical term mapping method, characterized in that: The method comprises: Calling the word encoding network in the word mapping model to encode each word in the symptom description sentence to obtain a word vector for each word; calling the feature extraction network in the word mapping model to perform feature extraction on the word vector of each word to obtain a weight for each word, wherein the weight for each word represents the degree of association between each word and the symptom described in the symptom description sentence; Calling the weighted fusion network in the word mapping model to perform weighted fusion on the word vectors of the multiple words in the symptom description sentence based on the weights of the multiple words to obtain the sentence features of the symptom description sentence; calling the feature mapping network in the word mapping model to map the sentence features to obtain the medical terms corresponding to the symptom description sentence, where the medical terms corresponding to the symptom description sentence are medical terms associated with the symptoms described in the symptom description sentence; Segmenting the symptom description statement into a plurality of sentence segments, each sentence segment including a plurality of words; Determining the weight of each sentence fragment based on the weight of the words in each sentence fragment; determining the sentence segment corresponding to the maximum weight among the multiple sentence segments as the target sentence segment that causes the symptom description sentence to be mapped to the medical term; The medical term and the target sentence segment are output.
2. The method according to claim 1, characterized in that The step of dividing the symptom description statement into multiple statement segments includes: According to the order of words in the symptom description sentence, a plurality of words starting with a first word and having a first number are selected to form a sentence fragment, wherein the first word is any word in the symptom description sentence, and the first number is an integer greater than 1; Continue to select multiple words starting with the second word and the first number to form a sentence fragment, wherein the second word is located after the first word and is separated from the first word by a second number of words, until a sentence fragment including the last word in the symptom description sentence is formed, and the second number is an integer not less than 0.
3. The method according to claim 2, characterized in that Before selecting a first number of words starting with the first word and forming a sentence segment according to the order of words in the symptom description sentence, the method further includes: The product of a third number and a target ratio is determined as the first number, the third number being the number of words in the symptom description sentence, and the target ratio being greater than 0 and less than 1.
4. The method according to claim 1, wherein The step of dividing the symptom description statement into multiple statement segments includes: Determining each target punctuation mark in the symptom description sentence, wherein the target punctuation mark is a punctuation mark indicating the end of a sentence; The position of each target punctuation mark determined in the symptom description sentence is segmented to obtain the multiple sentence segments.
5. The method according to claim 1, wherein The step of determining the weight of each sentence fragment based on the weight of the words in each sentence fragment comprises: The sum of the weights of the multiple words in each sentence fragment is determined as the weight of each sentence fragment.
6. The method according to claim 1, characterized in that The feature mapping network includes a plurality of reference medical terms, each of which is used to describe a symptom; calling the feature mapping network in the term mapping model to map the sentence features to obtain the medical terms corresponding to the symptom description sentence includes: calling the feature mapping network to map the sentence features to obtain prediction probabilities corresponding to the multiple reference medical terms, wherein the prediction probability corresponding to each reference medical term is used to indicate the likelihood that the reference medical term is the medical term corresponding to the symptom description sentence; Among the plurality of reference medical terms, a reference medical term corresponding to a maximum prediction probability is determined.
7. The method according to claim 6, characterized in that The calling of the feature mapping network to map the sentence features to obtain prediction probabilities corresponding to the multiple reference medical terms includes: Calling the feature mapping network to perform feature transformation on the sentence features to obtain reference features, wherein the reference features include feature values of multiple dimensions, each dimension corresponding to a reference medical term; The feature value of each dimension in the reference feature is respectively determined as the predicted probability corresponding to the reference medical term corresponding to each dimension.
8. The method according to any one of claims 1 to 7, characterized in that Before calling the word encoding network in the word mapping model to encode each word in the symptom description sentence and obtaining the word vector of each word, the method further includes: Acquire a sample symptom description sentence and annotation information of the sample symptom description sentence, wherein the annotation information includes medical terms associated with the symptoms described by the sample symptom description sentence; The word mapping model is trained based on the sample symptom description sentences and the annotation information.
9. The method according to claim 8, characterized in that The feature mapping network in the word mapping model includes a plurality of reference medical terms, and the word mapping model is trained according to the sample symptom description sentences and the annotation information, including: Calling a word encoding network in the word mapping model to encode each sample word in the sample symptom description sentence to obtain a word vector for each sample word in the sample symptom description sentence; Calling a feature extraction network in the word mapping model to perform feature extraction on word vectors of multiple sample words in the sample symptom description sentence to obtain a weight for each sample word; Calling the weighted fusion network in the word mapping model to perform weighted fusion on the word vectors of the multiple sample words based on the weights of the multiple sample words to obtain sample sentence features of the sample symptom description sentence; Calling the feature mapping network to map the sample sentence features to obtain sample prediction probabilities corresponding to the multiple reference medical terms; The word mapping model is trained according to the sample prediction probabilities corresponding to the multiple reference medical terms and the medical terms in the annotation information.
10. The method according to claim 9, characterized in that The training of the term mapping model according to the sample prediction probabilities corresponding to the plurality of reference medical terms and the medical terms in the annotation information includes: Determining the first target value as a true probability of the medical term in the annotation information; For any medical term in the annotation information, determining the sample prediction probability corresponding to the reference medical term identical to the medical term as the sample prediction probability corresponding to the medical term; Determining a loss value of the word mapping model based on a sample prediction probability and a true probability corresponding to each medical word in the annotation information; The word mapping model is trained according to the loss value.
11. The method according to claim 10, characterized in that Before determining the loss value of the word mapping model based on the sample prediction probability and the true probability corresponding to each medical word in the annotation information, the method further includes: determining a second target value as a true probability corresponding to a reference medical term among the plurality of reference medical terms that is not included in the annotation information; Determining the loss value of the word mapping model according to the sample prediction probability and the true probability corresponding to each medical word in the annotation information includes: The loss value of the word mapping model is determined based on the sample prediction probability and true probability corresponding to each medical term in the annotation information and the sample prediction probability and true probability corresponding to reference medical terms not included in the annotation information.
12. A medical term mapping device, characterized in that: The device comprises: A mapping module is used to call the word encoding network in the word mapping model to encode each word in the symptom description sentence to obtain a word vector for each word; The mapping module is further configured to call a feature extraction network in the word mapping model to perform feature extraction on the word vector of each word to obtain a weight of each word, wherein the weight of each word represents a degree of association between each word and the symptom described by the symptom description sentence; The mapping module is further configured to call a weighted fusion network in the word mapping model, and perform weighted fusion on the word vectors of the multiple words based on the weights of the multiple words in the symptom description sentence to obtain the sentence features of the symptom description sentence; The mapping module is further configured to call a feature mapping network in the word mapping model to map the sentence features to obtain medical terms corresponding to the symptom description sentence, where the medical terms corresponding to the symptom description sentence are medical terms associated with the symptoms described in the symptom description sentence; A sentence segmentation module, configured to segment the symptom description sentence into a plurality of sentence segments, each sentence segment including a plurality of words; A weight determination module, configured to determine the weight of each sentence fragment based on the weight of the words in each sentence fragment; a sentence segment determination module, configured to determine the sentence segment corresponding to the largest weight among the multiple sentence segments as the target sentence segment that causes the symptom description sentence to be mapped to the medical term; An output module is used to output the medical terms and the target sentence fragments.
13. The device according to claim 12, characterized in that The sentence segmentation module is used to: According to the order of words in the symptom description sentence, a plurality of words starting with a first word and having a first number are selected to form a sentence fragment, wherein the first word is any word in the symptom description sentence, and the first number is an integer greater than 1; Continue to select multiple words starting with the second word and the first number to form a sentence fragment, wherein the second word is located after the first word and is separated from the first word by a second number of words, until a sentence fragment including the last word in the symptom description sentence is formed, and the second number is an integer not less than 0.
14. The device according to claim 13, characterized in that The device further comprises: The first quantity determination module is used to determine the product of a third quantity and a target ratio as the first quantity, where the third quantity is the number of words in the symptom description sentence, and the target ratio is greater than 0 and less than 1.
15. The device according to claim 12, characterized in that The sentence segmentation module includes: a punctuation mark determination unit, configured to determine each target punctuation mark in the symptom description sentence, wherein the target punctuation mark is a punctuation mark indicating the end of a sentence; The sentence segmentation unit is used to segment the position of each target punctuation mark determined in the symptom description sentence to obtain the multiple sentence fragments.
16. The device according to claim 12, characterized in that The weight determination module is used to: The sum of the weights of the multiple words in each sentence fragment is determined as the weight of each sentence fragment.
17. The device according to claim 12, characterized in that The feature mapping network includes a plurality of reference medical terms, each of which is used to describe a symptom; and the mapping module is used to: calling the feature mapping network to map the sentence features to obtain prediction probabilities corresponding to the multiple reference medical terms, wherein the prediction probability corresponding to each reference medical term is used to indicate the likelihood that the reference medical term is the medical term corresponding to the symptom description sentence; Among the plurality of reference medical terms, a reference medical term corresponding to a maximum prediction probability is determined.
18. The device according to claim 17, characterized in that The mapping module is used to: Calling the feature mapping network to perform feature transformation on the sentence features to obtain reference features, wherein the reference features include feature values of multiple dimensions, each dimension corresponding to a reference medical term; The feature value of each dimension in the reference feature is respectively determined as the predicted probability corresponding to the reference medical term corresponding to each dimension.
19. The device according to any one of claims 12 to 18, characterized in that The device further comprises: an acquisition module, configured to acquire a sample symptom description sentence and annotation information of the sample symptom description sentence, wherein the annotation information includes medical terms associated with the symptoms described in the sample symptom description sentence; A training module is used to train the word mapping model based on the sample symptom description sentences and the annotation information.
20. The device according to claim 19, characterized in that The feature mapping network in the word mapping model includes a plurality of reference medical words, and the training module includes: A second encoding unit is used to call the word encoding network in the word mapping model to encode each sample word in the sample symptom description sentence to obtain a word vector for each sample word in the sample symptom description sentence; a second feature extraction unit, configured to call a feature extraction network in the word mapping model, perform feature extraction on word vectors of a plurality of sample words in the sample symptom description sentence, and obtain a weight of each sample word; a second weighted fusion unit, configured to call a weighted fusion network in the word mapping model, and perform weighted fusion on the word vectors of the multiple sample words based on the weights of the multiple sample words to obtain a sample sentence feature of the sample symptom description sentence; a second mapping unit, configured to call the feature mapping network to map the sample sentence features to obtain sample prediction probabilities corresponding to the multiple reference medical terms; A training unit is configured to train the term mapping model based on the sample prediction probabilities corresponding to the plurality of reference medical terms and the medical terms in the annotation information.
21. The device according to claim 20, characterized in that The training unit is used to: Determining the first target value as a true probability of the medical term in the annotation information; For any medical term in the annotation information, determining the sample prediction probability corresponding to the reference medical term identical to the medical term as the sample prediction probability corresponding to the medical term; Determining a loss value of the word mapping model based on a sample prediction probability and a true probability corresponding to each medical word in the annotation information; The word mapping model is trained according to the loss value.
22. The device according to claim 21, characterized in that The device further comprises: a probability determination module, configured to determine the second target value as a true probability corresponding to a reference medical term among the plurality of reference medical terms that is not included in the annotation information; The training unit is used to: The loss value of the word mapping model is determined based on the sample prediction probability and true probability corresponding to each medical term in the annotation information and the sample prediction probability and true probability corresponding to reference medical terms not included in the annotation information.
23. A computer device, characterized in that: The computer device includes a processor and a memory, wherein the memory stores at least one computer program, and the at least one computer program is loaded and executed by the processor to implement the operations performed in the medical term mapping method according to any one of claims 1 to 11.
24. A computer-readable storage medium, characterized in that The computer-readable storage medium stores at least one computer program, and the at least one computer program is loaded and executed by a processor to implement the operations performed in the medical term mapping method according to any one of claims 1 to 11.
25. A computer program product, characterized in that The computer program product includes computer program code, which is stored in a computer-readable storage medium. A processor of a computer device reads the computer program code from the computer-readable storage medium, and the processor executes the computer program code, so that the computer device implements the operations performed in the medical term mapping method according to any one of claims 1 to 11.
Citation Information
Patent Citations
Medical word meaning identification method and device, computer equipment and storage medium
CN111353302A
Word weight determination method and device, server and computer readable storage medium
CN112507724A