Vaccine inoculation question and answer method and device, electronic device, storage medium

By acquiring users' health status or special health status, and utilizing a pre-set knowledge base and large language model, highly accurate vaccination recommendations are generated. This solves the problem that existing systems cannot identify the vaccination needs of children with special health statuses, and realizes personalized vaccination recommendations.

CN121235126BActive Publication Date: 2026-02-24CHILDRENS HOSPITAL OF CHONGQING MEDICAL UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511783801.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-12-01
Publication Date
2026-02-24
Estimated Expiration
2045-12-01

AI Technical Summary

Technical Problem

Existing large language model-based medical question-answering systems cannot accurately identify the vaccination needs of children with special health conditions, resulting in insufficient accuracy and specificity in vaccination recommendations.

Method used

By acquiring users' health status or special health status, and utilizing a pre-set knowledge base and large language model, targeted vaccination recommendations are generated, including feature information variables, confidence ranking of target question-answer pairs, and dynamic questionnaire completion, thereby improving the accuracy of answers.

Benefits of technology

This has improved the accuracy and relevance of vaccination recommendations, especially for personalized vaccination recommendations for children with special health conditions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121235126B_ABST
    Figure CN121235126B_ABST
Patent Text Reader

Abstract

The application relates to the technical field of artificial intelligence, and discloses a vaccine inoculation question and answer method and device, an electronic device and a storage medium. The vaccine inoculation question and answer method comprises the following steps: in the case that inquiry information of a user is received, acquiring a user state; acquiring a characteristic information variable corresponding to the user state according to the user state; the characteristic information variable is an answer of the user to a preset question; according to the inquiry information and the characteristic information variable, a preset knowledge base is used for searching to obtain a target question and answer pair; according to the age of a source literature of the target question and answer pair, the authority score of the source literature and the taboo conflict situation of the target question and answer pair, a target confidence of the target question and answer pair is acquired; a system role, a user role, the target question and answer pair sorted according to the target confidence and the inquiry information are combined to form a first prompt word; and the first prompt word is input into a preset large language model to generate an answer corresponding to the inquiry information. The method can improve the accuracy of vaccine inoculation suggestions.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of artificial intelligence technology, such as a vaccine vaccination question-and-answer method and apparatus, electronic device, and storage medium. Background Technology

[0002] Vaccination is an effective means of preventing infectious diseases, especially for children. However, in practice, vaccination decisions for children with special health conditions (such as premature infants, congenital heart disease, immunodeficiency, liver and kidney disease, epilepsy, asthma, and blood disorders) face many challenges. Due to the specific nature of their underlying diseases or physiological conditions, these children face higher risks when vaccinated and require precise assessment based on individualized medical evidence.

[0003] Currently, while large language model (LLM) medical question-answering systems exist that can provide consultations regarding vaccinations, these systems generate answers by vectorizing medical literature and combining it with semantic retrieval. However, existing systems generally lack the ability to subdivide and identify specific health conditions in children, resulting in low accuracy and insufficient relevance of the answers.

[0004] It should be noted that the information disclosed in the background section above is only used to enhance the understanding of the background of this application, and therefore may include information that does not constitute prior art known to those skilled in the art. Summary of the Invention

[0005] To provide a basic understanding of some aspects of the disclosed embodiments, a brief summary is given below. This summary is not intended as a general commentary, nor is it intended to identify key / important components or describe the scope of protection of these embodiments, but rather as a prelude to the detailed description that follows.

[0006] This disclosure provides a vaccine vaccination question-and-answer method and apparatus, electronic device, and storage medium to improve the accuracy of vaccination recommendations.

[0007] In some embodiments, the vaccination question-and-answer method includes: upon receiving a user's inquiry information, obtaining the user's status; the user status is a healthy status or a special health status, the special health status being used to characterize that the user suffers from a preset disease; the inquiry information is used to characterize consultation information regarding vaccination; based on the user status, obtaining feature information variables corresponding to the user status; the feature information variables are the user's answers to preset questions; based on the inquiry information and the feature information variables, performing a search using a preset knowledge base to obtain a target question-and-answer pair; based on the age of the source literature of the target question-and-answer pair, the authority score of the source literature, and the taboo conflict status of the target question-and-answer pair, obtaining the target confidence level of the target question-and-answer pair; combining the system role, the user role, the target question-and-answer pair sorted according to the target confidence level, and the inquiry information to form a first prompt word; inputting the first prompt word into a preset large language model to generate the answer corresponding to the inquiry information.

[0008] In some embodiments, the vaccination question-and-answer device includes: a user status acquisition module, configured to acquire a user status upon receiving a user's inquiry information; the user status is a healthy status or a special health status, the special health status being used to characterize a user suffering from a preset disease; the inquiry information being used to characterize consultation information regarding vaccination; a feature information variable acquisition module, configured to acquire a feature information variable corresponding to the user status based on the user status; the feature information variable being the user's answer to a preset question; a retrieval module, configured to perform a retrieval using a preset knowledge base based on the inquiry information and the feature information variable to obtain a target question-and-answer pair; a target confidence level acquisition module, configured to acquire a target confidence level of the target question-and-answer pair based on the age of the source literature of the target question-and-answer pair, the authority score of the source literature, and the taboo conflict status of the target question-and-answer pair; a prompt word construction module, configured to compose a first prompt word by combining system roles, user roles, target question-and-answer pairs sorted according to the target confidence level, and the inquiry information; and a generation module, configured to input the first prompt word into a preset large language model to generate an answer corresponding to the inquiry information.

[0009] In some embodiments, the vaccination question-and-answer device includes a processor and a memory storing program instructions, the processor being configured to execute the above-described vaccination question-and-answer method when the program instructions are executed.

[0010] In some embodiments, the electronic device includes: an electronic device body; and a vaccination question-and-answer device, as described above, is mounted on the electronic device body.

[0011] In some embodiments, the storage medium stores program instructions that are executed by a processor to implement the above-described vaccine question-and-answer method.

[0012] The vaccination question-and-answer method, apparatus, electronic device, and storage medium provided in this disclosure can achieve the following technical effects: Upon receiving a user's inquiry about vaccination, the system obtains the user's status to determine whether the user is in a healthy state or a special health state; it then searches the knowledge base based on the information variables corresponding to the user's status and the inquiry information to obtain target question-and-answer pairs related to the user's status; and it obtains the target confidence of the target question-and-answer pairs. This makes the answers generated by the large language model based on the target question-and-answer pairs related to the user's status and sorted according to the target confidence, and the inquiry information, more targeted to the user, thus improving the accuracy of vaccination recommendations.

[0013] The above general description and the description below are exemplary and illustrative only and are not intended to limit this application. Attached Figure Description

[0014] One or more embodiments are illustrated by way of example with reference to the accompanying drawings. These illustrations and drawings do not constitute a limitation on the embodiments. Elements having the same reference numerals in the drawings are shown as similar elements. The drawings are not to be scaled. And wherein:

[0015] Figure 1 This is a schematic diagram of a vaccine vaccination question-and-answer method provided in an embodiment of this disclosure;

[0016] Figure 2 This is a schematic diagram of the structure of a vaccination question-and-answer device provided in an embodiment of this disclosure;

[0017] Figure 3 This is a schematic diagram of another vaccination question-and-answer device provided in an embodiment of this disclosure;

[0018] Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this disclosure. Detailed Implementation

[0019] To provide a more detailed understanding of the features and technical content of the embodiments of this disclosure, the implementation of the embodiments of this disclosure will be described in detail below with reference to the accompanying drawings. The accompanying drawings are for illustrative purposes only and are not intended to limit the embodiments of this disclosure. In the following technical description, for ease of explanation, several details are used to provide a full understanding of the disclosed embodiments. However, one or more embodiments may still be implemented without these details. In other cases, well-known structures and devices may be simplified in their depiction to simplify the drawings.

[0020] The terms "first," "second," etc., used in the specification, claims, and accompanying drawings of this disclosure are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate for the embodiments of this disclosure described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion.

[0021] Unless otherwise stated, the term "multiple" means two or more.

[0022] In this embodiment of the disclosure, the character " / " indicates that the objects before and after it are in an "or" relationship. For example, A / B means: A or B.

[0023] The term "and / or" describes an association between objects, indicating that three relationships can exist. For example, A and / or B means: A or B, or A and B.

[0024] The term "correspondence" can refer to an association or binding relationship. The correspondence between A and B means that there is an association or binding relationship between A and B.

[0025] The vaccination question-and-answer method provided in this disclosure is executed by an electronic device. The electronic device includes a computer or a server.

[0026] Existing vaccination consultation systems cannot provide accurate and personalized vaccination recommendations for children with special health conditions, such as premature birth, congenital heart disease, immunodeficiency, liver and kidney disease, epilepsy, asthma, and blood disorders. The vaccination question-and-answer method provided in this disclosure can input user-state-related question-and-answer pairs and query information into a large language model, making the answers generated by the large language model more targeted to the user and improving the accuracy of vaccination recommendations. This provides users with personalized answers.

[0027] Combination Figure 1 As shown, this disclosure provides a vaccine vaccination question-and-answer method, including:

[0028] Step S101: Upon receiving the user's inquiry information, obtain the user's status. The user status is either a healthy status or a special health status. A special health status indicates that the user suffers from a preset disease. For example, preset diseases include one or more of the following: premature birth, congenital heart disease, immunodeficiency, liver or kidney disease, epilepsy, asthma, or blood disorders. A healthy status indicates that the user is not sick. When the user status is healthy, it means the user is not sick and is in good health. When the user status is a special health status indicating a preset disease, it means the user is sick and suffers from a preset disease. The inquiry information is used to represent consultation information regarding vaccination.

[0029] Step S102: Based on the user's state, obtain the feature information variables corresponding to the user's state. The feature information variables are the user's answers to preset questions.

[0030] Step S103: Based on the query information and feature information variables, retrieve the target question-answer pair using a preset knowledge base.

[0031] Step S104: Obtain the target confidence level of the target question-answer pair based on the age of the source literature, the authority score of the source literature, and the taboo conflict status of the target question-answer pair.

[0032] Step S105: The system role, user role, target question-answer pairs sorted by target confidence level, and user query information are combined to form the first prompt word.

[0033] Step S106: Input the first prompt word into the preset large language model to generate the answer corresponding to the query information.

[0034] The vaccination question-and-answer method provided in this disclosure, upon receiving a user's inquiry about vaccination, determines whether the user is in a healthy or special health condition by obtaining the user's status; it then searches the knowledge base based on the feature information variables corresponding to the user's status and the inquiry information to obtain target question-and-answer pairs related to the user's status; and finally, it obtains the target confidence score of the target question-and-answer pairs. This allows the large language model to generate answers based on the target question-and-answer pairs and the inquiry information, which are related to the user's status and sorted according to the target confidence score, to be more targeted to the user, thus improving the accuracy of vaccination recommendations.

[0035] Optionally, obtaining the user's status includes: searching for a preset first keyword in the query information. If the first keyword is found in the query information, the user's status is determined based on the found first keyword.

[0036] Optionally, obtaining the user's status includes: searching for a preset first keyword in the query information; if the first keyword is not found in the query information, sending a query to the user and receiving the user's first response to the query; and obtaining the user's status based on the first response.

[0037] Furthermore, obtaining the user's status based on the first response information includes: searching for a preset first keyword in the first response information; if the first keyword is found in the first response information, determining the user's status based on the found first keyword; if the first keyword is not found in the first response information, continuing with the steps of sending an inquiry to the user, receiving the user's first response to the inquiry, and obtaining the user's status based on the first response.

[0038] In some embodiments, the preset first keyword includes one or more of the following: no illness, premature birth, congenital heart disease, immunodeficiency, liver and kidney disease, epilepsy, asthma, and blood disorders. The query information is information pre-stored in a query information database. If the first keyword is not found in the user's query information and the first answer information, a query is randomly selected from the query information database and sent to the user.

[0039] Furthermore, determining the user's status based on the found first keyword includes: performing a lookup operation in a preset first data table using the found first keyword to find the user status corresponding to that first keyword. This preset first data table stores the correspondence between first keywords and user statuses. For example, if the first keyword "not sick" is found, the corresponding user status is healthy. If the first keyword "premature birth" is found, the corresponding user status is a special health condition related to premature birth. If the first keyword "congenital heart disease" is found, the corresponding user status is a special health condition related to congenital heart disease. If the first keyword "immunodeficiency" is found, the corresponding user status is a special health condition related to immunodeficiency. If the first keyword "liver and kidney disease" is found, the corresponding user status is a special health condition related to liver and kidney disease. If the first keyword "epilepsy" is found, the corresponding user status is a special health condition related to epilepsy. If the first keyword "asthma" is found, the corresponding user status is a special health condition related to asthma. If the first keyword "blood disease" is found, the corresponding user status is a special health condition related to blood disease.

[0040] In some embodiments, the user describes the child's symptoms or diagnosis in natural language and inquires about whether vaccination is possible. If no first keyword is found in the inquiry, a new query is sent to the user, such as, "Does your child have a doctor-diagnosed chronic illness such as asthma, epilepsy, congenital heart disease, or allergies? Is the child currently sick?" The system then searches for the first keyword in the user's first response to this query. If "not sick" is found, the user is determined to be in a healthy state. If "asthma" is found, the user is determined to be in a specific health condition related to asthma. If no first keyword is found, a new query is randomly selected from the query database and sent to the user. The search continues on the user's first response to this query until the first keyword is found, thus determining the user's status.

[0041] For example, if a user enters the question, "My child has asthma, can he / she get vaccinated?", and the first keyword "asthma" is found in the question, then the user's condition is directly determined to be a specific health condition of asthma.

[0042] For example, a user enters the query: "My child isn't feeling well." No primary keyword is found in this query. Therefore, a random query is sent to the user: "Does your child have a doctor-diagnosed chronic illness such as asthma, epilepsy, congenital heart disease, or allergies? Is your child currently ill?" Upon receiving the user's first response: "Has congenital heart disease," the query finds "congenital heart disease" in that response. This determines the user's status as a special health condition related to congenital heart disease.

[0043] For example, a user enters the inquiry: "I'm inquiring about vaccination." No primary keyword is found in this inquiry. Therefore, a random inquiry is sent to the user: "Does your child have any doctor-diagnosed chronic illnesses such as asthma, epilepsy, congenital heart disease, or allergies? Is your child currently sick?" Upon receiving the user's first response: "No chronic illnesses, very healthy recently, not sick," the system searches for "not sick" in this response and determines the user's status as healthy.

[0044] For example, a user enters the question: "Are vaccines safe?". No primary keyword is found in this question. The system then randomly sends the question: "Does your child have a doctor-diagnosed chronic illness such as asthma, epilepsy, congenital heart disease, or allergies? Is your child currently sick?". The system receives the user's first response: "The weather is nice today." Again, no primary keyword is found in this response. The system continues sending the question: "Does your child have a doctor-diagnosed chronic illness such as asthma, epilepsy, congenital heart disease, or allergies? Is your child currently sick?", until the primary keyword is found in the user's first response.

[0045] Optionally, based on the user's status, the feature information variable corresponding to the user's status is obtained, including: obtaining questionnaire information corresponding to the user's status; sending the questionnaire information to the user and receiving the user's second response information; and obtaining the feature information variable corresponding to the user's status based on the second response information. Here, the feature information variable corresponding to the user's status is the value of the feature information corresponding to the user's status. For example, if the feature information corresponding to the user's status is age, then the feature information variable corresponding to the user's status is 5 years old.

[0046] Furthermore, obtaining questionnaire information corresponding to the user's status based on the user's status includes: performing a lookup operation in a preset second data table using the feature information corresponding to the user's status to find the preset questions corresponding to the feature information; generating questionnaire information from the preset questions corresponding to the found feature information; and identifying this questionnaire information as the questionnaire information corresponding to the user's status. The preset second data table stores the preset questions corresponding to the feature information.

[0047] The feature information corresponding to the user status is obtained in the following way: a table lookup operation is performed on the user status in a preset third data table to find the feature information corresponding to the user status. The preset third data table stores the feature information corresponding to the user status.

[0048] In some embodiments, the feature information includes one or more of the following: user identity, user age, user's vaccination history, user's allergy history, number of illnesses, and date of the first illness. Different user states correspond to different feature information. Once a user state is determined, a questionnaire corresponding to that user state is sent to the user, and the variable of the feature information corresponding to that user state is extracted from the user's second response to the questionnaire.

[0049] Furthermore, the process of obtaining feature information variables corresponding to the user's state based on the second response information includes: extracting feature information variables corresponding to the user's state from the second response information; and performing a null value check on the feature information variables corresponding to the user's state. If none of the feature information variables corresponding to the user's state are null, then it is determined that all feature information variables corresponding to the user's state have been obtained. If any of the feature information variables corresponding to the user's state contain null values, then a new questionnaire is generated based on the preset questions for the feature information corresponding to the null values, and the new questionnaire is sent to the user. The user's second response information is then received. The process of obtaining feature information variables corresponding to the user's state based on the second response information continues until all feature information variables corresponding to the user's state have been obtained.

[0050] In this way, by using dynamic questionnaires to obtain all the characteristic information variables corresponding to the user's status, information completion can be achieved, so that the final output of the user's inquiry information can better match the user's status, thus improving the accuracy of the answers to the user's inquiries about vaccination.

[0051] In some embodiments, if the user's status is healthy, the characteristic information corresponding to the healthy status includes eight characteristics such as user identity, age, vaccination history, and allergy history. Preset questions corresponding to this characteristic information are obtained, and corresponding questionnaire information is generated.

[0052] If a user's status is a special health condition of congenital heart disease, the corresponding characteristic information includes 15 features such as user identity, age, vaccination history, allergy history, and symptoms. Preset questions corresponding to these features are obtained, and a corresponding questionnaire is generated. This questionnaire is sent to the user, and feature information variables are extracted from the user's second response. These extracted variable values ​​are then stored in the corresponding feature information. For example, if the second response includes "child is 5 years old," the extracted variable "5 years old" is assigned to the "Age" variable. The feature information variables extracted from the second response in each round of user feedback are merged into a structured field (JSON Schema) in real time. Null values ​​are checked for the current 15 feature variables, and questions are asked sequentially for the null variables until the information is complete.

[0053] Optionally, the preset knowledge base includes a health knowledge base and a special health knowledge base. The preset knowledge base is obtained by inputting preset text information into a preset large language model, causing the large language model to output multiple question-answer pairs. The text information is used to represent vaccination knowledge. Each question-answer pair includes a question, a corresponding question vector, a corresponding answer, and a corresponding answer vector, where both the question and answer are text information. The user state targeted by each question-answer pair is obtained. Question-answer pairs targeting health states are stored in the health knowledge base. Question-answer pairs targeting special health states are stored in the special health knowledge base.

[0054] In some embodiments, multiple preset text messages are input into a preset large language model along with preset second prompt words, so that the large language model outputs multiple question-answer pairs. That is, each preset text message corresponds to multiple question-answer pairs.

[0055] This process involved acquiring multiple documents, including medical guidelines, expert consensus statements, and vaccine instruction manuals, through automated crawling or manual import. OCR and layout analysis were used to convert each document into Markdown format text, preserving headings, tables, and paragraphs. The text was then semantically segmented into blocks based on preset tags, including indications, contraindications, precautions, and adverse reactions. In essence, the Markdown-formatted text, divided into blocks, was identified as the predefined text.

[0056] The preset second prompt is: "Please list 30-50 questions and answers for children with special health conditions" or "Please list 30-50 questions and answers for vaccination".

[0057] For example, input the Markdown block of each document along with the prompt: "Please list 30-50 questions and answers for children with special health conditions" into a pre-defined large language model. The large language model will then output a question-answer pair JSON: {q, a, source_doc, section, evidence_span, update_date}. Here, q represents the question information and question vector, a represents the answer information, source_doc represents the source document, section represents the original article section, evidence_span represents the location of the original evidence, and update_date represents the update date.

[0058] Optionally, after the large language model outputs multiple question-answer pairs, the process also includes: performing quality checks on the multiple question-answer pairs; and obtaining the corresponding user status for the question-answer pairs that pass the checks.

[0059] The quality review process for multiple question-and-answer pairs includes the following steps:

[0060] Step S201: Check if the question-and-answer pair format is compliant. If yes, proceed to step S202; otherwise, discard the question-and-answer pair. For example, check if the question-and-answer pair format conforms to the JSON structure. If it does, it is compliant; otherwise, it is non-compliant. Through automated validation, enforce field checks for completeness of: q (question), a (answer), source_doc (source document), section (original article section), evidence_span (original evidence location), and update_date (update date).

[0061] Step S202: Check the accuracy of the medical terminology in the question-and-answer pair. If yes, proceed to step S203; otherwise, proceed to step S205. Specifically, match the terminology with a standard medical terminology database, such as ICD-10 or a vaccine generic terminology dictionary. If a matching term is found in the standard medical terminology database, the medical terminology in the question-and-answer pair is considered accurate; otherwise, it is considered inaccurate.

[0062] Step S203: Detect whether the text contains preset key elements. If yes, proceed to step S204; otherwise, proceed to step S205. The preset key elements include at least one of the following: whether vaccination has been administered, vaccination procedure, vaccination conditions, and vaccination risks.

[0063] Step S204: Check if there is a taboo conflict. If not, proceed to step S206; if yes, proceed to step S205. For example, if the answer indicates vaccination is permissible, but the original text contains a taboo, then there is a taboo conflict.

[0064] Step S205: Send the result to the user and receive the user's review result. If the review result is approved, proceed to step S206; if the review result is not approved, discard the question-and-answer pair.

[0065] Step S206: Obtain the user status targeted by the question-answer pair.

[0066] Optionally, the user status targeted by each question-and-answer pair is obtained, including: searching for a preset second keyword in the questions and answers of each question-and-answer pair. If a second keyword is found, a lookup operation is performed in a preset fourth data table using the found second keyword to find the user status corresponding to that second keyword. The found user status is then determined as the user status targeted by the corresponding question-and-answer pair. This preset fourth data table stores the correspondence between second keywords and user statuses. If the user status targeted by a question-and-answer pair is a special health state, the found second keyword is used as a tag for the corresponding question-and-answer pair.

[0067] Optionally, the user status targeted by each question-and-answer pair can be obtained, including searching for a preset second keyword in the questions and answers of each pair. If no second keyword is found, the user status targeted by the question-and-answer pair is determined to be healthy.

[0068] In some embodiments, the preset second keywords include one or more of the following: not sick, premature birth, congenital heart disease, immunodeficiency, liver and kidney disease, epilepsy, asthma, and blood disorders. For example, if the second keyword "not sick" is found, the user status targeted by the question and answer is healthy. If the second keyword "premature birth" is found, the user status targeted by the question and answer is a special health condition, and the corresponding tag is "premature birth". If the second keyword "congenital heart disease" is found, the user status targeted by the question and answer is a special health condition, and the corresponding tag is "congenital heart disease". If the second keyword "immunodeficiency" is found, the user status targeted by the question and answer is a special health condition, and the corresponding tag is "immunodeficiency". If the second keyword "liver and kidney disease" is found, the user status targeted by the question and answer is a special health condition, and the corresponding tag is "liver and kidney disease". If the second keyword "epilepsy" is found, the user status targeted by the question and answer is a special health condition, and the corresponding tag is "epilepsy". If the second keyword "asthma" is found, then the user status targeted by this question and answer is a special health condition, and the corresponding tag is "asthma". If the second keyword "blood disease" is found, then the user status targeted by this question and answer is a special health condition, and the corresponding tag is "blood disease".

[0069] Optionally, the user state targeted by each question-answer pair is obtained, including: searching for a preset second keyword in the questions and answers of each question-answer pair. If no second keyword is found, medical terms are extracted from the questions and answers of each question-answer pair. The extracted medical terms are semantically matched with the second keywords in the fourth data table, and the user state corresponding to the second keyword that successfully matches the medical term is determined as the user state targeted by the corresponding question-answer pair. A semantic match is considered successful if the semantic confidence is greater than a preset value. Medical terms in the questions and answers of the question-answer pair are extracted using a pre-trained medical named entity recognition model.

[0070] If no medical terms are extracted from the questions and answers of each question-and-answer pair, the user status targeted by the question-and-answer pair is determined to be healthy.

[0071] Optionally, after obtaining the user state targeted by each question-answer pair, the method further includes: using a preset embedding model to convert the questions and answers in the question-answer pair into dense vectors of a set length, obtaining the question vector corresponding to the question and the answer vector corresponding to the answer. The question vector and answer vector are then stored together with the corresponding question text and answer text in the corresponding knowledge base. Storing them in vector form enables the establishment of an efficient index structure to support fast retrieval. The preset embedding model is bge-large-zh-v1.5, with a set length of 1024 dimensions.

[0072] In some embodiments, for example, if question A is: "Can premature infants receive the BCG vaccine?", and the answer is: "Premature infants with a birth weight <2500g should postpone BCG vaccination until their weight reaches 2500g or more," then if the second keyword "premature" is found in the question, then question A is stored in the special health knowledge base and tagged with "premature."

[0073] For example, in question B: "Can a premature infant weighing only 2kg at birth receive the BCG vaccine?", the answer is: "Premature infants with a birth weight <2500g should postpone BCG vaccination until their weight reaches 2500g or more." If the answer contains the secondary keyword "premature," then question B is added to the special health knowledge base and tagged "premature."

[0074] For example, question C asks: "What precautions should be taken when children with congenital heart disease receive vaccinations?" The answer is: "For children with patent ductus arteriosus (PDA) who are hemodynamically stable, vaccination can proceed as scheduled. However, for children with complications such as heart failure, vaccination should be postponed until their heart function stabilizes and they are assessed." The medical term "congenital heart disease" is extracted using a named entity recognition model and semantically matched with the second keyword "congenital heart disease" in the fourth data table. If the semantic confidence score is greater than a threshold (e.g., 0.99), question-answer pair C is stored in a special health knowledge base and tagged with "congenital heart disease."

[0075] For example, the question and answer match D is: "What is the procedure for vaccinating healthy children against measles?". The answer is: "According to the National Immunization Program, healthy children receive one dose of measles-rubella combined live attenuated vaccine at 8 months of age, and one dose of measles-mumps-rubella combined live attenuated vaccine at 18-24 months of age." Neither the question nor the answer uses medical terminology other than vaccines, the answer clearly addresses "healthy children," and the entire text does not mention any specific diseases or abnormal conditions. Therefore, question and answer match D will be stored in the health knowledge base.

[0076] Optionally, based on the user's query information and the feature information variables corresponding to the user's state, a search is performed using a preset knowledge base to obtain the target question-answer pair. This includes: inputting the user's query information and the feature information variables corresponding to the user's state into a preset large language model, causing the large language model to output multiple key sentences; encoding the user's query information and the key sentences output by the large language model to obtain query vectors; obtaining the cosine similarity between each query vector and each question vector in the knowledge base; obtaining a first preset number of first candidate question-answer pairs based on each cosine similarity; matching the feature information variables corresponding to the user's state in each question-answer pair in the knowledge base to obtain a second preset number of second candidate question-answer pairs; and obtaining the target question-answer pair based on the first and second candidate question-answer pairs.

[0077] In some embodiments, the preset large language model is a large language model fine-tuned by prompt word engineering. The user's query information and the feature information variables corresponding to the user's state are input into the preset large language model, causing the large language model to generalize into multiple key sentences. The key sentences are the core viewpoints or key points related to the user's query information. For example, five key sentences related to the user's query information are generalized.

[0078] The user's query information and the key sentences output by the large language model are encoded separately to obtain query vectors. This includes: encoding the query information using a pre-defined embedding model to obtain a vector corresponding to the query information; encoding the key sentences using a pre-defined embedding model to obtain a vector corresponding to the key sentences; and determining both the vectors corresponding to the query information and the vectors corresponding to the key sentences as query vectors. The pre-defined embedding model is bge-large-zh-v1.5.

[0079] Optionally, the cosine similarity between each query vector and each question vector in the knowledge base is obtained, and a first preset number of first candidate question-answer pairs are obtained based on each cosine similarity. This includes: sorting the question-answer pairs in the health knowledge base and the special health knowledge base in descending order of cosine similarity. When the user's status is healthy, the top first preset number of question-answer pairs from the health knowledge base are selected as first candidate question-answer pairs. Similarly, the top second preset number of question-answer pairs from the special health knowledge base are selected as first candidate question-answer pairs. And again, the top second preset number of question-answer pairs from the health knowledge base are selected as first candidate question-answer pairs. Where the first preset number + the second preset number = the first preset number, and the first preset number > the second preset number. For example, if the first preset number is 30 and the second preset number is 20, then 50 first candidate question-answer pairs are retrieved.

[0080] Optionally, matching is performed on each question-and-answer pair in the knowledge base using the feature information variables corresponding to the user's state to obtain a second preset number of second candidate question-and-answer pairs. This includes: using the feature information variables corresponding to the user's state as third keywords, searching for the third keywords in the questions and answers of each question-and-answer pair in the knowledge base, obtaining the ratio of the number of unique third keywords found in the question-and-answer pair to the total number of feature information variables, and determining this ratio as the keyword score of the question-and-answer pair. The question-and-answer pairs in the health knowledge base and the special health knowledge base are sorted in descending order of keyword score. When the user's state is healthy, the top three preset number of question-and-answer pairs from the health knowledge base are selected as second candidate question-and-answer pairs. The top four preset number of question-and-answer pairs from the special health knowledge base are selected as second candidate question-and-answer pairs. When the user's state is special health, the top three preset number of question-and-answer pairs from the special health knowledge base are selected as second candidate question-and-answer pairs. The top four preset number of question-and-answer pairs from the health knowledge base are selected as second candidate question-and-answer pairs. The third preset quantity + the fourth preset quantity = the second preset quantity, where the third preset quantity > the fourth preset quantity. For example, if the third preset quantity is 20 and the fourth preset quantity is 10, then 30 second candidate question-answer pairs are retrieved. For instance, if there are 5 characteristic information variables corresponding to a user's state, namely "A", "B", "C", "D", and "E", then the third keywords are "A", "B", "C", "D", and "E". The third keywords are searched in each question-answer pair in the knowledge base. When the third keywords "A" and "B" are found in a question-answer pair, and "A" appears twice and "B" appears three times, then the number of unique third keywords found in that question-answer pair is 2, and the keyword score for that question-answer pair is... .

[0081] In this way, the search strategy is dynamically adjusted based on the user's status. If the user has a specific health condition, the search will prioritize content from the specific health knowledge base, with content from the general health knowledge base serving as a secondary consideration; if the user is in a healthy state, the search will prioritize content from the general health knowledge base, with content from the specific health knowledge base serving as a secondary consideration. This makes the content provided by the large language model based on the search results more accurate.

[0082] Optionally, based on the first and second candidate question-answer pairs, target question-answer pairs are obtained, including: calculating the target score for each candidate question-answer pair using a preset algorithm; sorting the candidate question-answer pairs in descending order of their target scores; and determining the top 5 candidate question-answer pairs as target question-answer pairs. The candidate question-answer pairs include the first and second candidate question-answer pairs. For example, setting the ranking as 5 determines 5 target question-answer pairs.

[0083] Specifically, through calculation: hybrid i_score =α×vec i_score +β× keyword i_score Obtain the target score for candidate question-answer pairs. Among them, hybrid... i_score Let vec be the target score for the i-th candidate question-answer pair. i_score For the vector score of the i-th candidate question-answer pair, keyword i_score Let α be the keyword score of the i-th candidate question-answer pair, α be the vector weight, and β be the keyword weight. The vector score of a candidate question-answer pair is its cosine similarity.

[0084] In some embodiments, a user's state is a special health condition, and the disease they suffer from is a special case, such as immunodeficiency, which is considered a complex condition requiring emphasis on semantic understanding. Therefore, the weight of the vector retrieval results is increased. For example, α = 0.8, β = 0.2. Or, α = 0.6, β = 0.4.

[0085] Optionally, after obtaining the target question-answer pair, the process further includes: obtaining the age of the source documents for the target question-answer pair, obtaining the authority score of the source documents for the target question-answer pair, and obtaining the taboo conflict status of the target question-answer pair. Based on the age of the source documents for the target question-answer pair, the authority score of the source documents, and the taboo conflict status of the target question-answer pair, the target confidence level of the target question-answer pair is obtained. The target question-answer pairs are then sorted in descending order of target confidence level to obtain target question-answer pairs sorted by target confidence level.

[0086] Furthermore, obtaining the target confidence score of the target question-answer pair includes: calculating P... j =hybrid j_score ×e^(-0.5× l j ), to obtain the basic confidence of the j-th target question-answer pair. Where, P j For the base confidence of the j-th target question-answer pair, hybrid j_score Let e^(-0.5×) be the target score for the j-th target question-answer pair. l j ) is the attenuation factor. l j For the first j The age of the source documents for each target question-and-answer pair. Source document age = current year - source document publication date.

[0087] By calculating P' j =P j × h j Obtain the j The target confidence of each target question-and-answer pair. Where, P'j Let be the target confidence of the j-th target question-answer pair. h j For the first j The authority score of the source literature for each target question and answer.

[0088] The authority score of the source literature for the target question-and-answer pair is obtained as follows: A lookup operation is performed in a pre-defined fifth data table based on the source literature of the target question-and-answer pair to find the corresponding authority score. The fifth data table stores the correspondence between source literature and authority scores. For example, a medical guideline has an authority score of 0.4; a medical expert consensus has an authority score of 0.3; a vaccine instruction manual has an authority score of 0.2; and a case report has an authority score of 0.1.

[0089] In some embodiments, if a taboo conflict is detected in the target question-answer pair, the target confidence of the target question-answer pair is determined to be 0.

[0090] Obtaining the taboo conflict status of the target question-answer pair includes: if the target question-answer pair contains a pre-defined conflicting word pair, determining that the target question-answer pair has a taboo conflict. For example, if the target question-answer pair contains the conflicting word pair "taboo" and "vaccineable", then the target question-answer pair is determined to have a taboo conflict.

[0091] Furthermore, the system roles and user roles are determined. The system roles, user roles, target question-answer pairs sorted by target confidence level, and user query information are combined to form the first prompt word.

[0092] Optionally, the system role is preset first role information. Optionally, preset first role keywords are searched in the user's query information, and the corresponding system role is matched in a preset role data table using the found first role keywords. Optionally, a preset first role question is sent to the user, and the user's first reply to the first role question is received. Preset first role keywords are searched in the user's first reply information, and the corresponding system role is matched in a preset role data table using the found first role keywords. The preset role data table stores the system roles corresponding to the first role keywords.

[0093] Optionally, the user role is preset second role information. Optionally, preset second role keywords are searched in the user's query information, and the corresponding user role is matched in a preset role data table using the found second role keywords. Optionally, a preset second role question is sent to the user, and a second response from the user to the second role question is received. Preset second role keywords are searched in the user's second response information, and the corresponding user role is matched in a preset role data table using the found second role keywords. The preset role data table stores the user roles corresponding to the second role keywords.

[0094] In some embodiments, the system role is a pediatric vaccination specialist. User roles include parents or doctors. For example, a dynamic Prompt template:

System Role

[0095] [User Role] Current Consultant Identity: <Parent / Doctor>

[0096] [Core Issue] <User Inquiry Information> + <Target Question-Answer Pair>

[0097] [Key Evidence]

[0098] 1. 《Document 1》: <Evidence Fragment 1> [Credibility: ] <score1>]

[0099] 2. 《Document 2》: <Evidence Fragment 2> [Credibility: ] <score2>] ...

[0100] [Constraints]

[0101] The output must include five parts: {Conclusion, Reasons, Recommendations, References, and Disclaimer}.

[0102] The conclusion must clearly state whether it is "recommended for vaccination," "vaccination is postponed," or "vaccination is prohibited."

[0103] The reasoning must cite evidence numbers [1]-[5]

[0104] Recommendations should include specific time points / medical indicators.

[0105]

Precautions

[0106] Before vaccination: Is a pre-examination, discontinuation of medication, or special preparation required?

[0107] Post-vaccination: Common adverse reactions, observation period, and emergency treatment tips

[0108] Other factors include diet, exercise, and drug interactions.

[0109] - Security constraint mechanisms:

[0110] When there is a contradiction in the target question and answer pair, such as the second recommendation to vaccinate and the third suggestion to prohibit vaccination, an automatic warning instruction is added: "Conflict of evidence detected (X for / Y against), please manually analyze the cause of the contradiction and provide manual intervention."

[0111] Optionally, the first prompt word includes a user role. The first prompt word is input into a preset large language model to generate an answer corresponding to the query information, including: determining the style of the answer corresponding to the query information based on the user role; and generating the answer corresponding to the query information based on the style.

[0112] In some embodiments, when the user role is a parent, the corresponding style is popular, emotional, and concise, highlighting risk warnings and next steps. When the user role is a doctor, the corresponding style is structured, including decision support, contraindication levels, and follow-up recommendations.

[0113] This formatted strategy, which differentiates and restructures the answers to user queries based on user roles, ensures that the generated answers better match the user's identity, thereby improving user satisfaction.

[0114] In some embodiments, the answer to each query is accompanied by a link to the original text snippet, which facilitates tracing the source.

[0115] Combination Figure 2 As shown, this embodiment of the present disclosure provides a vaccine vaccination question-and-answer device 200, including a user status acquisition module 201, a feature information variable acquisition module 202, a retrieval module 203, a target confidence level acquisition module 204, a prompt word construction module 205, and a generation module 206. The user status acquisition module 201 is configured to acquire the user's status upon receiving a user's inquiry information; the user status is either a healthy state or a special health state, where a special health state indicates the user has a preset disease; the inquiry information indicates consultation information regarding vaccination. The feature information variable acquisition module 202 is configured to acquire feature information variables corresponding to the user's status; the feature information variables are the user's answers to preset questions. The retrieval module 203 is configured to perform a retrieval using a preset knowledge base based on the inquiry information and feature information variables to obtain a target question-and-answer pair. The target confidence level acquisition module 204 is configured to acquire the target confidence level of the target question-and-answer pair based on the age of the source literature, the authority score of the source literature, and the taboo conflict status of the target question-and-answer pair. The prompt word construction module 205 is configured to combine system roles, user roles, target question-answer pairs sorted according to the target confidence level, and the query information to form a first prompt word. The generation module 206 is configured to input the first prompt word into a preset large language model to generate the answer corresponding to the query information.

[0116] The vaccination question-and-answer device provided in this embodiment, upon receiving a user's inquiry about vaccination, determines whether the user is in a healthy or special health condition by obtaining the user's status; it then searches the knowledge base based on the feature information variables corresponding to the user's status and the inquiry information to obtain target question-and-answer pairs related to the user's status; and it obtains the target confidence of the target question-and-answer pairs. This allows the large language model to generate answers based on the target question-and-answer pairs and the inquiry information, which are related to the user's status and sorted according to the target confidence, to be more targeted to the user, thus improving the accuracy of vaccination recommendations.

[0117] Optionally, the user status acquisition module is configured to acquire user status by: searching for a preset first keyword in the query information; and determining the user status based on the first keyword if the first keyword is found.

[0118] Optionally, the user status acquisition module is configured to acquire user status by: searching for a preset first keyword in the query information; if the first keyword is not found, sending a query to the user and receiving the user's first response to the query; and acquiring the user status based on the first response.

[0119] The feature information variable acquisition module is configured to acquire feature information variables corresponding to the user's status in the following ways: acquiring questionnaire information corresponding to the user's status; sending questionnaire information to the user and receiving the user's second response information to the questionnaire information; and acquiring feature information variables corresponding to the user's status based on the second response information.

[0120] The preset knowledge base includes a health knowledge base and a special health knowledge base. The retrieval module is configured to obtain the preset knowledge base in the following ways: Input preset text information into a preset large language model, so that the large language model outputs multiple question-answer pairs; the text information is used to represent vaccination knowledge; the question-answer pair includes a question, a question vector corresponding to the question, an answer corresponding to the question, and an answer vector corresponding to the answer; obtain the user status targeted by each question-answer pair; store the question-answer pairs for health status in the health knowledge base, and store the question-answer pairs for special health status in the special health knowledge base.

[0121] The retrieval module is configured to retrieve target question-answer pairs using a pre-defined knowledge base based on query information and feature information variables in the following manner: The query information and feature information variables are input into a pre-defined large language model, causing the model to output multiple key sentences; the query information and key sentences are encoded to obtain query vectors; the cosine similarity between each query vector and each question vector in the knowledge base is obtained; a first pre-defined number of first candidate question-answer pairs are obtained based on the cosine similarity; the feature information variables are used to match each question-answer pair in the knowledge base to obtain a second pre-defined number of second candidate question-answer pairs; and the target question-answer pair is obtained based on the first and second candidate question-answer pairs.

[0122] The first prompt word includes the user role. The generation module is configured to input the first prompt word into a preset large language model in the following way to generate the answer corresponding to the query information: determine the style of the answer based on the user role; generate the answer corresponding to the query information based on the style.

[0123] Combination Figure 3 As shown, this embodiment of the present disclosure provides a vaccination question-and-answer device 300, including a processor 304 and a memory 301 storing program instructions. Optionally, the device may further include a communication interface 302 and a bus 303. The processor 304, communication interface 302, and memory 301 can communicate with each other via the bus 303. The communication interface 302 can be used for information transmission. The processor 304 can call the program instructions in the memory 301 to execute the vaccination question-and-answer method of the above embodiment.

[0124] Furthermore, the logic instructions in the aforementioned memory 301 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium.

[0125] The memory 301, as a computer-readable storage medium, can be used to store software programs and computer-executable programs, such as program instructions / modules corresponding to the methods in the embodiments of this disclosure. The processor 304 executes functional applications and data processing by running the program instructions / modules stored in the memory 301, thereby implementing the vaccination question-and-answer method in the above embodiments.

[0126] The memory 301 may include a program storage area and a data storage area. The program storage area may store the operating system and applications required for at least one function; the data storage area may store data created based on the use of the terminal device. Furthermore, the memory 301 may include high-speed random access memory and may also include non-volatile memory.

[0127] Combination Figure 4 As shown, this disclosure provides an electronic device 400, including an electronic device body and the aforementioned vaccine inquiry-and-answer device 300. The vaccine inquiry-and-answer device 300 is installed in the electronic device body. The installation relationship described herein is not limited to placement inside the electronic device, but also includes installation connections with other components of the electronic device, including but not limited to physical connections, electrical connections, or signal transmission connections. Those skilled in the art will understand that the vaccine inquiry-and-answer device 300 can be adapted to suitable electronic device bodies to achieve other feasible embodiments.

[0128] Electronic devices include servers or computers.

[0129] This disclosure provides a storage medium storing program instructions, which are executed by a processor to implement the above-described vaccine question-and-answer method.

[0130] The technical solutions of this disclosure can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes one or more instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the method described in this disclosure. The aforementioned storage medium can be a non-transitory storage medium, including: a USB flash drive, a portable hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, and other media capable of storing program code; it can also be a transient storage medium.

[0131] The foregoing description and accompanying drawings fully illustrate embodiments of this disclosure to enable those skilled in the art to practice them. Other embodiments may include structural, logical, electrical, procedural, and other changes. The embodiments represent only possible variations. Individual components and functions are optional unless explicitly required, and the order of operation may vary. Parts and features of some embodiments may be included in or replace parts and features of other embodiments. Moreover, the terminology used in this application is for describing embodiments only and is not intended to limit the claims. As used in the description of embodiments and claims, the singular forms "a," "an," and "the" are intended to equally include the plural forms unless the context clearly indicates otherwise. Similarly, the term "and / or" as used in this application refers to any and all possible combinations of one or more of the associated listed elements. Additionally, when used in this application, the term "comprise" and its variations "comprises" and / or "comprising" refer to the presence of stated features, integrals, steps, operations, elements, and / or components, but do not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components, and / or groups thereof. Without further limitations, an element defined by the phrase "comprises a…" does not exclude the presence of other identical elements in the process, method, or apparatus that includes said element. In this document, each embodiment may focus on the differences from other embodiments, and similar or identical parts between embodiments can be referred to mutually. For methods, products, etc., disclosed in the embodiments, if they correspond to the method section disclosed in the embodiments, the relevant parts can be referred to the description of the method section.

[0132] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the embodiments of this disclosure. Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.

[0133] The methods and products disclosed in the embodiments herein (including but not limited to devices and equipment) can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For instance, the division of units may be merely a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces, and the indirect coupling or communication connection of devices or units may be electrical, mechanical, or other forms. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to implement this embodiment according to actual needs. In addition, the functional units in the embodiments of this disclosure may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0134] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. In some alternative implementations, the functions marked in the blocks may occur in a different order than that shown in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. In the descriptions corresponding to the flowcharts and block diagrams in the accompanying drawings, the operations or steps corresponding to different blocks may also occur in a different order than disclosed in the description, and sometimes there is no specific order between different operations or steps. For example, two consecutive operations or steps may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. Each block in a block diagram and / or flowchart, and combinations of blocks in a block diagram and / or flowchart, can be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions.

Claims

1. A method for answering questions about vaccination, characterized in that, include: Upon receiving a user's query, obtain the user's status; The user status is either healthy or in a special health state, where the special health state indicates that the user suffers from a preset disease; the inquiry information indicates consultation information regarding vaccination. Based on the user state, obtain the feature information variables corresponding to the user state; The feature information variable is the user's answer to a preset question; Based on the query information and the feature information variables, a search is performed using a preset knowledge base to obtain the target question-answer pair; The target confidence level of the target question-answer pair is obtained based on the age of the source documents of the target question-answer pair, the authority score of the source documents, and the taboo conflict of the target question-answer pair. The system role, user role, target question-answer pairs sorted according to the target confidence level, and the query information are combined to form the first prompt word; Input the first prompt word into a preset large language model to generate the answer corresponding to the query information; The process of obtaining target question-answer pairs by retrieving information from a pre-defined knowledge base based on the query information and the feature information variables includes: inputting the query information and the feature information variables into a pre-defined large language model, causing the large language model to output multiple key sentences; encoding the query information and the key sentences respectively to obtain query vectors; obtaining the cosine similarity between each query vector and each question vector in the knowledge base; obtaining a first pre-defined number of first candidate question-answer pairs based on the cosine similarity; matching the feature information variables with each question-answer pair in the knowledge base to obtain a second pre-defined number of second candidate question-answer pairs; and obtaining the target question-answer pair based on the first and second candidate question-answer pairs.

2. The vaccination question-and-answer method according to claim 1, characterized in that, Get user status, including: Search for the preset first keyword in the query information; If the first keyword is found, the user status is determined based on the first keyword; or, Search for the preset first keyword in the query information; If the first keyword is not found, a query message is sent to the user, and the user's first response to the query message is received. Based on the first answer information, the user status is obtained.

3. The vaccination question-and-answer method according to claim 1, characterized in that, Based on the user state, obtain the feature information variables corresponding to the user state, including: Based on the user status, obtain the questionnaire information corresponding to the user status; Send the questionnaire information to the user and receive the user's second response information in response to the questionnaire information; Based on the second answer information, obtain the feature information variables corresponding to the user state.

4. The vaccination question-and-answer method according to claim 1, characterized in that, The preset knowledge base includes a general health knowledge base and a special health knowledge base; the preset knowledge base is obtained through the following methods: Preset text information is input into a preset large language model, which then outputs multiple question-answer pairs. The text information is used to represent vaccination knowledge. Each question-answer pair includes a question, a question vector corresponding to the question, an answer corresponding to the question, and an answer vector corresponding to the answer. Obtain the user status for each question-and-answer pair; Question-and-answer pairs targeting health statuses will be stored in a health knowledge base, while question-and-answer pairs targeting specific health statuses will be stored in a specific health knowledge base.

5. The vaccination question-and-answer method according to any one of claims 1 to 4, characterized in that, Inputting the first prompt word into a preset large language model generates the answer corresponding to the query information, including: The style of the answer is determined based on the user role; The answer corresponding to the query information is generated based on the style.

6. A vaccination question-and-answer device, characterized in that, include: The user status acquisition module is configured to acquire the user status upon receiving a user's query information; The user status is either healthy or in a special health state, where the special health state indicates that the user suffers from a preset disease; the inquiry information indicates consultation information regarding vaccination. The feature information variable acquisition module is configured to acquire feature information variables corresponding to the user state based on the user state. The feature information variable is the user's answer to a preset question; The retrieval module is configured to perform a retrieval using a preset knowledge base based on the query information and the feature information variables to obtain the target question-answer pair. The target confidence acquisition module is configured to acquire the target confidence of the target question-answer pair based on the age of the source literature of the target question-answer pair, the authority score of the source literature, and the taboo conflict status of the target question-answer pair. The prompt word construction module is configured to combine system roles, user roles, target question-answer pairs sorted according to the target confidence level, and the query information to form the first prompt word; The generation module is configured to input the first prompt word into a preset large language model and generate an answer corresponding to the query information. The retrieval module is configured to retrieve target question-answer pairs by using a preset knowledge base based on the query information and the feature information variables in the following manner: inputting the query information and the feature information variables into a preset large language model, causing the large language model to output multiple key sentences; encoding the query information and the key sentences respectively to obtain query vectors; obtaining the cosine similarity between each query vector and each question vector in the knowledge base; obtaining a first preset number of first candidate question-answer pairs based on each cosine similarity; matching the feature information variables among the question-answer pairs in the knowledge base to obtain a second preset number of second candidate question-answer pairs; and obtaining the target question-answer pair based on the first candidate question-answer pairs and the second candidate question-answer pairs.

7. A vaccination question-and-answer device, comprising a processor and a memory storing program instructions, characterized in that, The processor is configured to execute the vaccination question-and-answer method as described in any one of claims 1 to 5 when running the program instructions.

8. An electronic device, characterized in that, include: The electronic device itself; The vaccination question-and-answer device as described in claim 6 or 7 is installed on the electronic device body.

9. A storage medium storing program instructions, characterized in that, The program instructions are executed by the processor to implement the vaccination question-and-answer method as described in any one of claims 1 to 5.

Citation Information

Patent Citations

  • Dietary nutrition survey method and device based on large model and storage medium

    CN119920388A

  • Terminal-based question and answer method and apparatus

    WO2024036616A1