Method and device for determining syndromes, electronic equipment and nonvolatile storage medium
Through word vector and feature vector processing, combined with traditional Chinese medicine diagnostic knowledge, the problem of inaccurate syndrome recommendation results in the traditional Chinese medicine syndrome recommendation system is solved, and fast, efficient and accurate syndrome recommendation is achieved, providing more accurate traditional Chinese medicine Diagnosis and treatment reference.
Patent Information
- Application Number
- CN202411224213.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-03
- Publication Date
- 2024-12-17
AI Technical Summary
The existing Chinese medicine syndrome recommendation system is based on the symptoms related to the symptoms of Chinese medicine diagnosis, combined with the patient's main complaint and the four diagnosis information, and has the problem of inaccurate recommendation results, which has failed to effectively solve the most likely syndrome of patients' current symptoms under the knowledge of Chinese medicine diagnosis. the accuracy of the time.
By obtaining the patient's main symptoms and secondary symptoms data, using word vector similarity and feature vector processing, combining traditional Chinese medicine diagnostic knowledge, the target syndrome is determined from the database, and a pre-trained language model is used to calculate the symptom similarity and weight to conduct the evidence. Wait for recommendations to ensure the accuracy of recommendation results.
It achieves rapid, efficient and accurate recommendation of syndromes, solves the problem of inaccurate recommendation results of syndromes under traditional Chinese medicine diagnostic knowledge, and provides a more accurate reference for traditional Chinese medicine diagnosis and treatment.
Smart Images

Figure CN119153071A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of intelligent medicine, and more specifically, to a syndrome determination method, device, electronic device and non-volatile storage medium. Background Art
[0002] The core of TCM theory is syndrome differentiation and treatment, which includes two processes: syndrome differentiation and treatment. Syndrome differentiation and treatment is the basic principle of TCM to understand and treat diseases, and is a special research method of TCM on diseases. Among them, syndrome differentiation is to use the patient's symptoms and signs information collected by observation, auscultation, questioning and palpation to distinguish the patient's cause of disease, pathological location and nature of pathogenic factors, and finally judge it as a syndrome of a certain nature; treatment is to determine the treatment plan based on the results of syndrome differentiation. The core of TCM diagnosis and treatment is syndrome differentiation and treatment, and the core of syndrome differentiation and treatment is the judgment of the patient's syndrome type, which depends on detailed patient self-report and four diagnostic information, as well as the doctor's rich theoretical knowledge and clinical experience. At present, most of the TCM syndrome recommendation systems are based on the knowledge of "syndrome" and "related symptoms" of TCM diagnosis, combined with the patient's main complaint and current symptoms, to match a syndrome with the largest number of syndrome-related symptoms matching the patient's current symptoms as the patient's most likely syndrome output, so there is a problem of inaccurate recommendation results.
[0003] To address the above-mentioned problems, no effective solution has been proposed yet. Summary of the invention
[0004] The embodiments of the present application provide a syndrome determination method, device, electronic device and non-volatile storage medium to at least solve the technical problem in the related art of recommending the most likely syndrome for a patient based on the patient's current symptoms based on the knowledge of traditional Chinese medicine diagnosis, resulting in inaccurate recommendation results.
[0005] According to one aspect of an embodiment of the present application, a method for determining a syndrome is provided, comprising: obtaining patient data matching a patient, wherein the patient data includes the patient's primary symptoms and the patient's secondary symptoms; when the patient's primary symptoms are the same as a reference primary symptom of a reference syndrome stored in a database, using a first method to determine a target syndrome corresponding to the patient data from the database, wherein the first method only processes the patient's secondary symptoms in the patient data and the reference secondary symptoms of the reference syndrome; when the patient's primary symptoms are different from the reference primary symptoms, using a second method to determine the target syndrome corresponding to the patient data from the database, wherein the second method processes all symptoms in the patient data and the reference syndrome.
[0006] In some embodiments of the present application, after obtaining patient data matching the patient, the method also includes: determining first symptom data in the patient data that belongs to a non-standard symptom description, wherein the first symptom data is data of any non-standard symptom description in the patient data; determining a first word vector corresponding to the first symptom data, and determining a standard word vector corresponding to each standard TCM symptom data; determining a first symptom data similarity set corresponding to the first symptom data based on the first word vector and the standard word vector corresponding to each standard TCM symptom data; and determining the target TCM symptom data with the highest similarity in the first symptom data similarity set as the standardized symptom data corresponding to the first symptom data.
[0007] In some embodiments of the present application, a first method is used to determine a target syndrome corresponding to patient data from a database, including: determining a first eigenvector corresponding to a secondary symptom of the patient, and determining a second eigenvector corresponding to a reference secondary symptom of each reference syndrome; determining a first similarity set consisting of a first similarity between the patient data and each reference syndrome based on the first eigenvector and the second eigenvector; determining a first recommended score set consisting of a first recommended score corresponding to each reference syndrome based on the first similarity in the first similarity set; after sorting the first recommended score set from high to low, determining the syndrome corresponding to the first preset number of first recommended scores as the target syndrome.
[0008] In some embodiments of the present application, determining the first feature vector corresponding to the patient's secondary symptoms includes: when the number of the patient's secondary symptoms is 0, the first feature vector is the average value of the word vectors of the reference secondary symptoms in the reference syndrome; when the number of the patient's secondary symptoms is greater than or equal to 1, the first feature vector is determined by the word vectors of the patient's secondary symptoms and the weighted average value of the patient's secondary symptoms in all syndromes in the database.
[0009] In some embodiments of the present application, the weight of each syndrome in the database is determined in the following manner: determining the first number of occurrences of the first secondary symptom in the first syndrome, and determining the total number of secondary symptoms contained in the first syndrome, wherein the first syndrome is any syndrome stored in the database, and the first secondary symptom is any secondary symptom in the first syndrome; determining the first word frequency corresponding to the first secondary symptom based on the first number and the total number of secondary symptoms; determining the total number of syndromes in the database, and obtaining the number of syndromes in the database that contain the first secondary symptom; determining the first reverse file frequency corresponding to the first secondary symptom based on the total number of syndromes and the number of syndromes; determining the first weight corresponding to the first secondary symptom based on the first word frequency and the first reverse file frequency.
[0010] In some embodiments of the present application, determining the second feature vector corresponding to the reference secondary symptom of each reference syndrome includes: determining the second word vector corresponding to each reference secondary symptom, and determining the second weight of each reference secondary symptom in the first syndrome, wherein the number of reference secondary symptoms is greater than or equal to 1; determining the second feature vector based on the second word vector and the second weight.
[0011] In some embodiments of the present application, determining a first recommended score set consisting of a first recommended score corresponding to each reference syndrome includes: determining a first ratio of the number of secondary symptoms of the patient to the number of reference secondary symptoms of the reference syndrome; respectively determining a third weight, a fourth weight, and a fifth weight corresponding to the first identifier, the first similarity, and the first ratio of each reference syndrome, wherein the first identifier is used to indicate whether the main symptom of the patient is the same as the reference main symptom of the reference syndrome stored in a database; determining a first recommended score for each reference syndrome based on the first identifier, the first similarity, the first ratio, the third weight, the fourth weight, and the fifth weight of each reference syndrome; and determining a first recommended score set based on the first recommended score of each reference syndrome.
[0012] In some embodiments of the present application, a second method is used to determine a target syndrome corresponding to patient data from a database, including: determining a third eigenvector corresponding to the patient data, and determining a fourth eigenvector corresponding to each reference syndrome, wherein the third eigenvector is a eigenvector corresponding to the patient's main symptoms and the patient's secondary symptoms, and the fourth eigenvector is a eigenvector corresponding to the reference main symptoms and the reference secondary symptoms of the reference syndrome; based on the third eigenvector and the fourth eigenvector, determining a second similarity set consisting of a second similarity between the patient data and each reference syndrome; based on the second similarity in the second similarity set, determining a second recommended score set consisting of a second recommended score corresponding to each reference syndrome; after sorting the second recommended score set from high to low, determining the syndrome corresponding to the first preset number of second recommended scores as the target syndrome.
[0013] In some embodiments of the present application, determining the third eigenvector corresponding to the patient data includes: when the number of the patient's secondary symptoms is 0, determining the third word vector corresponding to the patient's main symptoms, and determining the average value of the word vectors of the reference secondary symptoms in the reference syndrome; obtaining the third eigenvector based on the third word vector and the average value of the word vector of the reference secondary symptom; when the number of the patient's secondary symptoms is greater than or equal to 1, determining the word vector corresponding to the patient's secondary symptoms and the weighted average value of all syndromes of the patient's secondary symptoms in the database; determining the third eigenvector based on the third word vector, the word vector corresponding to the patient's secondary symptoms, and the weighted average value of all syndromes in the database.
[0014] In some embodiments of the present application, determining the fourth eigenvector corresponding to each reference syndrome includes: determining the fourth word vector corresponding to the reference major symptom of each reference syndrome, the second word vector corresponding to each reference minor symptom of each reference syndrome, and the second weight of each reference minor symptom in the first syndrome, wherein the number of reference minor symptoms is greater than or equal to 1, and the first syndrome is any syndrome stored in the database; determining the fourth eigenvector based on the fourth word vector, the second word vector and the second weight.
[0015] In some embodiments of the present application, the method also includes: obtaining target medical case data to be confirmed and real medical case data stored in a database, wherein the real medical case data includes the first main symptom and the first secondary symptom of the first syndrome, the syndrome diagnosis result of the first syndrome and the treatment method of the first syndrome, and the first syndrome is any syndrome stored in the database; determining the similarity between the target main symptom and the first main symptom in the target medical case data to obtain a first result; determining the similarity between the target secondary symptom and the first secondary symptom in the target medical case data to obtain a second result; and determining the recommended medical case data that is most similar to the target medical case data from the real medical case data based on the first result and the second result.
[0016] According to another aspect of an embodiment of the present application, a syndrome determination device is also provided, including: an acquisition module, used to acquire patient data matching the patient, wherein the patient data includes the patient's main symptoms and the patient's secondary symptoms; a first determination module, used to determine the target syndrome corresponding to the patient data from the database using a first method when the patient's main symptoms are the same as the reference main symptoms of the reference syndrome stored in the database, wherein the first method only processes the patient's secondary symptoms in the patient data and the reference secondary symptoms of the reference syndrome; a second determination module, used to determine the target syndrome corresponding to the patient data from the database using a second method when the patient's main symptoms are different from the reference main symptoms, wherein the second method processes all symptoms in the patient data and the reference syndrome.
[0017] According to another aspect of an embodiment of the present application, a non-volatile storage medium is provided, in which a program is stored, wherein when the program is running, the device where the non-volatile storage medium is located is controlled to execute the above-mentioned method for determining the symptom.
[0018] According to another aspect of an embodiment of the present application, there is also provided an electronic device, including: a memory and a processor, the processor being configured to run a program stored in the memory, wherein the above-mentioned syndrome determination method is executed when the program is run.
[0019] According to another aspect of the embodiment of the present application, a computer program product is also provided, including computer instructions, which implement the above-mentioned syndrome determination method when executed by a processor.
[0020] In an embodiment of the present application, patient data matching the patient is obtained, wherein the patient data includes the patient's main symptoms and the patient's secondary symptoms; when the patient's main symptoms are the same as the reference main symptoms of the reference syndrome stored in the database, a first method is used to determine the target syndrome corresponding to the patient data from the database, wherein the first method only processes the patient's secondary symptoms in the patient data and the reference secondary symptoms of the reference syndrome; when the patient's main symptoms are different from the reference main symptoms, a second method is used to determine the target syndrome corresponding to the patient data from the database, wherein the second method processes all symptoms in the patient data and the reference syndrome, by obtaining the main symptoms and secondary symptoms input by the patient. The main symptoms input by the patient are compared with the reference main symptoms of the reference syndromes stored in the database. When the main symptoms input by the patient are the same as the reference main symptoms of the reference syndromes stored in the database, only the secondary symptoms of the patient data and the reference secondary symptoms of the reference syndromes are processed. When the main symptoms input by the patient are different from the reference main symptoms of the reference syndromes stored in the database, all symptoms (including main symptoms and secondary symptoms) in the patient data and the reference syndromes are processed, thereby achieving the purpose of quickly, efficiently and accurately recommending syndromes, and further solving the technical problem of inaccurate recommendation results when the most likely syndrome of the patient is recommended based on the patient's current symptoms in related technologies based on the knowledge of Chinese medicine diagnosis. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0022] Figure 1 It is a hardware structure block diagram of a computer terminal for implementing a syndrome determination method provided in an embodiment of the present application;
[0023] Figure 2 is a flow chart of a method for determining a syndrome according to an embodiment of the present application;
[0024] Figure 3 It is a structural diagram of a pre-trained language model of a syndrome determination method according to an embodiment of the present application;
[0025] Figure 4 is a structural diagram of a Transformer encoder according to an embodiment of the present application;
[0026] Figure 5 It is a structural schematic diagram of a syndrome determination device according to an embodiment of the present application. DETAILED DESCRIPTION
[0027] In order to enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of this application.
[0028] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0029] Most of the TCM syndrome recommendation systems in the related art are based on the syndrome-related symptoms of TCM diagnosis, combined with the patient's main complaint and current symptoms, and input a syndrome with the largest number of related symptoms matching the patient's current symptoms; or through summarizing and studying the medical records of famous old TCM doctors, according to the patient's current symptoms and four diagnostic information, directly output the most likely syndrome of the current patient. Therefore, there is a problem of inaccurate recommendation results. In order to solve this problem, the relevant solution is provided in the embodiments of this application, which is described in detail below.
[0030] According to an embodiment of the present application, a method embodiment of a method for determining syndrome is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0031] The method embodiments provided in the embodiments of the present application can be executed in a mobile terminal, a computer terminal or a similar computing device. Figure 1 FIG. 1 shows a hardware structure block diagram of a computer terminal for implementing a syndrome determination method. Figure 1As shown, the computer terminal 10 may include one or more (102a, 102b, ..., 102n are used to illustrate) processors 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA), a memory 104 for storing data, and a transmission module 106 for communication functions. In addition, it may also include: a display, an input / output interface (I / O interface), a universal serial bus (USB) port (which may be included as one of the ports of the BUS bus), a network interface, a power supply and / or a camera. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the above electronic device. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations shown.
[0032] It should be noted that the one or more processors 102 and / or other data processing circuits described above may generally be referred to herein as "data processing circuits". The data processing circuits may be embodied in whole or in part as software, hardware, firmware, or any other combination thereof. In addition, the data processing circuit may be a single independent processing module, or may be incorporated in whole or in part into any of the other components in the computer terminal 10 (or mobile device). As described in the embodiments of the present application, the data processing circuit acts as a processor control (e.g., selection of a variable resistor terminal path connected to an interface).
[0033] The memory 104 can be used to store software programs and modules of application software, such as program instructions / data storage devices corresponding to the method for determining syndrome in the embodiment of the present application. The processor 102 executes various functional applications and data processing by running the software programs and modules stored in the memory 104, that is, the method for determining syndrome described above is realized. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the computer terminal 10 via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0034] The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the computer terminal 10. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0035] The display may be, for example, a touch screen liquid crystal display (LCD) that enables a user to interact with a user interface of the computer terminal 10 (or mobile device).
[0036] Under the above operating environment, the present application embodiment provides a method for determining syndrome, the flow chart is as follows: Figure 2 As shown, the method comprises the following steps:
[0037] Step S202, obtaining patient data matching the patient, wherein the patient data includes the patient's primary symptoms and the patient's secondary symptoms.
[0038] In the technical solution provided in step S202, after obtaining the patient data matching the patient, it is also necessary to standardize the non-standard symptoms in the patient data to obtain standardized symptoms. There are many ways to standardize the non-standard symptoms in the patient data. For example, the non-standard symptoms in the patient data can be standardized in the following ways: determine the first symptom data in the patient data that belongs to the non-standard symptom description, wherein the first symptom data is the data of any non-standard symptom description in the patient data; determine the first word vector corresponding to the first symptom data, and determine the standard word vector corresponding to each standard TCM symptom term; determine the first symptom data similarity set corresponding to the first symptom data based on the first word vector and the standard word vector corresponding to each standard TCM symptom data; determine the target TCM symptom data with the highest similarity in the first symptom data similarity set as the standardized symptom data corresponding to the first symptom data.
[0039] The following is a specific example: the patient describes his / her own information, symptoms, medical history, etc. in detail, and the doctor summarizes and performs the four traditional Chinese medicine examinations and then combines them into the patient's symptom input system. The patient's symptoms can be input by direct click input, custom input, paragraph recognition input, etc. For direct click input, the operator directly clicks to select the existing symptoms and obtains the standardized symptoms. For custom input, the operator can enter a custom word as the symptom name, which may be different from the standard TCM terminology, recorded as For paragraph recognition input, the operator can enter a text paragraph of all the symptoms of the patient, separated by delimiters (commas, semicolons, spaces, etc.), recorded as
[0040] No treatment required; Search the standard terminology database to see if there are similar standard term expressions. If there are, replace them; if not, keep the original words; After the delimiter is used to split multiple custom symptom inputs, The same processing, that is, standardizing the non-standard symptoms (i.e., the first symptom data mentioned above) input by the patient and converting them into standard TCM symptom terms (i.e., the standardized symptom data corresponding to the first symptom data mentioned above), solves the problem of not allowing patients to input non-standard symptoms.
[0041] The data stored in the standard terminology database can be determined in the following ways: Data collection, such as the need to collect TCM diagnostic data, TCM standard terminology data, etc., among which: TCM diagnostic data, data that comes from authoritative TCM diagnostic guidelines or the experience of famous experts, and is consistent with TCM theory, including multiple syndromes and related symptoms that each syndrome may manifest (symptoms include the patient's four diagnostic information). In the process of TCM syndrome differentiation, it is a common method to find the syndrome with the closest symptom manifestation based on the TCM diagnostic guideline data according to the symptoms manifested by the patient. This data will serve as the TCM theoretical support for syndrome recommendation.
[0042] TCM standard terminology data mainly includes standardized expressions and synonym libraries of commonly used terms such as TCM symptoms, syndromes, diseases, treatment methods, and prescriptions. It is used to standardize the terms in various collected data to unify data from different sources or in different formats.
[0043] Specifically, first obtain the patient's symptom list as follows:
[0044]
[0045] Among them, ω p , Input symptoms for the patient (i.e. the first symptom data mentioned above), ω p and They represent the patient's main symptoms and k secondary symptoms respectively, and input is the patient's input symptom set.
[0046] The above main symptoms need to be specified by the operator, and there is only one, and there can be multiple secondary symptoms or they can be empty. It should be noted that these symptoms can be standard symptom names or custom symptom names entered by the operator.
[0047] For the above patient symptom list, it is necessary to calculate the word vector f(ω) corresponding to the non-standard symptom (i.e. the above first symptom data) input by each patient in the patient data, calculate the word vector f(w) (i.e. the above standard word vector) of each standard TCM symptom w, and determine the cosine similarity between the non-standard symptom (i.e. the above first symptom data) input by the patient and any standard TCM symptom:
[0048]
[0049] Among them, cos(f(ω),f(w)) is the similarity between the first word vector and the standard word vector, f(w) is the above standard word vector, and f(ω) is the above first word vector. By calculating the similarity between the first word vector and the standard word vector corresponding to each standard TCM symptom data, the first symptom data similarity set corresponding to the first symptom data can be obtained.
[0050] The standard term with the highest cosine similarity replaces the original input symptom, that is, the target TCM symptom data with the highest similarity in the first symptom data similarity set is determined as the standardized symptom data corresponding to the first symptom data:
[0051]
[0052] Among them, w p , For standardized input symptoms (including standard major symptoms and standard minor symptoms), Input is the standardized symptom data obtained after standardizing the input symptoms.
[0053] Step S204: when the main symptoms of the patient are the same as the reference main symptoms of the reference syndrome stored in the database, a target syndrome corresponding to the patient data is determined from the database using the first method.
[0054] In the technical solution provided in step S204, the first method only processes the patient's secondary symptoms in the patient data and the reference secondary symptoms in the reference syndromes. There are many ways to use the first method to determine the target syndrome corresponding to the patient data from the database. For example, it can be done in the following way: determine the first feature vector corresponding to the patient's secondary symptom. For example, the first feature vector corresponding to the patient's secondary symptom can be determined in the following way: when the number of the patient's secondary symptoms is 0, the first feature vector is the average value of the word vectors of the reference secondary symptoms in the reference syndromes; when the number of the patient's secondary symptoms is greater than or equal to 1, the first feature vector is determined by the word vectors of the patient's secondary symptoms and the weighted average value of the patient's secondary symptoms in all syndromes in the database.
[0055] For example, the following is a specific embodiment: using a pre-trained language model (for example, the pre-trained language model can be a bidirectional encoder representation from transformer (Bidirectional Encoder Representations from Transformers, referred to as BERT) language model, but not limited to this) to calculate the secondary syndrome feature vector (i.e. the first eigenvector mentioned above), the formula is as follows:
[0056]
[0057] in, Represents the patient's secondary symptoms of the patient data, Indicates the calculation of the word vector for the i-th secondary symptom, that is, the word vector of the patient's secondary symptoms, For the currently used pre-trained language model, n can be 768; represents the average weight of the secondary symptom in all syndromes (i.e. the average weight of the secondary symptoms of the patient in all syndromes in the database), and k represents the number of secondary symptoms. If k = 0, that is, the secondary symptom entered by the patient is empty, then It is the average value of the word vectors of the reference secondary symptoms in the reference syndrome.
[0058] Symptoms can be the patient's current clinical manifestations, as well as the patient's tongue, pulse and other diagnostic information. It should be noted that for the same syndrome of different diseases, the symptoms may be different, and they will be calculated and recommended as different syndromes.
[0059] The weight of each syndrome in the database can be determined in the following way: determine the first number of occurrences of the first secondary symptom in the first syndrome, and determine the total number of secondary symptoms contained in the first syndrome, wherein the first syndrome is any syndrome stored in the database, and the first secondary symptom is any secondary symptom in the first syndrome; determine the first word frequency corresponding to the first secondary symptom based on the first number and the total number of secondary symptoms; determine the total number of syndromes in the database, and obtain the number of syndromes in the database that contain the first secondary symptom; determine the first reverse file frequency corresponding to the first secondary symptom based on the total number of syndromes and the number of syndromes; determine the first weight corresponding to the first secondary symptom based on the first word frequency and the first reverse file frequency.
[0060] For example, the following is a specific embodiment: the TF-IDF (term frequency-inverse document frequency) algorithm is used to calculate the weight of each symptom in the syndrome in the TCM diagnostic data (i.e., the weight of each syndrome in the database), where only the weight of the secondary syndrome is calculated.
[0061] The term frequency (TF) of the i-th secondary symptom (i.e., the first secondary symptom mentioned above) in the j-th syndrome (i.e., the first syndrome mentioned above) (i.e., the first term frequency corresponding to the first secondary symptom mentioned above) is calculated as follows:
[0062]
[0063] Among them, TF i,j represents the word frequency of the i-th secondary symptom in the j-th syndrome (i.e., the first word frequency corresponding to the first secondary symptom mentioned above), n i,j represents the number of occurrences of the i-th secondary symptom in the j-th syndrome (i.e., the number of first occurrences of the first secondary symptom in the first syndrome). According to the data specificity n i,j Only 0 or 1. k n k,j It represents the total number of secondary symptoms in the jth syndrome (i.e. the total number of secondary symptoms contained in the first syndrome mentioned above).
[0064] The inverse document frequency (IDF) of the ith subsymptom is calculated as follows:
[0065]
[0066] Among them, IDF i represents the inverse document frequency (IDF) of the ith secondary symptom (i.e., the first inverse document frequency corresponding to the first secondary symptom above), |D| represents the total number of syndromes (i.e., the total number of syndromes in the above database), and |d i | represents the number of syndromes containing the ith secondary symptom (the number of syndromes in the database containing the first secondary symptom). For any secondary symptom, |d i |≥1.
[0067] Since the sum of the weights of the secondary symptoms in any syndrome should be 1, the weight of the i-th secondary symptom in the j-th syndrome (i.e., the first weight corresponding to the first secondary symptom mentioned above) is calculated as follows:
[0068]
[0069] in, represents the weight of the ith secondary symptom in the jth syndrome (i.e., the first weight mentioned above), IDF i represents the reverse file frequency of the ith secondary disease (i.e., the first reverse file frequency mentioned above), TF i,j represents the word frequency of the i-th sub-symptom in the j-th syndrome (i.e. the first word frequency mentioned above), ∑ k TF k,j *IDF k represents the sum of the products of the inverse document frequency and the corresponding word frequency of all secondary symptoms. If the i-th secondary symptom (i.e., the first secondary symptom mentioned above) appears in the j-th syndrome (i.e., the first syndrome mentioned above), then If it does not appear, TFi,j =0,n j It represents the total number of secondary symptoms in the jth syndrome (i.e. the total number of secondary symptoms contained in the first syndrome mentioned above).
[0070] Therefore, it can be deduced that:
[0071]
[0072] in, It represents the sum of the IDF values of all sub-symptoms in the j-th syndrome (i.e. the first syndrome mentioned above).
[0073] Introducing the calculation of the above-mentioned weights can solve the problem of being unable to calculate the weights of different symptoms among syndrome-related symptoms when determining syndromes, and can determine syndromes more accurately.
[0074] When using the first method to determine the target symptom, it is also necessary to determine the second eigenvector corresponding to the reference secondary symptom of each reference syndrome; for example, the second eigenvector corresponding to the reference secondary symptom of each reference syndrome can be determined in the following manner: determine the second word vector corresponding to each reference secondary symptom, and determine the second weight of each reference secondary symptom in the first syndrome, wherein the number of reference secondary symptoms is greater than or equal to 1; determine the second eigenvector based on the second word vector and the second weight.
[0075] After obtaining the first eigenvector and the second eigenvector, determine a first similarity set consisting of the first similarities between the patient data and each reference syndrome based on the first eigenvector and the second eigenvector; determine a first recommended score set consisting of the first recommended score corresponding to each reference syndrome based on the first similarity in the first similarity set; after sorting the first recommended score set from high to low, determine the syndrome corresponding to the first preset number of first recommended scores as the target syndrome.
[0076] For example, the following is a specific embodiment: the symptoms in the TCM diagnostic data (i.e., the reference syndromes stored in the database) are as follows:
[0077]
[0078] Among them, Syn i represents the ith syndrome (i.e., the ith reference syndrome stored in the database), m p Indicates the main symptoms of this syndrome (i.e. the reference main symptoms of the reference syndrome). Represents the k minor symptoms of this syndrome (i.e., the reference minor symptoms of the reference syndrome).
[0079] Introducing the above-mentioned TCM diagnostic data can solve the problem of inaccurate results caused by not introducing TCM theoretical knowledge when recommending syndromes.
[0080] Calculate the sub-symptom feature vector F of each syndrome mentioned above s (i.e., the second eigenvector corresponding to the reference secondary symptom of each reference syndrome mentioned above):
[0081]
[0082] in, represents the secondary symptom feature vector of the ith syndrome (i.e., the second eigenvector mentioned above), It represents the jth minor symptom of the syndrome (i.e. the reference minor symptom mentioned above). There are k reference minor symptoms in total, and k≥1. represents the word vector calculated for this symptom (i.e., the second word vector corresponding to the above-mentioned reference secondary symptom), For example, n=768 for the pre-trained language model currently used. It represents the calculated weight of the j-th symptom in the ith syndrome (i.e. the second weight mentioned above. The calculation formula of the second weight is the same as that of the first weight mentioned above, which will not be repeated here).
[0083] It should be noted that there are many ways to determine the first recommended score set consisting of the first recommended score corresponding to each reference syndrome, for example: determining a first ratio of the number of the patient's secondary symptoms to the number of reference secondary symptoms of the reference syndrome; respectively determining the third weight, fourth weight and fifth weight corresponding to the first identifier, first similarity and first ratio of each reference syndrome, wherein the first identifier is used to indicate whether the patient's main symptoms are the same as the reference main symptoms of the reference syndrome stored in the database; determining the first recommended score for each reference syndrome based on the first identifier, first similarity, first ratio, third weight, fourth weight and fifth weight of each reference syndrome; and determining the first recommended score set based on the first recommended score of each reference syndrome.
[0084] For example, the following is a specific embodiment: when determining TCM syndromes based on the patient's input symptoms, based on TCM theory, the main symptoms input by the patient and the main symptoms of the syndrome should be matched first, and the similarity is calculated according to the matching results. When the main symptom input is the same as the main symptom of the syndrome, the cosine similarity of the secondary symptom feature vector is calculated as the similarity between the patient input and the i-th syndrome; for the patient input input, the similarity of the i-th syndrome is calculated as follows:
[0085]
[0086] Among them, Similarity(input,i) represents the similarity, ω p ≠m pIndicates that the main symptoms of the patient are different from the reference main symptoms. In this case, Similarity(input,i) represents the second similarity set composed of the second similarity between the patient data and each reference syndrome in the second method, ω p =m p Indicates that the main symptoms of the patient are the same as the reference main symptoms of the reference syndrome stored in the database. In this case, Similarity(input,i) represents the first similarity set formed by the first similarity between the patient data and each reference syndrome in the first method. The full symptom feature vector representing the input symptoms (i.e., the third eigenvector corresponding to the patient data), represents the symptom feature vector of the ith syndrome (i.e., the fourth feature vector corresponding to each reference syndrome), The secondary symptom feature vector representing the input symptom (i.e., the first eigenvector mentioned above), represents the secondary symptom feature vector of the ith syndrome (i.e., the second eigenvector mentioned above). sig() represents the sigmoid function, which is used to map the value of cosine similarity to the interval [0,1].
[0087] Then calculate the recommended score of the ith syndrome (i.e., the first recommended score set consisting of the first recommended score corresponding to each reference syndrome):
[0088]
[0089] Wherein, Score(input,i) represents the recommended score set, which represents the first recommended score set in the first mode and the second recommended score set in the second mode. p (i.e., the first identifier of each reference syndrome) indicates whether the input symptom matches the main symptom of the syndrome (i.e., whether the main symptom of the patient is the same as the reference main symptom of the reference syndrome stored in the database). Similarity(input,i) here indicates the first similarity, k in Indicates the number of secondary symptoms of the input symptom (i.e. the number of secondary symptoms of the above patient) (k in ≥0),k i represents the number of secondary symptoms of the ith syndrome (i.e. the number of reference secondary symptoms of the above reference syndrome) (k i ≥1), It indicates the ratio of the number of input secondary symptoms to the number of syndrome secondary symptoms (i.e. the first ratio of the number of the patient's secondary symptoms to the number of the reference secondary symptoms of the reference syndrome). The closer the numbers are, the higher the score. q, v, g (i.e. the third weight, fourth weight and fifth weight) are pre-defined weights, which respectively represent the weights of C p ,Similarity(input,i), The score weights of these three indicators, for example, can generally be set to q=0.4, v=0.4, and g=0.2.
[0090] Finally, according to the first recommended score set of all syndromes, n syndromes (for example, generally n=10) are recommended from high to low as target syndromes corresponding to the patient data.
[0091] Step S206, when the main symptoms of the patient are different from the reference main symptoms, a second method is used to determine the target syndrome corresponding to the patient data from the database.
[0092] In the technical solution provided in step S206, the second method processes all symptoms in the patient data and the reference syndromes. There are many ways to use the second method to determine the target syndrome corresponding to the patient data from the database. For example, the second method can be used to determine the target syndrome corresponding to the patient data from the database in the following ways: determine the third eigenvector corresponding to the patient data, and determine the fourth eigenvector corresponding to each reference syndrome, and determine a second similarity set consisting of the second similarity between the patient data and each reference syndrome based on the third eigenvector and the fourth eigenvector; determine a second recommended score set consisting of the second recommended score corresponding to each reference syndrome based on the second similarity in the second similarity set; after sorting the second recommended score set from high to low, determine the syndrome corresponding to the first preset number of second recommended scores as the target syndrome.
[0093] For example, the following is a specific embodiment: when determining TCM syndromes based on the patient's input symptoms, based on TCM theory, the main symptoms input by the patient and the main symptoms of the syndrome should be matched first, and the similarity is calculated according to the matching results. When the main symptom input is the same as the main symptom of the syndrome, the cosine similarity of the secondary symptom feature vector is calculated as the similarity between the patient input and the i-th syndrome; for the patient input input, the similarity of the i-th syndrome is calculated as follows:
[0094]
[0095] The meanings of the letters in the formula are as described above and will not be repeated here.
[0096] Then, the recommended score of the ith syndrome (i.e., the second recommended score set consisting of the second recommended scores corresponding to each reference syndrome) is calculated:
[0097]
[0098] The meanings of the parameters in the formula are as described above and will not be repeated here.
[0099] Finally, based on the second recommendation score set of all syndromes, n syndromes (for example, generally n=10) are recommended from high to low as target syndromes corresponding to the patient data.
[0100] The third eigenvector corresponding to the above-mentioned patient data can be determined in the following manner: when the number of the patient's secondary symptoms is 0, determine the third word vector corresponding to the patient's main symptoms, and determine the average value of the word vectors of the reference secondary symptoms in the reference syndrome; obtain the third eigenvector based on the average value of the third word vector and the word vector of the reference secondary symptom; when the number of the patient's secondary symptoms is greater than or equal to 1, determine the word vector corresponding to the patient's secondary symptoms and the weighted average value of all syndromes of the patient's secondary symptoms in the database; determine the third eigenvector based on the third word vector, the word vector corresponding to the patient's secondary symptoms and the weighted average value of all syndromes in the database, and the third eigenvector is the eigenvector corresponding to the patient's main symptoms and the patient's secondary symptoms.
[0101] For example, the following is a specific embodiment: The patient inputs the full symptom feature vector F all (i.e., the third eigenvector corresponding to the above patient data) is calculated as follows:
[0102]
[0103] in, Indicates the patient's secondary symptoms, ω p represents the main symptoms of the patient, f(ω p ) represents the word vector calculated for the patient's main symptoms (i.e., the third word vector corresponding to the patient's main symptoms), f(ω s ) avg The average value of the word vectors representing the reference secondary symptoms in the reference syndrome, represents the word vector corresponding to the i-th secondary symptom (i.e., the word vector corresponding to the secondary symptom of the patient), and [] represents the concatenation of two vectors, so after concatenation represents the average weight of the patient's secondary symptoms in all syndromes in the database, and k represents the number of secondary symptoms (i.e., the number of the patient's secondary symptoms). In particular, if k = 0, i.e., the patient's secondary symptoms are empty, then The average value of the main symptom word vector concatenated with all the secondary symptom word vectors (the word vectors corresponding to the patient's secondary symptoms).
[0104] The above-mentioned fourth eigenvector can be determined in the following manner: determine the fourth word vector corresponding to the reference major symptom of each reference syndrome, the second word vector corresponding to each reference minor symptom of each reference syndrome, and the second weight of each reference minor symptom in the first syndrome, wherein the number of reference minor symptoms is greater than or equal to 1, and the first syndrome is any syndrome stored in the database; determine the fourth eigenvector based on the fourth word vector, the second word vector and the second weight, and the fourth eigenvector is the eigenvector corresponding to the reference major symptom and the reference minor symptom of the reference syndrome.
[0105] For example, calculate the comprehensive symptom feature vector F of each syndrome all (i.e. the fourth eigenvector corresponding to each reference syndrome mentioned above):
[0106]
[0107] in represents the overall symptom feature vector of the ith syndrome (i.e. the fourth eigenvector mentioned above), represents the jth reference minor symptom, there are k minor symptoms (i.e. the number of reference minor symptoms mentioned above), and k ≥ 1, Represents the second word vector corresponding to each reference secondary symptom of each reference syndrome, m p Indicates the main symptom, f(m p ) represents the word vector calculated for the main symptom (i.e., the fourth word vector mentioned above), f(m p )∈R n For example, the currently used pre-trained language model n = 768. [] represents the concatenation of two vectors. It represents the calculated weight of the j-th symptom in the ith syndrome (i.e., the second weight of each reference secondary symptom in the first syndrome).
[0108] After completing the above steps S202-206, you can also obtain the target medical case data to be confirmed and the real medical case data stored in the database, where the real medical case data includes the first main symptom and the first secondary symptom of the first syndrome, the syndrome diagnosis result of the first syndrome and the treatment method of the first syndrome, and the first syndrome is any syndrome stored in the database; determine the similarity between the target main symptom and the first main symptom in the target medical case data to obtain a first result; determine the similarity between the target secondary symptom and the first secondary symptom in the target medical case data to obtain a second result; and determine the recommended medical case data that is most similar to the target medical case data from the real medical case data based on the first result and the second result.
[0109] For example, the following is a specific implementation example: collecting real-world TCM medical record data, which mainly includes patient information, symptoms, medical history, doctor's diagnosis (disease, syndrome), treatment methods, etc. collected during TCM diagnosis and treatment. The real-world TCM medical record data after terminology standardization can be used to test the accuracy of the syndrome recommendation system for doctors' reference.
[0110] After standardizing and sorting the real-world TCM medical case data using TCM standard terminology data, the following forms of TCM real-world medical case data (i.e., the real medical case data stored in the above-mentioned database) are obtained:
[0111]
[0112] Among them, P j represents the symptom of the jth patient (i.e., the first symptom mentioned above), m p and They represent the main symptom of the patient (i.e., the first main symptom of the first syndrome mentioned above) and k secondary symptoms after the medical records are sorted and summarized. There is only one main symptom, and there can be multiple secondary symptoms or they can be empty. Syn j Indicates the syndrome diagnosis of the patient in the medical record (i.e. the syndrome diagnosis result of the first syndrome mentioned above), T j Indicates the treatment method for the patient (i.e. the above-mentioned treatment method for the first symptom).
[0113] Determine the similarity between the target main symptom and the first main symptom in the target medical record data (i.e., the data input by the patient), and obtain the first result:
[0114]
[0115] Among them, C p Indicates the similarity between the target main symptom and the first main symptom in the target medical record data, m p ≠w p Indicates that the target main symptom and the first main symptom in the target medical record data are different. In this case, C p Take 0, m p =w p Indicates that the target main symptom and the first main symptom in the target medical record data are the same. In this case, C p Take 1.
[0116] Determine the similarity between the target secondary symptom and the first secondary symptom in the target medical record data, and obtain the second result:
[0117]
[0118] in, J(Input,j) represents the similarity between the target secondary symptom and the first secondary symptom in the target medical record data. Indicates that A is the target secondary symptom in the target medical record data, Indicates that B is the first secondary symptom of the first syndrome in the real medical record data. When A and B are both empty, J(Input, j)=1.
[0119] Determine the recommended medical case data that is most similar to the target medical case data from the real medical case data based on the first result and the second result:
[0120] s(input,i)=q 1 *C p +q 2 *J(Input,j)
[0121] Among them, s(input,i) represents the similarity of medical records, C p Indicates the similarity between the target main symptom and the first main symptom in the target medical record data, and J(Input,j) indicates the similarity between the target secondary symptom and the first secondary symptom in the target medical record data. 1 ,q 2 are the pre-determined partition weights, representing the p , J(Input,j) similarity calculation weight, for example, can generally be set to q 1 =0.5,q 2 =0.5.
[0122] Based on the medical case similarity, the medical case with the highest medical case similarity is used as the recommended medical case data that is most similar to the target medical case data for the doctor's reference.
[0123] Through the above steps, patients can be allowed to input non-standard symptom information when determining TCM syndromes. By introducing TCM theoretical knowledge and calculating the weights of different symptoms in syndrome-related symptoms, the recommendation results can be more accurate, providing doctors with more accurate references and providing references for patients' health management.
[0124] The present application embodiment also provides a pre-trained language model structure diagram of a syndrome determination method, such as Figure 3 As shown, Trm in the figure represents the Transformer encoder. Figure 3 Yes Figure 2 The structure of the pre-trained language model used in the embodiment shows that the pre-trained language model is generally composed of a multi-layer bidirectional Transformer encoder. The figure shows the implementation logic of the word vector. The words to be calculated are used as text input (i.e. Figure 2After the language model is pre-trained for each symptom of each feature vector that needs to be calculated in the embodiment, after the model calculation, the first vector in the vector sequence finally output is the word vector representing the meaning of the entire word (i.e. Figure 2 Each feature vector that needs to be calculated in the embodiment).
[0125] The present application also provides a Transformer encoder structure diagram, such as Figure 4 As shown, Figure 4 Yes Figure 3 The structure of the Transformer encoder in , where the input vector represents the vector of the input text after encoding or the intermediate vector of the calculation process, and the output vector represents the vector representation calculated by the pre-trained model or the intermediate vector of the calculation process. Masked multi-head self-attention is a calculation module of a masked multi-head self-attention mechanism. LN represents Layer Normalization, which is a vector normalization calculation module. The feedforward network layer is a two-layer fully connected layer used to perform nonlinear transformations on the processed data. ⊕ represents the element-by-element addition of a vector or matrix.
[0126] The embodiment of the present application provides a syndrome determination device, and the structural diagram of the syndrome determination device is as follows: Figure 5 As shown, it includes an acquisition module 50 , a first determination module 52 , and a second determination module 54 .
[0127] The acquisition module 50 is used to acquire patient data matching the patient, wherein the patient data includes the patient's primary symptoms and the patient's secondary symptoms.
[0128] The acquisition module 50 is also used to standardize non-standard symptoms in the patient data: determine the first symptom data in the patient data that belongs to the non-standard symptom description, wherein the first symptom data is the data of any non-standard symptom description in the patient data; determine the first word vector corresponding to the first symptom data, and determine the standard word vector corresponding to each standard TCM symptom term; determine the first symptom data similarity set corresponding to the first symptom data based on the first word vector and the standard word vector corresponding to each standard TCM symptom data; determine the target TCM symptom data with the highest similarity in the first symptom data similarity set as the standardized symptom data corresponding to the first symptom data.
[0129] The first determination module 52 is used to determine the target syndrome corresponding to the patient data from the database using a first method when the patient's main symptom is the same as the reference main symptom of the reference syndrome stored in the database, wherein the first method only processes the patient's secondary symptoms of the patient data and the reference secondary symptoms of the reference syndrome; the first method only processes the patient's secondary symptoms of the patient data and the reference secondary symptoms of the reference syndrome: determine the first feature vector corresponding to the patient's secondary symptoms, for example, the first feature vector corresponding to the patient's secondary symptoms can be determined in the following manner: when the number of the patient's secondary symptoms is 0 , the first feature vector is the average value of the word vectors of the reference secondary symptoms in the reference syndrome; when the number of the patient's secondary symptoms is greater than or equal to 1, the first feature vector is determined by the word vector of the patient's secondary symptoms and the weighted average value of the patient's secondary symptoms in all syndromes in the database; and the second feature vector corresponding to each reference syndrome is determined: the second word vector corresponding to each reference secondary symptom is determined, and the second weight of each reference secondary symptom in the first syndrome is determined, wherein the number of the reference secondary symptoms is greater than or equal to 1; the second feature vector is determined based on the second word vector and the second weight. Based on the first feature vector and the second feature vector, a first similarity set consisting of the first similarity between the patient data and each reference syndrome is determined; based on the first similarity in the first similarity set, a first recommended score set consisting of the first recommended score corresponding to each reference syndrome is determined; after sorting the first recommended score set from high to low, the syndrome corresponding to the first preset number of first recommended scores is determined as the target syndrome.
[0130] The first determination module 52 is also used to determine a first recommended score set consisting of the first recommended score corresponding to each reference syndrome: determine a first ratio of the number of the patient's secondary symptoms to the number of reference secondary symptoms of the reference syndrome; respectively determine the third weight, fourth weight and fifth weight corresponding to the first identifier, first similarity and first ratio of each reference syndrome, wherein the first identifier is used to indicate whether the patient's main symptoms are the same as the reference main symptoms of the reference syndrome stored in the database; determine the first recommended score for each reference syndrome based on the first identifier, first similarity, first ratio, third weight, fourth weight and fifth weight of each reference syndrome; and determine the first recommended score set based on the first recommended score of each reference syndrome.
[0131] The second determination module 54 is used to determine the target syndrome corresponding to the patient data from the database using a second method when the patient's main symptoms are different from the reference main symptoms, wherein the second method processes all symptoms in the patient data and the reference syndromes; the second method processes all symptoms in the patient data and the reference syndromes, and there are multiple methods for using the second method to determine the target syndrome corresponding to the patient data from the database, for example, the target syndrome corresponding to the patient data can be determined from the database using the second method in the following manner: determine the third eigenvector corresponding to the patient data, and determine the fourth eigenvector corresponding to each reference syndrome, and determine a second similarity set consisting of a second similarity between the patient data and each reference syndrome based on the third eigenvector and the fourth eigenvector; determine a second recommended score set consisting of a second recommended score corresponding to each reference syndrome based on the second similarity in the second similarity set; after sorting the second recommended score set from high to low, determine the syndrome corresponding to the first preset number of second recommended scores as the target syndrome.
[0132] The second determination module 54 is also used to determine the third eigenvector corresponding to the patient data: when the number of the patient's secondary symptoms is 0, determine the third word vector corresponding to the patient's main symptom, and determine the average value of the word vectors of the reference secondary symptoms in the reference syndrome; obtain the third eigenvector based on the average value of the third word vector and the word vector of the reference secondary symptom; when the number of the patient's secondary symptoms is greater than or equal to 1, determine the word vector corresponding to the patient's secondary symptoms and the weighted average value of all syndromes of the patient's secondary symptoms in the database; determine the third eigenvector based on the third word vector, the word vector corresponding to the patient's secondary symptoms and the weighted average value of all syndromes in the database. Quantity; determine the fourth eigenvector corresponding to each reference syndrome: determine the fourth word vector corresponding to the reference main symptom of each reference syndrome, the second word vector corresponding to each reference secondary symptom of each reference syndrome, and the second weight of each reference secondary symptom in the first syndrome, wherein the number of reference secondary symptoms is greater than or equal to 1, and the first syndrome is any syndrome stored in the database; determine the fourth eigenvector based on the fourth word vector, the second word vector and the second weight; wherein the third eigenvector is the eigenvector corresponding to the patient's main symptoms and the patient's secondary symptoms, and the fourth eigenvector is the eigenvector corresponding to the reference main symptoms and the reference secondary symptoms of the reference syndrome.
[0133] The above-mentioned syndrome determination device also includes a review module 56, which is used to obtain the target medical case data to be confirmed and the real medical case data stored in the database, wherein the real medical case data includes the first main symptom and the first secondary symptom of the first syndrome, the syndrome type diagnosis result of the first syndrome and the treatment method of the first syndrome, and the first syndrome is any syndrome stored in the database; determine the similarity between the target main symptom and the first main symptom in the target medical case data to obtain a first result; determine the similarity between the target secondary symptom and the first secondary symptom in the target medical case data to obtain a second result; and determine the recommended medical case data that is most similar to the target medical case data from the real medical case data based on the first result and the second result.
[0134] It should be noted that the various modules in the above-mentioned syndrome determination method can be program modules (for example, a set of program instructions that implement a certain specific function) or hardware modules. For the latter, it can be expressed in the following forms, but is not limited to this: the expression form of each of the above-mentioned modules is a processor, or the functions of each of the above-mentioned modules are implemented by a processor.
[0135] The embodiment of the present application also provides a non-volatile storage medium, the non-volatile storage medium includes a stored program, wherein when the program is running, the device where the non-volatile storage medium is located is controlled to execute the above syndrome determination method. For example, patient data matching the patient is obtained, wherein the patient data includes the patient's main symptoms and the patient's secondary symptoms; when the patient's main symptoms are the same as the reference main symptoms of the reference syndrome stored in the database, a first method is used to determine the target syndrome corresponding to the patient data from the database, wherein the first method only processes the patient's secondary symptoms of the patient data and the reference secondary symptoms of the reference syndrome; when the patient's main symptoms are different from the reference main symptoms, a second method is used to determine the target syndrome corresponding to the patient data from the database, wherein the second method processes all symptoms in the patient data and the reference syndrome.
[0136] The embodiment of the present application also provides an electronic device, the electronic device includes a processor, the processor is used to run a program, wherein the above syndrome determination method is executed when the program is running. For example, patient data matching the patient is obtained, wherein the patient data includes the patient's main symptoms and the patient's secondary symptoms; when the patient's main symptoms are the same as the reference main symptoms of the reference syndrome stored in the database, a first method is used to determine the target syndrome corresponding to the patient data from the database, wherein the first method only processes the patient's secondary symptoms of the patient data and the reference secondary symptoms of the reference syndrome; when the patient's main symptoms are different from the reference main symptoms, a second method is used to determine the target syndrome corresponding to the patient data from the database, wherein the second method processes all symptoms in the patient data and the reference syndrome.
[0137] According to another aspect of the embodiment of the present application, a computer program product is also provided, including a computer program, which implements the above syndrome determination method when executed by a processor. For example, patient data matching the patient is obtained, wherein the patient data includes the patient's main symptoms and the patient's secondary symptoms; when the patient's main symptoms are the same as the reference main symptoms of the reference syndrome stored in the database, a first method is used to determine the target syndrome corresponding to the patient data from the database, wherein the first method only processes the patient's secondary symptoms of the patient data and the reference secondary symptoms of the reference syndrome; when the patient's main symptoms are different from the reference main symptoms, a second method is used to determine the target syndrome corresponding to the patient data from the database, wherein the second method processes all symptoms in the patient data and the reference syndrome.
[0138] In the above embodiments of the present application, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.
[0139] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units can be a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.
[0140] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0141] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0142] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the relevant technology or all or part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, disk or optical disk, etc. Various media that can store program codes.
[0143] The above is only a preferred implementation of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.
Claims
1. A method for determining syndrome, characterized in that: include: Acquire patient data matching the patient, wherein the patient data includes the patient's primary symptoms and the patient's secondary symptoms; When the patient's main symptom is the same as the reference main symptom of the reference syndrome stored in the database, determining the target syndrome corresponding to the patient data from the database using a first method, wherein the first method processes only the patient's secondary symptoms of the patient data and the reference secondary symptoms of the reference syndrome; When the main symptom of the patient is different from the reference main symptom, a second method is used to determine the target syndrome corresponding to the patient data from the database, wherein the second method processes all symptoms in the patient data and the reference syndrome.
2. The method according to claim 1, characterized in that After obtaining the patient data matching the patient, the method further includes: Determine first symptom data belonging to a non-standard symptom description in the patient data, wherein the first symptom data is data of any non-standard symptom description in the patient data; Determine a first word vector corresponding to the first symptom data, and determine a standard word vector corresponding to each standard TCM symptom data; Determine a first symptom data similarity set corresponding to the first symptom data based on the first word vector and the standard word vector corresponding to each standard TCM symptom data; The target TCM symptom data with the highest similarity in the first symptom data similarity set is determined as the standardized symptom data corresponding to the first symptom data.
3. The method according to claim 1, characterized in that: Determining a target syndrome corresponding to the patient data from the database using a first method includes: Determine a first eigenvector corresponding to the secondary symptom of the patient, and determine a second eigenvector corresponding to the reference secondary symptom of each reference syndrome; Determine a first similarity set consisting of a first similarity between the patient data and each reference syndrome according to the first feature vector and the second feature vector; Determining a first recommended score set consisting of a first recommended score corresponding to each reference syndrome according to the first similarity in the first similarity set; After sorting the first recommendation score sets from high to low, the syndromes corresponding to the first preset number of first recommendation scores are determined as the target syndromes.
4. The method according to claim 3, characterized in that Determining a first feature vector corresponding to the secondary symptom of the patient includes: When the number of the secondary symptoms of the patient is 0, the first feature vector is the average value of the word vectors of the reference secondary symptoms in the reference syndrome; When the number of the patient's secondary symptoms is greater than or equal to 1, the first feature vector is determined by the word vector of the patient's secondary symptoms and the weighted average of all syndromes of the patient's secondary symptoms in the database.
5. The method according to claim 4, characterized in that The weight of each syndrome in the database is determined in the following way: Determine the first number of times the first secondary symptom appears in the first syndrome, and determine the total number of secondary symptoms included in the first syndrome, wherein the first syndrome is any syndrome stored in the database, and the first secondary symptom is any secondary symptom in the first syndrome; Determining a first word frequency corresponding to the first secondary symptom according to the first number and the total number of secondary symptoms; Determining the total number of syndromes in the database, and obtaining the number of syndromes in the database that include the first secondary symptom; Determining a first reverse file frequency corresponding to the first secondary symptom according to the total number of syndromes and the number of syndromes; A first weight corresponding to the first secondary symptom is determined according to the first word frequency and the first reverse file frequency.
6. The method according to claim 5, characterized in that Determine the second eigenvector corresponding to the reference secondary symptom of each reference syndrome, including: Determine a second word vector corresponding to each reference secondary symptom, and determine a second weight of each reference secondary symptom in the first syndrome, wherein the number of the reference secondary symptoms is greater than or equal to 1; The second feature vector is determined according to the second word vector and the second weight.
7. The method according to claim 3, characterized in that Determining a first recommended score set consisting of a first recommended score corresponding to each reference syndrome includes: determining a first ratio of the number of the patient's secondary symptoms to the number of reference secondary symptoms of the reference syndrome; Determining a third weight, a fourth weight, and a fifth weight corresponding to a first identifier, a first similarity, and a first ratio of each reference syndrome, respectively, wherein the first identifier is used to indicate whether the main symptom of the patient is the same as the reference main symptom of the reference syndrome stored in the database; Determine a first recommendation score for each reference syndrome according to the first identifier, the first similarity, the first ratio, the third weight, the fourth weight, and the fifth weight of each reference syndrome; The first recommended score set is determined according to the first recommended score of each reference syndrome.
8. The method according to claim 1, characterized in that Determining a target syndrome corresponding to the patient data from the database using a second method includes: Determine a third eigenvector corresponding to the patient data, and determine a fourth eigenvector corresponding to each reference syndrome, wherein the third eigenvector is a eigenvector corresponding to the patient's main symptom and the patient's secondary symptom, and the fourth eigenvector is a eigenvector corresponding to the reference main symptom and the reference secondary symptom of the reference syndrome; Determine a second similarity set consisting of second similarities between the patient data and each reference syndrome according to the third eigenvector and the fourth eigenvector; Determining, according to the second similarities in the second similarity set, a second recommended score set consisting of the second recommended scores corresponding to each reference syndrome; After sorting the second recommendation score set from high to low, the syndromes corresponding to the first preset number of second recommendation scores are determined as the target syndromes.
9. The method according to claim 8, characterized in that Determining a third eigenvector corresponding to the patient data includes: When the number of the secondary symptoms of the patient is 0, determining a third word vector corresponding to the primary symptom of the patient, and determining an average value of the word vectors of the reference secondary symptoms in the reference syndrome; Obtaining the third feature vector according to an average value of the third word vector and the word vector of the reference secondary symptom; When the number of the secondary symptoms of the patient is greater than or equal to 1, determining the word vector corresponding to the secondary symptoms of the patient and the weighted average of all syndromes of the secondary symptoms of the patient in the database; The third feature vector is determined based on the third word vector, the word vector corresponding to the patient's secondary symptoms and the weighted average of all syndromes in the database.
10. The method according to claim 8, characterized in that Determine the fourth eigenvector corresponding to each reference syndrome, including: Determine a fourth word vector corresponding to the reference main symptom of each reference syndrome, a second word vector corresponding to each reference secondary symptom of each reference syndrome, and a second weight of each reference secondary symptom in the first syndrome, wherein the number of the reference secondary symptoms is greater than or equal to 1, and the first syndrome is any syndrome stored in the database; The fourth feature vector is determined according to the fourth word vector, the second word vector and the second weight.
11. The method according to claim 1, characterized in that: The method further comprises: Acquire target medical case data to be confirmed and real medical case data stored in a database, wherein the real medical case data includes a first main symptom and a first secondary symptom of a first syndrome, a syndrome type diagnosis result of the first syndrome, and a treatment method for the first syndrome, and the first syndrome is any syndrome stored in the database; Determine the similarity between the target main symptom in the target medical record data and the first main symptom to obtain a first result; Determine the similarity between the target secondary symptom in the target medical record data and the first secondary symptom to obtain a second result; Determine recommended medical case data that is most similar to the target medical case data from the real medical case data according to the first result and the second result.
12. A syndrome determination device, characterized in that: include: An acquisition module, used for acquiring patient data matching the patient, wherein the patient data includes the patient's main symptoms and the patient's secondary symptoms; a first determination module, configured to determine a target syndrome corresponding to the patient data from the database using a first method when the patient's main symptom is the same as a reference main symptom of a reference syndrome stored in a database, wherein the first method processes only the patient's secondary symptoms of the patient data and the reference secondary symptoms of the reference syndrome; The second determination module is used to determine the target syndrome corresponding to the patient data from the database using a second method when the patient's main symptoms are different from the reference main symptoms, wherein the second method processes all symptoms in the patient data and the reference syndrome.
13. A non-volatile storage medium, characterized in that: The non-volatile storage medium stores a program, wherein when the program is executed, the device where the non-volatile storage medium is located is controlled to execute the syndrome determination method according to any one of claims 1 to 11.
14. An electronic device, characterized in that: include: A memory and a processor, wherein the processor is used to run a program stored in the memory, wherein the program executes the syndrome determination method described in any one of claims 1 to 11 when running.
15. A computer program product comprising computer instructions, characterized in that When the computer instructions are executed by a processor, the method for determining a syndrome according to any one of claims 1 to 11 is implemented.
