Inquiry regular expression generation method and device, equipment and storage medium

By using a disease knowledge graph model to extract features and process co-occurrence matrices from consultation data, and generating regular expressions, the problem of low efficiency in manual writing is solved, and higher recognition accuracy is achieved.

CN113191141BActive Publication Date: 2025-12-09KANG JIAN INFORMATION TECH (SHENZHEN) CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202110482326.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-04-30
Publication Date
2025-12-09
Estimated Expiration
2041-04-30

AI Technical Summary

Technical Problem

Existing methods for generating regular expressions rely on manual writing, which is inefficient and makes it difficult to process information data in a timely and accurate manner, resulting in inaccurate recognition.

Method used

By acquiring consultation data and diagnostic results, disease knowledge graph recognition models are used to extract symptom features, construct co-occurrence matrices, and perform vectorization to generate regular expressions.

Benefits of technology

It improves the accuracy of regular expressions, avoids human error in recognition, and generates expressions that better match the diagnostic results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113191141B_ABST
    Figure CN113191141B_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of data processing, and discloses a diagnosis regular expression generation method, device, equipment and storage medium. The disease characteristics are extracted from the collected labeled data, the co-occurrence matrix is constructed based on the disease characteristics, the feature combination with high combination frequency is selected from the co-occurrence matrix as the feature combination corresponding to the diagnosis result, then the selected feature combination is subjected to vectorization processing, and finally the regular expression is generated based on the vectorized feature combination. In this way, the automatic generation of the regular expression is realized. The disease knowledge graph model is used to extract the disease characteristics in the labeled data, so that the understanding deviation caused by manual extraction is avoided, and the phenomenon that the finally generated expression is not accurate enough for identifying the diagnosis result is avoided. In addition, the present application also relates to the blockchain technology, and the labeled data can be stored in the blockchain.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of data processing, and in particular to a medical consultation regular expression generation method and device, equipment and a storage medium. BACKGROUND

[0002] With the rapid development of the contemporary information age, a large amount of information data is generated and needs to be processed every day. Especially in the pre-examination, triage and diagnosis process in the field of intelligent medical treatment, due to the insufficient model classification and the difficult-to-solve difficult diseases, more accurate identification is needed. In some medical scenarios, regular expressions are used to identify the medical consultation information of the medical consultation person to realize the diagnosis of the symptoms of the medical consultation person. However, the regular expressions used at present are mainly generated by manual writing. The traditional manual writing of regular expressions needs to follow the steps of "viewing corpus -> judging keywords in corpus -> compiling word library -> writing regular expression", and the process is complicated and the efficiency of manual corpus viewing is low.

[0003] In addition, in the aspect of rule-based semantic recognition, a large amount of corpus needs to be manually written and a word library needs to be added, which consumes manpower and is inefficient. Relying entirely on manual writing of regular expressions cannot timely and accurately process the newly added information data every day, and manual writing of regular expressions has high requirements for the staff. SUMMARY

[0004] The main purpose of the present application is to solve the technical problem of low accuracy of the existing regular expression generation method.

[0005] The first aspect of the present application provides a medical consultation regular expression generation method, which comprises: acquiring a plurality of medical consultation data and corresponding diagnosis results, and labeling the corresponding medical consultation data based on the diagnosis results to obtain an expression generation sample set; using a preset disease knowledge graph recognition model to extract the disease characteristics of each sample in the expression generation sample set to generate a feature set of each sample; generating a co-occurrence matrix according to the feature sets of all samples, and calculating the combination frequency between each disease characteristic in the co-occurrence matrix; screening the disease characteristic combinations in the combination frequency that meet the preset value for vectorization processing, and generating the corresponding regular expression based on the vectorized characteristic combinations.

[0006] Optionally, in the first implementation manner of the first aspect, the labeling the corresponding interrogation data based on the diagnosis result to obtain the expression generation sample set comprises: querying a label corresponding to the diagnosis result from a preset diagnosis label table according to the diagnosis result; determining the interrogation data corresponding to the diagnosis result, setting a mark of the label on each word in the interrogation data by using a Chinese mark algorithm to obtain marked data; classifying all the marked data according to the label to generate a plurality of marked data subsets, wherein the classification is to combine the marked data with the same label to obtain a marked data subset; and generating an expression sample set from the plurality of marked data subsets.

[0007] Optionally, in the second implementation manner of the first aspect, the generating the expression sample set from the plurality of marked data subsets comprises: separately analyzing the marked data in each marked data subset according to a Chinese grammar rule to determine subject content and non-subject content of the marked data subset; removing the non-subject content from the marked data in the corresponding marked data subset by using a word segmentation tool until all the marked data subsets complete the removal of the non-subject content to generate the expression sample set.

[0008] Optionally, in the third implementation manner of the first aspect, the separately analyzing the marked data in each marked data subset according to a Chinese grammar rule to determine subject content and non-subject content of the marked data subset comprises: performing word segmentation processing on the marked data in each marked data subset according to a Chinese grammar rule to obtain words and corresponding parts of speech of the marked data subset; performing analysis on the sentence pattern of the marked data in the marked data subset according to the grammar rule and the words and corresponding parts of speech in the marked data subset to obtain a sentence pattern structure of the marked data subset; and extracting the subject content and the non-subject content of each marked data in the marked data subset according to the sentence pattern structure.

[0009] Optionally, in the fourth implementation manner of the first aspect, the disease knowledge graph recognition model comprises a stop word recognition network and a disease recognition network, and the extracting a disease feature of each sample in the expression generation sample set by using the preset disease knowledge graph recognition model to generate a feature set of each sample comprises: performing semantic recognition on each word in the subject content of the marked data subset by using the stop word recognition network, and labeling a word without obvious semantics based on a recognition result to obtain labeled subject content; deleting the word without obvious semantics in the labeled subject content by using an analysis technology to obtain sample word segmentation; and performing disease feature recognition and segmentation on the sample word segmentation by using the disease recognition network to obtain a feature set of the marked data subset.

[0010] Optionally, in a fifth implementation form of the first aspect of the present application, the generating a co-occurrence matrix according to the feature set of all samples and calculating the combination frequency between each disease feature in the co-occurrence matrix comprises: constructing a corresponding matrix table according to the disease features in the feature set of each of the labeled data subsets, wherein the matrix table comprises a list header and a row header, and the list header and the row header in each matrix table each contain all disease features in the feature set of the corresponding labeled data subset; counting the number of times that the disease feature combination of the list header and the row header in each labeled data subset appears in the same labeled data and adding the number of times to the corresponding matrix content table to obtain a co-occurrence matrix of each labeled data subset; and calculating the combination frequency of the corresponding disease feature combination according to the number of times.

[0011] Optionally, in a sixth implementation form of the first aspect of the present application, the screening the disease feature combination satisfying the preset value in the combination frequency for vectorization processing and generating a corresponding regular expression based on the vectorized feature combination comprises: sorting all disease feature combinations in each co-occurrence matrix in descending order of combination frequency, and selecting the top N disease feature combinations as the diagnostic feature combinations of the diagnostic result corresponding to the co-occurrence matrix, N being an integer greater than 1; vectorizing each disease feature in the diagnostic feature combination to obtain a feature vector; and generating a corresponding regular expression according to the feature vector.

[0012] The second aspect of the present application provides an inquiry regular expression generation device, comprising: a labeling module configured to obtain a plurality of inquiry data and corresponding diagnostic results, and label the corresponding inquiry data based on the diagnostic results to obtain an expression generation sample set; an extraction module configured to use a preset disease knowledge graph recognition model to extract disease features of each sample in the expression generation sample set to generate a feature set of each sample; a calculation module configured to generate a co-occurrence matrix according to the feature set of all samples and calculate the combination frequency between each disease feature in the co-occurrence matrix; and a generation module configured to screen the disease feature combination satisfying the preset value in the combination frequency for vectorization processing and generate a corresponding regular expression based on the vectorized feature combination.

[0013] Optionally, in the first implementation manner of the second aspect of the present application, the marking module comprises: a query unit configured to query a label corresponding to the diagnosis result from a preset diagnosis label table according to the diagnosis result; a marking unit configured to determine the interrogation data corresponding to the diagnosis result, set a mark of the label on each word in the interrogation data by using a Chinese marking algorithm, and obtain marked data; a classification unit configured to classify all the marked data according to the label, and generate a plurality of marked data subsets, wherein the classification is to combine the marked data with the same label to obtain a marked data subset; and a sample generation unit configured to generate an expression sample set from the plurality of marked data subsets.

[0014] Optionally, in the second implementation manner of the second aspect of the present application, the sample generation unit is specifically configured to: analyze the marked data in each marked data subset individually according to a Chinese grammar rule, determine the main content and the non-main content of the marked data subset, remove the non-main content from the marked data in the corresponding marked data subset by using a word segmentation tool, and generate the expression sample set after removing the non-main content from all the marked data subsets.

[0015] Optionally, in the third implementation manner of the second aspect of the present application, the sample generation unit is specifically configured to: perform word segmentation processing on the marked data in each marked data subset according to a Chinese grammar rule, obtain words and corresponding parts of speech of the marked data subset; analyze the marked data in the marked data subset according to the grammar rule and the words and corresponding parts of speech in the marked data subset, obtain a sentence pattern structure of the marked data subset; and extract the main content and the non-main content of each marked data in the marked data subset according to the sentence pattern structure.

[0016] Optionally, in the fourth implementation manner of the second aspect of the present application, the disease knowledge graph recognition model comprises a stop word recognition network and a disease recognition network, and the extraction module comprises: an identification unit configured to perform semantic recognition on each word in the main content of the marked data subset by using the stop word recognition network, and mark the words without obvious semantics based on the recognition result to obtain a marked main content; an extraction unit configured to delete the words without obvious semantics in the marked main content by using an analysis technology to obtain sample word segmentation; and a segmentation unit configured to perform disease feature recognition and segmentation on the sample word segmentation by using the disease recognition network to obtain a feature set of the marked data subset.

[0017] Optionally, in a fifth implementation form of the second aspect of the present application, the calculation module comprises: a construction unit, configured to construct a corresponding matrix table according to the disease features in the feature set of each of the labeled data subsets, wherein the matrix table comprises a list header and a row header, and the list header and the row header in each of the matrix tables comprise all the disease features in the feature set of the corresponding labeled data subset; a statistics unit, configured to count the number of times that the disease feature combination of the list header and the row header in each of the labeled data subsets appears in the same labeled data, and add the number of times to the corresponding matrix content table to obtain a co-occurrence matrix of each of the labeled data subsets; and a calculation unit, configured to calculate the combination frequency of the corresponding disease feature combination according to the number of times.

[0018] Optionally, in a sixth implementation form of the second aspect of the present application, the generation module comprises: an ordering unit, configured to order all the disease feature combinations in each of the co-occurrence matrices in descending order of the combination frequency, and select the top N disease feature combinations in the order as the diagnostic feature combinations of the diagnostic result corresponding to the co-occurrence matrix, N being an integer greater than 1; a vectorization unit, configured to perform vectorization processing on each of the disease features in the diagnostic feature combinations to obtain a feature vector; and an expression generation unit, configured to generate a corresponding regular expression according to the feature vector.

[0019] The third aspect of the present application provides a diagnosis regular expression generation device, comprising: a memory and at least one processor, the memory having instructions stored therein; the at least one processor calling the instructions in the memory to cause the diagnosis regular expression generation device to perform the diagnosis regular expression generation method described above.

[0020] The fourth aspect of the present application provides a computer-readable storage medium having instructions stored therein, which, when executed on a computer, causes the computer to perform the diagnosis regular expression generation method described above.

[0021] In the technical solution of the present application, the disease features are extracted from the collected labeled data, the co-occurrence matrix is constructed based on the disease features, the feature combinations with higher combination frequencies are selected from the co-occurrence matrix as the feature combinations corresponding to the diagnostic result, then the selected feature combinations are vectorized, and finally the regular expression is generated based on the vectorized feature combinations. In this way, the automatic generation of the regular expression is realized. The disease knowledge graph model is used to extract the disease features from the labeled data, which avoids the understanding bias caused by manual extraction and leads to the phenomenon that the generated expression is not accurate enough for identifying the diagnostic result. Meanwhile, the matrix and the vectorization processing make the extracted disease features more consistent with the diagnostic result, and further improve the accuracy of the regular expression. BRIEF DESCRIPTION OF DRAWINGS

[0022] Figure 1 A first embodiment of the method for generating a regular expression for inquiry diagnosis in the embodiments of the present application is shown in the figure;

[0023] Figure 2 A second embodiment of the method for generating a regular expression for inquiry diagnosis in the embodiments of the present application is shown in the figure;

[0024] Figure 3 A third embodiment of the method for generating a regular expression for inquiry diagnosis in the embodiments of the present application is shown in the figure;

[0025] Figure 4 A fourth embodiment of the method for generating a regular expression for inquiry diagnosis in the embodiments of the present application is shown in the figure;

[0026] Figure 5 An embodiment of the device for generating a regular expression for inquiry diagnosis in the embodiments of the present application is shown in the figure;

[0027] Figure 6 Another embodiment of the device for generating a regular expression for inquiry diagnosis in the embodiments of the present application is shown in the figure;

[0028] Figure 7 An embodiment of the equipment for generating a regular expression for inquiry diagnosis in the embodiments of the present application is shown in the figure. DETAILED DESCRIPTION

[0029] The embodiments of the present application provide a method, device and equipment for generating a regular expression for inquiry diagnosis and a storage medium. The model is used to extract features from inquiry data, thereby fundamentally avoiding the risk of inaccurate identification caused by human recognition features. The machine is inherently not sensitive to time, and the more data, the more perfect the regular expression generated by the intelligent regular expression system. Meanwhile, the regular expression is generated by constructing a co-occurrence matrix based on the inquiry data, and the feature vectorization processing is performed based on the co-occurrence matrix, thereby generating the regular expression. The expression generated in this way makes the extracted disease features and the diagnosis results more consistent, and further improves the accuracy of the regular expression.

[0030] The terms "first", "second", "third", "fourth" and the like in the description and in the claims of the present application, and above-described drawings, if any, are used to distinguish between similar objects and are not necessarily used to describe a particular sequential or chronological order. It is to be understood that the use of the terms so-termed, where appropriate, can be interchanged with each other to the extent that the embodiments described herein can be carried out in other sequences than those illustrated or described herein. Moreover, the terms "comprise" or "have" and any variations thereof are intended to cover a non-exclusive inclusion, for example, a process, method, system, product or apparatus that includes a list of steps or units not necessarily limited to those explicitly listed, but can include other steps or units not expressly listed or inherent to such processes, methods, products or apparatuses.

[0031] For the sake of understanding, the specific flow of the embodiments of the present application is described below, please refer to Figure 1 The first embodiment of the regular expression generation method in the embodiments of the present application, the implementation steps of the method are as follows:

[0032] 101, obtain a plurality of inquiry data and corresponding diagnosis results, and label the corresponding inquiry data based on the diagnosis results to obtain an expression generation sample set;

[0033] In this embodiment, for the acquisition of inquiry data and corresponding diagnosis results, it can be collected from a medical platform on the basis of authorization, such as a triage system in a hospital. Under the authorization of the hospital or the patient, the data reading interface in the triage system is requested to establish a communication connection with the current regular expression generation system according to the interface scheduling instruction. Based on the communication connection, the triage record after triage is read from the data storage area in the triage system according to the pre-handshake negotiated communication protocol. The inquiry data and diagnosis results in the inquiry record are extracted by data extraction technology. Preferably, the inquiry data is extracted as corpus data, and the diagnosis result is extracted from the triage record.

[0034] Further, after the corpus data and diagnosis results are extracted, the corresponding inquiry data (i.e. corpus data) is marked by data dotting recording method to obtain marked data, that is, expression generation sample set.

[0035] In practical application, the inquiry data can be a standard inquiry form, or an audio file such as user's voice. When it is an audio file, the audio file obtained is first converted into text information by voice recognition technology, and then the text information is processed by word standardization to obtain a standard written text. For example, different regions may have different descriptions for the same object. By recognizing the semantics of the words, the standard word expression is modified based on the semantics to obtain the standard inquiry data.

[0036] 102. Using a pre-defined disease knowledge graph recognition model, extract disease features from each sample in the expression generation sample set to generate a feature set for each sample.

[0037] In this step, the disease knowledge graph recognition model is a model generated in advance by deep learning algorithms on the triaged consultation data or the confirmed diagnosis records. The model learns according to the relationship between the diagnosis results and the characteristics of the disease.

[0038] In practical applications, when using this model to extract features from expression-generated samples, the diagnostic results are first input into the disease knowledge graph recognition model to set the model parameters. Then, based on the set model, features are identified in the sample set corresponding to the diagnostic results, and extracted to form separate feature subsets. After extracting features from all samples in the sample set corresponding to the diagnostic results, all feature subsets are merged to form a feature set.

[0039] In this embodiment, this step can also be implemented in the following ways:

[0040] The samples in the expression-generated sample set are classified, specifically based on the labels in the samples, which correspond to the diagnostic results. By identifying the labels, all samples with the same label are grouped into one category, resulting in multiple sample subsets. Then, the model is used to extract features from the samples in each sample subset. During the extraction process, the diagnostic results corresponding to the sample subsets are first determined, and the configuration parameters of the model are determined based on the diagnostic results. The parameters of the disease knowledge graph recognition model are configured according to the configuration parameters. After configuration, each sample in the sample subset is sequentially input into the model. The model identifies keywords and extracts features that match the diagnostic results, then outputs feature subsets, with one feature subset corresponding to one sample. After processing all samples in the sample subsets, the feature subsets are merged into multiple feature sets, forming a large feature set that is consistent with the expression-generated sample set.

[0041] 103. Generate a co-occurrence matrix based on the feature sets of all samples, and calculate the combination frequency between each disease feature in the co-occurrence matrix;

[0042] In this step, when generating the co-occurrence matrix, each diagnosis result corresponds to one co-occurrence matrix. The co-occurrence matrix contains multiple combinations of disease features that represent the same result. The specific steps for generating the co-occurrence matrix are as follows: First, the disease features in each sample within a subset of samples are combined to obtain a subset of combinations. Then, the number of identical disease feature combinations within this subset is counted to categorize and statistically analyze the disease feature combinations, obtaining the frequency of each combination. The co-occurrence matrix is ​​then constructed using the frequencies and the disease features within the combinations. For example, if a disease feature combination includes two disease features: menstruation and abdominal pain, then menstruation and abdominal pain are used as the row and column elements of the matrix, respectively, and the frequencies are used as the matrix content, thus constructing a co-occurrence matrix.

[0043] Based on the co-occurrence matrix, the total number of disease feature combinations existing in the co-occurrence matrix is ​​counted. Then, the frequency of each disease feature combination is divided by the total number to obtain the combination frequency of the corresponding disease feature combination.

[0044] 104. Select disease feature combinations that meet the preset values ​​from the combination frequencies, perform vectorization processing, and generate corresponding regular expressions based on the vectorized feature combinations.

[0045] In this step, disease feature combinations in each co-occurrence matrix are filtered out, and several disease feature combinations whose combination frequency meets the preset value are selected to form disease features corresponding to the diagnosis results. Then, the disease feature combinations are vectorized by the eigenvectorization algorithm to obtain vector combinations, and the vector combinations are converted into regular expressions.

[0046] In practical applications, a diagnosis result may correspond to multiple combinations of disease features. In this case, when generating the regular expression, this step specifically involves filtering out the common and different features in the vector combinations, generating a regular expression based on the common features, and then using the different features as condition variables for the regular expression to obtain the regular expression corresponding to the co-occurrence matrix.

[0047] By implementing the above method, features are first extracted from the consultation data through a model, fundamentally avoiding the risk of inaccuracy caused by human feature recognition. Machines are inherently insensitive to time, and the more data there is, the more perfect the regular expressions generated by the intelligent regular expression system become. In addition, the regular expression is generated by constructing a co-occurrence matrix from the consultation data and performing feature vectorization based on the co-occurrence matrix. The expression generated in this way makes the extracted symptom features more consistent with the diagnostic results, further improving the accuracy of the regular expression.

[0048] Please see Figure 2 The second embodiment of the method for generating regular expressions for patient consultation in this invention includes:

[0049] 201, acquire a plurality of interrogation data and corresponding diagnosis results;

[0050] 202, according to the diagnosis result, query the label corresponding to the diagnosis result from the preset diagnosis label table;

[0051] In this step, the corresponding label is configured in the triage system for different detection subjects, and the triage sheet is quickly identified through the label, so as to distribute the triage sheet to the corresponding examination clinic. In actual application, after determining the diagnosis result, the label corresponding to the current diagnosis result is queried from the relationship table of labels and diagnosis results in the triage system based on the diagnosis result. Specifically, the label can be a seal, a color identification, or even a combination of color and symbol.

[0052] 203, determine the interrogation data corresponding to the diagnosis result, and set the label mark on each character in the interrogation data by using Chinese mark algorithm to obtain marked data;

[0053] In this embodiment, the corresponding interrogation data is selected from a plurality of interrogation data according to the diagnosis result, and then the selected interrogation data is marked by using Chinese mark algorithm, such as text color matching rule, to obtain marked data.

[0054] For example, the algorithm controls the triage system to adjust the font display color of the text of the interrogation data to the color corresponding to the color indicated in the label. If there is also a mark symbol, the mark symbol is also marked on each character.

[0055] Further, if the interrogation data is an audio file, the label setting of the interrogation data includes: converting the audio file into text by using voice conversion technology, marking the text according to the specific content of the label, such as setting a seal on the entire text, and also setting the color of the text, so as to output the marked data.

[0056] 204, classify all the marked data according to the label to generate a plurality of marked data subsets;

[0057] In this step, the classification is to merge the labels in all the marked data, and obtain a marked data subset;

[0058] In this step, after marking the interrogation data, in order to improve the consistency of the data, the marked data after marking is also classified according to the label. In fact, the expression generation sample is classified according to the diagnosis result, and the same kind is merged together, so as to obtain a plurality of marked data subsets.

[0059] In practical application, the labeled data is clustered by using the clustering algorithm to obtain a subset of the labeled data.

[0060] 205, generating an expression sample set from the plurality of subsets of labeled data;

[0061] In this step, the corresponding relationship of the labels of the plurality of subsets of labeled data is set to form a data table, the data table includes a table header, the table header is set by a label, and the content under the table header is labeled data, so that a data corresponding relationship table is obtained, and an expression sample set is generated.

[0062] 206, extracting a disease feature of each sample in the expression sample set by using a preset disease knowledge graph recognition model to generate a feature set of each sample;

[0063] In this step, the disease knowledge graph recognition model includes a stop word recognition network and a disease recognition network, the stop word recognition network is a recognition network formed by learning the medical field jargon based on a neural network, and the so-called stop word refers to an auxiliary word without actual information, for example, in the sentence "Doctor, hello, I need to see a doctor, please help me to make an appointment", in addition to "see a doctor" and "make an appointment", which are useful information words, the others can be used as stop words, therefore, there are many stop words in a sentence, the combination of words is selected according to different scenes to determine the semantic of the words, so that the stop words are recognized and the past is obtained, and the final disease feature is obtained.

[0064] 207, generating a co-occurrence matrix according to the feature set of all samples, and calculating the combination frequency between the disease features in the co-occurrence matrix;

[0065] 208, screening the disease feature combination satisfying the preset value in the combination frequency for vectorization processing, and generating a corresponding regular expression based on the vectorized feature combination.

[0066] Through the implementation of the above-mentioned mode, the disease knowledge graph model is used to extract the disease features in the labeled data, which avoids the understanding deviation caused by manual extraction, so that the generated expression is not accurate enough for the recognition of the diagnosis result, and the matrix and vectorization processing are used, so that the extracted disease features are more consistent with the diagnosis result.

[0067] Please refer to Figure 3 The third embodiment of the inquiry regular expression generation method in the embodiment of the application includes:

[0068] 301, obtaining a plurality of inquiry data and corresponding diagnosis results;

[0069] 302, according to the diagnostic result, a label corresponding to the diagnostic result is queried from a preset diagnostic label table, and all the label data is classified based on the label to generate a plurality of label data subsets;

[0070] In this step, specifically, a label corresponding to the diagnostic result is queried from a preset diagnostic label table according to the diagnostic result, and then the interrogation data corresponding to the diagnostic result is determined, the Chinese marking algorithm is used to set a label mark for each word in the interrogation data to obtain label data, and all the label data is classified according to the label to generate a plurality of label data subsets.

[0071] 303, according to the Chinese grammar rules, the label data in each label data subset is analyzed separately to determine the main content and the non-main content of the label data subset;

[0072] 304, the non-main content is removed from the label data in the corresponding label data subset by using a word segmentation tool, and after all the label data subsets complete the removal of the non-main content, an expression sample set is generated;

[0073] In actual application, the main content and the non-main content can be extracted by the following method:

[0074] According to the Chinese grammar rules, the label data in each label data subset is subjected to word segmentation processing to obtain the words and corresponding parts of speech of the label data subset;

[0075] According to the grammar rules and the words and corresponding parts of speech in the label data subset, the label data in the label data subset is analyzed to obtain the sentence structure of the label data subset.

[0076] According to the sentence structure, the main content and the non-main content of each label data in the label data subset are extracted.

[0077] Then, according to the main content and the non-main content, the content is removed to obtain the final expression sample set.

[0078] 305, the semantic recognition of each word in the main content of the label data subset is performed by using a stop word recognition network, and based on the recognition result, the words without obvious semantics are screened out for marking to obtain marked main content;

[0079] 306, the words without obvious semantics in the marked main content are deleted by using an analysis technology to obtain sample word segmentation;

[0080] 307, the feature set of the label data subset is obtained by performing disease feature recognition and segmentation on the sample word segmentation by using a disease recognition network;

[0081] In practical applications, the stop word recognition network is specifically obtained through neural network learning according to the stop words in the professional field, and the stop words such as doctor, hello, see a doctor, I, often, and sometimes are words that often appear in medical diagnosis but have no obvious characteristic meaning, so as to avoid interference of messy information in feature extraction. Specifically, the stop word recognition network actually identifies the word segmentation based on the stop words learned in the network after the sample in the marked data subset is processed through the word segmentation tool, and marks the recognized stop words to retain the features, and obtains the marked main content.

[0082] Further, the semantic recognition technology is used for semantic matching and recognition of the marked main content, and specifically, the words in the medical scene are matched according to the dictionary

[0083] In practical applications, the disease recognition network can be a recognition model or a knowledge graph. If it is a knowledge graph, the features in the sample word segmentation are matched with the features in the knowledge graph one by one to identify and extract the feature set.

[0084] 308. Generate a co-occurrence matrix according to the feature set of all samples, and calculate the combination frequency between the disease features in the co-occurrence matrix.

[0085] In this step, when generating the co-occurrence matrix and calculating the combination frequency of the features, the following methods can be used:

[0086] According to the disease features in the feature set of each marked data subset, a corresponding matrix table is constructed, wherein the matrix table includes a list header and a matrix content table, and the list header and the row header in each matrix table include all disease features in the feature set of the corresponding marked data subset.

[0087] The number of times that the disease feature combination of the list header and the row header in each marked data subset appears in the same marked data is counted and added to the corresponding matrix content table to obtain the co-occurrence matrix of each marked data subset.

[0088] The number of times is calculated to obtain the combination frequency of the corresponding disease feature combination.

[0089] 309. Screen the disease feature combinations in the combination frequency that meet the preset value for vectorization processing, and generate a corresponding regular expression based on the vectorized feature combinations.

[0090] In the embodiment of the application, steps 308-309 are consistent with steps 103-104 in the first embodiment of the above-mentioned diagnosis regular expression generation method, and will not be repeated here.

[0091] In summary, the method provided by the above embodiments realizes automatic generation of regular expressions, uses a disease knowledge graph recognition model to label and extract features from sample data, generates a matrix from the extracted features, performs vectorization processing on the matrix to obtain a vector, and generates a regular expression based on the vector. The combination of recognition and vectorization processing makes the extracted disease features more consistent with the diagnosis results, further improving the accuracy of the regular expression.

[0092] Please refer to Figure 4 The fourth embodiment of the inquiry regular expression generation method in the embodiments of the present application includes:

[0093] 401, obtain a plurality of inquiry data and corresponding diagnosis results, and label the corresponding inquiry data based on the diagnosis results to obtain an expression generation sample set;

[0094] 402, use a preset disease knowledge graph recognition model to extract disease features from each sample in the expression generation sample set to generate a feature set for each sample;

[0095] 403, generate a co-occurrence matrix according to the feature sets of all samples, and calculate the combination frequency between the disease features in the co-occurrence matrix;

[0096] 404, sort all disease feature combinations in each co-occurrence matrix in descending order of combination frequency, and select the top N disease feature combinations as the diagnostic feature combinations of the diagnosis result corresponding to the co-occurrence matrix, N is an integer greater than 1;

[0097] 405, vectorize each disease feature in the diagnostic feature combination to obtain a feature vector;

[0098] 406, generate a corresponding regular expression according to the feature vector.

[0099] The above method will be described in conjunction with a specific example:

[0100] For example, the inquiry real corpus of dysmenorrhea inquiry data:

[0101] "I often have abdominal pain after menstruation;

[0102] Hello doctor, I want to ask how to deal with the unbearable pain in the lower abdomen during menstruation every time;

[0103] "Menstrual pain is unbearable";

[0104] The feature keywords after word segmentation are "menstruation, belly, pain, pain, lower abdomen", and a co-occurrence matrix is generated from these keywords, as shown in the following table:

[0105] counts menstrual tummy ache pain lower abdomen menstrual 0 1 3 1 1 tummy 1 0 1 1 0 ache 3 1 0 1 0 pain 2 1 1 0 1 lower abdomen 1 0 0 1 0

[0106] Through the co-occurrence matrix, it can be easily obtained that the high-frequency combination has (menstruation, pain);

[0107] Through simple screening, we can obtain an important common feature of the dysmenorrhea inquiry, which is

menstruation pain

[0108] The

menstruation pain

[0109] Further, in order to ensure the accuracy of the generated regular expression, after generating the regular expression, the manually generated regular expression is obtained to quality check the automatically generated regular expression.

[0110] The quality checking process usually includes the following steps:

[0111] The developer screens the inquiry data matched by the generated regular expression;

[0112] The doctor manually screens the matching error data according to the screened inquiry data;

[0113] The developer revises and supplements the regular expression according to the doctor's quality checking result, and then re-screen the new inquiry data, and repeat the manual screening and verification operation until the quality checker considers that the accuracy meets the standard, and then the regular expression is online.

[0114] Through the implementation of the above-mentioned scheme, all of which are completed by machine learning, not only the efficiency is improved by orders of magnitude, but also the more the amount of labeled data used to generate the regular expression, the more obvious the advantage of the artificial regular.

[0115] Further, the model extracts features from the inquiry data, fundamentally avoiding the inaccuracy risk caused by human recognition features. The machine is inherently not sensitive to time, and the more data, the more perfect the regular generated by the intelligent regular expression system. Meanwhile, the regular expression is generated by constructing a co-occurrence matrix based on the inquiry data, and the feature vector is processed based on the co-occurrence matrix, so that the expression generated in this way makes the extracted disease features more consistent with the diagnosis results, further improving the accuracy of the regular expression.

[0116] The inquiry regular expression generation method in the embodiment of the application is described above, and the inquiry regular expression generation device in the embodiment of the application is described below. Please refer to Figure 5 An embodiment of the inquiry regular expression generation device in the embodiment of the application includes:

[0117] The labeling module 501 is configured to obtain a plurality of inquiry data and corresponding diagnostic results, and label the corresponding inquiry data based on the diagnostic results to obtain an expression generation sample set.

[0118] The extraction module 502 is configured to use a preset disease knowledge graph recognition model to extract disease characteristics of each sample in the expression generation sample set to generate a feature set of each sample.

[0119] The calculation module 503 is configured to generate a co-occurrence matrix according to the feature sets of all samples, and calculate a combination frequency between disease characteristics in the co-occurrence matrix.

[0120] The generation module 504 is configured to filter disease characteristic combinations in the combination frequency that meet a preset value for vectorization processing, and generate a corresponding regular expression based on the vectorized characteristic combinations.

[0121] In the embodiment, the sample data is labeled and the features are extracted by using the disease knowledge graph recognition model, a matrix is generated from the extracted features, a vector is obtained by vectorization processing through the matrix, a regular expression is generated based on the vector, and the extracted disease characteristics are more consistent with the diagnostic results by combining recognition and vectorization processing, so that the accuracy of the regular expression is further improved.

[0122] Please refer to Figure 6 Another embodiment of the inquiry regular expression generation device in the embodiment includes:

[0123] The labeling module 501 is configured to obtain a plurality of inquiry data and corresponding diagnostic results, and label the corresponding inquiry data based on the diagnostic results to obtain an expression generation sample set.

[0124] The extraction module 502 is configured to use a preset disease knowledge graph recognition model to extract disease characteristics of each sample in the expression generation sample set to generate a feature set of each sample.

[0125] The calculation module 503 is configured to generate a co-occurrence matrix according to the feature sets of all samples, and calculate a combination frequency between disease characteristics in the co-occurrence matrix.

[0126] The generation module 504 is configured to filter disease characteristic combinations in the combination frequency that meet a preset value for vectorization processing, and generate a corresponding regular expression based on the vectorized characteristic combinations.

[0127] In the embodiment, the labeling module 501 includes:

[0128] The query unit 5011 is configured to query a label corresponding to the diagnostic result from a preset diagnostic label table according to the diagnostic result.

[0129] The tagging unit 5012 is used to determine the consultation data corresponding to the diagnosis result, and to set the tag on each character in the consultation data using a Chinese tagging algorithm to obtain the tagged data;

[0130] The classification unit 5013 is used to classify all the labeled data according to the label and generate multiple subsets of labeled data, wherein the classification is to merge all the labeled data with the same label to obtain a subset of labeled data;

[0131] The sample generation unit 5014 is used to generate an expression sample set from multiple subsets of labeled data.

[0132] In this embodiment, the sample generation unit 5014 is specifically used to: analyze the marked data in each marked data subset separately according to Chinese grammar rules, determine the main content and non-main content of the marked data subset; use a word segmentation tool to remove the non-main content from the marked data in the corresponding marked data subset, until all marked data subsets have been removed of non-main content, and then generate an expression sample set.

[0133] In this embodiment, the sample generation unit 5014 is specifically used for: performing word segmentation on the marked data in each marked data subset according to Chinese grammar rules to obtain the words and corresponding parts of speech of the marked data subset; performing sentence structure analysis on the marked data in the marked data subset according to the grammar rules and the words and corresponding parts of speech of the marked data subset to obtain the sentence structure of the marked data subset; and extracting the main content and non-main content of each marked data in the marked data subset according to the sentence structure.

[0134] In this embodiment, the disease knowledge graph recognition model includes a stop word recognition network and a symptom recognition network, and the extraction module 502 includes:

[0135] The identification unit 5021 is used to perform semantic recognition on each word in the main content of the labeled data subset using the stop word recognition network, and to filter out words without obvious semantics based on the recognition results to label them, thereby obtaining the labeled main content.

[0136] Extraction unit 5022 is used to delete words without obvious semantic meaning in the labeled main content using analysis technology to obtain sample word segmentation;

[0137] The segmentation unit 5023 is used to identify and segment the disease features of the sample word segmentation through the disease recognition network to obtain the feature set of the labeled data subset.

[0138] In the embodiment, the computing module 503 comprises:

[0139] a constructing unit 5031 configured to construct a corresponding matrix table according to the disease features in the feature set of each of the labeled data subsets, wherein the matrix table comprises a list header and a matrix content table, and the list header and the row header in each of the matrix tables comprise all the disease features in the feature set of the corresponding labeled data subset;

[0140] a statistical unit 5032 configured to count the number of times that the disease feature combination of the list header and the row header in each of the labeled data subsets appears in the same labeled data, and add the number of times to the corresponding matrix content table to obtain a co-occurrence matrix of each of the labeled data subsets;

[0141] a computing unit 5033 configured to calculate the combination frequency of the corresponding disease feature combination according to the number of times.

[0142] In the embodiment, the generating module 504 comprises:

[0143] a sorting unit 5041 configured to sort all the disease feature combinations in each of the co-occurrence matrices in descending order of the combination frequency, and select the top N disease feature combinations as the diagnostic feature combinations of the diagnostic result corresponding to the co-occurrence matrix, N being an integer greater than 1;

[0144] a vectorization unit 5042 configured to perform vectorization processing on each of the disease features in the diagnostic feature combinations to obtain a feature vector;

[0145] an expression generating unit 5043 configured to generate a corresponding regular expression according to the feature vector.

[0146] Through the implementation of the above method, the disease features are extracted from the collected labeled data, the co-occurrence matrix is constructed based on the disease features, the feature combinations with higher combination frequency are selected from the co-occurrence matrix as the feature combinations corresponding to the diagnostic result, the selected feature combinations are then vectorized, and finally the regular expression is generated based on the vectorized feature combinations. In this way, the automatic generation of the regular expression is realized, the disease knowledge graph model is used to extract the disease features from the labeled data, and the phenomenon that the generated expression is not accurate enough for the recognition of the diagnostic result due to the understanding bias caused by manual extraction is avoided.

[0147] Please refer to Figure 7 , and the following will describe one embodiment of the inquiry regular expression generation device in the embodiment from the perspective of hardware processing.

[0148] Figure 7Fig. 7 is a schematic diagram of an embodiment of a diagnosis regular expression generation device. The diagnosis regular expression generation device 700 can vary in configuration and performance, and can include one or more central processing units (CPUs) 710 (e.g., one or more processors) and a memory 720, and one or more storage media 730 (e.g., one or more mass storage devices) storing applications 733 or data 732. The memory 720 and the storage media 730 can be volatile or non-volatile storage. The programs stored in the storage media 730 can include one or more modules (not shown in the figure), each of which can include a series of instructions for operating the diagnosis regular expression generation device 700 based on user demand prediction based on routing. Further, the processor 710 can be configured to communicate with the storage media 730 and execute the series of instructions in the storage media 730 on the diagnosis regular expression generation device 700.

[0149] The diagnosis regular expression generation device 700 can further include one or more power supplies 740, one or more wired or wireless network interfaces 750, one or more input / output interfaces 760, and / or one or more operating systems 731, such as Windows Server, Mac OS X, Unix, Linux, FreeBSD, etc. Those skilled in the art will understand that the diagnosis regular expression generation device structure shown is not intended to limit the diagnosis regular expression generation device, and can include more or fewer components than shown, or combine certain components, or arrange the components differently. Figure 7 The diagnosis regular expression generation device structure shown is not intended to limit the diagnosis regular expression generation device, and can include more or fewer components than shown, or combine certain components, or arrange the components differently.

[0150] The blockchain referred to in the present application is a new application mode of distributed data storage, peer-to-peer transmission, consensus mechanism, encryption algorithm and other computer technologies. The blockchain is essentially a decentralized database, and is a series of data blocks associated using cryptographic methods, each of which contains a batch of information for verifying the validity (anti-fake) of the information and generating the next block. The blockchain can include a blockchain underlying platform, a platform product service layer, and an application service layer.

[0151] The present application also provides a computer readable storage medium, which can be a non-volatile computer readable storage medium, and can also be a volatile computer readable storage medium. The computer readable storage medium has instructions stored therein, and when the instructions are run on a computer, the computer executes the steps of the diagnosis regular expression generation method.

[0152] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described devices and units can refer to the corresponding processes in the foregoing method embodiments, and will not be described here again.

[0153] The integrated unit, if implemented in the form of a software function unit and sold or used as an independent product, can be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the present application or the whole or part of the technical solutions that essentially contribute to the prior art can be embodied in the form of a software product. The computer software product is stored in a storage medium, and includes a plurality of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in the various embodiments of the present application. The foregoing storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and various program code storage media.

[0154] The above-described embodiments are only used to illustrate the technical solutions of the present application, rather than limit them; although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that: it can still modify the technical solutions recorded in the foregoing embodiments, or make equivalent replacement for part of the technical features; and these modifications or replacements do not make the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims

1. A method for generating a consultation regular expression, characterized by, The interrogation regular expression generation method comprises: Obtaining a plurality of interrogation data and corresponding diagnostic results, and labeling the corresponding interrogation data based on the diagnostic results to obtain an expression generation sample set; Using a preset disease knowledge graph recognition model to extract the disease characteristics of each sample in the expression generation sample set to generate a feature set of each sample; Generating a co-occurrence matrix according to the feature set of each sample, wherein one diagnostic result corresponds to one co-occurrence matrix, and calculating the combination frequency between the disease characteristics in the co-occurrence matrix; Screening disease characteristic combinations in the combination frequency that meet a preset value for vectorization processing, and generating a corresponding regular expression based on the vectorized characteristic combinations; The labeling of the corresponding interrogation data based on the diagnostic results to obtain an expression generation sample set comprises: According to the diagnostic result, querying the label corresponding to the diagnostic result from the preset diagnostic label table; Determine the interrogation data corresponding to the diagnostic result, and set the label of each word in the interrogation data using a Chinese marking algorithm to obtain marked data; Classify all the marked data according to the label to generate a plurality of marked data subsets, wherein the classification is to combine the marked data with the same label in all the marked data to obtain a marked data subset; Generating an expression generation sample set from a plurality of marked data subsets; The generating of an expression generation sample set from a plurality of marked data subsets comprises: According to the Chinese grammar rules, separately analyze the marked data in each marked data subset to determine the subject content and non-subject content of the marked data in the marked data subset; Using a word segmentation tool to remove the non-subject content from the marked data in the corresponding marked data subset until all the marked data in the marked data subsets are removed from the non-subject content to generate an expression generation sample set; The disease knowledge graph recognition model comprises a stop word recognition network and a disease recognition network, and the use of the preset disease knowledge graph recognition model to extract the disease characteristics of each sample in the expression generation sample set to generate a feature set of each sample comprises: Using the stop word recognition network to recognize the semantics of each word in the subject content of each marked data in the marked data subset, and based on the recognition result, screening out the words without obvious semantics for labeling to obtain the labeled subject content; Using an analysis technique to delete the words without obvious semantics in the labeled subject content to obtain sample segmentation; Through the disease recognition network, the sample segmentation is recognized and segmented for disease characteristics to obtain the feature set of each sample.

2. The interrogation regular expression generation method of claim 1, wherein, The separate analysis of the marked data in each marked data subset according to the Chinese grammar rules to determine the subject content and non-subject content of the marked data in the marked data subset comprises: According to the Chinese grammar rules, the marked data in each marked data subset is segmented to obtain the words and corresponding parts of speech of the marked data in the marked data subset; According to the syntax rule and the word and corresponding part of speech of the marked data in the marked data subset, the marked data in the marked data subset is parsed to obtain the syntax structure of the marked data in the marked data subset; According to the syntax structure, the subject content and the non-subject content of each marked data in the marked data subset are extracted.

3. The interrogation regular expression generation method of claim 1, wherein, The generating of the co-occurrence matrix according to the feature set of each sample and the calculation of the combination frequency between the disease features in the co-occurrence matrix include: According to the disease features in the feature set of each sample, a corresponding matrix table is constructed, wherein the matrix table includes a matrix table header and a matrix content table, and the matrix table header includes a list header and a row header, and each matrix table header and row header contains all disease features in the feature set of the corresponding sample; The number of times of the disease feature combination of the list header and the row header of each matrix table appearing in the same sample is counted and added to the corresponding matrix content table to obtain the co-occurrence matrix of the feature set of each sample; The number of times is calculated to obtain the combination frequency of the corresponding disease feature combination.

4. The interrogation regular expression generation method of claim 3, wherein, The screening of the disease feature combination satisfying the preset value in the combination frequency for vectorization processing and the generation of the corresponding regular expression based on the vectorized feature combination include: All disease feature combinations in each co-occurrence matrix are sorted in descending order of combination frequency, and the top N disease feature combinations are selected as the diagnostic feature combinations of the corresponding diagnostic result of the co-occurrence matrix, N is an integer greater than 1; Each disease feature in the diagnostic feature combination is vectorized to obtain a feature vector; According to the feature vector, a corresponding regular expression is generated.

5. An interrogation regular expression generation apparatus characterized by comprising: The inquiry regular expression generation device includes: The labeling module is configured to obtain a plurality of inquiry data and corresponding diagnostic results, and label the corresponding inquiry data based on the diagnostic results to obtain an expression generation sample set; The extraction module is configured to use a preset disease knowledge graph recognition model to extract disease features from each sample in the expression generation sample set to generate a feature set of each sample; The calculation module is configured to generate a co-occurrence matrix according to the feature set of each sample, wherein one diagnostic result corresponds to one co-occurrence matrix, and the combination frequency between the disease features in the co-occurrence matrix is calculated; The generation module is configured to screen the disease feature combination satisfying the preset value in the combination frequency for vectorization processing, and generate a corresponding regular expression based on the vectorized feature combination; The labeling module is further configured to query a label corresponding to the diagnostic result from a preset diagnostic label table according to the diagnostic result; The inquiry data corresponding to the diagnostic result is determined, and a Chinese marking algorithm is used to set a mark of the label on each word in the inquiry data to obtain marked data; All the marked data is classified according to the label to generate a plurality of marked data subsets, wherein the classification is to combine the marked data with the same label to obtain a marked data subset; The plurality of marked data subsets are generated into an expression generation sample set; The labeling module is further configured to separately analyze the labeled data in each labeled data subset according to Chinese grammar rules, and determine subject content and non-subject content of the labeled data in the labeled data subset; The non-subject content is removed from the labeled data in the corresponding labeled data subset by using a word segmentation tool, until the labeled data in all labeled data subsets are completed to remove the non-subject content, and an expression generation sample set is generated; The extraction module is further configured to perform semantic identification on each word in the subject content of the labeled data in each labeled data subset by using the stop word identification network, and filter out words without obvious semantics based on the identification result to obtain labeled subject content; The words without obvious semantics in the labeled subject content are deleted by using an analysis technique to obtain sample word segmentation; The sample word segmentation is subjected to disease feature identification and segmentation by using the disease identification network to obtain a feature set of each sample.

6. An interrogation regular expression generation device, characterized by, The inquiry regular expression generation device includes a memory and at least one processor, and the memory stores instructions; The at least one processor invokes the instructions in the memory, so that the inquiry regular expression generation device performs the inquiry regular expression generation method in any one of claims 1-4.

7. A computer-readable storage medium having stored thereon a computer program, characterized in that The computer program is executed by the processor to implement the inquiry regular expression generation method in any one of claims 1-4.

Citation Information

Patent Citations

  • User corpus semantic understanding method and system

    CN109766453A

  • Regular expression obtaining method and device, electronic equipment and storage medium

    CN110472031A

  • Quick text classification method for corpus

    CN112328790A

  • Inquiry method, device and equipment based on text recognition and storage medium

    CN112509682A