Searching method and device, electronic equipment, storage medium and program product
By dynamically switching between medical search engines and general search engines, the shortcomings of vertical search engines in non-core medical issues are solved according to the domain and scenario classification results of user query, and more efficient and relevant search results are achieved, improving user experience.
Patent Information
- Application Number
- CN202510687475.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-27
- Publication Date
- 2025-07-01
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
When facing non-core medical problems, vertical search engines in the existing medical field find it difficult to return search results that are satisfactory to users, resulting in a decline in user experience.
By receiving user query information, input it into the domain classification model to determine its domain, and calling a matching medical search engine or general search engine to process the query information, dynamically adjusting the search strategy to meet different medical needs and non-medical needs.
It improves the relevance and efficiency of search results, meets diversified and professional query needs, and enhances the user experience.
Smart Images

Figure CN120234476A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of search technology, and in particular, to a search method, device, electronic device, storage medium, and program product. Background Art
[0002] With the rapid development of the medical and health industry and the continuous improvement of the informatization level, the retrieval demand of users for medical-related information shows a rapid growth trend. Therefore, it is necessary to build a search engine and search method for the medical field.
[0003] Currently, for the search demand in the medical field, a vertical search engine based on a medical knowledge base is mainly built to process user query information. However, many user queries are not core medical problems. Facing non-core medical problems, such as "the benefits of taking a walk after meals" or "what to do if a cat has diarrhea" and other pan-medical or cross-domain scenarios, the existing vertical search engines for the medical field often cannot return satisfactory results to users due to domain matching failures for these user query information, resulting in a decline in the user experience. Summary of the Invention
[0004] The present invention provides a search method, device, electronic device, storage medium, and program product to solve the defect of poor user search experience in the prior art and achieve a high-experience search method.
[0005] The present invention provides a search method, including: Receiving user query information; Inputting the user query information into a domain classification model to obtain a domain classification result output by the domain classification model; the domain classification model is used to determine the domain to which the user query information belongs; Invoking a search engine matching the domain classification result to process the user query information to obtain a search result; wherein, the search engine includes a medical search engine or a general search engine.
[0006] According to the search method provided by the present invention, the step of invoking a search engine matching the domain classification result to process the user query information to obtain a search result includes: In the case where it is determined based on the domain classification result that the user query information belongs to the medical field, inputting the user query information into a scenario classification model to obtain a scenario classification result output by the scenario classification model; the scenario classification model is used to determine the scenario to which the user query information belongs and the scenarios with different degrees of medical needs; Invoking a search engine matching the scenario classification result to process the user query information to obtain a search result; When it is determined that the user query information belongs to the non-medical field based on the field classification result, the general search engine is called to process the user query information to obtain search results; Among them, the medical search engine includes search engines for searching different degrees of medical needs.
[0007] According to a search method provided by the present invention, the scenario classification result includes at least one of a core medical scenario, a general medical scenario, and a non-medical scenario; The medical search engine includes a core medical search engine for searching the first degree of medical needs and a general medical search engine for searching the second degree of medical needs, and the first degree of medical needs is greater than the second degree of medical needs; The core medical scenario matches the core medical search engine, the general medical scenario matches the general medical search engine, and the non-medical scenario matches the general search engine.
[0008] According to a search method provided by the present invention, the core medical scenario includes core medical sub-scenarios with different needs; the general medical scenario includes general medical sub-scenarios with different needs; Among them, the target core medical search engine searches based on real-time data, and the target core medical search engine is a core medical search engine that matches the real-time core medical sub-scenario; the target general medical search engine searches based on real-time data, and the target general medical search engine is a general medical search engine that matches the real-time general medical sub-scenario.
[0009] According to a search method provided by the present invention, the scenario classification result includes multiple scenarios; Correspondingly, the calling of the search engine that matches the scenario classification result to process the user query information to obtain search results includes: Calling the search engines that respectively match the multiple scenarios to process the user query information to obtain sub-search results output by multiple search engines; Based on the confidence levels of the multiple scenarios, determining the priorities of the sub-search results; Based on the priorities, sorting the sub-search results to obtain search results.
[0010] According to a search method provided by the present invention, after inputting the user query information into the field classification model to obtain the field classification result output by the field classification model, it further includes: When the confidence level of the field classification result is less than the field confidence level threshold, calling the general search engine to process the user query information to obtain search results; In the case where the confidence level of the domain classification result is greater than or equal to the domain confidence level threshold, perform the step of calling a search engine that matches the domain classification result to process the user query information to obtain a search result.
[0011] According to a search method provided by the present invention, in the case where it is determined based on the domain classification result that the user query information belongs to the medical field, the domain confidence level threshold is the first confidence level threshold; In the case where it is determined based on the domain classification result that the user query information belongs to a non-medical field, the domain confidence level threshold is the second confidence level threshold; Wherein, the first confidence level threshold is less than the second confidence level threshold.
[0012] According to a search method provided by the present invention, after calling a search engine that matches the domain classification result to process the user query information to obtain a search result, it further includes: In the case where the search result is empty or the confidence level of the search result is less than the first preset confidence level threshold, call the general search engine to process the user query information to obtain a new search result.
[0013] According to a search method provided by the present invention, the step of inputting the user query information into a domain classification model to obtain a domain classification result output by the domain classification model includes: Input the user query information into a domain classification model to obtain an initial domain classification result output by the domain classification model; In the case where the confidence level of the initial domain classification result is less than the second preset confidence level threshold, determine the domain classification result of the user query information by using a preset domain classification method; In the case where the confidence level of the initial domain classification result is greater than or equal to the second preset confidence level threshold, determine the initial domain classification result as the domain classification result.
[0014] According to a search method provided by the present invention, the domain classification model is trained based on the following method: Input a user query information test sample into a pre-trained domain classification model to obtain classification probabilities of multiple prediction results output by the domain classification model; Based on each of the classification probabilities, determine the information entropy of the multiple prediction results; In the case where the information entropy is greater than a preset information entropy threshold, determine the user query information test sample as a difficult negative sample; Based on the difficult negative sample and its corresponding domain classification result label, retrain the domain classification model.
[0015] A search method provided by the present invention, the receiving of user query information includes: Receiving the original query information input by the user; Inputting the original query information into a query rewriting model to obtain the user query information output by the query rewriting model; Wherein, the query rewriting model is constructed based on a large model, and the query rewriting model is used to perform at least one of the following rewriting processes: error correction processing, synonym rewriting processing, redundant content deletion processing, and multi-round dialogue context optimization processing, and the multi-round dialogue context optimization processing is used to rewrite the current user query information based on historical user query information.
[0016] A search method provided by the present invention, before inputting the original query information into a query rewriting model to obtain the user query information output by the query rewriting model, further includes: Analyzing the query semantic type of the original query information to input the query semantic type and the original query information into the query rewriting model together; and / or, Decomposing the content of the original query information to obtain several content information, and inputting the several content information and the original query information into the query rewriting model together; the several content information includes at least one of core keyword information, modifier information, and context type information.
[0017] The present invention also provides a search device, including: A receiving module, configured to receive user query information; A classification module, configured to input the user query information into a domain classification model to obtain a domain classification result output by the domain classification model; the domain classification model is used to determine the domain to which the user query information belongs; A search module, configured to call a search engine matching the domain classification result to process the user query information to obtain a search result; Wherein, the search engine includes a medical search engine or a general search engine.
[0018] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor, and when the processor executes the program, it implements the search method as described in any one of the above.
[0019] The present invention also provides a non-transitory computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, it implements the search method as described in any one of the above.
[0020] The present invention also provides a computer program product, including a computer program, which, when executed by a processor, implements the search method as described in any one of the above.
[0021] For the search method, device, electronic device, storage medium and program product provided by the present invention, the received user query information is input into the domain classification model to obtain the domain classification result output by the domain classification model, and the domain classification model is used to determine the domain to which the user query information belongs, so as to call the search engine that matches the domain classification result to process the user query information. The search engine includes a medical search engine or a general search engine. Thus, when it is determined based on the domain classification result that the user query information belongs to the medical field, the search engine that matches the domain classification result is the medical search engine. Therefore, for medical problems, more professional search results can be obtained, and the medical search engine only retrieves in medical data, thereby improving the search efficiency, that is, improving the search effect, and further improving the user experience. When it is determined based on the domain classification result that the user query information belongs to a non-medical field, the search engine that matches the domain classification result is the general search engine. Therefore, for non-medical problems, corresponding search results can also be obtained, that is, diverse query needs can be satisfied, and further the user experience is improved. In summary, the present invention dynamically adjusts the search strategy based on the domain classification result, thereby ensuring the relevance and efficiency of the search result, that is, integrating the advantages of the medical search engine and the general search engine, ensuring the precise matching of the search strategy and the query intention, thereby satisfying diverse and professional query needs, and further improving the user's search experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following will briefly introduce the drawings required for the description of the embodiments or the prior art. Obviously, the drawings in the following description are some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0023] Figure 1 is one of the flow diagrams of the search method provided by the present invention.
[0024] Figure 2 is another flow diagram of the search method provided by the present invention.
[0025] Figure 3 is yet another flow diagram of the search method provided by the present invention.
[0026] Figure 4 is still another flow diagram of the search method provided by the present invention.
[0027] Figure 5It is the fifth flowchart diagram of the search method provided by the present invention.
[0028] Figure 6 It is the sixth flowchart diagram of the search method provided by the present invention.
[0029] Figure 7 It is the seventh flowchart diagram of the search method provided by the present invention.
[0030] Figure 8 It is the structural schematic diagram of the search device provided by the present invention.
[0031] Figure 9 It is the structural schematic diagram of the electronic device provided by the present invention. Detailed implementation manners
[0032] To make the objectives, technical solutions and advantages of the present invention clearer, the technical solutions in the present invention will be clearly and completely described below with reference to the accompanying drawings in the present invention. Apparently, the described embodiments are some but not all of the embodiments of the present invention. All other embodiments obtained by those of ordinary skill in the art based on the embodiments in the present invention without making creative efforts shall fall within the protection scope of the present invention.
[0033] Currently, for the search requirements in the medical field, most search solutions are to build vertical search engines based on medical knowledge bases. However, for non-core medical problems, the search effect is poor and the user experience is not good.
[0034] In view of the poor search effect of the current search solutions for non-core medical problems, the present invention has conducted research. The initial idea was to directly use a general search engine. However, although the general search engine has significant advantages in terms of coverage and content diversity, for user queries in the medical field, the quality of its search results is low, that is, the quality of search results in core medical scenarios is low. For example, for professional requirements (such as "the latest treatment plan for heart disease"), the results returned by the general search engine usually lack authority and accuracy and are difficult to meet the high standards of users for medical information. Moreover, the search results of the general search engine are disordered and unreliable, with authoritative content mixed with low-quality source information in the search results, which is difficult for users to effectively distinguish, and may thus lead to misjudgment or wrong decisions.
[0035] In view of the problems existing in the above idea, the present invention continued to conduct research. During the research process, it was thought to first perform simple scenario classification and then call a medical search engine or a general search engine based on the classification results. However, it is difficult to adapt to the diverse and complex expression methods of users by classifying scenarios based on fixed rules or keyword matching methods. For example, user queries such as "dietary precautions for hypertension" and "how to eat well for hypertension" may express the same intention, but fixed rules are difficult to accurately identify.
[0036] In view of the deficiencies existing in the simple scenario classification described above, through continuous research, the present invention finally proposes a search method. This search method first inputs the user query information into the domain classification model, and then calls a medical search engine or a general search engine based on the domain classification result, so as to achieve efficient search for both core medical problems and non-core medical problems.
[0037] Next, the search method provided by the present invention will be introduced through the following embodiments. The following combines Figures 1-7 Describe the search method of the present invention.
[0038] Figure 1 is one of the flow schematic diagrams of the search method provided by the present invention. As Figure 1 shown, this search method includes the following steps 110, step 120, and step 130.
[0039] Step 110, receive the user query information.
[0040] Here, the user query information is the query information input by the user. This user query information can be a user query text, which can be directly input by the user or the user's voice can be collected and converted into a user query text. No specific limitation is made here.
[0041] In one embodiment, the original query information input by the user is received, and the query format is verified. If the verification is successful, the original query information is directly determined as the user query information. If the verification fails, the original query information is converted into a qualified user query information. This query format verification can include checking whether it is empty, whether there are abnormal characters (such as special characters, codes), etc. Exemplarily, the query string input by the user is received and its format is checked for legality.
[0042] Step 120, input the user query information into the domain classification model to obtain the domain classification result output by the domain classification model.
[0043] Among them, the domain classification model is used to determine the domain to which the user query information belongs.
[0044] In one embodiment, the domain classification model belongs to a binary classification model, that is, it determines whether the user query information belongs to the medical field or the non-medical field. Correspondingly, the domain classification result includes the medical field or the non-medical field.
[0045] In another embodiment, the domain classification model belongs to a multi-classification model, that is, it determines whether the user query information belongs to the medical field or various other fields (such as the legal field, software field, programming field, etc.), and then determines various other fields as non-medical fields. That is, the domain classification model classifies the user query information into different fields. Accordingly, the domain classification result includes the medical field or the non-medical field.
[0046] In another embodiment, the domain classification model belongs to a three-classification model, that is, it determines that the user query information belongs to the medical field, the pan-medical field or the non-medical field, and then determines the pan-medical field as a non-medical field. Specifically, the domain classification model can be constructed with reference to the following scenario classification model, which will not be elaborated here one by one.
[0047] In one embodiment, the domain classification model is a single-label multi-classification model, that is, the domain classification result only includes one result. In other words, the domain classification model needs to select the most suitable label from multiple categories to classify the user query information. For example, the output layer in the domain classification model is usually a linear layer followed by a softmax activation function to output the probability distribution of each category, and finally selects the category with the highest probability as the prediction result.
[0048] In a specific embodiment, the domain classification model is trained based on sample user query information and its corresponding domain classification result labels. Further, a pre-trained model such as ernie or bert is used as the base model, and then fine-tuned to obtain the domain classification model, so as to improve the classification accuracy of the domain classification model. It should be understood that by training the domain classification model with a large amount of corpus, the domain classification model can learn the language features and semantic patterns of user query information in different fields, so as to accurately make domain classification judgments.
[0049] The main purpose of step 120 is to filter the user query information in the non-medical field, that is, to quickly determine the general domain range of the user query information, so as to provide support for which search engine to call subsequently.
[0050] Step 130, call the search engine matching the domain classification result to process the user query information to obtain a search result.
[0051] Among them, the search engine includes a medical search engine or a general search engine. That is, one of the two engines is called to process the user query information.
[0052] This medical search engine is a vertical search engine based on a medical knowledge base. This medical search engine can build an index based on a professional knowledge base in the medical field to provide highly relevant search results by semantically parsing and precisely matching the user's query information. For example, when the user's query information is "early symptoms of diabetes", the medical search engine will extract relevant content from medical literature databases, health popular science articles, and authoritative diagnosis and treatment guidelines as search results; when the user's query information is "cardiovascular specialist hospital nearby", the medical search engine will combine geographical location data and the directory of medical institutions to return hospital information that meets the criteria (search results).
[0053] Since the medical search engine mainly relies on a professional medical knowledge base and semantic matching algorithms, its retrieval effect for core medical scenarios is relatively excellent. Therefore, this medical search engine has professionalism and verticality, and can efficiently return good search results when facing user query information in the medical field, thereby improving the user experience. For example, it performs relatively well when processing queries in the fields of disease diagnosis and treatment, medical knowledge, and health popular science.
[0054] This general search engine is a search engine that covers multi-domain and multi-scenario query requirements. This general search engine can rely on large-scale data indexing and efficient retrieval algorithms to parse and sort the content of web pages, documents, and databases globally to provide users with extensive and diverse retrieval results. For example, when the user's query information is "Is it good to take a walk after dinner", the general search engine will extract relevant content (search results) from health popular science articles, sports science research, and forum discussions to provide scientific basis and suggestions; when the user's query information is "The cat has diarrhea", the general search engine will return relevant solutions from pet health popular science websites, veterinarian advice articles, and pet owner forums (search results).
[0055] This general search engine has a wide coverage and diverse content, and can meet the query needs in the medical, pan-medical, and non-medical fields, that is, it can meet various query needs, thereby improving the user experience.
[0056] Furthermore, this general search engine can be used as a fallback strategy to ensure that all queries can return search results, thereby improving the user experience.
[0057] It should be noted that the search engine includes a medical search engine or a general search engine, so as to integrate the advantages of both, maximize the use of different data sources, improve the retrieval effect of professional medicine, and avoid resource waste and mis-matching.
[0058] Specifically, when it is determined based on the domain classification result that the user query information belongs to the medical field, the search engine matching this domain classification result is a medical search engine; when it is determined based on the domain classification result that the user query information belongs to a non-medical field, the search engine matching this domain classification result is a general search engine.
[0059] Here, the search result is the data obtained by the search engine based on the user query information.
[0060] The search method provided by the embodiments of the present invention inputs the received user query information into a domain classification model to obtain the domain classification result output by the domain classification model, and the domain classification model is used to determine the domain to which the user query information belongs, so as to call the search engine matching this domain classification result to process the user query information. The search engine includes a medical search engine or a general search engine. Thus, when it is determined based on the domain classification result that the user query information belongs to the medical field, the search engine matching this domain classification result is a medical search engine, so that for medical problems, more professional search results can be obtained, and the medical search engine only retrieves in medical data, thereby improving the search efficiency, that is, improving the search effect, and further improving the user experience. When it is determined based on the domain classification result that the user query information belongs to a non-medical field, the search engine matching this domain classification result is a general search engine, so that for non-medical problems, corresponding search results can also be obtained, that is, diverse query needs can be met, and further the user experience is improved. In summary, the present invention dynamically adjusts the search strategy based on the domain classification result, thereby ensuring the relevance and efficiency of the search result, that is, integrating the advantages of the medical search engine and the general search engine, ensuring the accurate matching of the search strategy and the query intention, so as to meet diverse and professional query needs, and further improving the user's search experience.
[0061] Based on any of the above embodiments, the present invention further studies and finds that for queries with fuzzy medical boundaries (such as health care, health management, etc.), using a medical search engine does not work well, and it is easy to have situations where the search results are irrelevant or insufficient. Next, another specific embodiment of the search method is given to perform a refined strategy for scenario classification. Figure 2 is the second flow diagram of the search method provided by the present invention, as Figure 2 shown, this search method may include: Step 110, Step 120, Step 131, Step 132, and Step 133.
[0062] Step 110, receive user query information.
[0063] Step 120, input the user query information into a domain classification model to obtain the domain classification result output by the domain classification model.
[0064] Step 131, in the case that it is determined based on the domain classification result that the user query information belongs to the medical domain, input the user query information into the scenario classification model to obtain the scenario classification result output by the scenario classification model.
[0065] Wherein, the scenario classification model is used to determine the scenario to which the user query information belongs and to determine scenarios with different degrees of medical needs. That is, the scenario classification model is used to classify several scenarios with different degrees of medical needs.
[0066] In one embodiment, the scenario classification model belongs to a three-classification model, that is, it is divided into three scenarios, and the degree of medical needs of each scenario is different. For example, the three scenarios are the core medical scenario, the general medical scenario, and the non-medical scenario. Of course, the scenario classification model can be a more classification model, so as to be divided into more scenarios.
[0067] In one embodiment, the scenario classification model is a multi-label multi-classification model, that is, the scenario classification result includes multiple results. In other words, the scenario classification model needs to predict all relevant labels for the user query information. For example, the output layer in this scenario classification model is usually a linear layer followed by a sigmoid activation function to output the independent probability of each label, and then the probability threshold is used to determine whether to assign this label to the user query information.
[0068] In another embodiment, the scenario classification model is a single-label multi-classification model, that is, the scenario classification result only includes one result. In other words, the scenario classification model needs to select the most suitable label from multiple categories to classify the user query information. For example, the output layer in this scenario classification model is usually a linear layer followed by a softmax activation function to output the probability distribution of each category, and finally the category with the highest probability is selected as the prediction result.
[0069] In a specific embodiment, the scenario classification model is trained based on sample user query information and its corresponding scenario classification result labels. Further, a pre-trained model such as ernie or bert is used as the base model, and then training and fine-tuning are performed to obtain the scenario classification model, so as to improve the classification accuracy of the scenario classification model.
[0070] Further, when the confidence level of the scene classification result is less than the scene confidence threshold, a general search engine is called to process the user query information to obtain search results; when the confidence level of the scene classification result is greater than or equal to the scene confidence threshold, the following step 132 is executed. When the confidence level of the scene classification result is low, the general search engine can be directly called to process the user query information, avoiding calling an accurate search engine due to inaccurate scene classification results, thereby avoiding the inability to return satisfactory results for the user due to domain matching failure, that is, ensuring that the user's needs are not missed, and further improving the user experience. In other words, the embodiment of the present invention adopts a fallback mechanism to ensure the user query closed-loop, that is, effective search results can always be obtained, thereby improving the user experience.
[0071] Step 132: Call the search engine that matches the scene classification result to process the user query information to obtain search results.
[0072] Among them, the medical search engine includes search engines for searching different degrees of medical needs. That is, one scene matches one search engine, so as to have different search strategies for user query information with different degrees of medical needs, so as to meet the user's needs as much as possible and ensure efficient search.
[0073] Further, if there are multiple matching search engines, the priority of calling the search engine can also be adjusted based on the user's historical query behavior and preferences, so as to improve the personalized experience.
[0074] Step 133: When it is determined based on the domain classification result that the user query information belongs to a non-medical domain, call the general search engine to process the user query information to obtain search results.
[0075] It should be understood that the general search engine has a wide coverage and diverse content, and can meet the query needs of the pan-medical and non-medical fields, that is, it can meet the query needs of various non-medical fields, thereby improving the user experience.
[0076] The search method provided by the embodiments of the present invention, when it is determined based on the domain classification result that the user query information belongs to the medical field, continues to input the user query information into the scenario classification model to obtain the scenario classification result output by the scenario classification model, and then calls the search engine that matches the scenario classification result to process the user query information, so as to further perform scenario classification for the preliminarily classified medical problems, use a more matching search engine for searching, and thus obtain a more matching search result, that is, improve the search effect, and further improve the user experience. Moreover, the scenario classification model is used to determine the scenario to which the user query information belongs and the scenarios with different degrees of medical needs, so that there can be different search engines for scenarios with different degrees of medical needs, and thus a more matching search result can be obtained, that is, improve the search effect, and further improve the user experience. And the search engine only retrieves in the data corresponding to the scenario, thereby improving the search efficiency, that is, improving the search effect, and further improving the user experience. When it is determined based on the domain classification result that the user query information belongs to the non-medical field, a general search engine is called to process the user query information to obtain a search result, so that corresponding search results can also be obtained for non-medical problems, that is, diverse query needs can be satisfied, and further the user experience can be improved. In summary, the embodiments of the present invention dynamically adjust the search strategy based on the scenario classification result, so as to ensure the relevance and efficiency of the search result, that is, integrate the advantages of various search engines, ensure the accurate matching of the search strategy and the query intention, so as to meet diverse and professional query needs, and further improve the user's search experience.
[0077] Based on any of the above embodiments, another specific embodiment of the search method is given next. In this method, the scenario classification result includes at least one of a core medical scenario, a general medical scenario, and a non-medical scenario.
[0078] Here, the degrees of medical needs of the core medical scenario, the general medical scenario, and the non-medical scenario are different. The degree of medical need in the core medical scenario is greater than that in the general medical scenario, and the degree of medical need in the general medical scenario is greater than that in the non-medical scenario.
[0079] In one embodiment, the scenario classification model is a multi-label multi-classification model, that is, the scenario classification result can include multiple results. In other words, the scenario classification result can include one or more scenarios.
[0080] It should be understood that if the scenario classification result includes multiple scenarios, multiple search engines that match the multiple scenarios can be called to process the user query information respectively.
[0081] In another embodiment, the scenario classification model is a single-label multi-classification model, that is, the scenario classification result only includes one result. In other words, the scenario classification result can only include one scenario.
[0082] Among them, the medical search engine includes a core medical search engine for searching for the first degree of medical need and a general medical search engine for searching for the second degree of medical need, and the first degree of medical need is greater than the second degree of medical need.
[0083] The core medical search engine is a vertical search engine based on a core medical knowledge base. The core medical search engine can build an index based on the professional knowledge base in the core medical field to provide highly relevant search results by performing semantic analysis and precise matching on the user query information.
[0084] The general medical search engine is a vertical search engine based on a general medical knowledge base. The general medical search engine can build an index based on the professional knowledge base in the general medical field to provide highly relevant search results by performing semantic analysis and precise matching on the user query information.
[0085] Among them, the core medical scenario matches the core medical search engine, the general medical scenario matches the general medical search engine, and the non-medical scenario matches the general search engine.
[0086] That is to say, for highly specialized core medical scenarios involving diagnosis and treatment, diseases, medical treatment paths, etc., the vertical core medical search engine is called. The core medical search engine integrates resources such as professional medical databases and hospital information databases to provide highly accurate and authoritative search results. For general medical scenarios such as health management and health guidance, the general medical search engine is called to provide diverse search results. For non-medical scenarios, the general search engine is called to ensure a closed-loop query for users.
[0087] The search method provided by the embodiment of the present invention, when it is determined that the user query information belongs to the medical field based on the domain classification result, continues to input the user query information into the scenario classification model to obtain the scenario classification result output by the scenario classification model, and then calls the search engine that matches the scenario classification result to process the user query information. Thus, for the preliminarily classified medical problems, further scenario classification is performed, and the scenario classification results include core medical scenarios, general medical scenarios, and non-medical scenarios, and the search engines include core medical search engines, general medical search engines, and general search engines. Therefore, a more matching search engine can be used for searching, and then a more matching search result can be obtained, that is, the search effect is improved, and then the user experience is improved. Moreover, different search engines can be used for scenarios with different degrees of medical needs, and then a more matching search result can be obtained, that is, the search effect is improved, and then the user experience is improved.
[0088] Based on any of the above embodiments, another specific embodiment of the search method is given below. In this method, the core medical scenarios include core medical sub-scenarios with different requirements; the general medical scenarios include general medical sub-scenarios with different requirements.
[0089] In the embodiment of the present invention, the scenario classification model can classify into specific sub-scenarios, that is, it can be refined to specific multi-level medical scenarios, and these multi-level medical scenarios have a high degree of professionalism and pertinence, so as to more carefully adopt different search strategies for different business scenarios and requirements, thereby improving the search effect and ultimately improving the user experience. That is, based on these precise sub-scenarios, corresponding search strategies for medical, general medical, non-medical, etc. customized choreography can be adapted subsequently, thereby improving the search effect and ultimately improving the user experience.
[0090] In one embodiment, different core medical sub-scenarios match the same core medical search engine, but the search strategies for different core medical sub-scenarios can be different. For example, the databases to be searched are different.
[0091] In another embodiment, different core medical sub-scenarios match different core medical search engines to implement different search strategies.
[0092] In one embodiment, different general medical sub-scenarios match the same general medical search engine, but the search strategies for different general medical sub-scenarios can be different. For example, the databases to be searched are different.
[0093] In another embodiment, different general medical sub-scenarios match different general medical search engines to implement different search strategies.
[0094] Exemplarily, the scenario classification model can be refined to specific three-level medical scenarios, and these three-level medical scenarios have a high degree of professionalism and pertinence, so as to more carefully adopt different search strategies for different business scenarios and requirements, thereby improving the search effect and ultimately improving the user experience.
[0095] For example, the core medical scenarios include first-level scenarios such as medical treatment, childbirth, prevention, and diagnosis and treatment. And the first-level scenario of diagnosis and treatment is divided into second-level scenarios and third-level scenarios as shown in Table 1 below, where the third-level scenarios are core medical sub-scenarios.
[0096] Table 1
[0097] The search method provided by the embodiments of the present invention, the core medical scenarios include core medical sub-scenarios with different requirements; the general medical scenarios include general medical sub-scenarios with different requirements. Based on this, the scenario classification model can be refined to specific multi-level medical scenarios, so that different search strategies can be adopted more carefully according to different business scenarios and requirements, thereby improving the search effect and ultimately enhancing the user experience.
[0098] Based on any of the above embodiments, another specific embodiment of the search method is given below. In this method, the target core medical search engine conducts searches based on real-time data, and the target core medical search engine is a core medical search engine that matches the real-time core medical sub-scenarios; the target general medical search engine conducts searches based on real-time data, and the target general medical search engine is a general medical search engine that matches the real-time general medical sub-scenarios.
[0099] Here, the real-time data can be data that is updated in real time. For the real-time core medical sub-scenarios or real-time general medical sub-scenarios, conducting searches based on real-time data can improve the search effect, and thus enhance the user experience.
[0100] For example, when the query involves a medical sub-scenario with real-time updates, or a medical sub-scenario corresponding to a public health emergency, the real-time data source or the latest database is preferentially called for searches.
[0101] The search method provided by the embodiments of the present invention, through the above method, supports dynamic policy orchestration based on medical sub-scenarios, that is, for the real-time core medical sub-scenarios or real-time general medical sub-scenarios, conducting searches based on real-time data can improve the search effect, and thus enhance the user experience.
[0102] Based on any of the above embodiments, another specific embodiment of the search method is given below. In this method, the scenario classification result includes multiple scenarios.
[0103] In the embodiments of the present invention, the scenario classification model is a multi-label multi-classification model, that is, the scenario classification result can include multiple results. In other words, the scenario classification result can include one or more scenarios.
[0104] In the case where the scenario classification result includes multiple scenarios, step 132 above includes: step 1321, step 1322, and step 1323.
[0105] Step 1321, call the search engines that respectively match the multiple scenarios to process the user query information, and obtain sub-search results output by multiple search engines.
[0106] Here, the sub-search results are data obtained by the search engine based on the user query information. One search engine obtains one sub-search result.
[0107] Step 1322: Determine the priority of each sub-search result based on the confidence levels of the multiple scenarios.
[0108] Here, the confidence level is determined when the scenario classification model outputs the scenario classification result, that is, the confidence levels of multiple scenarios are determined. This confidence level can be used to judge the priority of each sub-search result and also to judge the reliability of the scenario classification result.
[0109] It should be noted that the greater the confidence level, the higher the priority of the corresponding sub-search result.
[0110] Step 1323: Sort each sub-search result based on each priority to obtain the search result.
[0111] It should be noted that the higher the priority, the more forward the sorting of the corresponding sub-search result.
[0112] Furthermore, it is also possible to perform merging, duplicate removal, and optimization processing on each sub-search result.
[0113] Exemplarily, for some complex queries (such as cross-domain or multi-scenario requirements), it is supported to call multiple search engines to work together, so as to merge, remove duplicates, and optimize the sorting of each sub-search result and then return it to the user. For example, when the user's query information is "how to prevent influenza and select a vaccine", the core medical search engine can be called simultaneously to obtain influenza prevention guidelines and vaccine data, and the general medical search engine can be combined to supplement health care suggestions.
[0114] Furthermore, when displaying the search result to the user, display the search result according to each priority.
[0115] Furthermore, display the search result to the user in a structured, charted, etc. form, so as to improve the user experience.
[0116] Furthermore, when displaying the search result, also display the recommended result (such as relevant disease guidelines or popular science articles), so as to improve the user experience. This recommended result can be determined based on the user's query information or based on the search result.
[0117] In the search method provided by the embodiment of the present invention, the scenario classification result includes multiple scenarios, so that multiple search engines can be called to process the user's query information, and then the query requirements of the user in multiple scenarios can be met, and the search result that meets the requirements can be obtained as much as possible, so as to improve the search effect and further improve the user experience; and based on the confidence levels of multiple scenarios, the priority of the sub-search results of each search engine is determined, and then the sub-search results of each search engine are sorted, so as to improve the search effect and further improve the user experience.
[0118] Based on any of the above embodiments, another specific embodiment of the search method is given below. Figure 3 It is the third schematic flow chart of the search method provided by the present invention. As Figure 3 shown, the search method includes the following steps 110, step 120, step 140 and step 150.
[0119] Step 110, receive user query information.
[0120] Step 120, input the user query information into the domain classification model to obtain the domain classification result output by the domain classification model.
[0121] While obtaining the domain classification result, the confidence level of the domain classification result can be obtained.
[0122] Step 140, in the case where the confidence level of the domain classification result is less than the domain confidence level threshold, call the general search engine to process the user query information to obtain a search result.
[0123] Here, the domain confidence level threshold can be set according to actual needs and is not limited here.
[0124] When the confidence level of the domain classification result is low, the general search engine can be directly called to process the user query information, avoiding calling the medical search engine due to inaccurate domain classification results, thereby avoiding the inability to return satisfactory results due to domain matching failure, that is, ensuring that user needs are not missed, and further improving the user experience. In other words, the embodiment of the present invention adopts a fallback mechanism to ensure the user query closed-loop, that is, an effective search result can always be obtained, thereby improving the user experience.
[0125] Step 150, in the case where the confidence level of the domain classification result is greater than or equal to the domain confidence level threshold, execute the step of calling the search engine matching the domain classification result to process the user query information to obtain a search result.
[0126] Specifically, in the case where the confidence level of the domain classification result is greater than or equal to the domain confidence level threshold, the above step 130 is executed.
[0127] When the confidence level of the domain classification result is high, the search engine matching the domain classification result can be directly called to process the user query information, thereby ensuring the relevance and efficiency of the search result, ensuring the accurate matching of the search strategy and the query intention, thereby meeting the diverse and professional query needs, and further improving the user's search experience.
[0128] The search method provided by the embodiment of the present invention, when the confidence level of the domain classification result is less than the domain confidence level threshold, invokes a general search engine to process the user query information, thereby avoiding invoking a medical search engine due to inaccurate domain classification results, and thus avoiding the inability to return satisfactory results due to domain matching failure, that is, ensuring that user needs are not overlooked, and further enhancing the user experience.
[0129] Based on any of the above embodiments, another specific embodiment of the search method is given below. In this method, when it is determined based on the domain classification result that the user query information belongs to the medical domain, the domain confidence level threshold is the first confidence level threshold; when it is determined based on the domain classification result that the user query information belongs to the non-medical domain, the domain confidence level threshold is the second confidence level threshold; the first confidence level threshold is less than the second confidence level threshold.
[0130] That is to say, the domain confidence level threshold can be dynamically adjusted. Thus, for the user query information in the medical domain, the domain confidence level threshold can be set lower to capture as many medical scenarios as possible, so as to satisfy the user's medical query needs as much as possible, and further improve the user experience; for the user query information in the non-medical domain, the domain confidence level threshold can be set higher to reduce the possibility of judgment by the domain classification model.
[0131] The search method provided by the embodiment of the present invention, through the above method, the domain confidence level threshold can be dynamically adjusted, thereby improving the accuracy of the domain classification result; and for the medical domain, its domain confidence level threshold is lower, and for the non-medical domain, its domain confidence level threshold is higher, to capture as many medical scenarios as possible, so as to satisfy the user's medical query needs as much as possible, and further improve the user experience.
[0132] Based on any of the above embodiments, another specific embodiment of the search method is given below. After the above step 130, the search method further includes: When the search result is empty, or the confidence level of the search result is less than the first preset confidence level threshold, the general search engine is invoked to process the user query information to obtain a new search result.
[0133] Here, the first preset confidence level threshold can be set according to actual needs and is not limited here.
[0134] It should be noted that when the search result returned by the search engine is not good or empty, it is intelligently switched to the general search engine for backup supplementation, that is, the general search engine is invoked to process the user query information to obtain a new search result, so as to ensure the user query closed-loop and always obtain effective results, and finally improve the user experience.
[0135] Especially when the search results returned by the medical search engine are not satisfactory, it automatically switches to a general search engine for supplementary search to ensure that user needs are not overlooked, avoid query interruption, and ensure the user experience. Compared with the existing technology that relies on a fixed process, the embodiments of the present invention can flexibly adjust the search strategy based on the feedback of real-time search results to adapt to different user needs.
[0136] Through the above method, the search method provided by the embodiments of the present invention calls a general search engine to process user query information in the case where the search results are empty or the confidence level of the search results is less than the first preset confidence threshold, so as to obtain new search results, ensure that user needs are not overlooked, and further improve the user experience.
[0137] Based on any of the above embodiments, another specific embodiment of the search method is given below. Figure 4 It is the fourth flowchart of the search method provided by the present invention, as Figure 4 shown, the search method includes the following steps 110, 121, 122, 123, and 130.
[0138] Step 110, receive user query information.
[0139] Step 121, input the user query information into the domain classification model to obtain the initial domain classification result output by the domain classification model.
[0140] While obtaining the initial domain classification result, the confidence level of the initial domain classification result can be obtained.
[0141] Step 122, in the case where the confidence level of the initial domain classification result is less than the second preset confidence threshold, determine the domain classification result of the user query information by using a preset domain classification method.
[0142] Here, the second preset confidence threshold can be set according to actual needs and is not limited here.
[0143] Here, the preset domain classification method is other classification methods except for the classification by the domain classification model. The preset domain classification method can be a domain classification method based on specified rules, and the preset domain classification method can adopt existing domain classification methods, which will not be elaborated here one by one.
[0144] When the confidence level of the initial domain classification result output by the domain classification model is low, for example, when the domain classification model has difficulty accurately classifying some boundary user query information (such as cross-domain content), the preset domain classification method is used for secondary determination, so as to improve the accuracy and robustness of the domain classification result, further improve the search effect, and finally improve the user experience.
[0145] Step 123, when the confidence level of the initial domain classification result is greater than or equal to the second preset confidence threshold, determine the initial domain classification result as the domain classification result.
[0146] When the confidence level of the initial domain classification result output by the domain classification model is high, the initial domain classification result can be directly determined as the domain classification result, thereby avoiding secondary determination and improving the search efficiency.
[0147] Step 130, call a search engine that matches the domain classification result to process the user query information to obtain a search result.
[0148] Based on this, a search engine that matches the accurate domain classification result can be called to process the user query information, so as to obtain a better search result and improve the user experience.
[0149] The search method provided by the embodiment of the present invention, through the above method, when the confidence level of the initial domain classification result output by the domain classification model is low, a preset domain classification method can be used for secondary determination, so as to improve the accuracy and robustness of the domain classification result, and then improve the search effect and ultimately improve the user experience.
[0150] Based on any of the above embodiments, another specific embodiment of the search method is given below. Figure 5 is the fifth flowchart of the search method provided by the present invention, as Figure 5 shown, the domain classification model is trained based on steps 510 to 540.
[0151] Step 510, input the user query information test sample into the pre-trained domain classification model to obtain the classification probabilities of multiple prediction results output by the domain classification model.
[0152] Here, the user query information test sample is a sample of user query information for testing, and this user query information test sample can be obtained from a large corpus.
[0153] Here, the classification probabilities of multiple prediction results are the classification probabilities of the domain classification model for each domain.
[0154] Here, the domain classification model can be trained first in the following way: train the initial domain classification model based on the user query information training sample and its domain classification result label to obtain the domain classification model.
[0155] In one embodiment, the initial domain classification model can be a pre-trained model such as ernie or bert, so as to reduce the training cost and improve the robustness of the domain classification model.
[0156] In one embodiment, the user query information training samples are obtained in the following manner: user query information training samples matching a keyword set are screened out from a massive amount of raw data. The keyword set is a keyword of a target field or scenario, thereby screening out data highly relevant to the target field or scenario from a massive amount of raw data as training samples.
[0157] Among them, this keyword set can deeply investigate the query keywords in various fields or scenarios. Through the systematic combing of typical query keywords in different target fields or specific scenarios such as medical, legal, and software programming, it is possible to accurately locate data features, thereby improving the accuracy of keyword set determination, and then improve the accuracy of training sample determination, and ultimately improve the training effect of field classification models.
[0158] The classification result labels in this field are obtained by labeling, which can be done manually or using a large model.
[0159] In one embodiment, a large model is used to label the domain classification result labels. The large model's in-depth understanding of the target domain or scene and its precise grasp of the model labeling requirements can accurately label the training samples. Furthermore, the powerful labeling ability of the large model is introduced, that is, the large model can quickly perform preliminary classification and labeling of the data by virtue of its learning and understanding ability of massive data. After large-scale labeling of the training sample set, considering that there may be certain errors in the large model labeling, manual sampling and correction are required; in the manual sampling stage, professionals randomly check the data labeled by the large model to check the accuracy and rationality of the labeling, and correct the data with incorrect or unclear labels. The data quality after this stage is significantly improved, thereby improving the training effect of the domain classification model.
[0160] Furthermore, a feedback mechanism for badcase analysis and targeted supplementation or correction of training data is established. During the model training process, the badcases with classification errors are deeply analyzed to find out the causes of the errors. It may be that the model does not learn certain features sufficiently due to insufficient or inaccurate training data. According to the analysis results, new training data is added or incorrect annotations in existing data are corrected. After multiple rounds of iterative optimization, the accuracy, recall rate and F1 value of the model can be significantly improved, thereby obtaining a highly usable domain classification model.
[0161] Step 520: Determine the information entropy of the multiple prediction results based on the classification probabilities.
[0162] In one embodiment, a preset number of target classification probabilities with relatively large probabilities are determined from the respective classification probabilities, and the information entropy of multiple prediction results is determined based on the target classification probabilities. That is, considering that the relatively small classification probabilities can be basically ignored, it is not necessary to use the classification probabilities of all prediction results. For example, the largest first classification probability and the second-largest second classification probability are determined from the respective classification probabilities, and the information entropy is determined based on the first classification probability and the second classification probability.
[0163] Here, the information entropy can reflect the uncertainty and confusion degree of multiple prediction results. Therefore, by analyzing the information entropy, difficult negative samples with high uncertainty can be screened out. The larger the information entropy, the greater the uncertainty.
[0164] Exemplarily, the calculation formula of the information entropy is as follows: ; In the formula, represents the information entropy, represents the preset number, represents the th target classification probability. is the natural logarithm, which can be the logarithm with base 2.
[0165] In another embodiment, the information entropy of multiple prediction results is calculated based on all classification probabilities.
[0166] Step 530, in the case where the information entropy is greater than a preset information entropy threshold, the user query information test sample is determined as a difficult negative sample.
[0167] Here, the preset information entropy threshold can be set according to actual needs and is not limited here.
[0168] In the case where the information entropy is greater than the preset information entropy threshold, it indicates that the uncertainty of the output of the domain classification model is relatively large. Therefore, the user query information test sample needs to be determined as a difficult negative sample. This difficult negative sample is a sample that the domain classification model is prone to confuse or misjudge during the classification process. Therefore, it is necessary to retrain based on the difficult negative sample to improve the robustness of the domain classification model; and the difficult negative sample helps to improve the model performance more than other samples.
[0169] Step 540, based on the difficult negative sample and its corresponding domain classification result label, retrain the domain classification model.
[0170] Here, the domain classification result label is obtained by labeling the difficult negative sample. In one embodiment, the domain classification result label can be labeled by a large model; further, after being labeled by the large model, it can be corrected manually to ensure the accuracy of the labeling.
[0171] Specifically, the domain classification model can be fine-tuned based on hard negative samples and their corresponding domain classification result labels, or the hard negative samples can be supplemented or corrected into the training dataset for retraining. In this way, the domain classification model can better learn the features of hard negative samples, thereby continuously improving the performance of the domain classification model and further enhancing the robustness of the domain classification model.
[0172] The search method provided by the embodiments of the present invention can accurately screen out hard negative samples that greatly improve the performance of the domain classification model by calculating the information entropy of multiple prediction results of the domain classification model, thereby continuously improving the performance of the domain classification model, further enhancing the robustness of the domain classification model, improving the search effect, and ultimately enhancing the user experience.
[0173] Based on any of the above embodiments, another specific embodiment of the search method is given below. Figure 6 is the sixth flowchart of the search method provided by the present invention, as Figure 6 shown, the search method includes: step 111, step 112, step 120, and step 130.
[0174] Step 111, receive the original query information input by the user.
[0175] Here, the original query information is the query information input by the user. The original query information can be the user query text, which can be directly input by the user or the user's voice can be collected and converted into the user query text, and no specific limitation is made here.
[0176] Step 112, input the original query information into the query rewriting model to obtain the user query information output by the query rewriting model.
[0177] Among them, the query rewriting model is constructed based on a large model (such as a large language model), and the query rewriting model is used to perform at least one of the following rewriting processes: error correction process, synonym rewriting process, redundant content deletion process, and multi-turn dialogue context optimization process, and the multi-turn dialogue context optimization process is used to rewrite the current user query information based on the historical user query information.
[0178] Here, the error correction process can correct the spelling mistakes and punctuation usage mistakes in the original query information. For example, the original query information "What should pregnant women pay attention to in their diet" is rewritten as "What should pregnant women pay attention to in their diet"; the original query information "Cold. What to do" is rewritten as "What to do if having a cold".
[0179] Here, the synonym rewriting process can expand and replace keywords in the original query information through a semantic knowledge base. For example, if the original query information is "hypertensive treatment plan", it is rewritten as "treatment methods for hypertension"; if the original query information is "symptoms of kidney disease", it is rewritten as "symptoms of kidney disease".
[0180] Here, the redundant content deletion process can streamline the redundant or irrelevant information in the original query information and retain the core semantics. For example, if the original query information is "May I ask the doctor what to do about a cold and fever", it is rewritten as "solutions for a cold and fever"; if the original query information is "I want to know the nutritional requirements in the early stage of pregnancy", it is rewritten as "nutritional requirements in the early stage of pregnancy".
[0181] Here, for the multi-round dialogue context optimization process in continuous multi-round dialogue scenarios, the original query information of the current input can be combined with the historical dialogue context for optimization. For example, if the original query information is "What dietary suggestions are there", and the historical user query information is "How should diabetes be treated", it is rewritten as "Dietary suggestions for diabetes patients" (the current user query information). The historical user query information can be the user query information obtained previously.
[0182] In a specific embodiment, the error correction process can be executed first, then the synonym rewriting process, followed by the redundant content deletion process, and finally the multi-round dialogue context optimization process. Of course, the rewriting process can also be executed in other orders.
[0183] Step 120: Input the user query information into the domain classification model to obtain the domain classification result output by the domain classification model.
[0184] Inputting the rewritten user query information into the domain classification model can improve the domain classification accuracy of the domain classification model, thereby improving the search effect and ultimately enhancing the user experience.
[0185] Step 130: Invoke a search engine that matches the domain classification result to process the user query information to obtain a search result.
[0186] The search engine processes the rewritten user query information, which can improve the search effect and ultimately enhance the user experience.
[0187] The search method provided by the embodiment of the present invention, through the above method, rewrites the original query information input by the user into structured and high-quality user query information that is more easily retrieved accurately by the search engine, thereby improving the search effect and ultimately enhancing the user experience.
[0188] Based on any of the above embodiments, another specific embodiment of the search method is given below. Before the above step 112, the search method further includes: Parse the query semantic type of the original query information, and input the query semantic type and the original query information into the query rewriting model together.
[0189] In one embodiment, the query semantic type includes declarative, question-and-answer, or directive.
[0190] For example, when the original query information is "early symptoms of diabetes", its query semantic type is question-and-answer; when the original query information is "how to make an appointment with a doctor", its query semantic type is directive; when the original query information is "dietary suggestions for pregnant women", its query semantic type is declarative.
[0191] The search method provided by the embodiments of the present invention, through the above method, inputs the query semantic type and the original query information into the query rewriting model together, that is, uses the query semantic type as a prompt to input into the query rewriting model, thereby improving the rewriting effect, further improving the search effect, and ultimately improving the user experience.
[0192] Based on any of the above embodiments, the following gives another specific embodiment of the search method. Before the above step 112, the search method further includes: Decompose the content of the original query information to obtain several content information, and input the several content information and the original query information into the query rewriting model together.
[0193] Wherein, the several content information includes at least one of core keyword information, modifier information, and context type information.
[0194] In one embodiment, semantic analysis is performed on the original query information, so as to decompose the content of the original query information.
[0195] For example, when the original query information is "can I eat seafood during pregnancy", it is decomposed into core keyword information: pregnancy, seafood, modifier information: during, can I, context type information: healthy diet.
[0196] The search method provided by the embodiments of the present invention, through the above method, inputs the decomposed several content information and the original query information into the query rewriting model together, that is, uses the several content information as a prompt to input into the query rewriting model, thereby improving the rewriting effect, further improving the search effect, and ultimately improving the user experience.
[0197] Based on any of the above embodiments, the following gives another specific embodiment of the search method. Before the above step 112, the search method further includes: Parse the query semantic type of the original query information, and input the query semantic type and the original query information into the query rewriting model together; Decompose the original query information to obtain a number of content information, and input the number of content information and the original query information into the query rewriting model together.
[0198] Through the above method, the search method provided by the embodiment of the present invention inputs the query semantic type, the decomposed number of content information and the original query information into the query rewriting model together, that is, uses the query semantic type and the number of content information as prompts to input into the query rewriting model, so as to improve the rewriting effect, and further improve the search effect, and finally improve the user experience.
[0199] To facilitate the understanding of the above embodiments, a specific embodiment is described here. As Figure 7 shown, first, preprocess the original query information input by the user; then input the preprocessed user query information into the domain classification model to obtain the domain classification result output by the domain classification model; when it is determined based on the domain classification result that the user query information belongs to the medical field, input the user query information into the scenario classification model to obtain the scenario classification result output by the scenario classification model; when it is determined based on the domain classification result that the user query information belongs to the non-medical field, call the general search engine to process the user query information to obtain the search result; when the scenario classification result is a non-medical scenario, call the general search engine to process the user query information to obtain the search result, when the scenario classification result is a general medical scenario, call the general medical search engine to process the user query information to obtain the search result, when the scenario classification result is a core medical scenario, call the core medical search engine to process the user query information to obtain the search result; when the search result of the medical search engine is empty, or the confidence of the search result is less than the first preset confidence threshold, call the general search engine to process the user query information to obtain a new search result.
[0200] The search device provided by the present invention is described below, and the search device described below can be mutually corresponding and referred to the search method described above.
[0201] Figure 8 is a schematic structural diagram of the search device provided by the present invention. As Figure 8 shown, the search device includes: a receiving module 810, a classification module 820, and a search module 830.
[0202] The receiving module 810 is configured to receive user query information.
[0203] The classification module 820 is configured to input the user query information into the domain classification model to obtain the domain classification result output by the domain classification model; the domain classification model is used to determine the domain to which the user query information belongs.
[0204] A search module 830, configured to call a search engine that matches the domain classification result to process the user query information and obtain a search result.
[0205] Wherein, the search engine includes a medical search engine or a general search engine.
[0206] In the search device provided by the embodiment of the present invention, the received user query information is input into a domain classification model to obtain a domain classification result output by the domain classification model, and the domain classification model is used to determine the domain to which the user query information belongs, so as to call a search engine that matches the domain classification result to process the user query information, and the search engine includes a medical search engine or a general search engine. Therefore, when it is determined based on the domain classification result that the user query information belongs to the medical field, the search engine that matches the domain classification result is a medical search engine. Thus, for medical problems, more professional search results can be obtained, and the medical search engine only retrieves in medical data, thereby improving the search efficiency, that is, improving the search effect, and further improving the user experience. When it is determined based on the domain classification result that the user query information belongs to a non-medical field, the search engine that matches the domain classification result is a general search engine. Thus, for non-medical problems, corresponding search results can also be obtained, that is, diverse query needs can be satisfied, and further the user experience is improved. In summary, the present invention dynamically adjusts the search strategy based on the domain classification result, thereby ensuring the relevance and efficiency of the search result, that is, integrating the advantages of the medical search engine and the general search engine, ensuring the accurate matching of the search strategy and the query intention, thereby satisfying diverse and professional query needs, and further improving the user's search experience.
[0207] Based on any of the above embodiments, the search module 830 is specifically configured to: When it is determined based on the domain classification result that the user query information belongs to the medical field, input the user query information into a scenario classification model to obtain a scenario classification result output by the scenario classification model; the scenario classification model is used to determine the scenario to which the user query information belongs, and is used to determine scenarios with different degrees of medical needs; Call a search engine that matches the scenario classification result to process the user query information and obtain a search result; When it is determined based on the domain classification result that the user query information belongs to a non-medical field, call the general search engine to process the user query information and obtain a search result; Wherein, the medical search engine includes search engines for searching different degrees of medical needs.
[0208] Based on any of the above embodiments, the scenario classification result includes at least one of a core medical scenario, a general medical scenario, and a non-medical scenario; The medical search engine includes a core medical search engine for searching for the first degree of medical need and a general medical search engine for searching for the second degree of medical need, where the first degree of medical need is greater than the second degree of medical need; The core medical scenario matches the core medical search engine, the general medical scenario matches the general medical search engine, and the non-medical scenario matches the general search engine.
[0209] Based on any of the above embodiments, the core medical scenario includes core medical sub-scenarios with different requirements; the general medical scenario includes general medical sub-scenarios with different requirements; Among them, the target core medical search engine conducts searches based on real-time data, and the target core medical search engine is a core medical search engine that matches the real-time core medical sub-scenario; the target general medical search engine conducts searches based on real-time data, and the target general medical search engine is a general medical search engine that matches the real-time general medical sub-scenario.
[0210] Based on any of the above embodiments, the scenario classification result includes multiple scenarios; the search module 830 is further configured to: Call search engines respectively matching the multiple scenarios to process the user query information, and obtain sub-search results output by the multiple search engines; Based on the confidence levels of the multiple scenarios, determine the priorities of the respective sub-search results; Based on the respective priorities, sort the respective sub-search results to obtain a search result.
[0211] Based on any of the above embodiments, the device further includes: An engine call module, configured to, when the confidence level of the domain classification result is less than the domain confidence level threshold, call the general search engine to process the user query information and obtain a search result; The search module 830 is further configured to, when the confidence level of the domain classification result is greater than or equal to the domain confidence level threshold, execute the step of calling a search engine matching the domain classification result to process the user query information and obtain a search result.
[0212] Based on any of the above embodiments, when it is determined based on the domain classification result that the user query information belongs to the medical domain, the domain confidence level threshold is the first confidence level threshold; When it is determined based on the domain classification result that the user query information belongs to the non-medical domain, the domain confidence level threshold is the second confidence level threshold; Wherein, the first confidence level threshold is less than the second confidence level threshold.
[0213] Based on any of the above embodiments, the device further includes: An engine call module, configured to call the general search engine to process the user query information and obtain new search results when the search results are empty or the confidence of the search results is less than the first preset confidence threshold.
[0214] Based on any of the above embodiments, the classification module 820 is specifically configured to: Input the user query information into the domain classification model to obtain an initial domain classification result output by the domain classification model; When the confidence of the initial domain classification result is less than the second preset confidence threshold, determine the domain classification result of the user query information by using a preset domain classification method; When the confidence of the initial domain classification result is greater than or equal to the second preset confidence threshold, determine the initial domain classification result as the domain classification result.
[0215] Based on any of the above embodiments, the device further includes a model training module, and the model training module is specifically configured to: Input the user query information test sample into the pre-trained domain classification model, and obtain the classification probabilities of multiple prediction results output by the domain classification model; Determine the information entropy of the multiple prediction results based on each of the classification probabilities; When the information entropy is greater than the preset information entropy threshold, determine the user query information test sample as a difficult negative sample; Retrain the domain classification model based on the difficult negative sample and its corresponding domain classification result label.
[0216] Based on any of the above embodiments, the receiving module 810 is specifically configured to: Receive the original query information input by the user; Input the original query information into the query rewriting model to obtain the user query information output by the query rewriting model; Wherein, the query rewriting model is constructed based on a large model, and the query rewriting model is used to perform at least one of the following rewriting processes: error correction processing, synonym rewriting processing, redundant content deletion processing, and multi-round dialogue context optimization processing, and the multi-round dialogue context optimization processing is used to rewrite the current user query information based on the historical user query information.
[0217] Based on any of the above embodiments, the device further includes: A type parsing module, configured to parse the query semantic type of the original query information, so as to input the query semantic type and the original query information into the query rewriting model together; and / or, A content disassembling module is configured to disassemble the original query information to obtain a plurality of content information, and input the plurality of content information and the original query information into the query rewriting model; the plurality of content information includes at least one of core keyword information, modifier information, and context type information.
[0218] Figure 9 An example of the physical structure diagram of an electronic device is as Figure 9 shown. The electronic device may include: a processor 910, a communication interface 920, a memory 930, and a communication bus 940. Among them, the processor 910, the communication interface 920, and the memory 930 complete mutual communication through the communication bus 940. The processor 910 can call the logical instructions in the memory 930 to execute a search method, which includes: receiving user query information; inputting the user query information into a domain classification model to obtain a domain classification result output by the domain classification model; the domain classification model is used to determine the domain to which the user query information belongs; calling a search engine that matches the domain classification result to process the user query information to obtain a search result; where the search engine includes a medical search engine or a general search engine.
[0219] In addition, when the logical instructions in the above-mentioned memory 930 are implemented in the form of software functional units and sold or used as an independent product, they can be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or a part of this technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in various embodiments of the present invention. The foregoing storage medium includes: various media such as USB flash drives, mobile hard disks, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), magnetic disks, or optical discs that can store program codes.
[0220] On the other hand, the present invention also provides a computer program product, which includes a computer program. The computer program can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the search method provided by each of the above methods. The method includes: receiving user query information; inputting the user query information into a domain classification model to obtain a domain classification result output by the domain classification model; the domain classification model is used to determine the domain to which the user query information belongs; calling a search engine that matches the domain classification result to process the user query information to obtain a search result; wherein, the search engine includes a medical search engine or a general search engine.
[0221] In another aspect, the present invention also provides a non-transitory computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, it is implemented to execute the search method provided by each of the above methods. The method includes: receiving user query information; inputting the user query information into a domain classification model to obtain a domain classification result output by the domain classification model; the domain classification model is used to determine the domain to which the user query information belongs; calling a search engine that matches the domain classification result to process the user query information to obtain a search result; wherein, the search engine includes a medical search engine or a general search engine.
[0222] The device embodiments described above are merely illustrative. 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 may be distributed to multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment. Those of ordinary skill in the art can understand and implement it without creative efforts.
[0223] Through the description of the above embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus a necessary general hardware platform, and of course, also by hardware. Based on this understanding, the essence of the above technical solution, or the part that contributes to the prior art, can be embodied in the form of a software product. The computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disc, etc., and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0224] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions described in the foregoing embodiments, or perform equivalent replacements for some of the technical features; and these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A search method, characterized in that, Including: Receiving user query information; Inputting the user query information into a domain classification model to obtain a domain classification result output by the domain classification model; The domain classification model is used to determine the domain to which the user query information belongs; Invoking a search engine that matches the domain classification result to process the user query information to obtain a search result; Wherein, the search engine includes a medical search engine or a general search engine.
2. The search method according to claim 1, wherein The invoking a search engine that matches the domain classification result to process the user query information to obtain a search result includes: When it is determined based on the domain classification result that the user query information belongs to the medical domain, inputting the user query information into a scenario classification model to obtain a scenario classification result output by the scenario classification model; the scenario classification model is used to determine the scenario to which the user query information belongs and the scenarios with different degrees of medical needs; Invoking a search engine that matches the scenario classification result to process the user query information to obtain a search result; When it is determined based on the domain classification result that the user query information belongs to a non-medical domain, invoking the general search engine to process the user query information to obtain a search result; Wherein, the medical search engine includes search engines for different degrees of medical needs.
3. The search method according to claim 2, wherein The scenario classification result includes at least one of a core medical scenario, a general medical scenario, and a non-medical scenario; The medical search engine includes a core medical search engine for searching for the first degree of medical need and a general medical search engine for searching for the second degree of medical need, and the first degree of medical need is greater than the second degree of medical need; The core medical scenario matches the core medical search engine, the general medical scenario matches the general medical search engine, and the non-medical scenario matches the general search engine.
4. The search method according to claim 3, characterized in that, The core medical scenario includes core medical sub-scenarios with different needs; the general medical scenario includes general medical sub-scenarios with different needs; Wherein, the target core medical search engine conducts searches based on real-time data, and the target core medical search engine is a core medical search engine that matches the real-time core medical sub-scenario; the target general medical search engine conducts searches based on real-time data, and the target general medical search engine is a general medical search engine that matches the real-time general medical sub-scenario.
5. The search method according to claim 2, wherein The scenario classification result includes multiple scenarios; Correspondingly, the invoking a search engine that matches the scenario classification result to process the user query information to obtain a search result includes: Invoking search engines that respectively match the multiple scenarios to process the user query information to obtain sub-search results output by the multiple search engines; Determining the priority of each sub-search result based on the confidence levels of the multiple scenarios; Sorting each sub-search result based on each priority to obtain a search result.
6. The search method according to any one of claims 1 to 5, characterized in that, After the inputting the user query information into the domain classification model to obtain the domain classification result output by the domain classification model, it further includes: When the confidence level of the domain classification result is less than the domain confidence level threshold, call the general search engine to process the user query information to obtain a search result; When the confidence level of the domain classification result is greater than or equal to the domain confidence level threshold, perform the step of calling the search engine that matches the domain classification result to process the user query information to obtain a search result.
7. The search method according to claim 6, wherein When it is determined based on the domain classification result that the user query information belongs to the medical field, the domain confidence level threshold is the first confidence level threshold; When it is determined based on the domain classification result that the user query information belongs to the non-medical field, the domain confidence level threshold is the second confidence level threshold; Wherein, the first confidence level threshold is less than the second confidence level threshold.
8. The search method according to any one of claims 1 to 5, characterized in that, After calling the search engine that matches the domain classification result to process the user query information to obtain a search result, it further includes: When the search result is empty or the confidence level of the search result is less than the first preset confidence level threshold, call the general search engine to process the user query information to obtain a new search result.
9. The search method according to any one of claims 1 to 5, characterized in that The step of inputting the user query information into the domain classification model to obtain the domain classification result output by the domain classification model includes: Input the user query information into the domain classification model to obtain the initial domain classification result output by the domain classification model; When the confidence level of the initial domain classification result is less than the second preset confidence level threshold, use the preset domain classification method to determine the domain classification result of the user query information; When the confidence level of the initial domain classification result is greater than or equal to the second preset confidence level threshold, determine the initial domain classification result as the domain classification result.
10. The search method according to any one of claims 1 to 5, characterized in that, The domain classification model is trained based on the following method: Input the user query information test sample into the pre-trained domain classification model to obtain the classification probabilities of multiple prediction results output by the domain classification model; Based on each of the classification probabilities, determine the information entropy of the multiple prediction results; When the information entropy is greater than the preset information entropy threshold, determine the user query information test sample as a difficult negative sample; Based on the difficult negative sample and its corresponding domain classification result label, retrain the domain classification model.
11. The search method according to any one of claims 1 to 5, characterized in that, The step of receiving the user query information includes: Receive the original query information input by the user; Input the original query information into the query rewriting model to obtain the user query information output by the query rewriting model; Wherein, the query rewriting model is constructed based on a large model, and the query rewriting model is used to perform at least one of the following rewriting processes: error correction process, synonym rewriting process, redundant content deletion process, and multi-turn dialogue context optimization process, and the multi-turn dialogue context optimization process is used to rewrite the current user query information based on the historical user query information.
12. The search method according to claim 11, wherein Before inputting the original query information into the query rewriting model to obtain the user query information output by the query rewriting model, it further includes: Parse the query semantic type of the original query information, and input the query semantic type and the original query information into the query rewriting model; and / or, Decompose the content of the original query information to obtain a number of content information, and input the number of content information and the original query information into the query rewriting model; the number of content information includes at least one of core keyword information, modifier information, and context type information.
13. A search device, characterized in that, Comprising: A receiving module, configured to receive user query information; A classification module, configured to input the user query information into a domain classification model to obtain a domain classification result output by the domain classification model; The domain classification model is used to determine the domain to which the user query information belongs; A search module, configured to call a search engine that matches the domain classification result to process the user query information to obtain a search result; Wherein, the search engine includes a medical search engine or a general search engine.
14. An electronic device, comprising a memory, a processor, and a computer program stored on the memory and running on the processor, characterized in that, When the processor executes the computer program, the search method according to any one of claims 1 to 12 is implemented.
15. A non-transitory computer-readable storage medium storing a computer program thereon, characterized in that, When the computer program is executed by a processor, the search method according to any one of claims 1 to 12 is implemented.
16. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, the search method according to any one of claims 1 to 12 is implemented.
Citation Information
Patent Citations
Adaptive multi-field search engine calling method and system
CN101980209A
Search method and device
CN102033877A
Multi-case weak supervision Mars surface morphology detection method based on online learning
CN114415254A
Data search method and device, electronic equipment and storage medium
CN115408582A
Searching method and device, computer equipment and storage medium
CN116561419A