Question and answer method, device and equipment based on large language model and storage medium

By performing metadata filtering and non-repeating sampling on structured data, the shortcomings of large language models in processing structured data are addressed, resulting in more accurate responses and improving the processing capabilities of large language models.

CN121117137BActive Publication Date: 2026-08-04CHINA MOBILE INFORMATION SYST INTEGRATION CO LTD +4
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
CHINA MOBILE INFORMATION SYST INTEGRATION CO LTD
Filing Date
2025-06-09
Publication Date
2026-08-04

AI Technical Summary

Technical Problem

Large language models have limitations in processing structured data, especially in dealing with noise interference and overfitting.

Method used

By acquiring raw structured data and question information, metadata filtering is performed to construct sublists, and non-repeating sampling is performed on each data column to generate response information using a large language model.

Benefits of technology

It reduces the volume of structured data, avoids noise interference and overfitting, enhances the model's understanding of data distribution, generates more accurate responses, and improves the structured data processing capabilities of large language models.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121117137B_ABST
    Figure CN121117137B_ABST
Patent Text Reader

Abstract

The application relates to a question answering method and device based on a large language model, equipment and a storage medium, and relates to the technical field of artificial intelligence. The method comprises the following steps: obtaining original structured data and question information; performing metadata filtering on the original structured data according to the question information to obtain a sub-list of the original structured data; sampling each data column in the sub-list to obtain a sample value of each data column; the sample values of the data columns are located in different data rows; and based on the sample values of the data columns and the question information, a large language model is used to generate reply information corresponding to the question information. Through the above method, the ability of the large language model to process structured data can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of artificial intelligence technology, and in particular to a question-answering method, apparatus, device, and storage medium based on a large language model. Background Technology

[0002] Large Language Models (LLMs) are artificial intelligence (AI) models with a large number of parameters and complex structures, capable of processing massive amounts of data and performing various complex tasks. However, because training large language models often involves a lack of structured data, their ability to process structured data remains insufficient. Summary of the Invention

[0003] This application provides a question-answering method, apparatus, device, and storage medium based on a large language model, which can improve the ability of the large language model to perform structured data processing. The technical solution is as follows.

[0004] On the one hand, a question-answering method based on a large language model is provided, the method comprising:

[0005] Obtain the raw structured data and the question information;

[0006] Based on the query information, the original structured data is filtered for metadata to obtain a sublist of the original structured data;

[0007] Each data column in the sublist is sampled to obtain a sampled value for each data column; the sampled values ​​for each data column are located in different data rows.

[0008] Based on the sampled values ​​of each data column and the question information, the response information corresponding to the question information is generated through a large language model.

[0009] On the other hand, a question-answering device based on a large language model is provided, the device comprising:

[0010] The information acquisition module is used to acquire raw structured data and question information;

[0011] The table filtering module is used to filter the original structured data based on the query information to obtain a sublist of the original structured data;

[0012] The sampling module is used to sample each data column in the sublist to obtain the sampled value of each data column; the sampled values ​​of each data column are located in different data rows;

[0013] The response generation module is used to generate response information corresponding to the question information based on the sampled values ​​of each data column and the question information through a large language model.

[0014] In one possible implementation, the sampling module is used for:

[0015] After the data of the target data row in the first data column is extracted, a sampled label is added to the target data row; the first data column is any data column in the sub-list;

[0016] When sampling the second data column, skip the data rows with the sampled labels, the second data column being any data column other than the first data column.

[0017] In one possible implementation, the sampling module includes:

[0018] The format determination submodule is used to determine the data format of each data column in the sublist;

[0019] The sampling module is used to sample each data column in the sublist based on the data format of each data column and the sampling method of each data format, so as to obtain the sampled value of each data column.

[0020] In one possible implementation, the format determination submodule is used for,

[0021] Determine the data format of each data item in the target data column; the target data column is any data column in the sub-list.

[0022] The data formats of each data point are statistically analyzed, and the data format with the most data points is determined as the data format of the target data column.

[0023] In one possible implementation, the table filtering module includes:

[0024] The metadata acquisition submodule is used to acquire the metadata of each data column of the original structured data;

[0025] The first calculation submodule is used to calculate the first matching degree between the query information and each metadata;

[0026] The filtering submodule is used to filter data columns based on the first matching degree corresponding to each metadata, and determine the sub-data columns;

[0027] A submodule is constructed to build the sublist based on the subdata columns.

[0028] In one possible implementation, the response generation module includes:

[0029] The second calculation submodule is used to calculate the second matching degree between the query information and the sampled values ​​of each data column;

[0030] The sample value determination submodule is used to determine the target sample value based on the second matching degree corresponding to the sample values ​​of each data column;

[0031] The response generation submodule is used to generate response information corresponding to the question information based on the data row where the target sample value is located, using a large language model.

[0032] On the other hand, a computer device is provided, the computer device including a processor and a memory, the memory storing at least one computer program, the at least one computer program being loaded and executed by the processor to implement the above-described question-answering method based on a large language model.

[0033] On the other hand, a computer-readable storage medium is provided, wherein at least one computer program is stored in the computer program, which is loaded and executed by a processor to implement the above-described question-answering method based on a large language model.

[0034] On the other hand, a computer program product is provided, the computer program product including a computer program stored on a non-transitory computer-readable storage medium, the computer program including program instructions that, when executed by a computer, cause the computer to execute to implement the question-answering method based on a large language model provided in the various optional implementations described above.

[0035] The technical solution provided in this application may include the following beneficial effects:

[0036] The question-answering method based on a large language model provided in this application, after obtaining the original structured data and question information, performs metadata filtering on the original structured data according to the question information to obtain a sublist of the original structured data. Then, it samples the data in each column of the sublist without repetition of data rows, and generates the corresponding response information based on the sampled values ​​of each data column and the question information. In the above method, filtering data columns through metadata and sampling each data column without repetition reduces the volume of structured data, which can reduce noise interference and effectively avoid the large language model receiving too much data. By adopting the strategy of independent sampling of columns, key data features are preserved, and overfitting caused by fixed row associations in the large language model is avoided, enhancing the model's understanding of data distribution. In addition, inputting the sampled structured data and question information into the large language model can effectively compensate for the shortcomings of the large language model in structured data reasoning, generating more accurate responses, thereby improving the large language model's ability to process structured data.

[0037] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and do not limit this application. Attached Figure Description

[0038] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.

[0039] Figure 1 A flowchart illustrating a question-answering method based on a large language model provided in an exemplary embodiment of this application is shown;

[0040] Figure 2 A flowchart of a question-answering method based on a large language model provided in another exemplary embodiment of this application is shown;

[0041] Figure 3 A schematic diagram of a question-answering method based on a large language model provided in an exemplary embodiment of this application is shown;

[0042] Figure 4 A block diagram of a question-answering device based on a large language model provided in an exemplary embodiment of this application is shown;

[0043] Figure 5 A structural block diagram of a computer device illustrated in an exemplary embodiment of this application is shown;

[0044] Figure 6 A structural block diagram of a computer device illustrated in an exemplary embodiment of this application is shown. Detailed Implementation

[0045] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.

[0046] This application provides a question-answering method based on a large language model, which can compensate for the shortcomings of large language models in processing structured data, thereby improving the accuracy of large language model question answering; Figure 1 The diagram illustrates a flowchart of a question-answering method based on a large language model, provided in an exemplary embodiment of this application. This method can be executed by a computer device, which may be a device configured with a large language model. The computer device can be implemented as a server or a terminal, such as... Figure 1 As shown, the method may include the following steps.

[0047] Step 110: Obtain the raw structured data and the question information.

[0048] In one possible implementation, the original structured data and the query information are information input by the user through an input interface; or, in another possible implementation, the query information is information input by the user through an input interface, and the original structured data is data obtained by the computer device after querying based on the query information, or data generated based on the query information.

[0049] Structured data refers to data that can be stored and managed using relational databases, and that can be logically expressed and implemented using a two-dimensional table structure. It typically has fixed fields and explicit types, such as data existing in the form of rows and columns, key-value pairs, or tags. Possible implementation forms of structured data include database tables, tables (such as Excel / CSV), JSON / XML documents, etc. Among them, a table is a structure with explicit rows and columns, and a database table can be an ordered collection of massive amounts of information that can be queried, written, and operated using SQL (Structured Query Language).

[0050] Step 120: Filter the raw structured data based on the query information to obtain a sublist of raw structured data.

[0051] In this embodiment, after obtaining the original structured data and the query information, the computer device can filter out data columns related to the query information from the original structured data based on the metadata in the original structured data and the query information, and form a sublist from these data columns. For example, taking the original structured data as a table, assuming the original table has three columns: name, gender, and household registration, and the query information is "Please find user A's household registration," by filtering the column fields, the name and household registration columns can be filtered out and merged into a sublist. Here, the column fields of the table are a type of metadata.

[0052] Step 130: Sample each data column in the sublist to obtain the sampled value of each data column; the sampled values ​​of each data column are located in different data rows.

[0053] In other words, when the computer device performs sampling, it performs independent sampling by column, extracting a certain number of data from each data class. In one possible implementation, the computer device can be configured to determine the total number of samples. For example, a fixed total number of samples can be set, or the total number of samples can be determined based on the total number of rows in the sublist, i.e., the total number of samples is n% of the total number of rows in the sublist, and the value of n can be set based on actual needs. The number of samples for each data column can be allocated based on the number of data columns, and the number of samples for each data column can be the same or different. When sampling data from each data column, it must be ensured that each sampled value comes from a different data row.

[0054] Step 140: Based on the sampled values ​​of each data column and the question information, generate the corresponding response information for the question information through a large language model.

[0055] Among them, large language models are deep learning-based artificial intelligence models capable of understanding and generating human language. These models typically consist of a large number of parameters learned from extensive text data. The number of parameters and layers in a large language model determines its ability to process and understand language. Large language models can use prompt words to guide the model in generating specific text or performing specific tasks. In this embodiment, the large language model can be used to generate corresponding response information based on the input question information and the sampled values ​​of various data columns.

[0056] After obtaining each sampled value, the large language model in the computer device can obtain the sampled value according to the receiving sampling process. Then, referring to the question information, it can filter out the sampled values ​​related to the question information from each sampled value, and then generate the corresponding response information based on the filtered sampled values. Furthermore, the computer device can feed back the response information to the user.

[0057] In summary, the question-answering method based on a large language model provided in this application, after obtaining the original structured data and question information, performs metadata filtering on the original structured data according to the question information to obtain a sublist of the original structured data. Then, it samples data from each column of the sublist without repetition of data rows, generating response information corresponding to the question information based on the sampled values ​​of each data column and the question information. In the above method, filtering data columns through metadata and performing non-repetitive sampling of each data column reduces the volume of structured data, which can reduce noise interference and effectively avoid the large language model receiving too much data. The strategy of independent sampling of columns preserves key data features and avoids overfitting caused by fixed row associations in the large language model, enhancing the model's understanding of data distribution. Furthermore, inputting the sampled structured data and question information into the large language model can effectively compensate for the shortcomings of the large language model in structured data reasoning, generating more accurate responses, thereby improving the large language model's ability to process structured data.

[0058] Different data columns can have different data formats. In this embodiment, the computer device can be configured with different sampling methods for different data formats. Based on this, Figure 2 The diagram illustrates a flowchart of a question-answering method based on a large language model, provided in another exemplary embodiment of this application. This method can be executed by a computer device, which may be a device configured with a large language model. The computer device can be implemented as a server or a terminal, such as... Figure 2 As shown, the method may include the following steps.

[0059] Step 210: Obtain the raw structured data and the question information.

[0060] Step 220: Filter the raw structured data based on the query information to obtain a sublist of raw structured data.

[0061] In one possible implementation, the computer device can input the query information and the raw structured data into a selector, which can select the data columns in the raw structured data that are related to the query information and form a sublist.

[0062] The process of filtering metadata to construct a sublist of the original structured data can be implemented as follows:

[0063] Obtain the metadata of each data column of the raw structured data;

[0064] Calculate the first degree of match between the query information and each piece of metadata;

[0065] Data columns are filtered based on the first matching degree of each metadata element to determine sub-data columns;

[0066] Construct a sublist based on the sub-data columns.

[0067] In calculating the first matching degree between the query information and each metadata, the computer device can obtain the data feature vector of each metadata and obtain the question feature vector of the query information using the same encoding method. By calculating the vector similarity between the data feature vector of each metadata and the question feature vector, the first matching degree corresponding to each metadata is obtained. Based on the first matching degree corresponding to each metadata, data columns are filtered to obtain sub-data columns and construct sub-lists. The computer device can filter each metadata by setting a first matching degree threshold, which can be set based on actual needs, and this application does not impose any restrictions on this.

[0068] Step 230: Determine the data format of each data column in the sublist.

[0069] Taking the determination of the data format of a single data column as an example, the process of determining the data format of each data column can be implemented as follows:

[0070] Determine the data format of each data item in the target data column; the target data column can be any data column in the sublist.

[0071] The data formats of each data point are statistically analyzed, and the data format with the most data points is determined as the data format of the target data column.

[0072] In one possible implementation, the data format of the data column may include at least one of the following: numeric, numeric phrase, word, text, number, and undetermined. For example, a numeric phrase may be information such as date or time, such as "2024-09-09" or "18:36:24", etc.

[0073] A computer device can invoke a determiner to determine the data format of each data column in a sublist. This determiner can be a network structure including an output layer and a multi-layer neural network model, and it can be trained on a large amount of tabular data. This determiner can be used to determine the data format of a single data column. ( The probability of belonging to each data format, let the output category set be . For each data The judge can output the probability distribution of the data belonging to different formats as follows: ,in This represents the output of the model's feedforward neural network. These are the model parameters. The model then determines which data format has the highest probability and uses it as the final output, i.e., the final predicted data format. .

[0074] In one possible implementation, after obtaining the data formats of each data item in a data column, the computer device can determine the data format of the target data column as the data format that appears most frequently.

[0075] In another possible implementation, to reduce the amount of data processing, the computer device can sample the data in the target data column and determine the data format of the target data column as the data format that appears most frequently among the sampled data formats. (Illustratively, in a certain column...) A subset is formed by randomly selecting a portion of the data. The sampling process is represented as ,in, The data is obtained through sampling, where k is much smaller than n; for a certain column All data obtained by random sampling The prediction category is: Count the occurrences of each category and record the category. The number of times it appears is The final column data format will be the category that appears most frequently: The data format of each data column can be obtained in the above manner, and represented as a tuple. It should be noted that when determining the data format of a data column through sampling, the sampling quantity can be set based on actual needs, and this application does not impose any restrictions on this.

[0076] Step 240: Based on the data format of each data column and the sampling method of each data format, sample each data column in the sublist to obtain the sampled value of each data column.

[0077] In one possible implementation, the computer device can plan a sampling task by counting the number of rows and columns of the obtained sublist and determining the data format of each data column, and then perform sampling according to the sampling task. For example, the number of rows and columns of the sublist is (M, N). If the sampling quantity is at least 1 / n of the total number of rows, then m data points need to be extracted from each data column. For example, if the sublist has 100,000 rows, 4 columns, and n = 100, then 1,000 sample values ​​need to be extracted, and 250 sample values ​​need to be extracted from each data column.

[0078] During sampling, after the data of the target data row in the first data column is extracted, a sampled label is added to the target data row; the first data column can be any data column in the sublist.

[0079] When sampling the second data column, skip the data rows that have been sampled and labeled. The second data column is any data column other than the first data column.

[0080] In other words, when a certain data is extracted from a column, the corresponding data row will be marked as sampled. Subsequently, when sampling other data columns, the computer will not sample from the data rows marked as sampled, i.e., sampling is not repeated.

[0081] During sampling, the computer device samples based on the data format of each data column and the sampling method for each data format. In one possible implementation, the sampling method for each data format can be based on stratified sampling according to the stratification criteria corresponding to each data format. For example, when the data format includes numerical values, numerical phrases, words, text, numbers, or when it is impossible to determine the format, the sampling method may include:

[0082] When the data format is numerical, the corresponding sampling method can be to sort the data in the data column according to the numerical value, and then perform stratified sampling based on the numerical value: divide the sorted numerical data into L strata, and the amount of data in each stratum is denoted as L. The total data volume is N, that is Calculate the proportion of each layer of data to the total data volume. Then, in each layer, random samples are taken. These values ​​are used as sample values.

[0083] When the data format is a numeric phrase, the corresponding sampling method can be to extract the numerical information from the numeric phrase and then perform stratified sampling based on the size of the numerical information in the numeric phrase. That is, after sorting the data in the data column according to the size of the numerical information, stratified sampling is performed.

[0084] When the data format is words, the corresponding sampling method can be: count the types of words in the data column and the quantity of each type of word, and then perform stratified sampling based on word type. For example, if the quantity of a certain type of word accounts for the total number of words, then samples are taken from all rows in which that type of word appears. One is used as a sample value.

[0085] When the data format is text, the corresponding sampling method can be to vectorize the text data, converting it into a vector set. Clustering algorithms are used to cluster the vector set V, resulting in K vector clusters, each containing the number of vectors. ,satisfy Stratified sampling is performed based on vector clusters, that is, the proportion of each vector cluster to the total number of vectors is calculated. Then, randomly select from each vector cluster Each vector is used as a sample value.

[0086] When the data format is numbers, the corresponding sampling method can be to count the similar parts of the numbers and the frequency of numbers containing similar parts. For example, if the column field is certificate numbers, there may be multiple certificate numbers that contain the same numbers such as 110, 310, 123, etc. Numbers containing similar parts are identified as number groups, and stratified sampling is performed based on number groups. That is, the proportion qi of each number group to the total number of numbers is calculated, and then samples are drawn from each vector cluster. One is used as the sampling value; if there is no similar part in the number, the sampling value of the data column is obtained by random sampling.

[0087] When the data format is undetermined, a sample value for the data column is obtained through random sampling.

[0088] The computer device can group the sampled values ​​obtained from each data column into a group. After the sampling process is completed, multiple data groups can be obtained. The computer device can use these multiple data groups as the basis for subsequent determination of recovery information. In another possible implementation, if the difference in the amount of data between multiple data groups exceeds the difference threshold, that is, if there is a large amount of data in one or more data groups, the computer device can split the data group exceeding the difference threshold into several sub-data groups for group processing when determining the recovery information.

[0089] Step 250: Based on the sampled values ​​of each data column and the question information, generate the corresponding response information for the question information through a large language model.

[0090] After obtaining the sampled values ​​of each data column, the computer device can calculate the matching degree between each sampled value and the query information, and filter the sampled values ​​based on the matching degree. Since the sampling is performed without replacement between data columns, the computer device can input the data of the data row containing the filtered sampled values ​​into the large language model to obtain the response information corresponding to the query information. This process can be implemented as follows:

[0091] Calculate the second degree of matching between the query information and the sampled values ​​of each data column;

[0092] The target sample value is determined based on the second matching degree corresponding to the sample value of each data column;

[0093] Based on the data row where the target sample value is located, the corresponding response information is generated through a large language model.

[0094] The computer device can calculate the second matching degree between the query information and the sampled values ​​of each data column by means of similarity calculation. The similarity calculation method can include cosine similarity, Euclidean distance calculation, etc. This application does not limit this. The computer device can filter each sampled value by means of the second matching degree threshold, and determine the sampled value with the second matching degree higher than the second matching degree threshold as the target sampled value. The second matching degree threshold can be set according to actual needs. This application does not limit this.

[0095] When generating response information corresponding to a question through a large language model, the computer device can input the data of the data row where the target sample value is located and a preset prompt word into the large language model. The prompt word is used to instruct the large language model to generate response information based on the data of the data row where the target sample value is located. When inputting data, the computer device can input the sample values ​​corresponding to each data column into the large language model in groups to reduce the amount of data processed by the large language model in one go.

[0096] After receiving the response to the question from the large language model, the computer device can feed back the response to the user through an output interface, such as displaying the response through a visual interface or providing feedback through voice.

[0097] In summary, the question-answering method based on a large language model provided in this application, after obtaining the original structured data and question information, performs metadata filtering on the original structured data according to the question information to obtain a sublist of the original structured data. Then, it samples data from each column of the sublist without repetition of data rows, generating response information corresponding to the question information based on the sampled values ​​of each data column and the question information. In the above method, filtering data columns through metadata and performing non-repetitive sampling of each data column reduces the volume of structured data, which can reduce noise interference and effectively avoid the large language model receiving too much data. The strategy of independent sampling of columns preserves key data features and avoids overfitting caused by fixed row associations in the large language model, enhancing the model's understanding of data distribution. Furthermore, inputting the sampled structured data and question information into the large language model can effectively compensate for the shortcomings of the large language model in structured data reasoning, generating more accurate responses, thereby improving the large language model's ability to process structured data.

[0098] Furthermore, by using different sampling methods to avoid sampling data columns of different data formats, information omissions can be reduced even with low sampling coverage, thereby improving the accuracy of question answering.

[0099] Taking the original structured data as a table as an example, Figure 3The illustration shows a schematic diagram of a question-answering method based on a large language model provided in an exemplary embodiment of this application, such as... Figure 3 As shown, the method includes a selection process, a judgment process, a sampling process, and a large language model response process.

[0100] In the selection process, the computer device inputs the received raw form and query information into the selector. The selector then selects the data columns in the raw form that are relevant to the query information and creates a sublist from these data columns. The computer device can then count the number of rows and columns in the sublist and send them to the sampler.

[0101] In the decision-making process, for each data column in the sublist, the computer device determines the data format of each data column through a decision-maker.

[0102] In the sampling process, the computer equipment can use a sampler to plan the sampling task based on the number of rows and columns of the sublist and the data format of each data column, so as to perform non-repeating sampling between different data columns, and input the sampled values ​​into the large language model in groups.

[0103] In the large language model's response process, the large language model receives the sampled values ​​obtained from the sampling process in groups. Then, referring to the question information, it filters the sampled values ​​based on the matching degree between the question information and the sampled values, and then generates response information corresponding to the question information based on the data row where the filtered sampled values ​​are located.

[0104] Figure 4 This invention illustrates a block diagram of a question-answering apparatus based on a large language model, provided in an exemplary embodiment of this application. This apparatus can be used to perform tasks such as... Figure 1 or Figure 2 All or part of the steps in the illustrated embodiments, such as Figure 4 As shown, the device may include the following modules.

[0105] Information acquisition module 410 is used to acquire raw structured data and question information;

[0106] The table filtering module 420 is used to filter the original structured data based on the query information to obtain a sublist of the original structured data;

[0107] The sampling module 430 is used to sample each data column in the sublist to obtain the sampled value of each data column; the sampled values ​​of each data column are located in different data rows.

[0108] The response generation module 440 is used to generate response information corresponding to the question information based on the sampled values ​​of each data column and the question information through a large language model.

[0109] In one possible implementation, the sampling module 430 is used for,

[0110] After the data of the target data row in the first data column is extracted, a sampled label is added to the target data row; the first data column is any data column in the sub-list;

[0111] When sampling the second data column, skip the data rows with the sampled labels, the second data column being any data column other than the first data column.

[0112] In one possible implementation, the sampling module 430 includes:

[0113] The format determination submodule is used to determine the data format of each data column in the sublist;

[0114] The sampling module is used to sample each data column in the sublist based on the data format of each data column and the sampling method of each data format, so as to obtain the sampled value of each data column.

[0115] In one possible implementation, the format determination submodule is used for,

[0116] Determine the data format of each data item in the target data column; the target data column is any data column in the sub-list.

[0117] The data formats of each data point are statistically analyzed, and the data format with the most data points is determined as the data format of the target data column.

[0118] In one possible implementation, the table filtering module 420 includes:

[0119] The metadata acquisition submodule is used to acquire the metadata of each data column of the original structured data;

[0120] The first calculation submodule is used to calculate the first matching degree between the query information and each metadata;

[0121] The filtering submodule is used to filter data columns based on the first matching degree corresponding to each metadata, and determine the sub-data columns;

[0122] A submodule is constructed to build the sublist based on the subdata columns.

[0123] In one possible implementation, the response generation module 440 includes:

[0124] The second calculation submodule is used to calculate the second matching degree between the query information and the sampled values ​​of each data column;

[0125] The sample value determination submodule is used to determine the target sample value based on the second matching degree corresponding to the sample values ​​of each data column;

[0126] The response generation submodule is used to generate response information corresponding to the question information based on the data row where the target sample value is located, using a large language model.

[0127] In summary, the question-answering device based on a large language model provided in this application, after acquiring the original structured data and question information, performs metadata filtering on the original structured data according to the question information to obtain a sublist of the original structured data. Then, it samples data from each column of the sublist without repetition of data rows, generating corresponding response information based on the sampled values ​​of each data column and the question information. Filtering data columns using metadata and performing non-repetitive sampling of each data column reduces the volume of structured data, thereby reducing noise interference and effectively avoiding the large language model receiving too much data. The strategy of independent column sampling preserves key data features and avoids overfitting caused by fixed row associations in the large language model, enhancing the model's understanding of data distribution. Furthermore, inputting the sampled structured data and question information into the large language model effectively compensates for the model's shortcomings in structured data reasoning, generating more accurate responses and thus improving the large language model's ability to process structured data.

[0128] Figure 5 A structural block diagram of a computer device 500 illustrated in an exemplary embodiment of this application is shown. This computer device can be implemented as a server as described in the above-described scheme of this application. The computer device 500 includes a Central Processing Unit (CPU) 501, a system memory 504 including Random Access Memory (RAM) 502 and Read-Only Memory (ROM) 503, and a system bus 505 connecting the system memory 504 and the CPU 501. The computer device 500 also includes a mass storage device 506 for storing an operating system 509, application programs 510, and other program modules 511. The aforementioned system memory 504 and mass storage device 506 can be collectively referred to as memory.

[0129] According to various embodiments of this disclosure, the computer device 500 can also be connected to a remote computer on a network, such as the Internet. That is, the computer device 500 can be connected to a network 508 via a network interface unit 507 connected to the system bus 505, or it can use the network interface unit 507 to connect to other types of networks or remote computer systems (not shown).

[0130] The memory also includes at least one instruction, at least one program, code set, or instruction set, which are stored in the memory. The central processing unit 501 executes the at least one instruction, at least one program, code set, or instruction set to implement all or part of the steps in the question-answering method based on the large language model shown in the above embodiments.

[0131] Figure 6 A structural block diagram of a computer device 600 illustrating an exemplary embodiment of this application is shown. The computer device 600 can be implemented as the aforementioned terminal device, such as a smartphone, tablet computer, laptop computer, desktop computer, etc. The computer device 600 may also be referred to as user equipment, portable terminal, laptop terminal, desktop terminal, or other names.

[0132] Typically, computer device 600 includes a processor 601 and a memory 602.

[0133] In some embodiments, the computer device 600 may optionally include a peripheral device interface 603 and at least one peripheral device. The processor 601, memory 602, and peripheral device interface 603 can be connected via a bus or signal line. Each peripheral device can be connected to the peripheral device interface 603 via a bus, signal line, or circuit board. Specifically, the peripheral device includes at least one of the following: a radio frequency circuit 604, a display screen 605, a camera assembly 606, an audio circuit 607, and a power supply 608.

[0134] In some embodiments, the computer device 600 further includes one or more sensors 609. The one or more sensors 609 include, but are not limited to, an accelerometer 610, a gyroscope 611, a pressure sensor 612, an optical sensor 613, and a proximity sensor 614.

[0135] Those skilled in the art will understand that Figure 6 The structure shown does not constitute a limitation on the computer device 600, and may include more or fewer components than shown, or combine certain components, or use different component arrangements.

[0136] In one exemplary embodiment, a computer-readable storage medium is also provided, which stores at least one computer program that is loaded and executed by a processor to implement the above-described question-answering method based on a large language model, and / or all or part of the steps in the question-answering method based on a large language model. For example, the computer-readable storage medium may be a read-only memory (ROM), a random access memory (RAM), a compact disc read-only memory (CD-ROM), magnetic tape, floppy disk, and optical data storage device, etc.

[0137] In one exemplary embodiment, a computer program product is also provided, comprising a computer program stored on a non-transitory computer-readable storage medium, the computer program including program instructions that, when executed by a computer, cause the computer to perform the above-described actions. Figure 1 or Figure 2 The embodiments illustrate all or part of the steps of the question-answering method based on a large language model.

[0138] Other embodiments of this application will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of this application that follow the general principles of this application and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this application are indicated by the claims.

[0139] It should be understood that this application is not limited to the precise structure described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this application is limited only by the appended claims.

Claims

1. A method for question answering based on a large language model, characterized in that, The method includes: Obtain the raw structured data and the question information; Based on the query information, the original structured data is filtered for metadata to obtain a sublist of the original structured data; Each data column in the sublist is sampled to obtain a sampled value for each data column; the sampled values ​​for each data column are located in different data rows. Based on the sampled values ​​of each data column and the question information, the response information corresponding to the question information is generated through a large language model.

2. The method according to claim 1, characterized in that, The sampling of each data column in the sublist to obtain sampled values ​​for each data column includes: After the data of the target data row in the first data column is extracted, a sampled label is added to the target data row; the first data column is any data column in the sub-list; When sampling the second data column, skip the data rows with the sampled labels, the second data column being any data column other than the first data column.

3. The method according to claim 1 or 2, characterized in that, The sampling of each data column in the sublist to obtain sampled values ​​for each data column includes: Determine the data format of each data column in the sublist; Based on the data format of each data column and the sampling method of each data format, each data column in the sublist is sampled to obtain the sampled value of each data column.

4. The method according to claim 3, characterized in that, Determining the data format of each data column in the sublist includes: Determine the data format of each data item in the target data column; the target data column is any data column in the sub-list. The data formats of each data point are statistically analyzed, and the data format with the most data points is determined as the data format of the target data column.

5. The method according to claim 1, characterized in that, The step of filtering the raw structured data based on the query information to obtain a sublist of the raw structured data includes: Obtain the metadata of each data column of the original structured data; Calculate the first matching degree between the query information and each piece of metadata; Data columns are filtered based on the first matching degree of each metadata element to determine sub-data columns; The sublist is constructed based on the sub-data columns.

6. The method according to claim 1, characterized in that, The process of generating response information corresponding to the question information using a large language model based on the sampled values ​​of each data column and the question information includes: Calculate the second degree of matching between the query information and the sampled values ​​of each data column; The target sample value is determined based on the second matching degree corresponding to the sample value of each data column; Based on the data in the row where the target sample value is located, the response information corresponding to the question information is generated through a large language model.

7. A question-answering device based on a large language model, characterized in that, The device includes: The information acquisition module is used to acquire raw structured data and question information; The table filtering module is used to filter the original structured data based on the query information to obtain a sublist of the original structured data; The sampling module is used to sample each data column in the sublist to obtain the sampled value of each data column; the sampled values ​​of each data column are located in different data rows; The response generation module is used to generate response information corresponding to the question information based on the sampled values ​​of each data column and the question information through a large language model.

8. A computer device, characterized in that, The computer device includes a processor and a memory, the memory storing at least one computer program, which is loaded and executed by the processor to implement the question-answering method based on a large language model as described in any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores at least one computer program, which is loaded and executed by a processor to implement the question-answering method based on a large language model as described in any one of claims 1 to 6.

10. A computer program product, characterized in that, The computer program product includes a computer program stored on a non-transitory computer-readable storage medium, the computer program including program instructions that, when executed by a computer device, cause the computer device to perform the question-answering method based on a large language model as described in any one of claims 1 to 6.