Writing method, system, device and medium based on generative text large model
By collecting industry data and fine-tuning the training for the generative text large model, and combining the DeepSpeed tool with the professional Prompt command, the problem of low efficiency in the application of generative text large models in professional fields is solved, and efficient and accurate document generation is achieved.
Patent Information
- Application Number
- CN202410317565.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-03-20
- Publication Date
- 2025-12-26
- Estimated Expiration
- 2044-03-20
AI Technical Summary
The application of existing generative text models for writing is limited in specific professional fields or tasks, and the lack of effective prompt instruction templates or methods in existing technologies leads to inefficient and unstable fine-tuning processes.
We collect relevant data for specific industries, fine-tune the training using a generative text model, accelerate model convergence with the DeepSpeed tool, evaluate the model using perplexity and similarity metrics, construct an industry-specific generative text model, and generate user templates using a professional Prompt command.
It improves the efficiency of professional document writing, enhances the professionalism and accuracy of document generation, meets personalized writing needs, and improves user experience and document quality.
Smart Images

Figure CN118246426B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application belongs to the field of artificial intelligence, and particularly relates to a writing method, system, device and medium based on a generative text large model. BACKGROUND
[0002] In the field of natural language processing, generative text large models (such as GPT-3, etc.) have made significant progress. Such large models can generate natural and fluent text through large-scale pre-training and instruction fine-tuning, and have the potential to perform tasks in multiple fields. However, one important problem in existing mainstream technologies is that such large model-based writing usually requires a large amount of data and computing resources for training, and the application in specific professional fields or tasks is greatly limited. In addition, for the fine-tuning needs of specific fields, the existing technology lacks effective Prompt instruction templates or methods, resulting in low efficiency and instability of the fine-tuning process.
[0003] Chinese patent with publication number "CN116775811A" discloses a data retrieval and intelligent auxiliary writing system and method based on power grid information. The system includes a data acquisition module that uses a collector to capture and online data reporting method to obtain data; a data storage module for data storage and file storage; a data retrieval module for structured data retrieval and unstructured data retrieval, real-time query and classification of massive data, and selection of effective data; a wisdom library analysis module for article word analysis, intelligent auxiliary writing, and intelligent writing of documents after structured data retrieval and unstructured data retrieval. The invention patent mainly uses a collector to capture and online data reporting method to obtain, store, and analyze data, and performs article word analysis, intelligent auxiliary writing, and intelligent writing on documents after structured data retrieval and unstructured data retrieval. Although it can better realize content detection and word analysis of unstructured data, it still has the problem of semantic repetition and word combination in professional document writing, which cannot well realize the professional and fluent expression of language, and the generated content is relatively rigid and lacks the ability to imitate the style of professional documents.
[0004] The Chinese patent with publication number "CN115630640B" discloses an intelligent writing method, device, equipment and medium, which includes: generating an article outline; forming a target text by combining any topic sentence in the article outline with a paragraph related to the topic sentence taken from a content knowledge base; inputting the target text into a pre-trained model to obtain the probability of each word in the dictionary being a generated word; punishing the probability corresponding to the target word in the dictionary based on a penalty factor, and taking the generated word from the dictionary based on the probability; updating the target text based on the generated word; calculating a diversity evaluation index based on the new target text, and updating the penalty factor based on the diversity evaluation index, and inputting the new target text into the pre-trained model for continuous iteration until the generated word taken is a stop symbol, then determining the current target text as a candidate paragraph; determining the optimal paragraph based on the candidate paragraph of any topic sentence. The invention patent mainly uses a knowledge base and a text pre-training model to extract content segments and keywords related to the written topic, and iteratively outputs text paragraphs that meet the index standards of the text generation content through a penalty factor and a text calculation diversity evaluation index. The text generation content can better iteratively output knowledge base text content related to the written topic, but the disadvantage is that it cannot adapt to new professional field style text writing, and the content is mostly fixed in the original knowledge base or pre-training model. The expansion and adaptability are poor.
[0005] The Chinese patent with publication number "CN114492327A" discloses an intelligent writing method for official documents. First, a large amount of official document data is automatically obtained from a designated website, and NLP technology is used for automatic filtering and cleaning of official document text data. Then, the GPT model is trained in two stages to capture the deep semantic information of official document text and learn the representation characteristics of official document sentences to obtain the ability of automatic official document writing. Finally, in the intelligent writing process, the trained BERT model is used to calculate the correlation score between the text segments of the recommended text set and the user-defined title, and the recommended segment that best matches the user title semantics is selected. Although the invention patent can learn the text style of official documents and has certain intelligent creation ability, the BERT model itself has a million-level parameter quantity, which cannot completely learn the writing style and semantic understanding of official documents. There is a certain text content deviation in the similarity calculation through the word vector. SUMMARY
[0006] The present application provides a writing method, system, device and medium based on a generative text large model, aiming to solve the problem that the application of the current writing based on a generative text large model in a specific professional field or task is greatly limited, and the fine-tuning process is inefficient and unstable due to the lack of effective Prompt instruction templates or methods in the prior art.
[0007] To solve the above technical problems, the application provides a writing method based on a generative text large model, comprising the following steps:
[0008] S1: Collecting field-related data for a specific industry, including text data, label data and related metadata, and preprocessing the collected data.
[0009] S2: Selecting a generative text large model, using a general corpus of industry-specific text corpus, using a text large model fine-tuning tool to fine-tune the model according to the data volume and computing resources, using DeepSpeed training tool to accelerate the model convergence speed during the fine-tuning training process, and performing multiple rounds of fine-tuning iteration to generate an industry-specific generative text large model.
[0010] S3: Evaluating the trained generative text large model using perplexity and similarity indicators and evaluation methods, and adjusting and optimizing the parameters according to the evaluation results.
[0011] S4: Determining the content and structure of the user template according to the specific industry scenario file style, including the title of the document, the paragraph structure, the insertion position of the specific information and the syntax constraints, and generating the user template prompt using the corresponding Prompt instruction.
[0012] S5: Based on the existing data input by the user, the user template prompt, and the inference of the generative text large model, the corresponding compiled text content is obtained.
[0013] Preferably, the calculation formula of the perplexity indicator used in step S3 is:
[0014] PP(W)=P(w1,w2,…,w N ) -1 / N
[0015] In the formula, W=(w1,w2,…,w N ) is the given text content, PP(W) is the perplexity indicator of W, N is the sequence length of W, and P(w1,w2,…,w N ) is the joint probability obtained by the generative text large model according to the training data.
[0016] Preferably, the calculation formula of the similarity indicator used in step S3 is:
[0017]
[0018] In the formula, ROUGE-N is a similarity index, Number of overlapping N-grams is the number of total text content identical character sequences overlapping between generated text content and reference text content, and Number of N-grams in reference summary is the number of total text content identical character sequences in the reference text.
[0019] Preferably, the writing method further comprises providing professional information data retrieval of a specific industry, specifically: retrieving and analyzing existing data related to a specific industry field, and according to user template prompts, when the user needs to introduce private, historical professional data, the trained generative text large model is used to give corresponding reference professional information data.
[0020] In another aspect, the present application provides a writing system based on a generative text large model, comprising a preprocessing module, a training module and a writing module.
[0021] The preprocessing module is used to collect field-related data for a specific industry, including text data, label data and other related metadata, and to preprocess the collected data.
[0022] The training module is used to select a generative text large model, use an industry-specific text corpus general corpus, and use a text large model fine-tuning tool to fine-tune the model according to the amount of data and the situation of computing resources. In the fine-tuning training process, the DeepSpeed training tool is used to speed up the model convergence speed, and multiple rounds of fine-tuning iteration are performed to generate an industry-specific generative text large model.
[0023] The trained generative text large model is evaluated using two indexes of perplexity and similarity and evaluation methods, and according to the evaluation results, the parameters are adjusted and optimized.
[0024] The writing module is used to determine the content and structure of the user template according to the specific industry scene file style, including the title of the document, the paragraph structure, the insertion position of the specific information and the grammar constraints, and uses the corresponding Prompt instruction to generate the user template prompt.
[0025] Based on the existing data input by the user and the user template prompt, the corresponding compiled text content is obtained through the inference of the generative text large model.
[0026] Preferably, the calculation formula of the perplexity index used in the training module is specifically:
[0027] PP(W)=P(w1,w2,…,w N ) -1 / N
[0028] In the formula, W=(w1,w2,…,wN ) is the perplexity indicator of W, N is the sequence length of W, P(w1, w2, …, w N ) is the joint probability obtained by the generative text large model according to the training data.
[0029] The calculation formula of the similarity indicator used in the training module is specifically:
[0030]
[0031] In the formula, ROUGE-N is the similarity indicator, Number of overlapping N-grams is the number of total text content same character sequence overlapping between the generated text content and the reference text content, and Number of N-grams in reference summary is the number of total text content same character sequence in the reference text.
[0032] Preferably, the writing module of the writing system further comprises providing professional information data retrieval of a specific industry, specifically: retrieving and analyzing existing data related to a specific industry field, and according to user template prompts, when the user needs to introduce private, historical professional data, the trained generative text large model is used to give corresponding reference professional information data.
[0033] In another aspect, the present application also provides an electronic device, comprising a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to realize the writing method based on the generative text large model according to any one of the embodiments of the present application.
[0034] In another aspect, the present application also provides a computer readable storage medium having a computer program stored thereon, wherein the computer program is executable by a processor to realize the writing method based on the generative text large model according to any one of the embodiments of the present application.
[0035] Compared with the prior art, the present application has the following technical effects:
[0036] 1. The present application proposes an intelligent writing method based on a generative text large model, which comprehensively uses a vertical field generative text large model, a large model fine-tuning tool, a professional Prompt instruction template and industry field related data resources, and based on the vertical field generative text large model, trains the industry field related data according to the data structure required by the text large model fine-tuning, and at the same time, relies on the Prompt instruction of professional document generation to construct an intelligent document writing suitable for professional field writing, greatly improves the efficiency of professional document writing, and has a flexible development scheme for complex professional requirement scene application.
[0037] 2. The intelligent writing system according to the present application provides a visual interface and simple commands through a new document writing mode, allowing users to quickly create documents and customize formats, saving time on layout. Users can choose templates and styles to meet individual writing needs, improving user experience and work efficiency. The writing system can deeply analyze document content using a text large model in the upload document writing mode, providing grammar error detection and optimization suggestions to improve the professionalism and accuracy of the document. Based on text analysis, the writing system provides personalized grammar optimization and modification suggestions to improve user writing skills and document quality. The quick writing mode is based on semantic understanding and a large amount of training data to quickly generate outlines and paragraphs, providing inspiration sources to effectively improve article creation efficiency and quality. The writing system in the template writing mode combines relevant data in the corresponding industry field and a generative text large model to provide text content that meets the specification requirements, improving text quality and specification, and promoting the improvement of writing level. BRIEF DESCRIPTION OF DRAWINGS
[0038] Figure 1 is the overall flowchart of the writing method based on the generative text large model according to the present application. DETAILED DESCRIPTION
[0039] To make the objectives, technical solutions, and advantages of the present application clearer, specific embodiments of the present application will be described below with reference to the accompanying drawings.
[0040] Example 1
[0041] The present embodiment provides a writing method based on a generative text large model, as shown in Figure 1 , including the following steps:
[0042] including the following steps:
[0043] S1: Collect field-related data for a specific industry, including text data, label data, and other related metadata. Preprocess the collected data. The preprocessing includes data cleaning, word segmentation, tokenization, noise removal, and sensitive data removal to ensure data quality and consistency. The data range is between 50,000 and 100,000 pieces of data.
[0044] S2: Select an appropriate, commercially available intellectual property, medium parameter scale generative text large model, such as LLaMa, BaiChuan, ChatGLM, etc. Open source text large model, use the general corpus of industry-specific text corpus, according to the data volume and computing resource situation, use the text large model fine-tuning tool for model fine-tuning training, in the fine-tuning training process, use the DeepSpeed training tool based on the Pytorch training framework to speed up the model convergence speed and improve the training efficiency, carry out multiple rounds of fine-tuning iteration, generate industry-specific generative text large model, so that it has the ability of semantic understanding, knowledge reasoning and text generation in professional field, and improve the application effect of industry text large model in the industry.
[0045] As a preferred embodiment of the present embodiment, taking BaiChuan text large model as an example, the data volume and computing resource situation in step S2 is as follows:
[0046] Data volume estimation: According to the sample balance and text generation business demand principle, the sample format of Baichuan text large model 100 billion parameter training data is pure text, and the data volume is about 170 million lines, 5GB text.
[0047] Computing resource estimation: using large model 130 billion parameters (supporting BF16), in the environment of 8 Nvidia A100 80GB, Python 3.8+ and PyTorch1.13.1+, using NVLink for full fine-tuning training.
[0048] As a preferred embodiment of the present embodiment, the present embodiment uses LLaMA Efficient Tuning fine-tuning tool for model fine-tuning training, and in the fine-tuning training process, the DeepSpeed training tool based on the Pytorch training framework is used to speed up the model convergence speed, which is as follows:
[0049] The text large model instruction supervised fine-tuning data volume is 140,000 pairs of data, the reinforcement learning fine-tuning data is 50,000 data, the data format is JSON question and answer pair, and the content type includes: brainstorming, key information extraction, information summary, open question and answer, rewriting, closed question and answer, classification, and text generation.
[0050] The train.sh script provided by the DeepSpeed training tool is used to perform text large model instruction fine-tuning and reinforcement learning fine-tuning. Further, in the DeepSpeed training tool, BF16 mixed precision training can be enabled to reduce memory usage; DeepSpeed training tool uses nccl library for distributed training on GPU, optimizes communication efficiency in model parallel training process, and realizes accelerated training; DeppSpeedZeRO function in DeppSpeed training tool is used to reduce memory usage and optimize text large model training. There is 1.2 to 3 times acceleration in different parts of the text large model training process.
[0051] The fine-tuned training model weights are merged and the text large model is exported. The export_model.py file provided by the LLaMA Efficient Tuning fine-tuning tool is used to export the text large model.
[0052] S3: Use perplexity and similarity as two indicators and evaluation methods to evaluate the fluency, accuracy and processing effect of specific industry data of the generated text content of the trained generative text large model. According to the evaluation results, the model parameters are adjusted and optimized to further improve the performance and stability of the model.
[0053] S4: Determine the content and structure of the user template according to the specific industry scenario file style, including the title of the document, the paragraph structure, the insertion position of specific information, and the syntax constraints, and generate the user template prompt using the corresponding Prompt instruction. The Prompt instruction describes the required template structure and content, and guides the model to generate text content that meets the expected structure. When building the service, ensure that the input Prompt instruction can be correctly processed and passed to the text large model.
[0054] As a preferred embodiment of the present embodiment, the user template prompt is generated, which is specifically: constructing the Prompt engineering of the generative text large model, for example, "generating content according to the title" is a business operation instruction, then a Prompt engineering is constructed, which contains two parts: one is the content of the dialogue with the text large model, including the input instruction, the specific industry scenario file style, and the other is the content required by the text large model instruction, i.e. domain related data, which generates the user template prompt through the Prompt engineering.
[0055] S5: Based on the existing data input by the user and the user template prompt, the corresponding compiled text content is obtained through the inference of the generative text large model.
[0056] As a preferred embodiment of the present embodiment, step S5 is specifically: sending the user template prompt to the text large model in the interface format of OpenAI, and the text large model understands the business operation content according to the text understanding ability formed after fine-tuning, and synchronously reasons to generate corresponding text content.
[0057] As a preferred embodiment of the present embodiment, the calculation formula of the perplexity index used in step S3 is specifically:
[0058] PP(W)=P(w1,w2,…,w N ) -1 / N
[0059] In the formula, W=(w1,w2,…,w N ) is the given text content, PP(W) is the perplexity index of W, N is the sequence length of W, and P(w1,w2,…,w N ) is the joint probability obtained by the generative text large model according to the training data.
[0060] As a preferred embodiment of the present embodiment, the calculation formula of the similarity index used in step S3 is specifically:
[0061]
[0062] In the formula, ROUGE-N is the similarity index, Number of overlapping N-grams is the number of total text content character sequence overlaps between the generated text content and the reference text content, and Number of N-grams in reference summary is the number of total text content character sequence in the reference text. The higher the similarity index, the higher the overlap between the generated text content and the reference text content, that is, the higher the quality and accuracy of the generated text content.
[0063] As a preferred embodiment of the present embodiment, the writing method further comprises providing professional information data retrieval of a specific industry, specifically: retrieving and analyzing existing data related to a specific industry, such as file slicing and semantic analysis, and when the user needs to introduce private, historical professional data, the trained generative text large model gives corresponding reference professional information data according to the user template prompt.
[0064] Embodiment two
[0065] Correspondingly, the present embodiment provides a writing system based on a generative text large model, comprising a preprocessing module, a training module and a writing module.
[0066] The preprocessing module is used to collect field-related data for a specific industry, including text data, label data and other related metadata, and preprocess the collected data.
[0067] The module is used to implement the function of step S1 in embodiment one, and will not be described here.
[0068] The training module is used to select a generative text large model, use an industry-specific text corpus, and use a text large model fine-tuning tool to fine-tune the model according to the data volume and computing resources. In the fine-tuning training process, the DeepSpeed training tool is used to speed up the model convergence, and multiple rounds of fine-tuning iteration are performed to generate an industry-specific generative text large model.
[0069] The perplexity and similarity indicators and evaluation methods are used to evaluate the trained generative text large model, and the parameters are adjusted and optimized according to the evaluation results.
[0070] The module is used to implement the functions of steps S2 and S3 in embodiment one, and will not be described here.
[0071] The writing module is used to determine the content and structure of the user template according to the specific industry scenario file style, including the title of the document, the paragraph structure, the insertion position of specific information, and the grammar constraints, and uses the corresponding Prompt instruction to generate the user template prompt.
[0072] Based on the existing data input by the user and the user template prompt, the corresponding compiled text content is obtained through the inference of the generative text large model.
[0073] The module is used to implement the functions of steps S4 and S5 in the embodiment, and will not be described here.
[0074] As a preferred embodiment of the present embodiment, the writing module of the writing system further comprises providing professional information data retrieval of a specific industry, specifically: retrieving and analyzing existing data related to a specific industry field, and according to the user template prompt, when the user needs to introduce private, historical professional data, the trained generative text large model gives the corresponding reference professional information data.
[0075] As a preferred embodiment of the present embodiment, the writing system can provide four writing modes, namely: new document, upload document writing, quick writing, and template writing.
[0076] For the new document writing mode, users can create new documents through simple writing commands. During the creation of the document, the user can select a document template (such as a document, a table, a presentation, etc.), a style (such as a font, a font size, a paragraph format, etc.), and other document functions (such as inserting a table, a picture, a link, etc.), and customize the appearance and layout of the document according to the user's own needs.
[0077] For the upload document writing mode, the user uploads an existing document to the writing system for assisted writing. After uploading, the writing system uses the semantic understanding ability of the generative text large model to deeply analyze the content of the document, identify the keywords, themes, sentence structures, and grammatical errors in the document, and provide relevant optimization suggestions. In addition, the writing system can also automatically correct the document, pointing out potential grammatical, spelling, and punctuation errors, and providing modification suggestions, so that the user can easily improve the quality of the document.
[0078] For the quick writing mode, the writing system extracts the user's keywords or themes according to the user's input instructions, generates relevant text outlines and paragraphs, and through the analysis of the user-provided information, generates creative ideas, viewpoints, and key information related to the theme based on the semantic and contextual understanding of the information and relevant data in the corresponding industry field. The user can further modify and edit the text outline and paragraphs generated by the writing system. Based on the semantic understanding of the text context, the writing system can also continue writing and rewriting the text according to the user's needs, thereby assisting the user in quickly completing the text writing task.
[0079] For the template writing mode, the user inputs relevant background information by selecting the corresponding template, and the writing system generates text content based on the style of the original standardized data set, ensuring the accuracy of the writing framework and greatly improving the quality of the text.
[0080] Embodiment Three
[0081] The embodiment provides an electronic device, which comprises a memory, a processor, and a computer program stored in the memory and executable on the processor, and the processor implements the writing method based on the generative text large model according to any one of the embodiments of the present application when executing the computer program.
[0082] Embodiment Four
[0083] The embodiment provides a computer-readable storage medium, which stores a computer program, and the computer program is executable on a processor to implement the writing method based on the generative text large model according to any one of the embodiments of the present application.
[0084] In the embodiments of the present application, "at least one" means one or more, and "multiple" means two or more. The "and / or" describes the association relationship of the associated objects, which means that there can be three relationships, for example, A and / or B can represent the cases of A alone, A and B together, and B alone. Wherein A and B can be singular or plural. The character " / " generally represents an "or" relationship between the front and rear associated objects. "At least one of the following" and the like means any combination of these items, including any combination of single or multiple items. For example, at least one of a, b and c can represent: a, b, c, a and b, a and c, b and c, or a and b and c, where a, b, and c can be single or multiple.
[0085] Those of ordinary skill in the art can realize that the units and algorithm steps described in the embodiments disclosed herein can be realized in electronic hardware, computer software, and a combination of electronic hardware and computer software. Whether the functions are realized in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the present application.
[0086] Those skilled in the art can clearly understand that, for the convenience and brevity of the description, the specific working processes of the above-described system, device and unit can refer to the corresponding processes in the foregoing method embodiments, which will not be described here.
[0087] In several embodiments provided by the present application, any function realized in the form of a software function unit and sold or used as an independent product can be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the present application essentially or the parts that make contributions to the prior art or parts of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium, and includes a plurality of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the embodiments of the present application. The foregoing storage medium includes: a U disk, a mobile hard disk, a read-only memory (Read-Only Memory; hereinafter referred to as: ROM), a random access memory (Random Access Memory; hereinafter referred to as: RAM), a magnetic disk or an optical disk, and various media that can store program codes.
[0088] The above only describes the embodiments of the present application, and does not limit the patent scope of the present application. Any equivalent structure or equivalent process transformation based on the content of the specification and drawings of the present application, or direct or indirect application in other related technical fields, are also included in the patent protection scope of the present application.
Claims
1. A writing method based on a generative text large model, characterized by, The method comprises the following steps: S1: collecting field-related data for a specific industry, including text data, label data and related metadata, and preprocessing the collected data; S2: selecting a generative text large model, using a general corpus of industry-specific text corpus, using a text large model fine-tuning tool for model fine-tuning training according to the data volume and computing resource condition, using DeepSpeed training tool to accelerate the model convergence speed in the fine-tuning training process, and performing multiple rounds of fine-tuning iteration to generate an industry-specific generative text large model; S3: evaluating the trained generative text large model using perplexity and similarity indicators and evaluation methods, and adjusting and optimizing parameters according to the evaluation results; S4: determining the content and structure of the user template according to the specific industry scenario file style, including the title of the document, the paragraph structure, the insertion position of the specific information, and the syntax constraint, and generating the user template prompt using the corresponding Prompt instruction; S5: obtaining the corresponding compiled text content through the inference of the generative text large model based on the existing data input by the user and the user template prompt. The calculation formula of the perplexity indicator used in step S3 is specifically: In the formula, For a given text content, For The confusion index of, For The sequence length of, The joint probability obtained by the generative text large model according to the training data; The calculation formula of the similarity indicator used in step S3 is specifically: In the formula, is a similarity index, is the number of identical character sequences in the total text content that overlaps between the generated text content and the reference text content, is the number of identical character sequences in the total text content in the reference text.
2. The generative text-based model-based writing method of claim 1, wherein, The writing method further comprises providing professional information data retrieval of a specific industry, specifically: retrieving and analyzing the existing specific industry field-related data, and giving corresponding reference professional information data through the trained generative text large model when the user needs to introduce private, historical professional data according to the user template prompt.
3. A writing system based on a generative text large model, characterized by, It comprises a preprocessing module, a training module and a writing module; The preprocessing module is used to collect field-related data for a specific industry, including text data, label data and other related metadata, and to preprocess the collected data; The training module is used to select a generative text large model, use a general corpus of industry-specific text corpus, use a text large model fine-tuning tool for model fine-tuning training according to the data volume and computing resource condition, use DeepSpeed training tool to accelerate the model convergence speed in the fine-tuning training process, and perform multiple rounds of fine-tuning iteration to generate an industry-specific generative text large model; The trained generative text large model is evaluated using perplexity and similarity indicators and evaluation methods, and parameters are adjusted and optimized according to the evaluation results; The writing module is used to determine the content and structure of the user template according to the specific industry scenario file style, including the title of the document, the paragraph structure, the insertion position of the specific information, and the syntax constraint, and to generate the user template prompt using the corresponding Prompt instruction; Based on the existing data input by the user and the user template prompt, the corresponding compiled text content is obtained through the inference of the generative text large model; The calculation formula of the perplexity indicator used in the training module is specifically: In the formula, For a given text content, For The confusion index of, For The sequence length of, The joint probability obtained by the generative text large model according to the training data; The calculation formula of the similarity indicator used in the training module is specifically: In the formula, is a similarity index, is the number of identical character sequences in the total text content of the overlapping part between the generated text content and the reference text content, is the number of identical character sequences in the total text content of the reference text.
4. The generative text-based model-based writing system of claim 3, wherein, The writing module of the writing system further comprises providing retrieval of professional information data of a specific industry, specifically: retrieving and analyzing existing data related to a specific industry field, and when the user needs to introduce private, historical professional data, the trained generative text large model is used to provide corresponding reference professional information data according to the user template prompt.
5. An electronic device, comprising: The memory, the processor and the computer program stored on the memory and executable on the processor, wherein the processor executes the computer program to implement the writing method based on the generative text large model according to any one of claims 1-2.
6. A computer-readable storage medium having stored thereon a computer program, characterized in that, The computer program is executed by the processor to implement the writing method based on the generative text large model according to any one of claims 1-2.
Citation Information
Patent Citations
Intelligent document writing method
CN114492327A
A smart writing method, device, equipment, and medium
CN115630640B
Data retrieval and intelligent auxiliary writing system and method based on power grid information
CN116775811A
Intelligent writing method, device, equipment and medium
CN115630640A
Templated text generation method and system based on large language model
CN116796717A