Medical ancient text recommendation method and device, electronic equipment and medium
By extracting user features and keyword features, using coarse-ranking algorithms and language representation models to splice and tag classical Chinese texts, and combining this with user click-through rate calculations, the problem of low accuracy in recommending classical Chinese texts for traditional Chinese medicine has been solved, achieving more efficient classical Chinese text recommendation.
Patent Information
- Application Number
- CN202310695289.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-12
- Publication Date
- 2025-11-28
- Estimated Expiration
- 2043-06-12
AI Technical Summary
Existing methods for recommending classical Chinese texts in traditional Chinese medicine mostly provide relevant texts based on the keywords searched by users, but they do not consider the relevance between the text content and the keywords, or user needs, resulting in low recommendation accuracy.
By receiving user-input search keywords and user information, feature information is extracted, and classical Chinese texts are spliced and tagged using a pre-set coarse-ranking algorithm and language representation model. User click-through rate is calculated by combining user behavior and translation data, and recommended classical Chinese texts are output.
It improves the accuracy of recommendations for classical Chinese medical texts, helping medical professionals to better find relevant texts, solve difficult and complicated cases, and improve the efficiency of disease treatment.
Smart Images

Figure CN116662531B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of digital medicine, in particular to a medical ancient text recommendation method and device, electronic equipment and readable storage medium. BACKGROUND
[0002] In the medical field, when encountering some complex disease problems, users need to query some medical ancient texts.
[0003] The common traditional Chinese medicine ancient text recommendation method at present is to provide the ancient text containing the keyword searched by the user according to the keyword searched by the user, without considering whether the content of the ancient text is related to the keyword. In addition, this traditional Chinese medicine ancient text recommendation method does not consider the real needs of the user, so it is easy to cause the technical problem of low accuracy of traditional Chinese medicine literature ancient text recommendation. SUMMARY
[0004] The present application provides a medical ancient text recommendation method, device, electronic equipment and readable storage medium, which aims to improve the accuracy of traditional Chinese medicine ancient text recommendation when medical workers search for related medical ancient texts.
[0005] To achieve the above purpose, the present application provides a medical ancient text recommendation method, which comprises:
[0006] receiving the search keyword input by the user, obtaining the user information of the user on the medical platform,
[0007] extracting the feature information of the search keyword and the user information respectively, obtaining keyword features and user features, and searching for recall ancient texts in the preset product library that match the user behavior sequence in the keyword features and the user features;
[0008] using a preset rough sorting algorithm to roughly sort the recall ancient texts to obtain the recommended medical ancient texts;
[0009] splicing the recommended medical ancient texts with corresponding translation data and annotation data respectively to obtain ancient text translation splicing data and ancient text annotation splicing data;
[0010] labeling the recommended medical ancient texts according to the ancient text translation splicing data and the ancient text annotation splicing data to obtain ancient text labels;
[0011] According to the user information and the ancient text labels of the recommended medical ancient texts, a preset medical ancient text recommendation model is used to calculate the user click rate of the recommended medical ancient texts;
[0012] According to the size order of the user click rate, the recommended medical ancient texts are output.
[0013] Optionally, the ancient text label of the medical ancient text to be recommended is obtained by marking the medical ancient text to be recommended according to the ancient text translation splicing data and the ancient text annotation splicing data, and the marking comprises:
[0014] The feature data of the ancient text translation splicing data and the ancient text annotation splicing data is extracted by using a preset language representation model, and a translation feature vector and an annotation feature vector are obtained.
[0015] The translation feature vector and the annotation feature vector are spliced to obtain a translation annotation splicing vector, and the translation annotation splicing vector is linearly converted to obtain a linear feature vector.
[0016] The linear feature vector is normalized to obtain a label feature vector, and the ancient text label of the medical ancient text to be recommended is obtained according to the mapping relationship between the vector dimension of the label feature vector and a preset label.
[0017] Optionally, the feature data of the ancient text translation splicing data and the ancient text annotation splicing data is extracted by using a preset language representation model, and a translation feature vector and an annotation feature vector are obtained, and the method comprises:
[0018] The ancient text translation splicing data is vectorized to obtain an ancient text translation splicing text vector, and the ancient text annotation splicing data is vectorized to obtain an ancient text annotation splicing text vector.
[0019] The ancient text translation splicing text vector is linearly transformed by using different classification layer parameter matrices of an attention mechanism module in the preset language representation model to obtain an ancient text translation query vector, an ancient text translation key vector and an ancient text translation numerical value vector.
[0020] The ancient text annotation splicing text vector is linearly transformed by using the classification layer parameter matrices to obtain an ancient text annotation query vector, an ancient text annotation key vector and an ancient text annotation numerical value vector.
[0021] The ancient text translation query vector, the ancient text translation key vector and the ancient text translation numerical value vector are calculated by using a normalization exponential function in the attention mechanism module to obtain an ancient text translation weight vector.
[0022] The ancient text annotation query vector, the ancient text annotation key vector and the ancient text annotation numerical value vector are calculated by using the normalization exponential function to obtain an ancient text annotation weight vector.
[0023] The translation feature vector and the annotation feature vector are obtained by decoding the ancient text translation weight vector and the ancient text annotation weight vector by using a decoding module in the language representation model.
[0024] Optionally, the ancient text translation splicing data is vectorized to obtain an ancient text translation splicing text vector.
[0025] The ancient text translation splicing data is text encoded to obtain an ancient text translation splicing vector.
[0026] Each character of the ancient text translation splicing data is position index encoded to obtain an ancient text translation splicing position code.
[0027] According to the ancient text translation splicing vector and the ancient text translation splicing position code, an ancient text translation splicing text vector is obtained.
[0028] Optionally, the linear feature vector is normalized to obtain a label feature vector, including:
[0029] The linear feature vector is cross-multiplied with a preset label parameter matrix to obtain a target linear feature vector.
[0030] The target linear feature vector is added to a preset label parameter vector to obtain a target feature vector.
[0031] The target feature vector is normalized by a preset activation function to obtain a label feature vector.
[0032] Optionally, the feature information of the search keyword and the user information is extracted respectively to obtain keyword features and user features, including:
[0033] The user information is word extracted to obtain an information bag.
[0034] The user information is sentence processed to obtain user information sentences.
[0035] According to the order of each word in the information bag and the words appearing in the user information sentences, the user information sentences are encoded to obtain user information sentence features.
[0036] The user information sentence features are spliced to obtain user features.
[0037] Optionally, according to the user information and the ancient text label of the to-be-recommended medical ancient text, a preset medical ancient text recommendation model is used to calculate the user click rate of the to-be-recommended medical ancient text, including:
[0038] The translation feature vector and the annotation feature vector of the to-be-recommended medical ancient text are obtained.
[0039] The translation feature vector and the annotation feature vector of the to-be-recommended medical ancient text are spliced with the label result to obtain an ancient text feature vector.
[0040] encoding the user information by using an encoder in the preset medical ancient text recommendation model, to obtain a user encoding vector;
[0041] calculating the user encoding vector and the ancient text feature vector by using a normalization exponential function of an attention mechanism layer in the medical ancient text recommendation model, to obtain an ideal ancient text vector;
[0042] calculating the similarity between the ancient text feature vector and the ideal ancient text vector, and converting the similarity into a user click rate of the to-be-recommended medical ancient text according to a preset similarity-click rate conversion rule.
[0043] To solve the above problems, the present application also provides a medical ancient text recommendation device, which comprises:
[0044] An ancient text splicing module is configured to receive a search keyword input by a user, acquire user information of the user on a medical platform, extract feature information of the search keyword and the user information respectively, obtain keyword features and user features, find recall ancient texts matching a user behavior sequence in the keyword features and the user features in a preset product library, perform coarse sorting on the recall ancient texts by using a preset coarse sorting algorithm, obtain to-be-recommended medical ancient texts, and splice the to-be-recommended medical ancient texts with corresponding translation data and annotation data respectively to obtain ancient text translation splicing data and ancient text annotation splicing data.
[0045] An ancient text label module is configured to label the to-be-recommended medical ancient texts according to the ancient text translation splicing data and the ancient text annotation splicing data to obtain ancient text labels.
[0046] A medical ancient text recommendation module is configured to calculate a user click rate of the to-be-recommended medical ancient texts by using a preset medical ancient text recommendation model according to the user information and the ancient text labels of the to-be-recommended medical ancient texts, and output the to-be-recommended medical ancient texts in a size order of the user click rates.
[0047] To solve the above problems, the present application also provides an electronic device, which comprises:
[0048] a memory configured to store at least one computer program; and
[0049] a processor configured to execute the computer program stored in the memory to implement the medical ancient text recommendation method described above.
[0050] To solve the above problems, the present application also provides a computer readable storage medium, which stores at least one computer program, and the at least one computer program is executed by a processor in an electronic device to implement the medical ancient text recommendation method described above.
[0051] The embodiment of the present application tags the ancient text data by the relationship among the ancient text data, the translation data and the annotation data, obtains the tag result of all the ancient text data, so that the medical ancient text recommendation system can better recommend the required ancient text to the user according to the user demand, thereby improving the accuracy of the medical ancient text recommendation. In addition, the present application integrates the tag information of the to-be-recommended medical ancient text into the preset medical ancient text recommendation model, so that the accuracy of the medical ancient text recommendation model is higher, and the accuracy of the medical ancient text recommendation is further improved. Therefore, the medical ancient text recommendation method, device, equipment and storage medium provided by the present application can improve the accuracy of the medical ancient text recommendation when a medical worker searches for related medical ancient text, thereby helping the medical worker to solve the difficult and complex diseases encountered, and improving the disease solving efficiency. BRIEF DESCRIPTION OF DRAWINGS
[0052] Figure 1 The flowchart of the medical ancient text recommendation method provided by an embodiment of the present application is shown in the figure;
[0053] Figures 2 to 3 The detailed implementation flowchart of one step of the medical ancient text recommendation method provided by an embodiment of the present application is shown in the figure;
[0054] Figure 4 The module schematic diagram of the medical ancient text recommendation device provided by an embodiment of the present application is shown in the figure;
[0055] Figure 5 The internal structure schematic diagram of the electronic equipment for implementing the medical ancient text recommendation method provided by an embodiment of the present application is shown in the figure;
[0056] The implementation, functional characteristics and advantages of the present application will be further described with reference to the embodiments and the accompanying drawings. DETAILED DESCRIPTION
[0057] It should be understood that the specific embodiments described herein are only used to explain the present application, and are not used to limit the present application.
[0058] The embodiment of the present application provides a medical ancient text recommendation method. The execution subject of the medical ancient text recommendation method includes but is not limited to at least one of electronic devices such as a server and a terminal, which can be configured to execute the method provided by the embodiment of the present application. In other words, the medical ancient text recommendation method can be executed by software or hardware installed in a terminal device or a server device, and the software can be a blockchain platform. The server can include a standalone server, or a cloud server providing cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content distribution networks (CDN), and basic cloud computing services such as big data and artificial intelligence platforms.
[0059] Referring to Figure 1 The embodiment of the present application provides a medical ancient text recommendation method. The execution subject of the medical ancient text recommendation method includes but is not limited to at least one of electronic devices such as a server and a terminal, which can be configured to execute the method provided by the embodiment of the present application. In other words, the medical ancient text recommendation method can be executed by software or hardware installed in a terminal device or a server device, and the software can be a blockchain platform. The server can include a standalone server, or a cloud server providing cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content distribution networks (CDN), and basic cloud computing services such as big data and artificial intelligence platforms.
[0060] S1, receiving a search keyword input by a user, obtaining user information of the user on a medical platform, and screening a medical ancient text to be recommended according to the search keyword and the user information.
[0061] In the embodiment of the present application, the search keyword can be a word or a word group appearing in a medical ancient text, for example: virtual evil, mental inner guard and desire. The user information includes basic information, user behavior and user portrait, wherein the basic information includes name, gender, age and hobby, the user behavior can be the operation behavior of the user in the network, which can be obtained by using Python crawler, and the user portrait includes the attributes, behavior and expectation of the user.
[0062] In an optional embodiment of the present application, when the search keyword input by the user is received, the user behavior and the basic information of the user on the medical platform are obtained by using the Python crawler, and the user portrait is generated according to the user behavior and the basic information of the user.
[0063] S2, respectively extracting feature information of the search keyword and the user information, obtaining keyword features and user features, and searching a recall ancient text matching a user behavior sequence in the keyword features and the user features in a preset product library.
[0064] In the embodiment of the present application, the user features include a user behavior sequence, a user image sequence and a basic information sequence. The preset product library can be a database containing a large amount of medical ancient text data.
[0065] In the embodiment of the present application, the feature information of the search keyword and the user information is extracted respectively to obtain keyword features and user features, and then the keyword features and the user features are matched with the ancient text in the preset product library to find the approximately matched ancient text data, so that the preliminary screening of the ancient text data is realized, the search range of the ancient text is reduced, and the efficiency of the medical ancient text recommendation is improved.
[0066] Further, as an optional embodiment of the present application, referring to Figure 2 The feature information of the user information is extracted to obtain user features, including:
[0067] S21, word extraction is performed on the user information to obtain an information bag;
[0068] S22, sentence processing is performed on the user information to obtain user information sentences;
[0069] S23, according to the order of each word in the information bag and the words appearing in the user information sentences, the user information sentences are coded to obtain user information sentence features;
[0070] S24, the user information sentence features are spliced to obtain user features.
[0071] In the embodiment of the present application, the bag of words can be a set of non-repeated words.
[0072] In an optional embodiment of the present application, the obtained user information is "he is an intern, he likes to view medical ancient text with a browser", the information bag obtained by word extraction on the user information is (he, is, an, intern, likes, to, view, medical, ancient, text), and according to the number of words in the information bag, a bag sequence (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0) is defined, further, the user information is processed by sentence to obtain two sentences "he is an intern" and "he likes to view medical ancient text with a browser", then, according to the order of each word in the information bag and the words appearing in the user information sentences, the user information sentences are coded, which can be expressed as the feature code corresponding to "he is an intern" is (1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0), and the feature code corresponding to "he likes to view medical ancient text with a browser" is (1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1), finally, the feature codes (1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0) (1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1) are spliced to obtain the user feature code.
[0073] In another optional embodiment of the present application, the feature information of the search keyword and the feature information of the user information are extracted, and the user feature is similar, so no further description is given.
[0074] S3, using a preset coarse ranking algorithm, the recalled ancient medical text is coarsely ranked to obtain a to-be-recommended medical ancient text.
[0075] In the embodiment of the present application, the coarse ranking algorithm can be an algorithm for reducing the number of recalled ancient texts to ensure the smooth operation of the subsequent attention mechanism.
[0076] In an optional embodiment of the present application, the recalled ancient texts are coarsely ranked to further filter out medical ancient texts that meet the user's requirements, thereby ensuring the accuracy of medical ancient text recommendation, and on the other hand, reducing the calculation amount of the recommendation model, thereby improving the efficiency of the recommendation model.
[0077] S4, the to-be-recommended medical ancient text is spliced with the corresponding translation data and annotation data to obtain ancient text translation splicing data and ancient text annotation splicing data.
[0078] In the embodiment of the present application, the to-be-recommended medical ancient text can be a medical ancient literature or a medical ancient poem that can be searched in the current Internet, such as ancient literature such as Huangdi Neijing and Shanghan Zabinglun. The translation data can be the current Internet translation data of each sentence in the medical ancient literature. The annotation data can be the sentence for annotating and explaining the words and sentences that are difficult to understand in the medical ancient literature.
[0079] In an optional embodiment of the present application, the medical translation data and the medical annotation data corresponding to the to-be-recommended medical ancient text data can be obtained by searching or crawling the network, for example, in the medical field, the relevant medical ancient text data can be searched in the Internet by the keywords "spiritual internal guard" and "desire", and Huangdi Neijing can be found, so that the user can easily obtain the required ancient text when querying the ancient text data, thereby improving the efficiency of medical ancient text recommendation.
[0080] Further, in order to better represent the relationship between the to-be-recommended medical ancient text and the translation data and the annotation data, the to-be-recommended medical ancient text is spliced with the translation data to obtain ancient text translation splicing data, and the to-be-recommended medical ancient text is spliced with the annotation data to obtain ancient text annotation splicing data, thereby improving the relevance between the to-be-recommended ancient text data and the translation data and the annotation data, and making the medical ancient text recommendation more accurate.
[0081] S5, according to the ancient text translation splicing data and the ancient text annotation splicing data, the to-be-recommended medical ancient text is labeled to obtain an ancient text label.
[0082] In the embodiment of the present application, the ancient text to be recommended is tagged according to the ancient text translation splicing data and the ancient text annotation splicing data, and the ancient text label of the ancient text to be recommended is determined, so that the medical ancient text recommendation is more accurate, and the accuracy of the medical ancient text recommendation is improved.
[0083] In detail, referring to FIG. 1, Figure 3 According to the ancient text translation splicing data and the ancient text annotation splicing data, the ancient text to be recommended is tagged to obtain an ancient text label, including:
[0084] S51, using a preset language representation model to extract feature data of the ancient text translation splicing data and the ancient text annotation splicing data respectively to obtain a translation feature vector and an annotation feature vector;
[0085] S52, splicing the translation feature vector and the annotation feature vector to obtain a translation annotation splicing vector, and performing linear conversion on the translation annotation splicing vector to obtain a linear feature vector;
[0086] S53, normalizing the linear feature vector to obtain a label feature vector, and obtaining the ancient text label of the ancient text to be recommended according to the vector dimension of the label feature vector and the reflection relationship of the preset label.
[0087] In the embodiment of the present application, the preset language representation model can be a trained Bert (Bidirectional Encoder Representations from Transformer, bidirectional encoder representation based on transformer) model. The preset label can be an ancient text label set according to the work field of the staff, for example, in the medical field, the preset label can be divided according to the human body part as the preset label, or can be divided according to the internal medicine and surgery as the preset label.
[0088] Further, the preset language representation model is used to extract feature data of the ancient text translation splicing data and the ancient text annotation splicing data respectively to obtain a translation feature vector and an annotation feature vector, including:
[0089] The ancient text translation splicing data is vectorized to obtain an ancient text translation splicing text vector, and the ancient text annotation splicing data is vectorized to obtain an ancient text annotation splicing text vector;
[0090] The different classification layer parameter matrix of the attention mechanism module in the preset language representation model is used for respectively linearly transforming the ancient text translation spliced text vector, to obtain an ancient text translation query vector, an ancient text translation key vector and an ancient text translation numerical vector.
[0091] The classification layer parameter matrix is used for respectively linearly transforming the ancient text annotation spliced text vector, to obtain an ancient text annotation query vector, an ancient text annotation key vector and an ancient text annotation numerical vector.
[0092] The normalization exponential function in the attention mechanism module is used for calculating the ancient text translation query vector, the ancient text translation key vector and the ancient text translation numerical vector, to obtain an ancient text translation weight vector.
[0093] The normalization exponential function is used for calculating the ancient text annotation query vector, the ancient text annotation key vector and the ancient text annotation numerical vector, to obtain an ancient text annotation weight vector.
[0094] The decoding module in the language representation model is used for respectively decoding the ancient text translation weight vector and the ancient text annotation weight vector, to obtain a translation feature vector and an annotation feature vector.
[0095] In the embodiment of the application, the classification layer parameter matrix can be obtained through multiple training and optimization in the Bert model.
[0096] In the optional embodiment of the application, since the model input port can only receive input in the form of a vector, before the preset language representation model is used to extract the feature data of the ancient text translation spliced data and the ancient text annotation spliced data, the ancient text translation spliced data and the ancient text annotation spliced data need to be converted into data in the form of a vector.
[0097] In detail, as an optional embodiment of the application, the following method is used to perform vectorization processing on the ancient text translation spliced data, to obtain an ancient text translation spliced text vector:
[0098] Text encoding is performed on the ancient text translation spliced data, to obtain an ancient text translation spliced vector.
[0099] Position index coding is performed on each character of the ancient text translation spliced data, to obtain an ancient text translation spliced position code.
[0100] According to the ancient text translation spliced vector and the ancient text translation spliced position code, an ancient text translation spliced text vector is obtained.
[0101] In the embodiment of the present application, the ancient text annotation splicing data is vectorized to obtain the ancient text annotation splicing text vector, which is similar to the above-mentioned ancient text translation splicing data vectorization to obtain the ancient text translation splicing text vector, and details are not repeated here.
[0102] In the embodiment of the present application, the ancient text translation splicing vector and the ancient text annotation splicing vector are respectively used to depict the global semantic information of the ancient text translation splicing data and the ancient text annotation splicing data, and are fused with the semantic information of the single word / word in the ancient text translation splicing data and the ancient text annotation splicing data. The ancient text translation splicing position code and the ancient text annotation splicing position code are respectively used to distinguish the position of the single word / word in the ancient text translation splicing data and the ancient text annotation splicing data.
[0103] In the optional embodiment of the present application, since the semantic information carried by the words / words appearing in different positions of the text is different, for example: "I love you" and "you love me", after the ancient text translation splicing data and the ancient text annotation splicing data are vectorized, a different vector needs to be added to the words / words in different positions of the ancient text translation splicing data and the ancient text annotation splicing data respectively for distinction.
[0104] Further, in an optional embodiment of the present application, the translation feature vector and the annotation feature vector are spliced by vector splicing to obtain the correlation between the translation feature vector and the annotation feature vector, thereby improving the accuracy of the label and the accuracy of the medical ancient text recommendation.
[0105] In the embodiment of the present application, the linear layer parameters in the trained language representation model can be used to perform linear conversion on the translation annotation splicing vector.
[0106] In another optional embodiment of the present application, the linear conversion of the translation annotation splicing vector is realized by cross-multiplying the translation annotation splicing vector and the linear layer parameters.
[0107] Further, as an optional embodiment of the present application, the normalization processing of the linear feature vector to obtain the label feature vector comprises:
[0108] Cross-multiplying the linear feature vector and the preset label parameter matrix to obtain a target linear feature vector;
[0109] Adding the target linear feature vector and the preset label parameter vector to obtain a target feature vector;
[0110] Normalizing the target feature vector by using a preset activation function to obtain a label feature vector.
[0111] In the embodiment of the present application, the preset label parameter matrix can be a matrix with a dimension of k*m, where k can be the number of preset labels, and m can be the vector dimension of the translation feature vector and the annotation feature vector. The preset label parameter vector can be a vector with a dimension of k. The preset activation function can be a softmax function.
[0112] Further, in an optional embodiment of the present application, the label feature vector can be calculated by using the following formula:
[0113]
[0114] wherein, denotes the label feature vector, denotes the preset activation function, denotes the preset matrix with a dimension of k*m, denotes the linear feature vector, denotes the preset vector with a dimension of k.
[0115] In an optional embodiment of the present application, after the expression of the label feature vector is calculated, the label corresponding to the ancient text of the label feature vector is determined according to the vector value of each dimension in the label feature vector, so as to realize the fusion of multi-label information into the recommendation model, and make the recommendation model more accurate, that is, improve the success rate of medical ancient text recommendation.
[0116] S6, according to the user information and the ancient text label of the to-be-recommended medical ancient text, a preset medical ancient text recommendation model is used to calculate the user click rate of the to-be-recommended medical ancient text.
[0117] In the embodiment of the present application, the preset medical ancient text recommendation model can be a common double-tower model in product recommendation, including a User tower and an item tower, wherein the User tower and the item tower both contain an encoder.
[0118] In an optional embodiment of the present application, the medical ancient text recommendation model can be applied to various different fields, such as medical ancient text recommendation, common ancient poetry recommendation, etc.
[0119] In an optional embodiment of the present application, the translation feature vector and the annotation feature vector of the to-be-recommended medical ancient text can be searched in the preset language representation model output database, so as to reduce the data coding process, thereby improving the efficiency of medical ancient text recommendation.
[0120] Further, the embodiment of the present application calculates the user click rate of the medical ancient text to be recommended according to the user information and the ancient text label of the medical ancient text to be recommended, and uses a preset medical ancient text recommendation model, so that the multi-label information is integrated into the medical ancient text recommendation model, the accuracy of the medical ancient text recommendation model is higher, and the accuracy of the medical ancient text recommendation is improved.
[0121] In detail, as an optional embodiment of the present application, the calculation of the user click rate of the medical ancient text to be recommended according to the user information and the ancient text label of the medical ancient text to be recommended includes:
[0122] Obtaining the translation feature vector and the annotation feature vector of the medical ancient text to be recommended;
[0123] Splicing the translation feature vector and the annotation feature vector of the medical ancient text to be recommended and the ancient text label to obtain an ancient text feature vector;
[0124] Encoding the user information by using an encoder in the preset medical ancient text recommendation model to obtain a user encoding vector;
[0125] Calculating the user encoding vector and the ancient text feature vector by using a normalization exponential function of an attention mechanism layer in the medical ancient text recommendation model to obtain an ideal ancient text vector;
[0126] Calculating the similarity between the ancient text feature vector and the ideal ancient text vector, and converting the similarity into the user click rate of the medical ancient text to be recommended according to a preset similarity click rate conversion rule.
[0127] In the embodiment of the present application, the encoder can be a tool for converting an input sequence into a fixed-length vector. The attention mechanism layer has the ability to determine which part of the input needs to be focused on and allocate limited information processing resources to important parts. The normalization exponential function can be a softmax function. The similarity can be calculated by a cosine similarity algorithm. The preset similarity click rate conversion rule can be a corresponding rule of the similarity size and the click rate. Generally, the larger the similarity is, the higher the click rate is.
[0128] The embodiment of the present application calculates the user encoding vector and the ancient text feature vector by using the normalization exponential function of the attention mechanism layer in the medical ancient text recommendation model to obtain an ideal ancient text vector, realizes the interaction between the user and the ancient text, improves the precision of the medical ancient text recommendation model sorting, and thus improves the accuracy of the medical ancient text recommendation.
[0129] Further, as an optional embodiment of the present invention, the step of using the normalized exponential function of the attention mechanism layer in the medical classical Chinese recommendation model to calculate the user encoding vector and the classical Chinese feature vector to obtain the ideal classical Chinese vector includes:
[0130] The user-encoded vector is linearly transformed based on the first attention parameter matrix in the attention mechanism layer to obtain the query vector;
[0131] A linear transformation is performed on the ancient text feature vector based on the second attention parameter matrix and the third attention parameter matrix in the attention mechanism layer to obtain the key vector and the numerical vector.
[0132] The similarity matrix is obtained by multiplying the key vector with the transpose of the query vector.
[0133] The similarity matrix is normalized to obtain the weight matrix;
[0134] The ideal ancient text vector is obtained by multiplying the weight matrix with the numerical vector.
[0135] In this embodiment of the invention, the first attention parameter matrix, the second attention parameter matrix, and the third attention parameter matrix can be parameter matrices obtained through multiple training and optimization processes in the attention mechanism layer of the medical classical Chinese text recommendation model.
[0136] This invention provides an ideal classical Chinese vector by performing a series of calculations on the user encoding vector and the classical Chinese feature vector. Then, the ideal classical Chinese vector is used to calculate the similarity between the classical Chinese feature vector of the recommended medical classical Chinese text. This overcomes the lack of interaction between the recommended medical classical Chinese text and user information, thus making the medical classical Chinese text recommendation results more accurate.
[0137] In addition, in an optional embodiment of the present invention, the user click-through rate of the recommended classical medical text can also be obtained by means of tracking point analysis.
[0138] S7. Output the recommended classical medical texts according to the order of user click rates.
[0139] In an optional embodiment of the present invention, when the user click-through rate of all medical classical texts to be recommended is calculated, the medical classical texts to be recommended are also sorted according to the order of the user click-through rate, and the medical classical texts to be recommended are output according to the sorting result, thereby improving the success rate of recommending medical classical texts.
[0140] The embodiment of the application tags the ancient text data by the relationship among the ancient text data, the translation data and the annotation data, obtains the tag result of all the ancient text data, so that the medical ancient text recommendation system can better recommend the required ancient text to the user according to the user demand, thereby improving the accuracy of medical ancient text recommendation. In addition, the application integrates the tag information of the to-be-recommended medical ancient text into the preset medical ancient text recommendation model, so that the accuracy of the medical ancient text recommendation model is higher, and the accuracy of medical ancient text recommendation is further improved. Therefore, the medical ancient text recommendation method provided by the application can improve the accuracy of medical ancient text recommendation when medical workers search for related medical ancient texts, thereby helping medical workers solve difficult and complex diseases and improving the efficiency of disease solving.
[0141] As Figure 4 shown, it is a functional module diagram of the medical ancient text recommendation device of the application.
[0142] The medical ancient text recommendation device 100 can be installed in an electronic device. According to the implemented functions, the medical ancient text recommendation device 100 can include an ancient text splicing module 101, an ancient text tag module 102 and a medical ancient text recommendation module 103. The modules of the application can also be referred to as units, which refer to a series of computer program segments that can be executed by an electronic device processor and can complete fixed functions, and are stored in the memory of the electronic device.
[0143] In this embodiment, the functions of each module / unit are as follows:
[0144] The ancient text splicing module 101 is used to receive the search keyword input by the user, obtain the user information of the user on the medical platform, extract the feature information of the search keyword and the user information respectively, obtain the keyword feature and the user feature, and find the recall ancient text matching the user behavior sequence in the keyword feature and the user feature in the preset product library. The recall ancient text is roughly sorted by using a preset rough sorting algorithm, and the to-be-recommended medical ancient text is obtained. The to-be-recommended medical ancient text is spliced with the corresponding translation data and annotation data respectively to obtain ancient text translation splicing data and ancient text annotation splicing data.
[0145] The ancient text tag module 102 is used to tag the to-be-recommended medical ancient text according to the ancient text translation splicing data and the ancient text annotation splicing data, and obtain the ancient text tag.
[0146] The medical ancient text recommendation module 103 is used to calculate the user click rate of the to-be-recommended medical ancient text by using a preset medical ancient text recommendation model according to the user information and the ancient text tag of the to-be-recommended medical ancient text, and output the to-be-recommended medical ancient text according to the size order of the user click rate.
[0147] As Figure 5 shown, it is a structural schematic diagram of the electronic device for implementing the medical ancient text recommendation method.
[0148] The electronic device can include a processor 10, a memory 11, a communication bus 12 and a communication interface 13, and can further include a computer program, such as a medical ancient text recommendation program, stored in the memory 11 and executable on the processor 10.
[0149] The memory 11 includes at least one type of readable storage medium, including flash memory, mobile hard disk, multimedia card, card-type memory (such as SD or DX memory, etc.), magnetic memory, disk, optical disk, etc. In some embodiments, the memory 11 can be an internal storage unit of the electronic device, such as a mobile hard disk of the electronic device. In other embodiments, the memory 11 can also be an external storage device of the electronic device, such as a plug-in mobile hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. Further, the memory 11 can include both an internal storage unit and an external storage device of the electronic device. The memory 11 can be used not only to store application software and various data installed in the electronic device, such as the code of the medical ancient text recommendation program, but also to temporarily store data that has been output or will be output.
[0150] The processor 10 can be composed of integrated circuits in some embodiments, such as a single packaged integrated circuit, or a plurality of packaged integrated circuits with the same or different functions, including one or more combinations of central processing units (CPU), microprocessors, digital processing chips, graphics processors and various control chips, etc. The processor 10 is the control core (Control Unit) of the electronic device, which connects all components of the electronic device through various interfaces and lines, and executes various functions and processes data of the electronic device by running or executing programs or modules stored in the memory 11 (such as the medical ancient text recommendation program, etc.) and calling data stored in the memory 11.
[0151] The communication bus 12 can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. The communication bus 12 is configured to realize the connection and communication between the memory 11 and the at least one processor 10, etc. For the convenience of representation, only one thick line is shown in the figure, but it does not mean that there is only one bus or one type of bus.
[0152] Figure 5 Only the electronic device with components is shown, and those skilled in the art can understand that, Figure 5 The structure shown does not constitute a limitation on the electronic device, and can include fewer or more components than shown, or combine certain components, or different component arrangements.
[0153] For example, although not shown, the electronic device can also include a power supply (such as a battery) for powering each component. Preferably, the power supply can be logically connected to the at least one processor 10 through a power management device, so as to realize functions such as charge management, discharge management, and power consumption management through the power management device. The power supply can also include one or more direct current or alternating current power supplies, recharging devices, power supply fault detection circuits, power supply converters or inverters, power supply status indicators, etc. The electronic device can also include various sensors, Bluetooth modules, Wi-Fi modules, etc., which are not described here.
[0154] Optionally, the communication interface 13 can include a wired interface and / or a wireless interface (such as a WI-FI interface, a Bluetooth interface, etc.), which is usually used to establish a communication connection between the electronic device and other electronic devices.
[0155] Optionally, the communication interface 13 can also include a user interface, which can be a display (Display), an input unit (such as a keyboard (Keyboard)), and optionally, the user interface can also be a standard wired interface, a wireless interface. Optionally, in some embodiments, the display can be an LED display, a liquid crystal display, a touch liquid crystal display, and an OLED (Organic Light-Emitting Diode) touch, etc. Among them, the display can also be appropriately called a display screen or a display unit, which is used to display information processed in the electronic device and to display a visualized user interface.
[0156] It should be understood that the embodiments are only for illustration, and the scope of the patent application is not limited by the structure.
[0157] The medical ancient text recommendation program stored in the memory 11 in the electronic device is a combination of multiple computer programs, which can realize the following functions when running in the processor 10:
[0158] receiving a search keyword input by a user, obtaining user information of the user on a medical platform,
[0159] extracting feature information of the search keyword and the user information respectively, obtaining keyword features and user features, and searching a preset product library for recalled ancient texts matching a user behavior sequence in the keyword features and the user features;
[0160] performing rough sorting on the recalled ancient texts by using a preset rough sorting algorithm to obtain to-be-recommended medical ancient texts;
[0161] splicing the to-be-recommended medical ancient texts with corresponding translation data and annotation data respectively to obtain ancient text translation splicing data and ancient text annotation splicing data;
[0162] labeling the to-be-recommended medical ancient texts according to the ancient text translation splicing data and the ancient text annotation splicing data to obtain ancient text labels;
[0163] calculating a user click rate of the to-be-recommended medical ancient texts by using a preset medical ancient text recommendation model according to the user information and the ancient text labels of the to-be-recommended medical ancient texts;
[0164] outputting the to-be-recommended medical ancient texts according to the size order of the user click rates.
[0165] Specifically, the specific implementation method of the processor 10 on the above computer programs can refer to the description of related steps in the corresponding embodiments, which will not be repeated here. Figure 1 The specific implementation method of the processor 10 on the above computer programs can refer to the description of related steps in the corresponding embodiments, which will not be repeated here.
[0166] Further, the modules / units integrated in the electronic device, if realized in the form of software function units and sold or used as independent products, can be stored in a computer readable storage medium. The computer readable medium can be non-volatile or volatile. The computer readable medium can include any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory).
[0167] The embodiment of the application can also provide a computer readable storage medium, which stores a computer program, and the computer program can realize the following functions when executed by a processor of an electronic device:
[0168] Receive a search keyword input by a user, obtain user information of the user on a medical platform,
[0169] Extract feature information of the search keyword and the user information respectively, obtain keyword features and user features, and find a recall ancient text matching a user behavior sequence in the keyword features and the user features in a preset product library;
[0170] Coarsely sort the recall ancient text by using a preset coarse sorting algorithm to obtain a to-be-recommended medical ancient text;
[0171] Splice the to-be-recommended medical ancient text with corresponding translation data and annotation data respectively to obtain ancient text translation splicing data and ancient text annotation splicing data;
[0172] Label the to-be-recommended medical ancient text according to the ancient text translation splicing data and the ancient text annotation splicing data to obtain ancient text labels;
[0173] Calculate a user click rate of the to-be-recommended medical ancient text by using a preset medical ancient text recommendation model according to the user information and the ancient text labels of the to-be-recommended medical ancient text;
[0174] Output the to-be-recommended medical ancient text according to the size order of the user click rate.
[0175] Further, the computer usable storage medium can mainly include a storage program area and a storage data area, wherein the storage program area can store an operating system, at least one application required by a function, etc.; and the storage data area can store data created according to use of a blockchain node, etc.
[0176] In several embodiments provided in the present application, it should be understood that the disclosed electronic devices, apparatuses and methods can be implemented in other manners. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the modules is merely a logical function division, and there can be another division manner in actual implementation.
[0177] The modules illustrated as separated components can or can not be physically separated, and the components illustrated as modules can or can not be physical units, i.e., can be located in one place, or can be distributed on a plurality of network units. According to actual needs, some or all of the modules can be selected to achieve the purpose of the embodiments.
[0178] In addition, each function module in each embodiment of the present application can be integrated in one processing unit, or each unit can be physically present separately, or two or more units can be integrated in one unit. The above integrated unit can be realized in the form of hardware, or in the form of hardware plus software function modules.
[0179] It is apparent to a person skilled in the art that the present application is not limited to the details of the above-described exemplary embodiments, but can be implemented in other concrete forms without departing from the spirit or essential characteristics of the present application.
[0180] Therefore, from any point of view, the embodiments should be considered as exemplary and not limiting, the scope of the present application being defined by the claims appended hereto and not by the above description, therefore all changes falling within the meaning and the scope of the equivalent elements of the claims are intended to be comprised within the present application. Any reference signs in the claims should not be considered as limiting the claims involved.
[0181] The blockchain referred to in the present application is a new application mode of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanism, and encryption algorithm. Blockchain, in essence, is a decentralized database, which is a series of data blocks associated using cryptographic methods, each data block containing information of a batch of network transactions, 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, etc.
[0182] In addition, it is clear that the word "comprising" does not exclude other elements or steps, and the singular does not exclude the plural. Multiple units or devices stated in the system claims can also be implemented by one unit or device through software or hardware. The second and the like are used to indicate names and do not mean any particular order.
[0183] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application and not to limit it, although the present application has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solutions of the present application can be modified or replaced by equivalents without departing from the spirit and scope of the technical solutions of the present application.
Claims
1. A method for recommending medical texts in classical Chinese, characterized in that, The method includes: Receive search keywords input by the user and obtain the user's information on the medical platform. The feature information of the search keywords and the user information is extracted respectively to obtain keyword features and user features, and the ancient texts that match the user behavior sequence in the keyword features and user features are searched in the preset product database. Using a preset coarse-ranking algorithm, the recalled classical Chinese texts are coarsely ranked to obtain the classical Chinese medical texts to be recommended. The ancient medical texts to be recommended are concatenated with their corresponding translation data and annotation data to obtain concatenated ancient text translation data and concatenated ancient text annotation data. Based on the spliced data of the ancient Chinese translation and the spliced data of the ancient Chinese annotation, the ancient Chinese medical texts to be recommended are tagged to obtain ancient Chinese tags; Based on the user information and the classical Chinese tags of the medical classical Chinese text to be recommended, the user click-through rate of the medical classical Chinese text to be recommended is calculated using a preset medical classical Chinese text recommendation model; The recommended classical Chinese medical texts are output in order of user click-through rates.
2. The method for recommending classical Chinese medical texts as described in claim 1, characterized in that, The step of tagging the recommended classical Chinese medical texts based on the spliced data of the classical Chinese translations and the spliced data of the classical Chinese annotations to obtain classical Chinese tags includes: The feature data of the ancient Chinese translation splicing data and the ancient Chinese annotation splicing data are extracted using a preset language representation model to obtain the translation feature vector and the annotation feature vector. The translated text feature vector and the annotation feature vector are concatenated to obtain a translated text annotation concatenated vector, and the translated text annotation concatenated vector is linearly transformed to obtain a linear feature vector; The linear feature vector is normalized to obtain the label feature vector, and the ancient Chinese label of the medical text to be recommended is obtained according to the mapping relationship between the vector dimension of the label feature vector and the preset label.
3. The method for recommending classical Chinese medical texts as described in claim 2, characterized in that, The method utilizes a preset language representation model to extract feature data from the spliced classical Chinese translation data and the spliced classical Chinese annotation data, respectively, to obtain translation feature vectors and annotation feature vectors, including: The spliced data of the ancient Chinese translation is vectorized to obtain the spliced text vector of the ancient Chinese translation, and the spliced data of the ancient Chinese annotation is vectorized to obtain the spliced text vector of the ancient Chinese annotation. By using the different classification layer parameter matrices of the attention mechanism module in the preset language representation model, the spliced text vector of the ancient Chinese translation is linearly transformed to obtain the ancient Chinese translation query vector, the ancient Chinese translation key vector, and the ancient Chinese translation numerical vector. The classification layer parameter matrix is used to perform linear transformations on the concatenated ancient text annotation text vector to obtain the ancient text annotation query vector, the ancient text annotation key vector, and the ancient text annotation numerical vector. The normalized exponential function in the attention mechanism module is used to calculate the ancient Chinese translation query vector, the ancient Chinese translation key vector, and the ancient Chinese translation numerical vector to obtain the ancient Chinese translation weight vector. The ancient text annotation query vector, the ancient text annotation key vector, and the ancient text annotation numerical vector are calculated using the normalized exponential function to obtain the ancient text annotation weight vector; The translation weight vector and the annotation weight vector are decoded using the decoding module in the language representation model to obtain the translation feature vector and the annotation feature vector, respectively.
4. The method for recommending classical Chinese medical texts as described in claim 3, characterized in that, The vectorization process of the spliced classical Chinese translation data to obtain the spliced classical Chinese translation text vector includes: Text encoding is performed on the spliced data of the ancient Chinese translation to obtain the spliced vector of the ancient Chinese translation; Each character in the ancient Chinese translation splicing data is encoded by its position index to obtain the ancient Chinese translation splicing position code; Based on the spliced vector of the ancient Chinese translation and the encoding of the spliced position of the ancient Chinese translation, the spliced text vector of the ancient Chinese translation is obtained.
5. The method for recommending classical Chinese medical texts as described in claim 2, characterized in that, The normalization process of the linear feature vector to obtain the label feature vector includes: The target linear feature vector is obtained by performing a cross product between the linear feature vector and the preset label parameter matrix. The target linear feature vector is added to the preset label parameter vector to obtain the target feature vector; The target feature vector is normalized using a preset activation function to obtain the label feature vector.
6. The method for recommending classical Chinese medical texts as described in claim 1, characterized in that, The step of extracting feature information from the search keywords and user information respectively to obtain keyword features and user features includes: Word extraction is performed on the user information to obtain an information bag-of-words. The user information is segmented into sentences to obtain user information sentences; Based on the order of each word in the information bag and the words appearing in the user information sentence, the user information sentence is encoded to obtain the user information segmentation sentence features; The user information segmentation sentence features are concatenated to obtain user features.
7. The method for recommending classical Chinese medical texts as described in claim 1, characterized in that, The step of calculating the user click-through rate of the recommended classical medical text based on the user information and the classical Chinese tags of the text to be recommended using a preset classical medical text recommendation model includes: Obtain the translation feature vector and annotation feature vector of the ancient medical text to be recommended; The translation feature vector, annotation feature vector, and tag results of the ancient medical text to be recommended are concatenated to obtain the ancient text feature vector; The user information is encoded using the encoder in the preset medical classical Chinese recommendation model to obtain the user encoding vector; The user encoding vector and the ancient text feature vector are calculated using the normalized exponential function of the attention mechanism layer in the medical ancient text recommendation model to obtain the ideal ancient text vector; The similarity between the ancient Chinese feature vector and the ideal ancient Chinese vector is calculated, and the similarity is converted into the user click-through rate of the recommended medical ancient Chinese text according to the preset similarity click-through rate conversion rule.
8. A device for recommending classical Chinese medical texts, characterized in that, The device includes: The classical Chinese text splicing module is used to receive search keywords input by the user, obtain the user's user information on the medical platform, extract feature information from the search keywords and the user information respectively to obtain keyword features and user features, and search for recalled classical Chinese texts that match the user behavior sequence in the keyword features and user features in a preset product library. Using a preset coarse ranking algorithm, the recalled classical Chinese texts are coarsely ranked to obtain medical classical Chinese texts to be recommended. The medical classical Chinese texts to be recommended are spliced with the corresponding translation data and annotation data respectively to obtain classical Chinese translation spliced data and classical Chinese annotation spliced data. The classical Chinese tagging module is used to tag the recommended medical classical Chinese texts based on the spliced data of the classical Chinese translations and the spliced data of the classical Chinese annotations, thereby obtaining classical Chinese tags; The medical classical Chinese text recommendation module is used to calculate the user click-through rate of the medical classical Chinese text to be recommended based on the user information and the classical Chinese text tags of the text to be recommended, using a preset medical classical Chinese text recommendation model, and output the medical classical Chinese text to be recommended in order of the user click-through rate.
9. An electronic device, characterized in that, The electronic device includes: At least one processor; and, A memory communicatively connected to the at least one processor; wherein, The memory stores computer program instructions executable by the at least one processor, which, when executed by the at least one processor, enables the at least one processor to perform the medical classical text recommendation method as described in any one of claims 1 to 7.
10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the method for recommending classical medical texts as described in any one of claims 1 to 7.
Citation Information
Patent Citations
Ancient Chinese language knowledge query method and device, equipment and storage medium
CN115422328A
Statement recommendation method and device, equipment and storage medium
CN116089597A