Large model cue word generation method and device, computer equipment, readable storage medium and program product
By acquiring multi-dimensional information to calculate relevance, constructing and optimizing dynamic prompt word templates, the problem that the structure and content of prompt words cannot be dynamically adjusted in existing technologies is solved, thereby improving the understanding accuracy of AI large language models.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-25
- Publication Date
- 2026-04-07
AI Technical Summary
Existing technologies struggle to dynamically adjust the content and structure of prompts based on the specific characteristics of the data, resulting in insufficient accuracy in the AI large language model's understanding of the requirements.
By acquiring multidimensional information from the target domain, calculating the correlation between continuous and categorical features, constructing dynamic prompt word templates, and performing feature value filling and optimization, large model prompt words are generated.
It improves the accuracy of AI large language model in understanding needs, and achieves dynamic adjustment of prompt words by dynamically adapting the content and structure of prompt words through feature contribution.
Smart Images

Figure CN121809433A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of artificial intelligence technology, and in particular to a method, apparatus, computer device, computer-readable storage medium, and computer program product for generating large model prompt words. Background Technology
[0002] As AI-powered large language models are increasingly used in various scenarios, the quality of prompt words directly affects the accuracy of the model's output. Currently, prompt word generation mainly relies on two technical solutions: manually defining feature templates and extracting basic attributes to generate standardized prompt words.
[0003] Existing technologies struggle to dynamically adjust the content and structure of prompts based on the specific characteristics of the data, resulting in insufficient targeting of prompts and consequently affecting the accuracy of AI large language models in understanding needs. Summary of the Invention
[0004] Therefore, it is necessary to provide a method, apparatus, computer device, computer-readable storage medium, and computer program product for generating large-scale prompt words that can dynamically adjust the content and structure of prompt words according to the specific characteristics of the data, in order to address the above-mentioned technical problems.
[0005] Firstly, this application provides a method for generating prompt words for large models, including:
[0006] Acquire multidimensional information and target data in the target domain, process the multidimensional information using a preset method, and obtain continuous features and classification features;
[0007] The continuous correlation between the continuous features and the target data is calculated using a metric function that fuses normalized mutual information and gradient contribution; the classification correlation between the classification features and the target data is calculated using a metric function that combines analysis of variance and probability distribution distance.
[0008] The continuous correlation and the categorical correlation are normalized and filtered to obtain the contribution characteristics.
[0009] Based on the contribution characteristics, a dynamic prompt word template is constructed, and the dynamic prompt word template is filled with feature values and optimized to obtain large model prompt words for the target domain.
[0010] In one embodiment, calculating the continuous correlation between the continuous features and the target data through a metric function that fuses normalized mutual information and gradient contribution includes:
[0011] The mutual information between the continuous feature and the target data is calculated using the mutual information calculation formula; the contribution of the continuous feature to the target data is calculated using the gradient contribution degree; and the mutual information and the contribution degree are normalized and fused to obtain the continuous correlation.
[0012] In one embodiment, calculating the classification correlation between the classification features and the target data using a measure function of variance and probability distribution distance includes:
[0013] The variance ratio between the classification features and the target data is calculated using the analysis of variance formula; the difference data between the classification features and the target data is calculated using the probability distance of parts formula; the variance ratio and the difference data are normalized and fused to obtain the classification correlation.
[0014] In one embodiment, the multidimensional information includes numerical information and non-numerical information; the multidimensional information is processed by a preset method to obtain continuous features and categorical features, including:
[0015] The numerical information in the multidimensional information is processed by a preset method to obtain continuous features; the non-numerical information in the multidimensional information is processed by a preset method to obtain classification features.
[0016] In one embodiment, the normalization and filtering operations on the continuous correlation and the categorical correlation to obtain the contribution feature include:
[0017] The continuous correlation and the categorical correlation are normalized to obtain the comprehensive correlation; the comprehensive correlation is filtered based on a preset filtering method to obtain correlation data; the correlation data is structured to obtain contribution features.
[0018] In one embodiment, the step of feature value filling and optimization of the dynamic prompt word template to obtain large-scale model prompt words for the target domain includes:
[0019] The feature values to be filled in the dynamic prompt word template are obtained from the target domain, and the feature values are filled into the dynamic prompt word template to obtain the preliminary large model prompt words; spaces, blank lines and redundant symbols are removed from the preliminary large model prompt words to obtain the large model prompt words of the target domain.
[0020] Secondly, this application also provides a large model prompt word generation device, including:
[0021] The acquisition module is used to acquire multidimensional information and target data in the target domain, and process the multidimensional information through a preset method to obtain continuous features and classification features.
[0022] The calculation module is used to calculate the continuous correlation between the continuous features and the target data by using a metric function that fuses normalized mutual information and gradient contribution; and to calculate the classification correlation between the classification features and the target data by using a metric function that combines variance analysis and probability distribution distance.
[0023] The processing module is used to perform normalization and filtering operations on the continuous correlation and the categorical correlation to obtain contribution features;
[0024] The generation module is used to construct a dynamic prompt word template based on the contribution feature, and to fill and optimize the dynamic prompt word template with feature values to obtain the large model prompt words in the target domain.
[0025] Thirdly, this application also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to perform the following steps:
[0026] Acquire multidimensional information and target data in the target domain, process the multidimensional information using a preset method, and obtain continuous features and classification features;
[0027] The continuous correlation between the continuous features and the target data is calculated using a metric function that fuses normalized mutual information and gradient contribution; the classification correlation between the classification features and the target data is calculated using a metric function that combines analysis of variance and probability distribution distance.
[0028] The continuous correlation and the categorical correlation are normalized and filtered to obtain the contribution characteristics.
[0029] Based on the contribution characteristics, a dynamic prompt word template is constructed, and the dynamic prompt word template is filled with feature values and optimized to obtain large model prompt words for the target domain.
[0030] Fourthly, this application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, performs the following steps:
[0031] Acquire multidimensional information and target data in the target domain, process the multidimensional information using a preset method, and obtain continuous features and classification features;
[0032] The continuous correlation between the continuous features and the target data is calculated using a metric function that fuses normalized mutual information and gradient contribution; the classification correlation between the classification features and the target data is calculated using a metric function that combines analysis of variance and probability distribution distance.
[0033] The continuous correlation and the categorical correlation are normalized and filtered to obtain the contribution characteristics.
[0034] Based on the contribution characteristics, a dynamic prompt word template is constructed, and the dynamic prompt word template is filled with feature values and optimized to obtain large model prompt words for the target domain.
[0035] Fifthly, this application also provides a computer program product, including a computer program that, when executed by a processor, performs the following steps:
[0036] Acquire multidimensional information and target data in the target domain, process the multidimensional information using a preset method, and obtain continuous features and classification features;
[0037] The continuous correlation between the continuous features and the target data is calculated using a metric function that fuses normalized mutual information and gradient contribution; the classification correlation between the classification features and the target data is calculated using a metric function that combines analysis of variance and probability distribution distance.
[0038] The continuous correlation and the categorical correlation are normalized and filtered to obtain the contribution characteristics.
[0039] Based on the contribution characteristics, a dynamic prompt word template is constructed, and the dynamic prompt word template is filled with feature values and optimized to obtain large model prompt words for the target domain.
[0040] The aforementioned method, apparatus, computer device, computer-readable storage medium, and computer program product for generating large-scale model prompt words first acquire multidimensional information and target data of the target domain, and process the multidimensional information using a preset method to obtain continuous features and categorical features. Then, using a metric function that fuses normalized mutual information and gradient contribution, the continuous correlation between the continuous features and the target data is calculated; using a metric function that combines variance analysis and probability distribution distance, the categorical correlation between the categorical features and the target data is calculated. Next, the continuous correlation and the categorical correlation are normalized and filtered to obtain contribution features. Finally, based on the contribution features, a dynamic prompt word template is constructed, and the dynamic prompt word template is filled with and optimized to obtain large-scale model prompt words for the target domain. By dynamically adapting the prompt word content and structure to the feature contribution, the content and structure of the prompt words can be dynamically adjusted according to the specific characteristics of the data, thereby improving the accuracy of the AI large-scale language model in understanding requirements. Attached Figure Description
[0041] To more clearly illustrate the technical solutions in the embodiments of this application or related technologies, the drawings used in the description of the embodiments of this application or related technologies will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0042] Figure 1 This is a flowchart illustrating a method for generating large model prompts in one embodiment;
[0043] Figure 2 This is a detailed flowchart illustrating a method for generating prompt words for a large model in one embodiment;
[0044] Figure 3 This is a structural block diagram of a large model prompt word generation device in one embodiment;
[0045] Figure 4 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation
[0046] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0047] In one embodiment, such as Figure 1 As shown, a method for generating prompt words for a large model is provided. This embodiment illustrates the application of this method to a terminal. It is understood that this method can also be applied to a server, and can also be applied to a system including both a terminal and a server, and implemented through the interaction between the terminal and the server. In this embodiment, the method includes the following steps:
[0048] Step 102: Obtain multidimensional information and target data in the target domain, process the multidimensional information using a preset method, and obtain continuous features and classification features.
[0049] Optionally, the target domain can be fields such as financial collateral valuation and industry data analysis. Taking financial collateral valuation as an example, multidimensional information refers to the multidimensional raw input data related to the target data in the target domain, covering numerical information (such as quantifiable indicators such as the area, price, and age of the collateral) and non-numerical information (such as classification indicators such as the city, building type, and business type of the collateral); the target data is the core result data to be output by the large model (such as the collateral valuation unit price, which is the house unit price in this case).
[0050] Step 104: Calculate the continuous correlation between continuous features and target data using a metric function that fuses normalized mutual information and gradient contribution; calculate the classification correlation between classification features and target data using a metric function that combines analysis of variance and probability distribution distance.
[0051] Among them, the metric function that integrates normalized mutual information and gradient contribution is used to capture the linear and nonlinear correlation between continuous features and target data; the metric function based on variance analysis and probability distribution distance focuses on the class correlation strength between classification features and target data.
[0052] Step 106: Normalize and filter the continuous correlation and categorical correlation to obtain the contribution characteristics.
[0053] The normalization operation maps continuous correlation values and categorical correlation values to the [0,1] interval. The standardization process eliminates the difference in the dimensions of the two types of correlation values, ensuring the consistency of the screening criteria.
[0054] Optionally, the filtering operation is performed based on a preset relevance threshold or contribution ranking rule: on the one hand, a fixed threshold can be set according to the business accuracy requirements of the target field, and features with relevance values higher than the threshold can be directly filtered out; on the other hand, features can be sorted from high to low according to relevance values and selected as Top-N (N is a positive integer that can be adjusted according to the scenario) features, or a feature set whose cumulative contribution reaches a preset proportion (such as 80%).
[0055] Step 108: Based on the contribution feature, construct a dynamic prompt word template, and fill and optimize the dynamic prompt word template with feature values to obtain the large model prompt words for the target domain.
[0056] The dynamic prompt word template construction is centered on contribution features, following the principle of "feature importance adapting to template structure": First, contribution features are sorted from highest to lowest relevance value. Core high-contribution features (such as Top-5 features) are set as mandatory core modules, medium-contribution features are optional supplementary modules, and low-contribution but necessary features are integrated into auxiliary explanation modules. Dynamic placeholders corresponding one-to-one with each contribution feature are reserved in the template, with placeholder names consistent with feature identifiers. A feature weight explanation area is also reserved to clarify the priority of each feature's impact on the target result. Feature value filling involves accurately matching the preprocessed actual feature values from the multidimensional information of the target domain into the template according to the placeholder identifiers—for numerical contribution features, the standardized specific value and unit (e.g., area: 100 square meters) are directly filled in; for categorical contribution features, the coded and restored category name (e.g., building type: reinforced concrete structure) is filled in, ensuring the filled data is complete and conforms to the understanding logic of the large model.
[0057] The aforementioned method for generating prompt words for large-scale models first acquires multidimensional information and target data from the target domain. The multidimensional information is then processed using a pre-defined method to obtain continuous and categorical features. Next, a metric function fusing normalized mutual information and gradient contribution is used to calculate the continuous correlation between the continuous features and the target data. A metric function using variance analysis and probability distribution distance is used to calculate the categorical correlation between the categorical features and the target data. Following this, the continuous and categorical correlations are normalized and filtered to obtain contribution features. Finally, based on these contribution features, a dynamic prompt word template is constructed, and feature value filling and optimization are performed on the template to obtain the prompt words for the large-scale model in the target domain. By dynamically adapting the prompt word content and structure to the feature contribution, the content and structure of the prompt words can be dynamically adjusted according to the specific characteristics of the data, thereby improving the accuracy of the AI large-scale language model in understanding the requirements.
[0058] In an exemplary embodiment, the continuous correlation between continuous features and target data is calculated using a metric function that fuses normalized mutual information and gradient contribution, including:
[0059] The mutual information between continuous features and target data is calculated using the mutual information calculation formula; the contribution of continuous features to target data is calculated using the gradient contribution; and the mutual information and contribution are normalized and fused to obtain continuous correlation.
[0060] For example, the formula for calculating continuous correlation is as follows:
[0061]
[0062] in, These are continuous features (such as house area, listing price, etc.). It refers to the target data (collateral valuation). yes and mutual information, It's weight. yes right The gradient contribution (feature importance).
[0063] In this embodiment, the calculation method of normalizing and fusing mutual information and gradient contribution can simultaneously and accurately capture the nonlinear dependency relationship and linear prediction contribution between continuous features and target data. The obtained continuous correlation results are more comprehensive and accurate, providing a reliable basis for subsequent screening of high-value contribution features, thereby improving the matching degree between dynamic prompts and target data.
[0064] In an exemplary embodiment, the classification correlation between classification features and target data is calculated using a measure function of variance and probability distribution distance, including:
[0065] The variance ratio between the categorical features and the target data is calculated using the analysis of variance formula; the difference between the categorical features and the target data is calculated using the probability distance of parts formula; and the variance ratio and the difference data are normalized and fused to obtain the categorical correlation.
[0066] For example, the formula for calculating classification relevance is as follows:
[0067]
[0068] in, These are classification features (such as city, building type, etc.). It refers to the target data (collateral valuation). yes and The variance ratio (the ratio of between-group variance to within-group variance). It's weight. yes right The probability distribution distance (discrepancy data, KL divergence).
[0069] In this embodiment, by combining analysis of variance and KL divergence normalization, the correlation strength between classification features and target data can be comprehensively quantified from two dimensions: class explanatory power and distributional differences. The resulting classification correlation results are more comprehensive and accurate, effectively screening out the key classification features that have an impact on the target data, providing high-quality feature input for dynamic prompt word templates, and further ensuring the accuracy of the output results of the large model.
[0070] In an exemplary embodiment, the multidimensional information includes numerical information and non-numerical information; the multidimensional information is processed by a preset method to obtain continuous features and categorical features, including:
[0071] Continuous features are obtained by processing numerical information in multidimensional information using a preset method; categorical features are obtained by processing non-numerical information in multidimensional information using a preset method.
[0072] Optional continuous features include: listing price, area, number of rooms, number of living rooms, number of bathrooms, level of renovation, average price per unit, remaining lease term, opening date, number of schools, number of bus stops, average price per unit in the community, year of construction, green space ratio (percentage), plot ratio (percentage), property management fee, and number of subway stations. Categorical features include: city, region, community name, address, building type, information release date, floor level, total number of floors, district, unit type, property type, building structure, main orientation, and source.
[0073] For example, for numerical information in multidimensional information (such as quantifiable indicators like the house area, listing price, remaining years of use, greening rate, and property management fees of collateral), the preset processing method includes: first, using the Z-Score method to identify and remove or correct outliers that exceed a reasonable range to avoid abnormal data interfering with feature quality; then, using Min-Max standardization to transform all numerical information to the same order of magnitude (such as the [0,1] interval) to eliminate dimensional differences; finally, for numerical information with missing values, using the mode or median to fill in the data, resulting in a continuous feature with a regular structure and reliable data after the above processing. For non-numerical information in multidimensional information (such as discrete category indicators like city name, building type, house type, property type, and main orientation of the house), the preset processing method includes: first, deduplicating and filtering duplicate or invalid category information to retain valid categories; then, using one-hot encoding or label encoding to convert the non-numerical information of text categories into a machine-recognizable encoding form; and simultaneously, filling in missing non-numerical information with the category that appears most frequently to ensure data integrity. After the above processing, classification features that meet the requirements of subsequent correlation calculations are obtained.
[0074] In this embodiment, by employing targeted preset processing methods for numerical and non-numerical information respectively, and combining clear definitions of continuous and categorical feature ranges, the structured and standardized transformation of multidimensional information can be achieved. This ensures that the output structured features not only meet the processing requirements of subsequent steps in the technical solution, but also accurately match the correlation analysis scenario of the target data, providing reliable data support for the generation of high-quality dynamic prompt words.
[0075] In an exemplary embodiment, normalization and filtering operations are performed on continuous correlation and categorical correlation to obtain contribution features, including:
[0076] The continuous correlation and categorical correlation are normalized to obtain the comprehensive correlation; the comprehensive correlation is filtered based on a preset screening method to obtain the correlation data; the correlation data is structured to obtain the contribution characteristics.
[0077] For example, a normalization operation is performed on continuous correlation and categorical correlation. The normalization operation adopts a unified Min-Max standardization method to further calibrate the continuous correlation values (range [0,1]) and categorical correlation values (range [0,1]) to the same dimension [0,1] interval, eliminating the implicit bias that may exist between the two types of correlation due to differences in calculation logic, and finally obtaining the comprehensive correlation of each feature (for example, the continuous correlation of the continuous feature "house area" is 0.85, and the categorical correlation of the categorical feature "city" is 0.78. After normalization calibration, the comprehensive correlations of the two are 0.83 and 0.76, respectively, ensuring that the correlation strength of all features is at the same comparison benchmark). The preset filtering method can be a combination of "threshold filtering + sorting filtering": First, set a comprehensive relevance threshold (e.g., 0.6) to initially filter out low-relevance features below this threshold (e.g., "greening rate" with a comprehensive relevance of 0.45); then sort the remaining features from high to low comprehensive relevance, and select the top-8 features as the relevance data (e.g., the top 8 after sorting: "house area, city, listing price, region, building type, number of rooms, average price of the community, house type"), or select a feature set whose cumulative comprehensive relevance reaches a preset proportion (e.g., 85%), balancing filtering efficiency and core feature coverage. The structured processing of the relevance data includes: organizing the feature sequence according to the comprehensive relevance sorting results, labeling each feature with its corresponding comprehensive relevance value and feature type (continuous / categorical), and supplementing feature description information (e.g., "house area: numerical, unit square meters, comprehensive relevance 0.83").
[0078] In this embodiment, through three steps of normalization calibration, precise screening, and structured organization, unified quantification and efficient screening of continuous and categorical features are achieved. This enables the obtained contribution features to accurately match the needs of the target domain, providing focused and reliable core input for the personalized construction of dynamic prompt words, and further improving the targeting and quality of prompt words in the large model.
[0079] In an exemplary embodiment, feature value filling and optimization are performed on the dynamic prompt word template to obtain large-scale model prompt words for the target domain, including:
[0080] The feature values to be filled in the dynamic prompt word template are obtained from the target domain, and the feature values are filled into the dynamic prompt word template to obtain the preliminary large model prompt words. Spaces, blank lines and redundant symbols in the preliminary large model prompt words are removed to obtain the large model prompt words of the target domain.
[0081] Exemplarily, first extract the actual feature values corresponding to the dynamic prompt template placeholders from the multi-dimensional information in the target domain. For example, the template contains placeholders such as "{City}, {House Area}, {Building Type}, {Number of Rooms}, {Average Price of the Community}", and the corresponding feature values obtained by matching from the multi-dimensional information of the collateral are "Beijing City, 100 square meters, reinforced concrete structure, 3 rooms, 58,000 yuan per square meter". Fill these feature values into the corresponding placeholders one by one precisely to obtain the preliminary large model prompt: "Please act as a professional real estate appraiser and evaluate the market unit price based on the following collateral information: City: Beijing City, House Area: 100 square meters, Building Type: reinforced concrete structure, Number of Rooms: 3 rooms, Average Price of the Community: 58,000 yuan per square meter. Combine the current market conditions and give a reasonable valuation unit price for this ordinary commercial housing and explain the basis for the valuation." Subsequently, perform optimization operations on the preliminary prompt: First, remove redundant spaces (such as correcting the extra space in "Beijing City," to "Beijing City,"), delete blank lines and meaningless symbols; then unify the punctuation usage norms (such as unifying the Chinese semicolon and the English comma into a Chinese comma), and finally obtain the optimized large model prompt in the target domain: Please act as a professional real estate appraiser and evaluate the market unit price based on the following collateral information: City: Beijing City, House Area: 100 square meters, Building Type: reinforced concrete structure, Number of Rooms: 3 rooms, Average Price of the Community: 58,000 yuan per square meter. Combine the current market conditions and give a reasonable valuation unit price for this ordinary commercial housing and explain the basis for the valuation.
[0082] In this embodiment, through the combined operation of precise feature value filling and standardized format optimization, the conversion from the dynamic prompt template to the available large model prompt is efficiently achieved. The entire process not only ensures the information integrity of the prompt but also improves the reading and understanding efficiency of the large model. The finally output prompt can accurately convey the core requirements of the target domain.
[0083] In one embodiment, as Figure 2As shown, a method for generating prompt words for large models is provided, including: acquiring multidimensional information and target data in the target domain; for numerical information in the multidimensional information (such as quantifiable indicators such as the house area, listing price, remaining years of use, greening rate, and property management fees of collateral), firstly, the Z-Score method is used to identify and remove or correct outliers that exceed the reasonable range to avoid abnormal data interfering with feature quality; then, all numerical information is transformed to the same order of magnitude (such as the [0,1] interval) through Min-Max standardization to eliminate dimensional differences; finally, for numerical information with missing values, the data is filled by mode or median filling method. After the above processing, a continuous feature with regular structure and reliable data is formed. For non-numerical information in multidimensional data (such as discrete category indicators like city name, building type, house type, property type, and main orientation of the house), duplicate or invalid category information is first deduplicated and filtered, retaining valid categories. Then, one-hot encoding or label encoding is used to convert the non-numerical information of text categories into a machine-recognizable encoding form. Simultaneously, missing non-numerical information is filled in with the most frequently occurring category to ensure data integrity. After the above processing, classification features that meet the requirements of subsequent correlation calculations are obtained. The continuous correlation between continuous features and target data is calculated using a metric function that fuses normalized mutual information and gradient contribution. The formula for calculating continuous correlation is as follows:
[0084]
[0085] in, These are continuous features (such as house area, listing price, etc.). It refers to the target data (collateral valuation). yes and mutual information, It's weight. yes right The gradient contribution (feature importance) is calculated. The classification correlation between the categorical features and the target data is calculated using a measure of distance from the probability distribution through analysis of variance. The formula for calculating classification correlation is as follows:
[0086]
[0087] in, These are classification features (such as city, building type, etc.). It refers to the target data (collateral valuation). yes and The variance ratio (the ratio of between-group variance to within-group variance). It's weight. yes right The probability distribution distance (discrepancy data, KL divergence) is calculated. A unified Min-Max standardization method is applied to continuous and categorical correlations, further calibrating the continuous correlation values (range [0,1]) and categorical correlation values (range [0,1]) to the same dimension [0,1] interval, eliminating potential implicit biases due to differences in calculation logic between the two types of correlations, ultimately obtaining the comprehensive correlation of each feature. The preset screening method can be a combination of "threshold screening + sorting screening": first, set a comprehensive correlation threshold (e.g., 0.6) to initially filter out low-correlation features below this threshold (e.g., "greening rate" with a comprehensive correlation of 0.45); then, sort the remaining features from high to low comprehensive correlation, selecting the Top-8 features as correlation data (e.g., the top 8 after sorting: "house area, city, listed price, region, building type, number of rooms, average price of the community, house type"), or select a feature set whose cumulative comprehensive correlation reaches a preset proportion (e.g., 85%), balancing screening efficiency and core feature coverage. The structured processing of the relevance data includes: organizing the feature sequence according to the comprehensive relevance ranking result, labeling each feature with its corresponding comprehensive relevance value and feature type (continuous / categorical), and supplementing feature description information (e.g., "House area: numerical, unit square meters, comprehensive relevance 0.83"). Based on the contribution feature, a dynamic prompt word template is constructed. The feature values to be filled in the dynamic prompt word template are obtained from the target domain, and the feature values are filled into the dynamic prompt word template to obtain the preliminary large model prompt words; spaces, blank lines, and redundant symbols in the preliminary large model prompt words are removed to obtain the large model prompt words for the target domain.
[0088] It should be understood that although the steps in the flowcharts of the above embodiments are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the above embodiments may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages in other steps. It is understood that the steps in different embodiments can be freely combined as needed, and all non-contradictory solutions formed by such combinations are within the scope of protection of this application.
[0089] In one exemplary embodiment, such as Figure 3As shown, a large model prompt word generation device is provided, including: an acquisition module 301, a calculation module 302, a processing module 303, and a generation module 304, wherein:
[0090] The acquisition module is used to acquire multidimensional information and target data in the target domain, and process the multidimensional information through a preset method to obtain continuous features and categorical features.
[0091] The calculation module is used to calculate the continuous correlation between continuous features and target data through a metric function that fuses normalized mutual information and gradient contribution; and to calculate the classification correlation between classification features and target data through a metric function that combines variance analysis and probability distribution distance.
[0092] The processing module is used to normalize and filter continuous and categorical correlations to obtain contribution features.
[0093] The generation module is used to construct dynamic prompt word templates based on contribution features, and to fill and optimize the dynamic prompt word templates with feature values to obtain large model prompt words for the target domain.
[0094] In one exemplary embodiment, the computing module is further configured to:
[0095] The mutual information between continuous features and target data is calculated using the mutual information calculation formula; the contribution of continuous features to target data is calculated using the gradient contribution; and the mutual information and contribution are normalized and fused to obtain continuous correlation.
[0096] In one exemplary embodiment, the computing module is further configured to:
[0097] The variance ratio between the categorical features and the target data is calculated using the analysis of variance formula; the difference between the categorical features and the target data is calculated using the probability distance of parts formula; and the variance ratio and the difference data are normalized and fused to obtain the categorical correlation.
[0098] In one exemplary embodiment, the acquisition module is further configured to:
[0099] Continuous features are obtained by processing numerical information in multidimensional information using a preset method; categorical features are obtained by processing non-numerical information in multidimensional information using a preset method.
[0100] In one exemplary embodiment, the processing module is further configured to:
[0101] The continuous correlation and categorical correlation are normalized to obtain the comprehensive correlation; the comprehensive correlation is filtered based on a preset screening method to obtain the correlation data; the correlation data is structured to obtain the contribution characteristics.
[0102] In one exemplary embodiment, the generation module is further configured to:
[0103] The feature values to be filled in the dynamic prompt word template are obtained from the target domain, and the feature values are filled into the dynamic prompt word template to obtain the preliminary large model prompt words. Spaces, blank lines and redundant symbols in the preliminary large model prompt words are removed to obtain the large model prompt words of the target domain.
[0104] Each module in the aforementioned large-scale prompt word generation device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in the processor of a computer device in hardware form or independent of it, or stored in the memory of a computer device in software form, so that the processor can call and execute the operations corresponding to each module.
[0105] In one exemplary embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 4 As shown, this computer device includes a processor, memory, input / output interfaces (I / O), and a communication interface. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface is also connected to the system bus via the I / O interfaces. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides the environment for the operating system and computer programs stored in the non-volatile storage media. The database stores multi-dimensional information. The I / O interfaces are used for exchanging information between the processor and external devices. The communication interface is used for communicating with external terminals via a network connection. When executed by the processor, the computer program implements a large-model prompt word generation method.
[0106] Those skilled in the art will understand that Figure 4 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0107] In one exemplary embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to perform the following steps:
[0108] Acquire multidimensional information and target data in the target domain, process the multidimensional information using a preset method, and obtain continuous features and categorical features;
[0109] The continuous correlation between continuous features and target data is calculated using a metric function that fuses normalized mutual information and gradient contribution; the classification correlation between categorical features and target data is calculated using a metric function that combines analysis of variance and probability distribution distance.
[0110] Normalization and filtering operations are performed on continuous correlation and categorical correlation to obtain contribution characteristics;
[0111] Based on contribution features, a dynamic prompt word template is constructed, and feature value filling and optimization are performed on the dynamic prompt word template to obtain large model prompt words for the target domain.
[0112] In one embodiment, the processor, when executing a computer program, also performs the following steps:
[0113] The mutual information between continuous features and target data is calculated using the mutual information calculation formula; the contribution of continuous features to target data is calculated using the gradient contribution; and the mutual information and contribution are normalized and fused to obtain continuous correlation.
[0114] In one embodiment, the processor, when executing a computer program, also performs the following steps:
[0115] The variance ratio between the categorical features and the target data is calculated using the analysis of variance formula; the difference between the categorical features and the target data is calculated using the probability distance of parts formula; and the variance ratio and the difference data are normalized and fused to obtain the categorical correlation.
[0116] In one embodiment, the processor, when executing a computer program, also performs the following steps:
[0117] Continuous features are obtained by processing numerical information in multidimensional information using a preset method; categorical features are obtained by processing non-numerical information in multidimensional information using a preset method.
[0118] In one embodiment, the processor, when executing a computer program, also performs the following steps:
[0119] The continuous correlation and categorical correlation are normalized to obtain the comprehensive correlation; the comprehensive correlation is filtered based on a preset screening method to obtain the correlation data; the correlation data is structured to obtain the contribution characteristics.
[0120] In one embodiment, the processor, when executing a computer program, also performs the following steps:
[0121] The feature values to be filled in the dynamic prompt word template are obtained from the target domain, and the feature values are filled into the dynamic prompt word template to obtain the preliminary large model prompt words. Spaces, blank lines and redundant symbols in the preliminary large model prompt words are removed to obtain the large model prompt words of the target domain.
[0122] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, the computer program performing the following steps when executed by a processor:
[0123] Acquire multidimensional information and target data in the target domain, process the multidimensional information using a preset method, and obtain continuous features and categorical features;
[0124] The continuous correlation between continuous features and target data is calculated using a metric function that fuses normalized mutual information and gradient contribution; the classification correlation between categorical features and target data is calculated using a metric function that combines analysis of variance and probability distribution distance.
[0125] Normalization and filtering operations are performed on continuous correlation and categorical correlation to obtain contribution characteristics;
[0126] Based on contribution features, a dynamic prompt word template is constructed, and feature value filling and optimization are performed on the dynamic prompt word template to obtain large model prompt words for the target domain.
[0127] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:
[0128] The mutual information between continuous features and target data is calculated using the mutual information calculation formula; the contribution of continuous features to target data is calculated using the gradient contribution; and the mutual information and contribution are normalized and fused to obtain continuous correlation.
[0129] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:
[0130] The variance ratio between the categorical features and the target data is calculated using the analysis of variance formula; the difference between the categorical features and the target data is calculated using the probability distance of parts formula; and the variance ratio and the difference data are normalized and fused to obtain the categorical correlation.
[0131] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:
[0132] Continuous features are obtained by processing numerical information in multidimensional information using a preset method; categorical features are obtained by processing non-numerical information in multidimensional information using a preset method.
[0133] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:
[0134] The continuous correlation and categorical correlation are normalized to obtain the comprehensive correlation; the comprehensive correlation is filtered based on a preset screening method to obtain the correlation data; the correlation data is structured to obtain the contribution characteristics.
[0135] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:
[0136] The feature values to be filled in the dynamic prompt word template are obtained from the target domain, and the feature values are filled into the dynamic prompt word template to obtain the preliminary large model prompt words. Spaces, blank lines and redundant symbols in the preliminary large model prompt words are removed to obtain the large model prompt words of the target domain.
[0137] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, performs the following steps:
[0138] Acquire multidimensional information and target data in the target domain, process the multidimensional information using a preset method, and obtain continuous features and categorical features;
[0139] The continuous correlation between continuous features and target data is calculated using a metric function that fuses normalized mutual information and gradient contribution; the classification correlation between categorical features and target data is calculated using a metric function that combines analysis of variance and probability distribution distance.
[0140] Normalization and filtering operations are performed on continuous correlation and categorical correlation to obtain contribution characteristics;
[0141] Based on contribution features, a dynamic prompt word template is constructed, and feature value filling and optimization are performed on the dynamic prompt word template to obtain large model prompt words for the target domain.
[0142] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:
[0143] The mutual information between continuous features and target data is calculated using the mutual information calculation formula; the contribution of continuous features to target data is calculated using the gradient contribution; and the mutual information and contribution are normalized and fused to obtain continuous correlation.
[0144] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:
[0145] The variance ratio between the categorical features and the target data is calculated using the analysis of variance formula; the difference between the categorical features and the target data is calculated using the probability distance of parts formula; and the variance ratio and the difference data are normalized and fused to obtain the categorical correlation.
[0146] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:
[0147] Continuous features are obtained by processing numerical information in multidimensional information using a preset method; categorical features are obtained by processing non-numerical information in multidimensional information using a preset method.
[0148] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:
[0149] The continuous correlation and categorical correlation are normalized to obtain the comprehensive correlation; the comprehensive correlation is filtered based on a preset screening method to obtain the correlation data; the correlation data is structured to obtain the contribution characteristics.
[0150] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:
[0151] The feature values to be filled in the dynamic prompt word template are obtained from the target domain, and the feature values are filled into the dynamic prompt word template to obtain the preliminary large model prompt words. Spaces, blank lines and redundant symbols in the preliminary large model prompt words are removed to obtain the large model prompt words of the target domain.
[0152] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, artificial intelligence (AI) processors, etc., and are not limited to these.
[0153] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.
[0154] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. A method for generating prompt words for large models, characterized in that, The method includes: Acquire multidimensional information and target data in the target domain, process the multidimensional information using a preset method, and obtain continuous features and classification features; The continuous correlation between the continuous features and the target data is calculated using a metric function that fuses normalized mutual information and gradient contribution; the classification correlation between the classification features and the target data is calculated using a metric function that combines analysis of variance and probability distribution distance. The continuous correlation and the categorical correlation are normalized and filtered to obtain the contribution characteristics. Based on the contribution characteristics, a dynamic prompt word template is constructed, and the dynamic prompt word template is filled with feature values and optimized to obtain large model prompt words for the target domain.
2. The method according to claim 1, characterized in that, The calculation of the continuous correlation between the continuous features and the target data through the metric function fused with normalized mutual information and gradient contribution includes: The mutual information between the continuous features and the target data is calculated using the mutual information calculation formula. The contribution of the continuous features to the target data is calculated using gradient contribution. The mutual information and the contribution are normalized and fused to obtain continuous correlation.
3. The method according to claim 1, characterized in that, The calculation of the classification correlation between the classification features and the target data using a metric function based on variance analysis and probability distribution distance includes: The variance ratio between the classification feature and the target data is calculated using the analysis of variance formula. The difference between the classification features and the target data is calculated using the probability distribution distance formula. The variance ratio and the difference data are normalized and fused to obtain the classification correlation.
4. The method according to claim 1, characterized in that, The multidimensional information includes numerical information and non-numerical information; the multidimensional information is processed by a preset method to obtain continuous features and categorical features, including: Continuous features are obtained by processing the numerical information in the multidimensional information using a preset method. The non-numerical information in the multidimensional information is processed by a preset method to obtain classification features.
5. The method according to claim 1, characterized in that, The normalization and filtering operations on the continuous correlation and the categorical correlation to obtain the contribution features include: The continuous correlation and the categorical correlation are normalized to obtain the comprehensive correlation. The comprehensive correlation is filtered based on a preset filtering method to obtain correlation data; The correlation data is structured to obtain contribution characteristics.
6. The method according to claim 1, characterized in that, The process of feature value filling and optimization of the dynamic prompt word template to obtain large model prompt words for the target domain includes: The feature values to be filled in the dynamic prompt word template are obtained from the target domain, and the feature values are filled into the dynamic prompt word template to obtain the preliminary large model prompt words; By removing spaces, blank lines, and redundant symbols from the initial large model hints, the large model hints for the target domain are obtained.
7. A large model prompt word generation device, characterized in that, The device includes: The acquisition module is used to acquire multidimensional information and target data in the target domain, and process the multidimensional information through a preset method to obtain continuous features and classification features. The calculation module is used to calculate the continuous correlation between the continuous features and the target data by using a metric function that fuses normalized mutual information and gradient contribution; and to calculate the classification correlation between the classification features and the target data by using a metric function that combines variance analysis and probability distribution distance. The processing module is used to perform normalization and filtering operations on the continuous correlation and the categorical correlation to obtain contribution features; The generation module is used to construct a dynamic prompt word template based on the contribution feature, and to fill and optimize the dynamic prompt word template with feature values to obtain large model prompt words for the target domain.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 6.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.
10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.