A user service method and device based on medical LLM model
Through the multi-modal LLM model combined with ORC recognition and logical reasoning, the problem of understanding user intentions and reasoning strategy selection in medical image interpretation and inquiry services is solved, achieving efficient interpretation of medical image content and inquiry services, and improving interpretation Accuracy and efficiency.
Patent Information
- Application Number
- CN202410571499.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-09
- Publication Date
- 2024-09-13
- Estimated Expiration
- 2044-05-09
AI Technical Summary
Existing LLM models are difficult to accurately understand user intentions in medical image interpretation and inquiry services, and lack effective reasoning strategies for different inquiry scenarios, resulting in insufficient interpretation efficiency and accuracy.
Using a multi-modal LLM model combined with ORC recognition and logical reasoning, the user inquiry scenario is determined through semantic recognition and decision-making models, an appropriate combination of reasoning strategies is selected, logical reasoning is performed on structured text to generate answers, and efficient interpretation of medical image content is achieved. and inquiry services.
The accuracy and efficiency of interpretation of medical image content are improved, the query results generated are more in line with user intentions, and the ability to understand and interpret complex medical content is enhanced.
Smart Images

Figure CN118135592B
Abstract
Description
Technical Field
[0001] The embodiments of this specification relate to the field of artificial intelligence technology, and in particular, to a user service method and device based on a medical LLM model. Background Art
[0002] The LLM model (Large Language Model) is a machine learning model with billions or even trillions of parameters that is built by using deep learning technology and pre-training with massive amounts of data. It is the basic technology for the new generation of artificial intelligence applications. Since the LLM model is based on large-scale data and trained in a pre-training manner, it has the characteristics of large scale, strong versatility, and good emergence.
[0003] With the continuous updating of technology, the LLM model has become the most widely watched and influential artificial intelligence technology in the world in recent years. More and more companies and institutions have launched products related to the LLM model. On this basis, how to better utilize the LLM model and explore the application scenarios of the LLM model will have a very huge application prospect. Summary of the invention
[0004] This specification proposes a user service method based on a medical LLM model, wherein the LLM model is a multimodal LLM model; the LLM model includes several reasoning strategies;
[0005] The method comprises:
[0006] Acquire a target text input by a user; wherein the target text is a text that inquires about the content contained in the target image;
[0007] Performing semantic recognition on the target text, determining the user's query scenario based on the semantic recognition result, and determining a reasoning strategy combination corresponding to the user's query scenario from the plurality of reasoning strategies;
[0008] Obtain structured text for describing the content contained in the target image obtained by performing ORC recognition on the content contained in the target image by the LLM model, and input the structured text into the LLM model, so that the LLM model can perform logical reasoning on the structured text based on each reasoning strategy in the reasoning strategy combination, and generate an answer text corresponding to the target text based on the reasoning results corresponding to the each reasoning strategy.
[0009] Optionally, the performing ORC recognition on the content contained in the target image by the LLM model to obtain structured text for describing the content contained in the target image includes:
[0010] Inputting the target image corresponding to the target text into the LLM model, so that the LLM model performs offline ORC recognition on the content contained in the target image to obtain a structured text for describing the content contained in the target image; or,
[0011] The target image corresponding to the target text is input into the LLM model, so that the LLM model performs online ORC recognition on the content contained in the target image to obtain a structured text for describing the content contained in the target image.
[0012] Optionally, the target image is input into the LLM model so that the LLM model performs ORC recognition on the content contained in the target image to obtain structured text for describing the content contained in the target image, including:
[0013] Acquire position information of text content contained in the target image in the target image, and encode the position information to generate a position code corresponding to the text content; wherein the position code is used to indicate the relative position of the text content in the target image;
[0014] Identifying target text content used to describe image content contained in the target image in the text content contained in the target image, and establishing an association relationship between the image content contained in the target image and the target text content used to describe the image content contained in the target image;
[0015] Generate identification indication information corresponding to the target image based on the position code and / or the association relationship;
[0016] The target image and the recognition indication information are input into the LLM model, so that the LLM model performs ORC recognition on the content contained in the target image based on the recognition indication information to obtain a structured text for describing the content contained in the target image.
[0017] Optionally, the LLM has a component for performing semantic alignment processing on image content contained in the target image and text content contained in the target image;
[0018] Identifying target text content in the text content contained in the target image, which is used to describe the image content contained in the target image, and establishing an association relationship between the image content contained in the target image and the target text content contained in the target image, which is used to describe the image content, includes:
[0019] Based on a preset semantic alignment algorithm, semantic alignment processing is performed on the image content contained in the target image and the text content contained in the target image to establish an association relationship between the image content contained in the target image and the target text content contained in the target image for describing the image content.
[0020] Optionally, establishing an association relationship between the image content contained in the target image and the target text content contained in the target image and used to describe the image content includes:
[0021] The target text content contained in the target image and used to describe the image content contained in the target image is used as annotation information to perform content annotation on the image content contained in the target image.
[0022] Optionally, performing semantic recognition on the target text and determining the user's query scenario based on the semantic recognition result includes:
[0023] The target text is input into the LLM model so that the LLM model performs semantic recognition on the target text, and the user's inquiry scenario is determined based on the semantic recognition result.
[0024] Optionally, the LLM model is connected to a pre-trained decision model; the decision model is used to determine the best reasoning strategy combination corresponding to the user's query scenario from several reasoning strategies included in the LLM model based on the user's query scenario;
[0025] Determining a reasoning strategy combination for performing logical reasoning on the content contained in the target image from the plurality of reasoning strategies based on the query scenario includes:
[0026] The query scenario is input into the decision model, so that the decision model determines a reasoning strategy combination for performing logical reasoning on the content contained in the target image from the several reasoning strategies based on the query scenario, and returns the reasoning strategy combination to the LLM model.
[0027] Optionally, each reasoning strategy included in the reasoning strategy combination corresponds to a different strategy weight;
[0028] Generating an answer text corresponding to the target text based on the reasoning results corresponding to the respective reasoning strategies, including:
[0029] Based on the strategy weights corresponding to the various reasoning strategies, the reasoning results corresponding to the various reasoning strategies are fused to obtain an answer text corresponding to the target text.
[0030] Optionally, the decision model is a reinforcement learning model obtained by performing reinforcement learning training by determining a reasoning strategy combination corresponding to the user's query scenario from the several reasoning strategies as an action of reinforcement learning, and using effect data used to represent the reasoning effect of logical reasoning based on the reasoning strategy combination as a state of reinforcement learning.
[0031] Optionally, the several reasoning strategies included in the LLM model are dynamically updated reasoning strategies.
[0032] Optionally, the LLM model is an LLM service model obtained by fine-tuning a pre-trained LLM basic model based on data related to the target application scenario; and the target image is an image related to the target application scenario.
[0033] Optionally, the target application scenario is a medical inquiry scenario, the target image includes a medical image; the LLM model is an LLM medical service model obtained by fine-tuning a pre-trained LLM basic model based on a number of medical documents and / or medical images; the target text is a medical inquiry text for medical inquiry regarding the content contained in the medical image; the structured text is structured medical content extracted from the medical image; and the answer text is a medical inquiry answer text corresponding to the medical inquiry text.
[0034] Optionally, the medical image is an image corresponding to a medical examination report; the structured medical content includes triple information consisting of a medical part entity contained in the medical image, an attribute corresponding to the medical part entity, and an examination result corresponding to the medical part entity.
[0035] This specification also proposes a user service method based on a medical LLM model, wherein the LLM model includes a first LLM model for performing ORC recognition on the content contained in a target image; and a second LLM model for performing logical reasoning on the content contained in the target image to generate an answer text corresponding to a target text input by a user to inquire about the content contained in the target image; wherein the first LLM model is a multimodal LLM model; and the second LLM model includes several reasoning strategies;
[0036] The method comprises:
[0037] Acquire a target text input by a user; wherein the target text is a text that inquires about the content contained in the target image;
[0038] Performing semantic recognition on the target text, determining the user's query scenario based on the semantic recognition result, and determining a reasoning strategy combination corresponding to the user's query scenario from the plurality of reasoning strategies;
[0039] Obtain structured text for describing the content contained in the target image obtained by performing ORC recognition on the content contained in the target image by the first LLM model, and input the structured text into the second LLM model, so that the second LLM model can perform logical reasoning on the structured text based on each reasoning strategy in the reasoning strategy combination, and generate an answer text corresponding to the target text based on the reasoning results corresponding to the each reasoning strategy.
[0040] This specification also proposes a user service system based on the medical LLM model, the system comprising:
[0041] An ORC recognition subsystem, the ORC recognition subsystem is a subsystem constructed based on a multimodal LLM model, and is used to perform ORC recognition on a target image input into the LLM model to obtain a structured text for describing the content contained in the target image; wherein the LLM model includes several reasoning strategies;
[0042] A decision subsystem, configured to perform semantic recognition on a target text input by a user to inquire about the content contained in a target image, determine the user's inquiry scenario based on the semantic recognition result, and determine a reasoning strategy combination corresponding to the user's inquiry scenario from the plurality of reasoning strategies;
[0043] The reasoning subsystem is used to input the structured text identified by the ORC recognition subsystem into the LLM model, so that the LLM model can perform logical reasoning on the structured text input based on each reasoning strategy in the reasoning strategy combination determined by the decision subsystem, and generate an answer text corresponding to the target text based on the reasoning results corresponding to each reasoning strategy.
[0044] This specification also proposes a user service system based on the medical LLM model, the system comprising:
[0045] An ORC recognition subsystem, the ORC recognition subsystem is a subsystem constructed based on a multimodal first LLM model, and is used to perform ORC recognition on a target image input into the LLM model to obtain a structured text for describing the content contained in the target image; wherein the LLM model includes several reasoning strategies;
[0046] a decision subsystem, configured to perform semantic recognition on a target text input by a user to inquire about the content contained in a target image, determine the user's inquiry scenario based on the semantic recognition result, and determine a reasoning strategy combination corresponding to the user's inquiry scenario from a plurality of reasoning strategies contained in a second LLM model;
[0047] The reasoning subsystem is a subsystem constructed based on the second LLM model, and is used to input the structured text recognized by the ORC recognition subsystem into the second LLM model, so that the second LLM model can perform logical reasoning on the input structured text based on each reasoning strategy in the reasoning strategy combination determined by the decision subsystem, and generate an answer text corresponding to the target text based on the reasoning results corresponding to the each reasoning strategy.
[0048] In the above technical scheme, in the process of using the multimodal LLM model to provide users with inquiry services regarding the content contained in the image, a structured interpretation of the content contained in the image is performed based on the LLM model, and in the process of the user inquiring about the content contained in the image, the optimal reasoning strategy combination corresponding to the inquiry scenario is determined from several reasoning strategies contained in the multimodal LLM model based on the user's inquiry scenario, so that the LLM model can more fully understand the content contained in the image and the user's inquiry intention, thereby helping the user to interpret the content contained in the image more accurately and efficiently, and generating inquiry results that are more in line with the user's inquiry intention for the user. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] In order to more clearly illustrate the technical solutions of the embodiments of this specification, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this specification. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0050] Figure 1 is a flow chart of a user service method based on a medical LLM model shown in an embodiment of this specification;
[0051] Figure 2 It is a schematic diagram of performing ORC recognition on a medical examination report based on a multimodal LLM model shown in an embodiment of this specification;
[0052] Figure 3 It is a schematic diagram of semantically aligning image content and text content contained in a medical examination report shown in an embodiment of this specification;
[0053] Figure 4 is an architecture diagram of an LLM model shown in an embodiment of this specification;
[0054] Figure 5 is a flowchart of another user service method based on the medical LLM model shown in an embodiment of this specification;
[0055] Figure 6 It is an architecture diagram of a user service system based on a medical LLM model shown in an embodiment of this specification;
[0056] Figure 7 is a schematic structural diagram of an electronic device shown in an embodiment of this specification;
[0057] Figure 8 is a block diagram of a user service device based on a medical LLM model shown in an embodiment of this specification;
[0058] Fig. 9 It is a block diagram of another user service device based on the medical LLM model shown in an embodiment of this specification. DETAILED DESCRIPTION
[0059] In order to enable those skilled in the art to better understand the technical solutions in this specification, the technical solutions in the embodiments of this specification will be clearly and completely described below in conjunction with the drawings in the embodiments of this specification. Obviously, the described embodiments are only part of the embodiments of this specification, not all of the embodiments. Based on the embodiments in this specification, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of this specification.
[0060] The VQA (Visual Question Answering) task is a multimodal task that combines computer vision and natural language processing. The task aims to require the computer system to be able to intelligently interpret the content contained in the image and intelligently provide answers corresponding to the natural language questions asked by the user based on the content contained in the image.
[0061] For example, in the medical field, some image-based inspection reports are usually generated. These inspection reports usually contain many highly professional medical terms and abnormal indicators. Without professional guidance, it is difficult for individual users to fully understand these highly professional medical terms and abnormal indicators. Therefore, for ordinary users, there is a need to interpret and inquire about the content contained in the image-based inspection reports.
[0062] With the development of technology, in application fields with similar VQA task requirements, people are generally more inclined to use advanced data processing technologies, such as knowledge graphs and big data analysis models, to build intelligent solutions and establish efficient and accurate image interpretation capabilities for users, thereby answering users' questions about the content contained in the image and providing users with further inquiry services.
[0063] For example, still taking the medical field as an example, we can build solutions to provide users with image interpretation services for examination reports, and intelligently answer users' inquiries such as abnormal indicators contained in the examination reports.
[0064] Based on this, this specification aims to propose a service framework that utilizes a multimodal LLM model to perform VQA tasks to provide users with query services regarding the content contained in an image.
[0065] Under this service framework, on the one hand, the multimodal LLM model can be used to perform ORC recognition on the content contained in the target image to obtain structured text used to describe the content contained in the target image;
[0066] On the other hand, when the user asks questions about the content contained in the target image, the best reasoning strategy combination corresponding to the inquiry scenario can be determined from several reasoning strategies contained in the multimodal LLM model based on the determined user's inquiry scenario, and then the structured text can be input into the LLM model. The LLM model performs logical reasoning on the structured text based on the above reasoning strategy combination to generate an answer text corresponding to the target text.
[0067] Based on the above service framework, in the process of using the multimodal LLM model to provide users with inquiry services regarding the content contained in the image, a structured interpretation of the content contained in the image is performed based on the LLM model, and in the process of users inquiring about the content contained in the image, the best reasoning strategy combination corresponding to the inquiry scenario is determined from several reasoning strategies contained in the multimodal LLM model based on the user's inquiry scenario, so that the LLM model can more fully understand the content contained in the image and the user's inquiry intention, thereby helping users to interpret the content contained in the image more accurately and efficiently, and generating inquiry results that are more in line with the user's inquiry intention.
[0068] See also Figure 1 , Figure 1 This is a flowchart of a user service method based on the medical LLM model shown in this specification. The execution subject of the method can be a service framework that provides inquiry services for the content contained in the image to the user, including the following execution process:
[0069] Step 102: Acquire a target text input by a user; wherein the target text is a text that inquires about the content contained in the target image;
[0070] The target image may specifically include any form of image containing content that needs to be interpreted; for example, in practical applications, the target image may specifically include an image containing both text content and image content. For example, in the medical field, the target image may specifically include an image corresponding to a medical examination report, and the image corresponding to the medical examination report may include images related to the medical examination and a text description of the image. Of course, in addition to being a medical examination report, the target image may specifically include other forms of highly professional medical reports, which are not particularly limited in this specification.
[0071] The above service framework can be a service framework based on the LLM model for providing users with inquiry services on the content contained in the image. It should be noted that the specific form of the above service framework is not particularly limited in this specification; for example, in actual applications, the above service framework can be a service system, or a service program deployed on a service platform or a user-side terminal, or other forms of service components that can provide services to users (such as plug-ins, applets), etc.
[0072] The above-mentioned LLM model may specifically be a multimodal LLM model. It should be explained that the so-called multimodal LLM model may specifically refer to an LLM model that has the ability to process multiple different types of input data. For example, in this specification, the above-mentioned LLM model may specifically be an LLM model that has the ability to process both input images and texts.
[0073] In one embodiment shown, the LLM model can be a LLM service model obtained by fine-tuning the pre-trained LLM basic model based on data related to the target application scenario. Correspondingly, the target image can be an image related to the target application scenario.
[0074] It should be noted that the above target application scenario can specifically be any form of service scenario related to the user's inquiry, and is not particularly limited in this specification.
[0075] For example, in one implementation method shown, the target application scenario may be a medical inquiry scenario, and the target image may be a medical image; accordingly, in this application scenario, the LLM model may be an LLM medical service model obtained by fine-tuning the pre-trained LLM basic model based on data related to the medical inquiry scenario.
[0076] It should be noted that in order to improve the LLM model's ability to identify and extract key information in the medical field, the data related to the medical inquiry scenario used to fine-tune the LLM model can specifically be a large number of medical documents and / or medical images, so that the fine-tuned LLM medical service model can have a higher generalization ability when identifying documents in the medical field.
[0077] In this specification, when a user has the need to inquire about the content contained in the target image, the user can edit a target text for inquiring about the content contained in the target image, and input the target text into the service framework for processing, and the service framework provides the user with an inquiry service regarding the content contained in the target image.
[0078] Step 104: performing semantic recognition on the target text, determining the user's query scenario based on the semantic recognition result, and determining a reasoning strategy combination corresponding to the user's query scenario from the plurality of reasoning strategies;
[0079] The above inquiry scenarios usually reflect the user's specific inquiry intention. When the user needs to inquire about the content contained in the target image, different inquiry scenarios may be involved.
[0080] For example, taking the above-mentioned target image as a medical image, when the user inquires about the content contained in the medical image, it may involve inquiry scenarios such as medical consultation, disease diagnosis inquiry, treatment suggestion inquiry, case analysis inquiry, medication suggestion inquiry, and disease science popularization inquiry.
[0081] After receiving the target text input by the user, the service framework may perform semantic recognition on the target text, and then determine the user's query scenario based on the semantic recognition result. For example, the service framework may perform semantic recognition on the target text, determine the user's query intention, and then determine the query scenario to which the query initiated by the user belongs based on the determined user's query intention.
[0082] In one embodiment shown, since the above-mentioned service framework can specifically be a service framework implemented based on the LLM model, when performing semantic recognition on the above-mentioned target text, the semantic recognition ability of the LLM model itself can be used to input the target text into the LLM model, so that the LLM model can perform semantic recognition on the target text and determine the user's inquiry scenario based on the semantic recognition result.
[0083] It should be noted that the specific process of semantic recognition of the target text will not be described in detail in this specification. Those skilled in the art may refer to the records in the relevant technology when implementing the technical solution described in this specification.
[0084] In this specification, the above LLM model can be specifically connected to a reasoning strategy library, and the reasoning strategy library can include several reasoning strategies.
[0085] For example, in practical applications, the reasoning strategies contained in the reasoning strategy library may specifically include reasoning strategies based on context, reasoning strategies based on reasoning tools, reasoning strategies based on knowledge graphs, reasoning strategies based on logic, and so on.
[0086] It should be noted that, in actual applications, corresponding reasoning strategies can be flexibly customized in the above reasoning strategy library based on specific application scenarios.
[0087] For example, taking the medical inquiry scenario in the medical field as an example, in this application scenario, users may usually need to conduct medical consultations based on the medical examination information contained in the image corresponding to the medical examination report. At this time, the reasoning strategies in the above-mentioned reasoning strategy library may specifically include reasoning strategies for diagnostic reasoning based on the constructed knowledge graph related to disease diagnosis, reasoning strategies for diagnostic reasoning based on the trained disease diagnosis model, and reasoning strategies for diagnostic reasoning based on the professional medical knowledge base constructed based on medical guidelines and expert experience, and so on.
[0088] In one embodiment shown, the above-mentioned reasoning strategy library can specifically be a strategy library in which the reasoning strategies therein can be dynamically updated. In this way, the strategies contained in the above-mentioned reasoning strategy library can be flexibly updated and expanded based on specific reasoning requirements, so that the LLM model can flexibly adapt to different reasoning strategies.
[0089] In practical applications, after determining the user's query scenario, the service framework may further determine the best combination of reasoning strategies corresponding to the user's query scenario from among the several reasoning strategies included in the LLM model.
[0090] For example, taking the medical inquiry scenario in the medical field as an example, the user's inquiry scenarios may include medical consultation, disease diagnosis inquiry, treatment suggestion inquiry, case analysis inquiry, medication suggestion inquiry, disease science inquiry and other inquiry scenarios. For different inquiry scenarios, the above LLM model may be suitable for using different reasoning strategy combinations to perform logical reasoning. For example, for the disease diagnosis inquiry scenario, LLM may be more suitable for giving priority to the reasoning strategy of combining the reasoning strategy of diagnostic reasoning based on the constructed knowledge graph and the reasoning strategy of diagnostic reasoning based on the trained disease diagnosis model; while for the treatment suggestion inquiry scenario, it may be more suitable to give priority to the reasoning strategy of combining the reasoning strategy of reasoning based on the constructed knowledge graph and the reasoning strategy of reasoning based on the professional medical knowledge base constructed by medical guidelines and expert experience.
[0091] In one embodiment shown, the above-mentioned LLM model can be specifically connected to a pre-trained decision model, which can be specifically used to determine the best reasoning strategy combination corresponding to the user's query scenario from several reasoning strategies contained in the reasoning strategy library accessed by the LLM model based on the user's query scenario.
[0092] In this case, after the service framework determines the user's query scenario, the user's query scenario can be further input into the decision model, and the decision model makes further decisions to determine the best reasoning strategy combination corresponding to the user's query scenario from the several reasoning strategies included in the reasoning strategy library accessed by the LLM model, and return the reasoning strategy combination to the LLM model. For example, in implementation, a specific interaction method can be designed for the LLM model and the decision model.
[0093] In one implementation, the above-mentioned interaction method can specifically be a method of explicit interaction between the above-mentioned LLM model and the above-mentioned decision model in the form of messages or instructions. In this case, after the above-mentioned decision model determines the optimal reasoning strategy combination corresponding to the user's query scenario, the above-mentioned optimal reasoning strategy combination can be explicitly transmitted to the above-mentioned LLM model in the form of messages or instructions (for example, in the form of prompt words) to prompt the LLM model to perform reasoning based on the optimal reasoning strategy combination in the future.
[0094] In another implementation, the above-mentioned interaction method can specifically be an invisible interaction method in which the above-mentioned decision model configures the model of the above-mentioned LLM model. In this case, the above-mentioned decision model can be authorized to modify the configuration of the above-mentioned LLM model. After the strategy model determines the optimal reasoning strategy combination corresponding to the user's query scenario, the reasoning strategy adopted by the above-mentioned LLM model by default when performing reasoning can be modified to the above-mentioned optimal reasoning strategy combination determined, so as to ensure that the LLM model will subsequently perform reasoning based on the optimal reasoning strategy combination by default.
[0095] It should be noted that determining the best reasoning strategy combination corresponding to the user's query scenario from the several reasoning strategies contained in the reasoning strategy library accessed by the above-mentioned LLM model specifically refers to the process of deciding a reasoning strategy combination that is more suitable for the user's query scenario from the reasoning strategy library.
[0096] Among them, the decision logic adopted when determining the optimal reasoning strategy combination corresponding to the user's query scenario from the several reasoning strategies contained in the above-mentioned reasoning strategy library is not specifically limited in this specification. In actual applications, the decision logic can be specifically determined in the process of learning and training the above-mentioned decision model.
[0097] For example, in practical applications, the decision model can specifically describe the combination relationship of reasoning strategies suitable for various inquiry scenarios through an objective function, and then determine the optimal values of the parameters in the objective function through learning and training. Then, when applying the decision model, the optimal reasoning strategy combination corresponding to the user's inquiry scenario can be determined from the several reasoning strategies contained in the above-mentioned reasoning strategy library based on the objective function.
[0098] It should be noted that, in this specification, the training method used to train the above-mentioned decision model is not particularly limited in this specification. In practical applications, different training methods can be flexibly adopted based on needs.
[0099] In one embodiment shown, the decision model may be trained by using reinforcement learning.
[0100] In this case, the above-mentioned decision model can specifically be a reinforcement learning model. When training the decision model, the reasoning strategy combination corresponding to the user's inquiry scenario can be determined from several reasoning strategies contained in the reasoning strategy library as the action of reinforcement learning, and the effect data used to represent the reasoning effect of logical reasoning based on the reasoning strategy combination can be used as the state of reinforcement learning. Then, a reasonable reward function can be designed based on the above-mentioned effect data to perform reinforcement learning training to obtain the above-mentioned decision model.
[0101] It should be noted that the above reward function can be flexibly designed based on specific needs in practical applications and will not be described in detail in this specification.
[0102] For example, in one example, a large amount of query data for image samples can be prepared in advance as training samples. The query data can include query text for the image samples and the correct answer text annotated for the query text. During the training process of the above reinforcement learning model, after the best reasoning strategy combination corresponding to the user's query scenario is determined from the several reasoning strategies contained in the reasoning strategy library of the above LLM model, the above LLM model can try to use each reasoning strategy in the reasoning strategy combination to perform logical reasoning on the structured text obtained by ORC recognition from the above image samples, and generate an answer text corresponding to the above query text based on the reasoning results corresponding to the above reasoning strategies. Then, the generated answer file can be compared with the correct answer text annotated for the query text to calculate the error between the two as the model loss. Accordingly, after the model loss is constructed in the above manner, the model loss can be used as a parameter for calculating the reward value generated during the reinforcement learning training process to design the above reward function. For example, generally speaking, the goal of reinforcement learning is to find the above-mentioned optimal combination of reasoning strategies, and the above-mentioned model loss describes the error between the generated answer file and the correct answer text annotated for the query text. This error is usually negatively correlated with the reward value generated in the reinforcement learning process. The smaller the error, the greater the reward value generated in the reinforcement learning process. In practical applications, a mathematical model can be used to describe the negative correlation between the above-mentioned error and the reward value generated in the reinforcement learning process to construct the above-mentioned reward function.
[0103] Of course, in practical applications, other training methods besides reinforcement learning can also be used to train the above decision model.
[0104] For example, in one embodiment shown, the decision model can also be trained in a supervised training manner. In this case, a large amount of query data for image samples can be prepared in advance as training samples, and the query data can include query text for the image samples and the correct answer text annotated for the query text. Then, the model loss of the decision model can be constructed, and the optimal value of the parameter in the objective function can be learned in a supervised training manner.
[0105] It should be noted that, in practical applications, the decision model connected to the LLM model may be an external model adapted to the LLM model. In this way, the decision model can be flexibly adapted to different LLM models.
[0106] Of course, in practical applications, the decision model connected to the LLM model can also be built into the LLM model in the form of a component.
[0107] For example, in practical applications, the above-mentioned LLM model generally adopts the transformer architecture. The two most core layers in the transformer architecture are the encoder layer and the decoder layer. The encoder layer is responsible for encoding the input data into vectors, and the decoder layer is responsible for reasoning about the vectors output by the encoder layer. In addition, an intermediate layer may be introduced between the encoder layer and the decoder layer. In this case, the above-mentioned decision model can be built into the above-mentioned intermediate layer in the form of a component. That is, the above-mentioned decision model can be a component contained in the above-mentioned intermediate layer.
[0108] Step 106: Obtain structured text for describing the content contained in the target image obtained by performing ORC recognition on the content contained in the target image by the LLM model, and input the structured text into the LLM model, so that the LLM model can perform logical reasoning on the structured text based on each reasoning strategy in the reasoning strategy combination, and generate an answer text corresponding to the target text based on the reasoning results corresponding to the each reasoning strategy.
[0109] In this specification, the above-mentioned multimodal LLM model can also be used to perform ORC recognition on the content contained in the target image to obtain a structured text used to describe the content contained in the target image. In practical applications, the KIE (Key Information Extraction) task is an important task in the field of natural language processing, which aims to identify and extract key information elements such as entities, concepts, relationships, and specific events from unstructured text data. In this specification, the processing power of the multimodal LLM model can be fully utilized, and the multimodal LLM model can be used to perform the KIE task, identify the key information contained in the target image from the target image, and generate the above-mentioned structured text.
[0110] For example, in one implementation shown, the target application scenario may be a medical inquiry scenario, the target image may be a medical image, and the LLM model may be an LLM medical service model obtained by fine-tuning the pre-trained LLM basic model based on data related to the medical inquiry scenario. Accordingly, in this application scenario, the target text may be a medical inquiry text for medical inquiry on the content contained in the medical image; the structured text may be structured medical content extracted from the medical image; and the answer text may be a medical inquiry answer text corresponding to the medical inquiry text.
[0111] For example, see Figure 2 , Figure 2 The figure is a schematic diagram showing ORC recognition of a medical examination report based on the multimodal LLM model.
[0112] like Figure 2 As shown, in this example, the medical image may be an image corresponding to a medical examination report; correspondingly, the structured medical content may specifically include triple information consisting of a medical part entity contained in the medical image, an attribute corresponding to the medical part entity, and an examination result corresponding to the medical part entity.
[0113] The above-mentioned multimodal LLM model can generally also be a model based on the transformer architecture. In the process of using the LLM model to perform ORC recognition on the medical examination report, the image corresponding to the above-mentioned medical examination report will be processed into a vector form by the encoder layer of the LLM model, and then input into the decoder layer. The decoder layer performs logical reasoning on the content contained in the image based on the knowledge base carried by the LLM model, and extracts the above-mentioned triplet information contained in the image corresponding to the above-mentioned medical examination report.
[0114] Among them, it should be noted that the medical field-related knowledge base carried by the LLM model can usually include a professional medical knowledge base built based on medical guidelines and expert experience, such as a knowledge graph, logical rules, etc. built based on medical guidelines and expert experience.
[0115] By equipping the LLM model with a professional medical knowledge base built based on medical guidelines and expert experience, the LLM model can correct some non-standard medical terms or medical expressions contained in the image based on the knowledge in the professional medical knowledge base during the process of logical reasoning on the content contained in the image. For example, the examination report may contain some spoken expressions corresponding to medical terms. Since the LLM model uses the above professional medical knowledge base, the professional expressions in the above professional medical knowledge base can be used to replace the spoken expressions contained in the examination report during the reasoning process.
[0116] In this specification, after determining the optimal reasoning strategy combination corresponding to the user's query scenario from the several reasoning strategies contained in the above-mentioned LLM model, the above-mentioned strategy framework can further obtain structured text for describing the content contained in the target image obtained by the LLM model through ORC recognition of the content contained in the target image.
[0117] It should be noted that when using the multimodal LLM model to perform ORC recognition on the content contained in the target image, offline recognition can be performed or online recognition can be performed.
[0118] In one embodiment shown, the multimodal LLM model can be used to perform offline ORC recognition on the content contained in the target image. In this case, before receiving the target text input by the user, the service framework can obtain the target image offline in advance, and input the obtained target image into the LLM model, and the LLM model performs offline ORC recognition on the content contained in the target image to obtain a structured text for describing the content contained in the target image.
[0119] For example, taking the above-mentioned target image as an image corresponding to a medical examination report, after the hospital issues a medical examination report, the medical examination report can be stored offline in a database, and the above-mentioned service framework can read the image corresponding to the medical examination report from the above-mentioned database offline, and then input the image into the above-mentioned LLM model. The LLM model performs offline ORC recognition on the content contained in the target image to obtain a structured text for describing the content contained in the target image.
[0120] In one embodiment shown, the multimodal LLM model can also be used to perform online ORC recognition on the content contained in the target image input by the user. In this case, the data input by the user to the service framework may include not only the target text but also the target image corresponding to the target text. After receiving the target text and the target image input by the user, the service framework may further input the target image input by the user into the LLM model, and the LLM model may perform online ORC recognition on the content contained in the target image to obtain a structured text for describing the content contained in the target image.
[0121] It should be noted that when using the above multimodal LLM model to perform ORC recognition on the content contained in the target image, in order to improve the accuracy of the LLM model in performing ORC recognition on the content contained in the target image, in addition to inputting the target image into the LLM model, some recognition indication information related to ORC recognition can also be added to the input. For example, in practical applications, a prompt word can be constructed based on the target image and the above recognition indication information, and then the prompt word can be input into the above LLM model.
[0122] In one embodiment shown, the above-mentioned identification indication information may specifically include a position code corresponding to the position information of the text content contained in the target image in the target image, and / or information such as the association relationship between the image content contained in the target image and the text content contained in the target image for describing the image content.
[0123] In this case, when the target image is input into the LLM model and the LLM model performs ORC recognition on the content contained in the target image, the position information of the text content contained in the target image can be obtained, and the position information can be encoded to generate a position code corresponding to the text content. The above-mentioned position information specifically refers to any form of information used to describe the relative position of the text content contained in the target image in the target image; for example, coordinates or other information forms used to describe relative positional relationships. The position code can be specifically used to indicate the relative position of the text content in the target image.
[0124] For example, in one embodiment shown, the position encoding obtained by encoding the above-mentioned position information may specifically be a position encoding vector obtained by encoding the position information; for example, it may be an Embedding vector obtained by Embedding encoding using 1D Position Embedding or 2D Position Embedding.
[0125] Of course, in practical applications, the above position encoding may also be data in other forms other than vectors.
[0126] In addition, it is also possible to identify target text content in the text content contained in the target image that is used to describe the image content contained in the target image, and establish an association relationship between the image content contained in the target image and the target text content contained in the target image that is used to describe the image content.
[0127] For example, in one embodiment shown, semantic alignment processing can be performed on the image content contained in the target image and the text content contained in the target image based on a preset semantic alignment algorithm to establish an association relationship between the image content contained in the target image and the target text content contained in the target image for describing the image content.
[0128] Then, based on the above-mentioned position coding and / or the above-mentioned association relationship, identification indication information corresponding to the above-mentioned target image can be generated, and then the target image and the generated identification indication information can be further input into the above-mentioned LLM model, and the LLM model performs ORC identification on the content contained in the target image based on the above-mentioned identification indication information to obtain a structured text for describing the content contained in the target image.
[0129] It should be noted that the above-mentioned target text content may specifically be text content contained in the target image that semantically matches the image content contained in the target image.
[0130] For example, still taking the above target image as an image corresponding to a medical examination report, the image corresponding to the medical examination report may generally include both images related to the medical examination and text descriptions of the images. These text descriptions generally include some text descriptions of the image content contained in the image, and this part of the text description may be referred to as text content that semantically matches the image content contained in the target image.
[0131] The specific algorithm type of the semantic alignment algorithm is not particularly limited in this specification. For example, in one example, it may be a Q-Form algorithm.
[0132] The following example describes the algorithm logic of the semantic alignment algorithm.
[0133] See also Figure 3 , suppose there is a medical examination report, which contains a pathological slice picture (image information) and related text description (text information), as shown below:
[0134] Image: "Pathological section image showing that tumor cells are arranged in glandular tubules, with necrosis and inflammatory cell infiltration in some areas."
[0135] Text description: "Pathological diagnosis: adenocarcinoma, with local necrosis and inflammatory reaction. Further immunohistochemistry is recommended to clarify the pathological subtype."
[0136] The process of semantic alignment for the medical report can be as follows:
[0137] First, image recognition can be performed on the pathological section images to identify key visual features in the image, such as the glandular arrangement of tumor cells, necrotic areas, inflammatory cell infiltration, etc. Further, text recognition can be performed on the above text description to extract key information in the text, such as keywords such as "adenocarcinoma", "necrosis", "inflammatory response", "immunohistochemistry detection", etc. Finally, the identified image features can be associated one-to-one with the keywords extracted from the above text.
[0138] For example, see Figure 3 , the model learns and understands medical knowledge, and knows that "glandular tubular arrangement" is a typical morphological feature of adenocarcinoma, so it associates the glandular tubular arrangement area in the image with the diagnosis of "adenocarcinoma" in the text. Similarly, after "necrotic area" and "inflammatory cell infiltration" are identified in the image, they can also be matched with the descriptions of "necrosis" and "inflammatory response" in the text, respectively.
[0139] In one embodiment shown, when establishing an association relationship between the image content contained in the above-mentioned target image and the target text content contained in the above-mentioned target image for describing the image content, the target text content contained in the target image for describing the image content contained in the target image can be used as annotation information to perform content annotation on the image content contained in the target image.
[0140] For example, see Figure 3 ,like Figure 3 As shown, in Figure 3 In the image of the medical examination report shown, the keyword "adenocarcinoma" in the text is used as annotation information to annotate the "glandular tubular arrangement area" contained in the image; the keyword "necrosis" in the text is used as annotation information to annotate the "necrotic area" contained in the image; and the keyword "inflammatory response" in the text is used as annotation information to annotate the "necrotic area" contained in the image.
[0141] In this way, the established association relationship can be made more intuitive and easier to understand by the LLM model.
[0142] It should be noted that the above-described process of encoding the above-mentioned position information, identifying the target text content contained in the text content contained in the target image, which is used to describe the image content contained in the target image, and establishing the above-mentioned association relationship, can also be specifically performed by the above-mentioned LLM model.
[0143] See also Figure 4 , Figure 4 Schematic diagram of an LLM model shown above.
[0144] like Figure 4 As shown in the figure, the above LLM model can still adopt the transformer architecture, which can specifically include an encoder layer and a decoder layer. The encoder layer is responsible for encoding the input data into a vector, and the decoder layer is responsible for reasoning about the vector output by the encoder layer.
[0145] It should be emphasized that, in this specification, the encoder layer may include an implemented position encoding component, which may be used to encode the position information of the text content contained in the input image in the image.
[0146] In addition, an intermediate layer is included between the encoder layer and the decoder layer, and the intermediate layer may specifically include an implemented processing component. The processing component may specifically be used to establish an association relationship between image content contained in the image and text content contained in the image for describing the image content.
[0147] For example, see Figure 4 In one example, as mentioned above, a semantic alignment method can be used to establish an association relationship between the image content contained in the target image and the target text content contained in the target image for describing the image content. In this case, the processing component can be a component for semantically aligning the image content contained in the target image and the text content contained in the target image.
[0148] It should be noted that in the transformer architecture, in addition to the encoder layer, decoder layer and intermediate layer listed above, in actual applications, it can also include an input layer, an output layer, etc., which will not be listed one by one in this manual.
[0149] In this specification, after obtaining the above-mentioned structured text, the above-mentioned service framework can further input the structured text into the LLM model, and the LLM model can perform logical reasoning on the structured text based on each reasoning strategy in the above-mentioned optimal reasoning strategy combination, and then generate an answer text corresponding to the target text based on the reasoning results corresponding to the above-mentioned each reasoning strategy.
[0150] In one embodiment shown, logical reasoning can be performed on the structured text based on each reasoning strategy in the above-mentioned optimal reasoning strategy combination, and reasoning results of each reasoning strategy in the above-mentioned optimal reasoning strategy combination can be obtained, and then the reasoning results corresponding to the above-mentioned each reasoning strategy can be fused to generate an answer text corresponding to the target text.
[0151] It should be noted that the specific method of fusing the inference results of each inference strategy in the above-mentioned optimal inference strategy combination is not particularly limited in this specification. In practical applications, the fusion strategy can be flexibly formulated based on actual needs.
[0152] In one embodiment shown, each reasoning strategy included in the above-mentioned reasoning strategy combination can correspond to different strategy weights respectively; when generating an answer text corresponding to the above-mentioned target text based on the reasoning results corresponding to the above-mentioned each reasoning strategy, the reasoning results corresponding to the above-mentioned each reasoning strategy can be fused based on the strategy weights corresponding to the above-mentioned each reasoning strategy to obtain an answer text corresponding to the above-mentioned target text.
[0153] It should be explained that the strategy weights corresponding to the respective reasoning strategies included in the above-mentioned reasoning strategy combination may specifically be weights learned through training during the process of training the above-mentioned decision model.
[0154] For example, as mentioned above, the decision model can specifically describe the combination relationship of reasoning strategies suitable for various inquiry scenarios through an objective function. The combination relationship can be a combination relationship in which the reasoning strategies suitable for various inquiry scenarios are combined in a weighted manner according to the corresponding strategy weights. Then, through learning and training, in addition to determining the optimal values of the parameters in the objective function, the strategy weights corresponding to each reasoning strategy can be determined.
[0155] Of course, in practical applications, the specific method of fusing the inference results of each inference strategy in the above-mentioned optimal inference strategy combination may adopt other fusion methods besides the weighted method described above, which will not be listed one by one in this specification.
[0156] In the above technical scheme, in the process of using the multimodal LLM model to provide users with inquiry services regarding the content contained in the image, a structured interpretation of the content contained in the image is performed based on the LLM model, and in the process of the user inquiring about the content contained in the image, the optimal reasoning strategy combination corresponding to the inquiry scenario is determined from several reasoning strategies contained in the multimodal LLM model based on the user's inquiry scenario, so that the LLM model can more fully understand the content contained in the image and the user's inquiry intention, thereby helping the user to interpret the content contained in the image more accurately and efficiently, and generating inquiry results that are more in line with the user's inquiry intention for the user.
[0157] See also Figure 5 , Figure 5 This is a flowchart of another user service method based on the medical LLM model shown in this specification, including the following execution process:
[0158] Step 502: Acquire a target text input by a user; wherein the target text is a text that inquires about the content contained in the target image;
[0159] Step 504: performing semantic recognition on the target text, determining the user's query scenario based on the semantic recognition result, and determining a reasoning strategy combination corresponding to the user's query scenario from the plurality of reasoning strategies;
[0160] Step 506: Obtain structured text for describing the content contained in the target image obtained by performing ORC recognition on the content contained in the target image by the first LLM model, and input the structured text into the second LLM model, so that the second LLM model can perform logical reasoning on the structured text based on each reasoning strategy in the reasoning strategy combination, and generate an answer text corresponding to the target text based on the reasoning results corresponding to the each reasoning strategy.
[0161] It should be noted that, in this embodiment, two different LLM models can be used to respectively execute the process of performing ORC recognition on the content contained in the target image to obtain the above-mentioned structured text, and the process of performing logical reasoning on the above-mentioned structured text to generate an answer text corresponding to the target text input by the user to inquire about the content contained in the target image.
[0162] The above-mentioned LLM model may specifically include a first LLM model for performing ORC recognition on the content contained in the target image; and a second LLM model for performing logical reasoning on the content contained in the target image to generate an answer text corresponding to the target text input by the user to inquire about the content contained in the target image.
[0163] The first LLM model may still be a multimodal LLM model, while the second LLM model may not be a multimodal LLM model, and the second LLM model may still include several reasoning strategies.
[0164] In addition, the specific implementation process of the first LLM model performing ORC recognition on the content contained in the target image, and the specific implementation process of the second LLM model performing logical reasoning on the content contained in the target image to generate an answer text corresponding to the target text input by the user to inquire about the content contained in the target image, can all be referred to. Figure 1 The embodiment shown will not be described in detail in this embodiment.
[0165] Corresponding to the aforementioned method embodiments, this specification also provides system embodiments.
[0166] See also Figure 6 , Figure 6 The following is an architecture diagram of a user service system based on the medical LLM model shown in this specification, including:
[0167] The ORC recognition subsystem 601 is a subsystem constructed based on a multimodal LLM model, and is used to perform ORC recognition on a target image input into the LLM model to obtain a structured text for describing the content contained in the target image; wherein the LLM model includes several reasoning strategies;
[0168] The decision subsystem 602 is used to perform semantic recognition on the target text input by the user to inquire about the content contained in the target image, determine the user's inquiry scenario based on the semantic recognition result, and determine a reasoning strategy combination corresponding to the user's inquiry scenario from the multiple reasoning strategies;
[0169] The reasoning subsystem 603 is used to input the structured text identified by the ORC recognition subsystem into the LLM model, so that the LLM model can perform logical reasoning on the input structured text based on each reasoning strategy in the reasoning strategy combination determined by the decision subsystem, and generate an answer text corresponding to the target text based on the reasoning results corresponding to each reasoning strategy.
[0170] It should be noted that, in actual applications, two different LLM models can also be used to respectively execute the process of performing ORC recognition on the content contained in the target image to obtain the above-mentioned structured text, and the process of performing logical reasoning on the above-mentioned structured text to generate an answer text corresponding to the target text input by the user to inquire about the content contained in the target image.
[0171] in this case, Figure 6 The ORC recognition subsystem 601 and the reasoning subsystem 603 in the illustrated system architecture may specifically be two subsystems constructed based on different LLM models.
[0172] For example, the ORC recognition subsystem 601 may be a subsystem constructed based on a multimodal first LLM model. The reasoning subsystem 603 may be a subsystem constructed based on a second LLM model. The second LLM model may include several reasoning strategies, and the decision subsystem 602 may be used to perform semantic recognition on a target text input by a user to inquire about the content contained in a target image, determine the user's inquiry scenario based on the semantic recognition result, and determine a reasoning strategy combination corresponding to the user's inquiry scenario from the several reasoning strategies included in the second LLM model.
[0173] Corresponding to the embodiments of the aforementioned method, this specification also provides embodiments of an apparatus, an electronic device, and a storage medium.
[0174] Figure 7is a schematic structural diagram of an electronic device provided by an exemplary embodiment. Figure 7 At the hardware level, the device includes a processor 702, an internal bus 704, a network interface 706, a memory 708, and a non-volatile memory 710, and may also include hardware required for other services. One or more embodiments of this specification may be implemented based on software, such as the processor 702 reading the corresponding computer program from the non-volatile memory 710 into the memory 708 and then running it. Of course, in addition to the software implementation, one or more embodiments of this specification do not exclude other implementations, such as logic devices or a combination of software and hardware, etc., that is, the execution subject of the following processing flow is not limited to each logic unit, but can also be hardware or logic devices.
[0175] like Figure 8 As shown, Figure 8 This is a block diagram of a user service device based on a medical LLM model according to an exemplary embodiment of the present specification. The device can be applied to Figure 7 In the electronic device shown, the technical solution of this specification is implemented. Wherein, the LLM model is a multimodal LLM model; the LLM model includes several reasoning strategies; the device 700 includes:
[0176] The first acquisition module 801 acquires a target text input by a user; wherein the target text is a text that inquires about the content contained in the target image;
[0177] A first decision module 802 performs semantic recognition on the target text, determines the user's query scenario based on the semantic recognition result, and determines a reasoning strategy combination corresponding to the user's query scenario from the multiple reasoning strategies;
[0178] The first generation module 803 obtains a structured text for describing the content contained in the target image obtained by performing ORC recognition on the content contained in the target image by the LLM model, and inputs the structured text into the LLM model, so that the LLM model performs logical reasoning on the structured text based on each reasoning strategy in the reasoning strategy combination, and generates an answer text corresponding to the target text based on the reasoning results corresponding to the each reasoning strategy.
[0179] like Fig. 9 As shown, Fig. 9 is a block diagram of another user service device based on the medical LLM model according to an exemplary embodiment of this specification, and the device can also be applied to Figure 7In the electronic device shown in the figure, the technical solution of this specification is implemented. The LLM model may include a first LLM model for performing ORC recognition on the content contained in the target image; and a second LLM model for performing logical reasoning on the content contained in the target image to generate an answer text corresponding to the target text input by the user to inquire about the content contained in the target image; wherein the first LLM model is a multimodal LLM model; the second LLM model includes several reasoning strategies; the device 900 includes:
[0180] The second acquisition module 901 acquires a target text input by a user; wherein the target text is a text that inquires about the content contained in the target image;
[0181] The second decision module 902 performs semantic recognition on the target text, determines the user's query scenario based on the semantic recognition result, and determines a reasoning strategy combination corresponding to the user's query scenario from the multiple reasoning strategies;
[0182] The second generation module 903 obtains a structured text for describing the content contained in the target image obtained by performing ORC recognition on the content contained in the target image by the first LLM model, and inputs the structured text into the second LLM model, so that the second LLM model performs logical reasoning on the structured text based on each reasoning strategy in the reasoning strategy combination, and generates an answer text corresponding to the target text based on the reasoning results corresponding to the each reasoning strategy.
[0183] Accordingly, the present specification also provides an electronic device, which includes a processor; a memory for storing instructions executable by the processor; wherein the processor is configured to implement the steps in all the method flows described above.
[0184] Accordingly, the present specification also provides a computer-readable storage medium on which executable computer program instructions are stored; wherein, when the instructions are executed by a processor, the steps in all the method flows described above are implemented.
[0185] Accordingly, the present specification also provides a computer program product having executable computer program instructions stored thereon; wherein, when the computer program instructions are executed by a processor, the steps in all the method flows described above are implemented.
[0186] In the 1990s, it was very clear whether the improvement of a technology was hardware improvement (for example, improvement of the circuit structure of diodes, transistors, switches, etc.) or software improvement (improvement of the method flow). However, with the development of technology, many improvements of the method flow today can be regarded as direct improvements of the hardware circuit structure. Designers almost always obtain the corresponding hardware circuit structure by programming the improved method flow into the hardware circuit. Therefore, it cannot be said that the improvement of a method flow cannot be implemented with hardware entity modules. For example, a programmable logic device (PLD) (such as a field programmable gate array (FPGA)) is such an integrated circuit whose logical function is determined by the user's programming of the device. Designers can "integrate" a digital system on a PLD by programming it themselves, without having to ask chip manufacturers to design and make dedicated integrated circuit chips. Moreover, nowadays, instead of manually making integrated circuit chips, this kind of programming is mostly implemented by "logic compiler" software, which is similar to the software compiler used when developing and writing programs, and the original code before compilation must also be written in a specific programming language, which is called hardware description language (HDL). There is not only one kind of HDL, but many kinds, such as ABEL (Advanced Boolean Expression Language), AHDL (Altera Hardware Description Language), Confluence, CUPL (Cornell University Programming Language), HDCal, JHDL (Java Hardware Description Language), Lava, Lola, MyHDL, PALASM, RHDL (Ruby Hardware Description Language), etc. The most commonly used ones are VHDL (Very-High-Speed Integrated Circuit Hardware Description Language) and Verilog. Those skilled in the art should also know that it is only necessary to program the method flow slightly in the above-mentioned hardware description languages and program it into the integrated circuit, and then it is easy to obtain the hardware circuit that implements the logic method flow.
[0187] The controller may be implemented in any suitable manner, for example, the controller may take the form of a microprocessor or processor and a computer-readable medium storing a computer-readable program code (e.g., software or firmware) executable by the (micro)processor, a logic gate, a switch, an application-specific integrated circuit (ASIC), a programmable logic controller, and an embedded microcontroller. Examples of controllers include, but are not limited to, the following microcontrollers: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicone Labs C2051F320. The memory controller may also be implemented as part of the control logic of the memory. It is also known to those skilled in the art that, in addition to implementing the controller in a purely computer-readable program code manner, the controller may be implemented in the form of a logic gate, a switch, an application-specific integrated circuit, a programmable logic controller, and an embedded microcontroller by logically programming the method steps. Therefore, such a controller may be considered as a hardware component, and the devices included therein for implementing various functions may also be considered as structures within the hardware component. Or even, the devices for implementing various functions may be considered as both software modules for implementing the method and structures within the hardware component.
[0188] The systems, devices, modules or units described in the above embodiments may be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a server system. Of course, it is not excluded that with the development of computer technology in the future, the computer that implements the functions of the above embodiments may be, for example, a personal computer, a laptop computer, a vehicle-mounted human-computer interaction device, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
[0189] Although one or more embodiments of the present specification provide method operation steps as described in the embodiments or flow charts, more or fewer operation steps may be included based on conventional or non-creative means. The order of steps listed in the embodiments is only one way of executing the order of many steps, and does not represent the only execution order. When the device or terminal product in practice is executed, it can be executed in sequence or in parallel according to the method shown in the embodiments or the drawings (for example, a parallel processor or a multi-threaded processing environment, or even a distributed data processing environment). The terms "include", "include" or any other variants thereof are intended to cover non-exclusive inclusion, so that the process, method, product or device including a series of elements includes not only those elements, but also other elements that are not explicitly listed, or also includes elements inherent to such a process, method, product or device. In the absence of more restrictions, it is not excluded that there are other identical or equivalent elements in the process, method, product or device including the elements. For example, if the words first, second, etc. are used to represent the name, they do not represent any specific order.
[0190] For the convenience of description, the above devices are described in various modules according to their functions. Of course, when implementing one or more of the present specification, the functions of each module can be implemented in the same or more software and / or hardware, or the module implementing the same function can be implemented by a combination of multiple sub-modules or sub-units, etc. The device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0191] The present invention is described with reference to flowcharts and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0192] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0193] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process in the computer or other programmable device. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0194] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0195] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0196] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage, graphene storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0197] It should be understood by those skilled in the art that one or more embodiments of the present specification may be provided as a method, system or computer program product. Therefore, one or more embodiments of the present specification may take the form of a complete hardware embodiment, a complete software embodiment or an embodiment combining software and hardware. Moreover, one or more embodiments of the present specification may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0198] One or more embodiments of this specification may be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. One or more embodiments of this specification may also be practiced in distributed computing environments where tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules may be located in local and remote computer storage media, including storage devices.
[0199] Each embodiment in this specification is described in a progressive manner, and the same and similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment. In the description of this specification, the description of the reference terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of this specification. In this specification, the schematic representation of the above terms does not necessarily target the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art can combine and combine the different embodiments or examples described in this specification and the features of different embodiments or examples without contradiction.
[0200] The above description is only an example of one or more embodiments of this specification and is not intended to limit one or more embodiments of this specification. For those skilled in the art, one or more embodiments of this specification may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of this specification shall be included in the scope of the claims.
Claims
1. A user service method based on the medical LLM model, wherein: The LLM model is a multimodal LLM model; the LLM model includes several reasoning strategies; the LLM model is connected to a pre-trained decision model; the decision model is used to determine the best reasoning strategy combination corresponding to the user's inquiry scenario from the several reasoning strategies included in the LLM model based on the user's inquiry scenario; each reasoning strategy included in the reasoning strategy combination corresponds to a different strategy weight; The method comprises: Acquire a target text input by a user; wherein the target text is a text that inquires about the content contained in the target image; Performing semantic recognition on the target text, determining the user's inquiry scenario based on the semantic recognition result, and inputting the inquiry scenario into the decision model, so that the decision model determines a reasoning strategy combination for performing logical reasoning on the content contained in the target image from the plurality of reasoning strategies based on the inquiry scenario, and returns the reasoning strategy combination to the LLM model; A structured text for describing the content contained in the target image is obtained by performing ORC recognition on the content contained in the target image by the LLM model, and the structured text is input into the LLM model, so that the LLM model performs logical reasoning on the structured text based on each reasoning strategy in the reasoning strategy combination, and fuses the reasoning results corresponding to each reasoning strategy based on the strategy weights corresponding to each reasoning strategy, so as to obtain an answer text corresponding to the target text.
2. The method according to claim 1, wherein the LLM model performs ORC recognition on the content contained in the target image to obtain structured text for describing the content contained in the target image, comprising: Inputting the target image corresponding to the target text into the LLM model, so that the LLM model performs offline ORC recognition on the content contained in the target image to obtain a structured text for describing the content contained in the target image; or, The target image corresponding to the target text is input into the LLM model, so that the LLM model performs online ORC recognition on the content contained in the target image to obtain a structured text for describing the content contained in the target image.
3. The method according to claim 2, wherein the target image is input into the LLM model so that the LLM model performs ORC recognition on the content contained in the target image to obtain a structured text for describing the content contained in the target image, comprising: Acquire position information of text content contained in the target image in the target image, and encode the position information to generate a position code corresponding to the text content; wherein the position code is used to indicate the relative position of the text content in the target image; Identifying target text content used to describe image content contained in the target image in the text content contained in the target image, and establishing an association relationship between the image content contained in the target image and the target text content used to describe the image content contained in the target image; Generate identification indication information corresponding to the target image based on the position code and / or the association relationship; The target image and the recognition indication information are input into the LLM model, so that the LLM model performs ORC recognition on the content contained in the target image based on the recognition indication information to obtain a structured text for describing the content contained in the target image.
4. The method according to claim 3, wherein the LLM comprises a component for performing semantic alignment processing on the image content contained in the target image and the text content contained in the target image; Identifying target text content in the text content contained in the target image, which is used to describe the image content contained in the target image, and establishing an association relationship between the image content contained in the target image and the target text content contained in the target image, which is used to describe the image content, includes: Based on a preset semantic alignment algorithm, semantic alignment processing is performed on the image content contained in the target image and the text content contained in the target image to establish an association relationship between the image content contained in the target image and the target text content contained in the target image for describing the image content.
5. The method according to claim 4, establishing an association relationship between the image content contained in the target image and the target text content contained in the target image for describing the image content, comprises: The target text content contained in the target image and used to describe the image content contained in the target image is used as annotation information to perform content annotation on the image content contained in the target image.
6. The method according to claim 1, performing semantic recognition on the target text, and determining the user's query scenario based on the semantic recognition result, comprises: The target text is input into the LLM model so that the LLM model performs semantic recognition on the target text, and the user's inquiry scenario is determined based on the semantic recognition result.
7. According to the method described in claim 1, the decision model is a reinforcement learning model obtained by performing reinforcement learning training by determining a reasoning strategy combination corresponding to the user's inquiry scenario from the several reasoning strategies as an action of reinforcement learning, and using effect data used to represent the reasoning effect of logical reasoning based on the reasoning strategy combination as the state of reinforcement learning.
8. According to the method of claim 1, the several reasoning strategies included in the LLM model are dynamically updated reasoning strategies.
9. According to the method as claimed in claim 1, the LLM model is an LLM service model obtained by fine-tuning the pre-trained LLM basic model based on data related to the target application scenario; and the target image is an image related to the target application scenario.
10. According to the method of claim 9, the target application scenario is a medical inquiry scenario, the target image includes a medical image; the LLM model is an LLM medical service model obtained by fine-tuning a pre-trained LLM basic model based on a number of medical documents and / or medical images; the target text is a medical inquiry text for medical inquiry on the content contained in the medical image; the structured text is structured medical content extracted from the medical image; and the answer text is a medical inquiry answer text corresponding to the medical inquiry text.
11. According to the method of claim 10, the medical image is an image corresponding to a medical examination report; the structured medical content includes triple information consisting of a medical part entity contained in the medical image, an attribute corresponding to the medical part entity, and an examination result corresponding to the medical part entity.
12. A user service method based on a medical LLM model, the LLM model comprising a first LLM model for performing ORC recognition on the content contained in a target image; and a second LLM model for performing logical reasoning on the content contained in the target image to generate an answer text corresponding to a target text input by a user to inquire about the content contained in the target image; wherein, The first LLM model is a multimodal LLM model; the second LLM model includes several reasoning strategies; the LLM model is connected to a pre-trained decision model; the decision model is used to determine the best reasoning strategy combination corresponding to the user's inquiry scenario from the several reasoning strategies included in the LLM model based on the user's inquiry scenario; each reasoning strategy included in the reasoning strategy combination corresponds to a different strategy weight; The method comprises: Acquire a target text input by a user; wherein the target text is a text that inquires about the content contained in the target image; Performing semantic recognition on the target text, determining the user's inquiry scenario based on the semantic recognition result, and inputting the inquiry scenario into the decision model, so that the decision model determines a reasoning strategy combination for performing logical reasoning on the content contained in the target image from the plurality of reasoning strategies based on the inquiry scenario, and returns the reasoning strategy combination to the LLM model; Obtain structured text for describing the content contained in the target image obtained by performing ORC recognition on the content contained in the target image by the first LLM model, and input the structured text into the second LLM model, so that the second LLM model can perform logical reasoning on the structured text based on each reasoning strategy in the reasoning strategy combination, and fuse the reasoning results corresponding to each reasoning strategy based on the strategy weights corresponding to each reasoning strategy, so as to obtain an answer text corresponding to the target text.
13. A user service system based on a medical LLM model, the system comprising: An ORC recognition subsystem is a subsystem constructed based on a multimodal LLM model, and is used to perform ORC recognition on a target image input into the LLM model to obtain a structured text for describing the content contained in the target image; wherein the LLM model includes several reasoning strategies; the LLM model is connected to a pre-trained decision model; the decision model is used to determine the best reasoning strategy combination corresponding to the user's inquiry scenario from the several reasoning strategies included in the LLM model based on the user's inquiry scenario; each reasoning strategy included in the reasoning strategy combination corresponds to a different strategy weight; A decision subsystem, configured to perform semantic recognition on a target text input by a user to inquire about the content contained in a target image, determine the user's inquiry scenario based on the semantic recognition result, and input the inquiry scenario into the decision model, so that the decision model determines a reasoning strategy combination for performing logical reasoning on the content contained in the target image from the plurality of reasoning strategies based on the inquiry scenario, and return the reasoning strategy combination to the LLM model; The reasoning subsystem is used to input the structured text identified by the ORC recognition subsystem into the LLM model, so that the LLM model can perform logical reasoning on the structured text input based on each reasoning strategy in the reasoning strategy combination determined by the decision subsystem, and fuse the reasoning results corresponding to each reasoning strategy based on the strategy weights corresponding to each reasoning strategy to obtain an answer text corresponding to the target text.
14. A user service system based on a medical LLM model, the system comprising: An ORC recognition subsystem, the ORC recognition subsystem is a subsystem constructed based on a multimodal first LLM model, and is used to perform ORC recognition on a target image input into the LLM model to obtain a structured text for describing the content contained in the target image; wherein the LLM model includes several reasoning strategies; the LLM model is connected to a pre-trained decision model; the decision model is used to determine the best reasoning strategy combination corresponding to the user's inquiry scenario from the several reasoning strategies included in the LLM model based on the user's inquiry scenario; each reasoning strategy included in the reasoning strategy combination corresponds to a different strategy weight; A decision subsystem, configured to perform semantic recognition on a target text input by a user to inquire about the content contained in a target image, determine the user's inquiry scenario based on the semantic recognition result, and input the inquiry scenario into the decision model, so that the decision model determines a reasoning strategy combination for performing logical reasoning on the content contained in the target image from the plurality of reasoning strategies based on the inquiry scenario, and return the reasoning strategy combination to the LLM model; The reasoning subsystem is a subsystem constructed based on the second LLM model, and is used for inputting the structured text identified by the ORC recognition subsystem into the second LLM model, so that the second LLM model, based on each reasoning strategy in the reasoning strategy combination determined by the decision subsystem, respectively performs logical reasoning on the input structured text, and based on the strategy weights corresponding to each reasoning strategy, fuses the reasoning results corresponding to each reasoning strategy to obtain an answer text corresponding to the target text.
15. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 12 are implemented.
16. A computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the steps of the method according to any one of claims 1 to 12.
17. A computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 12 are implemented.
