Symptom identification methods, devices, electronic equipment and storage media

By training a symptom recognition model and utilizing the similarity intervals of corpus text, positive symptom text, and high-confidence negative symptom text, the problem of insufficient recognition accuracy caused by the colloquial nature of user input text was solved, achieving higher symptom recognition accuracy.

CN114676682BActive Publication Date: 2026-04-03TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-25
Publication Date
2026-04-03

AI Technical Summary

Technical Problem

In existing technologies, the colloquial text input by users increases the difficulty of symptom recognition, resulting in insufficient recognition accuracy.

Method used

By training a symptom recognition model, similarity intervals are divided using corpus text, positive symptom text, and negative symptom text, especially high-confidence negative symptom text, to determine the similarity between the corpus text and the preset symptom text. A second negative symptom text is added during the training process to enrich the sample diversity and improve the model's recognition accuracy.

Benefits of technology

This increased the training difficulty of the symptom recognition model, enabling it to more accurately distinguish between positive and negative symptom text and improve recognition accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114676682B_ABST
    Figure CN114676682B_ABST
Patent Text Reader

Abstract

This application discloses a symptom recognition method, apparatus, electronic device, and storage medium, belonging to the field of natural language processing technology. The method includes: training a symptom recognition model based on corpus text, positive symptom text, and a first negative symptom text, where the positive symptom text is the symptom text that matches the corpus text, and the first negative symptom text is the symptom text that does not match the corpus text; calling the symptom recognition model to determine the similarity between the corpus text and multiple preset symptom texts; determining the preset symptom text corresponding to the highest similarity among at least one similarity score belonging to a second interval as the second negative symptom text corresponding to the corpus text; and training the symptom recognition model based on the corpus text, positive symptom text, first negative symptom text, and second negative symptom text. This method enriches the sample diversity during training, increases the training difficulty of the symptom recognition model, and thus improves the recognition accuracy of the symptom recognition model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of natural language processing technology, and in particular to a symptom recognition method, apparatus, electronic device, and storage medium. Background Technology

[0002] Currently, online medical services are a common mode of healthcare delivery. In related technologies, users input text describing their symptoms, and the device uses a recognition model to determine matching symptom text. This symptom text is expressed in standard medical language, clearly describing the user's symptoms. However, the often colloquial nature of the user-input text increases the difficulty of recognition, making it crucial to improve accuracy. Summary of the Invention

[0003] This application provides a symptom recognition method, device, electronic device, and storage medium, which can improve the accuracy of symptom recognition. The technical solution is as follows:

[0004] On the one hand, a symptom identification method is provided, the method comprising:

[0005] A symptom recognition model is trained based on corpus text, positive symptom text, and first negative symptom text, wherein the positive symptom text is the symptom text that matches the corpus text, and the first negative symptom text is the symptom text that does not match the corpus text.

[0006] The symptom recognition model is invoked to determine the similarity between the corpus text and multiple preset symptom texts. The similarity interval corresponding to the symptom recognition model includes a first interval and a second interval, and the similarity of the first interval is greater than the similarity of the second interval.

[0007] The preset symptom text corresponding to the largest similarity among at least one similarity in the second interval is determined as the second negative symptom text corresponding to the corpus text;

[0008] The symptom recognition model is trained based on the corpus text, the positive symptom text, the first negative symptom text, and the second negative symptom text.

[0009] In one possible implementation, after training the symptom recognition model based on the corpus text, the positive symptom text, the first negative symptom text, and the second negative symptom text, the method further includes:

[0010] The symptom recognition model is invoked to determine the similarity between the corpus text and multiple preset symptom texts;

[0011] The preset symptom text corresponding to the largest similarity among at least one similarity in the second interval is determined as the second negative symptom text corresponding to the corpus text;

[0012] Based on the corpus text, the positive symptom text, the first negative symptom text, and the determined second negative symptom text, the symptom recognition model is trained until the number of training iterations of the symptom recognition model reaches the training iteration threshold.

[0013] On the other hand, a symptom identification method is provided, the method comprising:

[0014] The system displays an information input interface, which includes a symptom input area.

[0015] Obtain the input text, which is the text entered in the symptom input area;

[0016] The symptom recognition model is invoked to determine the similarity between the input text and multiple preset symptom texts;

[0017] Based on the determined multiple similarities, the target symptom text that matches the input text is determined;

[0018] The symptom recognition model is trained based on corpus text, positive symptom text, first negative symptom text, and second negative symptom text. The positive symptom text is the symptom text that matches the corpus text, and the first negative symptom text is the symptom text that does not match the corpus text. The similarity interval corresponding to the symptom recognition model includes a first interval and a second interval. The similarity of the first interval is greater than the similarity of the second interval. The second negative symptom text is the preset symptom text that corresponds to the largest similarity among at least one similarity in the second interval among the similarity between the corpus text determined by the symptom recognition model and the plurality of preset symptom texts.

[0019] In one possible implementation, the information input interface further includes a submit control, and after determining the target symptom text matching the input text based on multiple determined similarities, the method further includes:

[0020] In response to the triggering operation of the submission control, the input text and the target symptom text are combined to form the health information of the currently logged-in account;

[0021] Upload the health information to the server.

[0022] On the other hand, a symptom recognition device is provided, the device comprising:

[0023] The model training module is used to train a symptom recognition model based on corpus text, positive symptom text, and first negative symptom text, wherein the positive symptom text is the symptom text that matches the corpus text, and the first negative symptom text is the symptom text that does not match the corpus text.

[0024] The similarity determination module is used to call the symptom recognition model to determine the similarity between the corpus text and multiple preset symptom texts. The similarity interval corresponding to the symptom recognition model includes a first interval and a second interval, and the similarity of the first interval is greater than the similarity of the second interval.

[0025] The text determination module is used to determine the preset symptom text corresponding to the largest similarity among at least one similarity belonging to the second interval as the second negative symptom text corresponding to the corpus text;

[0026] The model training module is also used to train the symptom recognition model based on the corpus text, the positive symptom text, the first negative symptom text, and the second negative symptom text.

[0027] In one possible implementation, the module training module is used for:

[0028] The symptom recognition model is invoked to determine the similarity between the corpus text and the positive symptom text, the first negative symptom text, and the second negative symptom text, respectively.

[0029] The loss value is determined based on the determined similarity, and the symptom recognition model is trained based on the loss value.

[0030] In one possible implementation, the module training module is used for:

[0031] The symptom recognition model is invoked to extract features from the corpus text, the positive symptom text, the first negative symptom text, and the second negative symptom text, resulting in corpus text features, positive symptom text features, first negative symptom text features, and second negative symptom text features.

[0032] Determine the similarity between the text features of the corpus and the text features of the positive symptoms, the first negative symptoms, and the second negative symptoms, respectively.

[0033] In one possible implementation, the device further includes:

[0034] The text determination module is further configured to determine the verification corpus text, the verification symptom text, and the verification tag. The verification tag is a first verification tag or a second verification tag. The first verification tag indicates that the verification symptom text is a symptom text that matches the verification corpus text. The second verification tag indicates that the verification symptom text is a symptom text that does not match the verification corpus text. The first verification tag corresponds to the first interval, and the second verification tag corresponds to the second interval.

[0035] The similarity determination module is also used to call the symptom recognition model to determine the similarity between the verification corpus text and the verification symptom text;

[0036] An accuracy determination module is used to determine the accuracy of the symptom recognition model based on whether the similarity belongs to the interval corresponding to the verification label.

[0037] The module training module is used to determine the preset symptom text corresponding to the largest similarity among at least one similarity in the second interval as the second negative symptom text corresponding to the corpus text, provided that the accuracy is not less than a preset accuracy.

[0038] In one possible implementation, the accuracy determination module is further configured to adjust the first interval and the second interval when the accuracy is less than the preset accuracy, and determine the accuracy of the symptom recognition model based on whether the similarity belongs to the interval corresponding to the verification label, until the accuracy is not less than the preset accuracy.

[0039] In one possible implementation, the device further includes:

[0040] The text acquisition module is used to acquire multiple sets of corpus texts, each set of corpus texts including multiple corpus texts, and each set of corpus texts including the same number of corpus texts;

[0041] The text determination module is further configured to, for each of the corpus texts, determine the positive symptom texts corresponding to other corpus texts in the corpus text set besides the corpus text itself as the first negative symptom text corresponding to the corpus text.

[0042] In one possible implementation, the text determination module is further configured to, for each corpus text, determine the second negative symptom text corresponding to other corpus texts in the corpus text set besides the corpus text itself as the third negative symptom text corresponding to the corpus text.

[0043] The model training module is used to train the symptom recognition model based on the corpus text, the positive symptom text, the first negative symptom text, the second negative symptom text, and the third negative symptom text.

[0044] In one possible implementation, the model training module is used for:

[0045] The symptom recognition model is invoked to determine the similarity between the corpus text and the positive symptom text and the first negative symptom text;

[0046] The loss value is determined based on the determined similarity, and the symptom recognition model is trained based on the loss value.

[0047] In one possible implementation, the similarity determination module is used to call the symptom recognition model to determine the similarity between the corpus text and multiple preset symptom texts;

[0048] The text determination module is used to determine the preset symptom text corresponding to the largest similarity among at least one similarity belonging to the second interval as the second negative symptom text corresponding to the corpus text.

[0049] The model training module is further configured to train the symptom recognition model based on the corpus text, the positive symptom text, the first negative symptom text, and the determined second negative symptom text, until the number of training iterations of the symptom recognition model reaches a training iteration threshold.

[0050] On the other hand, a symptom recognition device is provided, the device comprising:

[0051] The interface display module is used to display the information input interface, which includes a symptom input area;

[0052] The text acquisition module is used to acquire input text, which is the text entered in the symptom input area;

[0053] The similarity determination module is used to call the symptom recognition model to determine the similarity between the input text and multiple preset symptom texts;

[0054] The text determination module is used to determine the target symptom text that matches the input text based on multiple determined similarities;

[0055] The symptom recognition model is trained based on corpus text, positive symptom text, first negative symptom text, and second negative symptom text. The positive symptom text is the symptom text that matches the corpus text, and the first negative symptom text is the symptom text that does not match the corpus text. The similarity interval corresponding to the symptom recognition model includes a first interval and a second interval. The similarity of the first interval is greater than the similarity of the second interval. The second negative symptom text is the preset symptom text that corresponds to the largest similarity among at least one similarity in the second interval among the similarity between the corpus text determined by the symptom recognition model and the plurality of preset symptom texts.

[0056] In one possible implementation, the text determination module is configured to:

[0057] Display preset symptom texts ranked by similarity to the target number;

[0058] The selected preset symptom text from the displayed preset symptom texts is determined as the target symptom text.

[0059] In one possible implementation, the information input interface further includes a submission control, and the device further includes:

[0060] The information upload module is used to respond to the trigger operation of the submission control, combine the input text and the target symptom text to form the health information of the currently logged-in account, and upload the health information to the server.

[0061] On the other hand, an electronic device is provided, comprising a processor and a memory, wherein the memory stores at least one computer program, which is loaded and executed by the processor to perform the operations performed by the symptom recognition method as described above.

[0062] On the other hand, a computer-readable storage medium is provided that stores at least one computer program, which is loaded and executed by a processor to perform the operations performed by the symptom recognition method as described above.

[0063] In another aspect, a computer program product is provided, comprising a computer program that, when executed by a processor, performs the operations performed by the symptom recognition method described above.

[0064] This application provides a symptom recognition scheme. First, a trained symptom recognition model is invoked to determine the similarity between the corpus text and multiple preset symptom texts. Since the similarity of the second interval is less than that of the first interval, the preset symptom text corresponding to at least one similarity in the second interval does not match the corpus text. By determining the preset symptom text corresponding to the largest similarity among at least one similarity interval as the second negative symptom text, this second negative symptom text is a negative symptom text that does not match the corpus text but is relatively similar. Thus, during training, the symptom recognition model can learn not only the relationship between the corpus text and positive symptom texts, and the relationship between the corpus text and the first negative symptom text, but also the relationship between the corpus text and the interfering second negative symptom texts. This training scheme greatly enriches the sample diversity during training, increases the training difficulty of the symptom recognition model, and thus improves the recognition accuracy of the symptom recognition model. Therefore, the accuracy of symptom recognition based on the trained symptom recognition model is high. Attached Figure Description

[0065] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0066] Figure 1 This is a schematic diagram of an implementation environment provided in an embodiment of this application;

[0067] Figure 2 This is a flowchart of a symptom recognition method provided in an embodiment of this application;

[0068] Figure 3 This is a flowchart of another symptom recognition method provided in the embodiments of this application;

[0069] Figure 4 This is a schematic diagram of a symptom recognition model provided in an embodiment of this application;

[0070] Figure 5 This is a schematic diagram of another symptom recognition model provided in an embodiment of this application;

[0071] Figure 6 This is a schematic diagram illustrating the training process of a symptom recognition model provided in an embodiment of this application;

[0072] Figure 7 This is a flowchart of another symptom recognition method provided in the embodiments of this application;

[0073] Figure 8This is a flowchart of yet another symptom recognition method provided in the embodiments of this application;

[0074] Figure 9 This is a schematic diagram of an information input interface provided in an embodiment of this application;

[0075] Figure 10 This is a schematic diagram of the structure of a symptom recognition device provided in an embodiment of this application;

[0076] Figure 11 This is a schematic diagram of another symptom recognition device provided in an embodiment of this application;

[0077] Figure 12 This is a schematic diagram of the structure of a terminal provided in an embodiment of this application;

[0078] Figure 13 This is a schematic diagram of the structure of a server provided in an embodiment of this application. Detailed Implementation

[0079] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the implementation methods of this application will be further described in detail below with reference to the accompanying drawings.

[0080] The terms “first,” “second,” “third,” etc., used in this application may be used to describe various concepts, but unless otherwise stated, these concepts are not limited by these terms. These terms are only used to distinguish one concept from another. For example, without departing from the scope of this application, a first similarity may be referred to as a second similarity, and similarly, a second similarity may be referred to as a first similarity.

[0081] As used in this application, the terms "at least one," "multiple," "each," and "any" have the following meanings: at least one includes one, two, or more; multiple includes two or more; each refers to each of the corresponding multiple; and any refers to any one of the multiple. For example, multiple texts include three texts, where each refers to each of the three texts, and any refers to any one of the three texts, which could be the first text, the second text, or the third text.

[0082] It should be noted that in the embodiments of this application, account data and text-related data are involved. When the above embodiments of this application are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of related data must comply with the relevant laws, regulations and standards of the relevant countries and regions.

[0083] Artificial intelligence (AI) is the theory, methods, technology, and application systems that use digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, 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 attempts to understand the essence of intelligence and produce a new kind of intelligent machine that can react in a way similar to human intelligence. AI studies the design principles and implementation methods of various intelligent machines, enabling them to possess the functions of perception, reasoning, and decision-making.

[0084] Artificial intelligence (AI) is a comprehensive discipline encompassing a wide range of fields, including both hardware and software technologies. Fundamental AI technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing, operating / interactive systems, and mechatronics. AI software technologies primarily include computer vision, speech processing, natural language processing, and machine learning / deep learning.

[0085] Machine learning (ML) is a multidisciplinary field involving probability theory, statistics, approximation theory, convex analysis, and algorithm complexity theory. It specifically studies how computers can simulate or implement human learning behavior to acquire new knowledge or skills and reorganize existing knowledge structures to continuously improve their performance. Machine learning is the core of artificial intelligence and the fundamental way to endow computers with intelligence; its applications span all areas of artificial intelligence. Machine learning and deep learning typically include techniques such as artificial neural networks, belief networks, reinforcement learning, transfer learning, inductive learning, and learn-by-doing.

[0086] Natural Language Processing (NLP) is an important field within computer science and artificial intelligence. It studies the theories and methods for enabling effective communication between humans and computers using natural language. NLP is a science that integrates linguistics, computer science, and mathematics. Therefore, research in this field involves natural language—the language people use in daily life—and thus it has a close relationship with linguistic research. NLP techniques typically include text processing, semantic understanding, machine translation, question answering, and knowledge graphs.

[0087] Contrastive learning is a method that utilizes existing data to construct additional positive or negative samples, and then enhances representation learning through extensive comparison. There are two implementation methods for contrastive learning: unsupervised and supervised. Unsupervised contrastive learning is used as a pre-training method; when the dataset lacks or has no positive samples, it constructs positive samples on existing data to train the model. Supervised contrastive learning is applied to labeled data (i.e., positive samples), using existing data to construct negative samples to train the model.

[0088] High-confidence negative samples (Hard Negatives): High-confidence negative samples are negative samples with a high probability of being positive samples. Natural language processing tasks require labeled data to significantly improve the model's capabilities. This labeled data includes positive and negative samples, or only positive samples, and randomly generated negative samples. When the model is trained to a certain stage, its learning ability will encounter a bottleneck. One factor affecting further model improvement is the quality of the negative samples. If the negative samples used are clearly distinguishable from the positive samples, the model training process will be relatively easy. However, in symptom recognition, the distinction between positive and negative samples is not very clear or even ambiguous. To address this situation, incorporating high-confidence negative samples during training has become an effective method.

[0089] Bi-encoder: A Siamese network based on BERT (Bidirectional Encoder Representation from Transformers, a pre-trained language representation model) or other transformer-based models. A Bi-encoder has two encoders, each corresponding to one of the two inputs. Each encoder outputs a feature vector representing the input. The final output of the Bi-encoder is a probability or continuous numerical value representing the relationship between the two inputs, such as similarity.

[0090] The solution provided in this application embodiment, based on artificial intelligence machine learning technology and natural language processing technology, can train a symptom recognition model, and use the trained symptom recognition model to recognize the input text and obtain the matching symptom text.

[0091] The symptom recognition method provided in this application embodiment is executed by a server. Figure 1 This is a schematic diagram of an implementation environment provided in an embodiment of this application. See also... Figure 1 The implementation environment includes terminal 101 and server 102. Terminal 101 and server 102 are connected via a wireless or wired network, which is not limited in this application.

[0092] Optionally, terminal 101 may be a smartphone, tablet, laptop, desktop computer, smart speaker, smartwatch, smart voice interaction device, smart home appliance, vehicle terminal, or aircraft, but is not limited to these. Optionally, a target application provided by server 102 is installed on terminal 101, enabling terminal 101 to perform functions such as data transmission, information interaction, or information display through the target application. Optionally, the target application may be a target application within the operating system of terminal 101, or a target application provided by a third party. For example, the target application may be a medical service application that provides medical services, allowing users to obtain medical services or provide medical services to other users.

[0093] Optionally, server 102 may be an independent physical server, a server cluster or distributed system consisting 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 communication, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms. This application does not limit the scope of the application.

[0094] In this embodiment, the target application of terminal 101 has an account logged in. Terminal 101 obtains text input by the user that describes the illness and sends the text to server 102. Server 102 receives the text, calls a symptom recognition model, determines the symptom text that matches the text, and sends the determined symptom text to terminal 101. Terminal 101 receives and displays the symptom text for the user to view. Optionally, terminal 101 can also combine the input text and the symptom text to form the health information of the currently logged-in account and upload the health information to server 102.

[0095] After introducing the implementation environment of the embodiments of this application, the application scenarios of the embodiments of this application will be described below in conjunction with the above implementation environment. It should be noted that in the following description, the terminal is the terminal 101 mentioned above, and the server is the server 102 mentioned above. The symptom recognition method provided by the embodiments of this application can be applied in symptom recognition scenarios.

[0096] For example, in pre-consultation scenarios, the purpose of pre-consultation is to collect relevant information about the patient's condition in advance to assist medical staff in analyzing the patient's condition and making risk assessments more effectively and accurately. The patient inputs information related to their condition in text form on the terminal, such as symptoms, duration, and severity. The terminal sends this information to the server, which performs symptom recognition, thereby collecting the patient's condition information. The purpose of symptom recognition is to identify standard symptom text from the patient's input. For example, if the patient inputs "stomach ache," the server, using the symptom recognition method provided in this application, identifies the standard symptom text as "abdominal pain."

[0097] It should be noted that the symptom recognition method provided in this application embodiment can also be applied to other symptom recognition scenarios, and this application embodiment does not limit it in this regard.

[0098] Optionally, the server trains a symptom recognition model using the symptom recognition model provided in this application embodiment, deploys the trained symptom recognition model on the server, and after the terminal obtains the text input by the user, the terminal uses the server to call the symptom recognition model to recognize the input text and obtain the symptom text that matches the text, thereby reducing the computational load on the terminal. Alternatively, the server deploys the trained symptom recognition model on the terminal, then the terminal directly calls the symptom recognition model to recognize the input text and obtain the symptom text that matches the text, without needing to interact with the server again.

[0099] Figure 2 This is a flowchart of a symptom recognition method provided in an embodiment of this application. The method is executed by a server, such as... Figure 2 As shown, the method includes:

[0100] 201. The server trains a symptom recognition model based on the corpus text, positive symptom text, and first negative symptom text. The positive symptom text is the symptom text that matches the corpus text, and the first negative symptom text is the symptom text that does not match the corpus text.

[0101] The corpus text consists of texts that describe symptoms. Symptom texts are expressed in standard medical language. Positive symptom texts are those that match the corpus text, meaning the positive symptom text can express the symptoms described in the corpus text using standard medical language. For example, if the corpus text is "stomach ache," the positive symptom text is "abdominal pain." First negative symptom texts are those that do not match the corpus text, meaning the symptoms described in the first negative symptom text using standard medical language do not match the symptoms described in the corpus text. For example, if the corpus text is "stomach ache," the first negative symptom text is "headache."

[0102] It should be noted that the corpus text is either text entered by the user during the historical symptom recognition process or randomly generated text; this application does not limit this.

[0103] 202. The server calls the symptom recognition model to determine the similarity between the corpus text and multiple preset symptom texts. The similarity interval corresponding to the symptom recognition model includes the first interval and the second interval. The similarity of the first interval is greater than that of the second interval.

[0104] The preset symptom texts are symptom texts that have been set on the server. The number of preset symptom texts can be set as needed, and this application does not limit this. For example, the number of preset symptom texts can be 100, 200, or 300.

[0105] In this embodiment of the application, the symptom recognition model is a model trained on corpus text. Therefore, the symptom recognition model has a certain accuracy and can be called to predict the corpus text, that is, to determine the similarity between the corpus text and each preset symptom text.

[0106] The greater the similarity between the corpus text and each preset symptom text, the more the corpus text matches the preset symptom text, and the more likely the preset symptom text is the positive symptom text corresponding to the corpus text; the smaller the similarity between the corpus text and each preset symptom text, the less the corpus text matches the preset symptom text, and the more likely the preset symptom text is the negative symptom text corresponding to the corpus text.

[0107] The first and second intervals are used to distinguish between positive and negative symptom texts. If the similarity between the corpus text and the preset symptom text falls within the first interval, it indicates that the preset symptom text is the positive symptom text corresponding to the corpus text. If the similarity between the corpus text and the preset symptom text falls within the second interval, it indicates that the preset symptom text is the negative symptom text corresponding to the corpus text.

[0108] Optionally, the similarity score can be any real number between 0 and 1. The server sets a similarity threshold, which is a critical value used to distinguish between positive and negative symptom text. This similarity threshold is any real number between 0 and 1, with a first interval including similarities greater than the threshold and a second interval including similarities less than the threshold. It should be noted that the similarity threshold can belong to either the first interval or the second interval; this embodiment does not limit this. For example, if the similarity threshold is 0.5, then the first interval is a similarity interval greater than 0.5, and the second interval is a similarity interval not greater than 0.5; or, the first interval is a similarity interval not less than 0.5, and the second interval is a similarity interval less than 0.5.

[0109] 203. The server determines the preset symptom text corresponding to the highest similarity among at least one similarity in the second interval as the second negative symptom text corresponding to the corpus text.

[0110] In this system, the preset symptom text corresponding to the similarity score in the first interval is the positive symptom text predicted by the symptom recognition model and corresponding to the corpus text. The preset symptom text corresponding to the similarity score in the second interval is the negative symptom text predicted by the symptom recognition model and corresponding to the corpus text. The preset symptom text corresponding to the highest similarity score among at least one similarity score in the second interval is the preset symptom text that is most similar to the corpus text among the negative symptom texts corresponding to the corpus text. In other words, this preset symptom text does not represent the condition described in the corpus text, but the symptoms represented by this preset symptom text are extremely close to or similar to the condition described in the corpus text.

[0111] For example, the corpus text is "intermittent pain in the right abdomen", and the corresponding symptom text is "abdominal pain". The preset symptom text corresponding to the highest similarity in at least one of the second intervals is "abdominal distension". It can be seen that the preset symptom text is very similar to the corresponding symptom text of the corpus text, but the symptom represented by the preset symptom text is not the disease described in the corpus text.

[0112] 204. The server trains a symptom recognition model based on corpus text, positive symptom text, first negative symptom text, and second negative symptom text.

[0113] The second negative symptom text is a negative symptom text that is extremely close to the corresponding positive symptom text in the corpus text, and can be regarded as a high-confidence negative sample. In the embodiments of this application, in step 201, the symptom recognition model can not only learn the relationship between the corpus text and the positive symptom text, but also learn the relationship between the corpus text and the first negative symptom text. However, when the positive symptom text and the first negative symptom text differ significantly, the training process of the symptom recognition model is prone to premature fitting, making it difficult for the symptom recognition model to distinguish whether the symptom text that is close to the positive symptom text is the real positive symptom text in the corpus text.

[0114] By incorporating the second negative symptom text into the training process of the symptom recognition model, the model can learn the relationship between the corpus text and the second negative symptom text. This introduces interference into the training of the symptom recognition model, increases the training difficulty, and enables the model to more accurately distinguish between positive and negative symptom text, thereby improving the accuracy and robustness of the symptom recognition model.

[0115] This application provides a symptom recognition scheme. First, a trained symptom recognition model is invoked to determine the similarity between the corpus text and multiple preset symptom texts. Since the similarity of the second interval is less than that of the first interval, the preset symptom text corresponding to at least one similarity in the second interval does not match the corpus text. By determining the preset symptom text corresponding to the largest similarity among at least one similarity interval as the second negative symptom text, this second negative symptom text is a negative symptom text that does not match the corpus text but is relatively similar. Thus, during training, the symptom recognition model can learn not only the relationship between the corpus text and positive symptom texts, and the relationship between the corpus text and the first negative symptom text, but also the relationship between the corpus text and the interfering second negative symptom texts. This training scheme greatly enriches the sample diversity during training, increases the training difficulty of the symptom recognition model, and thus improves the recognition accuracy of the symptom recognition model. Therefore, the accuracy of symptom recognition based on the trained symptom recognition model is high.

[0116] Figure 3 This is a flowchart of another symptom recognition method provided in an embodiment of this application. This method is executed by a server, such as... Figure 3 As shown, the method includes:

[0117] 301. The server trains a symptom recognition model based on the corpus text, positive symptom text, and first negative symptom text. The positive symptom text is the symptom text that matches the corpus text, and the first negative symptom text is the symptom text that does not match the corpus text.

[0118] The input data for the symptom recognition model consists of corpus text, positive symptom text, and first negative symptom text. The output data of the symptom recognition model consists of the similarity between the corpus text and the positive symptom text, and the similarity between the corpus text and the first negative symptom text.

[0119] In this embodiment of the application, before training the symptom recognition model based on the corpus text, positive symptom text, and first negative symptom text, the server obtains training samples for the symptom recognition model. Optionally, the method further includes the following steps 1-2:

[0120] 1. The server obtains multiple sets of corpus texts. Each set of corpus texts contains multiple corpus texts, and the number of corpus texts in each set of corpus texts is equal.

[0121] Optionally, the server acquires a certain amount of corpus text, which can be divided into multiple corpus text sets, and each corpus text set includes multiple corpus texts. The number of corpus texts included in each corpus text set can be set as needed, and this application does not limit this. For example, if the server acquires 100 corpus texts, and each corpus text set includes 4 corpus texts, then it is divided into 25 corpus text sets.

[0122] After step 1, the server determines the positive symptom text and the first negative symptom text corresponding to each corpus text, and then executes step 301 to train the symptom recognition model. Optionally, the positive symptom text is the symptom text obtained by manually annotating the corpus text. Optionally, the first negative symptom sample is either the symptom text obtained by manually annotating the corpus text or the symptom text randomly generated by the server; this application does not limit this. The randomly generated symptom text refers to the symptom text selected by the server from multiple preset symptom texts. Alternatively, the server may first execute step 2 to determine the second negative symptom text, and then execute step 301. This embodiment of the application illustrates the example of the server executing step 2 first and then step 301.

[0123] 2. For each corpus text, the server identifies the positive symptom texts corresponding to other corpus texts in the corpus text set (excluding the corpus text itself) as the first negative symptom text corresponding to the corpus text.

[0124] The number of positive symptom texts corresponding to the corpus text can be one or more. This application embodiment does not limit this. This application embodiment takes one positive symptom text as an example for illustration.

[0125] In this embodiment, the positive symptom text corresponding to the corpus text can be regarded as the positive sample of the symptom recognition model. Since two corpus texts in the same corpus text set are not the same, the positive symptom texts corresponding to the two corpus texts are also very likely to be different. Therefore, the positive symptom text corresponding to one of the two corpus texts is very likely to be mismatched with the other corpus text. By directly determining the positive symptom texts corresponding to other corpus texts in the same corpus text set, excluding the current corpus text, as the first negative symptom text corresponding to the current corpus text, the purpose of providing the first negative symptom text for the symptom recognition model can be achieved directly using the existing positive symptom texts without the need for manual annotation or random generation of the first negative symptom text corresponding to the corpus text. This reduces the workload and ensures the sample quality.

[0126] Optionally, step 301 can be implemented by: the server calling the symptom recognition model to determine the similarity between the corpus text and the positive symptom text and the first negative symptom text, respectively; determining the loss value of the symptom recognition model based on the determined similarity; and training the symptom recognition model based on the loss value. Optionally, the server adjusts the model parameters of the symptom recognition model based on the loss value to obtain the trained symptom recognition model.

[0127] Optionally, the server invokes the symptom recognition model to extract features from the corpus text, the positive symptom text, and the first negative symptom text, obtaining corpus text features, positive symptom text features, and first negative symptom text features; and determines the similarity between the corpus text features and the positive symptom text features and the first negative symptom text features, respectively.

[0128] The symptom recognition model includes two encoders, each encoding the data input to the first encoder to obtain corresponding features. One encoder encodes the input corpus text to obtain corpus text features, and the other encoder encodes the input symptom text to obtain symptom text features. For example, if the symptom text includes positive symptom text and first negative symptom text, then the symptom text features include positive symptom text features and first negative symptom text features. Optionally, features are represented in the form of embedding vectors, and the similarity between features can be the cosine similarity between two vectors. Optionally, the symptom recognition model is a BERT-based bi-encoder, or other models capable of encoding input data to obtain features.

[0129] In this embodiment, feature extraction is performed on the text input to the symptom recognition model. This removes information in the text that is not significant for symptom recognition, and obtains text features that can characterize the relevant information of the text. Thus, the similarity between the two texts is determined based on the text features corresponding to the two texts, and the determined similarity is more accurate.

[0130] For example, see Figure 4 The symptom recognition model includes encoder 1 and encoder 2. Encoder 1 encodes the input corpus text, and encoder 2 encodes the input symptom text. A corpus text set includes four corpus texts: text 1 "My skin is very itchy and I get a rash after being exposed to the sun," text 2 "Intermittent pain in the right abdomen," text 3 "A white layer appears in the corner of my eye," and text 4 "My toes hurt, and I have a wound that is slow to heal and is very painful." The positive symptom text corresponding to text 1 is "rash." The server identifies the positive symptom texts corresponding to text 2 ("abdominal pain"), text 3 ("eye discharge"), and text 4 ("foot pain") as the first negative symptom texts of text 1. Similarly, each corpus text in this corpus text set has a corresponding first negative symptom text.

[0131] For ease of explanation, the similarity between the corpus text and the positive symptom text is referred to as the first similarity, and the similarity between the corpus text and the first negative symptom text is referred to as the second similarity. The loss value is negatively correlated with the first similarity and positively correlated with the second similarity. The more similar the corpus text is to the positive symptom text, the higher the first similarity; the less similar it is to the first negative symptom text, the lower the second similarity, and the lower the loss value. Conversely, the less similar the corpus text is to the positive symptom text, the lower the first similarity; the more similar it is to the first negative symptom text, the higher the second similarity, and the higher the loss value.

[0132] In the first scenario, if the input to the symptom recognition model is a corpus text along with its corresponding positive symptom text and first negative symptom text, the server directly determines the loss value of the symptom recognition model based on the determined similarity. Optionally, the server determines the loss value using the following formula:

[0133]

[0134] Where h is the corpus text, h + Let τ be the positive symptom text corresponding to the corpus text, τ be the preset temperature parameter, sim(·) be the similarity function, and sim(h, h) be the similarity function. + ) for h and h + The similarity between the texts is given by: e, the natural constant and the base of the natural logarithm function; N, the number of texts corresponding to the first negative symptom in the corpus text; L, the loss value; log(·), the logarithmic function; and j, the index of the first negative symptom text, where j = 1, 2, 3, ..., N. For the j-th first negative symptom text corresponding to the corpus text, For h and The similarity between them.

[0135] In the second scenario, if the input to the symptom recognition model is a corpus of text, the server determines the similarity between each text and its corresponding positive symptom text and the first negative symptom text. Based on the determined similarity, the server determines the loss value of the symptom recognition model for each text. The server then sums and averages these loss values ​​to obtain the final loss value for the symptom recognition model. Optionally, the server determines the loss value for each text using the following formula:

[0136]

[0137] Where i is the index of the corpus text, i = 1, 2, 3, ..., N+1, N+1 is the number of corpus texts included in the corpus text set, and L iLet h be the loss value corresponding to the i-th text in the corpus, log(·) be the logarithmic function, and h be the loss value. i For the i-th text in the corpus, Let be the text representing the positive symptoms corresponding to the i-th corpus text, τ be a preset temperature parameter, and sim(·) be the similarity function. for h i and The similarity between them, e is the natural constant and the base of the natural logarithm function, j is the index of the other texts in the expected text set except for the i-th text, j = 1, 2, 3, ..., N, For the i-th corpus text, the j-th negative symptom text is... for h i and The similarity between them.

[0138] Optionally, the server trains the symptom recognition model for at least one iteration. The server sets the sample size used in one iteration, which is the number of texts in a corpus (batch size). When the batch size is greater than 1, the training process of the symptom recognition model is the same as when the batch size is 1. For example, if the number of texts in the corpus is 100 and the batch size is 4, then the training process of the symptom recognition model requires 100 / 4 = 25 iterations. In each iteration, the server obtains a corpus text set, trains the symptom recognition model, obtains the symptom recognition model with adjusted model parameters, then obtains the next corpus text set, trains the symptom recognition model with adjusted model parameters, until the symptom recognition model has undergone one iteration based on each corpus text set, that is, one epoch is completed. One epoch means that each corpus text set has been input into the symptom recognition model and has undergone one forward computation and backpropagation process. Optionally, the server trains the symptom recognition model for at least one epoch based on multiple corpus text sets to obtain a symptom recognition model with higher accuracy. Accordingly, after step 301, the server continues to execute steps 302-307 to further train the symptom recognition model, thereby improving the accuracy of the symptom recognition model.

[0139] This application embodiment uses the example of the server first performing step 301 to perform one epoch on the symptom recognition model, and then performing steps 302-306 to further train the symptom recognition model.

[0140] 302. The server calls the symptom recognition model to determine the similarity between the corpus text and multiple preset symptom texts. The similarity interval corresponding to the symptom recognition model includes a first interval and a second interval. The similarity of the first interval is greater than that of the second interval.

[0141] The symptom recognition model, trained in step 301, possesses a certain level of accuracy. This model can predict the similarity between the corpus text and the multiple preset symptom texts, thereby identifying the corresponding positive symptom text from among several preset symptom texts. Optionally, the method by which the symptom recognition model determines the similarity between the corpus text and the multiple preset symptom texts is similar to the method in step 301 for determining the similarity between the corpus text and the positive symptom text, and will not be elaborated further here.

[0142] In this embodiment, the similarity between the corpus text and multiple preset symptom texts is determined by calling a symptom recognition model. Then, based on the determined similarity, a second negative symptom text corresponding to the corpus text can be determined. Optionally, after calling the symptom recognition model to determine the similarity between the corpus text and multiple preset symptom texts, the server can also perform steps 303-305 to determine the second negative symptom text corresponding to the corpus text.

[0143] 303. The server determines the verification corpus text, verification symptom text, and verification label. The verification label is either a first verification label or a second verification label. The first verification label corresponds to the first interval, and the second verification label corresponds to the second interval.

[0144] In this model, the first verification label indicates that the verification symptom text matches the verification corpus text, and the second verification label indicates that the verification symptom text does not match the verification corpus text. The verification corpus text and the verification symptom text are verification samples for the symptom recognition model, used to verify the accuracy of the symptom recognition model. Optionally, the server determines a verification text pair, which includes a verification corpus text, a verification symptom text, and a verification label.

[0145] 304. The server calls the symptom recognition model to determine the similarity between the verification corpus text and the verification symptom text.

[0146] Optionally, the method by which the symptom recognition model determines the similarity between the verification corpus text and the verification symptom text is the same as the method by which the symptom recognition model determines the similarity between the corpus text and the positive symptom text in step 301, and will not be repeated here. Optionally, if there are multiple verification text pairs, the server determines the similarity between the verification corpus text and the verification symptom text in each verification text pair.

[0147] 305. The server determines the accuracy of the symptom recognition model based on whether the similarity falls within the interval corresponding to the verification label.

[0148] Specifically, when the verification label is the first verification label, if the similarity between the verification corpus text and the verification symptom text falls within the first interval, it indicates that the symptom recognition model identifies the verification symptom text as the positive symptom text corresponding to the verification corpus text, meaning the symptom recognition model's identification result is correct. If the similarity falls within the second interval, it indicates that the symptom recognition model identifies the verification symptom text as the negative symptom text corresponding to the verification corpus text, meaning the symptom recognition model's identification result is incorrect. Similarly, when the verification label is the second verification label, if the similarity between the verification corpus text and the verification symptom text falls within the first interval, it indicates that the symptom recognition model identifies the verification symptom text as the positive symptom text corresponding to the verification corpus text, meaning the symptom recognition model's identification result is incorrect. If the similarity falls within the second interval, it indicates that the symptom recognition model identifies the verification symptom text as the negative symptom text corresponding to the verification corpus text, meaning the symptom recognition model's identification result is correct.

[0149] In this embodiment of the application, by calling the symptom recognition model, the similarity between the verification corpus text and the verification symptom text is determined. The server can determine whether the symptom recognition model correctly identifies the verification symptom text as the positive symptom text corresponding to the verification corpus text based on the magnitude of the similarity.

[0150] Optionally, precision is the proportion of true positive samples among those identified as positive samples. For example, if the number of true positive samples in the input model is 100, and the number of samples identified as positive samples is 90, then the number of true positive samples is 81, and the precision is 81 / 90 = 0.9. Alternatively, precision is the proportion of correctly identified samples out of all samples. For example, if the number of samples is 100, and the number of correctly identified samples is 80, then the precision is 80 / 100 = 0.8. This application embodiment uses the proportion of true positive samples among those identified as positive samples as an example for illustration.

[0151] Optionally, the server determines the accuracy of the symptom recognition model by the ratio between the first quantity and the second quantity. The first quantity is the number of verification symptom texts corresponding to the first verification label among the verification symptom texts belonging to the first interval of similarity, i.e., the number of true positive samples. The second quantity is the number of verification symptom samples belonging to the first interval of similarity, i.e., the number of samples identified as positive samples.

[0152] 306. When the accuracy is not less than the preset accuracy, the server determines the preset symptom text corresponding to the highest similarity among at least one similarity in the second interval as the second negative symptom text corresponding to the corpus text.

[0153] The preset precision can be set as needed, and this application does not limit it. For example, the preset precision can be 0.8, 0.85, 0.875, or 0.9. When the precision is not less than the preset precision, the higher the precision, that is, the higher the precision of the similarity determined by the symptom recognition model, the more likely the preset symptom text corresponding to the largest similarity in at least one of the second intervals is a negative symptom text that is very close to the positive symptom text corresponding to the corpus text. In this case, the negative symptom text can be regarded as the second negative symptom text corresponding to the corpus text.

[0154] In this embodiment, the accuracy of the symptom recognition model is affected by the magnitude of a similarity threshold, which is used to divide a first interval and a second interval. Accordingly, if the accuracy is less than a preset accuracy, the first interval and the second interval are adjusted, and the accuracy of the symptom recognition model is determined based on whether the similarity belongs to the interval corresponding to the verification label, until the accuracy is not less than the preset accuracy.

[0155] Specifically, the first and second intervals are adjusted by changing the similarity threshold, and then the accuracy of the symptom recognition model is redefined. If a similarity threshold results in an accuracy greater than a preset accuracy, then the similarity threshold is considered appropriate, and dividing the first and second intervals using this similarity threshold is appropriate. Therefore, the accuracy determined by whether the similarity between the verification corpus text and the corresponding positive symptom text belongs to the first interval is accurate.

[0156] It should be noted that the number of second negative symptom texts corresponding to the determined corpus texts can be set as needed, and can be one or more. When there is only one second negative symptom text, the largest similarity score is selected from the similarity scores belonging to the second interval; when there are multiple second negative symptom texts, multiple largest similarity scores are selected from the similarity scores belonging to the second interval, provided that the number of similarity scores belonging to the second interval is not less than the required number of second negative symptom samples. For example, if the similarity scores belonging to the second interval include 0.79, 0.76, 0.65, and 0.54, then if the required number of second negative symptom texts is 1, the preset symptom text corresponding to 0.79 is determined as the second negative symptom text; if the required number of second negative symptom texts is 2, then the preset symptom texts corresponding to 0.79 and 0.76 are determined as the second negative symptom texts respectively.

[0157] For example, see Figure 5The symptom recognition model includes encoder 1 and encoder 2. Encoder 1 encodes the input text corpus, and encoder 2 encodes the input symptom text. The second negative symptom texts for text 1 are "herpes" and "pigmentation", the second negative symptom texts for text 2 are "bloating" and "diarrhea", the second negative symptom texts for text 3 are "decreased vision" and "blurred vision", and the second negative symptom texts for text 4 are "joint pain" and "lower limb pain".

[0158] In this embodiment, the symptom recognition model is validated by verifying the corpus text and the verification symptom text. The accuracy of the symptom recognition model is determined based on whether the similarity determined by the symptom recognition model belongs to the interval corresponding to the verification label. Since the accuracy is affected by the size of the first interval, the accuracy is re-determined by adjusting the first interval. Through the mutual influence between the similarity interval and the accuracy, a sufficiently accurate similarity interval is adjusted, namely the first interval and the second interval. In this way, the second negative symptom text determined based on the second interval is relatively accurate, thereby improving the accuracy of the second negative symptom text.

[0159] 307. The server trains a symptom recognition model based on corpus text, positive symptom text, first negative symptom text, and second negative symptom text.

[0160] After identifying the second negative symptom text, the server adds this text to the training process of the symptom recognition model. Optionally, the server trains the symptom recognition model based on the corpus text, the positive symptom text, the first negative symptom text, and the second negative symptom text by: the server calling the symptom recognition model to determine the similarity between the corpus text and the positive symptom text, the first negative symptom text, and the second negative symptom text, respectively; determining a loss value based on the determined similarity; and training the symptom recognition model based on the loss value.

[0161] In this embodiment of the application, by adding a second negative symptom text during the training process of the symptom recognition model, the symptom recognition model can also determine the similarity between the corpus text and the second negative symptom text. This allows the model to combine similarity from multiple perspectives to determine the loss value of the symptom recognition model, resulting in a more accurate loss value. Consequently, the symptom recognition model trained based on this loss value has higher accuracy.

[0162] Optionally, the server invokes the symptom recognition model to extract features from the corpus text, positive symptom text, first negative symptom text, and second negative symptom text, obtaining corpus text features, positive symptom text features, first negative symptom text features, and second negative symptom text features; and determines the similarity between the corpus text features and the positive symptom text features, first negative symptom text features, and second negative symptom text features, respectively.

[0163] In this embodiment, feature extraction is performed on the text input to the symptom recognition model. This removes information in the text that is not significant for symptom recognition, and obtains text features that can characterize the relevant information of the text. Thus, the similarity between the two texts is determined based on the text features corresponding to the two texts, and the determined similarity is more accurate.

[0164] Optionally, since the second negative symptom text corresponding to the corpus text has been determined, other corpus texts besides this corpus text can also use the second negative symptom text when training the symptom recognition model based on the corpus text set. Accordingly, after step 306, for each corpus text, the server determines the second negative symptom text corresponding to other corpus texts besides this corpus text as the third negative symptom text corresponding to this corpus text. Accordingly, step 307 is implemented by the server training the symptom recognition model based on the corpus text, the positive symptom text, the first negative symptom text, the second negative symptom text, and the third negative symptom text.

[0165] In this embodiment, the corpus text corresponds to three types of negative symptom texts: one is the positive symptom text of other corpus texts in the same corpus text set; another is the preset symptom text that meets the similarity condition with the corpus text; and the third is the second negative symptom text of other corpus texts in the same corpus text set. During the training process, the symptom recognition model can learn the relationship between the corpus text and each type of negative symptom text. By strengthening the comparative learning between the positive and negative symptom texts, the symptom recognition model trained is more accurate.

[0166] Optionally, the implementation of step 307 is the same as that of step 301, and will not be described again in this embodiment.

[0167] Optionally, after step 307, the server directly applies the symptom recognition model to subsequent symptom recognition processes. Alternatively, after step 307, the server redetermines the second negative symptom text, and then uses the determined second negative symptom text to further train the symptom recognition model, i.e., repeating steps 302-307 to improve the accuracy of the symptom recognition model. Accordingly, the method further includes: the server calling the symptom recognition model to determine the similarity between the corpus text and multiple preset symptom texts; determining the preset symptom text corresponding to the largest similarity among at least one similarity belonging to the second interval as the second negative symptom text corresponding to the corpus text; and training the symptom recognition model based on the corpus text, positive symptom text, first negative symptom text, and the determined second negative symptom text until the number of training iterations of the symptom recognition model reaches a training iteration threshold.

[0168] The training iteration threshold can be set as needed, and this embodiment does not limit it. For example, the training iteration threshold can be 8, 10, or 12. It should be noted that the preset accuracy of the symptom recognition model can be a fixed value or can be set according to the number of training iterations. This embodiment does not limit it; for example, the more training iterations, the higher the preset accuracy. Optionally, the training iterations refer to the number of epochs; one training iteration of the symptom recognition model is equivalent to one epoch.

[0169] In this embodiment, the accuracy of the symptom recognition model is likely to improve with each training iteration. By using the trained symptom recognition model, the second negative symptom text corresponding to the corpus text is re-determined. Then, the symptom recognition model is trained again using the re-determined second negative symptom text. In this way, the symptom recognition model can gradually improve its accuracy in the training process, and thus obtain a highly accurate symptom recognition model when the number of training iterations reaches a certain threshold.

[0170] In this embodiment, symptom recognition is a subtask within medical entity recognition and standardization tasks. The objects of symptom recognition primarily consist of medical texts, as well as medical-related literature such as academic papers. Most symptom recognition methods in related technologies are designed for professional medical texts similar to case studies. Pre-consultation, as a new medical field, utilizes artificial intelligence to assist medical staff in conducting consultations; therefore, the objects of symptom recognition in pre-consultation are mostly texts input by patients. Because patients lack relevant medical knowledge, the text they input is more colloquial, making it more challenging than professional medical texts.

[0171] Compared to the shortcomings of existing symptom recognition models, such as high processing time and insufficient accuracy, this application proposes a symptom recognition model trained using contrastive learning and high-confidence negative samples. By utilizing contrastive learning to increase the diversity of negative samples and by adding high-confidence negative samples to increase the difficulty of model learning, the recognition capability of the symptom recognition model can be improved.

[0172] While symptom recognition models trained based on contrastive learning already possess good recognition capabilities, they still lack accuracy in certain situations. For example, when the text "large gap between front teeth" is input into the symptom recognition model, it returns the symptom texts "missing teeth," "damaged teeth," and "malformed teeth," where "malformed teeth" is the correct symptom text. The model then prioritizes "missing teeth" and "damaged teeth" over "malformed teeth." This indicates that while the model can accurately identify the affected area and determine the corresponding symptom text, it doesn't prioritize the most accurate text, meaning the similarity determined by the model isn't very accurate. In another scenario, the model can accurately identify the symptom text but lacks accuracy in identifying the affected area; for example, it might confuse "foot pain" with "lower limb pain." Therefore, this application also introduces high-confidence negative samples.

[0173] For example, see Figure 6 To improve the model's recognition ability, this embodiment employs contrastive learning to train the symptom recognition model based on the corpus text. After training, the trained symptom recognition model selects pre-defined symptom texts from multiple pre-defined symptom texts that meet the similarity criteria with the corpus text; these are designated as second negative symptom texts and treated as high-confidence negative samples. These second negative symptom texts are then added to the training samples of the symptom recognition model, and contrastive learning is used again to further train the model, thereby improving its recognition ability. This enables the symptom recognition model to recognize the input text and obtain more accurate symptom texts.

[0174] In this embodiment, the training set of the symptom recognition model contains 30,000 entries, including 638 symptom texts. The test set contains 1,200 entries, including 298 symptom texts, of which 121 symptom texts are included in both the training and test sets. Considering that new symptom terms may emerge during the symptom recognition process, the training set does not completely include all symptom texts in the test set. 80% of the text in the training set is used as training samples for the symptom recognition model, and 20% is used as validation samples.

[0175] To verify the effectiveness of the symptom recognition model proposed in this application, this application compares the models in related technologies with the symptom recognition model provided in this application. The models in related technologies include the following: Bi-encoder (BERT-based recall model); Bi-encoder+Cross-encoder (BERT-based recall and ranking model); and Bi-encoder (contrastive learning), a recall model trained using contrastive learning. The symptom recognition model provided in this application is a Bi-encoder (contrastive learning + high-confidence negative samples), that is, a contrastive learning model incorporating high-confidence negative samples. The comparison results are shown in Table 1.

[0176] Table 1

[0177] Model Recall rate Average CPU time Bi-encoder 0.7142 29ms Bi-encoder+Cross-encoder 0.7833 431ms Bi-encoder (comparative learning) 0.7890 29ms Bi-encoder (contrastive learning + high-confidence negative samples) 0.8075 29ms

[0178] The experimental results show that Bi-encoder (contrastive learning) improves recall by 7 percentage points compared to Bi-encoder alone. Compared to the recall ranking model Bi-encoder+Cross-encoder, Bi-encoder (contrastive learning) improves recall by approximately 1 percentage point, while its average CPU time is 7% lower. Furthermore, Bi-encoder (contrastive learning + high-confidence negative samples) further enhances the symptom recognition model's ability by incorporating high-confidence negative samples, fully demonstrating the effectiveness of adding high-confidence negative samples to contrastive learning. Therefore, the symptom recognition model proposed in this application not only shows a significant performance improvement in efficiency compared to models in related technologies, but also improves accuracy.

[0179] This application provides a symptom recognition scheme. First, a trained symptom recognition model is invoked to determine the similarity between the corpus text and multiple preset symptom texts. Since the similarity of the second interval is less than that of the first interval, the preset symptom text corresponding to at least one similarity in the second interval does not match the corpus text. By determining the preset symptom text corresponding to the largest similarity among at least one similarity interval as the second negative symptom text, this second negative symptom text is a negative symptom text that does not match the corpus text but is relatively similar. Thus, during training, the symptom recognition model can learn not only the relationship between the corpus text and positive symptom texts, and the relationship between the corpus text and the first negative symptom text, but also the relationship between the corpus text and the interfering second negative symptom texts. This training scheme greatly enriches the sample diversity during training, increases the training difficulty of the symptom recognition model, and thus improves the recognition accuracy of the symptom recognition model. Therefore, the accuracy of symptom recognition based on the trained symptom recognition model is high.

[0180] In this embodiment, the positive symptom text corresponding to the corpus text can be regarded as the positive sample of the symptom recognition model. Since two corpus texts in the same corpus text set are not the same, the positive symptom texts corresponding to the two corpus texts are also very likely to be different. Therefore, the positive symptom text corresponding to one of the two corpus texts is very likely to be mismatched with the other corpus text. By directly determining the positive symptom texts corresponding to other corpus texts in the same corpus text set, excluding the current corpus text, as the first negative symptom text corresponding to the current corpus text, the purpose of providing the first negative symptom text for the symptom recognition model can be achieved directly using the existing positive symptom texts without the need for manual annotation or random generation of the first negative symptom text corresponding to the corpus text. This reduces the workload and ensures the sample quality.

[0181] In this embodiment, feature extraction is performed on the text input to the symptom recognition model. This removes information in the text that is not significant for symptom recognition, and obtains text features that can characterize the relevant information of the text. Thus, the similarity between the two texts is determined based on the text features corresponding to the two texts, and the determined similarity is more accurate.

[0182] In this embodiment, the symptom recognition model is validated by verifying the corpus text and the verification symptom text. The accuracy of the symptom recognition model is determined based on whether the similarity determined by the symptom recognition model belongs to the interval corresponding to the verification label. Since the accuracy is affected by the size of the first interval, the accuracy is re-determined by adjusting the first interval. Through the mutual influence between the similarity interval and the accuracy, a sufficiently accurate similarity interval is adjusted, namely the first interval and the second interval. In this way, the second negative symptom text determined based on the second interval is relatively accurate, thereby improving the accuracy of the second negative symptom text.

[0183] In this embodiment of the application, by adding a second negative symptom text during the training process of the symptom recognition model, the symptom recognition model can also determine the similarity between the corpus text and the second negative symptom text. This allows the model to combine similarity from multiple perspectives to determine the loss value of the symptom recognition model, resulting in a more accurate loss value. Consequently, the symptom recognition model trained based on this loss value has higher accuracy.

[0184] In this embodiment, feature extraction is performed on the text input to the symptom recognition model. This removes information in the text that is not significant for symptom recognition, and obtains text features that can characterize the relevant information of the text. Thus, the similarity between the two texts is determined based on the text features corresponding to the two texts, and the determined similarity is more accurate.

[0185] In this embodiment, the corpus text corresponds to three types of negative symptom texts: one is the positive symptom text of other corpus texts in the same corpus text set; another is the preset symptom text that meets the similarity condition with the corpus text; and the third is the second negative symptom text of other corpus texts in the same corpus text set. During the training process, the symptom recognition model can learn the relationship between the corpus text and each type of negative symptom text. By strengthening the comparative learning between the positive and negative symptom texts, the symptom recognition model trained is more accurate.

[0186] In this embodiment, the accuracy of the symptom recognition model is likely to improve with each training iteration. By using the trained symptom recognition model, the second negative symptom text corresponding to the corpus text is re-determined. Then, the symptom recognition model is trained again using the re-determined second negative symptom text. In this way, the symptom recognition model can gradually improve its accuracy in the training process, and thus obtain a highly accurate symptom recognition model when the number of training iterations reaches a certain threshold.

[0187] In this embodiment of the application, after the symptom recognition model is trained, the symptom recognition model can be called to perform symptom recognition. Figure 7This is a flowchart of another symptom recognition method provided in an embodiment of this application. This method is executed by a terminal, such as... Figure 7 As shown, the method includes:

[0188] 701. The terminal displays an information input interface, which includes a symptom input area.

[0189] 702. The terminal obtains the input text, which is the text entered in the symptom input area.

[0190] 703. The terminal calls the symptom recognition model to determine the similarity between the input text and multiple preset symptom texts.

[0191] 704. The terminal determines the target symptom text that matches the input text based on the determined multiple similarities.

[0192] The symptom recognition model is trained based on corpus text, positive symptom text, first negative symptom text, and second negative symptom text. Positive symptom text is the symptom text that matches the corpus text, and the first negative symptom text is the symptom text that does not match the corpus text. The similarity interval corresponding to the symptom recognition model includes a first interval and a second interval. The similarity of the first interval is greater than that of the second interval. The second negative symptom text is the preset symptom text that corresponds to the highest similarity among at least one similarity in the second interval among the corpus text determined by the symptom recognition model and multiple preset symptom texts.

[0193] In this embodiment, during the training process, the symptom recognition model learns by comparing positive and negative symptom texts corresponding to the corpus text. Furthermore, the negative symptom texts include not only ordinary first negative symptom texts but also second negative symptom texts with high similarity to the corpus texts, increasing the training difficulty of the symptom recognition model and thus improving its recognition accuracy. By displaying a symptom input area, users are provided with a way to input text describing their condition. By acquiring the input text and calling the trained symptom recognition model, a relatively accurate similarity can be determined, resulting in a high accuracy in identifying the target symptom text.

[0194] Figure 8 This is a flowchart of a symptom recognition method provided in an embodiment of this application. The method is executed by a terminal, such as... Figure 8 As shown, the method includes:

[0195] 801. The terminal displays an information input interface, which includes a symptom input area.

[0196] Optionally, when a user wants to access medical services through the terminal, or when information describing the user's condition needs to be collected, the terminal triggers the display of an information input interface. Optionally, the terminal displays a control for triggering medical service functions. When the user triggers the control, the terminal responds by displaying the information input interface. This information input interface includes a symptom input area. This symptom input area is used to input text that describes the symptoms. The user can input text in this symptom input area, and the terminal performs the operation in step 302.

[0197] Optionally, the terminal directly displays at least one symptom text in the information input interface, without displaying a symptom input area. Correspondingly, the information input interface also includes multiple symptom options, each corresponding to a symptom text. This allows the user to directly select the appropriate symptom option from the displayed options in the information input interface. When the user triggers a symptom option, the terminal responds by displaying that symptom option as selected, distinguishing it from other unselected symptom options.

[0198] Since the displayed symptom options may not include the symptom options the user wants, the terminal can also display a control in the information input interface to trigger the display of the symptom input area. When the user wants to input symptom text other than the symptom text corresponding to the displayed symptom options, the user can trigger the control, and the terminal will respond to the triggering of the control by displaying the symptom input area.

[0199] For example, see Figure 9 The information display interface 901 shown displays multiple symptom options: "fever," "vomiting," "abdominal pain," "lower abdominal pain," "abdominal distension," and "diarrhea." Additionally, it displays an "Other" control to trigger the display of the symptom input area. When the "Other" control is triggered, the information display interface 901 also displays a symptom input area 902, where the user can enter text, such as... Figure 9 As shown, the entered text is "Unformed stool, occasionally black stool".

[0200] 802. The terminal obtains the input text, which is the text entered in the symptom input area.

[0201] The terminal responds to text input in the symptom input area and retrieves the input text.

[0202] 803. The terminal calls the symptom recognition model to determine the similarity between the input text and multiple preset symptom texts.

[0203] Optionally, if the terminal is equipped with a symptom recognition model, the terminal directly calls this model, inputting the input text and multiple preset symptom texts into it. The symptom recognition model outputs the similarity between the input text and each preset symptom text. The symptom recognition model is the model trained in steps 301-306. Optionally, the method by which the symptom recognition model determines the similarity between the corpus text and the multiple preset symptom texts is similar to the method by which the symptom recognition model determines the similarity between the corpus text and the positive symptom text in step 301, and will not be repeated here.

[0204] 804. The terminal displays the preset symptom texts of the target quantity ranked first by similarity.

[0205] The target symptom text is the positive symptom text of the input text. The number of targets can be set as needed, and this embodiment does not limit this; for example, the number of targets can be 4, 5, or 6. After the terminal determines multiple similarities, it sorts the multiple similarities in descending order. The higher the similarity, the more likely the corresponding preset symptom text is to be the positive symptom text corresponding to the input text; the lower the similarity, the less likely the corresponding preset symptom text is to be the positive symptom text corresponding to the input text.

[0206] 805. The terminal will select the preset symptom text from the displayed preset symptom texts as the target symptom text.

[0207] The terminal displays a target number of preset symptom texts in the information input interface. Users can select the desired preset symptom texts from these texts, and the terminal then identifies the selected preset symptom texts as the target symptom texts.

[0208] In this embodiment of the application, by displaying the preset symptom texts that are most likely to correspond to the positive symptom texts of the input text, users can select the preset symptom texts that match their own condition. In this way, in addition to using the symptom recognition model to identify symptoms, the user's judgment is also taken into account, so the target symptom texts determined are more accurate.

[0209] Optionally, the server deploys a symptom recognition model, and the terminal uses the server to determine similarity. Accordingly, the terminal sends input text to the server, the server invokes the symptom recognition model to determine the similarity between the input text and multiple preset symptom texts, the server determines the top target number of preset symptom texts in terms of similarity ranking, and sends the top target number of preset symptom texts to the terminal. The terminal receives and displays the top target number of preset symptom texts. Optionally, the implementation method of the symptom recognition model determining the similarity between the corpus text and multiple preset symptom texts is the same as the implementation method of the symptom recognition model determining the similarity between the corpus text and the positive symptom text in step 301, and will not be repeated here.

[0210] Optionally, the terminal can also directly select the pre-defined symptom texts with the highest similarity ranking as the target symptom texts. This eliminates the need for user selection, saving time in providing medical services.

[0211] In this embodiment of the application, the information input interface also includes a submission control. After the user inputs information, the user can trigger the submission control. Correspondingly, after determining the target symptom text that matches the input text based on the determined multiple similarities, the terminal responds to the triggering operation of the submission control by combining the input text and the target symptom text to form the health information of the currently logged-in account; and uploads the health information to the server.

[0212] The health information describes the user's condition. The input text and target symptom text describe the user's symptom information, which can be considered the user's current disease information. Optionally, the health information also includes at least one of the following: account information corresponding to the currently logged-in account or past medical history. For example, account information may include gender, age, or other information. Accordingly, after the user triggers the display of the information input interface on the terminal, they fill in the aforementioned health information. Optionally, the terminal obtains the account information and past medical history filled in on the information input interface, and combines the account information, input text, target symptom text, and past medical history to form the health information of the currently logged-in account. Optionally, a submit control is set in the information input interface where the user fills in and submits information, allowing the user to sequentially enter the aforementioned information on the information input interface until the submit control is triggered.

[0213] For example, see continue. Figure 9 The information display interface 901 also shows a progress bar with four progress levels: "Basic Information," "Disease Information," "Past Medical History," and "Submit Information." "Basic Information" refers to entering the account information of the currently logged-in account; "Disease Information" refers to entering symptom information; "Past Medical History" refers to entering past medical history; and "Submit Information" triggers the submission of the entered information. The progress bar shows that "Basic Information" is complete, "Disease Information" is being entered, and "Past Medical History" and "Submit Information" are not yet complete.

[0214] Optionally, the server receives the health information and stores it, or the server can forward the health information to the terminal logged in by the account that provides medical services to the currently logged-in account. In this way, the terminal logged in by the account that provides medical services can receive and display the health information for the user operating the terminal to view, so that the user can provide medical services to the user corresponding to the account to which the health information belongs based on the health information.

[0215] In this embodiment, by uploading health information including input text and target symptom text to the server, the server can store the health information, thereby enabling the collection of health information. Alternatively, the server can forward the health information to the terminal of the user providing medical services, so that the user providing medical services can understand the condition of the user who needs medical services based on the health information, thereby improving the efficiency of providing medical services.

[0216] The symptom recognition model proposed in this application can recognize relatively colloquial text, making it easier for users to describe their current condition. This improves the hit rate of symptom recognition when providing medical services. Accurate symptom recognition ensures that further acquisition of other information from users can be targeted, greatly improving the efficiency of providing medical services and thus improving the utilization of medical resources.

[0217] In this embodiment, during the training process, the symptom recognition model learns by comparing positive and negative symptom texts corresponding to the corpus text. Furthermore, the negative symptom texts include not only ordinary first negative symptom texts but also second negative symptom texts with high similarity to the corpus texts, increasing the training difficulty of the symptom recognition model and thus improving its recognition accuracy. By displaying a symptom input area, users are provided with a way to input text describing their condition. By acquiring the input text and calling the trained symptom recognition model, a relatively accurate similarity can be determined, resulting in a high accuracy in identifying the target symptom text.

[0218] In this embodiment of the application, by displaying the preset symptom texts that are most likely to correspond to the positive symptom texts of the input text, users can select the preset symptom texts that match their own condition. In this way, in addition to using the symptom recognition model to identify symptoms, the user's judgment is also taken into account, so the target symptom texts determined are more accurate.

[0219] In this embodiment, by uploading health information including input text and target symptom text to the server, the server can store the health information, thereby enabling the collection of health information. Alternatively, the server can forward the health information to the terminal of the user providing medical services, so that the user providing medical services can understand the condition of the user who needs medical services based on the health information, thereby improving the efficiency of providing medical services.

[0220] Figure 10 This is a schematic diagram of the structure of a symptom recognition device provided in an embodiment of this application, as shown below. Figure 10 As shown, the device includes:

[0221] The model training module 1001 is used to train a symptom recognition model based on corpus text, positive symptom text, and first negative symptom text. Positive symptom text is the symptom text that matches the corpus text, and the first negative symptom text is the symptom text that does not match the corpus text.

[0222] The similarity determination module 1002 is used to call the symptom recognition model to determine the similarity between the corpus text and multiple preset symptom texts. The similarity interval corresponding to the symptom recognition model includes a first interval and a second interval, and the similarity of the first interval is greater than the similarity of the second interval.

[0223] The text determination module 1003 is used to determine the preset symptom text corresponding to the largest similarity among at least one similarity in the second interval as the second negative symptom text corresponding to the corpus text.

[0224] The model training module 1001 is also used to train a symptom recognition model based on corpus text, positive symptom text, first negative symptom text, and second negative symptom text.

[0225] In one possible implementation, module training module 1001 is used for:

[0226] The symptom recognition model is invoked to determine the similarity between the corpus text and the positive symptom text, the first negative symptom text, and the second negative symptom text, respectively.

[0227] The loss value is determined based on the established similarity, and the symptom recognition model is trained based on the loss value.

[0228] In one possible implementation, module training module 1001 is used for:

[0229] The symptom recognition model is invoked to extract features from the corpus text, positive symptom text, first negative symptom text, and second negative symptom text, resulting in corpus text features, positive symptom text features, first negative symptom text features, and second negative symptom text features.

[0230] Determine the similarity between the text features of the corpus and the text features of the positive symptoms, the first negative symptoms, and the second negative symptoms.

[0231] In one possible implementation, the device further includes:

[0232] The text determination module 1003 is also used to determine the verification corpus text, the verification symptom text, and the verification label. The verification label is either a first verification label or a second verification label. The first verification label indicates that the verification symptom text is a symptom text that matches the verification corpus text, and the second verification label indicates that the verification symptom text is a symptom text that does not match the verification corpus text. The first verification label corresponds to the first interval, and the second verification label corresponds to the second interval.

[0233] The similarity determination module 1002 is also used to call the symptom recognition model to determine the similarity between the verification corpus text and the verification symptom text;

[0234] The accuracy determination module is used to determine the accuracy of the symptom recognition model based on whether the similarity falls within the interval corresponding to the verification label.

[0235] The module training module 1001 is used to determine the preset symptom text corresponding to the largest similarity among at least one similarity in the second interval as the second negative symptom text corresponding to the corpus text, provided that the accuracy is not less than the preset accuracy.

[0236] In one possible implementation, the accuracy determination module is further used to adjust the first interval and the second interval when the accuracy is less than the preset accuracy, and to determine the accuracy of the symptom recognition model based on whether the similarity belongs to the interval corresponding to the verification label, until the accuracy is not less than the preset accuracy.

[0237] In one possible implementation, the device further includes:

[0238] The text acquisition module is used to acquire multiple corpus text sets, each corpus text set includes multiple corpus texts, and each corpus text set includes an equal number of corpus texts;

[0239] The text determination module 1003 is also used to determine, for each corpus text, the positive symptom text corresponding to other corpus texts in the corpus text set besides the corpus text itself as the first negative symptom text corresponding to the corpus text.

[0240] In one possible implementation, the text determination module 1003 is further configured to, for each corpus text, determine the second negative symptom text corresponding to other corpus texts in the corpus text set besides the corpus text as the third negative symptom text corresponding to the corpus text.

[0241] The model training module 1001 is used to train a symptom recognition model based on corpus text, positive symptom text, first negative symptom text, second negative symptom text, and third negative symptom text.

[0242] In one possible implementation, the model training module 1001 is used for:

[0243] The symptom recognition model is invoked to determine the similarity between the corpus text and the positive symptom text and the first negative symptom text;

[0244] The loss value is determined based on the established similarity, and the symptom recognition model is trained based on the loss value.

[0245] In one possible implementation, the similarity determination module 1002 is used to call the symptom recognition model to determine the similarity between the corpus text and multiple preset symptom texts;

[0246] The text determination module 1003 is used to determine the preset symptom text corresponding to the largest similarity among at least one similarity in the second interval as the second negative symptom text corresponding to the corpus text.

[0247] The model training module 1001 is also used to train the symptom recognition model based on the corpus text, positive symptom text, first negative symptom text and determined second negative symptom text, until the number of training times of the symptom recognition model reaches the training number threshold.

[0248] Figure 11 This is a schematic diagram of another symptom recognition device provided in an embodiment of this application, as shown below. Figure 11 As shown, the device includes:

[0249] The interface display module 1101 is used to display the information input interface, which includes a symptom input area.

[0250] The text acquisition module 1102 is used to acquire input text, which is the text entered in the symptom input area;

[0251] The similarity determination module 1103 is used to call the symptom recognition model to determine the similarity between the input text and multiple preset symptom texts;

[0252] The text determination module 1104 is used to determine the target symptom text that matches the input text based on the determined multiple similarities;

[0253] The symptom recognition model is trained based on corpus text, positive symptom text, first negative symptom text, and second negative symptom text. Positive symptom text is the symptom text that matches the corpus text, and the first negative symptom text is the symptom text that does not match the corpus text. The similarity interval corresponding to the symptom recognition model includes a first interval and a second interval. The similarity of the first interval is greater than that of the second interval. The second negative symptom text is the preset symptom text that corresponds to the highest similarity among at least one similarity in the second interval among the corpus text determined by the symptom recognition model and multiple preset symptom texts.

[0254] In one possible implementation, the text determination module 1104 is used for:

[0255] Display preset symptom texts ranked by similarity to the target number;

[0256] The selected preset symptom text from the displayed preset symptom texts will be designated as the target symptom text.

[0257] In one possible implementation, the information input interface further includes a submission control, and the device further includes:

[0258] The information upload module is used to respond to the trigger operation of the submit control, combine the input text and the target symptom text to form the health information of the currently logged-in account, and upload the health information to the server.

[0259] It should be noted that the symptom recognition device provided in the above embodiments is only an example of the division of the above functional modules. In practical applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the electronic device can be divided into different functional modules to complete all or part of the functions described above. In addition, the symptom recognition device and the symptom recognition method embodiments provided in the above embodiments belong to the same concept, and the specific implementation process can be found in the method embodiments, which will not be repeated here.

[0260] This application also provides an electronic device, which includes a processor and a memory. The memory stores at least one computer program, which is loaded and executed by the processor to perform the operations performed in the symptom recognition method of the above embodiments.

[0261] Optionally, the electronic device is provided as a terminal. Figure 12 A schematic diagram of the structure of a terminal 1200 provided in an embodiment of this application is shown.

[0262] Terminal 1200 includes a processor 1201 and a memory 1202.

[0263] Processor 1201 may include one or more processing cores, such as a quad-core processor or an octa-core processor. Processor 1201 may be implemented using at least one hardware form selected from DSP (Digital Signal Processing), FPGA (Field Programmable Gate Array), and PLA (Programmable Logic Array). Processor 1201 may also include a main processor and a coprocessor. The main processor, also known as a CPU (Central Processing Unit), is used to process data in the wake-up state; the coprocessor is a low-power processor used to process data in the standby state. Optionally, processor 1201 may integrate a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the screen. In some embodiments, processor 1201 may also include an AI (Artificial Intelligence) processor, which is used to handle computational operations related to machine learning.

[0264] The memory 1202 may include one or more computer-readable storage media, which may be non-transitory. The memory 1202 may also include high-speed random access memory and non-volatile memory, such as one or more disk storage devices or flash memory devices. Optionally, the non-transitory computer-readable storage media in the memory 1202 may be used to store at least one computer program, which is used by the processor 1201 to implement the symptom recognition method provided in the method embodiments of this application.

[0265] Optionally, the terminal 1200 may further include: a peripheral device interface 1203 and at least one peripheral device. The processor 1201, memory 1202, and peripheral device interface 1203 can be connected via a bus or signal lines. Each peripheral device can be connected to the peripheral device interface 1203 via a bus, signal lines, or a circuit board. Optionally, the peripheral device includes at least one of: a radio frequency circuit 1204, a display screen 1205, and a power supply 1206.

[0266] Peripheral device interface 1203 can be used to connect at least one I / O (Input / Output) related peripheral device to processor 1201 and memory 1202. Optionally, processor 1201, memory 1202 and peripheral device interface 1203 are integrated on the same chip or circuit board; in some other embodiments, any one or two of processor 1201, memory 1202 and peripheral device interface 1203 can be implemented on separate chips or circuit boards, which is not limited in this embodiment.

[0267] The radio frequency (RF) circuit 1204 is used to receive and transmit RF (Radio Frequency) signals, also known as electromagnetic signals. The RF circuit 1204 communicates with communication networks and other communication devices via electromagnetic signals. The RF circuit 1204 converts electrical signals into electromagnetic signals for transmission, or converts received electromagnetic signals back into electrical signals. Optionally, the RF circuit 1204 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, etc. The RF circuit 1204 can communicate with other devices through at least one wireless communication protocol. This wireless communication protocol includes, but is not limited to: metropolitan area networks (MANs), various generations of mobile communication networks (2G, 3G, 4G, and 5G), wireless local area networks (WLANs), and / or WiFi (Wireless Fidelity) networks. Optionally, the RF circuit 1204 may also include circuitry related to NFC (Near Field Communication), which is not limited in this application.

[0268] Display screen 1205 is used to display a UI (User Interface). This UI may include graphics, text, icons, videos, and any combination thereof. When display screen 1205 is a touch display screen, it also has the ability to collect touch signals on or above its surface. These touch signals can be input as control signals to processor 1201 for processing. In this case, display screen 1205 can also be used to provide virtual buttons and / or a virtual keyboard, also known as soft buttons and / or a soft keyboard. Optionally, there may be one display screen 1205, located on the front panel of terminal 1200; alternatively, there may be at least two display screens, respectively located on different surfaces of terminal 1200 or in a folded design; alternatively, display screen 1205 may be a flexible display screen, located on a curved or folded surface of terminal 1200. Furthermore, display screen 1205 may even be configured as a non-rectangular, irregular shape, i.e., a non-rectangular screen. The display screen 1205 can be made of materials such as LCD (Liquid Crystal Display) and OLED (Organic Light-Emitting Diode).

[0269] Power supply 1206 is used to power the various components in terminal 1200. Power supply 1206 can be AC ​​power, DC power, a disposable battery, or a rechargeable battery. When power supply 1206 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.

[0270] Those skilled in the art will understand that Figure 12 The structure shown does not constitute a limitation on terminal 1200 and may include more or fewer components than shown, or combine certain components, or use different component arrangements.

[0271] Optionally, the electronic device can also be provided as a server. Figure 13 This is a schematic diagram of a server structure provided in an embodiment of this application. The server 1300 can vary significantly due to different configurations or performance. It may include one or more Central Processing Units (CPUs) 1301 and one or more memories 1302. The memories 1302 store at least one computer program, which is loaded and executed by the processor 1301 to implement the methods provided in the above-described method embodiments. Of course, the server may also have wired or wireless network interfaces, a keyboard, and input / output interfaces for input and output. The server may also include other components for implementing device functions, which will not be elaborated upon here.

[0272] This application also 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 by the symptom recognition method of the above embodiments.

[0273] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the operations performed by the symptom recognition method as described above.

[0274] Optionally, the computer program involved in the embodiments of this application may be deployed on an electronic device for execution, or executed on multiple electronic devices located in one location, or executed on multiple electronic devices distributed in multiple locations and interconnected through a communication network. Multiple electronic devices distributed in multiple locations and interconnected through a communication network may form a blockchain system.

[0275] Those skilled in the art will understand that all or part of the steps of the above embodiments can be implemented by hardware or by a program instructing related hardware. The program can be stored in a computer-readable storage medium, such as a read-only memory, a disk, or an optical disk.

[0276] The above description is only an optional embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present application should be included within the protection scope of the present application.

Claims

1. A symptom identification method, characterized in that, The method includes: A symptom recognition model is trained based on corpus text, positive symptom text, and first negative symptom text, wherein the positive symptom text is the symptom text that matches the corpus text, and the first negative symptom text is the symptom text that does not match the corpus text. The symptom recognition model is invoked to determine the similarity between the corpus text and multiple preset symptom texts. The similarity interval corresponding to the symptom recognition model includes a first interval and a second interval. The similarity of the first interval is greater than that of the second interval. The first interval and the second interval are used to divide positive symptom texts and negative symptom texts. The preset symptom texts whose similarity with the corpus text belongs to the first interval are classified as positive symptom texts corresponding to the corpus text, and the preset symptom texts whose similarity with the corpus text belongs to the second interval are classified as negative symptom texts corresponding to the corpus text. The preset symptom text corresponding to the largest similarity among at least one similarity in the second interval is determined as the second negative symptom text corresponding to the corpus text, and the second negative symptom text is different from the first negative symptom text; The symptom recognition model is trained based on the corpus text, the positive symptom text, the first negative symptom text, and the second negative symptom text. Before training the symptom recognition model based on the corpus text, positive symptom text, and first negative symptom text, the method further includes: Obtain multiple sets of corpus texts, each set of corpus texts including multiple corpus texts, and each set of corpus texts including the same number of corpus texts; For each of the corpus texts, the positive symptom texts corresponding to other corpus texts in the corpus text set besides the corpus text itself are determined as the first negative symptom texts corresponding to the corpus text.

2. The method according to claim 1, characterized in that, The step of training the symptom recognition model based on the corpus text, the positive symptom text, the first negative symptom text, and the second negative symptom text includes: The symptom recognition model is invoked to determine the similarity between the corpus text and the positive symptom text, the first negative symptom text, and the second negative symptom text, respectively. The loss value is determined based on the determined similarity, and the symptom recognition model is trained based on the loss value.

3. The method according to claim 2, characterized in that, The step of calling the symptom recognition model to determine the similarity between the corpus text and the positive symptom text, the first negative symptom text, and the second negative symptom text includes: The symptom recognition model is invoked to extract features from the corpus text, the positive symptom text, the first negative symptom text, and the second negative symptom text, resulting in corpus text features, positive symptom text features, first negative symptom text features, and second negative symptom text features. Determine the similarity between the text features of the corpus and the text features of the positive symptoms, the first negative symptoms, and the second negative symptoms, respectively.

4. The method according to claim 1, characterized in that, After calling the symptom recognition model to determine the similarity between the corpus text and multiple preset symptom texts, the method further includes: The verification corpus text, verification symptom text, and verification tag are determined. The verification tag is a first verification tag or a second verification tag. The first verification tag indicates that the verification symptom text is a symptom text that matches the verification corpus text. The second verification tag indicates that the verification symptom text is a symptom text that does not match the verification corpus text. The first verification tag corresponds to the first interval, and the second verification tag corresponds to the second interval. The symptom recognition model is invoked to determine the similarity between the verification corpus text and the verification symptom text; The accuracy of the symptom recognition model is determined based on whether the similarity falls within the range corresponding to the verification label. The step of determining the preset symptom text corresponding to the highest similarity among at least one similarity score belonging to the second interval as the second negative symptom text corresponding to the corpus text includes: If the accuracy is not less than the preset accuracy, the preset symptom text corresponding to the largest similarity among at least one similarity belonging to the second interval is determined as the second negative symptom text corresponding to the corpus text.

5. The method according to claim 4, characterized in that, The method further includes: If the accuracy is less than the preset accuracy, the first interval and the second interval are adjusted, and the accuracy of the symptom recognition model is determined based on whether the similarity belongs to the interval corresponding to the verification label, until the accuracy is not less than the preset accuracy.

6. The method according to claim 1, characterized in that, After determining the preset symptom text corresponding to the largest similarity among at least one similarity score belonging to the second interval as the second negative symptom text corresponding to the corpus text, the method further includes: For each of the corpus texts, the second negative symptom texts corresponding to other corpus texts in the corpus text set besides the corpus text itself are determined as the third negative symptom texts corresponding to the corpus text. The step of training the symptom recognition model based on the corpus text, the positive symptom text, the first negative symptom text, and the second negative symptom text includes: The symptom recognition model is trained based on the corpus text, the positive symptom text, the first negative symptom text, the second negative symptom text, and the third negative symptom text.

7. The method according to any one of claims 1-6, characterized in that, The training of the symptom recognition model based on corpus text, positive symptom text, and first negative symptom text includes: The symptom recognition model is invoked to determine the similarity between the corpus text and the positive symptom text and the first negative symptom text; The loss value is determined based on the determined similarity, and the symptom recognition model is trained based on the loss value.

8. The method according to any one of claims 1-6, characterized in that, After training the symptom recognition model based on the corpus text, the positive symptom text, the first negative symptom text, and the second negative symptom text, the method further includes: The symptom recognition model is invoked to determine the similarity between the corpus text and multiple preset symptom texts; The preset symptom text corresponding to the largest similarity among at least one similarity in the second interval is redefined as the second negative symptom text corresponding to the corpus text; Based on the corpus text, the positive symptom text, the first negative symptom text, and the redefined second negative symptom text, the symptom recognition model is trained until the number of training iterations of the symptom recognition model reaches a training iteration threshold.

9. A symptom identification method, characterized in that, The method includes: The system displays an information input interface, which includes a symptom input area. Obtain the input text, which is the text entered in the symptom input area; The symptom recognition model is invoked to determine the similarity between the input text and multiple preset symptom texts; Based on the determined multiple similarities, the target symptom text that matches the input text is determined; The symptom recognition model is trained based on corpus text, positive symptom text, first negative symptom text, and second negative symptom text. The positive symptom text is the symptom text that matches the corpus text, and the first negative symptom text is the symptom text that does not match the corpus text. The similarity interval corresponding to the symptom recognition model includes a first interval and a second interval. The similarity of the first interval is greater than the similarity of the second interval. The second negative symptom text is the preset symptom text that corresponds to the largest similarity among at least one similarity in the second interval among the similarity between the corpus text determined by the symptom recognition model and the multiple preset symptom texts. The second negative symptom text is different from the first negative symptom text. The first interval and the second interval are used to divide positive symptom texts and negative symptom texts. The preset symptom texts whose similarity with the corpus texts belongs to the first interval are classified as positive symptom texts corresponding to the corpus texts, and the preset symptom texts whose similarity with the corpus texts belongs to the second interval are classified as negative symptom texts corresponding to the corpus texts. The process of determining the first negative symptom text includes: acquiring multiple sets of corpus texts, each set of corpus texts including multiple corpus texts, and each set of corpus texts including an equal number of corpus texts; for each corpus text, determining the positive symptom texts corresponding to other corpus texts in the corpus text set besides the corpus text itself as the first negative symptom text corresponding to the corpus text.

10. The method according to claim 9, characterized in that, The step of determining the target symptom text that matches the input text based on the determined multiple similarities includes: Display preset symptom texts ranked by similarity to the target number; The selected preset symptom text from the displayed preset symptom texts is determined as the target symptom text.

11. The method according to claim 9, characterized in that, The information input interface also includes a submit control. After determining the target symptom text matching the input text based on multiple determined similarities, the method further includes: In response to the triggering operation of the submission control, the input text and the target symptom text are combined to form the health information of the currently logged-in account; Upload the health information to the server.

12. A symptom recognition device, characterized in that, The device includes: The model training module is used to train a symptom recognition model based on corpus text, positive symptom text, and first negative symptom text, wherein the positive symptom text is the symptom text that matches the corpus text, and the first negative symptom text is the symptom text that does not match the corpus text. The similarity determination module is used to call the symptom recognition model to determine the similarity between the corpus text and multiple preset symptom texts. The similarity interval corresponding to the symptom recognition model includes a first interval and a second interval. The similarity of the first interval is greater than that of the second interval. The first interval and the second interval are used to divide positive symptom texts and negative symptom texts. The preset symptom texts whose similarity with the corpus text belongs to the first interval are classified as positive symptom texts corresponding to the corpus text, and the preset symptom texts whose similarity with the corpus text belongs to the second interval are classified as negative symptom texts corresponding to the corpus text. The text determination module is used to determine the preset symptom text corresponding to the largest similarity among at least one similarity in the second interval as the second negative symptom text corresponding to the corpus text, wherein the second negative symptom text is different from the first negative symptom text; The model training module is also used to train the symptom recognition model based on the corpus text, the positive symptom text, the first negative symptom text, and the second negative symptom text; The device further includes: The text acquisition module is used to acquire multiple sets of corpus texts, each set of corpus texts including multiple corpus texts, and each set of corpus texts including the same number of corpus texts; The text determination module is further configured to, for each of the corpus texts, determine the positive symptom texts corresponding to other corpus texts in the corpus text set besides the corpus text itself as the first negative symptom text corresponding to the corpus text.

13. The apparatus according to claim 12, characterized in that, The model training module is used for: The symptom recognition model is invoked to determine the similarity between the corpus text and the positive symptom text, the first negative symptom text, and the second negative symptom text, respectively. The loss value is determined based on the determined similarity, and the symptom recognition model is trained based on the loss value.

14. The apparatus according to claim 13, characterized in that, The model training module is used for: The symptom recognition model is invoked to extract features from the corpus text, the positive symptom text, the first negative symptom text, and the second negative symptom text, resulting in corpus text features, positive symptom text features, first negative symptom text features, and second negative symptom text features. Determine the similarity between the text features of the corpus and the text features of the positive symptoms, the first negative symptoms, and the second negative symptoms, respectively.

15. The apparatus according to claim 12, characterized in that, The device further includes: The text determination module is further configured to determine the verification corpus text, the verification symptom text, and the verification tag. The verification tag is a first verification tag or a second verification tag. The first verification tag indicates that the verification symptom text is a symptom text that matches the verification corpus text. The second verification tag indicates that the verification symptom text is a symptom text that does not match the verification corpus text. The first verification tag corresponds to the first interval, and the second verification tag corresponds to the second interval. The similarity determination module is also used to call the symptom recognition model to determine the similarity between the verification corpus text and the verification symptom text; An accuracy determination module is used to determine the accuracy of the symptom recognition model based on whether the similarity belongs to the interval corresponding to the verification label. The model training module is used to determine the preset symptom text corresponding to the largest similarity among at least one similarity in the second interval as the second negative symptom text corresponding to the corpus text, provided that the accuracy is not less than a preset accuracy.

16. The apparatus according to claim 15, characterized in that, The accuracy determination module is further configured to adjust the first interval and the second interval when the accuracy is less than the preset accuracy, and determine the accuracy of the symptom recognition model based on whether the similarity belongs to the interval corresponding to the verification label, until the accuracy is not less than the preset accuracy.

17. The apparatus according to claim 12, characterized in that, The text determination module is further configured to, for each of the corpus texts, determine the second negative symptom text corresponding to other corpus texts in the corpus text set besides the corpus text itself as the third negative symptom text corresponding to the corpus text; The model training module is used to train the symptom recognition model based on the corpus text, the positive symptom text, the first negative symptom text, the second negative symptom text, and the third negative symptom text.

18. The apparatus according to any one of claims 12-17, characterized in that, The model training module is used for: The symptom recognition model is invoked to determine the similarity between the corpus text and the positive symptom text and the first negative symptom text; The loss value is determined based on the determined similarity, and the symptom recognition model is trained based on the loss value.

19. The apparatus according to any one of claims 12-17, characterized in that, The similarity determination module is used to call the symptom recognition model to determine the similarity between the corpus text and multiple preset symptom texts; The text determination module is used to re-determine the preset symptom text corresponding to the largest similarity among at least one similarity belonging to the second interval as the second negative symptom text corresponding to the corpus text; The model training module is further configured to train the symptom recognition model based on the corpus text, the positive symptom text, the first negative symptom text, and the redefined second negative symptom text, until the training times of the symptom recognition model reach a training time threshold.

20. A symptom recognition device, characterized in that, The device includes: The interface display module is used to display the information input interface, which includes a symptom input area; The text acquisition module is used to acquire input text, which is the text entered in the symptom input area; The similarity determination module is used to call the symptom recognition model to determine the similarity between the input text and multiple preset symptom texts; The text determination module is used to determine the target symptom text that matches the input text based on multiple determined similarities; The symptom recognition model is trained based on corpus text, positive symptom text, first negative symptom text, and second negative symptom text. The positive symptom text is the symptom text that matches the corpus text, and the first negative symptom text is the symptom text that does not match the corpus text. The similarity interval corresponding to the symptom recognition model includes a first interval and a second interval. The similarity of the first interval is greater than the similarity of the second interval. The second negative symptom text is the preset symptom text that corresponds to the largest similarity among at least one similarity in the second interval among the similarity between the corpus text determined by the symptom recognition model and the multiple preset symptom texts. The second negative symptom text is different from the first negative symptom text. The first interval and the second interval are used to divide positive symptom texts and negative symptom texts. The preset symptom texts whose similarity with the corpus texts belongs to the first interval are classified as positive symptom texts corresponding to the corpus texts, and the preset symptom texts whose similarity with the corpus texts belongs to the second interval are classified as negative symptom texts corresponding to the corpus texts. The process of determining the first negative symptom text includes: acquiring multiple sets of corpus texts, each set of corpus texts including multiple corpus texts, and each set of corpus texts including an equal number of corpus texts; for each corpus text, determining the positive symptom texts corresponding to other corpus texts in the corpus text set besides the corpus text itself as the first negative symptom text corresponding to the corpus text.

21. The apparatus according to claim 20, characterized in that, The text determination module is used for: Display preset symptom texts ranked by similarity to the target number; The selected preset symptom text from the displayed preset symptom texts is determined as the target symptom text.

22. The apparatus according to claim 20, characterized in that, The information input interface also includes a submit control, and the device further includes: The information upload module is used to respond to the trigger operation of the submission control, combine the input text and the target symptom text to form the health information of the currently logged-in account, and upload the health information to the server.

23. An electronic device, characterized in that, The electronic device includes a processor and a memory, the memory storing at least one computer program, which is loaded and executed by the processor to implement the symptom recognition method as claimed in 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, which is loaded and executed by a processor to implement the symptom recognition method as described in any one of claims 1 to 11.

25. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the symptom recognition method as described in any one of claims 1 to 11.

Citation Information

Patent Citations

  • Data recommendation method and device based on medical field, server and storage medium

    CN111949890A

  • Disease entity matching method and device based on voice semantics and computer equipment

    CN112199954A