Question processing method, construction method, device and equipment based on large language model

By constructing prompt sentences and inputting them into the large language model, the problem of divergence and uncertainty of the large language model in processing questions is solved, more stable output results are achieved, and a wider range of application needs are met.

CN117473062BActive Publication Date: 2024-10-01BEIJING BAIDU NETCOM SCI & TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311507880.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-11-13
Publication Date
2024-10-01
Estimated Expiration
2043-11-13

AI Technical Summary

Technical Problem

Large language models have divergence and uncertainty when processing questions, and cannot meet the needs of some scenarios.

Method used

By obtaining the data fields and format information in the target question and target data model, construct prompt statements and input the large language model to generate results in the target format, establish the relationship between the question and the data model, and improve the format stability of the output.

Benefits of technology

The format stability of the large language model output is improved, allowing it to more accurately parse and process target problems, generate results in specified data formats, and meet a wider range of application needs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117473062B_ABST
    Figure CN117473062B_ABST
Patent Text Reader

Abstract

The present disclosure provides a question processing method, construction method, device and equipment based on a large language model, which relates to technical fields such as deep learning and natural language processing. The question processing method includes: obtaining a target question to be processed; obtaining a data field in a target data model, and obtaining target format information of a specified data format; constructing a prompt statement according to the data field in the target data model, the target format information and the target question; inputting the prompt statement into a large language model to obtain a target format result output by the large language model. The above technical solution can convert the target question into a specified data format, thereby improving the format stability of the target format result.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of artificial intelligence technology, specifically to the technical fields of deep learning, natural language processing, etc. Specifically, it relates to a question processing method, construction method, device and equipment based on a large language model. Background Art

[0002] A large language model (LLM) is a generative language model characterized by its large size, large number of parameters and training data. By using more parameters and larger data sets for training, its performance and sample efficiency on various downstream tasks are effectively improved.

[0003] However, the results returned by large models are divergent and uncertain, and cannot meet the needs in some scenarios. Summary of the invention

[0004] The present disclosure provides a question processing method, construction method, device and equipment based on a large language model.

[0005] According to one aspect of the present disclosure, a question processing method based on a large language model is provided, comprising:

[0006] Get the target problem to be processed;

[0007] Get the data fields in the target data model and get the target format information of the specified data format;

[0008] Constructing a prompt statement according to the data fields in the target data model, the target format information and the target question;

[0009] The prompt sentence is input into the large language model to obtain a target format result output by the large language model.

[0010] According to one aspect of the present disclosure, a method for constructing a prompt sentence is provided, comprising:

[0011] Get the target problem to be processed;

[0012] Get the data fields in the target data model and get the target format information of the specified data format;

[0013] A prompt statement is constructed according to the data fields in the target data model, the target format information and the target question.

[0014] According to one aspect of the present disclosure, a question processing device based on a large language model is provided, comprising:

[0015] A problem acquisition module is used to acquire the target problem to be processed;

[0016] The field format module is used to obtain the data fields in the target data model and obtain the target format information of the specified data format;

[0017] A prompt statement module, used for constructing a prompt statement according to the data fields in the target data model, the target format information and the target question;

[0018] The result module is used to input the prompt sentence into the large language model to obtain the target format result output by the large language model.

[0019] According to one aspect of the present disclosure, a device for constructing a prompt statement is provided, comprising:

[0020] A problem acquisition module is used to acquire the target problem to be processed;

[0021] The field format module is used to obtain the data fields in the target data model and obtain the target format information of the specified data format;

[0022] The prompt statement module is used to construct a prompt statement according to the data fields in the target data model, the target format information and the target question.

[0023] According to another aspect of the present disclosure, there is provided an electronic device, the electronic device comprising:

[0024] at least one processor; and

[0025] a memory communicatively connected to the at least one processor; wherein,

[0026] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method provided by any embodiment of the present disclosure.

[0027] According to another aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to enable a computer to execute the method provided by any embodiment of the present disclosure.

[0028] According to another aspect of the present disclosure, a computer program product is provided, including a computer program, wherein when the computer program is executed by a processor, the method provided according to any embodiment of the present disclosure is implemented.

[0029] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] The accompanying drawings are used to better understand the present solution and do not constitute a limitation of the present disclosure.

[0031] Figure 1 is a flowchart of a question processing method based on a large language model provided according to an embodiment of the present disclosure;

[0032] Figure 2 is a flowchart of another question processing method based on a large language model provided according to an embodiment of the present disclosure;

[0033] Figure 3a is a flowchart of another question processing method based on a large language model provided according to an embodiment of the present disclosure;

[0034] Figure 3b is a schematic diagram of a prompt structure provided according to an embodiment of the present disclosure;

[0035] Figure 4 is a schematic diagram of a prompt structure provided according to an embodiment of the present disclosure;

[0036] Figure 5 is a flowchart of a method for constructing a prompt statement according to an embodiment of the present disclosure;

[0037] Figure 6 is a structural diagram of a question processing device based on a large language model provided according to an embodiment of the present disclosure;

[0038] Figure 7 It is a structural schematic diagram of a device for constructing a prompt statement provided according to an embodiment of the present disclosure;

[0039] Figure 8 It is a block diagram of an electronic device used to implement the question processing method or prompt sentence construction method based on a large language model of the embodiment of the present disclosure. DETAILED DESCRIPTION

[0040] Figure 1 The flowchart of a question processing method based on a large language model provided according to an embodiment of the present disclosure. The method is applicable to the case of a prompt statement (prompt) project of a large language model. The method can be executed by a question processing device based on a large language model, which can be implemented in software and / or hardware and can be integrated into an electronic device. Figure 1 As shown, the question processing method based on the large language model of this embodiment may include:

[0041] S101, obtaining the target problem to be processed;

[0042] S102, obtaining data fields in a target data model, and obtaining target format information of a specified data format;

[0043] S103, constructing a prompt statement according to the data fields in the target data model, the target format information and the target question;

[0044] S104, inputting the prompt sentence into the large language model to obtain a target format result output by the large language model.

[0045] Among them, prompt refers to the prompt sentence provided to the large language model, which can be a given question, task or instruction to guide the model's language generation process. The content of the prompt depends on the user's needs and task type. The data model is used to describe, organize or operate data. The data model can be regarded as a simplification and abstraction of the real world, used to describe entities, attributes and relationships between entities. Specifically, a pre-built data table can be selected as the target data model, so that the large language model can parse the target question into a specified data format based on the target data model.

[0046] The data fields in the target data model can be dimensions and measures in the target data model. Dimensions can describe the attributes or characteristics of data and are used to group, classify, filter and screen data. Dimensions provide context and classification for data and generally have discrete values. A measure is a measure of a business indicator, which is used to measure, calculate and analyze the numerical indicators or calculation results of data. It is usually a continuous numerical value, which is computable and can be aggregated, calculated and counted. For example, the target data model may include at least one of the following dimensions: order number, order date, region, province, city, product name, product category, product subcategory, customer name, customer type code, shipping date, mailing method; the target data model may also include at least one of the following measures: quantity, sales, cost, profit. The specified data format may be a fixed serialization format, and the target format information of the specified data format is used to describe the specified data format.

[0047] The prompt statement can be constructed according to the data fields, target format information and target question in the target data model. By introducing the data fields of the target data model in the prompt statement, the large language model can establish the relationship between the target question and the data fields. By introducing the target format information of the specified data format in the prompt statement, the large language model converts the target question into the specified data format, and the target format result of the specified data format can be used to query the target data model to obtain the answer to the target question, that is, the target format result can be used as a bridge between the large language model and the target data model, so as to facilitate the parsing of the target format result. Therefore, by adopting a prompt statement composed of multiple parts, the large language model understands the meaning of the target question and generates a target format result of the specified data format.

[0048] In an optional implementation, the target format result is used to establish a relationship between the target question and a data field in the target data model, and the target format result is a serialization result.

[0049] Among them, the specified serialization format can be a specified JSON (JavaScript Object Notation, JS object notation) format. The target format result can be a result in a specified JSON format. Therefore, the large language model can convert the target question into a result in a specified JSON format based on the data fields in the target data model. For example, the target question: sales in January this year can be converted into: {"dimensions":[],"measures":["sales"],"filters":[{"k":"order date","linkType":"between","v":["2023-01-01","2023-01-31"]}]}.

[0050] By converting the target question into a target format result in a specified serialization format, it can be used to query the target data model to obtain the answer to the target question, so that the target format result can be used as a bridge between the large language model and the target data model to facilitate the parsing of the target format result.

[0051] The technical solution provided by the embodiment of the present disclosure, by constructing an engineered prompt, enables the large language model to learn through the incoming prompt, establishes the relationship between the target question and the target data model, and outputs the target format result in a specified serialized format based on the relationship. In other words, through the prompt engineering, the large language model uses the data fields in the target data model to process the target question into a serialized target format result, thereby improving the format stability of the large language model output. The serialized target format result is used to query the target data model to obtain the answer to the target question, so that the target format result can be used as a bridge between the large language model and the target data model, which is convenient for parsing the target format result.

[0052] Figure 2 FIG. 1 is a flowchart of another question processing method based on a large language model provided according to an embodiment of the present disclosure. Figure 2 The training method of the intelligent customer service model of this embodiment may include:

[0053] S201, obtaining the target problem to be processed;

[0054] S202, obtaining data fields in a target data model, and obtaining target format information of a specified data format; wherein the target format information includes preset dimension fields, metric fields, and filtering conditions, placing a target dimension hit by the target question in the target data model into the dimension field, placing a target metric hit by the target question in the target data model into the metric field, and placing a field to be filtered in the target question into the filtering condition;

[0055] S203, constructing a prompt statement according to the data fields in the target data model, the target format information and the target question;

[0056] S204, inputting the prompt sentence into the large language model to obtain a target format result output by the large language model.

[0057] Among them, the target format information of the specified data format may include the format description of the specified data format. The format description of the specified data format may include preset dimension fields "dimensions", measurement fields "measures" and filter conditions "filters". Specifically, the target question may be matched with the dimensions and measures in the target data model to obtain the target dimensions and target fields hit by the target question, and the filter conditions may also be obtained. The filter conditions may include dimensions to be filtered and / or measures to be filtered, which may also be called filter conditions.

[0058] In the disclosed embodiment, the target dimension hit by the target question in the target data model can be placed in the dimension field "dimensions", the target metric hit by the target question in the target data model can be placed in the metric field "measures", and the to-be-filtered field in the target question can be placed in the filter condition "filters". By introducing the format description of the specified data format in the prompt, the large language model can perform prompt learning based on the format description of the specified data format, thereby converting the target question into the specified data format.

[0059] In an optional implementation, the filtering condition adopts an array structure, and the filtering condition includes a preset first subfield, a second subfield, and a third subfield, the first subfield is used to represent the field to be filtered, the second subfield is used to represent the filtering value used by the field to be filtered, and the third subfield represents the operator of the filtering condition.

[0060] The filtering condition has three elements: the field to be filtered, the filtering value used by the field to be filtered, and the filtering operator. By introducing the first subfield, the second subfield, and the third subfield in the filtering condition, the field to be filtered can be placed in the first subfield, the filtering value used by the field to be filtered can be placed in the second subfield, and the filtering operator can be placed in the third subfield. The format of the filtering condition can be as follows: "filters":[{"k":"___","linkType":"___","v":["___"]}, where k, v, and linkType are the first subfield, the second subfield, and the third subfield, respectively. Through the filtering condition of the above array structure, the modeling of the filtering condition in the specified data format is realized.

[0061] In addition, the target format information of the specified data format may further include a style of the specified data format. For example, the style of the specified data format may be as follows: {"dimensions":["___"],"measures":["___"],"filters":[{"k":"___","linkType":"___","v":["___"]},{"k":"___","linkType":"___","v":["___"]}]}.

[0062] By introducing the style of the specified data format in the prompt and providing two filtering conditions in the specified data format, the large language model can not only learn the specified data format, but also learn that the filtering conditions are not unique.

[0063] The technical solution provided by the embodiment of the present disclosure provides dimension fields, metric fields and filtering conditions in the format description of the specified data format, and provides filtering conditions for the array structure, so that the large language model can learn the specified data format through prompt learning, thereby converting the target problem into a target format result of the specified data format.

[0064] In an optional implementation, the method further includes: acquiring at least one data record from the target data model; generating sample data for the data field according to the at least one data record; and adding the sample data of the data field to the prompt statement.

[0065] In order to facilitate learning of data fields, sample data of data fields in the target data model can also be introduced in the prompt, especially sample data of dimensions in the target data model. Specifically, a preset value data record can be obtained from the target data model, and the obtained data record can be used to generate sample data for the dimension. For example, sample data of a data field may be as follows:|Order number|Region|Province|City|Product name|Product category|Product subcategory|Customer name|Customer type code|Postal method||------|------|------|------|------|------|------|------|------|------|SD0020190315××××|Northeast China|Shanghai|Qitaihe|316 stainless steel frying pan, cooking pan, less oil smoke, non-coated non-stick pan|Office supplies|T-shirt|Zhang San|A|Speed ​​up||SD0020190315××××|East China|Yunnan|Wanning|Apple 2019 MacBook-Pro-13.3|Home|Underwear|Li Si|B|Ordinary mail|

[0066] Figure 3a is a flowchart of another method for processing questions based on a large language model according to an embodiment of the present disclosure. Figure 3a The question processing method based on the large language model of this embodiment may include:

[0067] S301, obtaining a target problem to be processed;

[0068] S302, obtaining data fields in a target data model, and obtaining target format information of a specified data format;

[0069] S303, constructing a prompt statement according to the data fields in the target data model, the target format information and the target question; the prompt statement also includes a sample question and a sample answer in at least two small samples; the sample answer adopts a specified data format.

[0070] S304, inputting the prompt sentence into the large language model to obtain a target format result output by the large language model.

[0071] Figure 3b is a schematic diagram of a prompt structure provided according to an embodiment of the present disclosure; Figure 3b , prompt may include not only data fields in the target data model, target format information specifying the data format, target questions, but also a few-shot.

[0072] Few-shot learning is a method of learning and generalizing by using a small number of labeled samples, which can help us solve machine learning problems when data is scarce. In other words, small samples are used for effective learning and generalization when data is scarce. Small samples consist of sample questions and sample answers, and the sample answers use a specified data format, which means that the sample answers use the same data format as the target format results to be output, and can further use the specified JSON format. By introducing small samples in the prompt, the large language model can learn from a small number of sample questions and sample answers, further improving the quality of the target format results output by the large language model.

[0073] In an optional implementation, the fields in the sample answer are randomly selected from data fields in the target data model.

[0074] By randomly selecting some dimensions and fields from the dimensions and metrics of the target data model to construct sample answers, instead of using fixed dimensions and metrics to generate sample answers, and by introducing randomness in small sample learning, the coverage of small sample learning can be further improved, thereby improving the performance of the large language model.

[0075] Among them, at least one sample answer includes a dimension field, a metric field and a filter condition, and at least one sample answer lacks at least one of the dimension field, the metric field or the filter condition.

[0076] At least one sample answer includes dimension fields, metric fields, and filter conditions in the specified data format, that is, it has a complete specified data format; at least one sample answer lacks at least one of the dimension fields, metric fields, and filter conditions, so that the large language model learns that the dimension fields, metric fields, and filter conditions are not fields that must be returned. If some of them are missing, only the remaining fields can be returned. For example, if the filter conditions are missing, only the dimension fields and metric fields can be returned. By providing sample answers that lack filter conditions, dimension fields, or metric fields, the flexibility of the target format results can be improved.

[0077] In an optional implementation, if there is a date-type data dimension in the target data model, the first subfield in the screening condition of at least one sample answer is of date type.

[0078] If there is a date-type data dimension in the data model, you can introduce at least one small sample with the date-type dimension as the field to be filtered, so as to improve the learning effect of the large language model on the date-type dimension.

[0079] In an optional implementation, if there is a data dimension of geographic location type in the target data model, the first subfield in the screening condition of at least one sample answer is also of geographic location type.

[0080] If there is a geographic location data dimension in the data model, at least one small sample with the geographic location dimension as the field to be filtered can be introduced to improve the learning effect of the large language model on the geographic location dimension.

[0081] The technical solution provided by the embodiment of the present disclosure further introduces small samples in the prompt, so that the large language model can learn through a small number of sample questions and sample answers, thereby further improving the quality of the target format results output by the large language model.

[0082] In an optional embodiment, the prompt statement also includes at least one of the following strategies: a time strategy, which is used to process the time description information into a target time according to the current time when there is time description information in the target question, and put the target time into the filtering conditions of the target format results; an example data strategy, which is used to filter out the example data of any data field from the filtering conditions of the target format results when there is example data of the data field in the filtering conditions of the target format results and the example data of the data field does not exist in the target question; a field strategy, which is used to control the field to be filtered in the filtering conditions in the target format results to be the same as the data field in the target data model.

[0083] refer to Figure 3b , prompt can include not only the data fields in the target data model, the target format information of the specified data format, the target question, and the small sample, but also the strategy (also called precautions). By introducing precautions in the prompt to further constrain the specified data format, the quality of the target format results output by the large language model can be further improved.

[0084] Among them, the time strategy is used for target questions with time description information. According to the current time, the time description information is processed into the target time, and the target time is put into the filter condition, thereby improving the learning ability of the large language model for time description information. For example, the time strategy can be as follows: the current time is a certain year, month, and day. For the user's questions that contain relevant words such as this month, this week, last week, last month, this quarter, this year, this quarter, this Q, Q1, and Q2, the specific date needs to be calculated based on the current time and put into the filter condition "filters".

[0085] The sample data strategy is used to filter out the sample data of any data field from the filter conditions when there is sample data of any data field in the filter conditions, but there is no sample data of the data field in the target question, thereby improving the quality of the filter conditions. For example, the sample data strategy can be as follows: If the value of the dimension sample data does not appear in the user's question, do not put the sample data information in the filter condition "filters" of the returned results.

[0086] Among them, the field strategy is used to keep the name of the field to be filtered in the filter condition consistent with the name of the data field in the target data model, so that the field to be filtered can hit the data field in the target data model, thereby improving the quality of the field to be filtered and facilitating the subsequent use of the field to be filtered to query the target data model to get the answer to the target question. For example, the field strategy can be as follows: the "k" field in "filters" must have the same name as the dimension or measure in the target data model.

[0087] It should also be noted that the prompt statement can also include a numerical processing strategy, which is used to convert the data content in the target question into a numerical format, thereby improving the learning ability of the large language model for the data content. For example, the numerical processing strategy can be as follows: the data summarized in the question needs to be converted into specific numbers, for example: 10,000 needs to be converted into 10,000, and needs to be converted into specific values ​​according to the data content mentioned in the question.

[0088] Figure 4 is a schematic diagram of a structure of a prompt statement provided according to an embodiment of the present disclosure. Figure 4 , the prompt statement may include: data fields in the target data model, sample data for the data fields, target format information, strategies, few-shots, and target questions.

[0089] refer to Figure 4 For data fields (field schema information), since data fields are generally stored in the database with English names, the mapping relationship between the English name and the Chinese name of the data field is obtained by obtaining the field description of the data field or naming the data field in Chinese at the data model layer. The Chinese name of the data field is used for description in the prompt, so that subsequent questions can be asked using the Chinese name of the data field.

[0090] In the case where there is no sample data of the data field introduced in the prompt, when asking [What is the sales volume in Shanghai], the large language model may put Shanghai in the regional dimension, causing a parsing error. By introducing sample data of the data field in the prompt, the large language model is prompted with the name of the data field represented by the sample data, so that the large language model can perform inference learning based on the sample data. For example, when asking about the sales volume of "Shijiazhuang", the large language model can perform inference based on the given sample data and return the "city" dimension, increasing the accuracy of the target format result; in addition, if the target question includes sample data of the data field, the accuracy of the target format result can also be increased.

[0091] The format description of the data format specified in the target format information is used to tell the large language model the format of the output data, the information from which the fields in the specified data format need to be obtained, and the specific composition of the screening conditions. The target format information can also include the style of the specified data format, so that the result format returned by the large language model is fixed, which is convenient for subsequent parsing of the target format results.

[0092] The precautions may include at least one of the following:

[0093] A. The large language model is not very sensitive to time description information. By adding the current specific date in the notes and telling it some possible time description information, it is necessary to perform specific time processing on the time description information to improve its learning ability for time description information. For example, if a user asks "What was the sales volume in Hebei Province last year?", the large language model needs to parse the time description information "last year" into "2022-01-01, 2022-12-31" and put it into the screening conditions.

[0094] B. If the sample data of the data dimension does not appear in the target problem to be processed, do not put the sample data into the "filters" of the returned results. The above processing can avoid data that is not related to the target problem from appearing in the filter conditions.

[0095] C. The second subfield in the filter condition must be exactly the same as the name of the data dimension or data measure in the target data model. For example, for the target question "What is the sales volume in Hebei?", if there is no "sales volume" field in the target data model, but only the "volume" field, then we want it to return the "volume" field, so we describe it here, and hope that it can infer and find the data dimension or data measure that has appeared and is similar when it returns, as the second subfield in the filter condition.

[0096] D. The data content summarized in the target question needs to be converted into a specific array. Taking the target question "What are the products with sales greater than 10,000" as an example, the large language model can return 10,000 as the value of the screening condition, but what is wanted is a specific value such as 10,000, so it is explained in the precautions.

[0097] For small samples, the dimensions and metrics in the sample answers of small samples can be randomly obtained from the target data model and are not fixed. The details are as follows:

[0098] a. For small samples of date type, if there are date and date-time type fields in the dimension field of the target data model, small samples of date type can be added. The corresponding small samples can be as follows:

[0099] Question: Sales in January this year

[0100] Answer: {"dimensions":[],"measures":["Sales"],"filters":[{"k":"Order Date","linkType":"between","v":["2023-01-01","2023-01-31"]}]}

[0101] b. For geographical location-based small samples, if the target data model has geographical location-based data dimensions, geographical location-based small samples can be added. The corresponding small samples can be as follows:

[0102] Question: Show me the sales volume of Shanghai

[0103] Answer: {"dimensions":["Province"],"measures":["Sales"],"filters":[{"k":"Province","linkType":"=","v":"Shanghai"}]}

[0104] c. The filter condition is not a field that must be returned. When there is no filter condition, only the dimension and measure are returned. The corresponding small sample is as follows:

[0105] Question: Sales volume by city

[0106] Answer: {"dimensions":["city"],"measures":["sales"]}

[0107] In addition, two of the three small samples mentioned above have screening conditions that can increase the learning weight of the screening conditions.

[0108] In summary, taking the target question "What is the sales volume of each province in North China?" as an example, the constructed prompt example is as follows:

[0109] Please extract relevant information from the dimensions and measures of the data based on the user's question:

[0110] The schema data dimension fields are: order number, order date, region, province, city, product name, product category, product subcategory, customer name, customer type code, delivery date, mailing method, regional grouping, bucketing, custom bucketing, digital grouping test

[0111] The data measurement fields are: quantity, sales, cost, test, test count, profit

[0112] Sample data of dimensions are as follows for better accuracy:

[0113] |Order Number|Region|Province|City|Product Name|Product Category|Product Subcategory|Customer Name|Customer Type Code|Postal Method|

[0114] |------|------|------|------|------|------|------|------|------|------|------|------|

[0115] |SD002019 0315××××|Northeast China|Shanghai|Qitaihe|316 stainless steel frying pan, cooking pan, less smoke, non-coated non-stick pan|office supplies|T-shirt|Zhang San|A|speed up|

[0116] |SD0020190315××××|East China|Yunnan|Wanning|Apple 2019 MacBook-Pro-13.3|Home|Underwear|Li Si|B|Ordinary Mail|

[0117] |SD0020190315××××|Central China|Inner Mongolia|Sanya|A Wardrobe - Storage 1.6m 1.8m Wardrobe Wooden|Home Appliances|Kitchenware|Wang Er|C|Standard Mail|

[0118] |SD0020190315××××|North China|Beijing|Sanming|BABAMA original trendy wool hat hip-hop hat for men|Clothing|Coat|Armor|undefined|Express|

[0119] |SD0020190315××××|South China|Jilin|Sansha|Baleno short-sleeved T-shirt for men|undefined|Furniture|B|undefined|undefined|

[0120] The output content is in JSON format, parsing the user's question, putting the parsed dimensions into "dimensions", and putting the parsed measures into "measures".

[0121] Put the parsed filter conditions into "filters". "Filters" is an array corresponding to multiple filter conditions. Each filter condition contains three fields: "k", "v", and "linkType". "k" indicates the dimension or measure to be filtered, "v" indicates the value of the filter condition, and "linkType" indicates the operator of the filter condition. Currently, the following are supported: greater than >, less than <, equal to =, not equal to ! =, between, including in.

[0122] Notice:

[0123] 1. The current time is: 2023-06-27. For the related words such as this month, this week, last week, last month, this quarter, this year, this quarter, this Q, Q1, Q2, etc. that appear in the user's questions, it is necessary to calculate the specific date based on the current time and put it in "filters".

[0124] 2. If the value of the dimension sample data does not appear in the user's question, do not put the sample data information into the "filters" of the returned results.

[0125] 3. The "k" field in "filters" must strictly match the data dimension or measure field name.

[0126] 4. The data summarized in the question needs to be converted into specific numbers. For example, 10,000 needs to be converted into 10,000. It needs to be converted into specific data based on the numbers mentioned in the question.

[0127] The general format of the output is as follows:

[0128] {"dimensions":["___"],"measures":["___"],"filters":[{"k":"___","linkType":"___","v":["___"]},{"k":"___","linkType":"___","v":["___"]}]}

[0129] Question: Sales in January this year

[0130] Answer: {"dimensions":[],"measures":["Sales"],"filters":[{"k":"Order Date","linkType":"between","v":["2023-01-01","2023-01-31"]}]}

[0131] Question: Show me the sales volume of Shanghai

[0132] Answer: {"dimensions":["Province"],"measures":["Sales"],"filters":[{"k":"Province","linkType":"=","v":"Shanghai"}]}

[0133] Question: Sales volume by city

[0134] Answer: {"dimensions":["city"],"measures":["sales"]}

[0135] Query question: What is the sales volume of each province in North China?

[0136] Answer:

[0137] Figure 5 1 is a flowchart of a method for constructing a prompt statement according to an embodiment of the present disclosure. The method is applicable to the case of a prompt statement engineering of a large language model. The method can be executed by a prompt statement construction device, which can be implemented in software and / or hardware and can be integrated into an electronic device. Figure 5 As shown, the method for constructing the prompt statement of this embodiment may include:

[0138] S501, obtaining the target problem to be processed;

[0139] S502, obtaining data fields in a target data model, and obtaining target format information of a specified data format;

[0140] S503: Construct a prompt statement according to the data fields in the target data model, the target format information and the target question.

[0141] In an optional implementation, the target format result is used to establish a relationship between the target question and a data field in the target data model, and the target format result is a serialization result.

[0142] In an optional implementation, the target format information includes preset dimension fields, metric fields and filtering conditions, which are used to place the target dimension hit by the target question in the target data model into the dimension field, place the target metric hit by the target question in the target data model into the metric field, and place the field to be filtered in the target question into the filtering condition.

[0143] In an optional implementation, the filtering condition adopts an array structure, and the filtering condition includes a preset first subfield, a second subfield, and a third subfield, the first subfield is used to represent the field to be filtered, the second subfield is used to represent the filtering value used by the field to be filtered, and the third subfield represents the operator of the filtering condition.

[0144] In an optional implementation, the method for constructing the prompt statement further includes:

[0145] Retrieve at least one data record from the target data model;

[0146] generating example data for the data field based on the at least one data record;

[0147] Add sample data for the data fields to the prompt statement.

[0148] In an optional implementation, the prompt statement further includes sample questions and sample answers in at least two small samples; the sample answers are in a specified data format.

[0149] In an optional implementation, the fields in the sample answer are randomly selected from data fields in the target data model.

[0150] In an optional implementation, at least one sample answer includes a dimension field, a metric field, and a filter condition, and at least one sample answer lacks at least one of the dimension field, the metric field, or the filter condition.

[0151] In an optional implementation, if there is a date-type data dimension in the target data model, the first subfield in the screening condition of at least one sample answer is of date type.

[0152] In an optional implementation, if there is a data dimension of geographic location type in the target data model, the first subfield in the screening condition of at least one sample answer is also of geographic location type.

[0153] In an optional implementation manner, the prompt statement further includes at least one of the following strategies:

[0154] A time strategy, for processing the time description information into a target time according to the current time when the target question has the time description information, and putting the target time into the screening condition of the target format result;

[0155] The sample data strategy is used to filter out the sample data of any data field from the filter conditions of the target format results when there is sample data of the data field in the filter conditions of the target format results and there is no sample data of the data field in the target question;

[0156] Field strategy is used to control the filter fields in the target format results to be the same as the data fields in the target data model.

[0157] The technical solution provided by the embodiment of the present disclosure, by constructing an engineered prompt, allows the large language model to learn and output a fixed JSON format through the incoming prompt, that is, the conversion of the large language model to JSON is realized, which can be represented by NL2JSON. Compared with emphasizing the input format to make the large language model output the desired parseable JSON data, this case uses systematic prompt engineering to enable the large language model to stably understand the target problem and convert the target problem into a specified data format, that is, to obtain a fixed format target format result.

[0158] Figure 6 1 is a schematic diagram of a question processing device based on a large language model according to an embodiment of the present disclosure. This embodiment is applicable to the case of a prompt statement (prompt) project of a large language model. The device can be implemented in software and / or hardware. Figure 6 As shown, the question processing device 600 based on the large language model of this embodiment may include:

[0159] A question acquisition module 610 is used to acquire a target question to be processed;

[0160] The field format module 620 is used to obtain the data fields in the target data model and obtain the target format information of the specified data format;

[0161] A prompt statement module 630, configured to construct a prompt statement according to the data fields in the target data model, the target format information and the target question;

[0162] The result module 640 is used to input the prompt sentence into the large language model to obtain the target format result output by the large language model.

[0163] In an optional implementation, the target format result is used to establish a relationship between the target question and a data field in the target data model, and the target format result is a serialization result.

[0164] In an optional implementation, the target format information includes preset dimension fields, metric fields and filtering conditions, which are used to place the target dimension hit by the target question in the target data model into the dimension field, place the target metric hit by the target question in the target data model into the metric field, and place the field to be filtered in the target question into the filtering condition.

[0165] In an optional implementation, the filtering condition adopts an array structure, and the filtering condition includes a preset first subfield, a second subfield, and a third subfield, the first subfield is used to represent the field to be filtered, the second subfield is used to represent the filtering value used by the field to be filtered, and the third subfield represents the operator of the filtering condition.

[0166] In an optional implementation, the large language model-based question processing device 600 further includes an example data module, and the example data module includes:

[0167] A record acquisition unit, configured to acquire at least one data record from the target data model;

[0168] an example generating unit, configured to generate example data for the data field according to the at least one data record;

[0169] The example adding unit is used to add example data of the data field to the prompt sentence.

[0170] In an optional implementation, the prompt statement further includes sample questions and sample answers in at least two small samples; the sample answers are in a specified data format.

[0171] In an optional implementation, the fields in the sample answer are randomly selected from data fields in the target data model.

[0172] In an optional implementation, at least one sample answer includes a dimension field, a metric field, and a filter condition, and at least one sample answer lacks at least one of the dimension field, the metric field, or the filter condition.

[0173] In an optional implementation, if there is a date-type data dimension in the target data model, the first subfield in the screening condition of at least one sample answer is of date type.

[0174] In an optional implementation, if there is a data dimension of geographic location type in the target data model, the first subfield in the screening condition of at least one sample answer is also of geographic location type.

[0175] In an optional implementation manner, the prompt statement further includes at least one of the following strategies:

[0176] A time strategy, for processing the time description information into a target time according to the current time when the target question has the time description information, and putting the target time into the screening condition of the target format result;

[0177] The sample data strategy is used to filter out the sample data of any data field from the filter conditions of the target format results when there is sample data of the data field in the filter conditions of the target format results and there is no sample data of the data field in the target question;

[0178] Field strategy is used to control the filter fields in the target format results to be the same as the data fields in the target data model.

[0179] The technical solution of the disclosed embodiment, by constructing an engineered prompt, allows the large language model to learn and output a fixed JSON format through the incoming prompt, that is, the conversion of the large language model to JSON is realized, which can be represented by NL2JSON. Compared with emphasizing the input format to make the large language model output the desired parseable JSON data, this case uses systematic prompt engineering to enable the large language model to stably understand the target problem and convert the target problem into a specified data format, that is, to obtain a fixed format target format result.

[0180] Figure 7 1 is a schematic diagram of a device for constructing a prompt statement according to an embodiment of the present disclosure. This embodiment is applicable to the case of a prompt statement (prompt) project of a large language model. The device can be implemented in software and / or hardware. Figure 7 As shown, the construction 700 of the prompt statement of this embodiment may include:

[0181] A question acquisition module 710 is used to acquire a target question to be processed;

[0182] The field format module 720 is used to obtain the data fields in the target data model and obtain the target format information of the specified data format;

[0183] The prompt statement module 730 is used to construct a prompt statement according to the data fields in the target data model, the target format information and the target question.

[0184] In an optional implementation, the target format result is used to establish a relationship between the target question and a data field in the target data model, and the target format result is a serialization result.

[0185] In an optional implementation, the target format information includes preset dimension fields, metric fields and filtering conditions, which are used to place the target dimension hit by the target question in the target data model into the dimension field, place the target metric hit by the target question in the target data model into the metric field, and place the field to be filtered in the target question into the filtering condition.

[0186] In an optional implementation, the filtering condition adopts an array structure, and the filtering condition includes a preset first subfield, a second subfield, and a third subfield, the first subfield is used to represent the field to be filtered, the second subfield is used to represent the filtering value used by the field to be filtered, and the third subfield represents the operator of the filtering condition.

[0187] In an optional implementation, the above-mentioned large language model-based question processing device 600 further includes an example data module, and the example data module includes:

[0188] A record acquisition unit, configured to acquire at least one data record from the target data model;

[0189] an example generating unit, configured to generate example data for the data field according to the at least one data record;

[0190] The example adding unit is used to add example data of the data field to the prompt sentence.

[0191] In an optional implementation, the prompt statement further includes sample questions and sample answers in at least two small samples; the sample answers are in a specified data format.

[0192] In an optional implementation, the fields in the sample answer are randomly selected from data fields in the target data model.

[0193] In an optional implementation, at least one sample answer includes a dimension field, a metric field, and a filter condition, and at least one sample answer lacks at least one of the dimension field, the metric field, or the filter condition.

[0194] In an optional implementation, if there is a date-type data dimension in the target data model, the first subfield in the screening condition of at least one sample answer is of date type.

[0195] In an optional implementation, if there is a data dimension of geographic location type in the target data model, the first subfield in the screening condition of at least one sample answer is also of geographic location type.

[0196] In an optional implementation manner, the prompt statement further includes at least one of the following strategies:

[0197] A time strategy, for processing the time description information into a target time according to the current time when the target question has the time description information, and putting the target time into the screening condition of the target format result;

[0198] The sample data strategy is used to filter out the sample data of any data field from the filter conditions of the target format results when there is sample data of the data field in the filter conditions of the target format results and there is no sample data of the data field in the target question;

[0199] Field strategy is used to control the filter fields in the target format results to be the same as the data fields in the target data model.

[0200] The technical solution of the disclosed embodiment, through the hierarchical description of each part in the prompt statement, each part has a specific meaning and function, so that the large language model can understand the business meaning through the incoming prompt statement, and can stably output JSON format data with specified data format and meaningful information, which can make it easier for users to parse and use the information returned by the large model in the project, and is more conducive to the engineering use of the results returned by the large model.

[0201] In the technical solution disclosed herein, the acquisition, storage and application of user personal information involved are in compliance with the provisions of relevant laws and regulations and do not violate public order and good morals.

[0202] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium and a computer program product.

[0203] Figure 8 It is a block diagram of an electronic device used to implement the question processing method or prompt sentence construction method based on a large language model of the embodiment of the present disclosure.

[0204] Figure 8 A schematic block diagram of an example electronic device 800 that can be used to implement an embodiment of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.

[0205] like Figure 8As shown, the electronic device 800 includes a computing unit 801, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 802 or a computer program loaded from a storage unit 808 into a random access memory (RAM) 803. In the RAM 803, various programs and data required for the operation of the electronic device 800 can also be stored. The computing unit 801, the ROM 802, and the RAM 803 are connected to each other via a bus 804. An input / output (I / O) interface 805 is also connected to the bus 804.

[0206] Multiple components in the electronic device 800 are connected to the I / O interface 805, including: an input unit 806, such as a keyboard, a mouse, etc.; an output unit 807, such as various types of displays, speakers, etc.; a storage unit 808, such as a disk, an optical disk, etc.; and a communication unit 809, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 809 allows the electronic device 800 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0207] The computing unit 801 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 801 include, but are not limited to, a central processing unit (CPU), an image processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 801 performs the various methods and processes described above, such as a question processing method based on a large language model or a construction method for a prompt statement. For example, in some embodiments, a question processing method based on a large language model or a construction method for a prompt statement may be implemented as a computer software program, which is tangibly included in a machine-readable medium, such as a storage unit 808. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 800 via ROM 802 and / or a communication unit 809. When the computer program is loaded into RAM 803 and executed by the computing unit 801, one or more steps of the question processing method based on a large language model or a construction method for a prompt statement described above may be executed. Alternatively, in other embodiments, the computing unit 801 may be configured to execute the question processing method or the prompt sentence construction method based on the large language model in any other appropriate manner (for example, by means of firmware).

[0208] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0209] The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

[0210] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0211] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).

[0212] The systems and techniques described herein may be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communications network). Examples of communications networks include: a local area network (LAN), a wide area network (WAN), and the Internet.

[0213] A computer system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship of client and server is generated by computer programs running on respective computers and having a client-server relationship with each other. The server may be a cloud server, a server of a distributed system, or a server combined with a blockchain.

[0214] Artificial intelligence is a discipline that studies how to use computers to simulate certain human thought processes and intelligent behaviors (such as learning, reasoning, thinking, planning, etc.). It includes both hardware-level and software-level technologies. Artificial intelligence hardware technologies generally include technologies such as sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, and big data processing; artificial intelligence software technologies mainly include computer vision technology, speech recognition technology, natural language processing technology, machine learning / deep learning technology, big data processing technology, knowledge graph technology, and other major directions.

[0215] Cloud computing refers to a technology system that uses network access to elastically scalable shared physical or virtual resource pools. Resources can include servers, operating systems, networks, software, applications, and storage devices, and can be deployed and managed on demand and in a self-service manner. Cloud computing technology can provide efficient and powerful data processing capabilities for technical applications such as artificial intelligence and blockchain, as well as model training.

[0216] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this disclosure can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and this document does not limit this.

[0217] The above specific implementations do not constitute a limitation on the protection scope of the present disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present disclosure shall be included in the protection scope of the present disclosure.

Claims

1. Question processing method based on large language model, including: Get the target problem to be processed; Get the data fields in the target data model and get the target format information of the specified data format; Constructing a prompt statement according to the data fields in the target data model, the target format information and the target question; Inputting the prompt sentence into a large language model to obtain a target format result output by the large language model; Among them, the target format information includes preset dimension fields, metric fields and filtering conditions, which are used to place the target dimension hit by the target question in the target data model into the dimension field, place the target metric hit by the target question in the target data model into the metric field, and place the field to be filtered in the target question into the filtering condition.

2. The method according to claim 1, wherein: The target format result is used to establish the relationship between the target question and the data fields in the target data model, and the target format result is a serialization result.

3. The method according to claim 1, wherein: The screening condition adopts an array structure, and the screening condition includes a preset first subfield, a second subfield and a third subfield. The first subfield is used to represent the field to be screened, the second subfield is used to represent the screening value used by the field to be screened, and the third subfield represents the operator of the screening condition.

4. The method according to claim 1, further comprising: Retrieve at least one data record from the target data model; generating example data for the data field based on the at least one data record; Add sample data for the data fields to the prompt statement.

5. The method according to claim 1, wherein: The prompt statement also includes sample questions and sample answers in at least two small samples; the sample answers are in a specified data format.

6. The method according to claim 5, wherein: The fields in the sample answer are randomly selected from the data fields of the target data model.

7. The method according to claim 5, wherein: At least one sample answer includes a dimension field, a metric field, and a filter condition, and at least one sample answer lacks at least one of the dimension field, the metric field, or the filter condition.

8. The method according to claim 5, wherein: If a date-type data dimension exists in the target data model, the first subfield in the filter condition of at least one sample answer is of date type.

9. The method according to claim 5, wherein: If there is a data dimension of geographic location type in the target data model, the first subfield in the filter condition of at least one sample answer is also of geographic location type.

10. The method according to any one of claims 1, 2, 4-9, wherein: The prompt statement also includes at least one of the following strategies: A time strategy, for processing the time description information into a target time according to the current time when the target question has the time description information, and putting the target time into the screening condition of the target format result; The sample data strategy is used to filter out the sample data of any data field from the filter conditions of the target format results when there is sample data of the data field in the filter conditions of the target format results and there is no sample data of the data field in the target question; Field strategy is used to control the filter fields in the target format results to be the same as the data fields in the target data model.

11. A method for constructing a prompt statement, comprising: Get the target problem to be processed; Get the data fields in the target data model and get the target format information of the specified data format; Constructing a prompt statement according to the data fields in the target data model, the target format information and the target question; Among them, the target format information includes preset dimension fields, metric fields and filtering conditions, which are used to place the target dimension hit by the target question in the target data model into the dimension field, place the target metric hit by the target question in the target data model into the metric field, and place the field to be filtered in the target question into the filtering condition.

12. A question processing device based on a large language model, comprising: A problem acquisition module is used to acquire the target problem to be processed; The field format module is used to obtain the data fields in the target data model and obtain the target format information of the specified data format; A prompt statement module, used for constructing a prompt statement according to the data fields in the target data model, the target format information and the target question; A result module, used for inputting the prompt sentence into the large language model to obtain a target format result output by the large language model; Among them, the target format information includes preset dimension fields, metric fields and filtering conditions, which are used to place the target dimension hit by the target question in the target data model into the dimension field, place the target metric hit by the target question in the target data model into the metric field, and place the field to be filtered in the target question into the filtering condition.

13. The device according to claim 12, wherein: The target format result is used to establish the relationship between the target question and the data fields in the target data model, and the target format result is a serialization result.

14. The device according to claim 12, wherein: The screening condition adopts an array structure, and the screening condition includes a preset first subfield, a second subfield and a third subfield. The first subfield is used to represent the field to be screened, the second subfield is used to represent the screening value used by the field to be screened, and the third subfield represents the operator of the screening condition.

15. The apparatus according to claim 12, further comprising an example data module, the example data module comprising: A record acquisition unit, configured to acquire at least one data record from the target data model; an example generating unit, configured to generate example data for the data field according to the at least one data record; The example adding unit is used to add example data of the data field to the prompt sentence.

16. The device according to claim 12, wherein: The prompt statement also includes sample questions and sample answers in at least two small samples; the sample answers are in a specified data format.

17. The device according to claim 16, wherein: The fields in the sample answer are randomly selected from the data fields of the target data model.

18. The device according to claim 16, wherein: At least one sample answer includes a dimension field, a metric field, and a filter condition, and at least one sample answer lacks at least one of the dimension field, the metric field, or the filter condition.

19. The device according to claim 16, wherein: If a date-type data dimension exists in the target data model, the first subfield in the filter condition of at least one sample answer is of date type.

20. The device according to claim 16, wherein: If there is a data dimension of geographic location type in the target data model, the first subfield in the filter condition of at least one sample answer is also of geographic location type.

21. The device according to any one of claims 12, 13, 15-20, wherein: The prompt statement also includes at least one of the following strategies: A time strategy, for processing the time description information into a target time according to the current time when the target question has the time description information, and putting the target time into the screening condition of the target format result; The sample data strategy is used to filter out the sample data of any data field from the filter conditions of the target format results when there is sample data of the data field in the filter conditions of the target format results and there is no sample data of the data field in the target question; Field strategy is used to control the filter fields in the target format results to be the same as the data fields in the target data model.

22. A device for constructing a prompt statement, comprising: A problem acquisition module is used to acquire the target problem to be processed; The field format module is used to obtain the data fields in the target data model and obtain the target format information of the specified data format; A prompt statement module, used for constructing a prompt statement according to the data fields in the target data model, the target format information and the target question; Among them, the target format information includes preset dimension fields, metric fields and filtering conditions, which are used to place the target dimension hit by the target question in the target data model into the dimension field, place the target metric hit by the target question in the target data model into the metric field, and place the field to be filtered in the target question into the filtering condition.

23. An electronic device comprising: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 11.

24. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to make a computer execute the method according to any one of claims 1-12.

25. A computer program product comprising a computer program, which, when executed by a processor, implements the method according to any one of claims 1 to 11.