A helicobacter pylori question and answer method and device based on retrieval enhancement generation, a terminal device and a storage medium

By constructing a Helicobacter pylori knowledge vector database and combining it with a large language model, the problem of insufficient professionalism of general models in the diagnosis and treatment of Helicobacter pylori was solved, and accurate Helicobacter pylori question-and-answer results were achieved.

CN122196116APending Publication Date: 2026-06-12GUANGDONG HOSPITAL OF TRADITIONAL CHINESE MEDICINE

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
GUANGDONG HOSPITAL OF TRADITIONAL CHINESE MEDICINE
Filing Date
2026-02-11
Publication Date
2026-06-12

AI Technical Summary

Technical Problem

The generalized large language model cannot meet the needs of personalized diagnosis and treatment in the field of Helicobacter pylori, and the output content deviates greatly from the user's consultation intent, failing to meet professional requirements.

Method used

A Helicobacter pylori knowledge vector database was constructed. The knowledge text was semantically processed by a retrieval-enhanced generation platform to generate high-dimensional vector representations. The database was then combined with a large language model for accurate question answering.

Benefits of technology

It improves the professionalism and accuracy of Helicobacter pylori diagnosis and treatment Q&A, avoids the generation of irrelevant or erroneous medical information, and meets the needs of personalized diagnosis and treatment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122196116A_ABST
    Figure CN122196116A_ABST
Patent Text Reader

Abstract

The application discloses a Helicobacter pylori question and answer method and device based on retrieval enhancement generation, a terminal equipment and a storage medium, and belongs to the field of artificial intelligence. The method is: acquiring Helicobacter pylori knowledge texts; performing semantic processing on the Helicobacter pylori knowledge texts through a retrieval enhancement generation platform to obtain a plurality of knowledge segments; encoding each knowledge segment to obtain a high-dimensional vector representation corresponding to each knowledge segment; storing each knowledge segment and the high-dimensional vector representation corresponding to each knowledge segment in a preset vector database to construct a Helicobacter pylori knowledge vector database; and determining a Helicobacter pylori knowledge question and answer result matched with a query statement related to Helicobacter pylori input by a user, the Helicobacter pylori knowledge vector database and a preset large language model. Through implementation of the application, the problem that a general large language model in the prior art cannot meet the diagnosis and treatment requirements of Helicobacter pylori can be solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of artificial intelligence, and in particular to a method, apparatus, terminal device, and storage medium for Helicobacter pylori question-and-answer based on retrieval enhancement generation. Background Technology

[0002] Helicobacter pylori (Hp) is a widely prevalent pathogenic bacterium in the digestive tract. Its infection is closely related to the occurrence and development of diseases such as chronic gastritis, peptic ulcers, and even gastric cancer. It is a core issue that needs to be focused on in the clinical diagnosis and treatment of gastroenterology.

[0003] In recent years, large language models have made groundbreaking progress in the field of natural language processing. Their powerful semantic understanding and generation capabilities have demonstrated high efficiency in general information question answering scenarios, and many doctors use them to quickly answer common clinical questions, aiming to improve the efficiency of diagnostic and treatment decisions. However, in the highly specialized medical subfield of Helicobacter pylori diagnosis and treatment, the application effect of general large language models is less than satisfactory. The core problem lies in the significant discrepancy between their output and the personalized consultation intent raised by users based on specific diagnostic and treatment scenarios, failing to meet the professional requirements of individualized Helicobacter pylori diagnosis and treatment. Summary of the Invention

[0004] This invention provides a method, apparatus, terminal device, and storage medium for Helicobacter pylori question answering based on retrieval enhancement. The method can solve the problem that existing general-purpose large language models cannot meet the needs of Helicobacter pylori diagnosis and treatment.

[0005] To address the aforementioned technical problems, one embodiment of the present invention provides a Helicobacter pylori question-and-answer method based on search enhancement, comprising: Obtain Helicobacter pylori knowledge text; The Helicobacter pylori knowledge text is semantically processed through a pre-set retrieval enhancement generation platform to obtain several knowledge fragments; Each knowledge segment is encoded to obtain a high-dimensional vector representation of each knowledge segment; Each knowledge fragment and its corresponding high-dimensional vector representation are stored in a pre-defined vector database to construct a Helicobacter pylori knowledge vector database. Based on the user's query related to Helicobacter pylori, the Helicobacter pylori knowledge vector database, and the preset large language model, determine the Helicobacter pylori knowledge Q&A results that match the query.

[0006] Furthermore, the Helicobacter pylori knowledge text includes Helicobacter pylori Q&A text and Helicobacter pylori professional knowledge text; The aforementioned knowledge text on Helicobacter pylori is semantically processed through a pre-defined retrieval enhancement generation platform to obtain several knowledge fragments, including: Using the aforementioned retrieval enhancement generation platform, semantic boundary segmentation is performed on the Helicobacter pylori knowledge question and answer text to generate several knowledge fragments in the form of question and answer pairs; Using the aforementioned retrieval enhancement generation platform, semantic boundary segmentation is performed on the Helicobacter pylori professional knowledge text to generate several context-related knowledge fragments.

[0007] Further, determining the Helicobacter pylori knowledge question-and-answer results matching the query statement based on the user-inputted query related to Helicobacter pylori, the Helicobacter pylori knowledge vector database, and the preset large language model includes: After obtaining the query statement related to Helicobacter pylori input by the user, the query statement is converted into a corresponding query vector; Based on the query vector and the high-dimensional vector representations corresponding to each knowledge fragment in the Helicobacter pylori knowledge vector database, semantic similarity is calculated to obtain the calculation results; Based on the calculation results, several target knowledge fragments are selected from the Helicobacter pylori knowledge vector database. The target knowledge fragment and the query statement are input into a preset large language model to obtain the Helicobacter pylori knowledge question and answer results output by the large language model that match the query statement.

[0008] Further, the step of performing semantic similarity calculation based on the query vector and the high-dimensional vector representations corresponding to each knowledge fragment in the Helicobacter pylori knowledge vector database to obtain the calculation result includes: For each knowledge fragment in the Helicobacter pylori knowledge vector database, calculate the cosine similarity between the high-dimensional vector representation corresponding to the current knowledge fragment and the query vector; The calculation results are generated based on all the calculated cosine similarities.

[0009] Furthermore, based on the calculation results, several target knowledge fragments are selected from the Helicobacter pylori knowledge vector database, including: Sort all the cosine similarities in the calculation results in descending order to obtain the sorting results; The top M knowledge fragments from the sorting results are selected as the target knowledge fragments.

[0010] An embodiment of the present invention also provides a Helicobacter pylori question-and-answer device based on search enhancement, comprising: The data acquisition module is used to acquire Helicobacter pylori knowledge text; The data processing module is used to perform semantic processing on the Helicobacter pylori knowledge text through a preset retrieval enhancement generation platform to obtain several knowledge fragments; The encoding module is used to encode each knowledge fragment to obtain a high-dimensional vector representation of each knowledge fragment; The database construction module is used to store each knowledge fragment and its corresponding high-dimensional vector representation into a preset vector database to construct a Helicobacter pylori knowledge vector database. The result generation module is used to determine the Helicobacter pylori knowledge question and answer results that match the query statement based on the query statement related to Helicobacter pylori input by the user, the Helicobacter pylori knowledge vector database, and the preset large language model.

[0011] Furthermore, the Helicobacter pylori knowledge text includes Helicobacter pylori Q&A text and Helicobacter pylori professional knowledge text; The data processing module is specifically used for: Using the aforementioned retrieval enhancement generation platform, semantic boundary segmentation is performed on the Helicobacter pylori knowledge question and answer text to generate several knowledge fragments in the form of question and answer pairs; Using the aforementioned retrieval enhancement generation platform, semantic boundary segmentation is performed on the Helicobacter pylori professional knowledge text to generate several context-related knowledge fragments.

[0012] Furthermore, the result generation module is specifically used for: After obtaining the query statement related to Helicobacter pylori input by the user, the query statement is converted into a corresponding query vector; Based on the query vector and the high-dimensional vector representations corresponding to each knowledge fragment in the Helicobacter pylori knowledge vector database, semantic similarity is calculated to obtain the calculation results; Based on the calculation results, several target knowledge fragments are selected from the Helicobacter pylori knowledge vector database. The target knowledge fragment and the query statement are input into a preset large language model to obtain the Helicobacter pylori knowledge question and answer results output by the large language model that match the query statement.

[0013] This application also provides a terminal device, including: One or more processors; A memory, coupled to the processor, for storing one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the Helicobacter pylori question-and-answer method based on retrieval enhancement as described in the above embodiments of the invention.

[0014] This application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the Helicobacter pylori question-and-answer method based on retrieval enhancement as described in the above embodiments of the invention.

[0015] The following benefits can be obtained by implementing the present invention: This invention provides a method, apparatus, terminal device, and storage medium for Helicobacter pylori question-and-answering based on retrieval enhancement generation. The method first acquires Helicobacter pylori knowledge text; then, through a preset retrieval enhancement generation platform, semantic processing is performed on the Helicobacter pylori knowledge text to obtain several knowledge fragments. This transforms the originally fragmented and unstructured Helicobacter pylori knowledge into standardized knowledge modules, preserving the professionalism and logic of the Helicobacter pylori knowledge. After encoding the high-dimensional vector representations corresponding to each knowledge fragment, each knowledge fragment and its corresponding high-dimensional vector representation are stored in a preset vector database, constructing a Helicobacter pylori knowledge vector database. Subsequently, based on this Helicobacter pylori knowledge vector database, combined with user-inputted Helicobacter pylori-related query statements and a preset large language model, when determining the Helicobacter pylori knowledge question-and-answer results matching the query statements, the Helicobacter pylori knowledge vector database can provide accurate Helicobacter pylori professional knowledge support for the large language model, effectively improving the professionalism of the question-and-answer results and avoiding the model generating irrelevant or erroneous medical information. Attached Figure Description

[0016] To more clearly illustrate the technical solution of this application, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0017] Figure 1 This is a flowchart illustrating a Helicobacter pylori question-and-answer method based on search enhancement provided in a certain embodiment of this application; Figure 2 This is a schematic diagram of the structure of a Helicobacter pylori question-and-answer device based on search enhancement provided in a certain embodiment of this application; Figure 3 This is a schematic diagram of the structure of a terminal device provided in a certain embodiment of this application. Detailed Implementation

[0018] To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions of this application will be clearly and completely described below with reference to the accompanying drawings of the embodiments. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0019] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application pertains; the terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the application; the terms “comprising” and “having”, and any variations thereof, in the specification, claims, and foregoing description of the drawings are intended to cover non-exclusive inclusion.

[0020] In the description of the embodiments of this application, technical terms such as "first" and "second" are used only to distinguish different objects and should not be construed as indicating or implying relative importance or implicitly specifying the number, specific order, or primary and secondary relationship of the indicated technical features. In the description of the embodiments of this application, "multiple" means two or more, unless otherwise explicitly defined.

[0021] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.

[0022] In the description of the embodiments in this application, the term "and / or" is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. Additionally, the character " / " in this document generally indicates that the preceding and following related objects have an "or" relationship.

[0023] In the description of the embodiments of this application, the term "multiple" refers to two or more (including two), similarly, "multiple sets" refers to two or more (including two sets), and "multiple pieces" refers to two or more (including two pieces).

[0024] In the description of the embodiments of this application, unless otherwise expressly specified and limited, technical terms such as "installation," "connection," "joining," and "fixing" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral part; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; they can refer to the internal communication of two components or the interaction between two components. For those skilled in the art, the specific meaning of the above terms in the embodiments of this application can be understood according to the specific circumstances.

[0025] See Figure 1 To address the problem that existing general-purpose large language models cannot meet the diagnostic and treatment needs of Helicobacter pylori, an embodiment of the present invention provides a Helicobacter pylori question-answering method based on retrieval enhancement generation, comprising: S1. Obtain Helicobacter pylori knowledge text; To illustrate, in order to ensure that when responding to user queries about Helicobacter pylori, accurate knowledge-based question-and-answer results can be generated with the help of professional medical knowledge about Helicobacter pylori, it is necessary to first build a dedicated Helicobacter pylori knowledge vector database. This database aims to make up for the lack of professional depth in the field of Helicobacter pylori in general large language models. Specifically, before constructing the Helicobacter pylori knowledge vector database, it is necessary to acquire a large amount of Helicobacter pylori knowledge texts related to the diagnosis, treatment, and research of Helicobacter pylori. These Helicobacter pylori knowledge texts come from sources including clinical diagnosis and treatment guidelines for Helicobacter pylori published by authoritative medical institutions at home and abroad, medical research literature in the field of Helicobacter pylori, clinical pathological diagnostic standards, and interpretation standards of detection indicators, serving as professional knowledge texts on Helicobacter pylori. In addition, a large number of desensitized Helicobacter pylori knowledge question and answer texts are also introduced, including several question and answer dialogues between doctors and patients about Helicobacter pylori, to improve the clinical adaptability and practical guidance of the Helicobacter pylori knowledge vector database, so that the subsequently generated question and answer results not only have theoretical professionalism, but also fit the actual clinical application scenarios, effectively meeting the needs of doctors for concrete and scenario-based knowledge in diagnosis and treatment decisions. It should be noted that the patients have given informed consent for all the content in the Helicobacter pylori knowledge Q&A text.

[0026] S2. Using a preset retrieval enhancement generation platform, semantic processing is performed on the Helicobacter pylori knowledge text to obtain several knowledge fragments; This example illustrates how introducing a retrieval augmented generation platform to perform semantic processing on Helicobacter pylori knowledge text can effectively reduce the complexity of subsequent knowledge retrieval and thus improve overall knowledge processing efficiency. It should be noted that retrieval augmented generation (RAG) technology is a mature existing natural language processing fusion technology. The retrieval augmented generation platform, as the engineering carrier of this technology, can automatically complete functions such as semantic segmentation based on a mature algorithm framework.

[0027] In a preferred embodiment, the Helicobacter pylori knowledge text includes Helicobacter pylori Q&A text and Helicobacter pylori professional knowledge text; The aforementioned knowledge text on Helicobacter pylori is semantically processed through a pre-defined retrieval enhancement generation platform to obtain several knowledge fragments, including: Using the aforementioned retrieval enhancement generation platform, semantic boundary segmentation is performed on the Helicobacter pylori knowledge question and answer text to generate several knowledge fragments in the form of question and answer pairs; Using the aforementioned retrieval enhancement generation platform, semantic boundary segmentation is performed on the Helicobacter pylori professional knowledge text to generate several context-related knowledge fragments; Specifically, for Helicobacter pylori knowledge question and answer text, after calling the retrieval enhancement generation platform, the retrieval enhancement generation platform will perform sentence-by-sentence semantic analysis, question-and-answer relationship identification and pairing normalization on the Helicobacter pylori knowledge question and answer text. It adopts the question-and-answer (QA) slicing method to divide the semantic boundaries between questions and corresponding answers, remove redundant information and correct expression deviations, thereby generating knowledge fragments in the form of question-and-answer pairs.

[0028] Specifically, for Helicobacter pylori professional knowledge text, after calling the retrieval enhancement generation platform, the retrieval enhancement generation platform will perform paragraph structure analysis, semantic boundary positioning, and overlapping area setting on the Helicobacter pylori professional knowledge text. It adopts a general slicing method, based on clinical diagnosis and treatment logic and professional terminology association, to segment the paragraph structure and set reasonable overlapping areas in adjacent text block nodes, thereby generating knowledge fragments with coherent contextual logic and complete semantics, effectively avoiding the breakage of key information.

[0029] It should be noted that the search enhancement generation platform can be a professional search enhancement generation tool platform such as RAGFlow.

[0030] S3. Encode each knowledge segment to obtain a high-dimensional vector representation of each knowledge segment; Indicatively, after dividing the knowledge into segments in step S2, in order to achieve subsequent semantic retrieval and knowledge matching, it is necessary to uniformly encode each knowledge segment and convert it into a high-dimensional vector form that can be directly processed by a computer. Specifically, each knowledge fragment is encoded one by one using a preset embedding model. During the encoding process, the embedding model simultaneously captures the correlation features between the knowledge entity, the entity type label, and the semantic information of the text fragment, mapping the overall information of the knowledge fragment into a high-dimensional vector of fixed dimensions. In this embodiment, the encoded high-dimensional vector is represented as 1024-dimensional. It should be noted that the embedding model is a mature natural language processing model in the prior art. The embedding model used in this embodiment is based on the Transformer architecture.

[0031] S4. Store each knowledge fragment and its corresponding high-dimensional vector representation in a preset vector database to construct a Helicobacter pylori knowledge vector database. Specifically, after generating the high-dimensional vector representations corresponding to each knowledge fragment according to step S3, it is necessary to bind the knowledge fragments with the corresponding high-dimensional vector representations, and at the same time establish a unique identifier index for each binding combination; then, all the bound data are imported into the preset vector database in batches, and finally a structured Helicobacter pylori knowledge vector database is formed.

[0032] S5. Based on the query statement related to Helicobacter pylori input by the user, the Helicobacter pylori knowledge vector database, and the preset large language model, determine the Helicobacter pylori knowledge question and answer results that match the query statement; In a preferred embodiment, determining the Helicobacter pylori knowledge question-and-answer results matching the query statement based on the user-inputted query related to Helicobacter pylori, the Helicobacter pylori knowledge vector database, and a preset large language model includes: After obtaining the query statement related to Helicobacter pylori input by the user, the query statement is converted into a corresponding query vector; Based on the query vector and the high-dimensional vector representations corresponding to each knowledge fragment in the Helicobacter pylori knowledge vector database, semantic similarity is calculated to obtain the calculation results; Based on the calculation results, several target knowledge fragments are selected from the Helicobacter pylori knowledge vector database. The target knowledge fragment and the query statement are input into a preset large language model to obtain the Helicobacter pylori knowledge question and answer results output by the large language model that match the query statement; As an illustration, after obtaining the query statement related to Helicobacter pylori input by the user, the query statement must first be converted into the corresponding query vector; Specifically, the query statement is converted into a corresponding query vector through the embedding model. The dimension of the query vector is unified with the high-dimensional vector representation of the knowledge fragment to 1024 dimensions to ensure the consistency of the vector space and the accuracy of similarity calculation.

[0033] In a preferred embodiment, the step of performing semantic similarity calculation based on the query vector and the high-dimensional vector representations corresponding to each knowledge fragment in the Helicobacter pylori knowledge vector database to obtain the calculation result includes: For each knowledge fragment in the Helicobacter pylori knowledge vector database, calculate the cosine similarity between the high-dimensional vector representation corresponding to the current knowledge fragment and the query vector; Generate the calculation results based on all the calculated cosine similarities; Specifically, based on the query vector and the high-dimensional vector representations corresponding to each knowledge segment in the Helicobacter pylori knowledge vector database, a cosine similarity algorithm is used to calculate semantic similarity. The cosine similarity between the high-dimensional vector representations corresponding to each knowledge segment and the query vector is calculated. The score range of the cosine similarity is [-1, 1]. The closer the cosine similarity is to 1, the higher the semantic relevance of the current knowledge segment to the user's query statement, and vice versa. Finally, the calculation result is generated based on all the calculated cosine similarities.

[0034] In a preferred embodiment, the step of using the calculation results as the filtering basis to select several target knowledge fragments from the Helicobacter pylori knowledge vector database includes: Sort all the cosine similarities in the calculation results in descending order to obtain the sorting results; Select the top M knowledge fragments from the sorting results as target knowledge fragments; Specifically, all cosine similarities in the calculation results are sorted in descending order to obtain the sorting results; and the top M knowledge fragments in the sorting results are selected as target knowledge fragments (e.g., if M=5, then the top 5 knowledge fragments in the sorting results are selected). The target knowledge fragment and the query statement are then input into the large language model. The large language model first performs in-depth understanding and context integration of the input information, and then, with the help of the text fragments in the target knowledge fragment, finally generates a Helicobacter pylori knowledge question and answer result that matches the query statement. To better illustrate this, let's assume the current user's query is "What are the main virulence factors and pathogenic mechanisms of Helicobacter pylori type I strains?"; The selected target knowledge fragments include the text fragment "Helicobacter pylori type I strains are highly virulent strains, and their core virulence factors include cytotoxin-associated protein (CagA) and vacuolating toxin (VacA). CagA is injected into the host's gastric epithelial cells through the type IV secretion system, interfering with cell signaling pathways and causing abnormal cell proliferation and inflammatory response. VacA can form cell membrane pores, inducing cell vacuolization and apoptosis. The two work together to destroy the gastric mucosal barrier, inducing chronic gastritis, peptic ulcers, and even precancerous lesions of the stomach." Upon receiving a user query and the aforementioned target knowledge fragment, the large language model first analyzes the query intent, identifying "virulence factors" and "pathogenic mechanisms." It then identifies keywords such as "Helicobacter pylori type I," "CagA," "VacA," and "gastric mucosal barrier" within the target knowledge fragment, and outlines the pathways of action (including CagA injection and interference, and VacA pore formation). During this process, the large language model, based on the content provided by the target knowledge fragment and combining its own language organization and logical reasoning abilities, integrates the scattered professional expressions into the final Helicobacter pylori knowledge question-and-answer result: "Helicobacter pylori..." The main virulence factors of Helicobacter pylori type I strains are cytotoxin-associated protein (CagA) and vacuolating toxin (VacA). Their pathogenic mechanism is as follows: CagA protein enters the host's gastric epithelial cells through the bacteria's type IV secretion system, interfering with normal intracellular signal transduction, leading to abnormal cell proliferation and triggering an inflammatory response; VacA toxin, by forming pores on the cell membrane, induces vacuolizing degeneration and promotes apoptosis. The synergistic effect of CagA and VacA disrupts the integrity of the gastric mucosal barrier, thereby causing diseases such as chronic gastritis and peptic ulcers. Long-term infection may further develop into precancerous lesions of the stomach.

[0035] See Figure 2 This is an embodiment of the present invention providing a Helicobacter pylori question-and-answer device based on search enhancement generation, comprising: The data acquisition module is used to acquire Helicobacter pylori knowledge text; The data processing module is used to perform semantic processing on the Helicobacter pylori knowledge text through a preset retrieval enhancement generation platform to obtain several knowledge fragments; The encoding module is used to encode each knowledge fragment to obtain a high-dimensional vector representation of each knowledge fragment; The database construction module is used to store each knowledge fragment and its corresponding high-dimensional vector representation into a preset vector database to construct a Helicobacter pylori knowledge vector database. The result generation module is used to determine the Helicobacter pylori knowledge question and answer results that match the query statement based on the query statement related to Helicobacter pylori input by the user, the Helicobacter pylori knowledge vector database, and the preset large language model.

[0036] In a preferred embodiment, the Helicobacter pylori knowledge text includes Helicobacter pylori Q&A text and Helicobacter pylori professional knowledge text; The data processing module is specifically used for: Using the aforementioned retrieval enhancement generation platform, semantic boundary segmentation is performed on the Helicobacter pylori knowledge question and answer text to generate several knowledge fragments in the form of question and answer pairs; Using the aforementioned retrieval enhancement generation platform, semantic boundary segmentation is performed on the Helicobacter pylori professional knowledge text to generate several context-related knowledge fragments.

[0037] In a preferred embodiment, the result generation module is specifically used for: After obtaining the query statement related to Helicobacter pylori input by the user, the query statement is converted into a corresponding query vector; Based on the query vector and the high-dimensional vector representations corresponding to each knowledge fragment in the Helicobacter pylori knowledge vector database, semantic similarity is calculated to obtain the calculation results; Based on the calculation results, several target knowledge fragments are selected from the Helicobacter pylori knowledge vector database. The target knowledge fragment and the query statement are input into a preset large language model to obtain the Helicobacter pylori knowledge question and answer results output by the large language model that match the query statement.

[0038] See Figure 3 One embodiment of this application also provides a terminal device, including: One or more processors; A memory, coupled to the processor, for storing one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the Helicobacter pylori question-and-answer method based on retrieval enhancement as described above.

[0039] The processor controls the overall operation of the terminal device to complete all or part of the steps of the Helicobacter pylori question-and-answer method based on retrieval enhancement described above. The memory stores various types of data to support the operation of the terminal device. This data may include, for example, instructions for any application or method operating on the terminal device, as well as application-related data. The memory can be implemented using any type of volatile or non-volatile storage device or a combination thereof, such as Static Random Access Memory (SRAM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Erasable Programmable Read-Only Memory (EPROM), Programmable Read-Only Memory (PROM), Read-Only Memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk.

[0040] In an exemplary embodiment, the terminal device may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to execute the Helicobacter pylori question-and-answer method based on retrieval enhancement as described in any of the foregoing embodiments, and to achieve the same technical effect as the methods described above.

[0041] In another exemplary embodiment, a computer-readable storage medium including a computer program is also provided. When executed by a processor, the computer program implements the steps of the Helicobacter pylori question-and-answer method based on retrieval enhancement as described in any of the foregoing embodiments. For example, the computer-readable storage medium may be the aforementioned memory including the computer program, which may be executed by a processor of a terminal device to complete the Helicobacter pylori question-and-answer method based on retrieval enhancement as described in any of the foregoing embodiments, and achieve the same technical effects as the aforementioned method.

[0042] The above description represents the preferred embodiments of the present invention. It should be noted that those skilled in the art can make various improvements and modifications without departing from the principles of the present invention, and these improvements and modifications are also considered to be within the scope of protection of the present invention.

Claims

1. A Helicobacter pylori question-and-answer method based on retrieval enhancement, characterized in that, include: Obtain Helicobacter pylori knowledge text; The Helicobacter pylori knowledge text is semantically processed through a pre-set retrieval enhancement generation platform to obtain several knowledge fragments; Each knowledge segment is encoded to obtain a high-dimensional vector representation of each knowledge segment; Each knowledge fragment and its corresponding high-dimensional vector representation are stored in a pre-defined vector database to construct a Helicobacter pylori knowledge vector database. Based on the user's query related to Helicobacter pylori, the Helicobacter pylori knowledge vector database, and the preset large language model, determine the Helicobacter pylori knowledge Q&A results that match the query.

2. The Helicobacter pylori question-and-answer method based on retrieval enhancement as described in claim 1, characterized in that, The Helicobacter pylori knowledge text includes Helicobacter pylori Q&A text and Helicobacter pylori professional knowledge text; The aforementioned knowledge text on Helicobacter pylori is semantically processed through a pre-defined retrieval enhancement generation platform to obtain several knowledge fragments, including: Using the aforementioned retrieval enhancement generation platform, semantic boundary segmentation is performed on the Helicobacter pylori knowledge question and answer text to generate several knowledge fragments in the form of question and answer pairs; Using the aforementioned retrieval enhancement generation platform, semantic boundary segmentation is performed on the Helicobacter pylori professional knowledge text to generate several context-related knowledge fragments.

3. The Helicobacter pylori question-and-answer method based on retrieval enhancement as described in claim 1, characterized in that, The step of determining the Helicobacter pylori knowledge question-and-answer results matching the query statement based on the user-input query related to Helicobacter pylori, the Helicobacter pylori knowledge vector database, and the preset large language model includes: After obtaining the query statement related to Helicobacter pylori input by the user, the query statement is converted into a corresponding query vector; Based on the query vector and the high-dimensional vector representations corresponding to each knowledge fragment in the Helicobacter pylori knowledge vector database, semantic similarity is calculated to obtain the calculation results; Based on the calculation results, several target knowledge fragments are selected from the Helicobacter pylori knowledge vector database. The target knowledge fragment and the query statement are input into a preset large language model to obtain the Helicobacter pylori knowledge question and answer results output by the large language model that match the query statement.

4. The Helicobacter pylori question-and-answer method based on retrieval enhancement as described in claim 3, characterized in that, The step involves performing semantic similarity calculations based on the query vector and the high-dimensional vector representations corresponding to each knowledge fragment in the Helicobacter pylori knowledge vector database to obtain the calculation results, including: For each knowledge fragment in the Helicobacter pylori knowledge vector database, calculate the cosine similarity between the high-dimensional vector representation corresponding to the current knowledge fragment and the query vector; The calculation results are generated based on all the calculated cosine similarities.

5. The Helicobacter pylori question-and-answer method based on retrieval enhancement as described in claim 4, characterized in that, The calculation results are used as the selection criterion to select several target knowledge fragments from the Helicobacter pylori knowledge vector database, including: Sort all the cosine similarities in the calculation results in descending order to obtain the sorting results; The top M knowledge fragments from the sorting results are selected as the target knowledge fragments.

6. A Helicobacter pylori question-and-answer device based on search enhancement, characterized in that, include: The data acquisition module is used to acquire Helicobacter pylori knowledge text; The data processing module is used to perform semantic processing on the Helicobacter pylori knowledge text through a preset retrieval enhancement generation platform to obtain several knowledge fragments; The encoding module is used to encode each knowledge fragment to obtain a high-dimensional vector representation of each knowledge fragment; The database construction module is used to store each knowledge fragment and its corresponding high-dimensional vector representation into a preset vector database to construct a Helicobacter pylori knowledge vector database. The result generation module is used to determine the Helicobacter pylori knowledge question and answer results that match the query statement based on the query statement related to Helicobacter pylori input by the user, the Helicobacter pylori knowledge vector database, and the preset large language model.

7. The Helicobacter pylori question-and-answer device based on search enhancement as described in claim 6, characterized in that, The Helicobacter pylori knowledge text includes Helicobacter pylori Q&A text and Helicobacter pylori professional knowledge text; The data processing module is specifically used for: Using the aforementioned retrieval enhancement generation platform, semantic boundary segmentation is performed on the Helicobacter pylori knowledge question and answer text to generate several knowledge fragments in the form of question and answer pairs; Using the aforementioned retrieval enhancement generation platform, semantic boundary segmentation is performed on the Helicobacter pylori professional knowledge text to generate several context-related knowledge fragments.

8. The Helicobacter pylori question-and-answer device based on search enhancement as described in claim 6, characterized in that, The result generation module is specifically used for: After obtaining the query statement related to Helicobacter pylori input by the user, the query statement is converted into a corresponding query vector; Based on the query vector and the high-dimensional vector representations corresponding to each knowledge fragment in the Helicobacter pylori knowledge vector database, semantic similarity is calculated to obtain the calculation results; Based on the calculation results, several target knowledge fragments are selected from the Helicobacter pylori knowledge vector database. The target knowledge fragment and the query statement are input into a preset large language model to obtain the Helicobacter pylori knowledge question and answer results output by the large language model that match the query statement.

9. A terminal device, characterized in that, include: One or more processors; A memory, coupled to the processor, for storing one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the Helicobacter pylori question-and-answer method based on retrieval enhancement as described in any one of claims 1-5.

10. A storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the Helicobacter pylori question-and-answer method based on retrieval enhancement as described in any one of claims 1-5.