A large model-based question and answer interaction method and device, equipment and storage medium
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-31
- Publication Date
- 2026-08-11
AI Technical Summary
[0002]康复医疗领域中,咨询用户对于康复知识的个性化咨询需求日益增长,传统康复咨询模式不仅受限于地点,而且更依赖于康复师个体经验,在目前康复医学指南更新频繁的情况下,康复师难以实时同步最新进展,这就使得本就受限于康复师个体知识储备的康复诊断结论存在精准性问题
[0021] This application identifies the intent of the user's input request message, determines candidate knowledge fragments in the vector database based on the intent identification results, and updates the rehabilitation prompt word template according to the target request message, candidate knowledge fragments, and question-and-answer constraints to generate rehabilitation prompt word text. This enables the large language model to better identify the user's personalized needs, generate customized response content for the user, improve the accuracy of question-and-answer interaction, and enhance the user's experience in the intelligent question-and-answer interaction process.
Smart Images

Figure CN121301547B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of artificial intelligence medical consultation technology, and in particular to a question-and-answer interaction method, apparatus, device and storage medium based on a large model. Background Technology
[0002] In the field of rehabilitation medicine, the demand for personalized rehabilitation knowledge consultation among users is increasing. Traditional rehabilitation consultation models are not only limited by location, but also rely more on the individual experience of rehabilitation therapists. With the current frequent updates to rehabilitation medicine guidelines, it is difficult for rehabilitation therapists to keep up with the latest developments in real time. This makes the accuracy of rehabilitation diagnosis conclusions, which are already limited by the individual knowledge reserves of rehabilitation therapists, problematic.
[0003] With the development of artificial intelligence, health consultation robots have emerged. However, as we all know, most robots adopt a general question-and-answer model. For users seeking consultation, there are individual differences among them, and consultation robots cannot provide personalized responses to users. Summary of the Invention
[0004] This application provides a large-model-based question-and-answer interaction method, apparatus, device, and storage medium to improve the accuracy of the response content generated by the large model during the large-model question-and-answer interaction process, while also improving the adaptability between the response content and the consulting user.
[0005] According to one aspect of this application, a question-answering interaction method based on a large model is provided, the method comprising:
[0006] Obtain the initial request message from the target user, and convert the initial request message into a standard request format to generate the target request message;
[0007] Based on a pre-trained intent recognition model, intent recognition is performed on the target request message to determine the target entity and target intent in the target request message;
[0008] Based on the target entity and the target intent, a cascaded hybrid retrieval strategy is adopted to determine at least one candidate knowledge fragment in the vector database; wherein, the vector database stores structured rehabilitation knowledge data;
[0009] Based on the rehabilitation prompt word template, rehabilitation prompt word text is generated according to the target request message, candidate knowledge fragments, and question-and-answer constraints. Then, a pre-trained large language model is used to generate the target response content of the target request message based on the rehabilitation prompt word text.
[0010] According to another aspect of this application, a question-answering interaction device based on a large model is provided, the device comprising:
[0011] The request acquisition module is used to acquire the initial request message of the target user, and convert the initial request message into a standard request format to generate the target request message;
[0012] The intent recognition module is used to perform intent recognition on the target request message based on a pre-trained intent recognition model, and to determine the target entity and target intent in the target request message.
[0013] The knowledge retrieval module is used to determine at least one candidate knowledge fragment in a vector database based on the target entity and the target intent, using a cascaded hybrid retrieval strategy; wherein the vector database stores structured rehabilitation knowledge data.
[0014] The response generation module is used to generate rehabilitation prompt text based on the rehabilitation prompt text template, the target request message, candidate knowledge fragments, and question-and-answer constraints, and to generate the target response content of the target request message based on the rehabilitation prompt text using a pre-trained large language model.
[0015] According to another aspect of this application, an electronic device is provided, the electronic device comprising:
[0016] One or more processors;
[0017] Memory, used to store one or more programs;
[0018] When the one or more programs are executed by the one or more processors, the one or more processors implement any of the large-model-based question-and-answer interaction methods provided in the embodiments of this application.
[0019] According to another aspect of this application, a computer-readable storage medium is provided, on which a computer program is stored, which, when executed by a processor, implements any of the large-model-based question-and-answer interaction methods provided in the embodiments of this application.
[0020] According to another aspect of this application, a computer program product is provided, including a computer program that, when executed by a processor, implements any of the large-model-based question-and-answer interaction methods provided in the embodiments of this application.
[0021] This application identifies the intent of the user's input request message, determines candidate knowledge fragments in the vector database based on the intent identification results, and updates the rehabilitation prompt word template according to the target request message, candidate knowledge fragments, and question-and-answer constraints to generate rehabilitation prompt word text. This enables the large language model to better identify the user's personalized needs, generate customized response content for the user, improve the accuracy of question-and-answer interaction, and enhance the user's experience in the intelligent question-and-answer interaction process. Attached Figure Description
[0022] Figure 1 This is a flowchart of a question-answering interaction method based on a large model, according to Embodiment 1 of this application;
[0023] Figure 2 This is a flowchart of a question-answering interaction method based on a large model, according to Embodiment 2 of this application;
[0024] Figure 3 This is a schematic diagram of the structure of a question-and-answer interaction device based on a large model, according to Embodiment 3 of this application;
[0025] Figure 4 This is a schematic diagram of the structure of an electronic device that implements the question-and-answer interaction method based on a large model according to Embodiment 4 of this application. Detailed Implementation
[0026] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present application, and not all of them. The information collected in the embodiments of the present application is information and data authorized by the user or fully authorized by all parties, and the collection, storage, use, processing, transmission, provision, disclosure, and application of related data all comply with the relevant laws, regulations, and standards of relevant countries and regions, and necessary confidentiality measures have been taken, without violating public order and good morals. Corresponding operation entry points are provided for users to choose to authorize or refuse. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of this application.
[0027] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application 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 so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0028] Example 1
[0029] Figure 1This is a flowchart of a large-model-based question-and-answer interaction method according to Embodiment 1 of this application. This embodiment is applicable to situations where question-and-answer interaction is based on a large model and can be executed by a large-model-based question-and-answer interaction device. This large-model-based question-and-answer interaction device can be implemented in hardware and / or software and can be configured in a computer device, such as a question-and-answer interaction terminal device integrating a large model. Figure 1 As shown, the method includes:
[0030] S110. Obtain the initial request message from the target user, convert the initial request message into a standard request format, and generate the target request message.
[0031] The target user can refer to the sender of the initial request message, i.e., the user making the inquiry; the initial request message can be multimodal information, such as text, voice and image information.
[0032] Specifically, the target user can send an initial request message to the question-and-answer interactive terminal device through the information interaction interface. After receiving the initial request message, the question-and-answer interactive terminal device can perform a standardized format conversion on the initial request message, transforming it into a target request message in a preset text format. Optionally, the preset text format can be adapted to the needs of those skilled in the art.
[0033] S120. Based on the pre-trained intent recognition model, perform intent recognition on the target request message to determine the target entity and target intent in the target request message.
[0034] The target entity may include the name of the disease, rehabilitation actions, and body parts, while the target intent may refer to the purpose for which the user makes the inquiry request.
[0035] For example, when the target request message is "How to perform hand rehabilitation training after stroke", the target entities determined by the intent recognition model can be "stroke" and "hand rehabilitation training", and the target intent can be "to obtain a targeted training and rehabilitation program". Optionally, the intent recognition model can be adaptively configured according to those skilled in the art, for example, it can be a BERT (Bidirectional Encoder Representations from Transformers) model.
[0036] S130. Based on the target entity and target intent, a cascaded hybrid retrieval strategy is adopted to determine at least one candidate knowledge fragment in the vector database.
[0037] The vector database can store structured rehabilitation knowledge data, such as rehabilitation medicine guidelines, clinical pathways, case databases, and rehabilitation movement atlases.
[0038] Optionally, based on the target entity and target intent, a cascaded hybrid retrieval strategy is adopted to determine at least one candidate knowledge fragment in the vector database, including: performing a first-level retrieval in the vector database using the target entity to obtain a first retrieval result; wherein, the first-level retrieval may refer to keyword retrieval; performing a second-level retrieval in the first retrieval result using the target intent to obtain a target retrieval result; wherein, the second-level retrieval may refer to semantic retrieval, and the target retrieval result may be at least one candidate knowledge fragment that matches the target entity and target intent.
[0039] For example, by matching keywords in a vector database based on the target entity, the relevant rehabilitation knowledge required by the user can be quickly identified as the first search result, and irrelevant content can be excluded. Then, semantic matching can be performed on the first search result according to the target intent, prioritizing rehabilitation knowledge that matches the user's intent rather than general rehabilitation knowledge.
[0040] Optionally, after obtaining the target retrieval results, the method further includes: assigning knowledge level labels to candidate knowledge fragments based on their storage location information in a vector database; wherein the knowledge level labels can be used to characterize the credibility of candidate knowledge fragments; and filtering the target retrieval results based on the knowledge level labels, filtering out candidate knowledge fragments with a level lower than a preset label. The preset level labels can be adaptively set according to those skilled in the art.
[0041] It should be noted that, in this embodiment of the invention, the rehabilitation knowledge data stored in the vector database may have different knowledge level tags depending on its corresponding storage location. Optionally, different storage locations of rehabilitation knowledge data in the vector database can indicate different sources of the rehabilitation knowledge data. For example, the knowledge level tag of the rehabilitation knowledge data at a given source can be determined based on the number of visits or expert certifications.
[0042] By filtering out candidate knowledge fragments with low knowledge levels, the accuracy and credibility of the responses generated during intelligent question-and-answer interactions are improved.
[0043] S140. Based on the rehabilitation prompt word template, generate rehabilitation prompt word text according to the target request message, candidate knowledge fragments and question-and-answer constraints, and use a pre-trained large language model to generate the target response content of the target request message according to the rehabilitation prompt word text.
[0044] The rehabilitation prompt word template refers to the content format of the message input into the large language model. The rehabilitation prompt word template can include information in three dimensions: the target request message, candidate knowledge fragments, and question-and-answer constraints. It should be noted that the question-and-answer constraints can be used to adapt the candidate knowledge fragments to the target user.
[0045] Optionally, the target response content can be multimodal information, and users can specify the output format of the target response content, such as text, voice, and image formats.
[0046] This application embodiment performs intent recognition on the user's input request message, determines candidate knowledge fragments in the vector database based on the intent recognition results, and updates the rehabilitation prompt word template according to the target request message, candidate knowledge fragments, and question-and-answer constraints to generate rehabilitation prompt word text. This enables the large language model to better identify the user's personalized needs, generate customized response content for the user, improve the accuracy of question-and-answer interaction, and enhance the user's experience in the intelligent question-and-answer interaction process.
[0047] Example 2
[0048] Figure 2 This is a flowchart of a large-model-based question-and-answer interaction method according to Embodiment 2 of this application. Based on the technical solutions of the above embodiments, this embodiment refines the process of "generating rehabilitation prompt text based on a rehabilitation prompt template, target request message, candidate knowledge fragments, and question-and-answer constraints" into "obtaining a user health profile of the target user and generating question-and-answer constraints based on the user health profile; using the question-and-answer constraints to filter and update the candidate knowledge fragments to generate a target knowledge fragment; updating the rehabilitation prompt template based on the target knowledge fragment to generate the rehabilitation prompt text." It should be noted that for parts not detailed in this embodiment, please refer to the relevant descriptions in other embodiments. Figure 2 As shown, the method includes:
[0049] S210. Obtain the user health profile of the target user and generate question-and-answer constraints based on the user health profile.
[0050] The question-and-answer constraints can be used to adapt candidate knowledge fragments to target users. Optionally, the question-and-answer constraints may include rehabilitation period constraints, age group constraints, and rehabilitation strategy constraints.
[0051] User health profiles can represent the physical condition and medical records of consulting users, providing contextual constraints for the generation of target response content; optionally, the target user's health profile can be determined through electronic medical records, wearable device data, and historical dialogue information.
[0052] S220. Using question-and-answer constraints, candidate knowledge fragments are screened and updated to generate target knowledge fragments.
[0053] Among them, the target knowledge fragment can be the information obtained by fusing the target user's user information with the candidate knowledge fragments.
[0054] Optionally, question-and-answer constraints are used to filter and update candidate knowledge fragments to generate target knowledge fragments, including: filtering the candidate knowledge fragments according to the rehabilitation strategy constraints to generate alternative knowledge fragments; the alternative knowledge fragments are candidate knowledge fragments that conform to the rehabilitation strategy constraints; updating the alternative knowledge fragments using the rehabilitation period constraints and age group constraints, and using the updated alternative knowledge fragments as target knowledge fragments; wherein, the purpose of updating the knowledge fragments is to adapt the alternative knowledge fragments to the rehabilitation period and age group of the target user.
[0055] For example, different rehabilitation stages correspond to different rehabilitation programs. For instance, "passive training is recommended only for patients in the acute phase; active muscle strengthening training is prohibited." Rehabilitation period constraints can filter out candidate knowledge segments that conflict with the user's current rehabilitation stage. Age group constraints can refer to restricting rehabilitation programs based on the user's age. Rehabilitation strategy constraints can be used to filter rehabilitation programs that violate contraindications. For example, "If the user has a history of knee replacement surgery, squats, climbing stairs, and other movements with knee flexion exceeding 90° are prohibited." The number of rehabilitation movements in candidate knowledge segments can be dynamically updated based on age group constraints. For example, if the age group constraint limits the user's age to young users within a preset age range, and the candidate knowledge segment is "Postoperative 1-4 weeks (acute phase) core training consists of 'passive knee range of motion training (0-90°)' and 'straight leg raise training,' 15 minutes each time, twice daily," then "twice daily" can be updated to "three times daily."
[0056] S230. Update the rehabilitation prompt template based on the target request message and target knowledge fragments, and generate rehabilitation prompt text.
[0057] It should be noted that the updated target knowledge fragment has completed the question-and-answer constraint conditions and contains information that meets the question-and-answer constraint conditions.
[0058] Specifically, the rehabilitation prompt template can be updated based on the updated target knowledge fragments and target request messages, using the text format preset in the rehabilitation prompt template, to generate rehabilitation prompt text.
[0059] Optionally, in this embodiment of the invention, the rehabilitation knowledge data in the vector database can be updated periodically to ensure the accuracy and comprehensiveness of the rehabilitation knowledge data; and the retrieval weight and large language model of the cascaded hybrid retrieval strategy can be updated based on the feedback information of the target user on the target reply content, such as whether it is useful or not.
[0060] This application embodiment updates the rehabilitation prompt word template based on candidate knowledge fragments and question-and-answer constraints, adapts it to the user's health profile and dynamic rehabilitation stage, and generates target response content that matches the user, thereby improving the accuracy of question-and-answer interaction and the user's experience in the intelligent question-and-answer interaction process.
[0061] Example 3
[0062] Figure 3 This is a schematic diagram of a large-model-based question-and-answer interaction device according to Embodiment 3 of this application. It is applicable to situations involving question-and-answer interaction based on a large model. This large-model-based question-and-answer interaction device can be implemented in hardware and / or software, and can be configured in a computer device, such as a question-and-answer interaction terminal device integrating a large model. Figure 3 As shown, the device includes:
[0063] The request acquisition module 310 is used to acquire the initial request message of the target user, and convert the initial request message into a standard request format to generate the target request message;
[0064] The intent recognition module 320 is used to perform intent recognition on the target request message based on a pre-trained intent recognition model, and to determine the target entity and target intent in the target request message;
[0065] The knowledge retrieval module 330 is used to determine at least one candidate knowledge fragment in a vector database based on the target entity and the target intent, using a cascaded hybrid retrieval strategy; wherein the vector database stores structured rehabilitation knowledge data.
[0066] The response generation module 340 is used to generate rehabilitation prompt text based on the rehabilitation prompt text template, the target request message, candidate knowledge fragments, and question-and-answer constraints, and to generate the target response content of the target request message based on the rehabilitation prompt text using a pre-trained large language model.
[0067] This application embodiment performs intent recognition on the user's input request message, determines candidate knowledge fragments in the vector database based on the intent recognition results, and updates the rehabilitation prompt word template according to the target request message, candidate knowledge fragments, and question-and-answer constraints to generate rehabilitation prompt word text. This enables the large language model to better identify the user's personalized needs, generate customized response content for the user, improve the accuracy of question-and-answer interaction, and enhance the user's experience in the intelligent question-and-answer interaction process.
[0068] Optionally, the response generation module 340 includes:
[0069] A constraint generation unit is used to obtain a user health profile of the target user and generate question-and-answer constraints based on the user health profile; wherein, the question-and-answer constraints are used to adapt candidate knowledge fragments to the target user;
[0070] The knowledge fragment update unit is used to filter and update the candidate knowledge fragments using the question-and-answer constraints to generate a target knowledge fragment; wherein, the target knowledge fragment is information obtained by fusing the user information of the target user with the candidate knowledge fragments;
[0071] The prompt word generation unit is used to update the rehabilitation prompt word template based on the target knowledge fragment and generate rehabilitation prompt word text.
[0072] Optionally, the question-and-answer constraints include: rehabilitation period constraints, age group constraints, and rehabilitation strategy constraints.
[0073] Optionally, the knowledge fragment update unit can be specifically used for:
[0074] Based on the constraints of the rehabilitation strategy, the candidate knowledge fragments are screened to generate alternative knowledge fragments; the alternative knowledge fragments are candidate knowledge fragments that conform to the constraints of the rehabilitation strategy.
[0075] Using the aforementioned recovery period constraints and age group constraints, the candidate knowledge fragments are updated, and the updated candidate knowledge fragments are used as target knowledge fragments; wherein, the purpose of the knowledge fragment update is to adapt the candidate knowledge fragments to the recovery period and age group of the target user.
[0076] Optionally, the target user's health profile is determined using electronic medical records, wearable device data, and historical conversation information.
[0077] Optionally, the knowledge retrieval module 330 includes:
[0078] A first-level retrieval unit is used to perform a first-level retrieval in the vector database using the target entity to obtain a first retrieval result; wherein, the first-level retrieval refers to keyword retrieval;
[0079] A secondary retrieval unit is used to perform a secondary retrieval in the first retrieval result using the target intent to obtain a target retrieval result; wherein, the secondary retrieval refers to semantic retrieval, and the target retrieval result is a candidate knowledge fragment that matches the target entity and the target intent.
[0080] Optionally, the device may also include:
[0081] A knowledge fragment filtering device is used to: assign knowledge level tags to candidate knowledge fragments in the target retrieval results based on the storage location information of the candidate knowledge fragments in the vector database; wherein the knowledge level tags are used to characterize the credibility of the candidate knowledge fragments; and filter the target retrieval results based on the knowledge level tags to filter candidate knowledge fragments that are lower than a preset tag level.
[0082] The large-model-based question-and-answer interaction device provided in this application can execute the large-model-based question-and-answer interaction method provided in any embodiment of this application, and has the corresponding functional modules and beneficial effects for executing each large-model-based question-and-answer interaction method.
[0083] According to embodiments of this application, this application also provides an electronic device, a readable storage medium, and a computer program product.
[0084] Example 4
[0085] Figure 4 This is a schematic diagram of the structure of an electronic device 410 implementing the large-model-based question-and-answer interaction method of this application embodiment. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices (such as helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the present application described and / or claimed herein.
[0086] like Figure 4As shown, the electronic device 410 includes at least one processor 411 and a memory, such as a read-only memory 412 or a random access memory 413, communicatively connected to the at least one processor 411. The memory stores computer programs executable by the at least one processor. The processor 411 can perform various appropriate actions and processes based on the computer program stored in the read-only memory 412 or loaded from storage unit 418 into the random access memory 413. The random access memory 413 can also store various programs and data required for the operation of the electronic device 410. The processor 411, read-only memory 412, and random access memory 413 are interconnected via a bus 414. An input / output interface 415 is also connected to the bus 414.
[0087] Multiple components in electronic device 410 are connected to input / output interface 415, including: input unit 416, such as keyboard, mouse, etc.; output unit 417, such as various types of monitors, speakers, etc.; storage unit 418, such as disk, optical disk, etc.; and communication unit 419, such as network card, modem, wireless transceiver, etc. Communication unit 419 allows electronic device 410 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.
[0088] Processor 411 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of processor 411 include, but are not limited to, central processing units, graphics processing units, various special-purpose artificial intelligence computing chips, various processors running machine learning model algorithms, digital signal processors, and any suitable processor, controller, microcontroller, etc. Processor 411 performs the various methods and processes described above, such as question-answering interaction methods based on large models.
[0089] In some embodiments, the large-model-based question-and-answer interaction method can be implemented as a computer program tangibly contained in a computer-readable storage medium, such as storage unit 418. In some embodiments, part or all of the computer program can be loaded and / or installed on electronic device 410 via read-only memory 412 and / or communication unit 419. When the computer program is loaded into random access memory 413 and executed by processor 411, one or more steps of the large-model-based question-and-answer interaction method described above can be performed. Alternatively, in other embodiments, processor 411 can be configured for the large-model-based question-and-answer interaction method by any other suitable means (e.g., by means of firmware).
[0090] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays, application-specific integrated circuits (ASICs), application-specific standard products (ASICs), systems-on-a-chip (SoCs), payload programmable logic devices, computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.
[0091] Computer programs used to implement the methods of this application may be written in any combination of one or more programming languages. These computer programs may be provided to the processor of a general-purpose computer, a special-purpose computer, or other programmable, large-scale question-and-answer interactive device, such that when executed by the processor, the functions / operations specified in the flowcharts and / or block diagrams are implemented. The computer programs may be executed entirely on a machine, partially on a machine, or as a standalone software package, partially on a machine and partially on a remote machine, or entirely on a remote machine or server.
[0092] In the context of this application, a computer-readable storage medium can be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, apparatus, or device. A computer-readable storage medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium can be a machine-readable signal medium. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory, read-only memory, erasable programmable read-only memory, optical fibers, portable compact disk read-only memory, optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0093] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a cathode ray tube or liquid crystal display monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).
[0094] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or computing systems that include middleware components (e.g., application servers), or computing systems that include frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), blockchain networks, and the Internet.
[0095] A computing system can include clients and servers. Clients and servers are generally geographically separated and typically interact via communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a host product within the cloud computing service system to address the shortcomings of traditional physical hosts and virtual private servers, such as high management difficulty and weak business scalability.
[0096] It should be understood that the various forms of processes shown above can be used to rearrange, add, or delete steps. For example, the steps described in this application can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this application can be achieved, and this is not limited herein.
[0097] The specific embodiments described above do not constitute a limitation on the scope of protection of this application. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this application should be included within the scope of protection of this application.
Claims
1. A question-answering interaction method based on a large model, characterized in that, include: Obtain the initial request message from the target user, and convert the initial request message into a standard request format to generate the target request message; Based on a pre-trained intent recognition model, intent recognition is performed on the target request message to determine the target entity and target intent in the target request message; Based on the target entity and the target intent, a cascaded hybrid retrieval strategy is adopted to determine at least one candidate knowledge fragment in the vector database; wherein, the vector database stores structured rehabilitation knowledge data; the rehabilitation knowledge data stored in the vector database has different knowledge level labels according to its corresponding storage location, and the knowledge level labels are used to characterize the credibility of the candidate knowledge fragment; Based on the rehabilitation prompt word template, rehabilitation prompt word text is generated according to the target request message, candidate knowledge fragments and question-and-answer constraints. Then, a pre-trained large language model is used to generate the target response content of the target request message based on the rehabilitation prompt word text. The step of generating rehabilitation prompt text based on the rehabilitation prompt template, according to the target request message, candidate knowledge fragments, and question-and-answer constraints, includes: Obtain the user health profile of the target user, and generate question-and-answer constraints based on the user health profile; wherein, the user health profile is used to provide contextual constraints for the generation of target response content; the question-and-answer constraints are used to adapt candidate knowledge fragments to the target user, and the question-and-answer constraints include recovery period constraints, age group constraints, and recovery strategy constraints; Using the aforementioned question-and-answer constraints, the candidate knowledge fragments are filtered and updated to generate a target knowledge fragment; wherein, the target knowledge fragment is information obtained by fusing the target user's user information with the candidate knowledge fragments; The rehabilitation prompt template is updated based on the target request message and the target knowledge fragment to generate rehabilitation prompt text.
2. The method according to claim 1, characterized in that, Using the aforementioned question-and-answer constraints, the candidate knowledge fragments are filtered and updated to generate target knowledge fragments, including: Based on the constraints of the rehabilitation strategy, the candidate knowledge fragments are screened to generate alternative knowledge fragments; the alternative knowledge fragments are candidate knowledge fragments that conform to the constraints of the rehabilitation strategy. Using the aforementioned recovery period constraints and age group constraints, the candidate knowledge fragments are updated, and the updated candidate knowledge fragments are used as target knowledge fragments; wherein, the purpose of the knowledge fragment update is to adapt the candidate knowledge fragments to the recovery period and age group of the target user.
3. The method according to claim 1, characterized in that, The target user's health profile is determined through electronic medical records, wearable device data, and historical conversation information.
4. The method according to claim 1, characterized in that, Based on the target entity and the target intent, a cascaded hybrid retrieval strategy is employed to determine at least one candidate knowledge fragment in the vector database, including: The target entity is used to perform a first-level search in the vector database to obtain the first search result; wherein, the first-level search refers to keyword search; The target intent is used to perform a secondary search in the first search result to obtain the target search result; wherein, the secondary search refers to semantic search, and the target search result is a candidate knowledge fragment that matches the target entity and the target intent.
5. The method according to claim 4, characterized in that, After obtaining the target search results, the following is also included: Based on the storage location information of candidate knowledge fragments in the target retrieval results in the vector database, a knowledge level label is assigned to the candidate knowledge fragment; based on the knowledge level label, the target retrieval results are filtered to remove candidate knowledge fragments that are lower than the preset label level.
6. A question-and-answer interaction device based on a large model, characterized in that, include: The request acquisition module is used to acquire the initial request message of the target user, and convert the initial request message into a standard request format to generate the target request message; The intent recognition module is used to perform intent recognition on the target request message based on a pre-trained intent recognition model, and to determine the target entity and target intent in the target request message. The knowledge retrieval module is used to determine at least one candidate knowledge fragment in a vector database based on the target entity and the target intent, using a cascaded hybrid retrieval strategy; wherein, the vector database stores structured rehabilitation knowledge data; the rehabilitation knowledge data stored in the vector database has different knowledge level labels according to its corresponding storage location, and the knowledge level labels are used to characterize the credibility of the candidate knowledge fragment; The response generation module is used to generate rehabilitation prompt text based on the rehabilitation prompt text template, the target request message, candidate knowledge fragments, and question-and-answer constraints, and to generate the target response content of the target request message based on the rehabilitation prompt text using a pre-trained large language model. The response generation module includes: A constraint generation unit is used to obtain the user health profile of the target user and generate question-and-answer constraint conditions based on the user health profile; wherein, the user health profile is used to provide contextual constraints for the generation of target response content; the question-and-answer constraint conditions are used to adapt candidate knowledge fragments to the target user, and the question-and-answer constraint conditions include recovery period constraints, age group constraints, and recovery strategy constraints; The knowledge fragment update unit is used to filter and update the candidate knowledge fragments using the question-and-answer constraints to generate a target knowledge fragment; wherein, the target knowledge fragment is information obtained by fusing the user information of the target user with the candidate knowledge fragments; The prompt word generation unit is used to update the rehabilitation prompt word template based on the target knowledge fragment and generate rehabilitation prompt word text.
7. An electronic device, characterized in that, include: One or more processors; Memory, used to store 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 large model-based question-answering interaction method as described in any one of claims 1-5.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that, When executed by the processor, the program implements the large-model-based question-and-answer interaction method as described in any one of claims 1-5.
9. A computer program product comprising a computer program that, when executed by a processor, implements the question-answering interaction method based on a large model according to any one of claims 1-5.
Citation Information
Patent Citations
Intelligent assistant method and system based on large model
CN120806133A