Long text generation method and device, equipment, storage medium and program product
By dividing text modules and updating data for sample long text, using large models to generate long texts, the problem of low efficiency in long text generation is solved, and fast and efficient long text generation is achieved, improving generation efficiency and accuracy.
Patent Information
- Application Number
- CN202411065562.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-05
- Publication Date
- 2024-12-13
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
In the prior art, long text such as prospectus generation is inefficient, and requires multiple people to form a professional team, which takes a lot of time and relies on manual writing, making it difficult to quickly update and generate long texts with strong professionalism containing specific data.
By dividing the sample long text into text module, determine the parameters to be updated in the sample subtext, obtain and replace them with update data, and use the big model to generate the updated subtext, and then generate target long text to improve the generation efficiency.
The efficiency of generating target long text with the help of sample long text is achieved, which greatly improves the speed and accuracy of long text generation compared with manual writing, and reduces the complexity and time cost of manual operations.
Smart Images

Figure CN119129534A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of text processing technology, and in particular to a long text generation method, device, equipment, storage medium and program product. Background Art
[0002] Currently, long, highly specialized texts containing specific data are usually written manually.
[0003] For example, a prospectus usually contains hundreds of pages of detailed information. Writing a prospectus requires professional skills in legal knowledge, financial analysis, market insight, copywriting, psychological guidance, etc. Moreover, a prospectus contains a lot of specific data. It usually takes a professional team of multiple people and a lot of time to write a prospectus.
[0004] Therefore, long texts are written manually, resulting in low efficiency in long text generation. Summary of the invention
[0005] The present application provides a long text generation method, apparatus, device, storage medium and program product to solve the problem of low efficiency in long text generation.
[0006] According to a first aspect of an embodiment of the present application, a long text generation method is provided, comprising:
[0007] Determining parameters to be updated in each sample sub-text; the sample sub-text is determined by dividing the sample long text into text modules;
[0008] According to the parameters to be updated in each of the sample sub-texts, acquiring the update data corresponding to each of the sample sub-texts;
[0009] Replacing the parameters to be updated in each of the sample subtexts with the update data corresponding to each of the sample subtexts, to obtain updated subtexts corresponding to each of the sample subtexts;
[0010] A target long text is generated according to each of the updated sub-texts.
[0011] Optionally, replacing the parameters to be updated in each of the sample subtexts with the update data corresponding to each of the sample subtexts to obtain updated subtexts corresponding to each of the sample subtexts, includes:
[0012] Generate a first prompt word based on each of the sample sub-texts and the update data corresponding to each of the sample sub-texts;
[0013] The first prompt word is input into the large model to obtain updated subtexts corresponding to each of the sample subtexts output by the large model, wherein the first prompt word is used to instruct the large model to replace the parameters to be updated in the sample subtext with the updated data corresponding to the sample subtext.
[0014] Optionally, acquiring update data corresponding to each of the sample subtexts according to the parameters to be updated in each of the sample subtexts includes:
[0015] For any parameter to be updated in each of the sample sub-texts, perform the following operations:
[0016] Determine each similar draft of any one parameter to be updated from each draft;
[0017] Determine a target draft related to any one of the parameters to be updated from each of the similar drafts;
[0018] Based on the target manuscript, update data corresponding to any one of the parameters to be updated is determined.
[0019] Optionally, determining, from the various drafts, each similar draft of the arbitrary parameter to be updated includes:
[0020] Generate a first vector of any parameter to be updated and a second vector of each manuscript;
[0021] Calculating the similarity between the first vector and each of the second vectors;
[0022] Based on the similarity, each similar draft of any one parameter to be updated is determined from each draft.
[0023] Optionally, determining a target draft related to any one of the parameters to be updated from the similar drafts includes:
[0024] Splicing any of the parameters to be updated with each of the similar manuscripts to obtain each spliced text;
[0025] Generate a third vector of each of the concatenated texts;
[0026] Determine, based on each of the third vectors, the probability that any one of the parameters to be updated is associated with each of the similar manuscripts;
[0027] According to the probability, a target manuscript related to any one of the parameters to be updated is determined from each of the similar manuscripts.
[0028] Optionally, the generating the first prompt word based on each of the sample sub-texts and the update data corresponding to each of the sample sub-texts includes:
[0029] Summarizing each of the sample sub-texts to obtain a thought chain of each of the sample sub-texts;
[0030] A first prompt word is generated based on the thought chain of each of the sample sub-texts and the update data corresponding to each of the sample sub-texts.
[0031] Optionally, determining the parameters to be updated in each sample subtext includes:
[0032] Based on each sample sub-text, generate a second prompt word;
[0033] The second prompt word is input into the large model to obtain the parameters to be updated in each sample sub-text output by the large model, wherein the second prompt word is used to instruct the large model to identify the parameters to be updated in each sample sub-text.
[0034] Optionally, before determining the parameters to be updated in each sample subtext, the method further includes:
[0035] Based on the theme of the text content of the sample long text, the sample long text is divided into text modules to obtain various sub-texts;
[0036] From each of the subtexts, each sample subtext is determined.
[0037] Optionally, based on the theme of the text content of the sample long text, the sample long text is divided into text modules to obtain various sub-texts, including:
[0038] Based on the sample long text, generate a third prompt word;
[0039] The third prompt word is input into the large model to obtain each sub-text output by the large model, wherein the third prompt word is used to indicate the large model to divide the sample long text into text modules based on the theme of the text content of the sample long text to obtain each sub-text.
[0040] According to a second aspect of an embodiment of the present application, a long text generation device is provided, comprising:
[0041] A processing unit, used to determine the parameters to be updated in each sample sub-text; the sample sub-text is determined by dividing the sample long text into text modules;
[0042] An acquiring unit, configured to acquire update data corresponding to each of the sample subtexts according to the parameters to be updated in each of the sample subtexts;
[0043] A replacement unit, used for replacing the parameters to be updated in each of the sample subtexts with the update data corresponding to each of the sample subtexts, so as to obtain the updated subtext corresponding to each of the sample subtexts;
[0044] A generating unit is used to generate a target long text according to each of the updated sub-texts.
[0045] According to a third aspect of an embodiment of the present application, there is provided an electronic device, including a memory and a processor;
[0046] The memory is connected to the processor and is used to store programs;
[0047] The processor is used to implement the long text generation method described in the first aspect by running the program in the memory.
[0048] According to a fourth aspect of an embodiment of the present application, a storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the long text generation method described in the first aspect is implemented.
[0049] According to a fifth aspect of an embodiment of the present application, a computer program product is provided, comprising computer program instructions, which, when executed by a processor, enable the processor to execute the long text generation method described in the first aspect.
[0050] In the present application, the sample long text is divided into text modules to obtain various sample sub-texts, and then the update data corresponding to each sample sub-text is obtained, and the parameters to be updated in each sample sub-text are replaced with the update data corresponding to each sample sub-text. With the help of the sample long text, the parameters to be updated of each sample sub-text are updated, and the updated sub-texts corresponding to each sample sub-text are obtained, and then the target long text is generated. The target long text is generated with the help of the sample long text, which improves the efficiency of long text generation compared with long texts written entirely by humans. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.
[0052] Figure 1 A schematic diagram of a long text generation method provided in an embodiment of the present application;
[0053] Figure 2A schematic diagram of a process for determining a sample subtext provided in an embodiment of the present application;
[0054] Figure 3 A schematic diagram of a process of step 201 provided in an embodiment of the present application;
[0055] Figure 4 A schematic diagram of a process of step 101 provided in an embodiment of the present application;
[0056] Figure 5 A schematic diagram of the structure of a dual retrieval model provided in an embodiment of the present application;
[0057] Figure 6 A schematic diagram of a process of step 103 provided in an embodiment of the present application;
[0058] Figure 7 A schematic diagram of a process of step 601 provided in an embodiment of the present application;
[0059] Figure 8 A schematic diagram of the structure of a long text generation device provided in an embodiment of the present application;
[0060] Fig. 9 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0061] At present, long texts containing specific data and strong professionalism are usually written manually. The following explanation is given by taking the prospectus as an example of a long text, but it is not limited to a prospectus. The long text can also be long text in other scenarios, such as bidding documents, tender documents, project feasibility study reports, technical reports, etc.
[0062] Writing a high-quality prospectus requires a lot of time, energy and resources from many experts to present the company's value and potential in an accurate and detailed manner while attracting investors' attention. A prospectus usually contains hundreds of pages of detailed information. Writing a prospectus requires not only legal knowledge, financial analysis, market insight, copywriting, and psychological guidance, but also a comprehensive art that integrates these skills. The writer needs to find a delicate balance between rigor and attractiveness to successfully create an excellent prospectus. Moreover, the prospectus contains a lot of specific data. It usually takes a professional team of multiple people and a lot of time to write a prospectus.
[0063] Amid the rapid development of artificial intelligence technology, the field of natural language processing is particularly eye-catching. Big models have shown great application potential in generating prospectuses. However, generating long, highly professional texts still faces huge challenges. First, the specific data contained in the prospectus cannot be generated by the big model due to the lag in updating the training data of the big model, the high training cost, and the "hallucination" problem of the big model. Secondly, even the big model that processes long texts has limited output tokens and cannot generate consistent and continuous long texts. At present, there is no solution to generate long texts such as prospectuses that contain specific data and are highly professional through big models. Long texts that contain specific data and are highly professional are still written manually.
[0064] The following is a detailed list of the existing manual procedures for writing prospectuses:
[0065] (1) Project preparation and data collection.
[0066] To successfully conduct an Initial Public Offering (IPO), a company needs to assemble a team of professionals. This team is responsible for collecting key information and ensuring compliance with regulations. Investment banking advisors lead the entire process, provide market analysis and help with pricing. Legal advisors ensure that documents are legal and handle legal issues. Accountants review financial records and ensure reporting accuracy. Management provides strategic and operational information. These efforts are designed to provide investors with a clear and accurate picture of the company.
[0067] (2) Data analysis and writing.
[0068] When preparing a prospectus, the team needs to conduct an in-depth analysis of the company's history, business model, management, financial status, and market environment. Team members write different parts based on their expertise: some are responsible for company introduction, describing development, business, and culture; some conduct market analysis, assess industry status and market trends; others focus on financial data, demonstrating the company's financial health and growth potential. This collaboration ensures the efficient completion of the prospectus and lays the foundation for listing.
[0069] (3) Review and revision.
[0070] When preparing a prospectus, the review and revision process is crucial. The team conducts multiple rounds of meticulous internal reviews to ensure that every detail is accurate and in compliance with securities market systems and regulations. The document is revised multiple times to eliminate errors or omissions and enhance the professionalism and credibility of the document. External experts such as legal advisors, industry analysts or financial advisors also participate in optimizing the content to ensure that the information is the latest and most accurate and meets the expectations of investors and regulators. The strict review and revision process ensures the quality of the prospectus and provides a solid foundation for the company's successful listing and attracting investors.
[0071] (4) Release and distribution.
[0072] In the process of drafting a prospectus, submitting it to the securities regulator for review is a key step. The regulator ensures that the financial documents are legal and the information is accurate and not misleading. The issuer needs to wait for feedback and modify the draft as required, which may involve financial data, business descriptions, and risk factors. Only when the regulatory requirements are met will it be approved for publication and enter the public offering procedure. This process protects the interests of investors and maintains a fair and transparent market. Through this rigorous review, the quality and reliability of the prospectus can be ensured, providing a solid foundation for the company's successful listing and enhancing investors' confidence in the company.
[0073] Manually writing a prospectus is a very challenging task. It requires not only deep financial, legal and market knowledge, but also the ability to accurately understand and express the company's business model, risk factors and future development prospects. During the writing process, the author must strictly abide by the regulations of the securities regulatory authorities to ensure the authenticity, accuracy and completeness of the information. Manually writing a prospectus requires a lot of prior knowledge and is difficult. In addition, the prospectus contains a lot of specific data. It usually takes a professional team of multiple people and a lot of time to write a prospectus.
[0074] Therefore, long texts are written manually, resulting in low efficiency in long text generation.
[0075] In order to solve the problem of low efficiency in generating long texts, the present application provides a method, apparatus, device, storage medium and program product for generating long texts.
[0076] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0077] Exemplary Implementation Environment
[0078] The long text generation method according to the embodiment of the present disclosure can be executed by an electronic device such as a terminal device or a server. The terminal device can be a user equipment (UE), a mobile device, a user terminal, a terminal, a cellular phone, a cordless phone, a personal digital assistant (PDA), a handheld device, a computing device, a vehicle-mounted device, a wearable device, etc. The server can be an independent physical server, a server cluster composed of multiple physical servers, or a cloud server capable of cloud computing. The method can be implemented by a processor calling a computer-readable program instruction stored in a memory.
[0079] Exemplary Methods
[0080] See also Figure 1 In an exemplary embodiment, a long text generation method is provided. Figure 1 As shown, the process of the long text generation method mainly includes:
[0081] Step 101: Determine the parameters to be updated in each sample subtext.
[0082] The sample sub-text is determined by dividing the sample long text into text modules.
[0083] In the exemplary embodiment, the sample long text is a long text containing specific data. For example, the sample long text may be a prospectus, or a long text in other scenarios, such as a bidding document, a tender document, a project feasibility study report, a technical report, etc. The following explanation is given by taking the sample long text as a prospectus as an example, but the sample long text is not limited to a prospectus.
[0084] In the exemplary embodiment, the sample long text includes prospectus samples from different industries. The purpose of writing a prospectus is to ensure that the company can be successfully listed on the capital market and complete financing. Through preliminary research, it is found that the framework structure of the prospectus has a certain degree of universality, while there are slight differences in the writing style, wording and disclosure details of prospectuses in different industries. A detailed review was conducted for each major industry, and each more precise sub-industry category was further divided. For example, in the construction industry, sub-industries such as house construction and building installation are divided into; in the mining industry, sub-industries such as coal mining and washing, oil and natural gas mining, and non-metallic mineral mining are divided into; in the real estate industry, sub-industries such as real estate are divided into; in the financial industry, sub-industries such as monetary and financial services, insurance, and capital market services are divided into; in the financial industry, sub-industries such as monetary and financial services, insurance, and capital market services are divided into; in the accommodation and catering industry, sub-industries such as accommodation and catering are divided into; in the manufacturing industry, sub-industries such as tobacco products, food manufacturing, and textiles are divided into.
[0085] For each sub-industry, select n (for example, 3 to 5) typical and representative prospectuses as analysis samples. In the process of selecting prospectus samples, special attention is paid to well-known companies listed on the main board, the Science and Technology Innovation Board, and the Growth Enterprise Market, and the prospectuses of well-known listed companies are sampled as sample long texts. In addition, in view of the changes in market access conditions after the implementation of the registration system, this variable is also included in the scope of investigation to capture the impact of institutional changes on the content and form of the prospectus. Through the above detailed classification and selection, we can have a more comprehensive understanding of the writing characteristics of prospectuses in different industries, so as to sample better quality and more representative prospectus samples as sample long texts.
[0086] Since the prospectuses of well-known listed companies are sampled as sample long texts, the prospectuses of well-known listed companies are generally more attractive to readers. Generating target long texts with the help of sample long texts can enhance the reading appeal of the generated target long texts, increase potential investors' interest in issuing companies, and attract investors' attention.
[0087] In an exemplary embodiment, the parameters to be updated may be parameters that require adaptive adjustment of specific data in different enterprises or in different scenarios. For example, the parameters to be updated may be the basic information of the relevant parties and issuers of this issuance.
[0088] In some embodiments, the process of determining the sample subtexts may be to split the sample long text into individual subtexts, wherein the text length of each subtext is less than a text length threshold; and determine individual sample subtexts from the individual subtexts.
[0089] In other embodiments, Figure 2 As shown, the process of determining the sample subtext includes:
[0090] Step 201 , based on the theme of the text content of the sample long text, the sample long text is divided into text modules to obtain various sub-texts.
[0091] In an exemplary embodiment, the theme may be a chapter name, a subheading name, or the core idea of a portion of the text content. For example, the theme may be "operating risk", "technical risk", "financial risk", "basic industry situation", "company sales situation", "company procurement situation", "basic issuance situation", "purpose of raised funds", "issuer's equity situation", etc.
[0092] Based on the theme of the text content of the sample long text, the sample long text is divided into text modules to obtain sub-texts. The sub-texts obtained by division have high cohesion and low coupling, that is, the sub-texts are independent of each other and have less correlation with each other.
[0093] In some embodiments, step 201 may be to search for associated words corresponding to the theme of the text content of the sample long text in the sample long text, and divide the paragraphs containing associated words corresponding to the same theme into the same sub-text.
[0094] In other embodiments, Figure 3 As shown, step 201 includes:
[0095] Step 301: Generate a third prompt word based on the sample long text.
[0096] Step 302: input the third prompt word into the large model to obtain each sub-text output by the large model.
[0097] The third prompt word is used to indicate that the large model divides the sample long text into text modules based on the theme of the text content of the sample long text to obtain various sub-texts.
[0098] In the exemplary embodiment, a large model (also called a foundation model) refers to a machine learning model with large-scale parameters and complex computing structure, which can process massive data and complete various complex tasks, such as natural language processing, computer vision, speech recognition, etc. Large models usually have billions or even hundreds of billions of parameters.
[0099] In an exemplary embodiment, the large model may specifically be a large language model (Large Language Models, LLMs for short), which refers to a deep learning model trained using a large amount of text data, and is intended to understand and generate natural language text.
[0100] Through the large model, based on the theme of the text content of the sample long text, the sample long text is divided into text modules to obtain various sub-texts, and the automatic generation of sub-texts is realized, which can improve the generation efficiency of sub-texts.
[0101] In the exemplary embodiment, after step 201, each sub-text is manually checked. After the check is confirmed to be correct, each sub-text is stored in the database for subsequent use. This manual check is a one-time work. After the check is confirmed to be correct, these sub-texts can be reused. In the subsequent steps, these sub-texts are used as the minimum granularity for processing.
[0102] Step 202: determine each sample sub-text from each sub-text.
[0103] In an exemplary embodiment, step 202 may be implemented in a variety of ways, including but not limited to the following implementations:
[0104] Method 1
[0105] Obtaining a user's selection operation, wherein the user's selection operation includes a target topic;
[0106] Based on the user's selection operation, a sample sub-text corresponding to the target topic is found from each sub-text.
[0107] Since there may be sub-texts in each sub-text that are not needed when generating the target long text, the sub-texts that are needed when generating the target long text may be determined according to the user's selection operation.
[0108] Method 2
[0109] The sub-text that needs to be updated among the sub-texts is used as the sample sub-text.
[0110] There may be multiple categories of subtexts. For example, subtexts are divided into three categories: the first category is "fixed language", which is included in the prospectuses of almost all well-known companies in the industry. It has the same expression and does not contain specific data, including "Statement of Capital Verification and Review Agency", "Statement of Capital Verification Agency", "Statement of Asset Appraisal Agency", "Statement of Accounting Firm" and "Statement of Issuer's Lawyer", etc. Subtexts in the "fixed language" category do not need to be processed in any way; the second category is "fixed template plus simple slots", which mainly includes figures, tables, and fixed language expressions with data. The second category appears in the prospectuses of various companies, has the same expression, but needs to be filled in according to the information of the specific company. For example, "Related parties of this issuance", "Basic information of the issuer", "Issuer's equity situation" and "Tables and figures", etc., the specific data (such as quantity, name) of each company is different, and this information needs to be filled in the fixed template. The sub-text of the "fixed template plus simple slot" category needs to be updated and filled with specific data; the third category is "variable part plus slot". The third category is due to the inconsistency of the writing style of each company, and the expression methods are different, but the required slots are the same, for example, "financial risk", "purpose of raised funds" and "operating conditions of the issuer's main business", the sub-text of the "variable part plus slot" category needs to be updated, and the expression method may also be changed if specific data is filled in. Therefore, the sub-texts of the "fixed template plus simple slot" category and the sub-texts of the "variable part plus slot" category in each sub-text are used as sample sub-texts. The slots here refer to the parameters to be updated.
[0111] In some embodiments, step 101 may be to store commonly used keywords in a keyword database, retrieve each keyword in the keyword database from each sample subtext, and use the keywords retrieved from each sample subtext as parameters to be updated in each sample subtext.
[0112] In other embodiments, Figure 4 As shown, step 101 includes:
[0113] Step 401: Generate a second prompt word based on each sample sub-text.
[0114] Step 402: input the second prompt word into the large model to obtain the parameters to be updated in each sample sub-text output by the large model.
[0115] The second prompt word is used to instruct the large model to identify the parameters to be updated in each sample sub-text.
[0116] By using a large model to identify the parameters to be updated in each sample sub-text, the recognition efficiency of the parameters to be updated can be improved.
[0117] Step 102: acquiring update data corresponding to each sample sub-text according to the parameters to be updated in each sample sub-text.
[0118] In some embodiments, step 102 may be implemented in a variety of ways, including but not limited to the following ways:
[0119] Method 1
[0120] In each draft of the enterprise, the updated data corresponding to each sample sub-text is obtained by searching according to the parameters to be updated in each sample sub-text.
[0121] Method 2
[0122] Through the network API (Application Programming Interface), the updated data corresponding to each sample sub-text is obtained through network search according to the parameters to be updated in each sample sub-text.
[0123] Method 3
[0124] According to the parameters to be updated in each sample sub-text, the update data corresponding to each sample sub-text is filled in manually.
[0125] Step 102 may also be a combination of the above methods. For example, method one is first used. If no updated data can be retrieved according to method one, method two is used. If no updated data can be found according to method two, method three is used.
[0126] In some embodiments, the specific implementation process of the first method of step 102 is described in detail, and step 102 includes:
[0127] For any parameter to be updated in each sample subtext, perform the following operations:
[0128] Determine each similar draft of any parameter to be updated from each draft;
[0129] Determine a target draft related to any parameter to be updated from each similar draft;
[0130] Based on the target draft, determine the update data corresponding to any parameter to be updated.
[0131] In the exemplary embodiment, the manuscript refers to the original manuscript kept for reference, which is used as the original basis and records various original data. For example, the manuscript can be a sales contract, sales order, invoice, accounting voucher, receipt voucher, purchase application form, purchase order, etc.
[0132] At present, in the process of manually writing prospectuses, faced with a massive amount of company manuscripts and information disclosure requirements, the writers may face the problem of inaccurate information processing. Due to the large and complex amount of data involved, manual operations are prone to errors, such as missing key information, misclassifying data, or improper interpretation. These mistakes may lead investors to misjudge the value of the company. At the same time, the speed of manual sorting and writing may not be able to meet the rapidly changing market and regulatory requirements, resulting in delayed information disclosure. In addition, manual work may also be affected by subjective judgment and there is a risk of personal bias, which affects the objectivity and neutrality of the information. Therefore, the accuracy of the disclosed information in the prospectus is low and not rigorous enough.
[0133] In the present application, similar drafts of any parameter to be updated are determined from various drafts, and a target draft related to any parameter to be updated is determined from various similar drafts. By screening twice, the target draft related to any parameter to be updated is determined from various drafts, which can improve the correlation between the target draft and any parameter to be updated. Based on the target draft, the update data corresponding to any parameter to be updated is determined, which can further improve the accuracy of the update data generated according to the target draft.
[0134] In some embodiments, similar drafts of any parameter to be updated are determined from various drafts, and the number of overlapping characters between each draft and any parameter to be updated is calculated, and based on the number of overlapping characters, similar drafts of any parameter to be updated are determined from various drafts, wherein the number of overlapping characters between the similar drafts and any parameter to be updated is greater than a threshold value for the number of overlapping characters.
[0135] In some other embodiments, determining similar drafts of any parameter to be updated from the drafts includes:
[0136] Any parameter to be updated and each draft are input into the retrieval model to obtain the similarity between the parameter to be updated and each draft; based on the similarity, each similar draft of the parameter to be updated is determined from each draft.
[0137] Among them, the retrieval model is used to predict the similarity between any parameter to be updated and each manuscript.
[0138] In an exemplary embodiment, similar drafts of any parameter to be updated are determined from various drafts based on similarity, which can be implemented inside the retrieval model or outside the retrieval model.
[0139] In an exemplary embodiment, there are multiple implementation methods for determining similar drafts of any parameter to be updated from various drafts based on similarity, including but not limited to the following implementation methods:
[0140] Method 1
[0141] The similarities between any parameter to be updated and each draft are sorted in descending order to obtain a first sorting result; the drafts corresponding to the first K similarities in the first sorting result are used as each similar draft of any parameter to be updated. The value of K can be adjusted.
[0142] Method 2
[0143] Compare each similarity with a similarity threshold; use the drafts corresponding to the similarity greater than the similarity threshold as the similar drafts of any parameter to be updated. The similarity threshold can be adjusted.
[0144] The similarity between any parameter to be updated and each draft can be automatically obtained through the retrieval model, and further similar drafts of any parameter to be updated can be automatically determined from each draft based on the similarity.
[0145] In some embodiments, the process of retrieving the model to obtain the similarity between any parameter to be updated and each manuscript includes:
[0146] Generate a first vector of any parameter to be updated and a second vector of each manuscript; calculate the similarity between the first vector and each second vector.
[0147] In an exemplary embodiment, generating the first vector of any parameter to be updated and the second vector of each draft may be by inputting any parameter to be updated and each draft into BERT (Bidirectional Encoder Representation from Transformers, bidirectional encoding model) respectively, and obtaining the first vector of any parameter to be updated and the second vector of each draft output by BERT. Inputting any parameter to be updated and each draft into BERT respectively may be by inputting any parameter to be updated and each draft into the same BERT model in sequence, or by inputting any parameter to be updated into a BERT model, and inputting each draft into another BERT model in sequence. Inputting any parameter to be updated into a BERT model, and inputting each draft into another BERT model in sequence, and using a double-tower structure model to generate the first vector of any parameter to be updated and the second vector of each draft, which can be processed in parallel, and the efficiency of generating the first vector of any parameter to be updated and the second vector of each draft is improved.
[0148] In an exemplary embodiment, the similarity between the first vector and each second vector is calculated by using ES, Faiss or Milvus tools. ES (Elasticsearch) is a search server. Faiss is a library for high-dimensional vector indexing and clustering, supports multiple distance metrics, and performs well on large-scale data sets. Milvus is an open source feature vector similarity search engine.
[0149] In some embodiments, determining the target draft related to any parameter to be updated from various similar drafts may be by calculating the similarity between any parameter to be updated and each similar draft; and determining the target draft related to any parameter to be updated from various similar drafts based on the similarity between any parameter to be updated and each similar draft.
[0150] In some other embodiments, determining a target manuscript related to any parameter to be updated from various similar manuscripts includes:
[0151] Splice any parameter to be updated with each similar manuscript to obtain each spliced text;
[0152] Input each spliced text into the classification model to obtain the classification results corresponding to each spliced text; wherein the classification model is used to predict the correlation between any parameter to be updated contained in the spliced text and the similar manuscript;
[0153] According to the classification results corresponding to each spliced text, the target manuscript related to any parameter to be updated is determined from each similar manuscript.
[0154] Through the classification model, it is possible to automatically obtain the classification results corresponding to each spliced text, and further, based on the classification results corresponding to each spliced text, automatically determine the target manuscript related to any parameter to be updated from various similar manuscripts.
[0155] In an exemplary embodiment, according to the classification results corresponding to each spliced text, a target manuscript related to any parameter to be updated is determined from each similar manuscript, which can be implemented inside the classification model or outside the classification model.
[0156] In an exemplary embodiment, the classification result may include the probability that any parameter to be updated contained in the spliced text is related to a similar draft; the classification result may also include that any parameter to be updated contained in the spliced text is related to a similar draft, or that any parameter to be updated contained in the spliced text is not related to a similar draft. The classification result includes that any parameter to be updated contained in the spliced text is related to a similar draft, or that any parameter to be updated contained in the spliced text is not related to a similar draft. The first label value may be used to indicate that any parameter to be updated contained in the spliced text is related to a similar draft, and the second label value may be used to indicate that any parameter to be updated contained in the spliced text is not related to a similar draft. For example, the first label value is 1 and the second label value is 0.
[0157] In an exemplary embodiment, there are multiple implementation methods for determining the target manuscript related to any parameter to be updated from each similar manuscript based on the classification results corresponding to each spliced text, including but not limited to the following methods:
[0158] Method 1
[0159] The classification result includes the probability that any parameter to be updated contained in the concatenated text is related to a similar manuscript.
[0160] The probabilities are sorted in descending order to obtain a second sorting result; similar knowledge points corresponding to the first N probabilities in the second sorting result are used as target manuscripts related to any parameter to be updated, wherein the value of N can be adjusted.
[0161] Method 2
[0162] The classification result includes the probability that any parameter to be updated contained in the concatenated text is related to a similar manuscript.
[0163] Compare each probability with a probability threshold; use similar drafts corresponding to probabilities greater than the probability threshold as target drafts associated with any parameter to be updated. The probability threshold can be adjusted.
[0164] Method 3
[0165] The classification result includes that any parameter to be updated included in the spliced text is related to the similar draft, or any parameter to be updated included in the spliced text is not related to the similar draft.
[0166] The similar knowledge points corresponding to the classification results related to any parameter to be updated and similar manuscripts contained in the spliced text are used as the target manuscripts related to any parameter to be updated.
[0167] In some embodiments, the process of the classification model obtaining the classification results corresponding to each of the concatenated texts includes:
[0168] Generate a third vector of each concatenated text;
[0169] According to each third vector, the probability that any parameter to be updated is associated with each similar manuscript is determined, and a classification result is generated based on the probability.
[0170] In an exemplary embodiment, the third vector of each concatenated text is generated by inputting each concatenated text into BERT in sequence to obtain the third vector of each concatenated text output by BERT.
[0171] In an exemplary embodiment, there are many ways to generate classification results based on probability, including but not limited to the following ways:
[0172] Method 1
[0173] Directly use the probability as the classification result.
[0174] Method 2
[0175] Compare each probability with the probability threshold; determine the classification result corresponding to the spliced text corresponding to the probability greater than the probability threshold as any parameter to be updated contained in the spliced text is related to the similar draft; determine the classification result corresponding to the spliced text corresponding to the probability less than or equal to the probability threshold as any parameter to be updated contained in the spliced text is not related to the similar draft. The probability threshold can be adjusted.
[0176] In some embodiments, Figure 5 As shown, the dual retrieval model includes two parts. The first part is the retrieval model, and the second part is the classification model. The retrieval model adopts a double-tower structure model. Figure 8In the method, any parameter Q to be updated is input into a BERT model in the retrieval model, and each draft Chunk is input into another BERT model in the retrieval model in turn to obtain a first vector (i.e., vector representation) of any parameter to be updated and a second vector (i.e., vector representation) of each draft. The similarity between the first vector and each second vector is calculated by using ES, Faiss or Milvus tools in the retrieval model. The similarities between any parameter to be updated and each draft are sorted in descending order to obtain a first sorting result. The drafts corresponding to the top K similarities in the first sorting result (Top K) are used as similar drafts of any parameter to be updated, wherein the value of K can be adjusted. Splice any parameter Q to be updated with each similar draft (Top K) to obtain each spliced text, input each spliced text into BERT in the classification model, obtain the third vector of each spliced text, input the third vector of each spliced text into the softmax layer in the classification model, obtain the probability of any parameter to be updated contained in the spliced text being related to the similar draft, sort the probabilities in descending order, obtain the second sorting result, and use the similar drafts (TopN) corresponding to the top N probabilities in the second sorting result as the target drafts related to any parameter to be updated, wherein the value of N can be adjusted.
[0177] In some embodiments, there are multiple implementation methods for determining the update data corresponding to any parameter to be updated based on the target manuscript, including but not limited to the following methods:
[0178] Method 1
[0179] By means of keyword search, the update parameter value corresponding to any parameter to be updated is found from the target manuscript, and the update parameter value is used as the update data.
[0180] Method 2
[0181] Through the large model, the update parameter value corresponding to any parameter to be updated is found from the target manuscript, and the update parameter value is used as the update data.
[0182] Step 103: Replace the parameters to be updated in each sample subtext with the update data corresponding to each sample subtext, so as to obtain the updated subtext corresponding to each sample subtext.
[0183] In some embodiments, step 103 can be to directly find the position of the parameter to be updated in each sample sub-text by searching keywords in each sample sub-text, and replace the parameter to be updated in each sample sub-text with the update data corresponding to the parameter to be updated in the position of the parameter to be updated in each sample sub-text, so as to obtain the updated sub-text corresponding to each sample sub-text.
[0184] In other embodiments, Figure 6 As shown, step 103 includes:
[0185] Step 601: Generate a first prompt word based on each sample sub-text and the update data corresponding to each sample sub-text.
[0186] In some embodiments, step 601 may be inputting each sample sub-text and the update data corresponding to each sample sub-text into the prompt word template to generate the first prompt word. The prompt word template includes the variable text and the update value, but does not include the specific parameter value of the variable text and the specific parameter value of the update value. Therefore, when the specific parameter value of the variable text and the specific parameter value of the update value change, the prompt word template does not need to be changed. The prompt word template only needs to be designed once. The prompt word template may refer to replacing the parameter to be updated in the variable text with the update value variable. Inputting each sample sub-text and the update data corresponding to each sample sub-text into the prompt word template to generate the first prompt word means using the sample sub-text as the specific parameter value of the variable text in the prompt word template, and using the update data corresponding to the sample sub-text as the specific parameter value of the variable update value in the prompt word template to generate the first prompt word.
[0187] In other embodiments, Figure 7 As shown, step 601 includes:
[0188] Step 701, summarize each sample sub-text to obtain the thought chain of each sample sub-text.
[0189] In the exemplary embodiment, the Chain of Thought (COT) refers to a series of intermediate reasoning steps, which is a chain composed of multiple prompt words. By allowing the large model to gradually participate in the process of decomposing a complex problem into sub-problems step by step and solving them in sequence, the performance of the large model can be significantly improved. For example, the chain of thought can be: the core idea processed in the first step, the core idea processed in the second step, ..., the core idea processed in the last step. The chain of thought technology can extract the core writing logic of each sample sub-text according to different contexts and needs.
[0190] Summarizing each sample sub-text and obtaining the thought chain of each sample sub-text not only helps to capture the key information in the prospectus, but also ensures that the content of the generated updated sub-text is consistent with the sample long text in style, presenting readers with a text that is both professional and valuable for reference. It not only improves the efficiency of information processing, but also maintains the professionalism and accuracy of the sample long text, making complex prospectuses easy to understand and analyze, and enhancing the attractiveness of the generated target long text.
[0191] Step 702: Generate a first prompt word based on the thought chain of each sample sub-text and the update data corresponding to each sample sub-text.
[0192] Step 602: input the first prompt word into the large model to obtain updated sub-texts corresponding to each sample sub-text output by the large model.
[0193] The first prompt word is used to instruct the large model to replace the parameters to be updated in the sample sub-text with the update data corresponding to the sample sub-text.
[0194] Through the large model, the parameters to be updated in the sample sub-text are replaced with the updated data corresponding to the sample sub-text, so as to automatically generate the updated sub-text corresponding to each sample sub-text, and then generate the target long text according to each updated sub-text, so as to realize the automatic generation of the target long text and improve the generation efficiency of the target long text.
[0195] In an exemplary embodiment, the sample subtexts include subtexts of the "fixed template plus simple slots" category and subtexts of the "variable part plus slots" category. For the sample subtexts of the "fixed template plus simple slots" category, the parameters to be updated in the sample subtexts are replaced with the update data corresponding to the sample subtexts through the large model, and the language expression content adopts the language expression content in the sample subtexts. For the sample subtexts of the "variable part plus slots" category, each sample subtext is summarized to obtain the thought chain of each sample subtext, and the parameters to be updated in the sample subtexts are replaced with the update data corresponding to the sample subtexts through the large model, and the language expression content is generated according to the thought chain through the large model, and then the updated subtext corresponding to each sample subtext is obtained according to the update data and language expression content corresponding to the sample subtext.
[0196] Step 104: Generate a target long text according to each updated sub-text.
[0197] In an exemplary embodiment, when the target long text includes a subtext of the "fixed language" category, the target long text is generated based on each updated subtext, and each updated subtext and the subtext of the "fixed language" category selected by the user are spliced to generate the target long text. When the target long text does not include a subtext of the "fixed language" category, the target long text is generated based on each updated subtext, and each updated subtext is directly spliced to generate the target long text.
[0198] In summary, in the present application, the sample long text is divided into text modules to obtain various sample sub-texts, and then the update data corresponding to each sample sub-text is obtained, and the parameters to be updated in each sample sub-text are replaced with the update data corresponding to each sample sub-text. With the help of the sample long text, the parameters to be updated of each sample sub-text are updated, and the updated sub-texts corresponding to each sample sub-text are obtained, and then the target long text is generated. The target long text is generated with the help of the sample long text, which improves the efficiency of long text generation compared to completely relying on manual writing of long texts.
[0199] Exemplary Devices
[0200] Accordingly, the present application embodiment also provides a long text generation device, such as Figure 8 As shown, the long text generating device includes:
[0201] The processing unit 801 is used to determine the parameters to be updated in each sample sub-text; the sample sub-text is determined by dividing the sample long text into text modules;
[0202] An acquiring unit 802 is used to acquire update data corresponding to each of the sample subtexts according to the parameters to be updated in each of the sample subtexts;
[0203] A replacing unit 803 is used to replace the parameters to be updated in each of the sample subtexts with the update data corresponding to each of the sample subtexts, so as to obtain the updated subtext corresponding to each of the sample subtexts;
[0204] The generating unit 804 is used to generate a target long text according to each of the updated sub-texts.
[0205] Optionally, the replacement unit 803 includes:
[0206] A generating subunit, configured to generate a first prompt word based on each of the sample subtexts and the update data corresponding to each of the sample subtexts;
[0207] The first processing sub-unit is used to input the first prompt word into the large model to obtain the updated sub-text corresponding to each of the sample sub-texts output by the large model, wherein the first prompt word is used to instruct the large model to replace the parameters to be updated in the sample sub-text with the updated data corresponding to the sample sub-text.
[0208] Optionally, the acquiring unit 802 includes:
[0209] The second processing sub-unit is used to perform the following operations for any parameter to be updated in each of the sample sub-texts: determining each similar draft of the parameter to be updated from each draft;
[0210] A third processing subunit is used to determine a target manuscript related to any parameter to be updated from each of the similar manuscripts;
[0211] The fourth processing sub-unit is used to determine the update data corresponding to any one of the parameters to be updated based on the target manuscript.
[0212] Optionally, the second processing sub-unit is specifically used to generate a first vector of any parameter to be updated and a second vector of each draft; calculate the similarity between the first vector and each of the second vectors; and determine each similar draft of any parameter to be updated from each of the drafts based on the similarity.
[0213] Optionally, the third processing sub-unit is specifically used to splice the any one parameter to be updated with each of the similar manuscripts to obtain each spliced text; generate a third vector for each of the spliced texts; determine the probability of the any one parameter to be updated being associated with each of the similar manuscripts based on each of the third vectors; and determine the target manuscript associated with the any one parameter to be updated from each of the similar manuscripts based on the probability.
[0214] Optionally, the generating sub-unit is specifically used to summarize each of the sample sub-texts to obtain the thought chain of each of the sample sub-texts; based on the thought chain of each of the sample sub-texts and the corresponding update data of each of the sample sub-texts, generate the first prompt word.
[0215] Optionally, the processing unit 801 is specifically used to generate a second prompt word based on each sample sub-text; input the second prompt word into the big model to obtain the parameters to be updated in each sample sub-text output by the big model, wherein the second prompt word is used to instruct the big model to identify the parameters to be updated in each sample sub-text.
[0216] Optionally, the long text generating device further includes:
[0217] A division unit, used for dividing the sample long text into text modules based on the theme of the text content of the sample long text to obtain various sub-texts;
[0218] The determining unit is used to determine each sample subtext from each of the subtexts.
[0219] Optionally, the division unit is specifically used to generate a third prompt word based on the sample long text; input the third prompt word into the large model to obtain each sub-text output by the large model, wherein the third prompt word is used to indicate the theme of the text content of the sample long text to the large model, and divide the sample long text into text modules to obtain each sub-text.
[0220] The long text generation device provided in this embodiment belongs to the same application concept as the long text generation method provided in the above embodiments of this application, and can execute the long text generation method provided in any of the above embodiments of this application, and has the corresponding functional modules and beneficial effects of executing the long text generation method. For technical details not fully described in this embodiment, please refer to the specific processing content of the long text generation method provided in the above embodiments of this application, and will not be repeated here.
[0221] The functions implemented by the above processing unit 801, acquisition unit 802, replacement unit 803 and generation unit 804 can be implemented by the same or different processors respectively, and the embodiment of the present application is not limited thereto.
[0222] It should be understood that the units in the above devices can be implemented in the form of a processor calling software. For example, the device includes a processor, the processor is connected to a memory, and instructions are stored in the memory. The processor calls the instructions stored in the memory to implement any of the above methods or realize the functions of each unit of the device, wherein the processor can be a general-purpose processor, such as a CPU or a microprocessor, etc., and the memory can be a memory in the device or a memory outside the device. Alternatively, the units in the device can be implemented in the form of hardware circuits, and the functions of some or all units can be realized by designing the hardware circuits. The hardware circuit can be understood as one or more processors; for example, in one implementation, the hardware circuit is an ASIC, and the functions of some or all of the above units are realized by designing the logical relationship of the components in the circuit; for another example, in another implementation, the hardware circuit can be implemented by PLD, taking FPGA as an example, which can include a large number of logic gate circuits, and the connection relationship between the logic gate circuits is configured by the configuration file, so as to realize the functions of some or all of the above units. All units of the above devices can be implemented in the form of a processor calling software, or in the form of hardware circuits, or in part by a processor calling software, and the remaining part is implemented in the form of hardware circuits.
[0223] In an embodiment of the present application, a processor is a circuit with the ability to process signals. In one implementation, the processor may be a circuit with the ability to read and run instructions, such as a CPU, a microprocessor, a GPU, or a DSP; in another implementation, the processor may implement certain functions through the logical relationship of a hardware circuit, and the logical relationship of the hardware circuit is fixed or reconfigurable, such as a hardware circuit implemented by an ASIC or PLD, such as an FPGA. In a reconfigurable hardware circuit, the process of the processor loading a configuration document to implement the hardware circuit configuration can be understood as the process of the processor loading instructions to implement the functions of some or all of the above units. In addition, it can also be a hardware circuit designed for artificial intelligence, which can be understood as an ASIC, such as an NPU, TPU, DPU, etc.
[0224] It can be seen that each unit in the above device can be one or more processors (or processing circuits) configured to implement the above method, such as: CPU, GPU, NPU, TPU, DPU, microprocessor, DSP, ASIC, FPGA, or a combination of at least two of these processor forms.
[0225] In addition, all or part of the units in the above device can be integrated together, or can be implemented independently. In one implementation, these units are integrated together and implemented in the form of a SOC. The SOC may include at least one processor for implementing any of the above methods or implementing the functions of each unit of the device. The type of the at least one processor may be different, for example, including a CPU and an FPGA, a CPU and an artificial intelligence processor, a CPU and a GPU, etc.
[0226] Exemplary Electronic Devices
[0227] Another embodiment of the present application also provides an electronic device, see Fig. 9 As shown, the device includes:
[0228] Memory 200 and processor 210;
[0229] The memory 200 is connected to the processor 210 and is used to store programs;
[0230] The processor 210 is used to implement the long text generation method disclosed in any of the above embodiments by running the program stored in the memory 200.
[0231] Specifically, the electronic device may further include: a bus, a communication interface 220 , an input device 230 and an output device 240 .
[0232] The processor 210, the memory 200, the communication interface 220, the input device 230 and the output device 240 are connected to each other via a bus.
[0233] A bus may include a pathway that transfers information between components of a computer system.
[0234] The processor 210 may be a general-purpose processor, such as a general-purpose central processing unit (CPU), a microprocessor, etc., or an application-specific integrated circuit (ASIC), or one or more integrated circuits for controlling the execution of the program of the scheme of the present invention. It may also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
[0235] The processor 210 may include a main processor, and may also include a baseband chip, a modem, and the like.
[0236] The memory 200 stores a program for executing the technical solution of the present invention, and may also store an operating system and other key services. Specifically, the program may include a program code, and the program code includes a computer operation instruction. More specifically, the memory 200 may include a read-only memory (ROM), other types of static storage devices that can store static information and instructions, a random access memory (RAM), other types of dynamic storage devices that can store information and instructions, a disk storage, a flash, and the like.
[0237] The input device 230 may include a device for receiving data and information input by a user, such as a keyboard, a mouse, a camera, a scanner, a light pen, a voice input device, a touch screen, a pedometer, or a gravity sensor.
[0238] Output device 240 may include devices that allow information to be output to a user, such as a display screen, printer, speaker, etc.
[0239] The communication interface 220 may include any transceiver or the like to communicate with other devices or communication networks, such as Ethernet, Radio Access Network (RAN), Wireless Local Area Network (WLAN), etc.
[0240] The processor 210 executes the program stored in the memory 200 and calls other devices, which can be used to implement each step of any long text generation method provided in the above embodiments of the present application.
[0241] Exemplary computer program products and storage media
[0242] In addition to the above-mentioned methods and devices, an embodiment of the present application may also be a computer program product, which includes computer program instructions, which, when executed by a processor, enable the processor to execute the steps of the long text generation method according to various embodiments of the present application described in any of the above embodiments of this specification.
[0243] The computer program product may be written in any combination of one or more programming languages to write program codes for performing the operations of the embodiments of the present application, including object-oriented programming languages, such as Java, C++, etc., and conventional procedural programming languages, such as "C" language or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as an independent software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server.
[0244] In addition, the embodiment of the present application may also be a storage medium on which a computer program is stored. The computer program is executed by a processor to execute the steps of the long text generation method according to various embodiments of the present application described in any of the above embodiments of this specification, and specifically the following steps may be implemented:
[0245] Step 101: Determine the parameters to be updated in each sample subtext.
[0246] The sample sub-text is determined by dividing the sample long text into text modules.
[0247] Step 102: acquiring update data corresponding to each sample sub-text according to the parameters to be updated in each sample sub-text.
[0248] Step 103: Replace the parameters to be updated in each sample subtext with the update data corresponding to each sample subtext, so as to obtain the updated subtext corresponding to each sample subtext.
[0249] Step 104: Generate a target long text according to each updated sub-text.
[0250] For the aforementioned method embodiments, for the sake of simplicity, they are all described as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the order of the actions described, because according to the present application, some steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.
[0251] It should be noted that each embodiment in this specification is described in a progressive manner, and each embodiment focuses on the differences from other embodiments, and the same or similar parts between the embodiments can be referred to each other. For the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0252] The steps in the methods of each embodiment of the present application can be adjusted in order, combined and deleted according to actual needs, and the technical features recorded in each embodiment can be replaced or combined.
[0253] The modules and sub-modules in the devices and terminals in the various embodiments of the present application can be combined, divided and deleted according to actual needs.
[0254] In the several embodiments provided in the present application, it should be understood that the disclosed terminals, devices and methods can be implemented in other ways. For example, the terminal embodiments described above are only schematic, for example, the division of modules or submodules is only a logical function division, and there may be other division methods in actual implementation, for example, multiple submodules or modules can be combined or integrated into another module, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or modules, which can be electrical, mechanical or other forms.
[0255] The modules or submodules described as separate components may or may not be physically separated, and the components of the modules or submodules may or may not be physical modules or submodules, that is, they may be located in one place, or they may be distributed on multiple network modules or submodules. Some or all of the modules or submodules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0256] In addition, each functional module or submodule in each embodiment of the present application may be integrated into one processing module, or each module or submodule may exist physically separately, or two or more modules or submodules may be integrated into one module. The above-mentioned integrated modules or submodules may be implemented in the form of hardware or in the form of software functional modules or submodules.
[0257] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0258] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly by hardware, software units executed by a processor, or a combination of the two. The software units may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
[0259] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0260] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A long text generation method, characterized in that: include: Determining parameters to be updated in each sample sub-text; the sample sub-text is determined by dividing the sample long text into text modules; According to the parameters to be updated in each of the sample sub-texts, acquiring the update data corresponding to each of the sample sub-texts; Replacing the parameters to be updated in each of the sample subtexts with the update data corresponding to each of the sample subtexts, to obtain updated subtexts corresponding to each of the sample subtexts; A target long text is generated according to each of the updated sub-texts.
2. The long text generation method according to claim 1, characterized in that: Replacing the parameters to be updated in each of the sample subtexts with the update data corresponding to each of the sample subtexts to obtain updated subtexts corresponding to each of the sample subtexts, including: generating a first prompt word based on each of the sample sub-texts and the update data corresponding to each of the sample sub-texts; The first prompt word is input into the large model to obtain updated subtexts corresponding to each of the sample subtexts output by the large model, wherein the first prompt word is used to instruct the large model to replace the parameters to be updated in the sample subtext with the updated data corresponding to the sample subtext.
3. The long text generation method according to claim 1, characterized in that: The acquiring the update data corresponding to each of the sample subtexts according to the parameters to be updated in each of the sample subtexts includes: For any parameter to be updated in each of the sample sub-texts, perform the following operations: Determine each similar draft of any one parameter to be updated from each draft; Determine a target draft related to any one of the parameters to be updated from each of the similar drafts; Based on the target manuscript, update data corresponding to any one of the parameters to be updated is determined.
4. The long text generation method according to claim 3, characterized in that: The step of determining, from the various drafts, each similar draft of the arbitrary parameter to be updated comprises: Generate a first vector of any parameter to be updated and a second vector of each manuscript; Calculating the similarity between the first vector and each of the second vectors; Based on the similarity, each similar draft of any one parameter to be updated is determined from each draft.
5. The long text generation method according to claim 3, characterized in that: The step of determining a target draft related to any one of the parameters to be updated from the similar drafts includes: Splicing any of the parameters to be updated with each of the similar manuscripts to obtain each spliced text; Generate a third vector of each of the concatenated texts; Determine, based on each of the third vectors, the probability that any one of the parameters to be updated is associated with each of the similar manuscripts; According to the probability, a target manuscript related to any one of the parameters to be updated is determined from each of the similar manuscripts.
6. The long text generation method according to claim 2, characterized in that: The step of generating a first prompt word based on each of the sample sub-texts and the update data corresponding to each of the sample sub-texts includes: Summarizing each of the sample sub-texts to obtain a thought chain of each of the sample sub-texts; A first prompt word is generated based on the thought chain of each of the sample sub-texts and the update data corresponding to each of the sample sub-texts.
7. The long text generation method according to claim 1, characterized in that: The step of determining the parameters to be updated in each sample subtext includes: Based on each sample sub-text, generate a second prompt word; The second prompt word is input into the large model to obtain the parameters to be updated in each sample sub-text output by the large model, wherein the second prompt word is used to instruct the large model to identify the parameters to be updated in each sample sub-text.
8. The long text generation method according to claim 1, characterized in that: Before determining the parameters to be updated in each sample subtext, the method further includes: Based on the theme of the text content of the sample long text, the sample long text is divided into text modules to obtain various sub-texts; From the subtexts, sample subtexts are determined.
9. The long text generation method according to claim 8, characterized in that: Based on the theme of the text content of the sample long text, the sample long text is divided into text modules to obtain various sub-texts, including: Based on the sample long text, generate a third prompt word; The third prompt word is input into the large model to obtain each sub-text output by the large model, wherein the third prompt word is used to indicate the large model to divide the sample long text into text modules based on the theme of the text content of the sample long text to obtain each sub-text.
10. A long text generation device, characterized in that: include: A processing unit, used to determine the parameters to be updated in each sample sub-text; the sample sub-text is determined by dividing the sample long text into text modules; An acquiring unit, configured to acquire update data corresponding to each of the sample subtexts according to the parameters to be updated in each of the sample subtexts; A replacement unit, used for replacing the parameters to be updated in each of the sample subtexts with the update data corresponding to each of the sample subtexts, so as to obtain the updated subtext corresponding to each of the sample subtexts; A generating unit is used to generate a target long text according to each of the updated sub-texts.
11. An electronic device, characterized in that: including memory and processor; The memory is connected to the processor and is used to store programs; The processor is used to implement the long text generation method according to any one of claims 1 to 9 by running the program in the memory.
12. A storage medium, characterized in that: The storage medium stores a computer program, and when the computer program is executed by the processor, the long text generation method according to any one of claims 1 to 9 is implemented.
13. A computer program product, characterized in that The method comprises computer program instructions, which, when executed by a processor, enable the processor to execute the long text generation method according to any one of claims 1 to 9.
