Information query method and device, electronic equipment and computer readable storage medium

By binding trigger words and images to a large language model and outputting images under certain conditions, the problem of low matching between the output images and query questions in the large language model is solved, thus improving user experience and content coherence.

CN123178665APending Publication Date: 2026-11-27QINDAO HAIER REFRIGERATOR CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510830484.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-19
Publication Date
2026-11-27

AI Technical Summary

Technical Problem

When large language models output images, the matching degree between the images and the query questions is not high, resulting in a poor user experience. In addition, the parsing of image formats in existing technologies is prone to problems.

Method used

By binding trigger words and images to a set of knowledge entries, matching already answered information, and outputting images and lexical information only when the target condition is met, the system uses trigger words to accurately describe the bound images and combines similarity and edit distance algorithms to filter candidate images.

Benefits of technology

It improves the matching degree between output images and query questions, enhances the user experience, ensures the stickiness and relevance of images and text content, and makes the interaction process more vivid, rich and intuitive.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123178665A_ABST
    Figure CN123178665A_ABST
Patent Text Reader

Abstract

The application discloses an information query method and device, electronic equipment and computer readable storage medium, and belongs to the field of artificial intelligence. The method comprises the following steps: after inputting a query question input by a user and a retrieved knowledge entry set into a target large language model, obtaining and splicing word element information returned by the target large language model in the current round and answered information in the last round to obtain answered information in the current round; in the case that it is determined that the knowledge entry set has a first picture that has not been output, the first picture is bound to at least one trigger word, the trigger word is used to describe the bound picture, and the trigger word of each first picture and the answered information in the current round are matched; in the case that it is determined that there is a first target picture in each first picture, the matching result of the trigger word of the first target picture and the answered information in the current round satisfies a target condition, and the word element information in the current round and the first target picture are output, thereby greatly improving the matching degree between the output picture and the query question.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the field of artificial intelligence, and in particular relates to an information retrieval method, apparatus, electronic device, and computer-readable storage medium. Background Technology

[0002] Large language models can output answer information for user-input queries. To increase the density of the answer information, large language models sometimes also add images to the output answer information.

[0003] Some large language models retrieve the most relevant knowledge entries from the knowledge base based on the user's input query. Then, the large language model summarizes and generates the final answer information based on the query and these knowledge entries. The output image is usually an image of the knowledge entry directly referenced in the final answer information, which can easily lead to a problem where the output image does not match the query question well. Summary of the Invention

[0004] This application aims to address at least one of the technical problems existing in related technologies. To this end, this application proposes an information retrieval method, apparatus, electronic device, and computer-readable storage medium, which significantly improves the matching degree between the output image and the query question.

[0005] Firstly, this application provides an information retrieval method, which includes:

[0006] After inputting the user's query and the retrieved knowledge item set into the target large language model, the lexical information returned by the target large language model in this round is obtained and concatenated with the answered information from the previous round to obtain the answered information for this round; the knowledge item set is a collection of knowledge items retrieved from the knowledge base based on the query and used to generate the answer information for the query.

[0007] If it is determined that there is a first image that has not been output in the knowledge item set, the first image is bound to at least one trigger word. The trigger word is used to describe the bound image. The trigger words of each first image are matched with the answered information of this round.

[0008] If it is determined that a first target image exists in each first image, and the matching result of the trigger word of the first target image with the already answered information in this round satisfies the target condition, the word information and the first target image of this round are output.

[0009] According to the information query method of this application, when it is determined that there is a first image that has not been output in the knowledge item set, the first image is bound to at least one trigger word. The trigger words of each first image are matched with the answered information of the current round. When it is determined that there is a first target image in each first image, the matching result of the trigger word of the first target image and the answered information of the current round meets the target condition. The lexical information and the first target image of the current round are output. Since the trigger word can accurately describe the bound image, the first target image whose matching result of the trigger word and the answered information of the current round meets the target condition is output, which greatly improves the matching degree between the output image and the query question.

[0010] Furthermore, by matching the trigger words of each first image with the already answered information of this round, and outputting the lexical information and the first target image of this round when the target conditions are met, the stickiness and relevance between the output image and the lexical information and already answered information of this round can be improved, making the entire interactive process more vivid, rich and intuitive, maintaining user attention, accelerating the user understanding process, and enhancing the user experience.

[0011] According to one embodiment of this application, in the last round of the target large language model, if it is determined that no first target image has been output in any historical round and there are candidate knowledge entries with a second image in the knowledge entry set, candidate knowledge entries are selected from the knowledge entry set; the second image is not bound to any trigger word;

[0012] If the target knowledge item is determined from the candidate knowledge items, a second image of the target knowledge item is output; the first indicator between the target knowledge item and the query question satisfies the first target indicator, and / or the second indicator between the target knowledge item and the answered information in the last round satisfies the second target indicator.

[0013] According to one embodiment of this application, the first indicator includes a first similarity; when the first indicator is the first similarity, the first target indicator is the first target similarity; the knowledge entry includes an index vector and answer description information; the index vector is the vector corresponding to the question information in the answer description information or the vector corresponding to the keywords in the answer description information;

[0014] The target knowledge item is determined from the candidate knowledge items, including:

[0015] Determine the first similarity between the query vector corresponding to the query question and the index vector of each candidate knowledge item;

[0016] If a first candidate similarity exists among the first similarities, and the first candidate similarity is less than the first target similarity, then the candidate knowledge item corresponding to the first candidate similarity is determined as the target knowledge item.

[0017] According to one embodiment of this application, the second indicator includes relative editing distance; when the second indicator is relative editing distance, the second target indicator is the target relative editing distance;

[0018] The target knowledge item is determined from the candidate knowledge items, including:

[0019] In the absence of a first candidate similarity for each first similarity, the edit distance between the answer description information of each candidate knowledge item and the answered information of the last round is determined based on the edit distance algorithm;

[0020] The relative edit distance between the answer description information of each candidate knowledge item and the answer information of the last round is determined based on each edit distance and the length of the answered information in the last round;

[0021] If a first relative edit distance exists among the relative edit distances, and the first relative edit distance is less than the target relative edit distance, then the candidate knowledge entry corresponding to the first relative edit distance is determined as the target knowledge entry.

[0022] According to one embodiment of this application, the second indicator further includes a second similarity; when the second indicator is the second similarity, the second target indicator is the second target similarity;

[0023] The target knowledge item is determined from the candidate knowledge items, including:

[0024] In the absence of a first relative edit distance among the relative edit distances, determine the second similarity between the answer description information of each candidate knowledge item and the answered information of the last round;

[0025] If a second candidate similarity exists among the second similarities, and the second candidate similarity is less than the second target similarity, then the candidate knowledge item corresponding to the second candidate similarity is determined as the target knowledge item.

[0026] According to one embodiment of this application, inputting the user-inputted query question and the retrieved set of knowledge entries into the target large language model further includes:

[0027] Generate query vectors corresponding to the query question;

[0028] Based on the query vector, a set of knowledge entries is retrieved from the knowledge base; the similarity between the query vector and the index vectors of each knowledge entry in the knowledge entry set is higher than the preset similarity; the preset similarity is not greater than the first target similarity.

[0029] According to one embodiment of this application, after matching the trigger words of each first image with the lexical information returned in the current round, the method further includes:

[0030] If it is determined that the first target image does not exist in any of the first images, output the word information for this round.

[0031] Secondly, this application provides an information query device, which includes:

[0032] The acquisition module is used to acquire and concatenate the lexical information returned by the target large language model in this round with the answered information in the previous round after inputting the user's query question and the retrieved knowledge item set into the target large language model, so as to obtain the answered information in this round; the knowledge item set is a set of knowledge items retrieved from the knowledge base based on the query question and used to generate the answer information of the query question;

[0033] The first processing module is used to bind the first image to at least one trigger word when it is determined that there is a first image that has not been output in the knowledge item set. The trigger word is used to describe the bound image, and the trigger word of each first image is matched with the answered information of the current round.

[0034] The second processing module is used to output the lexical information and the first target image of the current round when it is determined that the first target image exists in each first image, the matching result of the trigger word of the first target image and the already answered information in the current round meets the target condition.

[0035] According to the information query device of this application, when it is determined that there is a first image that has not been output in the knowledge item set, the first image is bound to at least one trigger word, and the trigger words of each first image are matched with the answered information of the current round. When it is determined that there is a first target image in each first image, the matching result of the trigger word of the first target image and the answered information of the current round satisfies the target condition, and the lexical information and the first target image of the current round are output. Since the trigger word can accurately describe the bound image, the first target image whose matching result of the trigger word and the answered information of the current round satisfies the target condition is output, which greatly improves the matching degree between the output image and the query question.

[0036] Furthermore, by matching the trigger words of each first image with the already answered information of this round, and outputting the lexical information and the first target image of this round when the target conditions are met, the stickiness and relevance between the output image and the lexical information and already answered information of this round can be improved, making the entire interactive process more vivid, rich and intuitive, maintaining user attention, accelerating the user understanding process, and enhancing the user experience.

[0037] Thirdly, this application provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the information query method provided in the first aspect above.

[0038] Fourthly, this application provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the information query method provided in the first aspect above.

[0039] Fifthly, this application provides a chip including a processor and a communication interface coupled to the processor, the processor being used to run programs or instructions to implement the information query method provided in the first aspect.

[0040] Sixthly, this application provides a computer program product, including a computer program that, when executed by a processor, implements the information query method provided in the first aspect above.

[0041] The above-described one or more technical solutions in the embodiments of this application have at least one of the following technical effects:

[0042] If a first image is found to exist in the knowledge entry set but not yet output, it is bound to at least one trigger word. The trigger words of each first image are matched with the answered information of the current round. If a first target image is found in each first image, and the matching result of the trigger word of the first target image with the answered information of the current round satisfies the target condition, the lexical information and the first target image of the current round are output. Since the trigger word can accurately describe the bound image, the first target image whose matching result of the trigger word with the answered information of the current round satisfies the target condition is output, which greatly improves the matching degree between the output image and the query question.

[0043] Furthermore, by matching the trigger words of each first image with the already answered information of this round, and outputting the lexical information and the first target image of this round when the target conditions are met, the stickiness and relevance between the output image and the lexical information and already answered information of this round can be improved, making the entire interactive process more vivid, rich and intuitive, maintaining user attention, accelerating the user understanding process, and enhancing the user experience.

[0044] Additional aspects and advantages of this application will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of this application. Attached Figure Description

[0045] The above and / or additional aspects and advantages of this application will become apparent and readily understood from the description of the embodiments taken in conjunction with the following drawings, in which:

[0046] Figure 1 This is one of the flowcharts illustrating the information query method provided in the embodiments of this application;

[0047] Figure 2 This is a second schematic flowchart of the information query method provided in the embodiments of this application;

[0048] Figure 3 This is a schematic diagram of the structure of the information query device provided in the embodiments of this application;

[0049] Figure 4 This is a schematic diagram of the structure of the electronic device provided in the embodiments of this application. Detailed Implementation

[0050] The technical solutions of the embodiments of this application will be clearly described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this application. All other embodiments obtained by those skilled in the art based on the embodiments of this application are within the scope of protection of this application.

[0051] The terms "first," "second," etc., used in the specification and claims of this application are used to distinguish similar objects and not to describe a specific order or sequence. It should be understood that such use of data can be interchanged where appropriate so that embodiments of this application can be implemented in orders other than those illustrated or described herein, and the objects distinguished by "first," "second," etc., are generally of the same class and the number of objects is not limited; for example, a first object can be one or more. Furthermore, in the specification and claims, "and / or" indicates at least one of the connected objects, and the character " / " generally indicates that the preceding and following objects are in an "or" relationship.

[0052] Some large language models, such as the RAG (Retrieval-Augmented Generation) system, work on the principle of finding the most relevant knowledge entries to the user's query from the knowledge base. These knowledge entries form a knowledge entry set, and the large model then summarizes and generates the answer information based on the query and the knowledge entry set.

[0053] Most RAG systems primarily output text-based responses. However, in real-world applications, it is sometimes necessary to add corresponding images to the model's output responses to increase information density.

[0054] For example, in the scenario of using a refrigerator voice assistant, the user's query might be "Where should XX food be placed in the refrigerator?", such as "Where should salmon be placed?" The RAG system of the relevant technology will output a response message similar to the following text format and read the response message aloud via voice.

[0055] For example, the output response message is: "For short-term storage, it is recommended to store salmon in a magnetically controlled cold storage compartment, and when storing it, it is recommended to set it to the seafood setting. It is recommended to consume it within 7 days. For long-term storage, it is recommended to store it in a magnetically controlled frozen storage compartment and consume it within 60 days."

[0056] However, for refrigerators with screens, in order to improve the user experience, we hope to display some pictures in addition to voice broadcast. For the above query question, we hope to display a simple outline of the refrigerator on the refrigerator screen, and specifically mark the location of the two refrigerator compartments mentioned in the answer, namely "magnetic control cold fresh compartment" and "magnetic control frozen fresh compartment".

[0057] However, it is not easy for the RAG system to achieve this, because its answer is summarized from several knowledge items, which may not be related to any of them. If there are different image information in these knowledge items, it is difficult to determine which one is the most appropriate using general methods. Randomly selecting or selecting images from referenced knowledge items can easily lead to problems where the output image does not match the query question well.

[0058] For example, in an intelligent question-answering scenario, when a user searches for "donkey's living habits," since "donkey" and "horse" are closely related species, the large language model might reference knowledge entries about "horse's living habits" when outputting "donkey's living habits." In this case, if the output directly references the images included in the knowledge entries about "horse's living habits" (usually "horse pictures"), the output images (horse pictures) will not correspond to the query question, leading to a poor user experience.

[0059] Furthermore, when outputting images, these technologies typically embed the image name, path, or URL into the text. The system then retrieves the image based on this information and displays it on the screen. The embedding method often references formats such as natural language text, Markdown, or XML, which can easily lead to incomplete formatting issues (especially when using specific formats like Markdown or XML, incomplete formatting can cause image parsing failures).

[0060] To address at least one of the aforementioned technical problems, embodiments of this application provide an information query method, apparatus, electronic device, and computer-readable storage medium.

[0061] The information query method, information query device, electronic device, and readable storage medium provided in this application will be described in detail below with reference to the accompanying drawings and through specific embodiments and application scenarios.

[0062] The information retrieval method can be applied to a terminal, specifically executed by the terminal's hardware or software. This terminal can be a mobile phone, computer, tablet, or even a refrigeration device, such as a smart refrigerator with a display screen capable of outputting images.

[0063] The information query method provided in this application embodiment can be executed by an electronic device or a functional module or entity in an electronic device that can implement the information query method. The electronic devices mentioned in this application embodiment include, but are not limited to, mobile phones, tablets, computers, cameras, and wearable devices. The information query method provided in this application embodiment is described below using an electronic device as the execution subject.

[0064] The information query method provided in this application can be applied to fields such as Natural Language Processing (NLP) and Natural Language Understanding (NLU) in practical applications, and can be deployed in terminals or in-terminal dialogue systems, intelligent question answering systems, and voice assistants.

[0065] like Figure 1 As shown, the information query method includes steps 110, 120 and 130.

[0066] Step 110: After inputting the user-inputted query question and the retrieved knowledge item set into the target large language model, obtain and concatenate the lexical information returned by the target large language model in this round with the answered information in the previous round to obtain the answered information in this round; the knowledge item set is a set of knowledge items retrieved from the knowledge base based on the query question and used to generate the answer information for the query question.

[0067] A query question refers to the question a user intends to ask. Users can input their query questions in at least one of the following ways:

[0068] Firstly, the query can be performed via touch, including but not limited to click, swipe, and press.

[0069] In this embodiment, receiving the query input from the user can be achieved by receiving the user's touch operation on the display area of ​​the terminal screen.

[0070] Secondly, questions can be entered using physical buttons.

[0071] In this embodiment, the terminal is equipped with physical buttons to receive user queries. This can be done by receiving the user's operation of pressing the corresponding physical button; or by simultaneously pressing multiple physical buttons.

[0072] Thirdly, questions can also be answered via voice input.

[0073] In this implementation, the terminal can trigger a query display interface when it receives a voice message such as "Where should the salmon be placed?"

[0074] Of course, in other embodiments, the query question may also take other forms, including but not limited to character input, etc., which can be determined according to actual needs, and this application embodiment does not limit it.

[0075] The target large language model can be a generative large language model capable of intelligent question answering. It is a trained model, such as Qwen2.5, ChatGLM, Deepseek-V3, etc. It is the core module of the Retrieval-Augmented Generation (RAG) system and is responsible for generating answers.

[0076] The knowledge base in this application is used to store a massive number of knowledge entries. A knowledge entry refers to an individual knowledge unit stored in the knowledge base. These units typically contain information related to a specific topic and can be used by the model to generate more accurate and richer answers. An entry can be a paragraph, a fact, a phrase, or a larger block of text. These entries are extracted by the model through a retrieval process when processing a request.

[0077] Knowledge entries are typically built around a specific theme or field, such as food, medicine, history, or technology. When a user asks a question, the RAG system retrieves relevant entries from the knowledge base based on the input query, thus helping to generate an answer.

[0078] In the refrigerator field, this knowledge base is used to store relevant knowledge about refrigerators, such as "knowledge about refrigerator door installation", "models available in refrigerators", and "suggested storage locations for various foods in the refrigerator".

[0079] The knowledge base of this application embodiment may include three types of knowledge entries.

[0080] The first type of knowledge entry is a knowledge entry that does not include an image. For example:

[0081]

[0082] Among them, "documents" is the part that needs to be vectorized, which is the basis for retrieval. The vector obtained after vectorization is called the index vector. The content corresponding to "documents" is usually the question information of the answer description information. In some schemes, it can also be the keywords of the answer description information.

[0083] The “metadatas” section is related to “documents”. The data body in this section is not the basis for retrieval. It mainly records information such as answer descriptions and images corresponding to the questions.

[0084] The second type of knowledge entry is one that includes a first image. This first image is bound to at least one trigger word, which describes the bound image. When there are multiple trigger words, they can represent the same or similar meanings. For example, the trigger words for an image might include "tomato" and "tomato". For instance:

[0085]

[0086]

[0087] The "documents", "metadatas", and "answer" fields are the same as in the previous examples and will not be repeated here. In addition, "images" indicates that the knowledge entry is accompanied by images, "name" indicates the name of the image, and "images" contains a "triggers" field, indicating that the knowledge entry has trigger words, that is, the image is the first image with trigger words.

[0088] The third type of knowledge entry is one that has a second image, which is not bound to any trigger word. For example:

[0089]

[0090] The "documents", "metadatas", and "answer" fields are the same as in the previous examples and will not be repeated here. In addition, "images" indicates that the knowledge entry is accompanied by images, "name" indicates the name of the images, and the absence of the "triggers" field in "images" indicates that the knowledge entry does not have trigger words, that is, the image is a second image without trigger words.

[0091] This target large language model can summarize the answer information for a query based on the user's input query and the set of knowledge entries retrieved from the knowledge base. This answer information includes at least text content, and may also include images and other content.

[0092] In this application embodiment, the process of the target large language model returning (or outputting) answer information is a process of streaming lexical information (token). Streaming means that the interface of the target large language model usually returns data one token at a time (note that the token may not necessarily conform to the NLP word segmentation standard). Lexical information token refers to a segment of language units after word segmentation, which can be one or more words, one or more characters, one or more subwords, or one or more symbols.

[0093] Instead of concatenating all tokens to obtain the complete answer information and then returning the complete answer information, each round outputs a single token. When playing the answer information based on voice, the returned token can be read out while new tokens are received, which can reduce the user's waiting time.

[0094] For example, the tokens obtained in each round are as follows (note that the following are presented in chronological order):

[0095] {“token”:“salmon”},

[0096] {“token”:“short-term advice”},

[0097] {“token”:“stored in”},

[0098] {"token":"magnetic control"},

[0099] {“token”:“chilled fresh”},

[0100] {“token”:“cabin, storage”},

[0101] {“token”:“time”},

[0102] {“token”:“Suggested to be adjusted},

[0103] {“token”:“Seafood Stall”},

[0104] {“token”:“bit, suggestion},

[0105] {“token”:“7”},

[0106] {“token”:“to be consumed within one day”},

[0107] {“token”:“;long-term”},

[0108] {“token”:“Recommended storage},

[0109] {“token”:“in magnet”},

[0110] {"token":"freeze control"},

[0111] {“token”:“fresh cabin”},

[0112] {“token”:“,suggestion”},

[0113] {“token”:“60},

[0114] {“token”:“to be consumed within one day”},

[0115] {“token”:“.”},

[0116] By accumulating and concatenating the tokens returned in each round, we can obtain the full answer information for each round. In other words, we can concatenate the lexical information returned in the current round with the full answer information from the previous round to obtain the answer information for the current round.

[0117] Continuing with the above embodiments, the answered information obtained in each round is as follows:

[0118] {"fullAnswer":"salmon"}

[0119] {"fullAnswer":"Short-term recommendation for salmon"}

[0120] {"fullAnswer":"Short-term storage of salmon is recommended in "}"

[0121] {"fullAnswer":"Short-term storage of salmon is recommended on a magnetic refrigeration unit"}

[0122] {"fullAnswer":"Short-term storage of salmon is recommended in magnetically controlled refrigerated containers"}

[0123] {"fullAnswer":"For short-term storage, salmon is recommended to be kept in a magnetically controlled refrigerated compartment."}

[0124] {"fullAnswer":"For short-term storage, salmon is recommended to be kept in a magnetically controlled refrigerated compartment."}

[0125] {"fullAnswer":"For short-term storage, salmon is recommended to be kept in a magnetically controlled refrigerated compartment. When storing, it is advised to adjust the temperature to ""}

[0126] {"fullAnswer":"For short-term storage, salmon is recommended to be kept in a magnetically controlled refrigerated compartment; when storing, it is advisable to move it to the seafood section."}

[0127] {"fullAnswer":"For short-term storage, salmon is recommended to be kept in a magnetically controlled refrigerated compartment. When storing, it is suggested to switch to the seafood section."}

[0128] {"fullAnswer":"For short-term storage, salmon is recommended to be kept in a magnetically controlled refrigerated compartment. When storing, it is suggested to switch to the seafood setting and maintain temperature for 7 seconds."}

[0129] {"fullAnswer":"For short-term storage, salmon is recommended to be kept in a magnetically controlled refrigerated compartment, and stored in the seafood section. It is advised to consume it within 7 days."}

[0130] {"fullAnswer":"For short-term storage, salmon is recommended to be kept in a magnetically controlled refrigerated compartment, and stored in the seafood section. It is advised to consume within 7 days; for long-term storage..."}

[0131] {"fullAnswer":"For short-term storage, salmon is recommended to be kept in a magnetically controlled refrigerated compartment, and stored in the seafood section. It is recommended to consume it within 7 days. For long-term storage, it is recommended to store it in a cool, dry place."}

[0132] {"fullAnswer":"For short-term storage, salmon is recommended to be kept in a magnetically controlled refrigerated compartment, set to the seafood section, and consumed within 7 days; for long-term storage, it is recommended to keep it in a magnetically controlled refrigerated compartment."}

[0133] {"fullAnswer":"For short-term storage, salmon is recommended to be kept in a magnetically controlled cold storage compartment, and stored in the seafood section. It is advised to consume it within 7 days. For long-term storage, magnetically controlled freezing is recommended."}

[0134] {"fullAnswer":"For short-term storage, salmon is recommended to be kept in a magnetically controlled refrigerated compartment, set to the seafood section, and consumed within 7 days; for long-term storage, it is recommended to keep it in a magnetically controlled frozen compartment."}

[0135] {"fullAnswer":"For short-term storage, salmon is recommended to be kept in a magnetically controlled refrigerated compartment, and stored in the seafood section. It is advised to consume within 7 days. For long-term storage, it is recommended to keep salmon in a magnetically controlled frozen compartment."}

[0136] {"fullAnswer":"For short-term storage, salmon is recommended to be kept in a magnetically controlled cold storage compartment, set to the seafood section, and consumed within 7 days; for long-term storage, it is recommended to keep it in a magnetically controlled frozen storage compartment for 60 days."}

[0137] {"fullAnswer":"For short-term storage, salmon is recommended to be kept in a magnetically controlled cold storage compartment, set to the seafood section, and consumed within 7 days; for long-term storage, it is recommended to be kept in a magnetically controlled frozen storage compartment and consumed within 60 days."}

[0138] {"fullAnswer":"For short-term storage, salmon is recommended to be kept in a magnetically controlled cold storage compartment, and stored in the seafood section. It is recommended to consume it within 7 days. For long-term storage, salmon is recommended to be kept in a magnetically controlled frozen storage compartment and consumed within 60 days."}

[0139] The answers to other queries can be returned in the streaming manner described above, that is, one token information is returned per round. The detailed process will not be elaborated here.

[0140] Step 120: If it is determined that there is a first image that has not been output in the knowledge item set, the first image is bound to at least one trigger word. The trigger word is used to describe the bound image. The trigger words of each first image are matched with the answered information of this round.

[0141] As described in the foregoing embodiments, the knowledge entry set is divided into three types: knowledge entries that do not contain images, knowledge entries that contain a first image, and knowledge entries that contain a second image.

[0142] Since the first image is bound to at least one trigger word, meaning that at least one trigger word can accurately describe the corresponding first image, in order to improve the cohesion between the answered information and the output image, and to improve the matching accuracy between the output image and the answered information, this application embodiment will determine whether there is an unoutput first image in the knowledge item set after obtaining the answered information of this round (the first image that has been output in the previous round of the processing task corresponding to the same query question will not be repeatedly matched and repeatedly output).

[0143] If it is determined that there is a first image that has not been output in the knowledge item set, the trigger words of each first image will be matched with the answered information in this round (the word information returned in this round is usually short, so the trigger words of the first image usually do not match the word information returned in this round).

[0144] Specifically, the matching methods include, but are not limited to: determining whether any trigger word in the first image is located within the range of the trigger words in each first image and the word information returned in this round; determining whether the similarity between any trigger word in the first image and the words in the phrases of the previous round's answered information (e.g., 5 characters) meets any of the following similarity thresholds (e.g., 80%):

[0145] Step 130: If it is determined that a first target image exists in each first image, and the matching result of the trigger word of the first target image with the already answered information in this round meets the target condition, output the word information and the first target image of this round.

[0146] The target condition can be that any trigger word of the first image is in the already answered information of this round, or that the similarity between any trigger word of the first image and the words and phrases of the already answered information of this round within the last preset number of characters meets the similarity threshold, etc.

[0147] For any given first image, if the matching result of the trigger word of the first image with the already answered information in this round meets the target conditions, the first image can be identified as the first target image. In this case, the first target image can be returned to the backend output module. Specifically, the image identifier of the first target image can be returned (the image identifier can be the image name, image number, and image address, etc.). The backend output module can extract and output the first target image completely based on the image identifier of the first target image, avoiding incomplete formatting issues.

[0148] The output module of the target AI model's backend can not only output the lexical information of the target large language model in this round, but also output the first target image. The number of first target images can be one or multiple.

[0149] If the matching results of the trigger word of any first image and the already answered information in this round do not meet the target conditions, the backend where the target large language model is located will not output any first image in this round, but will directly output the word information of this round.

[0150] In this embodiment, when it is determined that there is a first image that has not been output in the knowledge item set, the first image is bound to at least one trigger word. The trigger words of each first image are matched with the answered information of the current round. When it is determined that there is a first target image in each first image, the matching result of the trigger word of the first target image and the answered information of the current round meets the target condition. The lexical information and the first target image of the current round are output. Since the trigger word can accurately describe the bound image, the first target image whose matching result of the trigger word and the answered information of the current round meets the target condition is output, which greatly improves the matching degree between the output image and the query question.

[0151] Furthermore, by matching the trigger words of each first image with the already answered information of this round, and outputting the lexical information and the first target image of this round when the target conditions are met, the stickiness and relevance between the output image and the lexical information and already answered information of this round can be improved, making the entire interactive process more vivid, rich and intuitive, maintaining user attention, accelerating the user understanding process, and enhancing the user experience.

[0152] In some embodiments, the method further includes:

[0153] In the final round of the target large language model, if it is determined that no first target image has been output in any previous round and there are candidate knowledge entries with a second image in the knowledge entry set, candidate knowledge entries are selected from the knowledge entry set; the second image is not bound to any trigger word;

[0154] If the target knowledge item is determined from the candidate knowledge items, a second image of the target knowledge item is output; the first indicator between the target knowledge item and the query question satisfies the first target indicator, and / or the second indicator between the target knowledge item and the answered information in the last round satisfies the second target indicator.

[0155] In each round of this application, if it is determined that there is a first image in the knowledge item set that has not been output, the trigger words of each first image will be matched with the already answered information of this round.

[0156] If it is determined that a first target image exists in each first image, and the matching result of the trigger word of the first target image with the already answered information in this round satisfies the target condition, the word information and the first target image of this round are output.

[0157] If it is determined that the first target image does not exist in any of the first images, output the word information for this round.

[0158] Next, determine whether this round is the last round (the interface of the large language model has a marker indicating whether it is the last returned lexical information, which can be used to determine this). If not, wait for the next round and continue to repeat the process from step 110 to step 130 above; if so, it is necessary to determine whether the first target image has been output in each historical round.

[0159] If the first target image has been output in each historical round, the process ends directly.

[0160] If the first target image has not been output in any historical round, it means that the first image in the knowledge item set is not suitable for output. In this case, it will be judged whether the second image, which is not bound to the trigger word, has a more suitable image.

[0161] Specifically, if it is determined that there are candidate knowledge entries with a second image in the knowledge entry set, candidate knowledge entries are selected from the knowledge entry set; the second image is not bound to any trigger word.

[0162] Next, it is determined whether the target knowledge item exists among each candidate knowledge item. The first indicator between the target knowledge item and the query question meets the first target indicator, and / or the second indicator between the target knowledge item and the answered information in the last round meets the second target indicator. Thus, the matching degree between each second image and the answer information is re-evaluated.

[0163] The first metric can be similarity (distance similarity, cosine similarity), and the second metric can be relative edit distance and similarity (distance similarity, cosine similarity, matrix multiplication, etc.).

[0164] If the target knowledge item is determined from the candidate knowledge items, a second image of the target knowledge item is output; if the first indicator between the target knowledge item and the query question satisfies the first target indicator, and / or the second indicator between the target knowledge item and the answered information in the last round satisfies the second target indicator, the relevance can be reassessed to ensure the best match between the image and the text content, making the content more coherent and easier to understand.

[0165] If the target knowledge entry is not found among the candidate knowledge entries, the lexical information of the last round is directly output.

[0166] In some embodiments, the first indicator includes a first similarity; when the first indicator is the first similarity, the first target indicator is the first target similarity; the knowledge entry includes an index vector and answer description information; the index vector is the vector corresponding to the question information in the answer description information or the vector corresponding to the keywords in the answer description information;

[0167] The target knowledge item is determined from the candidate knowledge items, including:

[0168] Determine the first similarity between the query vector corresponding to the query question and the index vector of each candidate knowledge item;

[0169] If a first candidate similarity exists among the first similarities, and the first candidate similarity is less than the first target similarity, then the candidate knowledge item corresponding to the first candidate similarity is determined as the target knowledge item.

[0170] Continuing with the aforementioned embodiments, the first indicator can be the first similarity, which refers to the similarity between the query vector corresponding to the query question and the index vector of each candidate knowledge item. Correspondingly, the first target indicator is the first target similarity, which is a preset similarity threshold, such as 75%.

[0171] The first similarity can be determined based on the cosine similarity algorithm, the vector distance similarity algorithm, or other similarity algorithms; there are no restrictions on this.

[0172] As described in the foregoing embodiments, each knowledge entry includes an index vector and answer description information. The index vector is the vector corresponding to the question information in the answer description information or the vector corresponding to the keywords in the answer description information. The answer description information is an accurate, detailed, and verifiable answer or explanation provided for a specific question, topic, or concept.

[0173] After obtaining the user's query input, the target large language model can generate a vector representation of the query, called the query vector. Additionally, candidate knowledge items also possess index vectors, and a similarity algorithm can be used to determine the first similarity between the query vector and the index vectors of each candidate knowledge item.

[0174] In practical applications, when querying a knowledge base, in addition to returning each knowledge entry in the knowledge entry set, it is also possible to return the first similarity between each knowledge entry and the query vector. For example, the first similarity is specifically the vector distance. The corresponding target vector distance is usually a very strict threshold, such as 0.1. The smaller the vector distance between two vectors, the closer the two vectors are.

[0175] Based on this, if there is a first candidate similarity among the first similarities, and the first candidate similarity is less than the first target similarity, it means that the index vector of the knowledge item corresponding to the first candidate similarity is relatively close to the query question. Therefore, the candidate knowledge item corresponding to the first candidate similarity can be determined as the target knowledge item, and then the second image of the target knowledge item is output, so that the output second image matches the query question better.

[0176] In some embodiments, the second metric includes relative editing distance; when the second metric is relative editing distance, the second target metric is the target relative editing distance.

[0177] The target knowledge item is determined from the candidate knowledge items, including:

[0178] In the absence of a first candidate similarity for each first similarity, the edit distance between the answer description information of each candidate knowledge item and the answered information of the last round is determined based on the edit distance algorithm;

[0179] The relative edit distance between the answer description information of each candidate knowledge item and the answer information of the last round is determined based on each edit distance and the length of the answered information in the last round;

[0180] If a first relative edit distance exists among the relative edit distances, and the first relative edit distance is less than the target relative edit distance, then the candidate knowledge entry corresponding to the first relative edit distance is determined as the target knowledge entry.

[0181] The second metric can be the relative edit distance, also known as the "normalized edit distance," which is the ratio between the edit distance between the string to be edited and the reference string and the length of the reference string. The edit distance is the minimum number of operations required to transform one string (the string to be edited) into another string (the reference string) through insertion, deletion, and replacement operations.

[0182] Correspondingly, the second target metric can be the target relative editing distance, which is a preset distance threshold, such as 0.75.

[0183] In this embodiment, the edit distance can be understood as the difference length between the answer description information and the answered information in the last round. However, since the lengths of the answer description information and the answered information are not fixed, simply comparing the difference length is not very accurate. In comparison, it is more reasonable to compare the ratio of the edit distance to the length of one of the texts.

[0184] In cases where no first candidate similarity exists for each first similarity, to improve the image recall rate, the edit distance between the answer description information of each candidate knowledge item and the answered information of the last round can be determined based on the edit distance algorithm.

[0185] Next, the relative edit distance between the answer description information of each candidate knowledge item and the answer information of the last round can be determined based on each edit distance and the length of the answered information in the last round. Specifically, the ratio of each edit distance to the length of the answer information in the last round is determined as the relative edit distance between the answer description information of the corresponding candidate knowledge item and the answer information in the last round.

[0186] If a first relative edit distance exists among the relative edit distances, the candidate knowledge entry corresponding to the first relative edit distance can be determined as the target knowledge entry, and then the second image of the target knowledge entry can be output, so that the output second image is more consistent with the query question.

[0187] In some embodiments, the second indicator further includes a second similarity; when the second indicator is a second similarity, the second target indicator is a second target similarity.

[0188] The target knowledge item is determined from the candidate knowledge items, including:

[0189] In the absence of a first relative edit distance among the relative edit distances, determine the second similarity between the answer description information of each candidate knowledge item and the answered information of the last round;

[0190] If a second candidate similarity exists among the second similarities, and the second candidate similarity is less than the second target similarity, then the candidate knowledge item corresponding to the second candidate similarity is determined as the target knowledge item.

[0191] In this embodiment of the application, when it is determined that there is no first relative edit distance among the relative edit distances, in order to reduce the occurrence of cases where no image is provided, a second similarity is further determined between the answer description information of each candidate knowledge item and the answered information of the last round, and it is determined whether there is a second candidate similarity among the second similarities, and the second candidate similarity is less than the second target similarity.

[0192] If a second candidate similarity exists among the second similarities, the candidate knowledge entry corresponding to the second candidate similarity can be determined as the target knowledge entry, and the second image of the target knowledge entry can be output.

[0193] If no second candidate similarity exists in each of the second similarity categories, the process ends, and no image is provided for the answer to the query question.

[0194] In some embodiments, inputting the user-inputted query question and the retrieved set of knowledge items into the target large language model further includes:

[0195] Generate query vectors corresponding to the query question;

[0196] Based on the query vector, a set of knowledge entries is retrieved from the knowledge base; the similarity between the query vector and the index vectors of each knowledge entry in the knowledge entry set is higher than the preset similarity; the preset similarity is not greater than the first target similarity.

[0197] In this embodiment of the application, the retrieval vectors of each knowledge entry in the knowledge base are used for retrieval. By matching the similarity between the query vector corresponding to the query question and each retrieval vector, a number of knowledge entries corresponding to index vectors with similarity higher than a preset similarity can be found. The preset similarity is also a similarity threshold used to filter knowledge entries. Its strictness is lower than that of the first target similarity. Therefore, the preset similarity is not greater than the first target similarity.

[0198] In some embodiments, after matching the trigger words of each first image with the lexical information returned in the current round, the method further includes:

[0199] If it is determined that the first target image does not exist in any of the first images, output the word information for this round.

[0200] As described in the foregoing embodiments, when it is determined that there is no first target image in each first image, the word information of this round is directly output without outputting any first image, and will not be repeated here.

[0201] See Figure 2 This application provides a second flowchart of an information query method, which includes the following steps:

[0202] Step 201: Retrieve the knowledge entry corresponding to the user's input query from the knowledge base; proceed to step 202.

[0203] Step 202: Input the user-inputted query and the retrieved set of knowledge items into the target large language model; proceed to step 203.

[0204] Step 203: Obtain and concatenate the lexical information returned by the target large language model in this round with the answered information from the previous round to obtain the answered information for this round; proceed to step 204.

[0205] Step 204: Determine whether there is a first image that has not been output in the knowledge entry set. The first image is bound to at least one trigger word, and the trigger word is used to describe the bound image. If yes, proceed to step 205; otherwise, proceed to step 208.

[0206] Step 205: Match the trigger words of each first image with the already answered information of this round; proceed to step 206.

[0207] Step 206: Determine whether a first target image exists in each first image, and whether the matching result of the trigger word of the first target image and the already answered information in this round meets the target condition; if yes, proceed to step 207; if no, proceed to step 208.

[0208] Step 207: Output the lexical information and the first target image for this round; proceed to step 209.

[0209] Step 208: Output the lexical information for this round; proceed to step 209.

[0210] Step 209: Determine if this round is the last round of the target large language model; if yes, proceed to step 210; if no, proceed to step 203.

[0211] Step 210: Determine whether the first target image has been output in each historical round; if not, proceed to step 211; if yes, end.

[0212] Step 211: Determine whether there is a candidate knowledge entry with a second image in the knowledge entry set, where the second image is not bound to any trigger word; if yes, proceed to step 212; otherwise, end.

[0213] Step 212: Filter candidate knowledge items from the knowledge item set; proceed to step 213;

[0214] Step 213: Based on the first indicator (vector similarity) and / or the second indicator (relative edit distance, matrix multiplication), determine whether there is a target knowledge entry among the candidate knowledge entries. The first indicator between the target knowledge entry and the query question satisfies the first target indicator, and / or the second indicator between the target knowledge entry and the answered information in the last round satisfies the second target indicator. If yes, proceed to step 214; otherwise, end.

[0215] Step 214: Output the second image of the target knowledge entry; End.

[0216] The detailed process of steps 201 to 214 above can be found in the aforementioned embodiments, and will not be repeated here.

[0217] The method of determining the image based on the query question, knowledge entries in the knowledge base, and answer information generated by the large language model avoids errors such as low accuracy and missing formatting that can occur when directly using a large model to determine the image. Furthermore, the algorithms used are lightweight, resulting in fast response times, low implementation costs, and high engineering feasibility.

[0218] The information query method provided in this application can be executed by an information query device. This application uses an information query device executing the information query method as an example to illustrate the information query device provided in this application.

[0219] This application also provides an information query device.

[0220] like Figure 3 As shown, the information query device includes: an acquisition module 310, a first processing module 320, and a second processing module 330.

[0221] The acquisition module 310 is used to acquire and concatenate the lexical information returned by the target large language model in this round with the answered information in the previous round after inputting the user's query question and the retrieved knowledge item set into the target large language model, so as to obtain the answered information in this round; the knowledge item set is a set of knowledge items retrieved from the knowledge base based on the query question and used to generate the answer information of the query question;

[0222] The first processing module 320 is used to bind the first image to at least one trigger word when it is determined that there is a first image that has not been output in the knowledge item set. The trigger word is used to describe the bound image, and the trigger word of each first image is matched with the answered information of the current round.

[0223] The second processing module 330 is used to output the lexical information and the first target image of the current round when it is determined that a first target image exists in each first image, and the matching result of the trigger word of the first target image and the already answered information in the current round meets the target condition.

[0224] According to the information query device provided in the embodiments of this application, when it is determined that there is a first image that has not been output in the knowledge item set, the first image is bound to at least one trigger word, and the trigger words of each first image are matched with the answered information of the current round. When it is determined that there is a first target image in each first image, the matching result of the trigger word of the first target image and the answered information of the current round meets the target condition, and the lexical information and the first target image of the current round are output. Since the trigger word can accurately describe the bound image, the first target image whose matching result of the trigger word and the answered information of the current round meets the target condition is output, which greatly improves the matching degree between the output image and the query question.

[0225] Furthermore, by matching the trigger words of each first image with the already answered information of this round, and outputting the lexical information and the first target image of this round when the target conditions are met, the stickiness and relevance between the output image and the lexical information and already answered information of this round can be improved, making the entire interactive process more vivid, rich and intuitive, maintaining user attention, accelerating the user understanding process, and enhancing the user experience.

[0226] In some embodiments, the information query device further includes:

[0227] The third processing module is used in the last round of the target large language model to filter candidate knowledge entries from the knowledge entry set if it is determined that no first target image has been output in any previous round and there are candidate knowledge entries with a second image in the knowledge entry set; the second image is not bound to any trigger word;

[0228] The fourth processing module is used to output a second image of the target knowledge item when the target knowledge item is determined from the candidate knowledge items; the first indicator between the target knowledge item and the query question satisfies the first target indicator, and / or the second indicator between the target knowledge item and the answered information in the last round satisfies the second target indicator.

[0229] In some embodiments, the first indicator includes a first similarity; when the first indicator is the first similarity, the first target indicator is the first target similarity; the knowledge entry includes an index vector and answer description information; the index vector is the vector corresponding to the question information in the answer description information or the vector corresponding to the keywords in the answer description information;

[0230] The third processing module is specifically used for:

[0231] Determine the first similarity between the query vector corresponding to the query question and the index vector of each candidate knowledge item;

[0232] If a first candidate similarity exists among the first similarities, and the first candidate similarity is less than the first target similarity, then the candidate knowledge item corresponding to the first candidate similarity is determined as the target knowledge item.

[0233] In some embodiments, the second metric includes relative editing distance; when the second metric is relative editing distance, the second target metric is the target relative editing distance.

[0234] The third processing module is specifically used for:

[0235] In the absence of a first candidate similarity for each first similarity, the edit distance between the answer description information of each candidate knowledge item and the answered information of the last round is determined based on the edit distance algorithm;

[0236] The relative edit distance between the answer description information of each candidate knowledge item and the answer information of the last round is determined based on each edit distance and the length of the answered information in the last round;

[0237] If a first relative edit distance exists among the relative edit distances, and the first relative edit distance is less than the target relative edit distance, then the candidate knowledge entry corresponding to the first relative edit distance is determined as the target knowledge entry.

[0238] In some embodiments, the second indicator further includes a second similarity; when the second indicator is a second similarity, the second target indicator is a second target similarity.

[0239] The third processing module is specifically used for:

[0240] In the absence of a first relative edit distance among the relative edit distances, determine the second similarity between the answer description information of each candidate knowledge item and the answered information of the last round;

[0241] If a second candidate similarity exists among the second similarities, and the second candidate similarity is less than the second target similarity, then the candidate knowledge item corresponding to the second candidate similarity is determined as the target knowledge item.

[0242] In some embodiments, the information query device further includes:

[0243] The search module is used for:

[0244] Generate query vectors corresponding to the query question;

[0245] Based on the query vector, a set of knowledge entries is retrieved from the knowledge base; the similarity between the query vector and the index vectors of each knowledge entry in the knowledge entry set is higher than the preset similarity; the preset similarity is not greater than the first target similarity.

[0246] In some embodiments, the second processing module 330 is further configured to output the lexical information of the current round when it is determined that the first target image does not exist in each of the first images.

[0247] The information query device in this application embodiment can be an electronic device or a component within an electronic device, such as an integrated circuit or a chip. The electronic device can be a terminal or other devices besides a terminal. For example, the electronic device can be a mobile phone, tablet computer, laptop computer, PDA, in-vehicle electronic device, mobile internet device (MID), augmented reality (AR) / virtual reality (VR) device, robot, wearable device, ultra-mobile personal computer (UMPC), netbook, or personal digital assistant (PDA), etc. It can also be a server, network attached storage (NAS), personal computer (PC), television set (TV), ATM, or self-service machine, etc. This application embodiment does not specifically limit the device.

[0248] The information query device in this application embodiment can be a device with an operating system. The operating system can be a Microsoft (Windows) operating system, an Android operating system, an iOS operating system, or other possible operating systems; this application embodiment does not specifically limit the specific operating system.

[0249] The information query device provided in this application embodiment can realize Figures 1 to 2 The various processes implemented in the method implementation examples will not be described again here to avoid repetition.

[0250] In some embodiments, such as Figure 4 As shown, this application embodiment also provides an electronic device 400, including a processor 401, a memory 402, and a computer program stored on the memory 402 and executable on the processor 401. When the program is executed by the processor 401, it implements the various processes of the above-described information query method embodiment and can achieve the same technical effect. To avoid repetition, it will not be described again here.

[0251] Processor 401 may be a CPU (Central Processing Unit), a general-purpose processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. It can implement or execute the various exemplary logic blocks, modules, and circuits described in conjunction with the disclosure of this application. Processor 401 may also be a combination that implements computational functions, such as including one or more microprocessor combinations, a combination of a DSP and a microprocessor, etc.

[0252] The memory 402 may be a ROM (Read Only Memory) or other type of static storage device capable of storing static information and instructions, RAM (Random Access Memory) or other type of dynamic storage device capable of storing information and instructions, or it may be an EEPROM (Electrically Erasable Programmable Read Only Memory), a CD-ROM (Compact Disc Read Only Memory) or other optical disc storage, optical disc storage (including compressed optical discs, laser discs, optical discs, digital universal optical discs, Blu-ray discs, etc.), magnetic disk storage media, other magnetic storage devices, or any other medium capable of carrying or storing computer programs and capable of being read by a computer, without limitation herein.

[0253] The memory 402 is used to store computer programs that execute the embodiments of this application, and the execution is controlled by the processor 401. The processor 401 is used to execute the computer programs stored in the memory 402 to implement the steps shown in the foregoing method embodiments.

[0254] It should be noted that the electronic devices in the embodiments of this application include the mobile electronic devices and non-mobile electronic devices described above.

[0255] This application also provides a non-transitory computer-readable storage medium storing a computer program. When the computer program is executed by a processor, it implements the various processes of the above-described information query method embodiments and achieves the same technical effect. To avoid repetition, it will not be described again here.

[0256] The processor is the processor in the electronic device described in the above embodiments. The readable storage medium includes computer-readable storage media, such as computer read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk.

[0257] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the above-described information query method.

[0258] The processor is the processor in the electronic device described in the above embodiments. The readable storage medium includes computer-readable storage media, such as computer read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk.

[0259] This application embodiment also provides a chip, which includes a processor and a communication interface. The communication interface is coupled to the processor. The processor is used to run programs or instructions to implement the various processes of the above-described information query method embodiments and can achieve the same technical effect. To avoid repetition, it will not be described again here.

[0260] It should be understood that the chip mentioned in the embodiments of this application may also be referred to as a system-on-a-chip, system chip, chip system, or system-on-a-chip, etc.

[0261] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element. Furthermore, it should be noted that the scope of the methods and apparatuses in the embodiments of this application is not limited to performing functions in the order shown or discussed, but may also include performing functions substantially simultaneously or in the reverse order, depending on the functions involved. For example, the described methods may be performed in a different order than described, and various steps may be added, omitted, or combined. Additionally, features described with reference to certain examples may be combined in other examples.

[0262] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the related technology, can be embodied in the form of a computer software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of this application.

[0263] The embodiments of this application have been described above with reference to the accompanying drawings. However, this application is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of this application without departing from the spirit and scope of the claims, and all of these forms are within the protection scope of this application.

[0264] In the description of this specification, the references to terms such as "one embodiment," "some embodiments," "illustrative embodiment," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of this application. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.

[0265] Although embodiments of this application have been shown and described, those skilled in the art will understand that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of this application, the scope of which is defined by the claims and their equivalents.

Claims

1. An information retrieval method, characterized in that, include: After inputting the user's query and the set of retrieved knowledge items into the target large language model, the word element information returned by the target large language model in this round is obtained and concatenated with the answered information in the previous round to obtain the answered information in this round. The knowledge entry set is a collection of knowledge entries retrieved from the knowledge base based on the query question, used to generate the answer information for the query question; If it is determined that there is a first image that has not been output in the knowledge item set, the first image is bound to at least one trigger word, the trigger word is used to describe the bound image, and the trigger words of each first image are matched with the answered information of the current round; If it is determined that a first target image exists in each of the first images, and the matching result of the trigger word of the first target image with the already answered information in the current round satisfies the target condition, the word information of the current round and the first target image are output.

2. The information query method according to claim 1, characterized in that, The method further includes: In the last round of the target large language model, if it is determined that the first target image has not been output in any historical round and there are candidate knowledge entries with a second image in the knowledge entry set, the candidate knowledge entries are selected from the knowledge entry set; the second image is not bound to any trigger word; If a target knowledge entry is determined from the candidate knowledge entries, a second image of the target knowledge entry is output; a first indicator between the target knowledge entry and the query question satisfies a first target indicator, and / or a second indicator between the target knowledge entry and the answered information of the last round satisfies a second target indicator.

3. The information query method according to claim 2, characterized in that, The first indicator includes a first similarity; when the first indicator is the first similarity, the first target indicator is the first target similarity; the knowledge item includes an index vector and answer description information; the index vector is the vector corresponding to the question information in the answer description information or the vector corresponding to the keywords in the answer description information; The step of determining the target knowledge entry from the candidate knowledge entries includes: Determine the first similarity between the query vector corresponding to the query question and the index vector of each of the candidate knowledge entries; If a first candidate similarity exists among the first similarities, and the first candidate similarity is less than the first target similarity, then the candidate knowledge entry corresponding to the first candidate similarity is determined as the target knowledge entry.

4. The information query method according to claim 3, characterized in that, The second indicator includes the relative edit distance; when the second indicator is the relative edit distance, the second target indicator is the target relative edit distance. The step of determining the target knowledge entry from the candidate knowledge entries includes: In the case where no first candidate similarity exists for each of the first similarities, the edit distance between the answer description information of each candidate knowledge item and the answered information of the last round is determined based on the edit distance algorithm; The relative edit distance between the answer description information of each candidate knowledge entry and the answer information of the last round is determined based on the edit distance and the length of the answered information in the last round. If a first relative edit distance exists among the relative edit distances, and the first relative edit distance is less than the target relative edit distance, then the candidate knowledge entry corresponding to the first relative edit distance is determined as the target knowledge entry.

5. The information query method according to claim 4, characterized in that, The second indicator also includes a second similarity; when the second indicator is the second similarity, the second target indicator is the second target similarity. The step of determining the target knowledge entry from the candidate knowledge entries includes: In the absence of a first relative edit distance among the relative edit distances, a second similarity is determined between the answer description information of each candidate knowledge entry and the answered information of the last round; If a second candidate similarity exists among the second similarities, and the second candidate similarity is less than the second target similarity, then the candidate knowledge entry corresponding to the second candidate similarity is determined as the target knowledge entry.

6. The information query method according to any one of claims 5, characterized in that, The step of inputting the user-input query and the retrieved set of knowledge items into the target large language model also includes: Generate the query vector corresponding to the query question; Based on the query vector, a set of knowledge entries is retrieved from the knowledge base; the similarity between the query vector and the index vectors of each knowledge entry in the set of knowledge entries is higher than a preset similarity; the preset similarity is not greater than the first target similarity.

7. The information query method according to any one of claims 1-6, characterized in that, After matching the trigger words of each of the first images with the lexical information returned in the current round, the method further includes: If it is determined that the first target image does not exist in any of the first images, the word information for this round is output.

8. An information query device, characterized in that, The acquisition module is used to acquire and concatenate the word element information returned by the target large language model in this round with the answered information in the previous round after inputting the user's query question and the set of retrieved knowledge items into the target large language model, so as to obtain the answered information in this round. The knowledge entry set is a collection of knowledge entries retrieved from the knowledge base based on the query question, used to generate the answer information for the query question; The first processing module is used to bind the first image to at least one trigger word when it is determined that there is a first image that has not been output in the knowledge item set. The trigger word is used to describe the bound image. The module then matches the trigger word of each first image with the already answered information of the current round. The second processing module is used to output the lexical information of the current round and the first target image when it is determined that a first target image exists in each of the first images, and the matching result of the trigger word of the first target image and the already answered information in the current round meets the target condition.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the information query method as described in any one of claims 1-7.

10. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the information query method as described in any one of claims 1-7.