Recommendation reason generation method, device, electronic device and storage medium
By generating target vectors and labels related to user query, recalling and merging doctors' multi-dimensional data, the problems in the existing technology that recommendation reasons are not related to user complaints are solved, and high accuracy and relevance recommendation reasons are generated, which improves the user's consultation experience.
Patent Information
- Application Number
- CN202411553498.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-02
- Publication Date
- 2025-03-11
- Estimated Expiration
- 2044-11-02
AI Technical Summary
When generating the reasons for doctor recommendation, the prior art ignores the matching information between the patient and the doctor, which leads to the reasons for recommendation being unrelated to the patient's main complaint, and large models based on probability statistics are prone to fabricating and unfounded problems.
By responding to the query request on the user side, a target vector and a target tag related to the query information are generated, a vector of non-service type data is recalled from the first database, and a tag data of service type is recalled from the second database, and a recommendation reason that meets the predetermined format is generated after the merge.
It improves the relevance and accuracy of the recommendation reasons, ensures that the generated recommendation reasons are related to the user's main complaints, avoids random fabrications, and improves the user's consultation experience.
Smart Images

Figure CN119049700B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of artificial intelligence technology, and specifically to a method, device, electronic device and storage medium for generating recommendation reasons. Background Art
[0002] With the development of the Internet, online diagnosis and treatment services have emerged. One of the core links is doctor recommendation, that is, how to recommend suitable doctors to patients. In medical scenarios, patients often lack judgment on doctors recommended by the platform due to their lack of medical expertise. The platform needs to give reasons for doctor recommendation to assist patients in judging the rationality, thereby improving the matching degree between doctors and patients. In related technologies, the platform only gives doctors' recommendation reasons from the doctor's side, giving doctors' aggregated information, but often ignores the matching information between patients and doctors, that is, the recommendation reasons are not related to the patients' complaints; the large model used in related technologies is still based on probability statistics. If the large model fails to learn relevant corpus or professional knowledge during training, it may generate recommendation reasons based on incomplete or erroneous data. Therefore, the recommendation reasons generated by the large model in related technologies often appear hallucinatory, with problems of fabrication and lack of factual basis, which leads to patients' misjudgment and affects the consultation experience. Summary of the invention
[0003] In order to solve the above technical problems, the present application provides a method, device, electronic device and storage medium for generating recommendation reasons.
[0004] In a first aspect, the present application provides a method for generating a recommendation reason, comprising: in response to a query request from a user side, obtaining a target vector and a target label corresponding to the query information from the user side, wherein the target vector is obtained by converting the query information, and the target label includes at least one of the following: a disease label, a symptom label, and an intention label; recalling first data from a first database according to the target vector, and recalling second data from a second database according to the target label, wherein the first database includes vectors corresponding to the doctor's non-business type data, and the second database includes label data of the doctor's business type; merging the first data and the second data to obtain a target text content; generating a target recommendation reason based on a preset Prompt instruction, the query information, and the target text content, wherein the preset Prompt instruction is used to indicate that a recommendation reason associated with the query information and conforming to a predetermined format is generated from the target text content.
[0005] By adopting the above technical solution, the target vector and the target label are both related to the query information, ensuring the correlation between the generated target recommendation reason and the query information, avoiding the problem of poor correlation between the recommendation reason and the user's main complaint in the related technology; the first data and the second data are obtained through the first database and the second database respectively, avoiding the problem that the generated recommendation reason is not comprehensive enough by piecing together only a few simple dimensions of the doctor in the related technology; the target text content is obtained by merging the first data and the second data, and the target recommendation reason is generated from the target text content according to the preset Prompt instruction and is associated with the query information, and the generated target recommendation reason conforms to the predetermined format, avoiding the problem that the method using large model prediction in the related technology is prone to fabrication and lack of factual basis. Through this technical solution, the purpose of improving the relevance and accuracy of the recommendation reason is achieved, and the effect of improving the user's consultation experience is achieved. In the related technologies, large models based on probability statistics are prone to generating recommendation reasons without factual basis and fabricated information, which affects the patient's judgment. This technical solution ensures the accuracy and factual basis of the recommendation reasons by recalling doctor data (including non-business type and business type data) closely related to the query information from the database; by combining the query information on the user side and the doctor's multi-dimensional data, it generates recommendation reasons that are highly relevant to the patient's actual situation, effectively improving the matching degree of the recommendation reasons, helping patients find the right doctor faster, and achieving the effect of improving the user's consultation experience.
[0006] Optionally, after generating a target recommendation reason based on a preset Prompt instruction, query information and target text content, the method further includes: returning the target recommendation reason to the user side.
[0007] By adopting the above technical solution, after generating the target recommendation reason, the target recommendation reason is returned to the user side, so that the user can view the doctor's target recommendation reason in time, which can meet the real-time requirements of online medical services and improve the user experience and satisfaction of online medical services.
[0008] Optionally, after generating the target recommendation reason based on the preset Prompt instruction, query information and target text content, the above method also includes: performing predetermined processing on the target recommendation reason to obtain a processed recommendation reason, wherein the predetermined processing includes at least one of the following: filtering processing, correction processing; and returning the processed recommendation reason to the user side.
[0009] By adopting the above technical solution, after generating the target recommendation reason, the target recommendation reason can be processed in advance to obtain the processed recommendation reason, and then the processed recommendation reason is returned to the user side. By filtering and correcting the target recommendation reason, redundant information can be removed, incorrect statements can be corrected, and the recommendation reason can be optimized according to the specific needs and context of the user, so that the returned recommendation reason is more accurate, comprehensive and applicable, and the user's trust and satisfaction with the recommendation results are improved.
[0010] Optionally, the target recommendation reasons are subjected to predetermined processing to obtain processed recommendation reasons, including one of the following: filtering the target recommendation reasons according to preset filtering rules to obtain processed recommendation reasons; adjusting the order of reasons of different dimensions in the target recommendation reasons according to preset priority rules to obtain processed recommendation reasons, wherein the target recommendation reasons include reasons of multiple dimensions; filtering the target recommendation reasons according to preset filtering rules to obtain a first recommendation reason, adjusting the order of reasons of different dimensions in the first recommendation reason according to preset priority rules to obtain processed recommendation reasons, wherein the target recommendation reasons include reasons of multiple dimensions.
[0011] By adopting the above technical solution, through the preset filtering rules, some recommendation reasons that are irrelevant to users, redundant or may have a negative impact can be eliminated, ensuring that the remaining recommendation reasons are more accurate and relevant, thereby improving users' acceptance and trust in the recommended content; according to the preset priority rules, the recommendation reasons of multiple dimensions are sorted to ensure that the most important reasons are displayed to users first, helping users to quickly understand the core value of the recommendation and improve the conversion rate of the recommendation; by optimizing the recommendation reasons, not only the quality of a single recommendation can be improved, but also by improving user satisfaction and conversion rate, the user experience and recommendation effect of the recommendation system can be significantly improved.
[0012] Optionally, in response to a query request from the user side, a target vector and a target label corresponding to the query information from the user side are obtained, including: in response to the query request from the user side, using the embedding capability of the big model to generate a target vector corresponding to the query information, and using the big model to extract labels associated with the condition and / or intent from the query information to obtain the target label.
[0013] By adopting the above technical solution, the embedding capability of the big model in the platform is used to generate a target vector corresponding to the query information, that is, the user's query information (or query) is converted into a vector in a high-dimensional space, which can capture the semantic information of the query for subsequent recall operations; the big model in the platform can also be used to extract labels associated with the condition and / or intention from the query information, for example, it can be a label of at least one of the disease label, symptom label and intention label. By using the embedding capability of the big model, the text information in the user query (i.e., query information) can be converted into a high-dimensional vector representation, which can more accurately capture the semantics and contextual information of the text, thereby improving the system's understanding and expression capabilities of the user query; the big model has learned a wealth of knowledge and patterns through pre-training, and can automatically extract labels closely related to the condition and / or intention from the user query information. These labels are not only highly accurate, but also have a wide coverage, providing strong support for subsequent recommendation, diagnosis and other processing.
[0014] Optionally, before recalling the first data from the first database according to the target vector, and before recalling the second data from the second database according to the target label, the method further includes: constructing a first database and a second database, wherein the first database is obtained in the following manner: obtaining unstructured data of doctors, wherein the unstructured data is non-business type data of doctors captured by searching the entire network; slicing the unstructured data to obtain sliced data; converting the sliced data into vectors; and storing the vectors in the first database; the second database is obtained in the following manner: obtaining structured data of doctors, wherein the structured data includes historical business data of doctors; processing the structured data to obtain label data of business types; and storing the label data in the second database.
[0015] By adopting the above technical solutions, in the field of medical health, doctors' data are often scattered in multiple sources, including unstructured data and structured data, which have large differences in format, structure and content. The raw data that has not been processed and sorted is inefficient in query and retrieval, and it is difficult to meet the needs of rapid response and accurate matching. By building two specially designed databases (the first database and the second database), the complexity of data integration and processing in the field of medical health, the inefficiency of data utilization, and the lack and inaccuracy of data labels are solved, and accurate retrieval and efficient utilization of data are achieved, providing users with a more personalized and intelligent medical service experience.
[0016] Optionally, recalling the first data from the first database based on the target vector, and recalling the second data from the second database based on the target tag, includes: recalling the first data from the first database based on the target vector and the target doctor ID, wherein the target doctor ID is the ID of a doctor recommended by the recommendation system in response to a query request, and the first data includes a vector that matches the target doctor ID and has a similarity to the target vector greater than a preset similarity threshold; recalling the second data from the second database based on the target tag and the target doctor ID, wherein the second data includes label data that matches the target doctor ID and matches the target tag.
[0017] By adopting the above technical solution, the first database includes vectors corresponding to non-business type data of multiple doctor IDs, each vector corresponds to a doctor ID, and the second database includes business type label data of multiple doctor IDs, each label data corresponds to a doctor ID; the first data is obtained by searching the vector whose similarity with the target vector is greater than the preset similarity threshold and the doctor ID is the target doctor ID in the first database, and the data matching the target label and whose doctor ID is the target doctor ID is searched in the second database to obtain the second data, that is, the first data and the second data are both data corresponding to the target doctor ID. Vectors with high similarity to the target vector are screened out from the first database, thereby ensuring that the recalled first data is highly relevant to the user query; at the same time, the accurate matching based on the label ensures that the second data recalled from the second database is also closely related to the user query; the purpose of accurately recalling relevant data from two different databases is achieved, which not only improves the accuracy and efficiency of data retrieval, but also realizes the effective integration of multi-source data and personalized recommendation services, providing users with a better quality and efficient medical and health service experience.
[0018] In the second aspect of the present application, there is also provided a device for generating a recommendation reason, comprising: a response module, for responding to a query request from a user side, and obtaining a target vector and a target label corresponding to the query information from the user side, wherein the target vector is obtained by converting the query information, and the target label comprises at least one of the following: a disease label, a symptom label, and an intention label; a recall module, for recalling first data from a first database according to the target vector, and for recalling second data from a second database according to the target label, wherein the first database includes vectors corresponding to the doctor's non-business type data, and the second database includes label data of the doctor's business type; a merging module, for merging the first data and the second data to obtain a target text content; a generating module, for generating a target recommendation reason based on a preset Prompt instruction, the query information, and the target text content, wherein the preset Prompt instruction is used to indicate that a recommendation reason associated with the query information and conforming to a predetermined format is generated from the target text content.
[0019] In a third aspect of the present application, an electronic device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the program, any of the above method steps is implemented.
[0020] In a fourth aspect of the present application, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores instructions, and when the instructions are executed, any of the above method steps is performed.
[0021] In summary, one or more technical solutions provided in this application have at least the following technical effects or advantages:
[0022] 1. By recalling doctor data closely related to the query information from the first database and the second database, the accuracy and factual basis of the recommendation reasons are ensured; by combining the query information on the user side and the multi-dimensional data of the doctor, the recommendation reasons that are highly relevant to the actual situation of the patient are generated, which effectively improves the matching degree of the recommendation reasons, helps patients find the right doctor for them faster, and achieves the effect of improving the user's consultation experience;
[0023] 2. Users can view the doctor's target recommendation reasons in a timely manner, which can meet the real-time requirements of online diagnosis and treatment services and improve the user experience and satisfaction of online diagnosis and treatment services;
[0024] 3. By filtering and correcting the target recommendation reasons, redundant information can be removed, incorrect statements can be corrected, and the recommendation reasons can be optimized according to the user's specific needs and context, making the returned recommendation reasons more accurate, comprehensive and applicable;
[0025] 4. By building the first database and the second database, we solved the problems of complexity of data integration and processing in the medical and health field, low efficiency of data utilization, missing and inaccurate data labels, etc., achieved accurate retrieval and efficient use of data, and provided users with a more personalized and intelligent medical service experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] Figure 1 is a flow chart of a method for generating recommendation reasons provided in an embodiment of the present application;
[0027] Figure 2 It is a flow chart of a method for generating recommendation reasons based on RAG provided in an embodiment of the present application;
[0028] Figure 3 It is a flowchart of processing the recommendation reasons provided in the embodiment of the present application;
[0029] Figure 4 It is a structural block diagram of a device for generating recommendation reasons provided in an embodiment of the present application;
[0030] Figure 5 It is a schematic diagram of the structure of an electronic device disclosed in an embodiment of the present application.
[0031] Description of the reference numerals: 500 - electronic device; 501 - processor; 502 - communication bus; 503 - user interface; 504 - network interface; 505 - memory. DETAILED DESCRIPTION
[0032] In order to enable technicians in this field to better understand the technical solutions in this specification, the technical solutions in the embodiments of this specification will be clearly and completely described below in conjunction with the drawings in the embodiments of this specification. Obviously, the described embodiments are only part of the embodiments of this application, not all of the embodiments.
[0033] In the description of the embodiments of the present application, words such as "for example" or "for example" are used to indicate examples, illustrations or explanations. Any embodiment or design described as "for example" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "for example" or "for example" is intended to present related concepts in a specific way.
[0034] In the description of the embodiments of the present application, the term "plurality" means two or more. In addition, the terms "first" and "second" are used for descriptive purposes only and cannot be understood as indicating or implying relative importance or implicitly indicating the indicated technical features. Thus, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. The terms "include", "comprise", "have" and their variations all mean "including but not limited to", unless otherwise specifically emphasized.
[0035] This application provides a method for generating recommendation reasons. Figure 1 , Figure 1 : is a flowchart of a method for generating a recommendation reason provided in an embodiment of the present application, comprising the following steps:
[0036] Step S101, in response to a query request from a user side, obtaining a target vector and a target label corresponding to the query information from the user side, wherein the target vector is obtained by converting the query information, and the target label includes at least one of the following: a disease label, a symptom label, and an intention label;
[0037] Step S102, recalling first data from a first database according to a target vector, and recalling second data from a second database according to a target label, wherein the first database includes vectors corresponding to non-business type data of doctors, and the second database includes label data of business type of doctors;
[0038] Step S103, merging the first data and the second data to obtain target text content;
[0039] Step S104, generating a target recommendation reason based on a preset Prompt instruction, the query information and the target text content, wherein the preset Prompt instruction is used to instruct to generate a recommendation reason associated with the query information and conforming to a predetermined format from the target text content.
[0040] Through the above steps, in response to the query request from the user side, the target vector and target label corresponding to the query information are obtained, and the first data and the second data are respectively recalled from the first database and the second database, wherein the first database includes the vector corresponding to the doctor's non-business type data, and the second database includes the doctor's business type label data, and then the first data and the second data are merged and processed to obtain the target text content; then, the target recommendation reason is generated based on the preset Prompt instruction, the query information and the target text content, wherein the preset Prompt instruction is used to indicate that a recommendation reason associated with the query information and conforming to a predetermined format is generated from the target text content. The target vector and the target label are both related to the query information, ensuring the correlation between the generated target recommendation reason and the query information, avoiding the problem of poor correlation between the recommendation reason and the user's main complaint in the related art; the first data and the second data are obtained through the first database and the second database respectively, avoiding the problem that the generated recommendation reason is not comprehensive enough due to the patchwork of only a few simple dimensions of the doctor in the related art; the target text content is obtained by merging the first data and the second data, and the target recommendation reason is generated from the target text content according to the preset Prompt instruction and is associated with the query information, and the generated target recommendation reason conforms to the predetermined format, avoiding the problem that the method using large model prediction in the related art is prone to fabrication and lack of factual basis; the purpose of improving the relevance and accuracy of the recommendation reason is achieved, and the effect of improving the user's consultation experience is achieved. The method in the related art only aggregates information from the doctor side to give the recommendation reason, ignoring the patient's main complaint and specific needs, resulting in the recommendation reason not matching the patient's actual situation. The method of the embodiment of the present application generates the recommendation reason by combining the query information (such as disease, symptoms, and intention) on the user side, thereby improving the matching degree between the patient and the doctor. In the related art, large models based on probability statistics are prone to generating recommendation reasons without factual basis or fabricated information, which affects the patient's judgment. The method of the embodiment of the present application ensures the accuracy and factual basis of the recommendation reasons by recalling doctor data (including non-business type and business type data) closely related to the query information from the database; by combining the query information on the user side and the multi-dimensional data of the doctor, a recommendation reason that is highly relevant to the patient's actual situation is generated, which effectively improves the matching degree of the recommendation reason, helps patients find a doctor that suits them faster, and achieves the effect of improving the user's consultation experience. By presetting the Prompt instruction, it ensures that the generated target recommendation reason is unified and standardized in format, improves the professionalism and readability of the recommendation reason, and facilitates patient understanding and acceptance.
[0041] The execution subject of the above steps may be a system or a platform, such as a doctor recommendation platform or a doctor recommendation system, or a large model in the platform, or a processor with human-computer interaction capabilities configured on a storage device, or a processing device or processing unit with similar processing capabilities, etc., but not limited thereto. The following takes the execution of the above operations by a large model in the platform as an example (only an exemplary description, in actual operation, other devices or modules may also be used to execute the above operations) for explanation.
[0042] In the above embodiment, in response to the query request from the user side, the platform can use the embedding capability of the big model to obtain the target vector corresponding to the query information from the user side. For example, the big model is used to convert the user's query information (or query) into a vector in a high-dimensional space, namely, embedding. The big model can also be used to extract disease, symptom, intention and other related labels from the query information, namely, when parsing the query, the big model can also identify the entity labels in the query. For example, for the user-side query "how to treat lung cancer", "lung cancer" can be identified as the disease label; or, for the user-side input query "I have been coughing a lot recently, what is the reason", the intent label can be identified as the intent of symptom consultation, or, for the query "are these symptoms of mine flu", the intent label can be identified as the intent of disease diagnosis, or, for the query "I have a cold, what medicine should I take", the intent label can be identified as the intent of treatment advice.
[0043] The above-mentioned first database includes vectors corresponding to non-business type data of multiple doctors. The non-business type data can be unstructured data about doctors, for example, doctor-related data captured or downloaded through network search, which can include personal profiles, academic content, forum posts or consultation conversations, etc. The first database includes vectors related to multiple doctors, each vector corresponds to a doctor ID, that is, the first database includes vectors corresponding to non-business type data of multiple doctor IDs; the above-mentioned second database includes business type label data of multiple doctors, for example, business type data can be historical data within the hospital, which can include different dimensions such as the number of doctor's consultations, evaluation data, completion rate, response time, etc. The label data in the second database can be business type data obtained after processing the historical data. Similarly, the second database includes label data related to multiple doctors, each label data corresponds to a doctor ID, that is, the second database includes business type label data of multiple doctor IDs.
[0044] This embodiment achieves rapid recall and merging by vectorizing query information and doctor data in the database, improves the efficiency of generating recommendation reasons, and meets the real-time requirements of online diagnosis and treatment services.
[0045] The first data and the second data are merged to obtain the target text content, so that the data related to the doctor's recommendation reasons will be more comprehensive and can better characterize the doctor's advantages; the above-mentioned preset Prompt instruction can instruct the large model in the platform to generate recommendation reasons associated with the query information and in a predetermined format from the target text content.
[0046] The above preset prompt instruction is also equivalent to a prompt template. As a direct input of the big model, in actual application, the above preset prompt instruction may include a task description. For example, if you are a medical expert, please strictly follow medical common sense and generate recommendation reasons related to the query information from the {target text content}. The recommendation reasons should follow the principles of ['rigorousness'] ['fluidity'] ['logical'] ['conciseness'], etc. The target recommendation reasons generated in this way are more logical, the sentences are more fluent, and they are easier to be recognized and trusted by users.
[0047] It should be noted that when responding to the query request from the user side, the platform will recommend one or more doctors. For example, other modules in the platform (or system) may automatically recommend one or more doctors. Each doctor corresponds to a doctor ID. The embodiment of the present application generates corresponding recommendation reasons for each doctor, that is, the big model is used to retrieve the multi-dimensional data of each doctor and generate a target recommendation reason associated with the query information and in a predetermined format. The other modules in the above platform can be understood as an upstream module of the big model.
[0048] In an optional embodiment, after generating a target recommendation reason based on a preset Prompt instruction, query information and target text content, the method further includes: returning the target recommendation reason to the user side.
[0049] In the above embodiment, after the target recommendation reason is generated, the target recommendation reason is returned to the user side, so that the user can view the doctor's target recommendation reason in time, which can meet the real-time requirements of online diagnosis and treatment services and improve the user experience and satisfaction of online diagnosis and treatment services. For example, the platform can display the target recommendation reason to the user, and the target recommendation reason can be displayed on the user side in the form of a dialog box. In actual applications, users can enter the platform for medical consultation through computers, mobile phones, iPADs or other terminal devices, and can obtain recommendation results in time. Timely and accurate return of the target recommendation reason enables users to find a suitable doctor more quickly, increases users' trust and satisfaction with the platform, and helps to improve the user stickiness and reputation of the platform. Returning the target recommendation reason to the user side also provides a basis for subsequent doctor-patient communication, appointment registration and other processes, making the entire online diagnosis and treatment business process smoother and more efficient.
[0050] In an optional embodiment, after generating the target recommendation reason based on the preset Prompt instruction, query information and target text content, the above method also includes: performing predetermined processing on the target recommendation reason to obtain a processed recommendation reason, wherein the predetermined processing includes at least one of the following: filtering processing, correction processing; and returning the processed recommendation reason to the user side.
[0051] In the above embodiment, after generating the target recommendation reason, the target recommendation reason may be subjected to a predetermined process to obtain the processed recommendation reason, and then the processed recommendation reason is returned to the user side. That is, before returning the recommendation reason to the user, the target recommendation reason is subjected to a predetermined process, for example, the target recommendation reason may be subjected to a filtering process and / or a correction process to obtain the processed recommendation reason. By filtering and correcting the target recommendation reason, redundant information may be removed, incorrect statements may be corrected, and the recommendation reason may be optimized according to the specific needs and context of the user, so that the returned recommendation reason is more accurate, comprehensive and applicable. The recommendation reason after the predetermined process is more in line with the user's expectations and needs, and the user's trust and satisfaction with the recommendation result is improved. Through the predetermined process, the format, language style, etc. of the recommendation reason may also be adjusted to make it easier to read and understand, and the readability and usability of the information may be improved. For example, the filtering process may be to filter out the recommendation reason with fewer words, or to filter out the sensitive data included in the recommendation reason, etc.; the correction process may be to adjust the order of the reasons of different dimensions included in the recommendation reason according to the severity of the patient's illness, or to correct some sensitive words in the recommendation reason, etc.
[0052] In an optional embodiment, the target recommendation reasons are subjected to predetermined processing to obtain processed recommendation reasons, including one of the following: filtering the target recommendation reasons according to preset filtering rules to obtain processed recommendation reasons; adjusting the order of reasons of different dimensions in the target recommendation reasons according to preset priority rules to obtain processed recommendation reasons, wherein the target recommendation reasons include reasons of multiple dimensions; filtering the target recommendation reasons according to preset filtering rules to obtain a first recommendation reason, adjusting the order of reasons of different dimensions in the first recommendation reason according to preset priority rules to obtain processed recommendation reasons, wherein the target recommendation reasons include reasons of multiple dimensions.
[0053] In the above embodiment, the target recommendation reasons can be filtered according to the preset filtering rules to obtain the processed recommendation reasons. For example, the recommendation reasons with fewer words can be filtered out, or the sensitive data included in the target recommendation reasons can be filtered out, or the repeated reasons appearing in the target recommendation reasons can be filtered out; or, the order of the reasons of different dimensions in the target recommendation reasons can be adjusted according to the preset priority rules to obtain the processed recommendation reasons. The aforementioned target recommendation reasons can include the recommendation reasons of multiple dimensions of the doctor. The recommendation reasons of the dimensions with relatively higher priorities can be arranged in the front, and the recommendation reasons of the dimensions with relatively lower priorities can be arranged in the back. For example, the recommendation reasons of dimension 1, dimension 2, and dimension N (N is a positive integer greater than 2) included in the originally generated target recommendation reasons are adjusted to the recommendation reasons of dimension N, dimension 1, and dimension 2; or, the target recommendation reasons are first filtered according to the preset filtering rules to obtain the first recommendation reason, and then the order of the reasons of different dimensions in the first recommendation reason is adjusted according to the preset priority rules to obtain the processed recommendation reason. The purpose of pre-processing the initial recommendation reason (i.e., the target recommendation reason) to obtain the processed recommendation reason is achieved, so that the processed recommendation reason is more reasonable. When the recommendation reason contains multiple dimensions, if there is no reasonable sorting rule, it may make it difficult for users to quickly grasp the core points of the recommendation, affecting the recommendation effect. Through the preset filtering rules, some recommendation reasons that are irrelevant to users, redundant or may have a negative impact can be eliminated to ensure that the remaining recommendation reasons are more accurate and relevant, thereby improving users' acceptance and trust in the recommended content; according to the preset priority rules, the recommendation reasons of multiple dimensions are sorted to ensure that the most important reasons are displayed to users first, helping users to quickly understand the core value of the recommendation and improve the conversion rate of the recommendation; through the optimization of the recommendation reasons, not only the quality of a single recommendation can be improved, but also the user satisfaction and conversion rate can be improved, which can significantly improve the user experience and recommendation effect of the recommendation system. Furthermore, the recommendation reasons can be customized for users in combination with the user's historical behavior, preferences and other data, which can further improve the user experience.
[0054] As an optional implementation, after generating the target recommendation reason based on the preset Prompt instruction, the query information and the target text content, the above method also includes: performing predetermined processing on the target recommendation reason in one of the following ways to obtain the processed recommendation reason: filtering the target recommendation reason according to the preset filtering rules to obtain the processed recommendation reason; adjusting the order of reasons of different dimensions in the target recommendation reason according to the preset priority rules to obtain the processed recommendation reason, wherein the target recommendation reason includes reasons of multiple dimensions; filtering the target recommendation reason according to the preset filtering rules to obtain the first recommendation reason, adjusting the order of reasons of different dimensions in the first recommendation reason according to the preset priority rules to obtain the processed recommendation reason, wherein the target recommendation reason includes reasons of multiple dimensions; and then returning the processed recommendation reason to the user side.
[0055] In an optional embodiment, the order of reasons of different dimensions in the target recommendation reasons is adjusted according to preset priority rules to obtain processed recommendation reasons, including: determining the target disease severity type corresponding to the query information; determining the target Prompt instruction corresponding to the target disease severity type, wherein the target Prompt instruction is used to indicate that the order of reasons of each dimension in the target recommendation reasons is adjusted according to preset priority rules; based on the target Prompt instruction and the target recommendation reasons, the processed recommendation reasons are obtained.
[0056] In the above embodiment, the target disease severity type of the patient can be determined according to the query information, for example, common diseases, serious diseases, or high-risk diseases, etc., and then the target Prompt instruction corresponding to the target disease severity type is determined to instruct the large model to adjust the order of the reasons of each dimension in the target recommendation reason according to the preset priority rule. The preset priority rule is the rule corresponding to the target disease severity type. For example, common diseases correspond to the first priority rule, serious diseases correspond to the second priority rule, and high-risk diseases correspond to the third priority rule. The order of the reasons of each dimension in each priority rule may be different. Diseases of different degrees have different focuses on the recommendation reasons. For example, minor diseases pay more attention to service quality, such as data of different dimensions such as the praise rate, response time, and number of consultations of a doctor in a certain disease; serious diseases pay attention to authority and relevance, such as high professional level, rich experience, high treatment level, etc., such as a doctor has published articles in core journals, or has won awards in the research of a certain disease, or a doctor's Fudan ranking, etc.; high-risk diseases pay more attention to registration plus services, such as whether a doctor is open or provides registration services. The above-mentioned service quality, authority, relevance, and registration plus sign can be understood as different recommendation dimensions. For different types of disease severity, the order of each recommendation dimension may be different, and the reasons included in each recommendation dimension may include one or more non-business type reasons, or one or more business type reasons. By introducing the target prompt instruction and preset priority rules, dynamic adjustment and personalized display of recommendation reasons are realized, so that the system can automatically adjust the order of recommendation reasons according to the user's query information, improving the intelligence level and response speed of the system. By optimizing the presentation of recommendation reasons, not only the user experience and the credibility of the recommendation are improved, but also the intelligence level and resource utilization efficiency of the recommendation system are improved.
[0057] In an optional embodiment, in response to a query request from a user side, a target vector and a target label corresponding to the query information from the user side are obtained, including: in response to the query request from the user side, using the embedding capability of the big model to generate a target vector corresponding to the query information, and using the big model to extract labels associated with the condition and / or intent from the query information to obtain the target label.
[0058] In the above embodiment, the embedding capability of the big model in the platform is used to generate a target vector corresponding to the query information, that is, the user's query information (or query) is converted into a vector in a high-dimensional space, which can capture the semantic information of the query for subsequent recall operations, for example, it can be compared with the vector in the first database for similarity to obtain the first data; the big model in the platform can also be used to extract labels associated with the condition and / or intention from the query information, for example, it can be a label of at least one of the disease label, symptom label and intention label. For example, for the user-side query "how to treat lung cancer", "lung cancer" can be identified as a disease label; or, for the user-side input query "I have been coughing recently, what is the reason", it can be identified that the intention label is symptom consultation, or, for the query "are these symptoms of mine flu", it can be identified that the intention label is disease diagnosis, or, for the query "I have a cold, what medicine should I take", it can be identified that the intention label is treatment advice. By using the embedding capability of the large model, the text information in the user query (i.e., query information) can be converted into a high-dimensional vector representation. This vector representation can more accurately capture the semantics and contextual information of the text, thereby improving the system's ability to understand and express user queries; the large model has learned a wealth of knowledge and patterns through pre-training, and can automatically extract labels that are closely related to the condition and / or intention from the user's query information. These labels are not only highly accurate, but also have a wide coverage, providing strong support for subsequent recommendations, diagnoses, and other processing. In this embodiment, by using the embedding capability and label extraction capability of the large model, the system's information understanding and expression capabilities, the accuracy and comprehensiveness of label extraction are improved, the development of personalized and intelligent services is promoted, and the overall efficiency and user experience are improved.
[0059] In an optional embodiment, before recalling the first data from the first database according to the target vector and recalling the second data from the second database according to the target label, the method further includes: constructing a first database and a second database, wherein the first database is obtained in the following manner: obtaining the doctor's unstructured data, wherein the unstructured data is non-business type data of the doctor captured by searching the entire network; slicing the unstructured data to obtain sliced data; converting the sliced data into vectors; and storing the vectors in the first database; the second database is obtained in the following manner: obtaining the doctor's structured data, wherein the structured data includes the doctor's historical business data; processing the structured data to obtain business type label data; and storing the label data in the second database.
[0060] In the above embodiment, the first database and the second database can be pre-built, wherein the first database is obtained by slicing the unstructured data of the acquired doctor to obtain slice data, and then using the embedding capability of the large model to convert the slice data into vectors and store them in the first database; the second database is obtained by processing the acquired historical business data of the doctor to obtain business type label data, and storing the label data in the second database. In the field of medical health, doctors' data are often scattered in multiple sources, including unstructured data and structured data, which have large differences in format, structure and content. The raw data that has not been processed and sorted is inefficient in query and retrieval, and it is difficult to meet the needs of rapid response and accurate matching. By effectively integrating and processing unstructured data, and processing structured data to generate business type label data, the overall utilization efficiency of data is improved; converting unstructured data into vectors and storing them in the first database enables the system to use efficient algorithms such as vector space search to quickly retrieve data related to user queries. The business type label data stored in the second database further improves the accuracy of data matching and helps provide users with more personalized services. By processing structured data, detailed business type label data is generated. These labels not only accurately describe the doctor's business capabilities and expertise, but also provide rich matching dimensions for user queries, which helps to improve the intelligence level of the system and provide users with more comprehensive and accurate medical service recommendations. By building two specially designed databases (the first database and the second database), the complexity of data integration and processing in the medical and health field, the inefficiency of data utilization, and the lack and inaccuracy of data labels are solved, and accurate retrieval and efficient use of data are achieved, providing users with a more personalized and intelligent medical service experience.
[0061] In an optional embodiment, recalling first data from a first database based on a target vector, and recalling second data from a second database based on a target tag, includes: recalling first data from the first database based on a target vector and a target doctor ID, wherein the target doctor ID is the ID of a doctor recommended by the recommendation system in response to a query request, and the first data includes a vector that matches the target doctor ID and has a similarity to the target vector greater than a preset similarity threshold; recalling second data from the second database based on the target tag and the target doctor ID, wherein the second data includes tag data that matches the target doctor ID and matches the target tag.
[0062] In the above embodiment, the first database includes vectors corresponding to non-business type data of multiple doctor IDs, each vector corresponds to a doctor ID, and the second database includes business type label data of multiple doctor IDs, each label data corresponds to a doctor ID; the first database searches for a vector whose similarity with the target vector is greater than a preset similarity threshold and whose doctor ID is the target doctor ID to obtain the first data, and the second database searches for data matching the target label and whose doctor ID is the target doctor ID to obtain the second data, that is, the first data and the second data are both data corresponding to the target doctor ID. Vectors with high similarity to the target vector are screened out from the first database, thereby ensuring that the recalled first data is highly relevant to the user query; at the same time, accurate matching based on labels ensures that the second data recalled from the second database is also closely related to the user query; the purpose of accurately recalling relevant data from two different databases is achieved, which not only improves the accuracy and efficiency of data retrieval, but also realizes the effective integration of multi-source data and personalized recommendation services, providing users with a better quality and efficient medical and health service experience. In actual applications, in response to a query request from the user side, the platform will recommend one or more doctors. For example, other modules in the platform (or system) may automatically recommend one or more doctors, and each doctor corresponds to a doctor ID. For example, the recommended doctors include the doctor corresponding to the target doctor ID. In an embodiment of the present application, for the target doctor ID, a vector having a similarity with the target vector greater than a preset similarity threshold is searched in the first database to obtain first data, and for the target doctor ID, data matching the target label is searched in the second database to obtain second data.
[0063] It should be noted that the above-described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. The present application will be described in detail below in conjunction with specific embodiments.
[0064] The embodiment of the present application provides a method for generating recommendation reasons based on RAG. First, the doctor's structured or unstructured data is processed through a series of processes and stored in a corresponding database. When the patient inputs a query, the query is used to generate embeddings and entity labels such as diseases and symptoms with the help of the big model capability. After two recalls: embedding recall and label recall, the doctor's unstructured slices and structured business indicator data are recalled respectively, and the two recalled data are merged. The prompt for generating the recommendation reason is added to the query information to ensure the relevance of the generated recommendation reason to the query.
[0065] Figure 2 This is a flow chart of a method for generating a recommendation reason based on RAG provided in an embodiment of the present application. Figure 2 The embodiments of the present application are described in detail.
[0066] 1. Data preparation stage
[0067] (1) External data: Search the entire Internet to capture or download doctor-related data, including the doctor’s hospital profile, department profile, personal profile, academic content, and forum post content;
[0068] (2) Internal data: Process internal historical data (including consultation data, evaluation data, edited content, note content, etc.) to obtain business indicator data and label data of the doctor's disease dimension, such as the number of consultations a doctor has received for a certain disease, response time, praise rate, and other related feature labels.
[0069] 2. Data database construction
[0070] (1) Slice the doctor's unstructured data (hospital profile, department profile, academic content, edited content, doctor's notes, evaluation content, etc.) (slice according to the length of the slice and the completeness of the sentence), then call the embedding capability of the big model to convert the slice into an embedding, and store the embedding and slice content and related data (title, abstract, etc.) into a vector database (corresponding to the first database mentioned above);
[0071] (2) Store the processed internal business indicator data or label data (the main label is the disease label) in the ES database (corresponding to the aforementioned second database) to facilitate retrieval by label.
[0072] 3. Patient-side query processing
[0073] (1) Query vectorization
[0074] Generate a query vector (corresponding to the target vector) using the embedding capability of the large model.
[0075] (2) Query labeling
[0076] Utilize the extraction capabilities of the large model to extract disease, symptom, intention and other related labels (corresponding to the aforementioned target labels) from the query.
[0077] 4. Multi-channel recall
[0078] (1) Vector recall
[0079] Recall the doctor-related slice content (academic content, comment content, edited content, doctor's notes, etc.) in the vector database through the query vector and doctor ID;
[0080] (2) Label recall
[0081] The labels extracted from the big model, mainly diseases, are used to recall the doctor's related business indicator data (number of consultations, response time, praise rate, etc.) in combination with the doctor's ID, and all the English label names and indicator names are converted into Chinese characters. This big model can better understand the meaning of the business field.
[0082] 5. Recall data merging
[0083] The multi-channel recalled data is first assigned an index ID, and then merged and spliced. The merged content is represented by the Content field.
[0084] 6. Build a prompt to generate the doctor's recommendation reason
[0085] As the direct input of the big model, prompt is a key factor affecting the output accuracy and high quality. In the RAG scenario, prompt generally includes task description, background knowledge (retrieval slice), task instruction (usually user questions, such as query). In addition, other instructions can be added to optimize the output of the big model. The prompt example is as follows:
[0086]
Task Description
[0087] If you are a medical expert, please strictly follow medical common sense and generate recommendation reasons related to the query from {content}. The recommendation reasons should follow the principles of ['rigorousness'] ['fluidity'] ['logical'] ['conciseness']. At the same time, you should display the reference source in the generated recommendation reasons;
[0088]
Content
[0089] {Content}: the content generated by merging and concatenating in (5) above (corresponding to the target text content mentioned above);
[0090]
Query
[0091] {query}: The query entered by the user. Taking the query as input makes it easier for the big model to understand the user’s core demands and accurately give reasons for recommendations based on the query.
[0092] 7. Call the big model to generate recommendation reasons
[0093] Use the Prompt constructed above as the input of the big model, call the big model, and return the result.
[0094] 8. Return the generated recommendation reasons to the patient
[0095] The recommendation reasons generated by the large model (corresponding to the aforementioned target recommendation reasons) are processed and filtered accordingly and finally returned to the user side.
[0096] Figure 3 is a flowchart of processing the recommendation reasons provided in the embodiment of the present application, such as Figure 3 As shown, the whole process is divided into two stages: filtering and correction.
[0097] (1) Filter
[0098] First, we need to filter out the recommendation reasons with fewer words, because the information presented to the patient is less convincing, which will affect the patient's trust in the recommendation reasons; for example, filter out the recommendation reasons with less than 20 (or other number) words;
[0099] Second, it is necessary to filter sensitive data, including personal information (name, contact information, account number, etc.) and keywords on the company's blacklist. For example, security and privacy leakage detection is performed, including personal privacy detection and blacklist keyword detection, and the recommended reasons that hit security and privacy are filtered out to obtain the filtered recommended reasons.
[0100] (2) Correction
[0101] Determine the severity of the patient's illness based on the query, and adjust the order of different dimensions of the recommendation reasons based on the priority of different severity levels; for example, identify the disease through the query and determine the severity of the disease;
[0102] Diseases of different severity have different focuses on recommendation reasons. For example, minor illnesses focus more on service popularization, prevention and precautions; serious illnesses focus more on high level of professionalism, rich experience and high level of treatment; the second is registration.
[0103] The specific priority settings are shown in Table 1.
[0104] Table 1
[0105]
[0106] Different prompts are constructed based on the patient's priority level. The prompts are merged with the filtered recommendation reasons and input into the large model for correction. Finally, the corrected recommendation reasons (corresponding to the recommendation reasons after the aforementioned processing) are returned.
[0107] Compared with the related art, the embodiments of the present application have at least the following advantages: 1) RAG technology is used to ensure that the generated recommendation reasons are well-founded and avoid fabrication; 2) RAG technology can be used to more comprehensively recall doctor information and improve the rationality of the recommendation reasons; 3) A query is added to the constructed Prompt to improve the relevance of the generated recommendation reasons to the query.
[0108] The present application also provides a recommendation reason generating device, such as Figure 4 As shown, Figure 4 : is a structural block diagram of a device for generating recommendation reasons provided in an embodiment of the present application, the device comprising:
[0109] The response module 401 is used to respond to the query request of the user side and obtain a target vector and a target label corresponding to the query information of the user side, wherein the target vector is obtained by converting the query information, and the target label includes at least one of the following: a disease label, a symptom label, and an intention label;
[0110] A recall module 402, configured to recall first data from a first database according to a target vector, and to recall second data from a second database according to a target label, wherein the first database includes vectors corresponding to non-business type data of doctors, and the second database includes label data of business type of doctors;
[0111] A merging module 403 is used to merge the first data and the second data to obtain target text content;
[0112] The generation module 404 is used to generate a target recommendation reason based on a preset Prompt instruction, query information and target text content. The preset Prompt instruction is used to instruct to generate a recommendation reason associated with the query information and conforming to a predetermined format from the target text content.
[0113] In an optional embodiment, the above-mentioned device also includes: a return module, which is used to return the target recommendation reason to the user side after generating the target recommendation reason based on the preset Prompt instruction, query information and target text content.
[0114] In an optional embodiment, the above-mentioned device also includes: a processing module, which is used to perform predetermined processing on the target recommendation reason after generating the target recommendation reason based on the preset Prompt instruction, query information and target text content, to obtain a processed recommendation reason, wherein the predetermined processing includes at least one of the following: filtering processing, correction processing; and returning the processed recommendation reason to the user side.
[0115] In an optional embodiment, the above-mentioned processing module includes one of the following: a first processing unit, used to filter the target recommendation reasons according to preset filtering rules to obtain processed recommendation reasons; a second processing unit, used to adjust the order of reasons of different dimensions in the target recommendation reasons according to preset priority rules to obtain processed recommendation reasons, wherein the target recommendation reasons include reasons of multiple dimensions; a third processing unit, used to filter the target recommendation reasons according to preset filtering rules to obtain the first recommendation reason, adjust the order of reasons of different dimensions in the first recommendation reason according to preset priority rules to obtain processed recommendation reasons, wherein the target recommendation reasons include reasons of multiple dimensions.
[0116] In an optional embodiment, the response module 401 includes: a response unit, used to respond to a query request from the user side, generate a target vector corresponding to the query information using the embedding capability of the big model, and extract labels associated with the condition and / or intention from the query information using the big model to obtain a target label.
[0117] In an optional embodiment, the above-mentioned device also includes: a construction module, which is used to construct the first database and the second database before recalling the first data from the first database according to the target vector and recalling the second data from the second database according to the target label, wherein the first database is obtained in the following manner: obtaining the doctor's unstructured data, wherein the unstructured data is the doctor's non-business type data captured by searching the entire network; slicing the unstructured data to obtain sliced data; converting the sliced data into vectors; and storing the vectors in the first database; the second database is obtained in the following manner: obtaining the doctor's structured data, wherein the structured data includes the doctor's historical business data; processing the structured data to obtain business type label data; and storing the label data in the second database.
[0118] In an optional embodiment, the recall module 402 includes: a first recall unit, used to recall first data from a first database based on a target vector and a target doctor ID, wherein the target doctor ID is the ID of a doctor recommended by the recommendation system in response to a query request, and the first data includes a vector that matches the target doctor ID and has a similarity with the target vector greater than a preset similarity threshold; a second recall unit, used to recall second data from a second database based on a target label and a target doctor ID, wherein the second data includes label data that matches the target doctor ID and matches the target label.
[0119] Other device embodiments correspond to the aforementioned method embodiments, and other technical features can be found in the previous embodiments, which will not be repeated here.
[0120] The present application also provides a computer-readable storage medium, in which instructions are stored. When the instructions are executed, any one of the method steps described above is executed.
[0121] In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to, various media that can store computer programs, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk.
[0122] The present application also discloses an electronic device. Figure 5 As shown, Figure 5 The electronic device 500 may include: at least one processor 501 , at least one network interface 504 , a user interface 503 , a memory 505 , and at least one communication bus 502 .
[0123] The communication bus 502 is used to realize the connection and communication between these components.
[0124] The user interface 503 may include a display screen (Display) and a camera (Camera). Optionally, the user interface 503 may also include a standard wired interface and a wireless interface.
[0125] The network interface 504 may optionally include a standard wired interface or a wireless interface (such as a WI-FI interface).
[0126] Among them, the processor 501 may include one or more processing cores. The processor 501 uses various interfaces and lines to connect various parts of the entire electronic device (such as a server), and executes various functions of the server and processes data by running or executing instructions, programs, code sets or instruction sets stored in the memory 505, and calling data stored in the memory 505. Optionally, the processor 501 can be implemented in at least one hardware form of digital signal processing (Digital Signal Processing, DSP), field programmable gate array (Field-Programmable Gate Array, FPGA), and programmable logic array (Programmable Logic Array, PLA). The processor 501 can integrate one or a combination of a central processing unit (Central Processing Unit, CPU), a graphics processing unit (Graphics Processing Unit, GPU) and a modem. Among them, the CPU mainly processes the operating system, user interface and application programs; the GPU is responsible for rendering and drawing the content to be displayed on the display screen; the modem is used to process wireless communications. It can be understood that the above-mentioned modem may not be integrated into the processor 501, and it can be implemented separately through a chip.
[0127] Among them, the memory 505 may include a random access memory (Random Access Memory, RAM) and may also include a read-only memory (Read-Only Memory). Optionally, the memory 505 includes a non-transitory computer-readable storage medium. The memory 505 can be used to store instructions, programs, codes, code sets or instruction sets. The memory 505 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for at least one function (such as a touch function, a sound playback function, an image playback function, etc.), instructions for implementing the above-mentioned various method embodiments, etc.; the data storage area may store data involved in the above-mentioned various method embodiments, etc. The memory 505 may also be optionally at least one storage device located away from the aforementioned processor 501. Refer to Figure 5 , the memory 505 as a computer storage medium may include an operating system, a network communication module, a user interface module and an application program of a method for generating a recommendation reason.
[0128] exist Figure 5In the electronic device 500 shown, the user interface 503 is mainly used to provide an input interface for the user and obtain the data input by the user; and the processor 501 can be used to call an application program of a method for generating a recommendation reason stored in the memory 505, and when executed by one or more processors 501, the electronic device 500 executes one or more of the methods described in the above embodiments. It should be noted that for the aforementioned method embodiments, for the sake of simple description, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited to the described order of actions, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required for the present application.
[0129] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0130] In the several embodiments provided in this application, it should be understood that the disclosed devices can be implemented in other ways. For example, the device embodiments described above are only schematic, such as the division of units, which is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some service interfaces, and the indirect coupling or communication connection of devices or units can be electrical or other forms.
[0131] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0132] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0133] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable memory. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a memory and includes several instructions for a computer device (which can be a personal computer, server or network device, etc.) to execute all or part of the steps of the various embodiments of the present application. The aforementioned memory includes: various media that can store program codes, such as USB flash drives, mobile hard drives, magnetic disks or optical disks.
[0134] The above is only an exemplary embodiment of the present disclosure and cannot be used to limit the scope of the present disclosure. That is, any equivalent changes and modifications made according to the teachings of the present disclosure are still within the scope of the present disclosure. After considering the disclosure of the specification and the truth of practice, those skilled in the art will easily think of other embodiments of the present disclosure.
[0135] This application is intended to cover any modifications, uses or adaptations of the present disclosure, which follow the general principles of the present disclosure and include common knowledge or customary technical means in the technical field not recorded in the present disclosure.
Claims
1. A method for generating a recommendation reason, characterized in that: include: In response to a query request from a user side, a target vector and a target label corresponding to the query information from the user side are obtained, wherein the target vector is obtained by converting the query information, and the target label includes at least one of the following: a disease label, a symptom label, and an intention label; Recalling first data from a first database according to the target vector, and recalling second data from a second database according to the target label, wherein the first database includes vectors corresponding to non-business type data of doctors, and the second database includes label data of business type of doctors; Merging the first data and the second data to obtain target text content; Generate a target recommendation reason based on a preset Prompt instruction, the query information and the target text content, wherein the preset Prompt instruction is used to instruct to generate a recommendation reason associated with the query information and conforming to a predetermined format from the target text content; Wherein, after generating a target recommendation reason based on a preset Prompt instruction, the query information and the target text content, the method further includes: Performing a predetermined process on the target recommendation reason to obtain a processed recommendation reason, wherein the predetermined process includes: correction processing; returning the processed recommendation reason to the user side; The target recommendation reasons are subjected to predetermined processing to obtain processed recommendation reasons, including: adjusting the order of reasons of different dimensions in the target recommendation reasons according to preset priority rules to obtain the processed recommendation reasons, wherein the target recommendation reasons include reasons of multiple dimensions.
2. The method according to claim 1, characterized in that The predetermined processing also includes: filtering processing.
3. The method according to claim 2, characterized in that Performing a predetermined process on the target recommendation reason to obtain a processed recommendation reason also includes one of the following: Filter the target recommendation reasons according to preset filtering rules to obtain the processed recommendation reasons; The target recommendation reason is filtered according to preset filtering rules to obtain a first recommendation reason, and the order of reasons of different dimensions in the first recommendation reason is adjusted according to preset priority rules to obtain the processed recommendation reason, wherein the target recommendation reason includes reasons of multiple dimensions.
4. The method according to claim 1, characterized in that: In response to a query request from a user side, a target vector and a target label corresponding to the query information from the user side are obtained, including: In response to the query request from the user side, the target vector corresponding to the query information is generated using the embedding capability of the large model, and the label associated with the condition and / or intention is extracted from the query information using the large model to obtain the target label.
5. The method according to claim 1, characterized in that Before recalling the first data from the first database according to the target vector and recalling the second data from the second database according to the target label, the method further includes: The first database and the second database are constructed, wherein: The first database is obtained in the following manner: obtaining unstructured data of doctors, wherein the unstructured data is non-business data of doctors captured by searching the entire network; slicing the unstructured data to obtain sliced data; converting the sliced data into the vector; and storing the vector in the first database; The second database is obtained in the following manner: acquiring the doctor's structured data, wherein the structured data includes the doctor's historical business data; processing the structured data to obtain business type label data; and storing the label data in the second database.
6. The method according to claim 1, characterized in that Recalling first data from a first database according to the target vector, and recalling second data from a second database according to the target label, comprising: Recalling the first data from the first database according to the target vector and a target doctor ID, wherein the target doctor ID is an ID of a doctor recommended by the recommendation system in response to the query request, and the first data includes a vector that matches the target doctor ID and has a similarity with the target vector greater than a preset similarity threshold; The second data is recalled from the second database according to the target tag and the target doctor ID, wherein the second data includes tag data matching the target doctor ID and matching the target tag.
7. A device for generating a recommendation reason, characterized in that: include: A response module, configured to respond to a query request from a user side and obtain a target vector and a target label corresponding to the query information from the user side, wherein the target vector is obtained by converting the query information, and the target label includes at least one of the following: a disease label, a symptom label, and an intention label; A recall module, configured to recall first data from a first database according to the target vector, and to recall second data from a second database according to the target label, wherein the first database includes vectors corresponding to non-business type data of doctors, and the second database includes label data of business type of doctors; A merging module, used for merging the first data and the second data to obtain target text content; A generating module, configured to generate a target recommendation reason based on a preset Prompt instruction, the query information and the target text content, wherein the preset Prompt instruction is used to instruct to generate a recommendation reason associated with the query information and conforming to a predetermined format from the target text content; The device further comprises: a processing module, which is used to perform a predetermined process on the target recommendation reason after generating the target recommendation reason based on the preset prompt instruction, the query information and the target text content, so as to obtain the processed recommendation reason, wherein the predetermined process comprises: a correction process; and returning the processed recommendation reason to the user side; Among them, the above-mentioned processing module includes: a second processing unit, which is used to adjust the order of reasons of different dimensions in the target recommendation reasons according to a preset priority rule to obtain the processed recommendation reasons, wherein the target recommendation reasons include reasons of multiple dimensions.
8. An electronic device comprising a memory and a processor, wherein a computer program is stored in the memory, wherein: When the processor executes the program, the method according to any one of claims 1 to 6 is implemented.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores instructions, and when the instructions are executed, the method according to any one of claims 1 to 6 is performed.
Citation Information
Patent Citations
Medical auxiliary question and answer method and system based on knowledge calibration and retrieval enhancement
CN117573843A