Question and answer method and device based on large model

By obtaining the summary text of non-text data in the text block and combining it with the question to be answered and the target text block, inputting it into the large model solves the problem that the large model cannot effectively process pictures and tables, and improves the accuracy of question and answer.

CN118760742APending Publication Date: 2024-10-11HISENSE GRP HLDG CO LTD

Patent Information

Application Number
CN202410702697.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-31
Publication Date
2024-10-11

Smart Images

  • Figure CN118760742A_ABST
    Figure CN118760742A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of artificial intelligence, in particular to a question and answer method and device based on a large model. In the question answering process, according to each pre-stored text block, a target text block matched with a question to be answered is determined, namely, a text related to the question to be answered is determined, if non-text data of a picture and / or a table is pre-stored for the target text block, a summary text of the stored non-text data is obtained, and the summary text is sent to the question to be answered. And inputting the to-be-replied question, the target text block and the summary text into the first large model according to the preset format to obtain reply information, and since the summary text is a text summarizing all contents in non-text data and is input into the first large model, the first large model does not need to directly process a picture and / or a table, and the reply information can be obtained. And the content recorded in the picture and / or the table can be considered when the reply information is generated, so that the question and answer accuracy of the large model is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of artificial intelligence technology, and in particular to a question-answering method and device based on a large model. Background Art

[0002] When the model is based on document knowledge question answering, the Retrieval-Augmented Generation (RAG) model is usually used to retrieve relevant document fragments. The RAG model cannot directly retrieve images and tables. The large model can only generate answer information based on the question to be answered and the document fragment, but cannot consider the content in the image or table when generating the answer information, resulting in low accuracy of the large model's question answering. In addition, even if the corresponding images and tables are input into the large model, the large model cannot directly process the images or tables well.

[0003] Therefore, how to improve the accuracy of questions and answers about images and tables in documents has become an urgent problem to be solved. Summary of the invention

[0004] The embodiments of the present application provide a large-model-based question-answering method and device to solve the problem of low accuracy of large-model question-answering in the prior art.

[0005] In a first aspect, the present application provides a question-answering method based on a large model, the method comprising:

[0006] According to each pre-saved text block, a target text block matching the question to be answered is determined;

[0007] If non-text data is stored in advance for the target text block, a summary text of the stored non-text data is obtained, wherein the non-text data includes at least one of a picture and a table, and the summary text is a text summarizing all contents in the non-text data;

[0008] The question to be answered, the target text block and the summary text are input into the first large model according to a preset format to obtain answer information.

[0009] In a second aspect, the present application provides a question-answering device based on a large model, the device comprising:

[0010] A determination module, used for determining a target text block matching the question to be answered based on each pre-saved text block;

[0011] an acquisition module, configured to acquire summary text of the stored non-text data if non-text data is stored in advance for the target text block, wherein the non-text data includes at least one of a picture and a table, and the summary text is a text summarizing all contents in the non-text data;

[0012] The question-answering module is used to input the question to be answered, the target text block and the summary text into the first large model according to a preset format to obtain answer information.

[0013] In a third aspect, the present application also provides an electronic device, comprising a processor, wherein the processor is used to implement the steps of any of the above-mentioned large model-based question-answering methods when executing a computer program stored in a memory.

[0014] In a fourth aspect, the present application also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of any of the above-mentioned large model-based question-answering methods.

[0015] Because in an embodiment of the present application, during the question-and-answer process, a target text block matching the question to be answered is determined based on each pre-saved text block, that is, the text related to the question to be answered is determined. If non-text data of pictures and / or tables are pre-saved for the target text block, the summary text of the saved non-text data is obtained, and the question to be answered, the target text block and the summary text are input into the first large model in a preset format to obtain the answer information. Since the summary text is a text that summarizes all the contents in the non-text data, it is input into the first large model, so that the first large model does not need to directly process the pictures and / or tables, and can also ensure that it considers the contents recorded in the pictures and / or tables when generating the answer information, thereby improving the question-and-answer accuracy of the large model. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] In order to more clearly illustrate the technical solution of the present application, 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 of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0017] Figure 1 A flowchart of a question-answering process based on a large model provided in an embodiment of the present application;

[0018] Figure 2 A schematic diagram of a question-answering process based on a large model provided in an embodiment of the present application;

[0019] Figure 3A schematic diagram of table format conversion provided in an embodiment of the present application;

[0020] Figure 4 A schematic diagram of an enhanced tag screening process provided in an embodiment of the present application;

[0021] Figure 5 A schematic diagram of an enhanced tag screening process provided in an embodiment of the present application;

[0022] Figure 6 A schematic diagram of an enhanced tag determination process provided in an embodiment of the present application;

[0023] Figure 7 A picture to be stored provided in an embodiment of the present application;

[0024] Figure 8 A schematic diagram of the structure of a question-answering device based on a large model provided in an embodiment of the present application;

[0025] Fig. 9 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0026] In order to make the purpose, technical solution and advantages of the present application clearer, the technical solution of the embodiment of the present application will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the described embodiment is only a part of the embodiment of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field belong to the scope of protection of this application.

[0027] An embodiment of the present application provides a question-answering method and device based on a large model, in which a target text block matching the question to be answered is determined based on each pre-saved text block; if non-text data is pre-saved for the target text block, a summary text of the saved non-text data is obtained, the non-text data includes at least one of a picture and a table, and the summary text is a text summarizing all the contents in the non-text data; the question to be answered, the target text block and the summary text are input into the first large model according to a preset format to obtain the answer information.

[0028] Figure 1 A flowchart of a question-answering process based on a large model is provided in an embodiment of the present application, such as Figure 1 As shown, the process includes the following steps:

[0029] S101: Determine a target text block that matches the question to be answered based on each pre-saved text block.

[0030] The large model-based question-answering method provided in this application is applied to an electronic device, which may be a server, a PC, a mobile terminal, etc.

[0031] Since the large model is generally trained with general knowledge, if the large model is applied to the question-answering process in a specific field, the accuracy of the large model will not be very high, and it may give incorrect answers because the large model has not learned relevant knowledge during pre-training. The large model can be any large model with language processing capabilities, such as a large language model (LLM).

[0032] In order to improve the accuracy of question and answer based on the large model, in an embodiment of the present application, the text that may be involved in the question and answer process can be pre-saved. Since the technical field to which the question and answer is applied is known, documents, books, news, etc. related to the technical field can be collected in advance and saved. When saving, each document can be used as a text block, or a document can be split into multiple text segments, and the multiple text segments can be saved as text blocks. Exemplarily, when the document is segmented as a whole, it can be segmented according to the number of characters, punctuation or title, for example, with N characters as a text block.

[0033] After receiving the question to be answered, the target text block that matches the question to be answered can be determined based on each pre-saved text block. That is to say, in order for the large model to answer accurately, one or more target text blocks related to the content of the question to be answered can be found in each pre-saved text block. When determining the target text block, the similarity between the question to be answered and each text block can be determined respectively, and the text blocks with similarity greater than a set threshold can be determined as the target text blocks, or one or more text blocks with the greatest similarity can be selected from the text blocks with similarity greater than a preset threshold as the target text blocks. How to determine the target text block that matches the question to be answered is a prior art, and the embodiments of the present application will not be repeated here.

[0034] S102: If non-text data is stored in advance for the target text block, a summary text of the stored non-text data is obtained, wherein the non-text data includes at least one of a picture and a table, and the summary text is a text summarizing all contents in the non-text data.

[0035] Since when performing text block similarity matching, only the similarity between text and text can be compared, but the similarity between text and non-text data cannot be compared. The non-text data can be at least one of a picture and a table. Of course, the non-text data can also be a video or audio. If a certain text corresponds to non-text data, it means that the non-text data has more important information, but the large model cannot obtain the content recorded in the corresponding non-text data when answering questions, and the content recorded in the picture and / or table cannot be considered when generating the reply information, resulting in a low accuracy rate of question answering. Therefore, in an embodiment of the present application, if a certain text block collected corresponds to non-text data, the corresponding non-text data can be saved for the text block. Since the large model cannot directly process the non-text data, the summary text of the non-text data can be saved synchronously when the non-text data is saved. Among them, the summary text can be understood as a text that summarizes all the contents in the non-text data. The summary text can be manually annotated by relevant staff after collection.

[0036] S103: Input the question to be answered, the target text block and the summary text into the first large model according to a preset format to obtain answer information.

[0037] After obtaining the target text block and the summary text of the non-text data of the target text block, the question to be answered, the target text block and the summary text block can be input into the first large model according to the preset format to obtain the answer information. Since the summary text is a text that summarizes all the contents in the relevant non-text data, the first large model can understand all the contents recorded in the non-text data based on the summary text, thereby generating more accurate answer information for the question to be answered based on the summary text and the target text.

[0038] Because in the embodiment of the present application, during the question-and-answer process, a target text block matching the question to be answered is determined based on each pre-saved text block, that is, a target text block related to the question to be answered is determined. If non-text data of pictures and / or tables are pre-saved for the target text block, a summary text of the saved non-text data is obtained, and the question to be answered, the target text block and the summary text are input into the first large model according to a preset format to obtain the answer information. Since the summary text is a text that summarizes all the contents in the non-text data, it is input into the first large model, so that the first large model does not need to directly process the pictures and / or tables, and can also ensure that it considers the contents recorded in the pictures and / or tables when generating the answer information, thereby improving the question-and-answer accuracy of the large model.

[0039] In order to further improve the accuracy of question and answer, based on the above embodiment, in the embodiment of the present application, if the non-text data pre-stored for the target text block includes a target table, after obtaining the summary text of the stored non-text data, before inputting the question to be answered, the target text block and the summary text into the first large model according to a preset format, the method further includes:

[0040] Obtaining an enhanced tag pre-saved for each entry in the target table, wherein the enhanced tag is key information obtained by summarizing the content of the corresponding entry;

[0041] Determine a first similarity between the question to be answered and the enhanced tag corresponding to each item;

[0042] Determine, according to each of the first similarities, a target item that matches the question to be answered, and obtain a target index of the target item;

[0043] The step of inputting the question to be answered, the target text block and the summary text into the first large model according to a preset format to obtain answer information includes:

[0044] The question to be answered, the target text block, the summary text, all table contents of the target table and the target index are input into the first large model according to a preset format to obtain answer information.

[0045] Since the question to be answered may be asked about a certain item in the table, and the summary text of the table is summarized from the overall perspective of the table, the content recorded in a certain item in the table may be weakened when determining the summary information, resulting in the first large model being unable to obtain more content recorded in the item when determining the reply information, resulting in incorrect answers to the question to be answered. Therefore, in order to further improve the accuracy of questions and answers, in an embodiment of the present application, if it is determined that a table exists in the non-text data pre-saved for the target text block, after obtaining the summary text of the non-text data, before inputting the relevant information into the first large model, the entries in the existing table can also be processed. For ease of description, the existing table will be referred to as the target table later. Among them, the entries in the table can be understood as details grouped by content. For ease of understanding, the entries are explained below in conjunction with Table 1.

[0046] Table 1

[0047] area date Traffic congestion index YoY Qingdao 2024-04 1.790 10.76% decrease Jinan 2024-04 1.769 13.62% rise

[0048] According to the contents recorded in Table 1, the contents recorded in each row in Table 1 are about the same region. For example, the contents recorded in the second row in Table 1 are about the traffic congestion index of Qingdao in April 2024, which is 1.790, a year-on-year decrease of 10.76%. The contents recorded in the third row in Table 1 are about the traffic congestion index of Jinan in April 2024, which is 1.769, a year-on-year increase of 13.62%. Although the contents recorded in the second and third rows are both traffic conditions, the contents reflected in the second and third rows are different cities. Therefore, the second row in Table 1 can be regarded as an entry, and the third row in Table 1 can be regarded as an entry.

[0049] In an embodiment of the present application, after obtaining the summary text of the saved non-text data, if it is determined that there is a target table in the non-text data, the enhanced label pre-saved for each entry in the target table can be obtained, wherein the enhanced label can be understood as the key information obtained after summarizing the content of the corresponding entry. For example, if an entry is "Scenario: Safety Situation, Indicator: Traffic Accident Quantity, Indicator Value: 0", then the key information obtained after summarizing all the contents recorded in the entry can be: traffic safety, traffic accidents, zero accidents, accident statistics, road safety.

[0050] In order to determine whether the question to be answered is a question for an item in the target table, in an embodiment of the present application, a first similarity between the question to be answered and the enhanced label corresponding to each item can be determined. Each strong label corresponding to each item can be manually marked by the collector.

[0051] After determining each first similarity, the target item matching the question to be answered can be determined according to each first similarity, that is, it is determined which item's content is related to the content involved in the question to be answered, and the related item is determined as the target item.

[0052] In order to facilitate the subsequent first model to clarify which item in the target table the question to be answered is asked about, after the target item is determined, the target index of the target item can be obtained, wherein the target index can be the row number in the target table.

[0053] Specifically, obtain the feature vector of the enhanced label corresponding to each entry in the target table. It should be noted that if a certain entry corresponds to multiple enhanced labels, then a feature vector is determined comprehensively based on the multiple enhanced labels. Exemplarily, the feature vector of each enhanced label can be determined separately. After obtaining the feature vector of each enhanced label, these feature vectors are fused to obtain the feature vector corresponding to the entry. For example, the sum or average value between the feature vectors is determined as the feature vector of the corresponding entry. Assume that a table includes 3 entries, namely m1, m2, and m3, where the feature vector corresponding to m1 is vm1: [0,1,0,1,1], the feature vector corresponding to m2 is vm2: [1,1,0,1,1], and the feature vector corresponding to m3 is vm3: [1,1,1,1,1]. The feature vector of the question to be answered is denoted as vu. To determine the first similarity between the question to be answered and the enhanced label corresponding to each entry, the first similarity between mi and vu can be calculated using cosine similarity, where i is an integer representing the entry number. After determining each first similarity, the maximum value of the first similarity is found, and the target index Index of the target entry is obtained through the maximum value. Wherein, Index can be expressed as Index=max(cos(mi,vu)).

[0054] After obtaining the target index, when using the first large model to determine the answer information, the question to be answered, the target text block, the summary text, the entire table content of the target table, and the target index can be input into the first large model according to the preset format to obtain the answer information. Since the large model cannot process data in table form well, the entire table content of the target table input into the first large model can be the text after the target table is formatted. For example, the content of the target table is generated in Markdown format.

[0055] Specifically, the input content of the first model can be determined according to the following template:

[0056] <Overall table> Markdown format of the table;

[0057] <matched text> a block of text related to the user's question;

[0058] <Rule> The rule for generating responses, such as "Based on the above content, answer the following user questions";

[0059] <Index Enhancement> The table index with the highest relevance, e.g. "It is known that entry 2 has greater relevance";

[0060] <User question>User’s request to look up a table.

[0061] Among them, <whole table> is the entire table content of the target table; <matching text> is the target text block; <rule> is the prompt text, that is, the text used to prompt the first model what processing to perform; <index enhancement> determines the target index; and <user question> is the question to be answered.

[0062] The following is a specific example to illustrate the question-answering process based on a large model. Figure 2 A schematic diagram of a question-answering process based on a large model provided in an embodiment of the present application is shown in FIG. Figure 2 As shown, the process includes the following steps:

[0063] S201: Determine a target text block that matches the question to be answered.

[0064] S202: Determine whether non-text data is stored for the target text block, if so, execute S203, if not, execute S204.

[0065] S203: Obtain the summary text stored for the non-text data, and execute S205.

[0066] S204: Input the question to be answered and the target text block into the first large model to obtain the information to be answered.

[0067] S205: Determine whether the non-text data includes a target table, if so, execute S206, if not, execute S208.

[0068] S206: Determine the target index according to the enhanced label of the target table and the question to be answered, and execute S207.

[0069] S207: Input the question to be answered, the target text block, the summary text, all the table contents of the target table and the target index into the first large model to obtain the answer information.

[0070] S208: Input the question to be answered, the target text block, and the summary text into the first large model to obtain answer information.

[0071] In order to improve the efficiency of enhancing label determination, based on the above embodiments, in the embodiment of the present application, the process of determining the enhanced label corresponding to each entry in any table includes:

[0072] Performing format conversion on the table to obtain all table contents included in the table;

[0073] The entire table content and the first prompt text are input into the second largest model to obtain an enhanced label corresponding to each entry in the table. The first prompt text is used to prompt the second largest model to analyze each entry in the entire table content and output a text summarizing the corresponding entry content.

[0074] In order to improve the efficiency of enhancing the label determination, when determining the enhanced label corresponding to each entry in any table, the table may be formatted and all the table contents included in the table may be obtained. For example, the contents in the table may be converted into Markdown format. After obtaining all the table contents included in the table, the large model may be used to generate the enhanced label corresponding to each entry in the table. In an embodiment of the present application, the entire table content and the first prompt text may be input into the second large model to obtain the enhanced label corresponding to each entry in the table. Among them, the second large model may be any large model with language analysis capabilities, and the second large model may be the same as or different from the first large model. The first prompt text is input into the second large model to prompt the second large model to analyze each entry in the entire table content received, and output a text summarizing the corresponding entry content.

[0075] For ease of understanding, Figure 3 A schematic diagram of a table format conversion provided in an embodiment of the present application, such as Figure 3 As shown, the text in table format (such as Figure 3 After converting according to the fixed format, the entire table content can be obtained (as shown on the left) Figure 3 shown on the right).

[0076] Specifically, in the process of generating the enhanced label corresponding to each entry based on the second largest model, the prompt word can be input according to the following template:

[0077] <Tag enhancement rules> A description of the steps or rules for generating given tags

[0078] <Example> Given the input and output of the sample table

[0079] Table field name and description

[0080] Exemplarily, if you want to determine the enhanced label corresponding to each entry in Table 2 below, you can input the following content into the second largest model.

[0081] Table 2

[0082] Scenario index Index value Item 1 Vehicle and driver management Car ownership 10 Entry 2 Security Posture Traffic accidents 0

[0083] Inputs to the second largest model may include the following:

[0084] #Based on the input fields, find the most relevant tags. The requirements are as follows:

[0085] - Use "," to separate the output tags

[0086] - The output cannot contain company names, and no results related to numerical values ​​should appear

[0087] - Tags must be representative and convey the overall meaning of the corresponding item

[0088] #enter:{

[0089] Item 1: Scenario: Vehicle and Driver Management, Indicator: Number of Cars, Indicator Value: 10

[0090] Item 2: Scenario: Safety situation, Indicator: Traffic accident volume, Indicator value: 0

[0091] }

[0092] After receiving the above input, the second largest model can output the following:

[0093] Output: {

[0094] Item 1: Car, vehicle ownership, traffic management, vehicle statistics, vehicle data, number of vehicles, traffic data

[0095] Item 2: Traffic safety, traffic accidents, zero accidents, accident statistics, road safety

[0096] }

[0097] According to the output content of the second largest model mentioned above, the enhanced labels corresponding to item 1 in the above Table 2 may include automobiles, vehicle ownership, traffic management, vehicle statistics, vehicle data, number of vehicles, and traffic numbers; the enhanced labels corresponding to item 2 may include traffic safety, traffic accidents, zero accidents, accident statistics, and road safety.

[0098] After the enhanced label is determined, the table corresponding to each enhanced label can be stored as shown in Table 3. The database stores the summary text of the table, that is, the table summary of the content recorded in the table, and each summary text feature vector. It also stores the entire table content and the enhanced label corresponding to each entry.

[0099] Table 3

[0100]

[0101] In order to further enhance the accuracy of label determination, when using the second largest model to generate enhanced labels, a reference example can also be input into the second largest model so that the second largest model learns how to determine the reference example and generates enhanced labels for the table.

[0102] Specifically, it is assumed that the enhanced labels shown in Table 4 below need to be generated.

[0103] Table 4

[0104] Logo date area Traffic congestion index YoY Item 1 2024-04 Qingdao 1.790 10.76% decrease Entry 2 2024-04 Jinan 1.769 13.62% rise Entry 3 2024-04 .. .. ..

[0105] When generating the enhanced labels for each entry in Table 4 above, the following can be input to the second largest model:

[0106] #Based on the input fields, find the most relevant tags. The requirements are as follows:

[0107] - Use "," to separate the output tags

[0108] - The output cannot contain company names, and no results related to numerical values ​​should appear

[0109] - Tags must be representative and convey the overall meaning of the corresponding item

[0110] #Please refer to the example:

[0111] -enter:{

[0112] Item 1: Scenario: Vehicle and Driver Management, Indicator: Number of Cars, Indicator Value: 10

[0113] Item 2: Scenario: Safety situation, Indicator: Traffic accident volume, Indicator value: 0

[0114] }

[0115] Output: {

[0116] Item 1: Car, vehicle ownership, traffic management, vehicle statistics, vehicle data, number of vehicles, traffic data

[0117] Item 2: Traffic safety, traffic accidents, zero accidents, accident statistics, road safety

[0118] }

[0119] #enter:{

[0120] Item 1: Date: 2024-04, Region: Qingdao, Traffic Congestion Index: 1.790, Year-on-year: 10.76% decrease

[0121] Item 2: Date: 2024-04, Region: Jinan, Traffic congestion index: 1.769, Year-on-year: 13.62% increase

[0122] Entry 3: Date: 2024-04, …

[0123] }

[0124] After receiving the above input content, the second largest model can determine the enhanced tag corresponding to each entry. Exemplarily, the output content can be:

[0125] Item 1: Seaside city, close to mountains and water, seafood, pleasant climate, traffic relief, Laoshan scenery...

[0126] Entry 2: Capital of Shandong Province, Spring City, Daming Lake, hospitality, traffic congestion…

[0127] Entry 3: …

[0128] In order to further improve the efficiency of enhancing the tag determination, based on the above embodiments, in the embodiment of the present application, the method further includes:

[0129] For each enhanced tag corresponding to each entry, determine whether the semantics of the enhanced tag and any other enhanced tag corresponding to the entry are repeated;

[0130] If so, delete any enhanced tag with repeated semantics, and continue to execute the step of determining whether the semantics of each enhanced tag corresponding to each entry are repeated with any other enhanced tag corresponding to the entry, until the semantics between the enhanced tags corresponding to each entry are no longer repeated.

[0131] Since the enhanced tags generated by the second largest model may contain some semantically repeated content, after obtaining the enhanced tags corresponding to each entry, these enhanced tags can be screened. In an embodiment of the present application, for each enhanced tag corresponding to each entry, it can be determined whether the semantics of the enhanced tag and any other enhanced tag corresponding to the entry are repeated. If so, any enhanced tag with the repeated semantics can be deleted, and each enhanced tag corresponding to each remaining entry can be re-determined to determine whether there are semantically repeated tags in the enhanced tags corresponding to the entry, until the semantics between the enhanced tags corresponding to each entry are not repeated.

[0132] In the embodiment of the present application, the determining whether the semantics of the enhanced tag and any other enhanced tag corresponding to the entry are repeated includes:

[0133] Determining a second similarity between the enhanced tag and the other enhanced tags;

[0134] If the second similarity is greater than a first preset threshold, determining that the enhanced tag has semantic overlap with the other enhanced tags;

[0135] If the second similarity is not greater than the first preset threshold, it is determined that the enhanced tag and the other enhanced tags do not have overlapping semantics.

[0136] When determining whether the enhanced tag and the other enhanced tag have semantic duplication, a second similarity between the enhanced tag and the other enhanced tag may be determined, and then based on the second similarity and the first preset threshold, whether there is semantic duplication is determined. If it is determined that the second similarity is greater than the first preset threshold, it is determined that the enhanced tag and the other enhanced tag have semantic duplication. Otherwise, it is determined that the enhanced tag and the other enhanced tag do not have semantic duplication.

[0137] Specifically, after obtaining each enhanced label, all enhanced labels can be encoded through the embedding model to generate the word vector corresponding to each enhanced label. For example, the enhanced labels include coastal cities, mountains and rivers, etc., then the generated word vector is as follows:

[0138] Coastal cities: [0.1211, -1.231, ..., 1.546, -0.1234]

[0139] Near mountains and rivers: [1.1782, 0.1232, ..., -1.784, 0.1232]

[0140] …

[0141] All word vectors are calculated for similarity, and a first preset threshold p is set. When calculating the similarity, the calculation can be based on the following formula:

[0142]

[0143] Among them, A and B represent two word vectors; similarity(A, B) represents the second similarity between word vectors A and B; a represents an element in word vector A; b represents an element in word vector B; d represents the inner product of element clicks.

[0144] If it is determined that the second similarity is greater than the first preset threshold p, it means that the corresponding two enhanced labels have semantic duplication, and only one of the enhanced labels can be retained. For example, the enhanced labels are coastal city and mountain and water. Since the second similarity of these two enhanced labels is greater than the first preset threshold p, one of the enhanced labels can be randomly deleted, for example, the enhanced label mountain and water can be deleted.

[0145] If it is determined that the second similarity is not greater than the first preset threshold p, it means that the corresponding two enhanced tags are not semantically repeated, and both enhanced tags can be retained.

[0146] The following describes the screening process of enhanced tags in conjunction with a specific embodiment. Figure 4 A schematic diagram of an enhanced tag screening process provided in an embodiment of the present application is shown in FIG. Figure 4As shown, an entry includes an enhancement tag A and an enhancement tag B. If the second similarity between the enhancement tag A and the enhancement tag B is greater than a preset threshold, it can be determined that there is semantic repetition between the enhancement tag A and the enhancement tag B, and only the enhancement tag A is retained as the enhancement tag of the entry.

[0147] For ease of understanding, the following Figure 5 Explain the screening process of enhanced tags. Figure 5 A schematic diagram of an enhanced tag screening process provided in an embodiment of the present application is shown in FIG. Figure 5 As shown, enhanced tags 1-6 are obtained, and the similarity between each two enhanced tags is calculated respectively. Among them, there is semantic repetition between enhanced tag 1 and enhanced tag 2, and one of them is retained between enhanced tag 1 and enhanced tag 2. Assuming that enhanced tag 2 is retained, enhanced tag 1 is deleted. Subsequently, the similarity between enhanced tag 2 and enhanced tag 3 is calculated. According to the similarity, it is determined that there is no semantic repetition between enhanced tag 2 and enhanced tag 3, and both enhanced tag 3 are retained. In addition, there is semantic repetition between enhanced tag 5 and enhanced tag 6, and one of them is retained between enhanced tag 5 and enhanced tag 6. Assuming that enhanced tag 5 is retained, enhanced tag 6 is deleted. Subsequently, it is determined that there is semantic repetition between enhanced tag 4 and enhanced tag 5, and both enhanced tag 4 and enhanced tag 5 can be retained. Finally, through screening, enhanced tag 2, enhanced tag 3, enhanced tag 4 and enhanced tag 5 can be retained.

[0148] In order to further improve the efficiency of question-answering, based on the above embodiments, in the embodiment of the present application, the method further includes:

[0149] Inputting the enhanced label and the second prompt text corresponding to each item into the third model to obtain a summary label for each item, wherein the second prompt text is used to prompt the third model to summarize the enhanced label corresponding to each item to generate a representative label;

[0150] Update the enhanced tags for each item with the summary tags for that item.

[0151] In order to further improve the accuracy of questions and answers, in an embodiment of the present application, after obtaining the enhanced labels, the enhanced labels can also be summarized to obtain representative summary labels. In an embodiment of the present application, the enhanced labels and the second prompt text corresponding to each entry can be respectively input into the third largest model to obtain a summary label for each entry. The second prompt text is input into the third largest model to prompt the third largest model to summarize the enhanced labels corresponding to each entry and generate representative labels. Among them, the third largest model can be any large model with language processing capabilities, and the third largest model can be the same as or different from the first largest model and the second largest model.

[0152] After obtaining the summary tag corresponding to each item, the summary tag corresponding to each item may be used to update the enhanced tag of the corresponding item.

[0153] Specifically, the input content of the third model can be determined according to the following template:

[0154] <label generation rule> describes the steps or rules for given label generation

[0155] <Example> Given the input and output of the sample table

[0156] <Tags to be generated> Field name and description of the table

[0157] For example, the following may be input to the third largest model:

[0158] #According to the input fields, summarize them into representative labels. The requirements are as follows:

[0159] - Output 1-2 labels, with "," separating the fields

[0160] -The output label can cover the meaning of multiple fields

[0161] #Please refer to the example:

[0162] -enter:{

[0163] Item 1: Automobiles, traffic management, vehicle statistics, traffic data

[0164] }

[0165] Output: car statistics, traffic management

[0166] #enter:

[0167] To facilitate understanding, the process of determining the enhanced tag is described below in conjunction with a specific embodiment. Figure 6 A schematic diagram of an enhanced tag determination process provided in an embodiment of the present application is shown in FIG. Figure 6 As shown, the entire content of the table and the first prompt text are input into the second largest model to obtain the enhanced label corresponding to each item. The enhanced labels with repeated semantics are eliminated, and the semantics of the remaining enhanced labels are not repeated. The remaining enhanced labels and the second prompt text corresponding to each item are input into the third largest model to obtain the summary label of each item, and these summary labels are used as the final enhanced labels.

[0168] In order to further improve the accuracy of question answering, based on the above embodiments, in the embodiment of the present application, the process of determining the summary text of the picture includes:

[0169] The picture to be stored is processed based on the multimodal large model to obtain a summary text of the picture to be stored.

[0170] In the embodiment of the present application, when determining the summary text of the picture, the multimodal large model can be used for determination. That is, the picture to be stored can be processed based on the multimodal large model to obtain the summary text of the picture to be stored. The picture to be stored can be a picture in a document.

[0171] Specifically, Figure 7 A picture to be stored provided in an embodiment of the present application, such as Figure 7 As shown, Figure 7 There are many cars on the road, and the distance between cars is relatively close. Most of the brake lights on the rear of the cars are on. It can be inferred that there is a traffic jam on this road. Figure 7 After processing, the obtained summary text may be: traffic congestion occurs on xxx road.

[0172] After obtaining the summary text of the picture, the picture to be stored and the corresponding summary text can be stored in a database. Specifically, the storage can be performed according to the content shown in Table 5.

[0173] Table 5

[0174]

[0175] According to Table 5, after the summary text of the image is determined, the image identifier, the summary text of the image, the feature vector of the summary text, and the address / URL of the image can be stored. Among them, the feature vector of the summary text can be generated by the embedding model. The feature vector of the summary text is used to facilitate the subsequent determination of similarity, without having to determine the feature vector of the summary text each time the similarity is calculated.

[0176] In order to further improve the accuracy of question and answer, based on the above embodiments, in the embodiment of the present application, the process of determining the summary text of the table includes:

[0177] Convert the format of the table to be stored to obtain all the table contents;

[0178] All the table contents are processed based on the fourth model to obtain a summary text of the table to be stored.

[0179] In an embodiment of the present application, when determining the summary text of a table, it can be determined based on a large model. Since the large model cannot process data in a tabular form, the table to be stored can be formatted and all the table contents in the table to be stored can be obtained. Among them, the table to be stored can be a table in a document. Exemplarily, after obtaining a document, the table can be located with the help of a table recognition tool. Specifically, how to locate a table in an article is a prior art, and the embodiments of the present application will not be repeated here.

[0180] After obtaining the entire table content of the table to be stored, the large model can be used to generate the summary text of the table to be stored. That is, all the table contents are processed based on the fourth large model to obtain the summary text of the table to be stored. After obtaining the summary text of the table, the summary text of the table, the feature vector (embedding) of the summary text, and the content of the table can be stored in Markdown format. Among them, the feature vector of the summary text can be generated by the embedding model.

[0181] Specifically, assuming that the table to be stored is Table 6, when storing in the database, it can be stored according to the example of Table 7.

[0182] Table 6

[0183] date area Traffic congestion index YoY 2024-04 Qingdao 1.790 10.76% decrease 2024-04 Jinan 1.769 13.62% rise 2024-04 .. .. ..

[0184] Table 7

[0185]

[0186] In order to further improve the accuracy of question answering, based on the above embodiments, in the embodiment of the present application, the process of determining whether non-text data is pre-stored for the target text block includes:

[0187] Get the first feature vector of the summary text of each saved non-text data;

[0188] respectively determining a third similarity between the second feature vector of the target text block and each first feature quantity;

[0189] According to each third similarity and the second preset threshold, it is determined whether corresponding non-text data exists in the pre-stored target text block.

[0190] When determining whether non-text data is stored for the target text block, the first feature vector of the summary text of each pre-stored non-text data may be obtained, and the third similarity between the second feature vector of the target text block and each first feature vector may be determined respectively. The third similarity may be cosine similarity.

[0191] After each third similarity is determined, it can be determined whether corresponding non-text data exists in the pre-stored target text block according to each third similarity and the second preset threshold.

[0192] Specifically, each non-text data whose third similarity is greater than the second preset threshold value may be determined as the non-text data stored for the target text block.

[0193] In order to further improve the accuracy of question answering, based on the above embodiments, in the embodiment of the present application, the process of determining the second feature vector of the target text block includes:

[0194] Divide the target text block into blocks according to a preset segmentation rule to obtain multiple text sub-blocks;

[0195] Determine the third feature vector of each text sub-block as the second feature vector;

[0196] The step of respectively determining the third similarity between the second feature vector of the target text block and each first feature quantity comprises:

[0197] For each text sub-block, a third similarity between the second feature vector of the text sub-block and each first feature vector is determined respectively.

[0198] The target text block generally contains many sentences, and the dimension of the feature vector of a target text block is fixed. The feature vector of an entire text may mask the subtle features of a sentence therein, resulting in a low accuracy rate of similarity comparison. Therefore, in order to further improve the accuracy of question and answer, in an embodiment of the present application, when determining the second feature vector of the target text block, the target text block can be divided into blocks according to a preset segmentation rule to obtain multiple text sub-blocks. Specifically, in an embodiment of the present application, each sentence in the target text block can be regarded as a text sub-block; the target text block can also be divided according to a set length to obtain multiple text sub-blocks, that is, the length of each text sub-block is the same.

[0199] After each text sub-block is obtained, the third feature vector of each text sub-block may be determined as the second feature vector.

[0200] When determining the third similarity, the third similarity between the second feature vector of each text sub-block and each first feature vector may be determined for each text sub-block.

[0201] Specifically, assume that the target text block N includes three text sub-blocks, namely n1, n2, and n3, wherein the third feature vector of n1 is v1: [0, 1, 0, 1, 1]; the third feature vector of n2 is v2: [1, 1, 0, 1, 1]; the third feature vector of n3 is v4: [1, 1, 1, 1, 1]. Assume that the first feature vectors of the summary text of the pre-saved non-text data are vf1, vf2, vf3, etc. The second preset threshold is pf, and the value interval of the second preset threshold is [0, 1].

[0202] Then, when determining the third similarity, the third feature vector of each text sub-block can be sequentially calculated with vfi (i is an integer representing the non-text data number) for cosine similarity to obtain cos1, cos2, cos3, ... Among them, cos1 = v1@vf1, cos2 = v2@vf1, cos3 = v3@vf1, ..., wherein v1@vf1 represents the similarity between v1 and vf1.

[0203] When any third similarity exists that is greater than or equal to the second preset threshold value pf, it can be considered that non-text data is pre-stored for the target text block, and the address of the corresponding non-text data can be obtained. It should be noted that the non-text data stored for the target text block can be a set, that is, multiple non-text data can be stored for the target text block. For example, three pictures, a table, and an audio are stored for the target text block.

[0204] Based on the same inventive concept, the embodiment of the present application also provides a question-answer data generation device based on a large model, Figure 8 A schematic diagram of the structure of a question-answering device based on a large model provided in an embodiment of the present application, the device comprising:

[0205] A determination module 801 is used to determine a target text block that matches the question to be answered based on each pre-stored text block;

[0206] An acquisition module 802 is used to acquire summary text of the stored non-text data if non-text data is stored in advance for the target text block, wherein the non-text data includes at least one of a picture and a table, and the summary text is a text summarizing all contents in the non-text data;

[0207] The question-answering module 803 is used to input the question to be answered, the target text block and the summary text into the first large model according to a preset format to obtain answer information.

[0208] In a possible implementation manner, if the non-text data pre-stored for the target text block includes a target table, the acquisition module 802 is further used to acquire an enhanced tag pre-stored for each entry in the target table, where the enhanced tag is key information obtained by summarizing the content of the corresponding entry;

[0209] The determination module 801 is further configured to determine a first similarity between the question to be answered and the enhanced tag corresponding to each item; and determine a target item matching the question to be answered according to each of the first similarities;

[0210] The acquisition module 802 is further used to acquire the target index of the target entry;

[0211] The question-and-answer module 803 is specifically used to input the question to be answered, the target text block, the summary text, all table contents of the target table and the target index into the first large model according to a preset format to obtain answer information.

[0212] In a possible implementation, the determination module 801 is also used to perform format conversion on the table to obtain all table contents included in the table; input all table contents and the first prompt text into the second large model to obtain an enhanced label corresponding to each entry in the table, and the first prompt text is used to prompt the second large model to analyze each entry in the entire table content and output a text summarizing the corresponding entry content.

[0213] In a possible implementation, the device further includes:

[0214] The filtering module 804 is used to determine, for each enhanced tag corresponding to each entry, whether the semantics of the enhanced tag are repeated with any other enhanced tag corresponding to the entry; if so, any enhanced tag with repeated semantics is deleted, and the step of determining, for each enhanced tag corresponding to each entry, whether the semantics of the enhanced tag are repeated with any other enhanced tag corresponding to the entry is continued until the semantics between the enhanced tags corresponding to each entry are not repeated.

[0215] In one possible implementation, the screening module 804 is specifically used to determine a second similarity between the enhanced tag and the other enhanced tags; if the second similarity is greater than a first preset threshold, it is determined that the enhanced tag and the other enhanced tags are semantically repeated; if the second similarity is not greater than the first preset threshold, it is determined that the enhanced tag and the other enhanced tags are semantically non-repetitive.

[0216] In a possible implementation, the screening module 804 is also used to input the enhanced label and the second prompt text corresponding to each entry into the third largest model to obtain a summary label for each entry, and the second prompt text is used to prompt the third largest model to summarize the enhanced label corresponding to each entry to generate a representative label; and use the summary label corresponding to each entry to update the enhanced label of the corresponding entry.

[0217] In a possible implementation, the determination module 801 is further configured to process the image to be stored based on the multimodal large model to obtain a summary text of the image to be stored.

[0218] In a possible implementation, the determination module 801 is further used to perform format conversion on the table to be stored to obtain all table contents; and process all table contents based on the fourth model to obtain a summary text of the table to be stored.

[0219] In a possible implementation, the determination module 801 is specifically used to obtain the first feature vector of the summary text of each saved non-text data; respectively determine the third similarity between the second feature vector of the target text block and each first feature quantity; and determine whether there is corresponding non-text data in the pre-saved target text block based on each third similarity and a second preset threshold.

[0220] In a possible implementation, the determination module 801 is specifically used to divide the target text block into blocks according to a preset segmentation rule to obtain multiple text sub-blocks; determine the third feature vector of each text sub-block as the second feature vector; and for each text sub-block, determine the third similarity between the second feature vector of the text sub-block and each first feature vector.

[0221] Based on the same inventive concept, an embodiment of the present application further provides an electronic device, Fig. 9 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application is shown in FIG. Fig. 9 As shown, it includes: a processor 901, a communication interface 902, a memory 903 and a communication bus 904, wherein the processor 901, the communication interface 902, and the memory 903 communicate with each other through the communication bus 904;

[0222] The memory 903 stores a computer program. When the program is executed by the processor 901, the processor 901 performs the following steps:

[0223] According to each pre-saved text block, a target text block matching the question to be answered is determined;

[0224] If non-text data is stored in advance for the target text block, a summary text of the stored non-text data is obtained, wherein the non-text data includes at least one of a picture and a table, and the summary text is a text summarizing all contents in the non-text data;

[0225] The question to be answered, the target text block and the summary text are input into the first large model according to a preset format to obtain answer information.

[0226] In a possible implementation manner, if the non-text data pre-stored for the target text block includes a target table, the processor 901 is further configured to:

[0227] In a possible implementation, the processor 901 is further configured to: obtain an enhanced tag pre-saved for each entry in the target table, where the enhanced tag is key information obtained by summarizing the content of the corresponding entry;

[0228] Determine a first similarity between the question to be answered and the enhanced tag corresponding to each item;

[0229] Determine, according to each of the first similarities, a target item that matches the question to be answered, and obtain a target index of the target item;

[0230] The step of inputting the question to be answered, the target text block and the summary text into the first large model according to a preset format to obtain answer information includes:

[0231] The question to be answered, the target text block, the summary text, all table contents of the target table and the target index are input into the first large model according to a preset format to obtain answer information.

[0232] In a possible implementation manner, the processor 901 is further configured to: perform format conversion on the table to obtain all table contents included in the table;

[0233] The entire table content and the first prompt text are input into the second largest model to obtain an enhanced label corresponding to each entry in the table. The first prompt text is used to prompt the second largest model to analyze each entry in the entire table content and output a text summarizing the corresponding entry content.

[0234] In a possible implementation, the processor 901 is further configured to: for each enhanced tag corresponding to each entry, determine whether the semantics of the enhanced tag and any other enhanced tag corresponding to the entry are repeated;

[0235] If so, delete any enhanced tag with repeated semantics, and continue to execute the step of determining whether the semantics of each enhanced tag corresponding to each entry are repeated with any other enhanced tag corresponding to the entry, until the semantics between the enhanced tags corresponding to each entry are no longer repeated.

[0236] In a possible implementation, the processor 901 is further configured to: determine a second similarity between the enhanced tag and the other enhanced tags;

[0237] If the second similarity is greater than a first preset threshold, determining that the enhanced tag has semantic overlap with the other enhanced tags;

[0238] If the second similarity is not greater than the first preset threshold, it is determined that the enhanced tag and the other enhanced tags do not have overlapping semantics.

[0239] In a possible implementation manner, the processor 901 is further configured to: input the enhanced label and the second prompt text corresponding to each entry into the third model to obtain a summary label for each entry, wherein the second prompt text is used to prompt the third model to summarize the enhanced label corresponding to each entry to generate a representative label;

[0240] Update the enhanced tags for each item with the summary tags for that item.

[0241] In a possible implementation, the processor 901 is further configured to: process the image to be stored based on the multimodal large model to obtain a summary text of the image to be stored.

[0242] In a possible implementation manner, the processor 901 is further configured to: perform format conversion on the table to be stored to obtain all table contents;

[0243] All the table contents are processed based on the fourth model to obtain a summary text of the table to be stored.

[0244] In a possible implementation manner, the processor 901 is further configured to: obtain a first feature vector of the summary text of each stored non-text data;

[0245] respectively determining a third similarity between the second feature vector of the target text block and each first feature quantity;

[0246] According to each third similarity and the second preset threshold, it is determined whether corresponding non-text data exists in the pre-stored target text block.

[0247] In a possible implementation manner, the processor 901 is further configured to: divide the target text block into blocks according to a preset segmentation rule to obtain a plurality of text sub-blocks;

[0248] Determine the third feature vector of each text sub-block as the second feature vector;

[0249] The step of respectively determining the third similarity between the second feature vector of the target text block and each first feature quantity comprises:

[0250] For each text sub-block, a third similarity between the second feature vector of the text sub-block and each first feature vector is determined respectively.

[0251] The communication bus mentioned in the above electronic device can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus. The communication interface 902 is used for communication between the above electronic device and other devices. The memory may include a random access memory (RAM) and may also include a non-volatile memory (NVM), such as at least one disk storage. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.

[0252] The above-mentioned processor can be a general-purpose processor, including a central processing unit, a network processor (Network Processor, NP), etc.; it can also be a digital signal processing processor (Digital Signal Processing, DSP), an application-specific integrated circuit, a field programmable gate array or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component, etc.

[0253] On the basis of the above embodiments, an embodiment of the present invention further provides a computer-readable storage medium, in which a computer program executable by a processor is stored. When the program runs on the processor, the processor implements the following steps when executing:

[0254] According to each pre-saved text block, a target text block matching the question to be answered is determined;

[0255] If non-text data is stored in advance for the target text block, a summary text of the stored non-text data is obtained, wherein the non-text data includes at least one of a picture and a table, and the summary text is a text summarizing all contents in the non-text data;

[0256] The question to be answered, the target text block and the summary text are input into the first large model according to a preset format to obtain answer information.

[0257] In a possible implementation manner, if the non-text data stored in advance for the target text block includes a target table, after acquiring the summary text of the stored non-text data and before inputting the question to be answered, the target text block and the summary text into the first large model according to a preset format, the method further includes:

[0258] Obtaining an enhanced tag pre-saved for each entry in the target table, wherein the enhanced tag is key information obtained by summarizing the content of the corresponding entry;

[0259] Determine a first similarity between the question to be answered and the enhanced tag corresponding to each item;

[0260] Determine, according to each of the first similarities, a target item that matches the question to be answered, and obtain a target index of the target item;

[0261] The step of inputting the question to be answered, the target text block and the summary text into the first large model according to a preset format to obtain answer information includes:

[0262] The question to be answered, the target text block, the summary text, all table contents of the target table and the target index are input into the first large model according to a preset format to obtain answer information.

[0263] In a possible implementation, the process of determining the enhanced label corresponding to each entry in any table includes:

[0264] Performing format conversion on the table to obtain all table contents included in the table;

[0265] The entire table content and the first prompt text are input into the second largest model to obtain an enhanced label corresponding to each entry in the table. The first prompt text is used to prompt the second largest model to analyze each entry in the entire table content and output a text summarizing the corresponding entry content.

[0266] In a possible implementation, the method further includes:

[0267] For each enhanced tag corresponding to each entry, determine whether the semantics of the enhanced tag and any other enhanced tag corresponding to the entry are repeated;

[0268] If so, delete any enhanced tag with repeated semantics, and continue to execute the step of determining whether the semantics of each enhanced tag corresponding to each entry are repeated with any other enhanced tag corresponding to the entry, until the semantics between the enhanced tags corresponding to each entry are no longer repeated.

[0269] In a possible implementation manner, determining whether the enhanced tag has overlapping semantics with any other enhanced tag corresponding to the entry includes:

[0270] Determining a second similarity between the enhanced tag and the other enhanced tags;

[0271] If the second similarity is greater than a first preset threshold, determining that the enhanced tag has semantic overlap with the other enhanced tags;

[0272] If the second similarity is not greater than the first preset threshold, it is determined that the enhanced tag and the other enhanced tags do not have overlapping semantics.

[0273] In a possible implementation, the method further includes:

[0274] Inputting the enhanced label and the second prompt text corresponding to each item into the third model to obtain a summary label for each item, wherein the second prompt text is used to prompt the third model to summarize the enhanced label corresponding to each item to generate a representative label;

[0275] Update the enhanced tags for each item with the summary tags for that item.

[0276] In a possible implementation, the process of determining the summary text of the picture includes:

[0277] The picture to be stored is processed based on the multimodal large model to obtain a summary text of the picture to be stored.

[0278] In a possible implementation, the process of determining the summary text of the table includes:

[0279] Convert the format of the table to be stored to obtain all the table contents;

[0280] All the table contents are processed based on the fourth model to obtain a summary text of the table to be stored.

[0281] In a possible implementation, the process of determining whether non-text data is pre-stored for the target text block includes:

[0282] Get the first feature vector of the summary text of each saved non-text data;

[0283] respectively determining a third similarity between the second feature vector of the target text block and each first feature quantity;

[0284] According to each third similarity and the second preset threshold, it is determined whether corresponding non-text data exists in the pre-stored target text block.

[0285] In a possible implementation, the process of determining the second feature vector of the target text block includes:

[0286] Divide the target text block into blocks according to a preset segmentation rule to obtain multiple text sub-blocks;

[0287] Determine the third feature vector of each text sub-block as the second feature vector;

[0288] The step of respectively determining the third similarity between the second feature vector of the target text block and each first feature quantity comprises:

[0289] For each text sub-block, a third similarity between the second feature vector of the text sub-block and each first feature vector is determined respectively.

[0290] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.

[0291] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes 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 produce 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.

[0292] 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.

[0293] 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. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0294] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.

Claims

1. A question-answering method based on a large model, It is characterized in that The method comprises: According to each pre-saved text block, a target text block matching the question to be answered is determined; If non-text data is stored in advance for the target text block, a summary text of the stored non-text data is obtained, wherein the non-text data includes at least one of a picture and a table, and the summary text is a text summarizing all contents in the non-text data; The question to be answered, the target text block and the summary text are input into the first large model according to a preset format to obtain answer information.

2. The method according to claim 1, It is characterized in that If the non-text data stored in advance for the target text block includes a target table, after acquiring the summary text of the stored non-text data and before inputting the question to be answered, the target text block and the summary text into the first large model according to a preset format, the method further includes: Obtaining an enhanced tag pre-saved for each entry in the target table, wherein the enhanced tag is key information obtained by summarizing the content of the corresponding entry; Determine a first similarity between the question to be answered and the enhanced tag corresponding to each item; Determine, according to each of the first similarities, a target item that matches the question to be answered, and obtain a target index of the target item; The step of inputting the question to be answered, the target text block and the summary text into the first large model according to a preset format to obtain answer information includes: The question to be answered, the target text block, the summary text, all table contents of the target table and the target index are input into the first large model according to a preset format to obtain answer information.

3. The method according to claim 2, It is characterized in that The process of determining the enhanced label corresponding to each entry in any table includes: Performing format conversion on the table to obtain all table contents included in the table; The entire table content and the first prompt text are input into the second largest model to obtain an enhanced label corresponding to each entry in the table. The first prompt text is used to prompt the second largest model to analyze each entry in the entire table content and output a text summarizing the corresponding entry content.

4. The method according to claim 3, It is characterized in that The method further comprises: For each enhanced tag corresponding to each entry, determine whether the semantics of the enhanced tag and any other enhanced tag corresponding to the entry are repeated; If so, delete any enhanced tag with repeated semantics, and continue to execute the step of determining whether the semantics of each enhanced tag corresponding to each entry are repeated with any other enhanced tag corresponding to the entry, until the semantics between the enhanced tags corresponding to each entry are no longer repeated.

5. The method according to claim 4, It is characterized in that The determining whether the enhanced tag has the same semantics as any other enhanced tag corresponding to the entry includes: Determining a second similarity between the enhanced tag and the other enhanced tags; If the second similarity is greater than a first preset threshold, determining that the enhanced tag has semantic overlap with the other enhanced tags; If the second similarity is not greater than the first preset threshold, it is determined that the enhanced tag and the other enhanced tags do not have overlapping semantics.

6. The method according to claim 3 or 4, It is characterized in that The method further comprises: Inputting the enhanced label and the second prompt text corresponding to each item into the third model to obtain a summary label for each item, wherein the second prompt text is used to prompt the third model to summarize the enhanced label corresponding to each item to generate a representative label; Update the enhanced tags for each item with the summary tags for that item.

7. The method according to claim 1, It is characterized in that The process of determining the summary text of the table includes: Convert the format of the table to be stored to obtain all the table contents; All the table contents are processed based on the fourth model to obtain a summary text of the table to be stored.

8. The method according to claim 1, It is characterized in that The process of determining whether non-text data is pre-stored for the target text block includes: Get the first feature vector of the summary text of each saved non-text data; respectively determining a third similarity between the second feature vector of the target text block and each first feature quantity; According to each third similarity and the second preset threshold, it is determined whether corresponding non-text data exists in the pre-stored target text block.

9. The method according to claim 8, It is characterized in that The process of determining the second feature vector of the target text block includes: Divide the target text block into blocks according to a preset segmentation rule to obtain multiple text sub-blocks; Determine the third feature vector of each text sub-block as the second feature vector; The step of respectively determining the third similarity between the second feature vector of the target text block and each first feature quantity comprises: For each text sub-block, a third similarity between the second feature vector of the text sub-block and each first feature vector is determined respectively.

10. An electronic device, It is characterized in that The electronic device comprises a processor, and the processor is used to implement the steps of the large model-based question-answering method as described in any one of claims 1 to 9 when executing a computer program stored in a memory.

Citation Information

Patent Citations

  • Information extraction method, server and storage medium

    CN117520343A

  • Question and answer reply method and system based on large model, terminal and storage medium

    CN117609475A

  • Document question-answering method, document question-answering device and readable storage medium

    CN117668180A

  • Interaction method and device of knowledge database, electronic equipment and computer readable storage medium

    CN117807210A

  • Question and answer method, electronic equipment, storage medium and program product

    CN117909479A

Cited By

  • Question and answer method based on memory retrieval

    CN122240676A

  • A question answering method based on memory retrieval

    CN122240676B

  • Question answering method based on large model, and electronic device

    WO2025246204A1

  • Large language model system

    WO2026140992A1