{'fraction_non_alphanumeric': 0.021119434040782356, 'fraction_numerical': 0.004577611319184353, 'mean_word_length': 5.246263807667316, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Research on Similar Medical Records Recommend Model based on Natural Language Processing

Aiming at the problem of low efficiency and poor credibility in medical record text data mining, this paper proposes a similar medical record recommend model based on natural language processing. Firstly, extract the samples by structured data in the medical record data and narrow down the extraction of similar medical records, then use the text keyword extraction algorithm to obtain the keyword text data about chief complaint, medical history and physical examination in the medical record text, use these data as input data, get the similarity between the input data and the patient data by text similarity algorithm, and use collaborative filtering algorithm to calculate the most similar medical records and obtain the most similar medical records diagnosis conclusions, take the chief complaint, medical history, physical examination data and diagnosis conclusions as input data to calculate the text similarity and collaborative filtering values and obtain the final recommend treatment plan. The case analysis proves that the model proposed in this paper has high credibility and practicality.


Introduction
In recent years, the improvement of deep learning frameworks and artificial intelligence algorithms performance have provided new ideas for text data mining, and the accuracy and efficiency of the results obtained by using natural language processing techniques for natural language processing also surpass the traditional methods. For text data such as medical record data, the use of natural language processing technology has wide application value, especially for some specific diseases, using similar medical record data can help junior doctors and doctors in underdeveloped medical resources region to improve the accuracy of diagnosis and rationality of treatment plans, optimize auxiliary diagnosis and treatment methods, and promote the development of smart medical technology.
The current methods for processing medical record data include: (1) Use machine learning algorithms to analyze text statistical data, such as statistical analysis of drug properties [1].
(2) Use statistical methods to analyze the frequency of drug use and obtain the most frequently used words [2][3][4].
(3) Text clustering analysis based on machine learning algorithms, clustering medical record data and discovering the rules of medication [5].
The above methods mainly use the traditional statistical learning algorithms and machine learning algorithms to process the structured data and text data in the medical records, resulting in lower accuracy of calculations and poor credibility of the results. Therefore, this paper proposes a similar medical record recommend model based on natural language processing. First, extract the sample from the structured data in the medical record data to narrow down the extraction of similar medical records, then use the chief complaint, medical history, and physical examination data in the medical record as input data to recommend the diagnostic result, and use the selected diagnostic data as input data to get the optimal diagnostic program, achieve auxiliary diagnosis and treatment based on natural language processing.

Modeling Process
This paper constructs a similar medical record recommend model, which mainly includes SQL-based text data acquisition from medical record database, input text keyword extraction, text data similarity calculation, recommending the optimal diagnosis conclusion by similarity data collaborative filtering, and recommending for final processing scheme based on collaborative filtering. The overall modeling process is shown in Figure 1.

Text data acquisition of medical record database based on SQL
Currently, all medical records are issued through the Hospital Information System (HIS). Therefore, the medical record data is stored in the database of the HIS system. After the doctor enters the basic information of the patient, we can use SQL language to obtain data similar to the basic information of the patient based on the basic situation of the current patient. The pseudo code is 'Select medicine_cases from case_table where Gender = 'male' and Visiting_department ='Visiting_department' and ages in (Minimum_age, Maximum_age)'.
The range of similar data acquisition is shown in Table 1. The obtained text data is divided into two parts, where the data of chief complaint, medical history (including current medical history and past history), physical examination are set as input data for diagnostic result data, the diagnostic result data is set as output data for the first three types of data, and the data of chief complaint, medical history, physical examination and diagnostic result are set as input data for treatment program data.

Keyword extraction
To the three types of input text data, due to the large amount of data and the importance of containing information, it is impossible to make full use of these data. Therefore, we consider using keywords to replace these text data, which can speed up the calculation speed, ensure the important content to be not lost, and guarantee the accuracy of the algorithm. The keyword extraction algorithm used in this paper contains four algorithms: TF-IDF \ TextRank \ LSI \ LDA, and the extraction results of each algorithm are combined by using intersection method to avoid the loss of important keywords due to different algorithms and prevent over-production Large amount of computation.
Assuming that the keyword set extracted by each model of TF-IDF \ TextRank \ LSI \ LDA is STF, STe, SLAS and SLDA, then the total text data set is Sin=STF∪STe∪SLAS∪SLDA (1)

Text data similarity calculation
For the extracted keywords, a similarity calculation with the keywords of the current patient is required, so as to obtain a sample matrix collaborative filtering algorithms needed.
where X1i represents the text similarity of the chief complaint, X2i represents the text similarity of the medical history, and X3i represents the text similarity of the physical examination, Medical history text similarity X2i is calculated as: Where X2i1 indicates the text similarity of the current medical history, and X2i2 indicates the similarity of text the previous medical history.

Recommending diagnosis result and processing program based on collaborative filtering
Collaborative filtering is a recommendation technology. It can filter information that is difficult for the machine to automatically analyze based on some complex and difficult to expression, and ensure the feasibility of recommendations, so it is very suitable for text recommendation. Therefore, this paper adopts collaborative filtering to recommend the optimal diagnosis conclusion and final treatment plan.
Set the similarity matrix of each text as the new matrix of the current patient input data, and take the processing program corresponding to the maximum value as the recommended program.

Case analysis
The case data is derived from the medical records of pediatric visits within a 5-day period in a hospital. The method proposed in this paper is used to process these data.
(1) Use SQL statements to get text from HIS and get a total of 10 hits. Categorize the text in the data, including the main complaint, medical history, physical examination, diagnostic conclusions, and treatment program.
(2) Extract text keywords, among which 1000 pieces of medical records of the department were collected for the keyword learning samples.
For example, for a medical examination text: 'pharyngeal congestion, 1 degree of double tonsil, no secretions, thick lung breathing, no wet and dry rales, no abnormalities in the abdomen, red tongue, less moss, flat pulse', the keywords obtained by using TF-IDF \ TextRank \ LSI \ LDA algorithms are shown in Table 2. It can be seen that the medical record No. 9 is most similar to the case of the current patient. Taking the diagnosis result of No. 9 as the diagnosis program of the current patient, calculate the text similarity of each medical record and the collaborative filtering value of each medical record text data. Finally, the 9th program has the highest collaborative filtering value, so the 9th medical record processing program is pushed.
The collaborative filtering values based on the similarity of 3 text data and 4 text data are shown in Figure 2. (5) Algorithm credibility analysis. Because there is no similar algorithm to compare, in order to verify the effectiveness of the algorithm, this paper analyzes 16 existing medical records.
Assume that the medical record data is diagnostic data, and the diagnosis conclusions and processing schemes are pushed according to the method in this paper. The textual similarity data between the pushed medical record data and the original medical record data are shown in Table 3. From Table 3 we could find that the similarity of the medical records pushed by the algorithm in this paper is mostly above 0.9, which illustrates the credibility and practicability of the algorithm.

Conclusion
In recent years, natural language processing has become an important branch of artificial intelligence, and it will also be widely used in the field of smart medicine in the future. This paper uses natural language processing technology including keyword extraction, text similarity model and collaborative filtering algorithm to achieve the pushing of similar medical records, which has good practicability and credibility. Meanwhile, this paper only analyzes the medical record data of the first diagnosis.