A large model prompt automatic generation method for the textile generation field
By generating structured textile semantic tags and dynamically adjusting the activation weights of textile terms, the instability and incompleteness of prompt word generation in textile product design are solved, achieving efficient and accurate automatic generation of English prompt words, which is suitable for textile product simulation display.
Patent Information
- Application Number
- CN202611371560.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-04
- Publication Date
- 2026-11-27
AI Technical Summary
In existing technologies, there are several problems in textile product design, including high cost of manually writing prompts, insufficient coverage of general large-scale textile terminology, unstable transcription of Chinese professional tags to English terminology, lack of input condition adaptation for static keyword enhancement, incomplete generation of multi-token textile terminology, repetitive stacking of terminology, and difficulty in distinguishing between input transcription and extended generation in evaluation.
By obtaining the textile product parameters selected by the user, structured textile semantic tags are generated, a candidate set of textile terms is constructed, semantic relevance is calculated using multilingual semantic encoding, the activation weight of textile terms is dynamically adjusted, an autoregressive large model decodes token by token to generate English prompt words, and prefix matching continuation and phrase-level decay control are performed on multi-token textile terms.
It improves the standardization and accuracy of prompt word generation, stabilizes the transcription of Chinese labels to English terms, reduces the risk of term stuffing and misuse, and enhances the completeness of generated compound terms and the interpretability of evaluations.
Smart Images

Figure CN123180153A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of smart textiles, AI-generated content, large model prompt word engineering, natural language generation, and simulation-assisted design of textile products, and in particular to an automatic method for generating large model prompt words for the textile generation field. Background Technology
[0002] In textile and home furnishing product design, pattern development, e-commerce display, and soft furnishing coordination, designers typically need to quickly generate professional prompts that express the product's form, materials, craftsmanship, style, and lighting conditions, focusing on products such as four-piece bedding sets, curtains, pillowcases, tablecloths, sofa covers, rugs, bath towel sets, or placemats. Traditional methods rely on manual experience to write prompts or create physical samples, which is time-consuming, costly, and difficult to support rapid previewing and selection of a large number of product designs.
[0003] With the application of generative artificial intelligence in product simulation and display, users can obtain product display results with a certain degree of realism by inputting prompts. However, general generation processes have limited understanding of textile-specific scenarios, especially in areas such as materials, fabric structure, printing and dyeing, finishing, sewing, and surface texture, which are prone to insufficient descriptions or misuse of terminology. For example, for cotton-linen blended bedding, it is necessary to describe textile characteristics such as plain weave, reactive printing, fiberhairiness, and binding stitch; for blackout curtains, it is necessary to describe product structure and functional characteristics such as blackout coating, natural drape, and pleated heading. If the prompts lack such specialized information, the generated results often only reflect a general decorative style and fail to accurately express the differences in textile materials and processes.
[0004] In existing practices, one approach involves designers manually writing prompts. This method heavily relies on personal experience, resulting in inconsistent prompt quality and difficulty in standardizing and reusing them in enterprise production processes. Another approach directly utilizes a general model to generate prompts based on user descriptions. However, this general model lacks constraints on the compatibility between textile products, materials, and processes, easily generating generalized descriptions, irrelevant terms, or contradictory terms. Some keyword enhancement methods add domain-specific terms to prompts using fixed word lists or manual rules. However, these enhancement methods are usually static and cannot dynamically adjust term weights based on the user's current product, material, process, and style selection. Furthermore, for textile terms composed of multiple tokens, they may only enhance the first token, failing to guarantee the generation of the complete term.
[0005] Furthermore, user input in smart textile scenarios is often in Chinese labels, while prompts for product simulation demonstrations typically require professional English expressions. This creates a cross-language mapping issue between Chinese material and process labels and English textile terminology. For example, labels such as "modal," "digital printing," and "anti-mite and antibacterial finishing" need to be reliably transcribed into English technical terms like modal, digital printing, anti-mite, or antibacterial, respectively. Simply counting the number of terminology hits in the generated text can easily confuse the English transcriptions of user-input labels with the textile technical descriptions proactively expanded by the method, making it difficult to objectively evaluate the technical effectiveness.
[0006] Therefore, there is a need for an automatic generation method for large model prompts in the textile generation field, which can dynamically generate English textile field prompts containing accurate textile terminology based on structured textile parameters, thereby providing more controllable, professional and consistent text conditions for the simulation display of home textile products. Summary of the Invention
[0007] The purpose of this invention is to provide an automatic generation method for large model prompts in the field of textile generation, in order to solve the problems of high cost of manual prompt writing, insufficient coverage of general large model textile terms, unstable transcription of Chinese professional tags to English terms, lack of input condition adaptation for static keyword enhancement, incomplete generation of multi-token textile terms, terminology duplication, and difficulty in distinguishing between input transcription and extended generation in terminology hit evaluation.
[0008] To address the aforementioned technical problems, this invention provides a method for automatically generating prompt words for large models in the textile manufacturing field, comprising the following steps:
[0009] Step S1: Obtain the textile product parameters selected by the user. The textile product parameters include at least product type, material, style and lighting conditions, as well as process parameters.
[0010] Step S2: Generate structured textile semantic tags based on the textile product parameters;
[0011] Step S3: Construct a candidate set of textile terms, which includes multiple textile term texts and term descriptions corresponding to each textile term text;
[0012] Step S4: Perform semantic vector encoding on the structured textile semantic tags and the term descriptions respectively, and calculate the semantic relevance between the structured textile semantic tags and each term description;
[0013] Step S5: Determine the textile terms and their activation weights related to the current structured textile semantic tags based on the semantic relevance.
[0014] Step S6: Segment the activated textile terms into token sequences and construct a term phrase state and token continuation mapping;
[0015] Step S7: Input the structured textile semantic tags into an autoregressive large model trained or fine-tuned with textile domain data, and obtain the original output score of the current decoding step during the token-by-token decoding process;
[0016] Step S8: Based on the term activation weight and term phrase state, dynamically adjust the output score of the token corresponding to the activated textile term, and perform prefix matching continuation control on multi-token textile terms.
[0017] Step S9: Generate English textile-related prompts for textile product pattern simulation based on the output distribution after dynamic gain adjustment.
[0018] Furthermore, the structured textile semantic tags of the present invention are assembled according to preset fields, which include product form field, material field, process field, style field and light field; wherein, when the process parameter is empty, the structured textile semantic tags omit the process field or set the process field to an empty value.
[0019] Furthermore, the candidate set of textile terms in this invention includes terms related to fabric structure, printing and dyeing processes, spinning and yarn structure, fiber material, surface texture, finishing functions, sewing and decoration processes, curtain-specific structures, and photographic rendering. Each textile term text is configured with a term description for semantic encoding, which is used to characterize the meaning of the textile term in textile application scenarios.
[0020] Furthermore, in step S4 of the present invention, the input semantic vector of the structured textile semantic tag and the term semantic vector of each term description are generated using a multilingual semantic coding model, and the cosine similarity between the input semantic vector and each term semantic vector is calculated, and the cosine similarity is used as the semantic relevance.
[0021] Furthermore, in step S5 of the present invention, irrelevant terms are first filtered based on a preset similarity threshold, and then the top-k terms with the highest semantic relevance are selected from the remaining terms. The semantic relevance of the top-k terms is then normalized to obtain the sparse term activation weights.
[0022] Furthermore, the normalized weights of the top-k terms in this invention are calculated by the softmax function, which takes the semantic relevance of the top-k terms as input and has a temperature coefficient, so that dynamic enhancement is performed only on the sparse term subspace related to the current input each time it is generated.
[0023] Furthermore, the dynamic gain adjustment in step S8 of the present invention further includes confidence-aware dynamic gain adjustment, wherein the confidence-aware dynamic gain adjustment satisfies:
[0024]
[0025]
[0026] in, Indicates the first The original output score of token v in each decoding step. This represents the adjusted output score. Indicates the first The textile term in the first The dynamic gain applied to token v in each decoding step This represents the set of textile terms that have been activated. This represents the gain scaling factor. Indicates the first The activation weight of each activated textile term. This represents the prediction probability of the autoregressive large model for token v at the current decoding step. Indicates the phrase state decay factor. Indicates the first Does a textile term in a generated sequence state require an enhanced token v? Indicates the first decoding step to the second step. The token sequence generated in the decoding steps.
[0027] Furthermore, the prefix matching continuation control for multi-token textile terms of the present invention includes: segmenting the textile term text into a token sequence; during the token-by-token decoding process, detecting whether the end of the generated token sequence matches the prefix token sequence of the textile term text; if they match, applying a dynamic gain to the next token in the textile term text that is located after the prefix token sequence; if no prefix of the textile term is generated, applying a guiding gain less than the full dynamic gain to the first token of the textile term.
[0028] Furthermore, step S8 of the present invention also includes phrase-level attenuation processing: recording the number of times each complete textile term phrase appears in the generated text, and reducing the dynamic gain value of the subsequent complete textile term phrase according to the number of times the complete textile term phrase appears; wherein, different textile terms containing a shared token record the phrase state respectively.
[0029] Furthermore, when generating the English textile field prompts, the present invention outputs term activation attribution information, which includes at least one of the following: activated term, semantic relevance, term activation weight, dynamic gain value, number of tokens, and activation mode.
[0030] Furthermore, the autoregressive large model of the present invention, trained or fine-tuned with data in the textile field, is obtained through textile prompt word training data; the textile prompt word training data uses compatible label sampling to generate candidate inputs, and performs multi-dimensional quality scoring and hard threshold filtering on the candidate English prompt words. The multi-dimensional quality scoring includes at least term density, term context correctness, input anchoring recall, contradiction consistency, and length sufficiency.
[0031] Furthermore, the textile prompt word training data of the present invention undergoes quality-first semantic deduplication after hard threshold filtering, and the training set and validation set are isolated according to the tag combination composed of product type, material and process, so that the same tag combination only enters one of the training set or the validation set.
[0032] Furthermore, the dynamic gain adjustment of the present invention is performed as an output score processing step in the inference stage of the autoregressive large model. The input of the output score processing step is the generated token sequence and the original output score of the current step, and the output is the output score after semantic relevance gain, confidence modulation, multi-token continuation and phrase-level attenuation processing, without changing the model parameters of the autoregressive large model.
[0033] Furthermore, the method of the present invention also includes a prompt quality assessment step, in which the input anchor terms directly corresponding to the user input are distinguished and statistically analyzed from the extended terms other than the user input, and the English textile field prompt terms are evaluated using at least one of the following indicators:
[0034]
[0035]
[0036] in, This indicates the recall rate of the input anchored terms. This indicates the hit rate of extended terms.
[0037] Furthermore, the method of the present invention includes at least one functional step among parameter acquisition, structured label generation, term candidate set construction, semantic relevance calculation, term activation, large model dynamic decoding, attribution evaluation, and prompt word output.
[0038] Furthermore, the large model dynamic decoding steps include at least one of semantic encoding, similarity calculation, sparse term activation, confidence-aware gain, multi-token prefix matching continuation, phrase-level state decay, and activation attribution records.
[0039] By adopting the above technical solution, the present invention has the following beneficial effects:
[0040] First, this invention constructs structured textile semantic tags based on product type, material, process, style, and lighting conditions, improving the standardization of the prompt word generation process. Second, this invention utilizes multilingual semantic encoding to map Chinese textile tags and English terminology descriptions to a unified semantic space, improving the stability of transcribing Chinese professional tags to English textile terms. Third, this invention uses similarity threshold filtering and top-k sparse term activation to enable different product scenarios to activate different subsets of textile terms, reducing the risk of terminology stuffing and misuse caused by overall enhancement of a fixed vocabulary. Fourth, this invention uses confidence-aware dynamic gain to reduce intervention when the model has already generated target terms with high confidence, and to increase intervention when the model underestimates relevant textile terms. Fifth, this invention improves the probability of complete generation of composite terms and reduces false negatives from shared token decay by using prefix matching continuation control and phrase-level state decay for multi-token textile terms. Sixth, this invention improves the interpretability of technical effect verification by using terminology activation attribution and separate evaluation of input anchored terms and extended terms. Attached Figure Description
[0041] Figure 1 This is a schematic diagram of the overall process of the automatic generation method for large model prompt words in the field of textile production according to the present invention.
[0042] Figure 2 This is a schematic diagram of the functional flow of the automatic generation method for large model prompt words in the field of textile production according to the present invention.
[0043] Figure 3 This is a schematic diagram of the CA-SemBoost dynamic domain gain decoding process of the present invention.
[0044] Figure 4 This is a schematic diagram of the state control of multi-token textile terminology phrases in this invention.
[0045] Figure 5 This is a schematic diagram of the terminology attribution assessment and prompt word output process of this invention. Detailed Implementation
[0046] The technical solution of the present invention will now be clearly and completely described with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0047] The present invention will be further explained below with reference to specific embodiments.
[0048] like Figure 1 As shown, this invention provides an automatic generation method for large model prompt words in the field of textile production, including the following steps:
[0049] Step S1: The user selects the product type, material, process, style, and lighting conditions on the front-end interface. The product type can include bedding sets, curtains, pillowcases, tablecloths, sofa covers, carpets, bath towel sets, or placemats. The material can include pure cotton, combed cotton, long-staple cotton, cotton-linen blends, linen, silk, polyester imitation silk, velvet, wool, bamboo fiber, Tencel, Modal, polyester-cotton blends, light-blocking coated fabrics, and anti-mite and antibacterial fabrics. The process can include plain weave, twill weave, satin weave, jacquard, yarn-dyed jacquard, reactive printing, digital printing, transfer printing, screen printing, mercerizing, brushing, flame-retardant finishing, light-blocking coating, anti-mite and antibacterial finishing, quilting, binding, piping, and embroidery.
[0050] Step S2: This method assembles the user-selected product type, material, process, style, and lighting conditions into structured textile semantic tags. For example, when a user selects a four-piece bedding set, cotton-linen blend, reactive printing, Nordic style (wooden), and natural morning light, the following structured textile semantic tags are generated: Product form: four-piece bedding set | Material: cotton-linen blend | Process: reactive printing | Style: Nordic style (wooden) | Lighting: natural morning light.
[0051] Step S3: This method constructs a candidate set of textile terms. Each candidate term includes the text and description of the textile term. For example, the term "plain weave" corresponds to the description "basic textile weave structure for cotton and linen fabrics"; the term "reactive printing" corresponds to the description "textile dyeing process where dye bonds with fiber"; and the term "blackout coating" corresponds to the description "opaquebacking that blocks light for curtains". The term description is used to enhance the semantic encoding process's understanding of the textile context.
[0052] Step S4: This method uses a multilingual semantic coding model to encode the structured textile semantic tags and terminology descriptions into semantic vectors, respectively, to obtain the input semantic vector. and term semantic vector And calculate the cosine similarity between the two. The higher the cosine similarity, the more relevant the English textile term is to the current Chinese product, material, process, style, and light label.
[0053] Step S5: This method first filters out obviously irrelevant textile terms using a similarity threshold, then selects the top-k most relevant terms from the remaining terms, and performs softmax normalization on the similarity of the top-k terms to obtain the sparse term activation weights. For example, in scenarios such as four-piece bedding sets, cotton-linen blends, and reactive printing, terms such as plain weave, linen, cotton, reactive printing, and breathable may enter the sparse term subset; while curtain-specific terms such as blackout and valance will not be activated due to insufficient semantic relevance.
[0054] Step S6: This method will segment the activated terms into a token sequence, record the number of tokens, the first token, the continuation token, and the number of times the complete phrase appears for each term, and construct a term phrase state and token continuation mapping.
[0055] Step S7: This method inputs the structured textile semantic tags into an autoregressive large model trained or fine-tuned with textile domain data. The autoregressive large model learns the mapping relationship from Chinese structured tags to English textile domain prompts through textile domain training data, and outputs the original score of the current step during the token-by-token decoding process.
[0056] Step S8: This method generates English textile-related prompts. These prompts include not only product form, spatial arrangement, and lighting information, but also input anchor terms and extended textile terminology beyond the input. For example, prompts may include descriptions such as cotton linen blend fabric, plain weave structure, reactive printing process, natural fiber hairiness, binding stitch edges, and soft matte surface.
[0057] Step S9: This method outputs the generated English textile field prompts in the form of text data, and can simultaneously output structured textile semantic tags, term activation attribution information and prompt quality assessment results, which can be used for subsequent product simulation display, scheme management or manual review.
[0058] Step S2: Construction of the candidate set of textile labels and terms, the specific process is as follows:
[0059] In this step, a tag lexicon and a candidate term set are pre-built. The tag lexicon includes product type, material, process, style, and lighting lexicon. To reduce the impact of inappropriate combinations on training and inference, compatible candidate pools between products and materials, and products and processes, can also be established. For example, bath towel sets are more suitable for pure cotton, combed cotton, long-staple cotton, bamboo fiber, bamboo-cotton blends, and terry cloth; curtains are more suitable for linen, polyester imitation silk, blackout coated fabrics, gauze, blackout coatings, and flame-retardant finishes.
[0060] The terminology candidate set is grouped according to the textile knowledge structure, including: terms related to fabric structure, printing and dyeing processes, spinning and yarn structure, fiber materials, surface characteristics and texture, finishing and functional finishing, sewing and decoration processes, curtain-specific structures, and photographic rendering. By using the terminology candidate set as a candidate semantic space, rather than a hard-coded product-terminology mapping table, this invention avoids complete reliance on manual rules.
[0061] Step S3: Training the domain cue word generation model, the specific process is as follows:
[0062] In this step, training data from the textile industry is used to train the autoregressive model or to efficiently fine-tune its parameters. Training data can be obtained through methods such as manual annotation, expert compilation, compilation of existing textile cue words, and generation via large-scale model distillation. Each training sample includes structured textile semantic tags and corresponding English textile cue words.
[0063] To improve the quality of training data, candidate samples can be scored using a multi-dimensional quality assessment. This multi-dimensional quality assessment can include terminology density, terminology contextual correctness, input anchoring recall, description consistency, and length adequacy. Specifically, input anchoring recall measures whether a user-given material or process label is correctly transcribed into English textile terminology; terminology contextual correctness determines whether the terminology is applicable to the current product, material, or process; and description consistency detects whether mutually exclusive terms such as matte and lustrous, blackout and sheer, appear simultaneously.
[0064] In one implementation, the training sample quality score can be expressed as:
[0065]
[0066] in, Indicates term density, Indicate the correctness of the terminology in context. This indicates input-anchored recall. Indicates no contradiction. Indicates sufficiency of length.
[0067] Relying solely on the overall quality score may retain samples with significant individual deficiencies. Therefore, hard threshold filtering conditions can be set, including a term hit count of no less than a preset number, the absence of mutually exclusive terms, an input anchor term recall rate of no less than a preset threshold, an English word count of no less than a preset number, and a term context accuracy rate of no less than a preset threshold. Only samples whose overall quality score reaches the threshold and passes the hard threshold are included in the subsequent training dataset.
[0068] Furthermore, a unified terminology matching module can be used to maintain English terminology aliases, word boundary matching rules, and input anchoring mappings from Chinese tags to English terms. These input anchoring mappings are used only for data quality filtering and evaluation and do not participate in CA-SemBoost decoding control, thus avoiding the reintroduction of manually generated terminology gating into the core decoding algorithm.
[0069] Furthermore, semantic vector models can be used to perform quality-priority semantic deduplication on training samples. Before deduplication, samples are sorted according to hard threshold passing state, overall quality score, input anchoring recall, term context correctness, term density, and length sufficiency, so that higher-quality samples are retained among semantically similar samples.
[0070] Furthermore, the training and validation sets are isolated based on label combinations composed of product type, material, and process. This ensures that the same product type, material, and process combination only enters either the training or validation set, thereby reducing the possibility of inflated validation results due to leakage of the same combination. Data quality audit results can also be output, recording the sample size, average quality score, number of hard-threshold failure samples, and number of label combination leaks in the training and validation sets.
[0071] Step S4: Dynamic neighborhood gain decoding, the specific process is as follows:
[0072] like Figure 3 As shown, dynamic domain gain decoding includes an initialization phase and a token-by-token decoding phase.
[0073] The initialization phase includes: processing structured textile semantic tags. Perform multilingual semantic encoding to obtain the input semantic vector. Multilingual semantic encoding is performed on the description of each English term in the term candidate set to obtain a term semantic vector. The cross-linguistic semantic relevance between structured textile semantic tags and textile terms is calculated using the following formula:
[0074]
[0075] in, The larger the value, the higher the semantic relevance between the structured textile semantic tags and the corresponding textile terminology descriptions; subsequently, a similarity threshold is used. After filtering out obviously irrelevant terms, top-k selection and softmax normalization are performed on the remaining terms to obtain the sparse term activation weights. .
[0076] In one engineering implementation, dynamic neighborhood gain decoding is integrated into the stepwise generation process as an output score processing step of the autoregressive large model. The inputs are the generated token sequence and the current step's output score, and the output is the score after neighborhood gain and attenuation processing. Therefore, this method does not require changes to the autoregressive large model parameters and is not limited to a specific deployment environment.
[0077] The token-by-token decoding phase includes: the autoregressive large model outputting the original score at the t-th decoding step. Calculate the probability of the current step using the following formula:
[0078]
[0079] Then, it is determined whether the current candidate token belongs to the activated textile term and its continuation state; if it does, the gain determined by the sparse term activation weight, confidence adjustment term, and phrase state decay factor is added to the output score of the corresponding token to obtain the adjusted output score. The next token is selected based on the adjusted output distribution. This process can be represented as:
[0080]
[0081]
[0082] in, Indicates the first The original output score of token v in each decoding step. This represents the adjusted output score. Indicates the first The textile term in the first The dynamic gain applied to token v in each decoding step This represents the set of textile terms that have been activated. Indicates the gain scaling factor. Indicates the first The activation weight of each activated textile term. This represents the prediction probability of the autoregressive large model for token v at the current decoding step. Indicates the phrase state decay factor. Indicates the first Does a textile term in an already generated sequence state require an enhanced token v? Indicates the first decoding step to the second step. The token sequence generated in the decoding steps.
[0083] Step S5: Multi-token continuation, term decay, and confidence awareness, the specific process is as follows:
[0084] like Figure 4 As shown, for multi-token textile terms, the term text is segmented into a token sequence. For example, "reactiveprinting" can be segmented into [reactive, printing], and "plain weave" can be segmented into [plain, weave]. During token-by-token decoding, it is checked whether the end of the generated sequence matches the term prefix. When the model has already generated "reactive", a dynamic gain is applied to the token corresponding to "printing", thereby increasing the probability of generating "reactive printing" completely.
[0085] To avoid excessive repetition of the same term in prompts, this method performs term attenuation. In one implementation, the number of times a term's corresponding token appears in the generated text is counted, and the output score is reduced for tokens whose occurrence count reaches a preset number. In another implementation, the occurrence count of the complete term phrase is recorded, and the subsequent dynamic gain of that complete term phrase is multiplicatively attenuated. Phrase-level attenuation avoids false positives caused by shared tokens; for example, after "plain weave" appears, only the subsequent gain of "plain weave" itself is reduced, without affecting other terms containing "weave," such as "twill weave."
[0086] Furthermore, confidence-aware gain processing can be performed. Specifically, in the current decoding step, the prediction probability of the autoregressive large model for the target token is calculated. The effective gain is determined by the gain scaling factor, sparse term activation weights, confidence adjustment term, and phrase state decay factor. Indicates the activation weights of sparse terms. This represents the term decay factor. When the model itself is already highly inclined to generate a certain textile term, the confidence modifier is smaller, reducing intervention; when the model underestimates relevant textile terms, the confidence modifier is larger, increasing intervention.
[0087] In phrase-level attenuation, the attenuation factor can be expressed as:
[0088]
[0089] in, Indicates the first The number of times a complete textile term phrase appears in the generated text. This represents the phrase decay saturation threshold.
[0090] The aforementioned confidence-aware, phrase state decay, and top-k sparse activation can be enabled individually or in combination to form an ablation comparison of baseline decoding, semantically enhanced decoding, confidence-aware semantically enhanced decoding, and top-k sparsely enhanced decoding. This method can return generated prompts, structured input, number of activated terms, term activation attribution information, and decoding scheme identifiers.
[0091] Step S6: Terminology Attribution and Evaluation, the specific process is as follows:
[0092] In this step, term activation attribution information is output, including term, similarity, weight, boost, token_count, and mode. This attribution information explains which textile terms are activated, why each term is activated, and from which semantic weights the dynamic enhancement intensity comes. This attribution information is only used for logging, experimental analysis, and interpretability demonstration, and is not used as additional manually controlled rules for decoding.
[0093] To avoid misinterpreting user-inputted technical tags as extended generation capabilities, a distinction is made between input anchor terms and extended terms during the evaluation phase. Input anchor term recall rate. It can be represented as:
[0094]
[0095] in, This represents the set of English terms that directly correspond to the material or process labels entered by the user. This represents the set of input anchor terms that the generated prompt word hit.
[0096] Extended term hit rate It can be represented as:
[0097]
[0098] in, This indicates a glossary of terms for independent evaluation. This represents the set of evaluation terms indicating the generation of prompt word hits. (Through...) and It can measure the ability to transcribe professional tags from Chinese input and the ability to expand textile professional descriptions beyond user input, respectively.
[0099] Step S7: Prompt word output and application interface, the specific process is as follows:
[0100] like Figure 5 As shown, the English textile domain prompts, structured textile semantic tags, and terminology activation attribution information are output as text data. This output can be used in product simulation demonstration processes, design scheme management processes, or manual review processes. However, the core improvement of this invention lies in the automatic generation and decoding control of the English textile domain prompts.
[0101] For example, when the input is a four-piece bedding set, cotton-linen blend, reactive printing, Nordic style with natural wood texture, and early morning natural light, the generated English prompt can be described as: "a complete 4-piece bedding set made of cotton linenblend fabric in plain weave structure, with reactive printing process, natural fiber hairiness, soft matte surface, binding stitch edges, early morning natural light." This prompt can serve as text conditions for simulating or showcasing textile product patterns, conveying professional information such as the cotton-linen texture, bedding structure, and Nordic style with natural wood texture.
[0102] Step S8: Implementation of the method's functional flow, the specific process is as follows:
[0103] like Figure 2 As shown, the present invention provides a functional flow of an automatic generation method for large model prompt words in the field of textile production, including parameter acquisition steps, structured label generation steps, term candidate set construction steps, semantic relevance calculation steps, term activation steps, large model dynamic decoding steps, attribution evaluation steps, and prompt word output steps.
[0104] The parameter acquisition step is used to acquire the product type, material, process, style, and lighting conditions selected by the user. The structured tag generation step is used to assemble the product type, material, process, style, and lighting conditions into structured textile semantic tags. The term candidate set construction step is used to maintain textile term text and term descriptions. The semantic relevance calculation step is used to calculate the semantic relevance between the structured textile semantic tags and the English term descriptions. The term activation step is used to determine the activated terms and their weights based on semantic relevance. The large model dynamic decoding step is used to perform confidence-aware dynamic gain, multi-token continuation, and phrase-level state decay. The attribution evaluation step is used to output term activation attribution information and calculate indicators such as input anchored term recall, extended term hit, and term precision. The prompt word output step is used to output at least one of the following in text data form: English textile domain prompt words, structured textile semantic tags, and term activation attribution information.
[0105] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.
Claims
1. A method for automatically generating prompt words for large models in the field of textile production, characterized in that, Includes the following steps: Step S1: Obtain the textile product parameters selected by the user. The textile product parameters include at least product type, material, style and lighting conditions, as well as process parameters. Step S2: Generate structured textile semantic tags based on the textile product parameters; Step S3: Construct a candidate set of textile terms, which includes multiple textile term texts and term descriptions corresponding to each textile term text; Step S4: Perform semantic vector encoding on the structured textile semantic tags and the term descriptions respectively, and calculate the semantic relevance between the structured textile semantic tags and each term description; Step S5: Determine the textile terms and their activation weights related to the current structured textile semantic tags based on the semantic relevance. Step S6: Segment the activated textile terms into token sequences and construct a term phrase state and token continuation mapping; Step S7: Input the structured textile semantic tags into an autoregressive large model trained or fine-tuned with textile domain data, and obtain the original output score of the current decoding step during the token-by-token decoding process; Step S8: Based on the term activation weight and term phrase state, dynamically adjust the output score of the token corresponding to the activated textile term, and perform prefix matching continuation control on multi-token textile terms. Step S9: Generate English textile-related prompts for textile product pattern simulation based on the output distribution after dynamic gain adjustment.
2. The method for automatically generating prompt words for large models in the textile production field according to claim 1, characterized in that, The candidate set of textile terms includes terms related to fabric structure, printing and dyeing processes, spinning and yarn structure, fiber materials, surface texture, finishing functions, sewing and decoration processes, curtain-specific structures, and photographic rendering. Each textile term text is configured with a term description for semantic encoding, which is used to characterize the meaning of the textile term in textile application scenarios.
3. The method for automatically generating prompt words for large models in the textile production field according to claim 1, characterized in that, In step S4, the input semantic vector of the structured textile semantic tag and the term semantic vector of each term description are generated using a multilingual semantic coding model, and the cosine similarity between the input semantic vector and each term semantic vector is calculated, and the cosine similarity is used as the semantic relevance.
4. The method for automatically generating prompt words for large models in the textile production field according to claim 1, characterized in that, In step S5, irrelevant terms are first filtered based on a preset similarity threshold. Then, the top-k terms with the highest semantic relevance are selected from the remaining terms, and the semantic relevance of the top-k terms is normalized to obtain sparse term activation weights. The normalized weights of the top-k terms are calculated by the softmax function, which takes the semantic relevance of the top-k terms as input and includes a temperature coefficient, so that dynamic enhancement is performed only on the sparse term subspace related to the current input each time it is generated.
5. The method for automatically generating prompt words for large models in the textile production field according to claim 1, characterized in that, The dynamic gain adjustment in step S8 further includes confidence-aware dynamic gain adjustment, wherein the confidence-aware dynamic gain adjustment satisfies: ; ; in, Indicates the first The original output score of token v in each decoding step. This represents the adjusted output score. Indicates the first The textile term in the first The dynamic gain applied to token v in each decoding step This represents the set of textile terms that have been activated. This represents the gain scaling factor. Indicates the first The activation weight of each activated textile term. This represents the prediction probability of the autoregressive large model for token v at the current decoding step. Indicates the phrase state decay factor. Indicates the first Does a textile term in an already generated sequence state require an enhanced token v? Indicates the first decoding step to the second step. The token sequence generated in the decoding steps.
6. The method for automatically generating prompt words for large models in the textile production field according to claim 1, characterized in that, The prefix matching continuation control for multi-token textile terms includes: segmenting the textile term text into a token sequence; during the token-by-token decoding process, detecting whether the end of the generated token sequence matches the prefix token sequence of the textile term text; if they match, applying a dynamic gain to the next token in the textile term text that follows the prefix token sequence; if no prefix for the textile term is generated, applying a guiding gain smaller than the full dynamic gain to the first token of the textile term.
7. The method for automatically generating prompt words for large models in the textile production field according to claim 1, characterized in that, Step S8 also includes phrase-level attenuation processing: recording the number of times each complete textile term phrase appears in the generated text, and reducing the dynamic gain value of the subsequent complete textile term phrase according to the number of times the complete textile term phrase appears; wherein, different textile terms containing shared tokens record the phrase state respectively.
8. The method for automatically generating prompt words for large models in the textile production field according to claim 1, characterized in that, When generating the English textile field prompts, term activation attribution information is output. The term activation attribution information includes at least one of the following: activated term, semantic relevance, term activation weight, dynamic gain value, number of tokens, and activation mode.
9. The method for automatically generating prompt words for large models in the textile production field according to claim 1, characterized in that, The method further includes a prompt quality assessment step, in which the input anchor terms directly corresponding to the user input are distinguished and statistically analyzed from extended terms outside the user input, and the English textile field prompt terms are evaluated using at least one of the following indicators: ; ; in, This indicates the recall rate of the input anchored terms. Indicates the hit rate of extended terms. This represents the set of input anchor terms that the generated prompt word hits. This represents the set of English terms that directly correspond to the material or process labels entered by the user. This represents the set of evaluation terms that indicate the generated prompt word hits. A glossary of terms indicating independent evaluation.
10. The method for automatically generating prompt words for large models in the textile production field according to claim 1, characterized in that, The method includes at least one of the following functional steps: parameter acquisition, structured label generation, term candidate set construction, semantic relevance calculation, term activation, large model dynamic decoding, attribution evaluation, and prompt word output; the large model dynamic decoding step includes at least one of the following: semantic encoding, similarity calculation, sparse term activation, confidence-aware gain, multi-token prefix matching continuation, phrase-level state decay, and activation attribution records.
