A long text information processing method and device, computer equipment and storage medium

By embedding question-and-answer pairs into long texts using semantic recognition and question-and-answer generation technologies, the problem of information loss in long text processing by large language models is solved, and the accuracy and completeness of the generated data are improved.

CN119670764BActive Publication Date: 2025-10-21PING AN TECH (SHENZHEN) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411562254.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-01
Publication Date
2025-10-21
Estimated Expiration
2044-11-01

AI Technical Summary

Technical Problem

Large language models tend to miss or ignore key information in the middle of long texts, leading to incomplete understanding and processing.

Method used

By acquiring semantic features of text through semantic recognition, generating question-answer pairs related to the original text, and embedding them into the original text, a long text question-answer dataset is constructed. This dataset is then used to train the second language model, thereby improving information preservation capabilities.

Benefits of technology

It enhances the accuracy and completeness of long text generation, reduces the risk of losing intermediate information, and ensures that key information is clearer during the generation process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119670764B_ABST
    Figure CN119670764B_ABST
Patent Text Reader

Abstract

The application discloses a long text information processing method and device, computer equipment and a storage medium, and belongs to the technical field of artificial intelligence. The application obtains text semantic features by performing semantic recognition on an original text; generates a question and answer pair related to the original text based on the text semantic features using a large language model; determines the embedding position of the question and answer pair in the original text, and performs text combination on the original text and the question and answer pair based on the embedding position to generate an initial long text; combines the initial long text and the question and answer pair to construct a long text question and answer dataset; performs long text generation training on the large language model using the long text question and answer dataset to obtain a long text generation model; and obtains a long text generation result from the long text generation model by inputting a to-be-processed text input by a user. The application also relates to the technical field of blockchains, and the to-be-processed text is stored in a blockchain network. The application reduces the risk of loss of intermediate information and improves the accuracy and integrity of generated texts.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of artificial intelligence technology, and specifically relates to a method, apparatus, computer equipment, and storage medium for processing long text information. Background Art

[0002] Nowadays, the training text windows of many large language models have been expanded to tens of thousands of tokens, enabling these models to process long text inputs. This expanded training text window can enhance many real-world downstream tasks, such as long-text question answering and summarization. However, current large language models still struggle to fully utilize the information in long texts and are prone to omitting or ignoring key information in the middle of the text, resulting in biased or incomplete understanding and processing of the overall content. In other words, current large language models generally suffer from the problem of intermediate information loss. This is due to insufficient explicit supervision in the contextual training of long texts, which does not emphasize that any position in the long context can accommodate key information. Therefore, how to enable large language models generated from long texts to fully utilize the key information in the middle of the text to solve the intermediate information loss problem of large language models has become an urgent research issue.

[0003] To address the issue of information loss in long texts, current research focuses on improving model architectures, specifically designing neural network architectures more suitable for processing long texts, or on layered processing, which involves breaking down long texts into multiple layers or sections, processing and analyzing each layer separately, and then synthesizing the results from each layer. However, these approaches still have limitations. For example, improving model architectures can increase computational complexity and training costs, and may not fundamentally resolve the information loss issue for all long texts. While layered processing can alleviate some of the pressure, it can introduce new errors during the synthesis phase, affecting the accuracy and completeness of the final analysis results. Summary of the Invention

[0004] The purpose of the embodiments of the present application is to propose a long text information processing method, apparatus, computer equipment and storage medium to solve the problem of intermediate information loss of large language models when generating long texts from the data level, so as to improve the accuracy and completeness of long texts.

[0005] In order to solve the above technical problems, the present application provides a method for processing long text information, which adopts the following technical solutions:

[0006] A long text information processing method, comprising:

[0007] Obtain the original text from the preset corpus, perform semantic recognition on the original text, and obtain the text semantic features;

[0008] Based on the semantic features of the text, a pre-trained language model is used to generate question-answer pairs related to the original text;

[0009] Determine the embedding position of the question-answer pair in the original text, and combine the original text and the question-answer pair based on the embedding position to generate an initial long text;

[0010] Combine the initial long text and question-answer pairs to build a long text question-answering dataset;

[0011] Use the long text question answering dataset to train the preset second largest language model on long text generation to obtain a long text generation model;

[0012] Receive a long text generation instruction, obtain the text to be processed input by the user, input the text to be processed into the long text generation model, and obtain the long text generation result.

[0013] Furthermore, the steps of obtaining original text from a preset corpus and performing semantic recognition on the original text to obtain text semantic features specifically include:

[0014] Perform word segmentation on the original text to obtain several original text word segments;

[0015] Perform semantic analysis on the original text segmentation to obtain the semantic analysis results of the original text segmentation;

[0016] Determine the semantic keywords of the original text based on the semantic analysis results of the original text segmentation;

[0017] Perform feature extraction on semantic keywords to obtain text semantic features.

[0018] Furthermore, the steps of determining the embedding position of the question-answer pair in the original text and combining the original text and the question-answer pair based on the embedding position to generate the initial long text specifically include:

[0019] Perform feature encoding on the original text after word segmentation to obtain the original text feature set;

[0020] Perform semantic recognition on the question-answer pair to obtain the semantic features of the question-answer pair;

[0021] Determine the location information of the semantic keywords in the original text, and replace the text semantic features in the original text feature set with the question-answer pair semantic features based on the location information to obtain a new text feature set;

[0022] Perform feature decoding on the new text feature set to obtain the initial long text.

[0023] Furthermore, the steps of determining the position information of the semantic keywords in the original text and replacing the text semantic features in the original text feature set with the question-answer pair semantic features according to the position information to obtain a new text feature set specifically include:

[0024] Vectorize the original text feature set to obtain the original text feature matrix;

[0025] Vectorize the text semantic features and question-answer pair semantic features respectively to obtain the text semantic feature vector and question-answer pair semantic feature vector;

[0026] Identify the position information of the text semantic feature vector in the original text feature matrix to obtain the position information of the semantic keywords in the original text;

[0027] According to the position information, the question-answer pair semantic feature vector is used to replace the text semantic feature vector in the original text feature matrix to obtain a new text feature matrix;

[0028] Generate a new text feature set based on the new text feature matrix.

[0029] Furthermore, the steps of combining the initial long text and question-answer pairs to construct a long text question-answering dataset include:

[0030] Obtain a new text feature matrix and a question-answer pair semantic feature vector, and perform feature association on the new text feature matrix and the question-answer pair semantic feature vector;

[0031] Based on the feature association results, the new text feature matrix and question-answer pair semantic feature vector are labeled to generate feature association labels.

[0032] Combine feature association labels, new text feature matrix, question-answer pair semantic feature vectors, initial long text and question-answer pairs to construct a long text question answering dataset.

[0033] Furthermore, the long text question-answering dataset is used to train the preset second largest language model for long text generation, and the steps of obtaining the long text generation model specifically include:

[0034] Based on the feature association labels, the new text feature matrix and the question-answer pair semantic feature vector, the second language model is used for feature learning;

[0035] During feature learning, the second largest language model outputs a predicted long text and a predicted question-answer pair that matches the predicted long text.

[0036] The second largest language model is iteratively updated by combining the predicted long text, predicted question-answer pairs, initial long text, and question-answer pairs until the model is fitted to obtain a long text generation model.

[0037] Furthermore, the second language model is configured with a first loss function and a second loss function, and the second language model is iteratively updated by combining the predicted long text, the predicted question-answer pair, the initial long text, and the question-answer pair until the model is fitted, thereby obtaining a long text generation model. Specifically, the steps include:

[0038] Based on the predicted long text and the initial long text, a first prediction loss is calculated using a first loss function;

[0039] Calculating a second prediction loss using a second loss function based on the predicted question-answer pair and the question-answer pair;

[0040] Based on the back-propagation algorithm, the second largest language model is iteratively updated using the first prediction loss and the second prediction loss until the model is fitted, thereby obtaining a long text generation model.

[0041] In order to solve the above technical problems, the embodiment of the present application further provides a long text information processing device, which adopts the following technical solution:

[0042] A long text information processing device, comprising:

[0043] The semantic recognition module is used to obtain the original text from the preset corpus and perform semantic recognition on the original text to obtain the semantic features of the text;

[0044] The question-answer pair generation module is used to generate question-answer pairs related to the original text based on the semantic features of the text using the pre-trained first-class language model;

[0045] The text combination module is used to determine the embedding position of the question-answer pair in the original text and combine the original text and the question-answer pair based on the embedding position to generate the initial long text;

[0046] The dataset construction module is used to combine the initial long text and question-answer pairs to construct a long text question-answering dataset;

[0047] The model training module is used to train the preset second-largest language model on long text generation using the long text question-answering dataset to obtain a long text generation model;

[0048] The long text generation module is used to receive a long text generation instruction, obtain the text to be processed input by the user, input the text to be processed into the long text generation model, and obtain the long text generation result.

[0049] In order to solve the above technical problems, the embodiment of the present application further provides a computer device, which adopts the following technical solution:

[0050] A computer device includes a memory and a processor, wherein the memory stores computer-readable instructions, and the processor implements the steps of any of the above-mentioned long text information processing methods when executing the computer-readable instructions.

[0051] In order to solve the above technical problems, the embodiment of the present application further provides a computer-readable storage medium, which adopts the following technical solution:

[0052] A computer-readable storage medium stores computer-readable instructions, which, when executed by a processor, implement the steps of any one of the above-mentioned long text information processing methods.

[0053] Compared with the prior art, the embodiments of the present application have the following beneficial effects:

[0054] The present application discloses a long text information processing method, device, computer equipment and storage medium, which belongs to the field of artificial intelligence technology. The present application ensures that the key information of the original text can be better captured when long text is generated by utilizing semantic recognition and question-answer generation technology. First, the semantic features of the text are obtained through semantic recognition, and relevant question-answer pairs are generated with the help of a pre-trained first language model, and the question-answer pairs are embedded in the original text to construct an initial long text structure containing questions and answers. This not only increases the semantic density of the text, but also makes the key information clearer during the generation process. In addition, by training the second language model based on the long text question-answer dataset, the model's information retention ability in long text generation is improved, and the risk of loss of intermediate information is reduced, thereby improving the accuracy and completeness of the generated text. BRIEF DESCRIPTION OF THE DRAWINGS

[0055] In order to more clearly illustrate the solutions in this application, a brief introduction will be given below to the drawings required for use in the description of the embodiments of this application. Obviously, the drawings described below are some embodiments of this application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0056] Figure 1 shows an exemplary system architecture diagram in which the present application can be applied;

[0057] Figure 2 A flowchart of an embodiment of a method for processing long text information according to the present application is shown;

[0058] Figure 3 A schematic structural diagram of an embodiment of a long text information processing device according to the present application is shown;

[0059] Figure 4 A schematic structural diagram of an embodiment of a computer device according to the present application is shown. DETAILED DESCRIPTION

[0060] Unless otherwise defined, all technical and scientific terms used herein have the same meanings as commonly understood by those skilled in the art to which this application belongs. The terms used in the specification of the application are for the purpose of describing specific embodiments only and are not intended to limit this application. The terms "including" and "having" and any variations thereof in the specification and claims of this application and the above-mentioned drawings are intended to cover non-exclusive inclusions. The terms "first", "second", etc. in the specification and claims of this application or the above-mentioned drawings are used to distinguish different objects, not to describe a specific order.

[0061] References herein to "embodiments" mean that a particular feature, structure, or characteristic described in connection with the embodiments may be included in at least one embodiment of the present application. The appearance of this phrase in various places in the specification does not necessarily refer to the same embodiment, nor does it constitute an independent or alternative embodiment that is mutually exclusive of other embodiments. It is understood, both explicitly and implicitly, by those skilled in the art that the embodiments described herein may be combined with other embodiments.

[0062] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the accompanying drawings.

[0063] like Figure 1 As shown, system architecture 100 may include a terminal device 101, a network 102, and a server 103. Terminal device 101 may be a laptop computer 1011, a tablet computer 1012, or a mobile phone 1013. Network 102 is a medium for providing a communication link between terminal device 101 and server 103. Network 102 may include various connection types, such as wired or wireless communication links or fiber optic cables.

[0064] The user can use the terminal device 101 to interact with the server 103 via the network 102 to receive or send messages, etc. Various communication client applications can be installed on the terminal device 101, such as web browser applications, shopping applications, search applications, instant messaging tools, email clients, social platform software, etc.

[0065] The terminal device 101 can be various electronic devices with a display screen and supporting web browsing. In addition to the laptop computer 1011, tablet computer 1012 or mobile phone 1013, the terminal device 101 can also be an e-book reader, an MP3 player (Moving Picture Experts Group Audio Layer III), an MP4 (Moving Picture Experts Group Audio Layer IV) player, a laptop computer and a desktop computer, etc.

[0066] The server 103 may be a server that provides various services, such as a background server that provides support for web pages displayed on the terminal device 101 .

[0067] It should be noted that the long text information processing method provided in the embodiment of the present application is generally executed by a server / terminal device, and accordingly, the long text information processing device is generally set in the server / terminal device.

[0068] It should be understood that Figure 1 The numbers of terminal devices, networks and servers in the embodiment are merely illustrative. The above system may have any number of terminal devices, networks and servers according to implementation requirements.

[0069] Continue to refer Figure 2 , shows a flow chart of an embodiment of a method for processing long text information according to the present application. The long text information processing method includes the following steps:

[0070] S201, obtaining original text from a preset corpus, and performing semantic recognition on the original text to obtain text semantic features.

[0071] Furthermore, the system obtains the original text from a preset corpus. The corpus is a collection of texts that has been screened and organized, containing rich linguistic information and semantic background, and can provide diverse and extensive text samples for subsequent semantic recognition. After extracting the text, the system first performs semantic recognition on the original text. This step uses natural language processing technology to analyze the content of the text and identify sentence structure, themes, and key semantic features, such as sentiment, concept classification, logical relationships, etc. The text semantic features obtained through semantic recognition can help the system generate more coherent and contextually consistent content, especially in long text generation tasks. Semantic analysis ensures the logical consistency of text content between paragraphs. The extraction of text semantic features usually uses pre-trained models, such as BERT or other large-scale semantic models, to obtain more accurate semantic representations, ensuring that the model can better capture the key information and core semantics of the text when generating long texts.

[0072] S202, based on the semantic features of the text, use the pre-trained first language model to generate question-answer pairs related to the original text.

[0073] Furthermore, in this stage, the system generates question-and-answer pairs using the pre-trained language model based on the semantic features of the text obtained in the previous step. The question-and-answer generation process relies primarily on the recognition results of semantic features to ensure that the generated questions and answers are closely related to the original text and cover key information from the original text. Generating question-and-answer pairs has multiple uses in language understanding tasks. It not only helps the model better understand the semantic structure of the content, but also clarifies the key points of information in the text through questions and answers. Deep learning-based models, such as GPT or T5 models, are typically used to generate question-and-answer pairs. These models have acquired a wealth of question-and-answer knowledge during training and are able to generate logical questions and answers based on the given semantic features. The generated questions and answers can further enrich the semantic expression level of the text. Furthermore, question-and-answer pairs help improve the model's information completeness when generating long texts, ensuring that important information from the original text is reflected in the generated long text, effectively avoiding information omissions and semantic distortion.

[0074] S203: Determine the embedding position of the question-answer pair in the original text, and perform text combination on the original text and the question-answer pair based on the embedding position to generate an initial long text.

[0075] Furthermore, this step mainly involves determining the embedding position of the question-answer pairs and combining them with the text. After obtaining the question-answer pairs related to the original text, the system needs to reasonably select the optimal position for inserting the question-answer pairs in the text. Generally, this position should be able to coherently connect with the text content, and the embedding position should help improve the readability and information density of the text. The embedding position can be determined based on the logical structure of the context. For example, questions and answers can be inserted at the end of each chapter or paragraph so that readers can review the key points after reading, or question-answer pairs can be added after certain content that requires further explanation and deepening to enhance understanding. After determining the embedding position, the system combines the original text and the question-answer pairs to generate a preliminary long text. The combination process is not just a simple splicing, but also requires necessary language connection processing between sentences to make the generated long text natural and fluent. This stage is an important step in improving the structural integrity of the text. By reasonably embedding question-answer pairs, the content of the long text is more clearly structured and the semantic expression is clearer.

[0076] S204: Combine the initial long text and question-answer pairs to construct a long text question-answering dataset.

[0077] Furthermore, after initially generating long texts embedded with question-answer pairs, the system needs to combine these long texts with the generated question-answer pairs to construct a long-text question-answer dataset. This dataset contains a large number of long-text samples embedded with question-answer pairs, which can provide high-quality corpus support for model training. By systematically grouping the initial long texts with relevant question-answer pairs, a well-structured dataset can be formed. Such a long-text question-answer dataset not only retains the original information of the text, but also significantly improves the semantic richness of the text and the clarity of information expression. The dataset construction process requires reviewing the accuracy and logic of the question-answer pairs to ensure that each question-answer pair is reasonably embedded in the appropriate location. This dataset is ultimately used to train the language model, so that the model can not only maintain the accuracy of the information when generating long texts, but also generate supplementary explanations or summaries based on the context, thereby better serving users' needs for the completeness of long text information.

[0078] S205: Use the long text question-answering dataset to perform long text generation training on the preset second largest language model to obtain a long text generation model.

[0079] Furthermore, at this stage, based on the constructed long-text question-answering dataset, the preset second-largest language model is specially trained for long-text generation. The goal of this training process is to enhance the model's performance in long-text generation tasks, so that it can not only generate coherent text, but also reduce information loss when generating long texts. Long-text generation training mainly utilizes the question-answer pairs and text structure in the dataset to enable the model to learn to maintain information density when generating content, while effectively integrating question-answer information, so as to more accurately reproduce key content and logical relationships during generation. During the training process, the model will continuously learn how to embed question-answer pairs into the generated text, improving the model's contextual understanding and long paragraph structure processing capabilities. The trained long-text generation model can better understand the instructions input by the user and has the ability to generate natural, fluent, clearly structured, and complete text in complex long-text scenarios.

[0080] S206, receiving a long text generation instruction, obtaining the text to be processed input by the user, inputting the text to be processed into the long text generation model, and obtaining a long text generation result.

[0081] Furthermore, the system receives a long text generation instruction from the user and generates text based on the text to be processed input by the user using the trained long text generation model. This process aims to expand the user's input content into a long text that meets the requirements, and in the process, achieve content coherence and semantic integrity. Based on the instruction, the model parses the user's specific needs, such as the level of detail of the information, the expression of logical relationships, etc., and then uses the text to be processed as a starting point to expand and optimize the content through the generation model. The long text result generated by the model will comprehensively utilize the question-answer pair embedding experience and information extraction methods learned in the early stage to ensure that the output long text can not only accurately express the core information of the text to be processed, but also add necessary explanations, summaries and supplementary content to form a more well-structured long text. The final generated result is an optimized long text with high semantic density and information integrity, which can better meet the user's high-quality demand for long text content.

[0082] In the above embodiment, this application utilizes semantic recognition and question-answer generation technology to ensure that the key information of the original text can be better captured when generating long text. First, the semantic features of the text are obtained through semantic recognition, and relevant question-answer pairs are generated with the help of the pre-trained first language model. The question-answer pairs are then embedded into the original text to construct an initial long text structure containing questions and answers. This not only increases the semantic density of the text, but also makes the key information clearer during the generation process. In addition, by training the second language model based on the long text question-answer dataset, the model's information retention ability in long text generation is improved, the risk of losing intermediate information is reduced, and the accuracy and completeness of the generated text are improved.

[0083] Furthermore, the steps of obtaining original text from a preset corpus and performing semantic recognition on the original text to obtain text semantic features specifically include:

[0084] Perform word segmentation on the original text to obtain several original text word segments;

[0085] Perform semantic analysis on the original text segmentation to obtain the semantic analysis results of the original text segmentation;

[0086] Determine the semantic keywords of the original text based on the semantic analysis results of the original text segmentation;

[0087] Perform feature extraction on semantic keywords to obtain text semantic features.

[0088] In this embodiment, the original text is first segmented by word to obtain a number of original segmented words that are helpful for semantic analysis. After segmentation, the system performs semantic analysis on these segmented words, parsing the semantic meaning of each segmented word and the logical relationship in the sentence, such as entity, action, emotion, time and other feature information. Then, based on the semantic analysis results of the segmented words, semantic keywords that can reflect the text theme and information content are determined. Extracting these keywords can help the system focus on the key information in the text. Finally, feature extraction is performed on the selected semantic keywords, which are converted into semantic vectors or feature matrices that can be used by the model to generate a semantic feature representation of the text. In this process, the system applies deep learning models and natural language processing technology, so that the semantic features of the text can more accurately express the core meaning of the original text.

[0089] For example, in a property and casualty insurance customer service bot, the system first extracts raw text from a user's description, such as "My car hit a guardrail on a rainy day. What should I do?" The system then segmented the text, generating word fragments such as "car," "rainy day," "hit," and "guardrail." The system then performs semantic analysis on these segmented words, identifying "car" as the subject of the accident, "rainy day" as an environmental factor, "hit" as an event verb, and "guardrail" as the object of collision. Based on the semantic analysis results, the system extracts core keywords such as "accident vehicle," "rainy day accident," and "collision handling." Semantic features are then generated for each keyword, helping the model understand the core of the user's question. These semantic features can help the bot generate more precise responses, such as suggesting that the user report the incident or contact emergency services, thereby improving the accuracy and efficiency of customer service responses.

[0090] Through the above steps, accurate text semantic features can be obtained, thereby providing key information for downstream generation tasks and improving the accuracy and completeness of the generated text.

[0091] Furthermore, the steps of obtaining original text from a preset corpus and performing semantic recognition on the original text to obtain text semantic features specifically include:

[0092] Perform word segmentation on the original text to obtain several original text word segments;

[0093] Perform semantic analysis on the original text segmentation to obtain the semantic analysis results of the original text segmentation;

[0094] According to the semantic analysis results of the original text segmentation, the independent semantic segments contained in the original text are identified;

[0095] Determine the semantic keywords corresponding to each independent semantic segment based on the semantic analysis results of the original text segmentation;

[0096] Feature extraction is performed on the semantic keywords corresponding to each independent semantic segment to obtain the text semantic features corresponding to each independent semantic segment.

[0097] In this embodiment, the original text is first segmented so that the text content is decomposed into several smaller independent semantic segments, which are convenient for semantic analysis and processing. Based on the segmentation, each segmentation result is semantically analyzed to obtain the semantic information represented by each segmentation, which further constitutes the semantic analysis result of the original text. Based on the semantic analysis results, semantic segments with relatively independent meanings in the text can be identified, that is, expression units with certain coherence or independence in content. Subsequently, the corresponding semantic keywords are extracted for each independent semantic segment to better express the core content of the segment. For each semantic keyword, its text semantic features are extracted through feature extraction technology, and these features reflect the core information of the text content.

[0098] For example, for the sentence "I accidentally hit the guardrail while driving in the rain, and the vehicle was seriously damaged", the system first segments it into "rainy day", "driving", "accidental", "hit", "guardrail", "vehicle damage", etc. Next, a semantic analysis is performed on each segmented word to parse the role and meaning of the segmented word, such as "driving" represents an action, "guardrail" is the collision object, and "vehicle damage" is the result of the event. On this basis, the system further identifies independent semantic segments contained in the text, such as "driving in the rain", "guardrail collision", and "vehicle damage". The corresponding semantic keywords are then extracted for each semantic segment, and features are extracted for these keywords and converted into a semantic feature matrix. This method breaks down complex text into multiple semantic segments and features the core semantic keywords of each segment, which helps the model accurately grasp the multiple meanings of the text.

[0099] Through the above steps, we can effectively improve the structured understanding of text information, enhance the accuracy of semantic analysis, and provide higher-quality semantic support for scenarios such as information retrieval and natural language processing.

[0100] Furthermore, the steps of determining the embedding position of the question-answer pair in the original text and combining the original text and the question-answer pair based on the embedding position to generate the initial long text specifically include:

[0101] Perform feature encoding on the original text after word segmentation to obtain the original text feature set;

[0102] Perform semantic recognition on the question-answer pair to obtain the semantic features of the question-answer pair;

[0103] Determine the location information of the semantic keywords in the original text, and replace the text semantic features in the original text feature set with the question-answer pair semantic features based on the location information to obtain a new text feature set;

[0104] Perform feature decoding on the new text feature set to obtain the initial long text.

[0105] In this embodiment, the original text after word segmentation is first feature encoded so as to convert the text content into a numerical and structured feature set. Next, semantic recognition is performed on the content of the question-answer pair, and the core semantic features contained in the question-answer pair are extracted to ensure that the content of the question-answer pair can be effectively embedded in the semantic structure of the original text in subsequent operations. Then, based on the position information of the semantic keywords in the original text, the feature set of the original text is updated, that is, the corresponding features in the original text are replaced according to the semantic features of the question-answer pair, so that the feature set of the original text is integrated into the semantic content of the question-answer pair, and a new text feature set is generated. Through feature decoding, the new text feature set is restored to a long text with complete semantics, so that the final generated text not only retains the information framework of the original text, but also integrates the semantic features of the question-answer pair, achieving a semantic enhancement effect.

[0106] Through the above steps, the semantic expressiveness of long texts can be effectively enhanced, the integration of text information can be improved, and richer and more accurate semantic support can be provided for application scenarios such as intelligent question answering and text generation.

[0107] Furthermore, the steps of determining the position information of the semantic keywords in the original text and replacing the text semantic features in the original text feature set with the question-answer pair semantic features according to the position information to obtain a new text feature set specifically include:

[0108] Vectorize the original text feature set to obtain the original text feature matrix;

[0109] Vectorize the text semantic features and question-answer pair semantic features respectively to obtain the text semantic feature vector and question-answer pair semantic feature vector;

[0110] Identify the position information of the text semantic feature vector in the original text feature matrix to obtain the position information of the semantic keywords in the original text;

[0111] According to the position information, the question-answer pair semantic feature vector is used to replace the text semantic feature vector in the original text feature matrix to obtain a new text feature matrix;

[0112] Generate a new text feature set based on the new text feature matrix.

[0113] In this embodiment, the original text feature set is first vectorized to convert the semantic features in the text into a structured feature matrix so that the semantic content of the text is embedded in an operable vector space. On this basis, the text semantic features and the question-answer pair semantic features are respectively vectorized to generate corresponding semantic feature vectors so that the semantic information of both can be expressed and processed in vector form. Then, by locating the position of the text semantic feature vector in the original feature matrix, the specific position of the semantic keyword in the text feature matrix can be determined. Subsequently, based on this position information, the question-answer pair semantic feature vector replaces the corresponding vector in the text feature matrix so that the semantic content of the question-answer pair is injected into the semantic structure of the original text, generating a new text feature matrix containing enhanced semantics. Finally, the updated text feature set is generated by decoding the new feature matrix to ensure that the semantic features of the question-answer pair are effectively integrated while maintaining the original text structure.

[0114] Through the above steps, the integration of text content and semantic features of question and answer can be significantly improved, thereby providing more accurate and rich semantic expressions for applications such as text generation and semantic retrieval.

[0115] Furthermore, the steps of combining the initial long text and question-answer pairs to construct a long text question-answering dataset include:

[0116] Obtain a new text feature matrix and a question-answer pair semantic feature vector, and perform feature association on the new text feature matrix and the question-answer pair semantic feature vector;

[0117] Based on the feature association results, the new text feature matrix and question-answer pair semantic feature vector are labeled to generate feature association labels.

[0118] Combine feature association labels, new text feature matrix, question-answer pair semantic feature vectors, initial long text and question-answer pairs to construct a long text question answering dataset.

[0119] In this embodiment, a new text feature matrix and question-answer pair semantic feature vector are first obtained. Through the feature association step, the new text feature matrix and question-answer pair semantic feature vector are associated to build a feature connection between the two, and a semantic mapping relationship between the text and the question-answer pair is established, so that the question-answer pair information can be accurately mapped to the text semantics. Then, based on the results of the feature association, the new text feature matrix and question-answer pair semantic feature vector are feature labeled, that is, a unique label is generated for each associated feature. The generated feature association label can effectively identify the correspondence between the text content and the question-answer pair semantic features, ensuring the semantic connection between different features. Then, the generated feature association label is combined with the new text feature matrix, the question-answer pair semantic feature vector, the initial long text and the original question-answer pair to construct a complete long text question-answer dataset. This dataset not only contains the original information of the text and the question-answer pair, but also introduces feature association labels and updated semantic features, thereby greatly enhancing the semantic structure and information relevance of the dataset, making it more suitable for various natural language processing tasks such as text generation and semantic matching.

[0120] Through the above steps, the semantic coupling between long texts and question-answer pairs can be effectively improved, providing high-quality semantic data support for tasks such as multi-level semantic understanding and text generation.

[0121] Furthermore, the long text question-answering dataset is used to train the preset second largest language model for long text generation, and the steps of obtaining the long text generation model specifically include:

[0122] Based on the feature association labels, the new text feature matrix and the question-answer pair semantic feature vector, the second language model is used for feature learning;

[0123] During feature learning, the second largest language model outputs a predicted long text and a predicted question-answer pair that matches the predicted long text.

[0124] The second largest language model is iteratively updated by combining the predicted long text, predicted question-answer pairs, initial long text, and question-answer pairs until the model is fitted to obtain a long text generation model.

[0125] In this embodiment, a second language model is used to perform feature learning, using feature association labels, a new text feature matrix, and question-answer pair semantic feature vectors as input. This allows the model to more deeply understand and generate the semantic relationship between text and question-answer pairs. During the feature learning process, the second language model continuously optimizes its output based on the input features, generating predicted long texts and their matching predicted question-answer pairs. The predicted long texts and question-answer pairs output by the model not only retain the structure and content framework of the original text but also incorporate the semantic features of the question-answer pairs, making the generated text more semantically rich and contextually appropriate. During this process, the second language model is iteratively updated multiple times, combining the predicted long texts and question-answer pairs with the original long texts and question-answer pairs, until model training reaches stability and optimal fit. This iterative process helps the model continuously optimize its semantic generation capabilities and gradually adjusts the quality of the generated text, enabling the model to accurately reproduce or generate long text content with high semantic consistency. Ultimately, after multiple optimizations and updates, a language model specifically designed for long text generation is obtained, which has highly accurate semantic matching capabilities and high-quality text generation results.

[0126] Through the above steps, the model's semantic understanding and generation accuracy in long text generation tasks can be effectively improved, providing powerful model support for applications such as long text generation and content expansion.

[0127] Furthermore, the second language model is configured with a first loss function and a second loss function, and the second language model is iteratively updated by combining the predicted long text, the predicted question-answer pair, the initial long text, and the question-answer pair until the model is fitted, thereby obtaining a long text generation model. Specifically, the steps include:

[0128] Based on the predicted long text and the initial long text, a first prediction loss is calculated using a first loss function;

[0129] Calculating a second prediction loss using a second loss function based on the predicted question-answer pair and the question-answer pair;

[0130] Based on the back-propagation algorithm, the second largest language model is iteratively updated using the first prediction loss and the second prediction loss until the model is fitted, thereby obtaining a long text generation model.

[0131] In this embodiment, the second language model is configured with two loss functions: the first loss function is used to evaluate the difference between the predicted long text and the original long text, and the second loss function is used to evaluate the difference between the predicted question-answer pairs and the actual question-answer pairs. During model training, the first loss function is used to calculate the similarity between the predicted long text and the original long text, thereby obtaining the first prediction loss. This loss reflects the semantic and structural differences between the long text generated by the model and the original long text. Next, the second loss function is used to calculate the similarity between the predicted question-answer pairs and the actual question-answer pairs, thereby obtaining the second prediction loss to evaluate the model's generation performance for the question-answer pairs. Then, through the backpropagation algorithm, the first and second prediction losses are fed back into the model, and the model parameters are adjusted based on these two loss values. In this way, the model continuously optimizes its generation performance for long texts and question-answer pairs. After multiple rounds of iterative updates, the loss value is gradually reduced until the model reaches the optimal fit. Ultimately, the trained long text generation model not only generates long text content that meets semantic requirements, but also ensures the semantic consistency and correctness of the question-answer pairs in the generated long text.

[0132] Through the above steps, the semantic accuracy and consistency of generated long texts can be improved, making the content generated by the model more fluent and relevant, and providing high-precision semantic generation capabilities for application scenarios such as text generation and question-answering systems.

[0133] In the above embodiment, the present application discloses a long text information processing method, which belongs to the field of artificial intelligence technology. The present application ensures that the key information of the original text can be better captured when long text is generated by utilizing semantic recognition and question-answer generation technology. First, the semantic features of the text are obtained through semantic recognition, and relevant question-answer pairs are generated with the help of a pre-trained first language model, and the question-answer pairs are embedded in the original text to construct an initial long text structure containing questions and answers. This not only increases the semantic density of the text, but also makes the key information clearer during the generation process. In addition, by training the second language model based on the long text question-answer dataset, the model's information retention ability in long text generation is improved, and the risk of loss of intermediate information is reduced, thereby improving the accuracy and completeness of the generated text.

[0134] In this embodiment, the long text information processing method is executed on the electronic device (eg Figure 1 The server shown in the figure) can receive instructions or obtain data through a wired connection or a wireless connection. It should be noted that the above-mentioned wireless connection method may include but is not limited to 3G / 4G connection, WiFi connection, Bluetooth connection, WiMAX connection, Zigbee connection, UWB (ultra wideband) connection, and other wireless connection methods currently known or to be developed in the future.

[0135] It should be emphasized that in order to further ensure the privacy and security of the above-mentioned text information to be processed, the above-mentioned text information to be processed can also be stored in a node of a blockchain.

[0136] The blockchain referred to in this application is a new application model for computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanisms, and encryption algorithms. Blockchain is essentially a decentralized database, a series of data blocks generated using cryptographic methods. Each data block contains information about a batch of network transactions, which is used to verify the validity of this information (to prevent counterfeiting) and generate the next block. Blockchain can include the underlying blockchain platform, the platform product service layer, and the application service layer.

[0137] The embodiments of the present application can acquire and process relevant data based on artificial intelligence technology. Artificial Intelligence (AI) is the theory, method, technology, and application system that uses digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use knowledge to achieve optimal results.

[0138] Fundamental AI technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing, operating / interaction systems, and mechatronics. AI software technologies primarily encompass computer vision, robotics, biometrics, speech processing, natural language processing, and machine learning / deep learning.

[0139] Those skilled in the art will appreciate that all or part of the processes in the above-described method embodiments can be implemented by instructing related hardware via computer-readable instructions. The computer-readable instructions can be stored in a computer-readable storage medium, and when the program is executed, it can include the processes in the above-described method embodiments. The aforementioned storage medium can be a non-volatile storage medium such as a magnetic disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM).

[0140] It should be understood that although the steps in the flowcharts of the accompanying drawings are shown in sequence as indicated by the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some of the steps in the flowcharts of the accompanying drawings may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and their execution order is not necessarily sequential, but can be executed in turn or alternately with other steps or at least a portion of the sub-steps or stages of other steps.

[0141] Further references Figure 3 , as a response to the above Figure 2 The present application provides an embodiment of a long text information processing device. Figure 2 Corresponding to the method embodiment shown, the device can be specifically applied to various electronic devices.

[0142] like Figure 3 As shown, the long text information processing device 300 described in this embodiment includes:

[0143] Semantic recognition module 301 is used to obtain original text from a preset corpus and perform semantic recognition on the original text to obtain text semantic features;

[0144] A question-answer pair generation module 302 is configured to generate question-answer pairs related to the original text using a pre-trained first language model based on text semantic features;

[0145] A text combination module 303 is used to determine the embedding position of the question-answer pair in the original text, and to combine the original text and the question-answer pair based on the embedding position to generate an initial long text;

[0146] A dataset construction module 304 is used to combine the initial long text and question-answer pairs to construct a long text question-answer dataset;

[0147] A model training module 305 is configured to perform long text generation training on a preset second language model using the long text question-answering dataset to obtain a long text generation model;

[0148] The long text generation module 306 is configured to receive a long text generation instruction, obtain the text to be processed input by the user, input the text to be processed into the long text generation model, and obtain a long text generation result.

[0149] Furthermore, the semantic recognition module 301 is specifically configured to:

[0150] The original text is segmented to obtain several original text segmentations; the original text segmentations are semantically analyzed to obtain semantic analysis results of the original text segmentations; the semantic keywords of the original text are determined based on the semantic analysis results of the original text segmentations; and features are extracted from the semantic keywords to obtain text semantic features.

[0151] Furthermore, the semantic recognition module 301 is further configured to:

[0152] The original text is segmented to obtain several original text segmentations; the original text segmentations are semantically analyzed to obtain semantic analysis results of the original text segmentations; based on the semantic analysis results of the original text segmentations, independent semantic segments contained in the original text are identified; based on the semantic analysis results of the original text segmentations, semantic keywords corresponding to each independent semantic segment are determined; features are extracted for the semantic keywords corresponding to each independent semantic segment to obtain text semantic features corresponding to each independent semantic segment.

[0153] Furthermore, the text combination module 303 is specifically used to:

[0154] The original text after word segmentation is feature encoded to obtain the original text feature set; semantic recognition is performed on the question-answer pair to obtain the semantic features of the question-answer pair; the position information of the semantic keywords in the original text is determined, and the text semantic features in the original text feature set are replaced with the semantic features of the question-answer pair based on the position information to obtain a new text feature set; the new text feature set is feature decoded to obtain the initial long text.

[0155] Furthermore, the text combination module 303 is further configured to:

[0156] The original text feature set is vectorized to obtain the original text feature matrix; the text semantic features and question-answer pair semantic features are vectorized respectively to obtain text semantic feature vectors and question-answer pair semantic feature vectors; the position information of the text semantic feature vectors in the original text feature matrix is ​​identified to obtain the position information of the semantic keywords in the original text; based on the position information, the text semantic feature vectors in the original text feature matrix are replaced with the question-answer pair semantic feature vectors to obtain a new text feature matrix; and a new text feature set is generated based on the new text feature matrix.

[0157] Furthermore, the data set construction module 304 is specifically configured to:

[0158] Obtain a new text feature matrix and question-answer pair semantic feature vectors, and perform feature association on the new text feature matrix and question-answer pair semantic feature vectors; perform feature annotation on the new text feature matrix and question-answer pair semantic feature vectors according to the feature association results to generate feature association labels; combine the feature association labels, the new text feature matrix, the question-answer pair semantic feature vectors, the initial long text and the question-answer pair to construct a long text question-answer dataset.

[0159] Furthermore, the model training module 305 is specifically used to:

[0160] Based on feature association labels, a new text feature matrix, and semantic feature vectors of question-answer pairs, a second-largest language model is used for feature learning. During the feature learning process, the second-largest language model outputs a predicted long text and a predicted question-answer pair that matches the predicted long text. The second-largest language model is iteratively updated based on the predicted long text, predicted question-answer pair, initial long text, and question-answer pair until the model is fitted, thereby obtaining a long text generation model.

[0161] Furthermore, the second largest language model is configured with a first loss function and a second loss function, and the model training module 305 is further configured to:

[0162] Based on the predicted long text and the initial long text, the first prediction loss is calculated using the first loss function; based on the predicted question-answer pair and the question-answer pair, the second prediction loss is calculated using the second loss function; based on the back propagation algorithm, the second largest language model is iteratively updated using the first prediction loss and the second prediction loss until the model is fitted, thereby obtaining a long text generation model.

[0163] In the above embodiment, the present application discloses a long text information processing device, which belongs to the field of artificial intelligence technology. The present application ensures that the key information of the original text can be better captured when generating long texts by utilizing semantic recognition and question-answer generation technology. First, the semantic features of the text are obtained through semantic recognition, and relevant question-answer pairs are generated with the help of a pre-trained first language model. The question-answer pairs are embedded in the original text to construct an initial long text structure containing questions and answers, which not only increases the semantic density of the text, but also makes the key information clearer during the generation process. In addition, by training the second language model based on the long text question-answer dataset, the model's information retention ability in long text generation is improved, and the risk of loss of intermediate information is reduced, thereby improving the accuracy and completeness of the generated text.

[0164] To solve the above technical problems, the present application also provides a computer device. Figure 4 , Figure 4 This is a basic structural block diagram of the computer device in this embodiment.

[0165] The computer device 4 includes a memory 41, a processor 42, and a network interface 43 that are interconnected through a system bus. It should be noted that the figure only shows a computer device 4 with a memory 41, a processor 42, and a network interface 43, but it should be understood that it is not required to implement all the components shown, and more or fewer components can be implemented instead. Among them, those skilled in the art can understand that the computer device here is a device that can automatically perform numerical calculations and / or information processing according to pre-set or stored instructions, and its hardware includes but is not limited to a microprocessor, an application specific integrated circuit (ASIC), a field-programmable gate array (FPGA), a digital signal processor (DSP), an embedded device, etc.

[0166] The computer device may be a desktop computer, notebook computer, PDA, cloud server, etc. The computer device may interact with the user via a keyboard, mouse, remote control, touchpad, or voice control device.

[0167] The memory 41 includes at least one type of readable storage medium, including flash memory, hard disk, multimedia card, card-type memory (e.g., SD or DX memory), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, magnetic disk, optical disk, etc. In some embodiments, the memory 41 can be an internal storage unit of the computer device 4, such as the hard disk or memory of the computer device 4. In other embodiments, the memory 41 can also be an external storage device of the computer device 4, such as a plug-in hard disk equipped on the computer device 4, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. Of course, the memory 41 can also include both the internal storage unit of the computer device 4 and its external storage device. In this embodiment, the memory 41 is generally used to store the operating system and various application software installed on the computer device 4, such as computer-readable instructions for a long text information processing method. In addition, the memory 41 can also be used to temporarily store various types of data that have been output or are to be output.

[0168] In some embodiments, the processor 42 may be a central processing unit (CPU), a controller, a microcontroller, a microprocessor, or other data processing chip. The processor 42 is generally used to control the overall operation of the computer device 4. In this embodiment, the processor 42 is used to execute computer-readable instructions stored in the memory 41 or process data, such as executing computer-readable instructions for the long text information processing method.

[0169] The network interface 43 may include a wireless network interface or a wired network interface. The network interface 43 is generally used to establish a communication connection between the computer device 4 and other electronic devices.

[0170] In the above embodiment, the present application discloses a computer device, which belongs to the field of artificial intelligence technology. The present application ensures that the key information of the original text can be better captured when long text is generated by utilizing semantic recognition and question-answer generation technology. First, the semantic features of the text are obtained through semantic recognition, and relevant question-answer pairs are generated with the help of a pre-trained first language model. The question-answer pairs are embedded in the original text to construct an initial long text structure containing questions and answers, which not only increases the semantic density of the text, but also makes the key information clearer during the generation process. In addition, by training the second language model based on the long text question-answer dataset, the model's information retention ability in long text generation is improved, and the risk of loss of intermediate information is reduced, thereby improving the accuracy and completeness of the generated text.

[0171] The present application also provides another embodiment, namely, providing a computer-readable storage medium, wherein the computer-readable storage medium stores computer-readable instructions, and the computer-readable instructions can be executed by at least one processor to enable the at least one processor to perform the steps of the long text information processing method as described above.

[0172] In the above embodiment, the present application discloses a computer-readable storage medium, which belongs to the field of artificial intelligence technology. The present application ensures that the key information of the original text can be better captured when long text is generated by utilizing semantic recognition and question-answer generation technology. First, the semantic features of the text are obtained through semantic recognition, and relevant question-answer pairs are generated with the help of a pre-trained first language model. The question-answer pairs are embedded in the original text to construct an initial long text structure containing questions and answers, which not only increases the semantic density of the text, but also makes the key information clearer during the generation process. In addition, by training the second language model based on the long text question-answer dataset, the model's information retention ability in long text generation is improved, and the risk of loss of intermediate information is reduced, thereby improving the accuracy and completeness of the generated text.

[0173] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus the necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for enabling a terminal device (which can be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in each embodiment of the present application.

[0174] The present application can be used in many general or special computer system environments or configurations. For example: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronic devices, network PCs, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, etc. The present application can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. The present application can also be practiced in distributed computing environments, in which tasks are performed by remote processing devices connected via a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media, including storage devices.

[0175] Obviously, the embodiments described above are only some of the embodiments of the present application, rather than all of the embodiments. The preferred embodiments of the present application are given in the accompanying drawings, but they do not limit the patent scope of the present application. The present application can be implemented in many different forms. On the contrary, the purpose of providing these embodiments is to make the understanding of the disclosure of the present application more thorough and comprehensive. Although the present application has been described in detail with reference to the aforementioned embodiments, for those skilled in the art, it is still possible to modify the technical solutions described in the aforementioned specific embodiments, or to make equivalent replacements for some of the technical features therein. Any equivalent structure made using the contents of the present application specification and the accompanying drawings, directly or indirectly used in other related technical fields, is also within the scope of patent protection of the present application.

Claims

1. A method for processing long text information, characterized in that: include: Obtaining original text from a preset corpus, and performing semantic recognition on the original text to obtain text semantic features; Based on the semantic features of the text, using a pre-trained first language model to generate question-answer pairs related to the original text; Determining an embedding position of the question-answer pair in the original text, and performing text combination on the original text and the question-answer pair based on the embedding position to generate an initial long text; Combining the initial long text and the question-answer pairs to construct a long text question-answer dataset; Using the long text question answering dataset to perform long text generation training on the preset second largest language model to obtain a long text generation model; Receive a long text generation instruction, obtain a text to be processed input by a user, input the text to be processed into the long text generation model, and obtain a long text generation result; The step of obtaining original text from a preset corpus and performing semantic recognition on the original text to obtain text semantic features specifically includes: Performing word segmentation processing on the original text to obtain a plurality of original text word segments; Performing semantic analysis on the original text segmentation to obtain semantic analysis results of the original text segmentation; Determining semantic keywords of the original text according to the semantic analysis results of the original text segmentation; Extracting features of the semantic keywords to obtain the text semantic features; The step of determining the embedding position of the question-answer pair in the original text, and combining the original text and the question-answer pair based on the embedding position to generate an initial long text specifically includes: Performing feature encoding on the original text after word segmentation processing to obtain an original text feature set; Performing semantic recognition on the question-answer pair to obtain semantic features of the question-answer pair; Determining position information of the semantic keyword in the original text, and replacing the text semantic features in the original text feature set with the question-answer pair semantic features according to the position information to obtain a new text feature set; Feature decoding is performed on the new text feature set to obtain the initial long text.

2. The long text information processing method according to claim 1, characterized in that: The step of determining the position information of the semantic keywords in the original text and replacing the text semantic features in the original text feature set with the question-answer pair semantic features according to the position information to obtain a new text feature set specifically includes: Performing vectorization processing on the original text feature set to obtain an original text feature matrix; Performing vectorization processing on the text semantic features and the question-answer pair semantic features respectively to obtain a text semantic feature vector and a question-answer pair semantic feature vector; Identifying position information of the text semantic feature vector in the original text feature matrix to obtain position information of the semantic keyword in the original text; According to the position information, using the question-answer pair semantic feature vector to replace the text semantic feature vector in the original text feature matrix to obtain a new text feature matrix; The new text feature set is generated based on the new text feature matrix.

3. The long text information processing method according to claim 2, characterized in that: The step of combining the initial long text and the question-answer pairs to construct a long text question-answer dataset specifically includes: Acquire the new text feature matrix and the question-answer pair semantic feature vector, and perform feature association on the new text feature matrix and the question-answer pair semantic feature vector; According to the feature association results, feature annotation is performed on the new text feature matrix and the question-answer pair semantic feature vector to generate feature association labels; The feature association label, the new text feature matrix, the question-answer pair semantic feature vector, the initial long text and the question-answer pair are combined to construct the long text question-answer dataset.

4. The long text information processing method according to claim 3, characterized in that: The steps of using the long text question-answering dataset to perform long text generation training on the preset second largest language model to obtain the long text generation model specifically include: Performing feature learning using the second language model based on the feature association label, the new text feature matrix, and the question-answer pair semantic feature vector; During the feature learning process, the second largest language model outputs a predicted long text and a predicted question-answer pair matching the predicted long text; The second largest language model is iteratively updated by combining the predicted long text, the predicted question-answer pair, the initial long text, and the question-answer pair until the model is fitted, thereby obtaining the long text generation model.

5. The long text information processing method according to claim 4, characterized in that: The second largest language model is configured with a first loss function and a second loss function, and the step of iteratively updating the second largest language model by combining the predicted long text, the predicted question-answer pair, the initial long text, and the question-answer pair until the model is fitted to obtain the long text generation model specifically includes: Calculating a first prediction loss using the first loss function based on the predicted long text and the initial long text; Calculating a second prediction loss using the second loss function based on the predicted question-answer pair and the question-answer pair; Based on a back-propagation algorithm, the second large language model is iteratively updated using the first prediction loss and the second prediction loss until the model is fitted, thereby obtaining the long text generation model.

6. A long text information processing device, characterized in that: The long text information processing device implements the steps of the long text information processing method according to any one of claims 1 to 5, and the long text information processing device includes: A semantic recognition module is used to obtain original text from a preset corpus and perform semantic recognition on the original text to obtain text semantic features; A question-answer pair generation module, configured to generate question-answer pairs related to the original text using a pre-trained first language model based on the semantic features of the text; a text combination module, configured to determine an embedding position of the question-answer pair in the original text, and perform text combination on the original text and the question-answer pair based on the embedding position to generate an initial long text; A dataset construction module, configured to combine the initial long text and the question-answer pairs to construct a long text question-answer dataset; A model training module is used to use the long text question-answering dataset to perform long text generation training on a preset second language model to obtain a long text generation model; The long text generation module is used to receive a long text generation instruction, obtain the text to be processed input by the user, input the text to be processed into the long text generation model, and obtain a long text generation result.

7. A computer device, characterized in that: The method comprises a memory and a processor, wherein the memory stores computer-readable instructions, and the processor implements the steps of the long text information processing method according to any one of claims 1 to 5 when executing the computer-readable instructions.

8. A computer-readable storage medium, characterized in that The computer-readable storage medium stores computer-readable instructions, which, when executed by a processor, implement the steps of the long text information processing method according to any one of claims 1 to 5.

Citation Information

Patent Citations

  • Answer selection method and system based on semantic union

    CN113342950A

  • Text processing method and device, computer equipment and computer readable storage medium

    CN113569001A