A scoring system for the electronic medical record question-answering model

By scoring the electronic medical record question and answer model based on different dimensions, the problem of low scoring accuracy in the existing technology is solved and higher scoring accuracy is achieved.

CN117520126BActive Publication Date: 2024-08-27SINGULARITY OF LIFE (BEIJING) TECH CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311518059.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-11-14
Publication Date
2024-08-27
Estimated Expiration
2043-11-14

AI Technical Summary

Technical Problem

When the existing technology scores the electronic medical record question and answer model, it fails to judge the results output by the model and does not score based on different dimensions, resulting in reduced scoring accuracy.

Method used

By obtaining the initial electronic medical record question and answer model, inputting the preset text set, generating the initial text and text vector set, calculating the similarity list and keyword set, scoring based on the similarity and keyword similarity, and scoring when the threshold conditions are met. Score models based on different dimensions.

Benefits of technology

The scoring accuracy of the electronic medical record question and answer model is improved, making the scoring results more accurate and reliable.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117520126B
    Figure CN117520126B
Patent Text Reader

Abstract

The present invention is a scoring system for an electronic medical record question and answer model, comprising a sample electronic medical record information set, a second preset text set, a processor and a memory storing a computer program. When the computer program is executed by the processor, the following steps are implemented: according to the sample electronic medical record information set, an initial electronic medical record question and answer model is obtained, the second preset text set is input into the initial electronic medical record question and answer model, a first initial text set is obtained, a first initial text vector set is obtained, a second initial text set and a second initial text vector set are obtained, a first similarity list is obtained, according to the first initial keyword set and the second initial keyword set, a second similarity list is obtained, and a candidate priority corresponding to the initial electronic medical record question and answer model is obtained. The present invention judges the result output by the model, scores when the result meets the threshold condition, and scores the model based on different dimensions, so that the accuracy of the obtained electronic medical record question and answer model score is higher.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of artificial intelligence technology, and in particular to a scoring system for an electronic medical record question-and-answer model. Background Art

[0002] With the continuous growth of medical business volume and the continuous development of artificial intelligence technology, the electronicization of medical records has become a trend. The models trained based on electronic medical records are becoming more and more diversified. However, after training the data to generate the model, the model needs to be scored. The strategy for scoring the model directly affects the quality of the model. Therefore, accurately scoring the electronic medical record question and answer model has become a hot research direction.

[0003] At present, in the prior art, the method for model scoring is: to generate a model based on inference based on a traditional machine learning model, input a test sample into the model, and calculate the similarity between the model output result and the real result corresponding to the test sample to achieve model scoring.

[0004] To sum up, there are problems with the method of scoring the model: the results of the model output are not judged, and the model is not scored based on different dimensions, which reduces the accuracy of the obtained electronic medical record question and answer model score. Summary of the invention

[0005] The present invention provides a scoring system for an electronic medical record question-and-answer model, comprising: a sample electronic medical record information set, a second preset text set, a processor, and a memory storing a computer program. When the computer program is executed by the processor, the following steps are implemented:

[0006] S100, sample electronic medical record information set, obtain the initial electronic medical record question-answering model.

[0007] S200, input the second preset text set into the initial electronic medical record question answering model, and obtain the first initial text set EW={EW1, ..., EW λ ,……,EW σ}, where EW λ is the λth first initial text, λ=1…σ, σ is the number of first initial texts.

[0008] S300, obtaining a first initial text vector set EW according to EW 0 ={EW 0 1, ..., EW 0 λ ,……,EW 0 σ}, E.W. 0 λ =(EW 0 λ1,……,EW 0 λγ ,……,EW 0 λη ), E.W. 0 λγ For EW λ The corresponding bit value of the γth bit in the first initial text vector, γ=1...η, η is the bit position of the first initial text vector.

[0009] S400, according to the first initial text set, obtain a second initial text set FW = {FW1, ..., FW λ , ..., FW σ}, where FW λ is the λth second initial text.

[0010] S500, according to FW, obtaining a second initial text vector set FW corresponding to FW 0 ={FW 0 1, ..., FW 0 λ , ..., FW 0 σ}, FW 0 λ =(FW 0 λ1 , ..., FW 0 λγ , ..., FW 0 λη ), FW 0 λγ For FW λ The corresponding bit value of the γth bit in the first initial text vector.

[0011] S600, according to EP 0 and FP 0 , obtain the first similarity list ΔW = {ΔW1, ..., ΔW λ , ..., ΔW σ}, where ΔW λ Meet the following conditions:

[0012]

[0013] S700, according to the EW, obtaining a first initial keyword set corresponding to the EW, wherein the first initial keyword set includes a plurality of first initial keyword lists, the first initial keyword list includes a first initial keyword, and the first initial keyword is a keyword in the first initial text.

[0014] S800, according to FW, obtain a second initial keyword set corresponding to FW, the second initial keyword set includes several second initial keyword lists, the second initial keyword list includes a second initial keyword, and the second initial keyword is a keyword in the second initial text.

[0015] S900, obtaining a first initial keyword set and a second initial keyword set, obtaining a second similarity list ΔV={ΔV1, . . . , ΔV λ , ..., ΔV σ}, where ΔV λ It is the similarity between the first initial keyword and the second initial keyword corresponding to the same second preset text.

[0016] S1000, obtaining a candidate priority KL corresponding to the initial electronic medical record question and answer model according to ΔW and ΔV, wherein KL is a score value of the initial electronic medical record question and answer model.

[0017] The present invention is a scoring system for an electronic medical record question-and-answer model, comprising a sample electronic medical record information set, a second preset text set, a processor, and a memory storing a computer program. When the computer program is executed by the processor, the following steps are implemented: according to the sample electronic medical record information set, an initial electronic medical record question-and-answer model is obtained, the second preset text set is input into the initial electronic medical record question-and-answer model, a first initial text set is obtained, according to the first initial text set, a first initial text vector set is obtained, according to the first initial text set, a second initial text set is obtained, according to the second initial text set, a second initial text vector set is obtained, according to the first initial text vector set and A second initial text vector set is used to obtain a first similarity list. According to the first initial text set, a first initial keyword set corresponding to the first initial text is obtained. According to the second initial text set, a second initial keyword set corresponding to the second initial text is obtained. According to the first initial keyword set and the second initial keyword set, a second similarity list is obtained. According to the first similarity list and the second similarity list, a candidate priority corresponding to the initial electronic medical record question and answer model is obtained. The present invention judges the result output by the model, scores the result when the result meets the threshold condition, and scores the model based on different dimensions, so that the accuracy of the obtained electronic medical record question and answer model score is higher. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0019] Figure 1A flowchart of an execution computer program of a scoring system for an electronic medical record question-and-answer model provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0020] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.

[0021] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention 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 interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product, or server that includes 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.

[0022] Example

[0023] A scoring system for an electronic medical record question-answering model, the system comprising: a sample electronic medical record information set, a second preset text set, a processor, and a memory storing a computer program. When the computer program is executed by the processor, the following steps are implemented: Figure 1 As shown:

[0024] S100, sample electronic medical record information set, obtain the initial electronic medical record question-answering model.

[0025] Specifically, S100 also includes the following steps:

[0026] S1001, obtaining a specified text vector set according to a sample electronic medical record information set.

[0027] Specifically, the sample electronic medical record information set includes several sample electronic medical record information, wherein the sample electronic medical record information is abnormal state characteristic information corresponding to the medical record obtained from the database, wherein the abnormal state characteristic information is characteristic information associated with the disease, such as abnormal sugar chain glycoprotein tap in detection abnormality, nasopharynx presenting poorly differentiated squamous cell carcinoma and other abnormal state characteristic information.

[0028] Furthermore, those skilled in the art know that any public medical database that can obtain cases can be selected according to actual needs, all of which fall within the protection scope of the present invention and will not be described in detail again.

[0029] Furthermore, the data format of the sample electronic medical record information includes text format and table format.

[0030] Specifically, the system also includes a target term knowledge graph, wherein the target term knowledge graph is in a triple form, wherein each triple form in the target term knowledge graph includes two entities related to the abnormal state and a relationship between the two entities related to the abnormal state.

[0031] Furthermore, those skilled in the art know that any method in the prior art for constructing a knowledge graph based on target terms falls within the scope of protection of the present invention and will not be described in detail herein.

[0032] Specifically, S1001 also includes the following steps:

[0033] S1, according to the sample electronic medical record information set, obtain the candidate text set A = {A1, ..., A i , ..., A n}, A i is the i-th candidate text, i=1...n, and n is the number of candidate texts.

[0034] Specifically, in S1, the candidate text is obtained through the following steps:

[0035] S11, when the data format of the sample electronic medical information is a text format, segment the sample electronic medical information according to segmentation symbols to generate candidate texts.

[0036] S13, when the data format of the sample electronic medical information is in a table format, each record in the sample electronic medical information and the field name corresponding to the record are integrated to generate a candidate text, which can be understood as: when the field name corresponding to each field in the sample electronic medical information is ID, biopsy site, and histological classification from left to right, and the content of a certain row in the sample electronic medical information is 008, nasopharynx, and squamous cell carcinoma from left to right, a candidate text is obtained: the biopsy site with ID 008 is nasopharynx, and the histological classification is squamous cell carcinoma.

[0037] S3, based on A and the target term knowledge graph, obtain the candidate keyword set Q corresponding to A = {Q1, ..., Q i , ..., Q n}, Q i A i The corresponding candidate keyword list.

[0038] Specifically, in S3, Q is obtained through the following steps: i :

[0039] S31, according to A, obtain the first intermediate word set B corresponding to A = {B1, ..., B i , ..., B n}, B i = {B i1 , ..., B ij , ..., B im(i)}, B ij A i The jth first middle word in the corresponding first middle word list, j=1...m(i), m(i) is A i The number of first intermediate words in the corresponding first intermediate word list.

[0040] Specifically, the first intermediate word is a word obtained from the candidate text, wherein those skilled in the art know that any method of extracting words from a text in the prior art falls within the protection scope of the present invention and will not be described in detail here.

[0041] S33, according to the target term knowledge graph, obtain the target word list D = {D1, ..., D r , ..., D s}, D r is the rth target word, r=1…s, s is the number of target words.

[0042] Specifically, the target word is an entity related to the abnormal state obtained from the target term knowledge graph.

[0043] S35, according to B and D, obtain the first intermediate similarity set F corresponding to B = {F1, ..., F i , ..., F n}, F i ={F i1 , ..., F ij , ..., F im(i)}, F ij ={F 1 i1 , ..., F r ij , ..., F s im(i)}, F r ij For B ij With D r The first intermediate similarity between .

[0044] Specifically, the first intermediate similarity is the similarity between the word vector corresponding to the first intermediate word and the word vector corresponding to the target word. Those skilled in the art know that any method of calculating the similarity between vectors in the prior art falls within the protection scope of the present invention and will not be repeated here.

[0045] Furthermore, the method for obtaining the word vector corresponding to the first intermediate word is to input the first intermediate word vector into a natural language processing model to obtain a vector corresponding to the word, wherein those skilled in the art know that any natural language processing model in the prior art that converts text into a vector falls within the protection scope of the present invention and will not be repeated here.

[0046] S37, when F r ij ≥F 0 When B ij Insert to Q i Among them, F 0 is a preset first intermediate similarity threshold.

[0047] Specifically, F 0 The value range of F is 0.8 to 0.9, wherein those skilled in the art know that F can be adjusted according to actual needs. 0 The selection of all falls within the protection scope of the present invention and will not be repeated here.

[0048] S5, according to A and Q, obtain the initial text set T = {T1, ..., T i , ..., T n}, T i ={A i , Q i}, T i is the i-th initial text.

[0049] Specifically, the initial text is a text obtained by concatenating the candidate text with the candidate keyword, with the candidate keyword concatenated after the candidate text.

[0050] S7, according to T, obtain the specified text set U = {U1, ..., U i , ..., U n},U i is the i-th specified text, wherein U is obtained in S7 by the following steps i :

[0051] S71, according to T i , get T i The corresponding text string WT i =(WT 0 i1 , ..., WT 0 ix, ..., WT 0 ip , WT 1 i1 , ..., WT 1 iy , ..., WT 1 iq ), WT 0 ix A i The corresponding x-th character, x=1...p, p is A i The number of corresponding text characters, WT 1 iy Q i The corresponding y-th character, y = 1...q, q is Q i The number of corresponding text characters.

[0052] S72, when p+q=K, obtain U i =T i , where K is the preset critical priority threshold.

[0053] Specifically, in S72, K is obtained through the following steps:

[0054] S721, according to T, obtain a key text type set C = {C1, ..., C d , ..., C z}, C d ={C d1 , ..., C dg , ..., C dh(d)}, C dg is the g-th key text in the d-th key text list, g=1...h(d), h(d) is the number of key texts in the d-th key text list, d=1...z, z is the number of key text types.

[0055] Specifically, the key text is the initial text obtained from T based on the text type corresponding to the initial text, wherein those skilled in the art know that any method for classifying text in the prior art falls within the protection scope of the present invention and will not be repeated here. For example, a method for classifying text by keywords in the text, wherein the text type is divided into text types corresponding to the initial text such as heart type and eye, nose and throat type.

[0056] S723, according to C, obtain a first text string quantity set C corresponding to C 0 ={C 0 1, ..., C 0 d , ..., C 0 z}, C 0d ={C 0 d1 , ..., C 0 dg , ..., C 0 dh(d)}, C 0 dg C dg The corresponding first text string number.

[0057] Specifically, the first number of text character strings is the number of text character strings corresponding to the key text.

[0058] S725, according to C 0 , get the second text string quantity set C corresponding to C 1 ={C 1 1, ..., C 1 d , ..., C 1 z}, C 1 d ={C 1 d1 , ..., C 1 du , ..., C 1 dh(d)}, C 1 du is the u-th second text in the second text string quantity list corresponding to the d-th type key text list, u=1...h(d), where C 1 d1 ≥……≥C 1 du ≥……≥C 1 dh(d) .

[0059] Specifically, the second number of text strings is the number of text strings acquired in descending order according to the first number of text strings.

[0060] Furthermore, the number of text strings is the number of character strings corresponding to the text.

[0061] S725, according to C 0 , get K, where K meets the following conditions:

[0062] Among them, C 1 dα is the number of text strings corresponding to the key text corresponding to the αth second text string number in the dth type key text list, and ε is a preset first quantity threshold.

[0063] Specifically, is an integer not greater than (h(d)×ε).

[0064] Specifically, the value range of ε is 0.85 to 1, wherein those skilled in the art know that ε can be selected according to actual needs, all of which fall within the protection scope of the present invention and will not be described in detail here.

[0065] In the above, the preset key priority threshold is obtained based on the type of key text and the number of text strings corresponding to each type of key text, so that the number of text strings corresponding to the initial text is unified. The unified number of text strings combined with the type of text ensures the comprehensiveness of the text corresponding to the specified text vector subsequently obtained. Setting the threshold based on the number of text strings corresponding to each type of key text improves the accuracy of the unified value of the number of text strings obtained. By setting the threshold reasonably, it can avoid the problem of missing text data due to too short text string length and the problem of reduced text data processing efficiency due to too long text string length, thereby improving the accuracy of the specified text vector set subsequently obtained.

[0066] S73, when p+q>K, obtain the candidate priority set P corresponding to Q={P1, ……, P i , ..., P n}, P i = {P i1 , ..., P ie , ..., P if(i)}, P ie Q i The candidate priority corresponding to the e-th candidate keyword in the corresponding candidate keyword list, e=1...f(i), f(i) is Q i The number of candidate keywords in the corresponding candidate keyword list.

[0067] Specifically, in S73, P is obtained through the following steps: ie :

[0068] S731, obtain candidate keyword list Q i = {Q i1 , ..., Q ie , ..., Q if(i)}, Q ie Q i The e-th candidate keyword in .

[0069] S733, according to the target term knowledge graph, obtain Q ie The corresponding specified keyword list R ie = {R 1 ie , ..., R aie , ..., R b(e) ie} and Q ie The corresponding specified priority list G ie = {G 1 ie , ..., G a ie , ..., G b(e) ie}, R a ie Q ie The corresponding a-th specified keyword, a=1...b(e), b(e) is Q ie The number of corresponding specified keywords, G a ie Q ie With R a ie The specified priority between .

[0070] Specifically, the designated keyword is a target word associated with the candidate keyword obtained from the target term knowledge graph.

[0071] Specifically, the designated priority is the degree of association between the candidate keyword and the designated keyword, wherein those skilled in the art know that any method of obtaining the degree of association between two texts in the prior art falls within the protection scope of the present invention and will not be described in detail herein.

[0072] S735, according to Q ie , R ie and G ie , get P ie , where P ie Meet the following conditions:

[0073] Among them, M ie Q ie The frequency of occurrence in the candidate text set A, N ie The candidate text set A includes Q ie The number of first intermediate words corresponding to the candidate text, V ie The candidate text set A includes Q ie The number of candidate texts, E a ie G a ie The frequency of occurrence in the candidate text set A, L a ie The candidate text set A includes G a ie The number of first intermediate words corresponding to the candidate text, J aie The candidate text set A includes G a ie The number of candidate texts.

[0074] S74, based on P, for WT i Processing to obtain U i .

[0075] Specifically, S74 also includes the following steps:

[0076] S741, according to P i , get T i The corresponding first intermediate text β 1 i =(A i , Q i1 , ..., Q i(e-1) , Q i(e+1) ..., Q if(i) ), where P ie P i The smallest candidate priority.

[0077] S743, when β 1 i When the number of corresponding text strings is not greater than K, get U i =β i .

[0078] S745, when β 1 i When the number of corresponding text strings is greater than K, get P i Medium ie Except P ie The minimum candidate priority outside the initial text Q i Remove from to get T i The corresponding second intermediate text β 2 i .

[0079] S747, repeat S743 to S745 until the U i The number of corresponding text strings is not greater than K to obtain U i .

[0080] S75, when p+q<K, obtain Q i Corresponding specified keyword set R i = {R i1 , ..., R ie , ..., R if(i)} and Q i The corresponding specified priority set G i = {G i1, ..., G ie , ..., G if(i)}, R ie Q ie The corresponding specified keyword list, G ie Q ie The corresponding specified priority list.

[0081] S76, according to R i and G i , for WT i Processing to obtain U i .

[0082] Specifically, S76 also includes the following steps:

[0083] S761, when G a ie G ie When the specified priority is the largest among the i The first candidate text set corresponding to the first candidate text set includes a plurality of first candidate texts, and the first candidate texts are obtained from A and include G a ie Corresponding specified keyword R a ie Candidate text for .

[0084] S763, based on T i The corresponding first candidate text set, get T i The corresponding second candidate text H i , where H 0 i =Kpq,H 0 i H i The corresponding number of text strings.

[0085] S765, according to H i , get U i =(A i , Q i , H i ).

[0086] In the above, the initial text is processed based on the number of text strings corresponding to the initial text. When the text string corresponding to the initial text exceeds a preset length threshold, truncation processing is performed based on the priority of the candidate keywords corresponding to the initial text. When the text string corresponding to the initial text is less than the preset length threshold, supplementary processing is performed based on the text associated with the candidate keywords corresponding to the initial text. Different processing methods are used based on the different numbers of text strings corresponding to the initial text to unify the number of text strings corresponding to the initial text, thereby improving the accuracy of the obtained specified text vector set.

[0087] S9. According to U, obtain a specified text vector set, wherein the specified text vector set includes a plurality of specified text vectors, wherein the specified text vectors are obtained by inputting the specified text into a pre-trained electronic medical record coding model.

[0088] Specifically, the pre-trained electronic medical record encoding model is a model for converting text into vectors obtained by training a medical record text training set based on a pre-trained model.

[0089] Furthermore, those skilled in the art know that the selection of pre-trained models can be carried out according to actual needs, all of which fall within the scope of protection of the present invention and will not be described in detail here, such as the ERNIE pre-trained model.

[0090] Furthermore, the medical record text training set is a medical record text set for model training obtained based on different search engines, and the medical record text set includes several medical record texts of different types and forms.

[0091] Furthermore, those skilled in the art know that any method of obtaining text from multiple search engines in the prior art falls within the protection scope of the present invention and will not be described in detail herein, including search engines such as Baidu.

[0092] S1003: Based on the first preset text set and the specified text vector set, obtain a first target text set corresponding to the first preset text set.

[0093] Specifically, the first preset text set includes a plurality of first preset texts, wherein the first preset text is a question text related to the abnormal state obtained based on the abnormal state.

[0094] Furthermore, the question text is a text presented in the form of a question requiring an answer and explanation, for example, question texts such as "what are the symptoms of luteinizing hormone being lower than 3" and so on.

[0095] Furthermore, the first preset text is a question text obtained through a public medical database, wherein those skilled in the art know that any text in the prior art that obtains medicine-related questions based on a public medical database falls within the protection scope of the present invention and will not be repeated here.

[0096] Specifically, S1003 also includes the following steps:

[0097] S10031, obtaining a first preset text vector set I={I1, ..., I t , ..., I θ}, I t is the first preset text vector corresponding to the t-th first preset text, t=1...θ, θ is the number of first preset texts.

[0098] Specifically, the first preset text vector is obtained by inputting the first preset text into a pre-trained electronic medical record coding model.

[0099] S10033, get the specified text vector set Specify the text vector for the ith element.

[0100] S10035, according to I and Get the first target similarity set ER corresponding to I = {ER1, ..., ER t , ..., ER θ}, ER t ={ER t1 , ..., ER ti , ..., ER tn}, ER ti For I t and The first target similarity between .

[0101] Specifically, those skilled in the art know that any method for obtaining the similarity between vectors in the prior art falls within the protection scope of the present invention and will not be described in detail herein, for example, methods for calculating the similarity between vectors such as cosine similarity.

[0102] S10037, when ER ti ≥ER 0 When The corresponding target text U i For I t The corresponding first target text, where ER 0 is the preset second priority threshold.

[0103] Specifically, ER 0The value range of ER is 0.8 to 0.85. Those skilled in the art know that ER can be adjusted according to actual needs. 0 The selection of all falls within the protection scope of the present invention and will not be repeated here.

[0104] S1005: Based on the first preset text set and the first target text set, obtain a second target text set corresponding to the first preset text set.

[0105] Specifically, the second target text set includes several second target texts, wherein the second target text is an explanatory content text associated with the first preset text generated by the prompt instruction based on the first preset text and the first target text set. For example, when the first preset text involves the heart, the heart is simply explained in combination with the related first target text and some relevant knowledge in the field of abnormal conditions, and the first preset text and the explanatory content obtained based on the first preset text are regarded as the second target text.

[0106] Furthermore, those skilled in the art know that any method of training and outputting results by using any prompt instruction in the prior art falls within the protection scope of the present invention and will not be described in detail herein.

[0107] In the above, based on the first preset text set and the first target text, the second target text set corresponding to the first preset text set is generated through the prompt instruction. For each question text, the corresponding medical record text is obtained, and the instruction instruction is set for it through the prompt instruction, which is conducive to the understanding and response of the electronic medical record question and answer system, and improves the accuracy of the output results of the electronic medical record question and answer system.

[0108] S1007: Input the first preset text set and the second target text set into a preset first initial LLM model to obtain a third target text set corresponding to the first preset text set.

[0109] Specifically, the third target text set includes a plurality of third target texts, wherein the third target text is an answer text and an explanation text corresponding to the first preset text obtained based on the first preset text.

[0110] Furthermore, the answer text is a text that answers the question text.

[0111] Furthermore, the explanation text is a text obtained based on the question text to explain the answer text.

[0112] Furthermore, in S1007, the third target text is obtained through the following steps:

[0113] S1071, according to the first preset text and the second target text corresponding to the first preset text, obtain ψ fourth target texts corresponding to the first preset text, wherein the fourth target text is the answer text and the explanation text corresponding to the first preset text obtained in multiple LLM models based on the second target text.

[0114] Specifically, those skilled in the art know that any method in the prior art that outputs results through an LLM model falls within the protection scope of the present invention and will not be described in detail herein, including, for example, LLM models such as the Baichuan-13B model and the LLaMA model.

[0115] Specifically, the value range of ψ is 30 to 50, wherein those skilled in the art know that ψ can be selected according to actual needs, all of which fall within the protection scope of the present invention and will not be described in detail here.

[0116] S1073, according to the fourth target text, obtain the preferred priority corresponding to the fourth target text, wherein the preferred priority is the score value obtained based on the voting method, wherein those skilled in the art know that any method of obtaining scores based on the voting method in the prior art falls within the protection scope of the present invention and will not be repeated here.

[0117] Specifically, the value range of the preferred priority is 0-1.

[0118] S1075: Acquire a third target text corresponding to the first preset text according to the preferred priority, wherein the third target text is the fourth target text corresponding to the maximum preferred priority.

[0119] S1009: Input the first target text set, the second target text set and the third target text set as training sets into a preset second initial LLM model to generate an initial electronic medical record question-and-answer model.

[0120] In another specific embodiment, after S1009, the following steps are also included:

[0121] S910, when the data volume of the training set corresponding to the initial electronic medical record question answering model is greater than a preset data volume threshold, obtain a candidate parameter list ω={ω1,……,ω c , ..., ω w},ω c is the cth candidate parameter, c = 1...w, w is the number of candidate parameters, where ω c =2 c , w=6.

[0122] Specifically, the candidate parameter is the rank corresponding to the matrix set to reduce the training time of the training set in the initial electronic medical record question and answer model, which can be understood as: when the LLM model performs data processing, matrix multiplication is involved. If the amount of data in the training set is too large, the training efficiency will be reduced. Therefore, in order to reduce the training time of the training set, it is necessary to set a matrix with a slightly smaller rank to assist in training, and the candidate parameter is the rank of this set matrix.

[0123] Furthermore, the preset data volume threshold value ranges from 100GB to 1TB. Those skilled in the art know that the preset data volume threshold value can be selected according to actual needs, which falls within the protection scope of the present invention and will not be described in detail here.

[0124] S912, according to ω, obtain a first intermediate priority list Tω={Tω1, ..., Tω1, Tω2, Tω3, Tω4, Tω5, Tω6, Tω7, Tω8, Tω9, Tω10, Tω11, Tω12, Tω13, Tω14, Tω15, Tω16, Tω17, Tω18, Tω19, Tω20, Tω21, Tω22, c , ..., Tω w}, Tω c ω c The corresponding first intermediate priority.

[0125] Specifically, the first intermediate priority is the GPU occupancy rate during the operation of the initial electronic medical record question and answer model. Those skilled in the art know that any method for obtaining GPU occupancy rate in the prior art falls within the protection scope of the present invention and will not be repeated here.

[0126] S913, when the first preset text is a first type of first preset text, obtain a second intermediate priority set Eω corresponding to ω based on the preset weight type = {Eω1, ..., Eω c , ..., Eω w}, Eω c ={Eω c1 ..., Eω cμ , ..., Eω cτ}, Eω cμ ω c The μth second intermediate priority in the corresponding second intermediate priority list, μ=1...τ, τ is the number of preset weight types.

[0127] Specifically, the first type of first preset text is a question text in which the first preset text is a separate question and has no relevance to other questions.

[0128] Specifically, the second intermediate priority is the score value corresponding to the initial electronic medical record question and answer model obtained under different preset weight types based on the candidate parameters and the first category of first preset text. Among them, those skilled in the art know that any method in the prior art for obtaining the corresponding model based on different conditions falls within the protection scope of the present invention and will not be repeated here.

[0129] Specifically, the preset weight type is a matrix type for calculating weights, which can be understood as follows: in the Transformer architecture, there are four weight matrices (Wq, Wk, Wv, Wo) in the self-attention module, where Wq (or Wk, Wv) is regarded as a single square matrix.

[0130] Specifically, 4≤τ≤30.

[0131] Preferably, the value of τ is 6. When τ is 6, the problem of low efficiency caused by performing a large number of tests can be avoided while ensuring the comprehensiveness of the tests.

[0132] S914, when the first preset text is the first preset text of the second category, obtaining a third intermediate priority set Lω corresponding to ω based on the preset weight type Lω={Lω1, . . . , Lω c , ..., Lω w}, Lω c ={Lω c1 ..., Lω cμ , ..., Lω cτ}, Lω cμ ω c The μth third intermediate priority in the corresponding third intermediate priority list.

[0133] Specifically, the second type of first preset text is a question text including a plurality of questions in the first preset text and each question is related to another.

[0134] Specifically, the third intermediate priority is a score value corresponding to the initial electronic medical record question and answer model obtained under different preset weight types based on the candidate parameters and the second type of first preset text.

[0135] Furthermore, the method for obtaining the third intermediate priority is consistent with the method for obtaining the second intermediate priority.

[0136] S915, according to Tω, Eω and Lω, obtain the final priority list Fω corresponding to ω={Fω1, ……, Fω c , ..., Fω w}, where Fω c Meet the following conditions:

[0137]

[0138] S916, according to Fω, obtain ω c is the target parameter of the initial electronic medical record question answering model, where Fω c is the largest final priority in Fω.

[0139] In the above, the performance of the initial electronic medical record question and answer model is obtained through the candidate parameters of the initial electronic medical record question and answer model. By setting the candidate parameters, the time of model training can be saved, and resources are not easily wasted. At the same time, it will not affect the reasoning ability and response ability of the model itself. At the same time, the parameters are adjusted to make the output results of the electronic medical record question and answer model more accurate.

[0140] S200, input the second preset text set into the initial electronic medical record question answering model, and obtain the first initial text set EW={EW1, ..., EW λ ,……,EW σ}, where EW λ is the λth first initial text, λ=1…σ, σ is the number of first initial texts.

[0141] Specifically, the first initial text is a first key text obtained from a first key text set and having a Chinese-English ratio within a preset ratio range.

[0142] Furthermore, the first key text set includes several first key texts, wherein the first key text is an answer text and an explanation text corresponding to a second preset text obtained based on the initial electronic medical record question and answer model.

[0143] Furthermore, the answer text is a text that answers the question text.

[0144] Furthermore, the explanation text is a text obtained based on the question text to explain the answer text.

[0145] Furthermore, the preset ratio range is tr 1 ~tr 2 , where tr 1 =tr-tr 0 , tr 2 =tr+tr 0 , tr is the average value of the English ratio in the sample text obtained, tr 0 is the preset ratio threshold.

[0146] Furthermore, tr 0 The value range of tr is 0.01 to 0.1, wherein those skilled in the art know that tr can be adjusted according to actual needs. 0 The selection of all falls within the protection scope of the present invention and will not be repeated here.

[0147] Furthermore, the sample text is the text output when the preset sample text is input into the initial electronic medical record question and answer model, wherein the properties of the preset sample text are consistent with the properties of the first preset text, and the method for obtaining the preset sample text can refer to the method for obtaining the first preset text.

[0148] S300, obtaining a first initial text vector set EW according to EW 0 ={EW 0 1, ..., EW 0 λ ,……,EW 0 σ}, E.W. 0 λ =(EW 0 λ1 ,……,EW 0 λγ ,……,EW 0 λη ), E.W. 0 λγ For EW λ The corresponding bit value of the γth bit in the first initial text vector, γ=1...η, η is the bit position of the first initial text vector.

[0149] Specifically, the first initial text vector is obtained by inputting the first initial text into a pre-trained electronic medical record coding model.

[0150] S400, according to the first initial text set, obtain a second initial text set FW = {FW1, ..., FW λ , ..., FW σ}, where FW λ is the λth second initial text.

[0151] Specifically, the second initial text is an accurate answer text and explanation text of a second preset text corresponding to the first initial text.

[0152] S500, according to FW, obtaining a second initial text vector set FW corresponding to FW 0 ={FW 0 1, ..., FW 0 λ , ..., FW 0 σ}, FW 0 λ =(FW 0 λ1 , ..., FW 0 λγ , ..., FW 0 λη ), FW 0 λγ For FW λ The corresponding bit value of the γth bit in the first initial text vector.

[0153] Specifically, the method for acquiring the second initial text vector is consistent with the method for acquiring the first initial text vector.

[0154] S600, according to EW 0 and FW 0 , obtain the first similarity list ΔW = {ΔW1, ..., ΔW λ , ..., ΔW σ}, where ΔW λ Meet the following conditions:

[0155]

[0156] S700, according to the EW, obtaining a first initial keyword set corresponding to the EW, wherein the first initial keyword set includes a plurality of first initial keyword lists, the first initial keyword list includes a first initial keyword, and the first initial keyword is a keyword in the first initial text.

[0157] Specifically, the first keyword is a word obtained from the first initial text that is similar to the target word in the target term knowledge graph.

[0158] Specifically, the method for acquiring the first initial keyword is consistent with the method for acquiring the candidate keyword, and reference may be made to steps S31 to S37.

[0159] S800, according to FW, obtain a second initial keyword set corresponding to FW, the second initial keyword set includes several second initial keyword lists, the second initial keyword list includes a second initial keyword, and the second initial keyword is a keyword in the second initial text.

[0160] Specifically, the method for acquiring the second initial keyword is consistent with the method for acquiring the first initial keyword.

[0161] S900, obtaining a first initial keyword set and a second initial keyword set, obtaining a second similarity list ΔV={ΔV1, . . . , ΔV λ , ..., ΔV σ}, where ΔV λ It is the similarity between the first initial keyword and the second initial keyword corresponding to the same second preset text.

[0162] Specifically, the ΔV λ The method of obtaining ΔW λ The method of obtaining is the same.

[0163] S1000, obtaining the candidate priority KL corresponding to the initial electronic medical record question-answering model according to ΔW and ΔV.

[0164] Specifically, in S1000, KL is obtained through the following steps:

[0165] S1111, when ΔW λ ≤ZM 0 When KL=0, ZM 0 is a preset first similarity threshold.

[0166] Specifically, ZM 0 The value range of is 0.6 to 0.85, wherein those skilled in the art know that those skilled in the art can select the preset first similarity threshold according to actual needs, which falls within the protection scope of the present invention and will not be repeated here.

[0167] S1113, when ΔW λ ≥ZM 0 And ΔV λ ≤ZM 1 When , KL meets the following conditions:

[0168] Among them, ZM 1 A preset second similarity threshold.

[0169] Specifically, ZM 1 The value range of is 0.5 to 0.9, wherein those skilled in the art know that those skilled in the art can select the preset second similarity threshold according to actual needs, which falls within the protection scope of the present invention and will not be described in detail here.

[0170] S1115, when ΔW λ ≥ZM 0 And ΔV λ ≥ZM 1 When KL meets the following conditions

[0171]

[0172] In the above, based on the difference between the first similarity and the second similarity, different correlation coefficients for calculating the candidate priorities are set, and different correlation coefficients are set based on different dimensions to make the obtained candidate priorities more accurate. The candidate priorities corresponding to the electronic medical record question and answer model are obtained based on different dimensions. At the same time, different methods are used to obtain the candidate priorities based on different situations. By reasonably setting the priorities, the results output by the electronic medical record question and answer system are more accurate.

[0173] Specifically, after S1000, the following steps are also included:

[0174] S81, based on the candidate priority, adjusting the parameters of the initial electronic question and answer model until the candidate priority is not less than a preset candidate priority threshold to obtain the target electronic medical record question and answer model.

[0175] Specifically, the preset candidate priority threshold has a value range of 0.7 to 0.9, wherein those skilled in the art know that those skilled in the art can select the preset candidate priority threshold according to actual needs, which falls within the protection scope of the present invention and will not be repeated here.

[0176] Specifically, those skilled in the art know that any process of adjusting parameters of a training model in the prior art falls within the protection scope of the present invention and will not be described in detail herein.

[0177] S82, obtaining preset key text, inputting the preset key text into the target electronic medical record question model to obtain the target text, wherein the preset key text is the question text about the abnormal state obtained based on the abnormal state to be queried, and the target text is the answer text and explanation text corresponding to the preset key text.

[0178] As mentioned above, applying the LLM model to electronic medical record question and answer can process large-scale data, reducing the application limitations of the electronic medical record question and answer model. Setting instruction instructions for it through the prompt instruction is conducive to the understanding and response of the electronic medical record question and answer system, and improving the accuracy of the output results of the electronic medical record question and answer system.

[0179] Specifically, after step S82, the following steps are also included:

[0180] S821, acquiring a key entity set according to a sample database, wherein the key entity set includes a plurality of key entities, and the key entities are entities related to the abnormal state acquired based on the sample database.

[0181] Specifically, the sample database includes a number of abnormal state-related information, such as drug data tables, human body parts, ICD-10 standard vocabulary, symptoms and signs, infectious diseases and other abnormal state-related information.

[0182] Furthermore, in S821, the key entity is obtained through the following steps:

[0183] S8211, obtaining a sample entity set according to a sample data set, wherein the sample entity set includes a plurality of sample entities, and the sample entities are entities related to abnormal states obtained from the sample data set. It can be understood that: the sample data set includes a large amount of text describing abnormal states, and terms related to the medical field are extracted from these texts. These terms are the obtained sample entities.

[0184] Specifically, the number of sample entities included in the sample entity set is in the millions.

[0185] Furthermore, it is known in the art that any method for extracting entities from text in the prior art falls within the protection scope of the present invention and will not be described in detail herein.

[0186] S8213: Obtain a first sample entity set according to the sample entity set, wherein the first sample entity set includes several first sample entities, and the first sample entities are entities similar to the sample entities obtained based on the LLM model.

[0187] Specifically, those skilled in the art know that any method for obtaining similar entities based on the LLM model in the prior art falls within the protection scope of the present invention and will not be described in detail here, such as LLM models such as chatglm.

[0188] S8215: Obtain a second sample entity set according to the first sample entity set, wherein the second sample entity set includes a plurality of second sample entities, and the second sample entities are entities that have no similar features to the first sample entities.

[0189] Specifically, those skilled in the art know that any method in the prior art for obtaining entities that have no similar features to an entity based on entity features falls within the protection scope of the present invention and will not be repeated here. For example, entities that have no similar features to an entity are obtained through models such as FM models and FFM models.

[0190] S8217: Acquire a key entity set based on the sample entity set, the first sample entity set, and the second sample entity set, wherein the key entity set includes the sample entity set, the first sample entity set, and the second sample entity set.

[0191] Specifically, the number of key entities in the key entity set is in the tens of millions, wherein those skilled in the art know that the ratio of the first sample entity to the second sample entity can be selected according to actual needs, all of which fall within the protection scope of the present invention and will not be repeated here.

[0192] S822, input the key entity set and the target entity set into the first intermediate model to obtain the key entity vector set and the target entity vector set.

[0193] Specifically, the target entity set includes a plurality of target entities, wherein the target entities are standard terms related to abnormal states.

[0194] Specifically, the first intermediate model is a model for converting text into vectors, wherein those skilled in the art know that any natural language processing model for converting text into vectors can be performed according to actual needs, and all fall within the protection scope of the present invention, and will not be repeated here, such as natural language processing models such as the BERT model.

[0195] Specifically, the key entity vector set includes a plurality of key entity vectors, wherein the key entity vectors are vectors corresponding to key entities.

[0196] Furthermore, the target entity vector set includes a plurality of target entity vectors, wherein the target entity vector is a vector corresponding to the target entity.

[0197] S823, inputting the key entity vector set and the target entity vector set into a second intermediate model to obtain a final entity set corresponding to the key entity set, wherein the second intermediate model is a preset neural network model.

[0198] Specifically, in S823, the final entity set is obtained through the following steps:

[0199] S8231, obtain any key entity vector XY from the key entity vector set = (XY1, ..., XY (ab) , ..., XY (jk) ), XY (ab) is the bit value of the abth position in the key entity vector, ab=1...jk, jk is the bit position of the key entity vector.

[0200] S8232, obtain the target entity vector set ZH={ZH1, ……, ZH (cd) ,……,ZH (ef)}, ZH (cd) =(ZH 1 (cd) ,……,ZH (ab) (cd) ,……,ZH (jk) (cd) ), ZH (ab) (cd) is the bit value of the abth position corresponding to the cdth target entity vector, cd=1…ef, ef is the number of target entity vectors.

[0201] S8233, according to XY and ZH, obtain the first intermediate priority list XH corresponding to XY = {XH1, ..., XH (cd) ,……,XH (ef)}, XH (cd) For XY and ZH (cd) The first intermediate priority between the two, where XH (cd) Meet the following conditions:

[0202]

[0203] As mentioned above, when obtaining the priority corresponding to the entity, it is not limited to one method of acquisition. By combining multiple methods, the final priority corresponding to the entity is obtained, which improves the accuracy of obtaining the priority corresponding to the entity, thereby making the standardized results corresponding to the output results of the electronic medical record question and answer model more accurate.

[0204] S8235, according to XH, obtain the final entity corresponding to XY, wherein when XH (cd) When it is the largest first intermediate priority in XH, get ZH (cd) The corresponding target entity is the final entity corresponding to XY.

[0205] S824, acquiring a target model based on the sample entity set and the final entity set, wherein the target model is a model trained in the process of acquiring the final entity set based on the sample entity set.

[0206] S825, obtaining a first candidate entity set corresponding to the target text, wherein the first candidate entity set includes a plurality of first candidate entities, and the first candidate entities are entities obtained from the target text.

[0207] Specifically, those skilled in the art know that any method for obtaining entities from text in the prior art falls within the protection scope of the present invention and will not be described in detail herein.

[0208] S826, input the first candidate entity into the target model to obtain a second candidate entity set corresponding to the target text, wherein the second candidate entity set includes a plurality of second candidate entities, and the second candidate entity is an entity in the target entity corresponding to the first candidate entity obtained based on the first candidate entity and the target model.

[0209] S827, replacing the first candidate entity set in the target text with the corresponding second candidate entity set to achieve standardization processing of the target text.

[0210] As mentioned above, by standardizing the output results of the electronic medical record question-and-answer model, subsequent data query and statistics are facilitated.

[0211] The present embodiment provides a scoring system for an electronic medical record question-and-answer model, including a sample electronic medical record information set, a second preset text set, a processor, and a memory storing a computer program. When the computer program is executed by the processor, the following steps are implemented: obtaining an initial electronic medical record question-and-answer model based on the sample electronic medical record information set, inputting the second preset text set into the initial electronic medical record question-and-answer model, obtaining a first initial text set, obtaining a first initial text vector set based on the first initial text set, obtaining a second initial text set based on the first initial text set, obtaining a second initial text vector set based on the second initial text set, and obtaining a second initial text vector set based on the first initial text set. and the second initial text vector set, obtain a first similarity list, obtain a first initial keyword set corresponding to the first initial text according to the first initial text set, obtain a second initial keyword set corresponding to the second initial text according to the second initial text set, obtain a second similarity list according to the first initial keyword set and the second initial keyword set, obtain the candidate priority corresponding to the initial electronic medical record question and answer model according to the first similarity list and the second similarity list, the present invention judges the result output by the model, scores when the result meets the threshold condition, and scores the model based on different dimensions, so that the accuracy of the obtained electronic medical record question and answer model score is higher.

[0212] Although some specific embodiments of the present invention have been described in detail by way of example, it will be appreciated by those skilled in the art that the above examples are for illustration only and are not intended to limit the scope of the present invention. It will also be appreciated by those skilled in the art that various modifications may be made to the embodiments without departing from the scope and spirit of the present invention. The scope of the present invention is defined by the appended claims.

Claims

1. A scoring system for an electronic medical record question-answering model, the system include: A sample electronic medical record information set, a second preset text set, a processor, and a memory storing a computer program, when the computer program is executed by the processor, implements the following steps: S100, obtaining an initial electronic medical record question-answering model based on a sample electronic medical record information set; S200, input the second preset text set into the initial electronic medical record question answering model, and obtain the first initial text set EW={EW 1 ,……,EW λ ,……,EW σ }, where EW λ is the λth first initial text, λ=1…σ, σ is the number of first initial texts, wherein the first initial text is a first key text obtained from the first key text set with a Chinese-English ratio within a preset ratio range, and the first key text set includes a plurality of first key texts, wherein the first key text is an answer text and an explanation text corresponding to a second preset text obtained based on the initial electronic medical record question-answering model; S300, obtaining a first initial text vector set EW according to EW 0 ={EW 0 1 ,……,EW 0 λ ,……,EW 0 σ }, E.W. 0 λ =(EW 0 λ1 ,……,EW 0 λγ ,……,EW 0 λη ), E.W. 0 λγ For EW λ The corresponding bit value of the γth bit in the first initial text vector, γ=1...η, η is the bit position of the first initial text vector; S400, obtaining a second initial text set FW based on the first initial text set FW = {FW 1 , ..., FW λ , ..., FW σ }, where FW λ is the λth second initial text; S500, according to FW, obtaining a second initial text vector set FW corresponding to FW 0 ={FW 0 1 , ..., FW 0 λ , ..., FW 0 σ }, FW 0 λ =(FW 0 λ1 , ..., FW 0 λγ , ..., FW 0 λη ), FW 0 λγ For FW λ The bit value of the γth bit in the corresponding first initial text vector; S600, according to EW 0 and FW 0 , obtain the first similarity list ΔW = {ΔW 1 , ..., ΔW λ , ..., ΔW σ }, where ΔW λ Meet the following conditions: S700, according to the EW, obtaining a first initial keyword set corresponding to the EW, wherein the first initial keyword set includes a plurality of first initial keyword lists, the first initial keyword list includes a first initial keyword, and the first initial keyword is a keyword in the first initial text; S800, according to FW, obtaining a second initial keyword set corresponding to FW, where the second initial keyword set includes a plurality of second initial keyword lists, where the second initial keyword list includes a second initial keyword, and the second initial keyword is a keyword in the second initial text; S900, obtaining a second similarity list ΔV={ΔV 1 , ..., ΔV λ , ..., ΔV σ }, where ΔV λ is the similarity between the first initial keyword and the second initial keyword corresponding to the same second preset text, wherein the ΔV λ The method of obtaining ΔW λ The acquisition method is consistent; S1000, obtaining a candidate priority KL corresponding to the initial electronic medical record question and answer model according to ΔW and ΔV, wherein KL is a score value of the initial electronic medical record question and answer model.

2. The scoring system of the electronic medical record question-answering model according to claim 1, It is characterized in that The answer text is a text that answers the question text.

3. The scoring system of the electronic medical record question-answering model according to claim 1, It is characterized in that The explanation text is a text obtained based on the question text to explain the answer text.

4. The scoring system of the electronic medical record question-answering model according to claim 1, It is characterized in that The second initial text is an accurate answer text and explanation text of a second preset text corresponding to the first initial text.

5. The scoring system of the electronic medical record question-answering model according to claim 1, It is characterized in that The method for acquiring the second initial keyword is consistent with the method for acquiring the first initial keyword.

6. The scoring system of the electronic medical record question-answering model according to claim 1, It is characterized in that In S1000, KL is obtained by the following steps: S1111, when ΔW λ <ZM 0 When KL=0, ZM 0 is a preset first similarity threshold; S1113, when ΔW λ ≥ZM 0 And ΔV λ ≤ZM 1 When , KL meets the following conditions: Among them, ZM 1 a preset second similarity threshold; S1115, when ΔW λ ≥ZM 0 And ΔV λ >ZM 1 When KL meets the following conditions