Large language model writing method and device, electronic equipment and storage medium

By determining the target text attribute information, retrieving and extracting format elements in the writing system of large language model, and generating writing texts that meet the format requirements in combination with the format knowledge base, the problems of high usage threshold and low efficiency in the existing technology are solved, and efficient and standardized writing texts are achieved automatically.

CN120387429APending Publication Date: 2025-07-29SHANDONG INSPUR SCI RES INST CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510218279.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-26
Publication Date
2025-07-29

AI Technical Summary

Technical Problem

The existing large language model writing system has a high threshold and low efficiency in professional writing scenarios that follow strict format specifications, and requires manual writing of detailed format tips, which leads to inconvenience in use.

Method used

By determining the target text attribute information based on writing requirements description information, retrieving and extracting the format elements and features of the target sample document, using a large language model to generate writing text that meets the format requirements, and optimizing the format elements and features in combination with the format knowledge base to achieve automated generation.

Benefits of technology

It lowers the threshold for using large model writing, improves writing efficiency and standardization of generated text, reduces manual intervention, and improves the usability of generated text.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120387429A_ABST
    Figure CN120387429A_ABST
Patent Text Reader

Abstract

The invention provides a large language model writing method and device, electronic equipment, a non-transient computer readable storage medium and a computer program product, and belongs to the technical field of artificial intelligence. The method comprises the following steps: determining target text attribute information according to writing demand description information; retrieving a target sample document conforming to the target text attribute information; performing format extraction on the target sample document to obtain a plurality of target format elements and target format features respectively corresponding to the target format elements; generating a target writing text according to the writing demand description information, the target format elements and the corresponding target format features through a large language model; the target writing text comprises the text content under each target format element, and the format of the text content under each target format element accords with the corresponding target format feature. By adopting the method, the use threshold of large-model writing can be reduced, and the efficiency of large-model writing can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of artificial intelligence technology, and in particular, to a large language model writing method, device, electronic device, non-transitory computer-readable storage medium, and computer program product. Background Art

[0002] With the rapid development of artificial intelligence technology, large language models have made remarkable progress in the field of natural language generation and can already generate fluent text content. However, in practical applications, especially in professional writing scenarios that require strict format specifications, there are still many limitations. Traditional large model writing systems usually require manual writing of detailed format prompts (prompts), and for different types of documents, different format prompts (prompts) need to be written and maintained separately, which greatly increases the usage threshold of the system and results in relatively low writing efficiency using large language models. Summary of the Invention

[0003] The present invention provides a large language model writing method, device, electronic device, non-transitory computer-readable storage medium, and computer program product to solve the defects of high usage threshold and low efficiency in large model writing in the prior art, and to achieve the effect of reducing the usage threshold of large model writing and improving the writing efficiency of large models.

[0004] In a first aspect, the present invention provides a large language model writing method, including the following steps.

[0005] Determine target text attribute information according to the writing requirement description information; Retrieve target sample documents that meet the target text attribute information; Extract the format of the target sample documents to obtain a plurality of target format elements and target format features respectively corresponding to each of the target format elements; Generate a target written text through a large language model according to the writing requirement description information, as well as each of the target format elements and the corresponding target format features; the target written text contains the text content under each of the target format elements, and the format of the text content under each of the target format elements conforms to the corresponding target format feature.

[0006] According to the large language model writing method provided by the present invention, the number of the target sample documents is multiple; the extracting the format of the target sample documents to obtain a plurality of target format elements and target format features respectively corresponding to each of the target format elements includes: Extract the format of each of the target sample documents to respectively obtain a plurality of format elements and corresponding format features in each of the target sample documents; Select a target sample document from each of the target sample documents as a reference sample document according to the similarity of multiple format elements and corresponding format features in each of the target sample documents; Use the multiple format elements and corresponding format features in the reference sample document as target format elements and target format features.

[0007] According to a large language model writing method provided by the present invention, the method for generating a target written text through the large language model according to the writing requirement description information and each of the target format elements and the corresponding target format features includes: Input the writing requirement description information and each of the target format elements and the corresponding target format features into the large language model to obtain a text structure tree output by the large language model; wherein, the large language model is specifically configured to: generate outline text content under the outline elements in each of the target format elements according to the writing requirement description information, and generate the text structure tree based on the outline text content and the target format features of each of the target format elements; the text structure tree includes the outline text content under the outline elements in each of the target format elements and the target format features of each of the target format elements; Input the writing requirement description information and the text structure tree into the large language model to obtain a target written text output by the large language model; wherein, the large language model is specifically configured to: generate detailed text content under the outline text content according to the writing requirement description information and the outline text content in the text structure tree, and adjust the format according to the target format features of each of the target format elements in the text structure tree to obtain the target written text.

[0008] According to a large language model writing method provided by the present invention, after determining the target text attribute information according to the writing requirement description information, the method further includes: Query a target node in the format knowledge base whose label contains the target text attribute information; If found, determine multiple target format elements and the target format features corresponding to each of the target format elements according to the target node, and perform the step of generating a target written text through the large language model according to the writing requirement description information and each of the target format elements and the corresponding target format features; If not found, perform the step of retrieving a target sample document that meets the target text attribute information and subsequent steps.

[0009] A large language model writing method provided by the present invention, each node in the format knowledge base represents a different sample document; a plurality of format elements and corresponding format features in the corresponding sample document are recorded in each node; Determining a plurality of target format elements and target format features respectively corresponding to each of the target format elements according to the target node includes: Taking the plurality of format elements and corresponding format features recorded in the target node as the target format elements and target format features; Alternatively, selecting a child node from each child node in the classification tree to which the target node belongs, and taking the plurality of format elements and corresponding format features recorded in the selected child node as the target format elements and target format features.

[0010] A large language model writing method provided by the present invention, each node in the format knowledge base represents a different format element; format features of the corresponding format element are recorded in each node; the edges connected between the nodes represent the hierarchical relationship between the format elements; Determining a plurality of target format elements and target format features respectively corresponding to each of the target format elements according to the target node includes: Taking the format elements and corresponding format features respectively recorded in each target node as the target format elements and target format features, and determining the hierarchical relationship between the target format elements according to the edges connected between the target nodes; The large language model is specifically used for: Generating the target written text according to the writing requirement description information, each of the target format elements and the corresponding target format features, and the hierarchical relationship.

[0011] A large language model writing method provided by the present invention, after extracting the format of the target sample document to obtain a plurality of target format elements and target format features respectively corresponding to each of the target format elements, the method further includes: Recording the plurality of target format elements and target format features respectively corresponding to each of the target format elements into the format knowledge base.

[0012] A large language model writing method provided by the present invention, recording the plurality of target format elements and target format features respectively corresponding to each of the target format elements into the format knowledge base includes: When each node in the format knowledge base represents a different sample document, a new node is added to the format knowledge base, the multiple target format elements and the target format features respectively corresponding to the target format elements are recorded in the newly added node, and the target text attribute information is used as the label of the newly added node; When each node in the format knowledge base represents a different format element, multiple new nodes are added to the format knowledge base, each of the target format elements and the corresponding format features are respectively recorded in different newly added nodes, and the target text attribute information is used as the label of each newly added node.

[0013] In a second aspect, the present invention also provides a large language model writing device, including the following modules: A semantic understanding module, configured to determine target text attribute information according to the writing requirement description information; A document retrieval module, configured to retrieve target sample documents that meet the target text attribute information; A format extraction module, configured to perform format extraction on the target sample documents to obtain multiple target format elements and the target format features respectively corresponding to the target format elements; A content generation module, configured to generate a target written text through a large language model according to the writing requirement description information, and each of the target format elements and the corresponding target format features; the target written text includes the text content under each of the target format elements, and the format of the text content under each of the target format elements conforms to the corresponding target format feature.

[0014] In a third aspect, the present invention also provides an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor, where when the processor executes the computer program, it implements the large language model writing method as described in any one of the above.

[0015] In a fourth aspect, the present invention also provides a non-transitory computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, it implements the large language model writing method as described in any one of the above.

[0016] In a fifth aspect, the present invention also provides a computer program product, including a computer program, and when the computer program is executed by a processor, it implements the large language model writing method as described in any one of the above.

[0017] The large language model writing method, device, electronic device, non-transitory computer-readable storage medium, and computer program product provided by the present invention determine target text attribute information according to the writing requirement description information, then retrieve target sample documents that meet the target text attribute information, extract the formats of the target sample documents, and finally, through the large language model, generate a target written text according to the writing requirement description information, as well as the extracted target format elements and corresponding target format features. This realizes automatically determining the target format elements and target format features according to the writing requirement description information without manually writing detailed format prompt words, and then generating a target written text that conforms to the target format elements and target format features through the large language model, thereby reducing the usage threshold of large model writing and improving the efficiency of large model writing. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the description of the embodiments or the prior art. Obviously, the drawings in the following description are some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.

[0019] Figure 1 is one of the flow diagrams of the large language model writing method provided by the present invention.

[0020] Figure 2 is another flow diagram of the large language model writing method provided by the present invention.

[0021] Figure 3 is one of the structural diagrams of the large language model writing device provided by the present invention.

[0022] Figure 4 is another structural diagram of the large language model writing device provided by the present invention.

[0023] Figure 5 is the structural diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0024] To make the objectives, technical solutions, and advantages of the present invention clearer, the following clearly and completely describes the technical solutions in the present invention with reference to the drawings in the present invention. Obviously, the described embodiments are some, but not all, of the embodiments of the present invention. All other embodiments obtained by those of ordinary skill in the art without creative efforts based on the embodiments in the present invention belong to the scope of protection of the present invention.

[0025] The following combines Figures 1 - 5Describe the large language model writing method, device, electronic device, non-transitory computer-readable storage medium, and computer program product provided by the present invention.

[0026] Figure 1 It is one of the schematic flowcharts of the large language model writing method provided by the present invention. As Figure 1 shown, the method includes the following: Step 102, determine the target text attribute information according to the writing requirement description information.

[0027] Among them, the writing requirement description information is the prompt information (prompt) input by the user to describe the writing requirement. The target text attribute information is the text attribute information of the target writing text to be generated determined according to the writing requirement description information. The text attribute information is used to characterize the attributes of the writing text.

[0028] In one embodiment, the text attribute information may include at least one of the type and the field of the writing text, etc.

[0029] In one embodiment, the large language model may be used to determine the target text attribute information according to the writing requirement description information.

[0030] In one embodiment, the large language model may be a model based on the Transformer architecture. For example: high-performance models such as ChatGLM or Qwen.

[0031] In one embodiment, the semantic understanding module may receive the writing requirement description information input by the user and input the writing requirement description information into the large language model to obtain the target text attribute information output by the large language model. The target text attribute information may be structured data including the type and the field of the writing text.

[0032] For example, when the user inputs "Write an academic paper on the technological development of new energy vehicles", the semantic understanding module can identify that the type of the writing text is "academic paper", and the fields are "new energy vehicles" and "technological development".

[0033] In one embodiment, the semantic understanding module adopts a context-based semantic representation method, captures the key information in the writing requirement description information through a multi-layer attention mechanism, and uses the domain knowledge of the pre-trained model for accurate classification.

[0034] Step 104, retrieve the target example documents that meet the target text attribute information.

[0035] In one embodiment, the step of retrieving the target example documents that meet the target text attribute information is executed by the document retrieval module.

[0036] In one embodiment, the target sample document that meets the target text attribute information can be retrieved by calling the API (Application Programming Interface) of the document search engine.

[0037] In one embodiment, first, the candidate sample texts that meet the target text attribute information can be retrieved, and then, according to the multi-dimensional information of each candidate sample text, the weights of each candidate sample text can be calculated, and a preset number of candidate sample texts can be selected as the target sample document in the order from high to low of the weights.

[0038] In one embodiment, the multi-dimensional information may include at least one of the release time, the authority of the source institution, the citation times, etc.

[0039] In one embodiment, the preset number can be set according to the actual situation. For example, the preset number can be selected from the range of 3 to 5 to balance the calculation overhead and the format coverage.

[0040] Step 106: Extract the format of the target sample document to obtain a plurality of target format elements and the target format features respectively corresponding to each target format element.

[0041] Among them, the target format element is the format element that needs to be included in the target composition text to be generated. The format element is the compositional element at different levels in the composition text. Each format element in the composition text has its corresponding format feature. The target format feature is the format feature corresponding to the target format element in the target composition text to be generated.

[0042] In one embodiment, the format elements may include titles, chapters, paragraphs, etc.

[0043] In one embodiment, the format features may include fonts, indents, spacings, etc.

[0044] In one embodiment, the step of extracting the format of the target sample document to obtain a plurality of target format elements and the target format features respectively corresponding to each target format element is performed by the format extraction module.

[0045] In one embodiment, the structure of each target sample document can be parsed separately to determine the multiple format elements in the target sample document, and then the format features of each format element can be extracted.

[0046] In one embodiment, the format element to which each compositional element belongs can be determined by identifying the title font size of the multiple compositional elements obtained by the structure parsing.

[0047] Step 108, using a large language model, generate a target written text based on the writing requirement description information, as well as each target format element and its corresponding target format feature; the target written text contains the text content under each target format element, and the format of the text content under each target format element conforms to the corresponding target format feature.

[0048] Among them, the target written text is a written text generated by the large language model that conforms to the writing requirement description information.

[0049] In one embodiment, the target written text can be output to a front-end device for display.

[0050] The above large language model writing method determines the target text attribute information according to the writing requirement description information, then retrieves the target sample documents that conform to the target text attribute information, extracts the formats of the target sample documents, and finally uses the large language model to generate the target written text based on the writing requirement description information, as well as the extracted target format elements and their corresponding target format features. It realizes that without manually writing detailed format prompt words, it can automatically determine the target format elements and target format features according to the writing requirement description information, and then generate the target written text that conforms to the target format elements and target format features through the large language model, thereby reducing the usage threshold of large model writing and improving the efficiency of large model writing. In addition, through the automatic learning of text formats, it can also improve the standardization and usability of the generated written text.

[0051] In one embodiment, the number of target sample documents is multiple. Extracting the formats of the target sample documents to obtain multiple target format elements and the target format features corresponding to each target format element includes: extracting the formats of each target sample document to respectively obtain multiple format elements and their corresponding format features in each target sample document; selecting a target sample document as a reference sample document from each target sample document according to the similarity of the multiple format elements and their corresponding format features in each target sample document; using the multiple format elements and their corresponding format features in the reference sample document as the target format elements and target format features.

[0052] In one embodiment, selecting a target sample document as a reference sample document from each target sample document according to the similarity between multiple format elements and corresponding format features in each target sample document includes: respectively calculating, for each target sample document, a first similarity between the multiple format elements and corresponding format features in the target sample document and the multiple format elements and corresponding format features in each of the remaining target sample documents other than the target sample document, determining a first target similarity of the target sample document according to the mean value of each first similarity, and then selecting, from each target sample document, the target sample document with the highest first target similarity as the reference sample document.

[0053] In another embodiment, selecting a target sample document as a reference sample document from each target sample document according to the similarity between multiple format elements and corresponding format features in each target sample document includes: respectively calculating, for each target sample document, a second similarity between the format feature of each format element in the target sample document and the format features of the corresponding format elements in each of the remaining target sample documents, determining a second target similarity of the format elements in the target sample document according to the mean value of each second similarity, then determining a third target similarity of the target sample document according to the second target similarities respectively corresponding to each format element in the target sample document, and then selecting, from each target sample document, the target sample document with the highest third target similarity as the reference sample document.

[0054] In the above embodiments, selecting a target sample document as a reference sample document from each target sample document according to the similarity between multiple format elements and corresponding format features in each target sample document improves the robustness through soft matching of the similarity and allows for certain variations in the format. For example, for the numbering format of chapter titles, multiple presentation forms such as "1." and "I." can be supported simultaneously.

[0055] In one embodiment, through a large language model, according to the writing requirement description information, as well as each target format element and its corresponding target format feature, a target written text is generated, including: inputting the writing requirement description information, as well as each target format element and its corresponding target format feature into the large language model to obtain a text structure tree output by the large language model; wherein, the large language model is specifically used for: generating the outline text content under the outline element in each target format element according to the writing requirement description information, and generating a text structure tree based on the outline text content and the target format features of each target format element; the text structure tree contains the outline text content under the outline element in each target format element and the target format features of each target format element; inputting the writing requirement description information and the text structure tree into the large language model to obtain the target written text output by the large language model; wherein, the large language model is specifically used for: generating the detailed text content under the outline text content according to the writing requirement description information and the outline text content in the text structure tree, and adjusting the format according to the target format features of each target format element in the text structure tree to obtain the target written text.

[0056] Among them, the outline element refers to a format element related to the outline, such as: chapter title, etc.

[0057] It can be understood that the text structure tree contains the outline text content under the outline element in each target format element and the target format features of each target format element, which is equivalent to obtaining the outline of the target written text and the format requirements for each part.

[0058] In one embodiment, the writing requirement description information and the text structure tree are input into the large language model. The large language model generates the detailed text content under the outline text content in a top-down recursive generation manner according to the writing requirement description information and the outline text content in the text structure tree. During the generation process, the attention mechanism is used to ensure the coherence of the context, and at the same time, it is checked in real time whether the target format features of each target format element in the text structure tree are satisfied to obtain the target written text.

[0059] In the above embodiment, a two-stage generation strategy is adopted. In the framework generation stage, the large language model generates a text structure tree to specify the outline and format. Then, in the content filling stage, the generation of the main text content is completed from top to bottom, ensuring the coherence of the context and constraining the format of each part of the content.

[0060] In one embodiment, after describing information according to writing requirements and determining the target text attribute information, the method further includes: querying a target node in the format knowledge base whose label contains the target text attribute information; if found, determining multiple target format elements and the target format features corresponding to each target format element according to the target node, and performing the step of generating a target composition text by a large language model according to the writing requirement description information, as well as each target format element and the corresponding target format feature; if not found, performing the step of retrieving a target sample document that conforms to the target text attribute information and subsequent steps.

[0061] Among them, the format knowledge base is used to store and manage format knowledge. The format knowledge base can adopt a graph database structure.

[0062] In one embodiment, the format knowledge base contains nodes and edges. Each node has a corresponding label.

[0063] In one embodiment, the label of the node contains text attribute information.

[0064] In one embodiment, in addition to containing text attribute information, the label of the node may further contain at least one of information such as usage frequency and user rating.

[0065] In one embodiment, each node may respectively represent different sample documents or different format elements.

[0066] In one embodiment, the update method of the format knowledge base may include: recording the target format elements and the corresponding target format features determined from the newly analyzed target sample document into the format knowledge base, and correcting and optimizing the existing format knowledge in the format knowledge base according to the feedback information of the user.

[0067] In the above embodiment, querying a target node in the format knowledge base whose label contains the target text attribute information, if found, directly determining multiple target format elements and the target format features corresponding to each target format element according to the target node, if not found, determining the target format elements and target format features through the retrieval of sample documents, can save the previously determined format elements and format features through the format knowledge base, quickly determine the target format elements and target format features, effectively utilize historical experience to solve format problems, improve the efficiency of determining the format, and thus improve the writing efficiency of the large language model.

[0068] In one embodiment, each node in the format knowledge base represents a different sample document; multiple format elements and corresponding format features in the corresponding sample document are recorded in each node; determining multiple target format elements and the target format features respectively corresponding to each target format element according to the target node includes: using the multiple format elements and corresponding format features recorded in the target node as the target format elements and target format features; or selecting a child node from each child node in the classification tree to which the target node belongs, and using the multiple format elements and corresponding format features recorded in the selected child node as the target format elements and target format features.

[0069] In one embodiment, nodes corresponding to sample documents under the same classification tree in the format knowledge base can be connected into a tree structure through edges. The nodes in the classification tree are arranged according to the classification levels to which the text attribute information in the corresponding labels belongs. For example: the first level is a thesis, and the second level below the thesis includes conference papers and journal papers. The third level below the conference papers includes IEEE conference papers and EI conference papers, etc.

[0070] In one embodiment, each node may have a corresponding sample document. The target node with the target text attribute information in the label can be queried, and the multiple format elements and corresponding format features recorded in the target node are directly used as the target format elements and target format features. For example: the node with the label containing "thesis" has a general template for the corresponding thesis (i.e., multiple target format elements and target features of the thesis), the node with the label containing "journal paper" has a general template for the corresponding journal paper (i.e., multiple target format elements and target features of the journal paper), the node with the label containing "conference paper" has a general template for the corresponding conference paper (i.e., multiple target format elements and target features of the conference paper), and the node with the label containing "IEEE conference paper" has a template for the corresponding IEEE conference paper (i.e., multiple target format elements and target features of the IEEE conference paper).

[0071] In another embodiment, the leaf nodes at the bottom layer of the classification tree have corresponding sample documents. The target nodes with tags containing the target text attribute information can be queried, and then multiple target leaf nodes below the target nodes can be determined according to the classification tree to which the target nodes belong. One target leaf node is selected from the multiple target leaf nodes, and the multiple format elements and the corresponding format features recorded in the selected target leaf node are used as the target format elements and the target format features. For example: According to the writing requirement description information, the target text attribute information desired by the user is determined to be conference papers. The target nodes corresponding to conference papers are queried, and then multiple target leaf nodes below the conference papers are determined according to the classification tree to which the target nodes corresponding to conference papers belong, including the leaf nodes corresponding to IEEE conference papers and EI conference papers respectively. The multiple format elements and the corresponding format features recorded in one target leaf node selected from the leaf nodes corresponding to IEEE conference papers and EI conference papers respectively are used as the target format elements and the target format features.

[0072] In one embodiment, the method for selecting the target leaf node may be to select according to at least one of the usage frequency and user scores in the tags of each target leaf node. Alternatively, inquiry information may be output to ask the user which specific subcategory is needed, and the target leaf node is selected according to the feedback information of the user.

[0073] In the above embodiment, each node in the format knowledge base represents a different sample document, and multiple format elements and the corresponding format features in the corresponding sample document are recorded in each node. By determining multiple format elements and the corresponding format features as the target format elements and the target format features according to the target node, the target format elements and the target format features can be efficiently queried through the format knowledge base, thereby improving the writing efficiency of the large language model.

[0074] In one embodiment, each node in the format knowledge base represents a different format element; the format features of the corresponding format element are recorded in each node; the edges connecting the nodes represent the hierarchical relationship between the format elements; determining multiple target format elements and the target format features corresponding to each target format element according to the target node includes: using the format elements and the corresponding format features recorded in each target node as the target format elements and the target format features, and determining the hierarchical relationship between the target format elements according to the edges connected between the target nodes; the large language model is specifically used for: generating the target writing text according to the writing requirement description information, each target format element and the corresponding target format feature, and the hierarchical relationship.

[0075] For example, according to the information description of the writing requirements, the target text attribute information required by the user is "IEEE conference paper". The target nodes with the target text attribute information "IEEE conference paper" retrieved include target node A (the represented format element is the title), target node B (the represented format element is the chapter), and target node C (the represented format element is the paragraph). The edge connecting target node A and target node B is used to represent that the chapter is at the next level below the title, and the edge connecting target node B and target node C is used to represent that the paragraph is at the next level below the chapter.

[0076] In one embodiment, after determining the hierarchical relationship of each target format element, during the process of generating the target writing text, a text structure tree can be generated according to the hierarchical relationship of each target format element, and then through the large language model, according to the writing requirement description information and the outline text content in the text structure tree, the detailed text content below the outline text content can be generated, and the target writing text can be obtained by adjusting the format according to the target format features of each target format element.

[0077] In the above embodiment, each node in the format knowledge base represents a different format element, and the format features of the corresponding format element are recorded in each node. The edges connecting the nodes represent the hierarchical relationship between the format elements. Taking the format elements and the corresponding format features respectively recorded in each target node as the target format elements and the target format features, and determining the hierarchical relationship between each target format element according to the edges connected between each target node, the target format elements and the target format features can be efficiently retrieved through the format knowledge base, thereby improving the writing efficiency of the large language model.

[0078] In one embodiment, after extracting the format of the target sample document to obtain multiple target format elements and the target format features respectively corresponding to each target format element, the method further includes: recording the multiple target format elements and the target format features respectively corresponding to each target format element into the format knowledge base.

[0079] In the above embodiment, recording the multiple target format elements and the target format features respectively corresponding to each target format element into the format knowledge base, thereby realizing the update of the format knowledge base, making the format knowledge in the format knowledge base more and more rich and comprehensive, so that the target format elements and the target format features can be efficiently retrieved through the format knowledge base, and further improving the writing efficiency of the large language model.

[0080] In one embodiment, recording multiple target format elements and the target format features respectively corresponding to each target format element into a format knowledge base includes: when each node in the format knowledge base represents a different sample document, adding a new node in the format knowledge base, recording the multiple target format elements and the target format features respectively corresponding to each target format element into the added node, and using the target text attribute information as the label of the added node; when each node in the format knowledge base represents a different format element, adding multiple new nodes in the format knowledge base, recording each target format element and the corresponding format feature into different added nodes respectively, and using the target text attribute information as the label of each added node.

[0081] In one embodiment, when each node in the format knowledge base represents a different sample document, adding a new node in the format knowledge base, recording the multiple target format elements and the target format features respectively corresponding to each target format element into the added node, and using the target text attribute information as the label of the added node.

[0082] In one embodiment, when each node in the format knowledge base represents a different format element, adding multiple new nodes in the format knowledge base, recording each target format element and the corresponding format feature into different added nodes respectively, and using the target text attribute information as the label of each added node.

[0083] In the above embodiments, for the two cases where each node in the format knowledge base represents a different sample document and each node in the format knowledge base represents a different format element respectively, the target format elements and target format features obtained from the newly analyzed target sample document can be recorded respectively, improving the flexibility and applicability of the method.

[0084] In one embodiment, at the system implementation level, the present invention adopts a microservices architecture design, including a semantic understanding module, a document retrieval module, a format extraction module, a content generation module, and a format knowledge base module. Each functional module is encapsulated as an independent service unit, and asynchronous communication is achieved through a message queue. The system adopts a distributed deployment method, and the core computing tasks are processed by a GPU (Graphics Processing Unit) cluster, and the storage and retrieval services are supported by a distributed database cluster.

[0085] In one embodiment, the system also provides a flexible configuration management interface, supporting dynamic adjustment of the parameters of each module. For example: the adjustable parameters may include whether the format knowledge base supports adding new format knowledge, the temperature and style of the generated text content, and the scope of document retrieval, etc.

[0086] Such asFigure 2 As shown, it is a schematic diagram of the overall process of the large language model writing method in various embodiments of the present invention. The user sends writing requirement description information to the semantic understanding module through the client. The semantic understanding model determines the target text attribute information according to the writing requirement description information, and then queries the node corresponding to the target text attribute information from the format knowledge base module. If found, directly determine the target format specification (i.e., target format elements and corresponding format features) according to the queried target node. The content generation module generates the target writing text based on the target format specification and sends it to the user's client. If not found, the document retrieval module retrieves the target sample document according to the target text attribute information, and the format extraction module extracts the format of the target sample document to obtain the target format specification (i.e., target format elements and corresponding format features). The content generation module generates the target writing text based on the target format specification and sends it to the user's client. The format extraction module can also add the extracted target format specification (i.e., target format elements and corresponding format features) to the format knowledge base module. The format knowledge base module can also correct and optimize the format knowledge in the format knowledge base according to the user's feedback information.

[0087] The large language model writing device provided by the present invention will be described below. The large language model writing device described below can be correspondingly referred to the large language model writing method described above. As Figure 3 shown, the large language model writing device 300 includes the following modules: The semantic understanding module 302 is used to determine the target text attribute information according to the writing requirement description information.

[0088] The document retrieval module 304 is used to retrieve the target sample document that meets the target text attribute information.

[0089] The format extraction module 306 is used to extract the format of the target sample document to obtain a plurality of target format elements and the target format features respectively corresponding to each target format element.

[0090] The content generation module 308 is used to generate the target writing text through the large language model according to the writing requirement description information, as well as each target format element and the corresponding target format feature. The target writing text contains the text content under each target format element, and the format of the text content under each target format element conforms to the corresponding target format feature.

[0091] In one embodiment, the number of target sample documents is multiple. The format extraction module 306 is further configured to extract the formats of each target sample document, respectively obtaining multiple format elements and corresponding format features in each target sample document; select a target sample document from each target sample document as a reference sample document according to the similarity of the multiple format elements and corresponding format features in each target sample document; and use the multiple format elements and corresponding format features in the reference sample document as target format elements and target format features.

[0092] In one embodiment, the content generation module 308 is further configured to input the writing requirement description information, as well as each target format element and corresponding target format feature, into a large language model to obtain a text structure tree output by the large language model; wherein, the large language model is specifically configured to: generate outline text content under the outline elements in each target format element according to the writing requirement description information, and generate a text structure tree based on the outline text content and the target format features of each target format element; the text structure tree includes the outline text content under the outline elements in each target format element and the target format features of each target format element; input the writing requirement description information and the text structure tree into the large language model to obtain a target written text output by the large language model; wherein, the large language model is specifically configured to: generate detailed text content under the outline text content according to the writing requirement description information and the outline text content in the text structure tree, and adjust the format according to the target format features of each target format element in the text structure tree to obtain the target written text.

[0093] In one embodiment, as Figure 4 shown, the large language model writing device 300 further includes: A format knowledge base module 310, configured to query a target node in the format knowledge base whose label contains target text attribute information; if found, determine multiple target format elements and target format features respectively corresponding to each target format element according to the target node, and perform the step of generating a target written text through the large language model according to the writing requirement description information, as well as each target format element and corresponding target format feature; if not found, perform the step of retrieving target sample documents that meet the target text attribute information and subsequent steps.

[0094] In one embodiment, each node in the format knowledge base represents a different sample document; multiple format elements and corresponding format features in the corresponding sample document are recorded in each node; the format knowledge base module 310 is further configured to use the multiple format elements and corresponding format features recorded in the target node as target format elements and target format features; or select a child node from each child node in the classification tree to which the target node belongs, and use the multiple format elements and corresponding format features recorded in the selected child node as target format elements and target format features.

[0095] In one embodiment, each node in the format knowledge base represents different format elements; the format features of the corresponding format elements are recorded in each node; the edges connecting the nodes represent the hierarchical relationships between the format elements; the format knowledge base module 310 is further configured to use the format elements and the corresponding format features respectively recorded in each target node as target format elements and target format features, and determine the hierarchical relationships between the target format elements according to the edges connected between the target nodes; the large language model is specifically configured to: generate a target composition text according to the writing requirement description information, each target format element and the corresponding target format feature, and the hierarchical relationship.

[0096] In one embodiment, the format knowledge base module 310 is further configured to record multiple target format elements and the target format features respectively corresponding to each target format element into the format knowledge base.

[0097] In one embodiment, when each node in the format knowledge base represents different sample documents, the format knowledge base module 310 is further configured to add a new node to the format knowledge base, record multiple target format elements and the target format features respectively corresponding to each target format element into the new node, and use the target text attribute information as the label of the new node; when each node in the format knowledge base represents different format elements, the format knowledge base module 310 is further configured to add multiple new nodes to the format knowledge base, record each target format element and the corresponding format feature into different new nodes respectively, and use the target text attribute information as the label of each new node.

[0098] Figure 5 An example of the physical structure diagram of an electronic device is shown as Figure 5 shown. The electronic device may include: a processor 510, a communication interface 520, a memory 530, and a communication bus 540. Among them, the processor 510, the communication interface 520, and the memory 530 complete communication with each other through the communication bus 540. The processor 510 may call the logical instructions in the memory 530 to execute the large language model writing method, and the method includes: determining target text attribute information according to the writing requirement description information; retrieving a target sample document that meets the target text attribute information; performing format extraction on the target sample document to obtain multiple target format elements and the target format features respectively corresponding to each target format element; generating a target composition text through the large language model according to the writing requirement description information and each target format element and the corresponding target format feature; the target composition text includes the text content under each target format element, and the format of the text content under each target format element conforms to the corresponding target format feature.

[0099] In addition, when the logical instructions in the above-mentioned memory 530 are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or a part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods according to the various embodiments of the present invention. The aforementioned storage medium includes: various media such as USB flash drives, mobile hard disks, read-only memories (ROMs), random access memories (RAMs), magnetic disks, or optical discs that can store program codes.

[0100] On the other hand, the present invention also provides a computer program product. The computer program product includes a computer program that can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the large language model writing method provided by the above-mentioned various methods. The method includes: determining target text attribute information according to writing requirement description information; retrieving a target sample document that conforms to the target text attribute information; performing format extraction on the target sample document to obtain a plurality of target format elements and target format features respectively corresponding to each target format element; generating a target written text through a large language model according to the writing requirement description information, as well as each target format element and the corresponding target format feature; the target written text contains the text content under each target format element, and the format of the text content under each target format element conforms to the corresponding target format feature.

[0101] On yet another hand, the present invention also provides a non-transitory computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, it realizes the large language model writing method provided by the above-mentioned various methods. The method includes: determining target text attribute information according to writing requirement description information; retrieving a target sample document that conforms to the target text attribute information; performing format extraction on the target sample document to obtain a plurality of target format elements and target format features respectively corresponding to each target format element; generating a target written text through a large language model according to the writing requirement description information, as well as each target format element and the corresponding target format feature; the target written text contains the text content under each target format element, and the format of the text content under each target format element conforms to the corresponding target format feature.

[0102] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed to multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment. Those of ordinary skill in the art can understand and implement it without creative efforts.

[0103] Through the description of the above embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on such an understanding, the essence of the above technical solution or the part that contributes to the prior art can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods of each embodiment or some parts of the embodiments.

[0104] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit them. Although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions recorded in the foregoing embodiments or equivalently replace some of the technical features; and these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A large language model writing method, characterized in that, Including: Describe information according to the writing requirements to determine the target text attribute information; Retrieve target sample documents that meet the described target text attribute information; Extract the format of the target sample documents to obtain multiple target format elements and the target format features corresponding to each of the target format elements; Generate a target writing text through a large language model according to the writing requirement description information, as well as each of the target format elements and the corresponding target format features; The target writing text contains the text content under each of the target format elements, and the format of the text content under each of the target format elements conforms to the corresponding target format features.

2. The large language model writing method according to claim 1, characterized in that: The number of the target sample documents is multiple; the extracting the format of the target sample documents to obtain multiple target format elements and the target format features corresponding to each of the target format elements includes: Extract the format of each of the target sample documents to respectively obtain multiple format elements and the corresponding format features in each of the target sample documents; Select a target sample document from each of the target sample documents as a reference sample document according to the similarity of the multiple format elements and the corresponding format features in each of the target sample documents; Use the multiple format elements and the corresponding format features in the reference sample document as the target format elements and the target format features.

3. The large language model writing method according to claim 1, wherein The generating a target writing text through a large language model according to the writing requirement description information, as well as each of the target format elements and the corresponding target format features includes: Input the writing requirement description information, as well as each of the target format elements and the corresponding target format features into the large language model to obtain a text structure tree output by the large language model; wherein, the large language model is specifically used for: generating the outline text content under the outline elements in each of the target format elements according to the writing requirement description information, and generating the text structure tree based on the outline text content and the target format features of each of the target format elements; the text structure tree contains the outline text content under the outline elements in each of the target format elements and the target format features of each of the target format elements; Input the writing requirement description information and the text structure tree into the large language model to obtain the target writing text output by the large language model; wherein, the large language model is specifically used for: generating the detailed text content under the outline text content according to the writing requirement description information and the outline text content in the text structure tree, and adjusting the format according to the target format features of each of the target format elements in the text structure tree to obtain the target writing text.

4. The large language model writing method according to any one of claims 1 to 3, characterized in that, After determining the target text attribute information according to the writing requirement description information, the method further includes: Query a target node in the format knowledge base whose label contains the target text attribute information; If found, determining multiple target format elements and target format features corresponding to each target format element according to the target node, and executing the step of generating a target writing text using the large language model according to the writing requirement description information, each target format element and the corresponding target format feature; If no target document is found, the step of retrieving the target sample document that meets the target text attribute information and subsequent steps are performed.

5. The large language model writing method according to claim 4, characterized in that, Each node in the format knowledge base represents a different sample document; each node records a plurality of format elements and corresponding format features in the corresponding sample document; The determining, according to the target node, a plurality of target format elements and target format features corresponding to the target format elements, respectively, includes: Using the multiple format elements and corresponding format features recorded in the target node as target format elements and target format features; Alternatively, a sub-node is selected from each sub-node in the classification tree to which the target node belongs, and the multiple format elements and corresponding format features recorded in the selected sub-node are used as the target format elements and target format features.

6. The method for writing using a large language model according to claim 4, wherein Each node in the format knowledge base represents a different format element; each node records the format features of the corresponding format element; the edges connecting the nodes represent the hierarchical relationship between the format elements; The determining, according to the target node, a plurality of target format elements and target format features corresponding to the target format elements, respectively, includes: The format elements and corresponding format features respectively recorded in the target nodes are used as target format elements and target format features, and a hierarchical relationship between the target format elements is determined based on the edges connecting the target nodes; The large language model is specifically used for: The target writing text is generated according to the writing requirement description information, each of the target format elements and the corresponding target format features, and the hierarchical relationship.

7. The large language model writing method according to any one of claims 1 to 3, characterized in that After performing format extraction on the target sample document to obtain a plurality of target format elements and target format features corresponding to each of the target format elements, the method further includes: The multiple target format elements and the target format features respectively corresponding to the target format elements are recorded in a format knowledge base.

8. The large language model writing method according to claim 7, wherein The step of recording the plurality of target format elements and the target format features corresponding to the target format elements into a format knowledge base includes: In the case where each node in the format knowledge base represents a different sample document, a new node is added to the format knowledge base, the multiple target format elements and the target format features corresponding to each target format element are recorded in the new node, and the target text attribute information is used as a label of the new node; In the case where each node in the format knowledge base represents a different format element, multiple nodes are added to the format knowledge base, each target format element and the corresponding format feature are recorded in a different newly added node, and the target text attribute information is used as a label for each newly added node.

9. A large language model writing device, characterized in that, include: Semantic understanding module, used to describe information according to writing requirements and determine the target text attribute information; A document retrieval module, used to retrieve target sample documents that meet the target text attribute information; A format extraction module is used to extract the format of the target sample document to obtain a plurality of target format elements and target format features corresponding to each of the target format elements; The content generation module is used to generate a target writing text based on the writing requirement description information, each target format element and the corresponding target format feature through a large language model; the target writing text includes the text content under each target format element, and the format of the text content under each target format element conforms to the corresponding target format feature.

10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that: When the processor executes the computer program, the large language model writing method according to any one of claims 1 to 8 is implemented.

11. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, the large language model writing method according to any one of claims 1 to 8 is implemented.

12. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, the large language model writing method according to any one of claims 1 to 8 is implemented.