Long text information processing method and device, computer equipment and storage medium

Through semantic recognition and question-answer generation technology, the Q&A pair is embedded into the original text and the language model is specially trained to generate long texts, which solves the problem of intermediate information loss in the processing of long texts by large language models, and significantly improves the accuracy and completeness of generated texts.

CN119670764AActive Publication Date: 2025-03-21PING AN TECH (SHENZHEN) CO LTD

Patent Information

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

AI Technical Summary

Technical Problem

Existing large language models are prone to loss of intermediate information when processing long texts, resulting in deviations or incomplete understanding and processing of the overall content.

Method used

Obtain the semantic features of the text through semantic recognition, use the pre-trained first language model to generate Q&A pairs related to the original text, and embed the Q&A pairs into the original text to build an initial long text structure containing Q&A. Then, the second largest language model is trained using a long text question and answer dataset to improve the model's information retention ability in long text generation.

Benefits of technology

It effectively reduces the risk of loss of intermediate information, improves the accuracy and completeness of generated text, and makes the results of long text generation more accurate and comprehensive.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119670764A_ABST
    Figure CN119670764A_ABST
Patent Text Reader

Abstract

The invention 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 method comprises the following steps: performing semantic recognition on an original text to obtain text semantic features; based on the text semantic features, using a large language model to generate question and answer pairs related to the original text; determining an embedding position of the question and answer pair in the original text, and performing text combination on the original text and the question and answer pair based on the embedding position to generate an initial long text; combining the initial long text and the question-answer pair to construct a long text question-answer data set; performing long text generation training on the large language model by using the long text question and answer data set to obtain a long text generation model; and obtaining a to-be-processed text input by a user, and using the long text generation model to obtain a long text generation result. The invention further relates to the technical field of block chains, and the to-be-processed text is stored in a block chain network. According to the method, the loss risk of intermediate information is reduced, and the accuracy and integrity of the generated text are improved.
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 long text information processing method, device, computer equipment and storage medium. Background Art

[0002] Nowadays, the training text windows of many large language models have been expanded to tens of thousands of tokens, allowing these models to handle 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 find it difficult 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 deviations or incomplete understanding and processing of the overall content. In other words, current large language models generally have the problem of intermediate information loss. This is because there is not enough explicit supervision in the context training of long texts, and there is no emphasis on the fact that any position in the long context can accommodate key information. Therefore, how to make the large language model generated by long texts fully utilize the key information in the middle of the text to solve the problem of intermediate information loss in large language models has become an urgent research issue.

[0003] In response to the problem of intermediate loss, current research focuses on improving the model architecture, that is, designing a neural network architecture that is more suitable for processing long texts, or hierarchical processing, that is, breaking down long texts into multiple levels or paragraphs, processing and analyzing them separately, and then synthesizing the results of each part. However, these methods still have limitations. For example, improving the model architecture may increase computational complexity and training costs, and may not fundamentally solve the problem of information loss in all long texts; and although hierarchical processing can alleviate some pressure, it may introduce new errors in the synthesis stage, 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 a large language model when generating long texts from a data level, so as to improve the accuracy and completeness of the long texts.

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

[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 for 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 the original text from a preset corpus and performing semantic recognition on the original text to obtain the semantic features of the text 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 according to the semantic analysis results of the original text segmentation;

[0017] Feature extraction is performed on semantic keywords to obtain text semantic features.

[0018] Furthermore, 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 the initial long text specifically includes:

[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 position 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 according to the position 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] Further, 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:

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

[0025] Vectorize 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;

[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 semantic feature vector of the question-answer pair 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 specifically 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] 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;

[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 perform long text generation training on the preset second largest language model to obtain the long text generation model, specifically including:

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

[0035] During the feature learning process, the second largest language model outputs the predicted long text and the predicted question-answer pair matching 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 largest language model is configured with a first loss function and a second loss function, and 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 to obtain the long text generation model, specifically including:

[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 language model;

[0045] A text combination module 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;

[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] A model training module is used to use a 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;

[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 comprises 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, and when the computer-readable instructions are executed by a processor, the steps of any of the long text information processing methods described above are implemented.

[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 the 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 the 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, 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 largest language model based on the long text question-answer data set, the information retention ability of the model in the 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 scheme in the present application, a brief introduction is given below to the drawings required for use in the description of the embodiments of the present application. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0056] Figure 1 An exemplary system architecture diagram is shown in which the present application can be applied;

[0057] Figure 2 A flowchart of an embodiment of a long text information processing method 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 meaning as those commonly understood by technicians in the technical field of the present application; the terms used in the specification of the application herein are only for the purpose of describing specific embodiments and are not intended to limit the present application; the terms "including" and "having" and any variations thereof in the specification and claims of the present application and the above-mentioned drawings are intended to cover non-exclusive inclusions. The terms "first", "second", etc. in the specification and claims of the present application or the above-mentioned drawings are used to distinguish different objects, not to describe a specific order.

[0061] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood 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, the system architecture 100 may include a terminal device 101, a network 102 and a server 103. The terminal device 101 may be a laptop 1011, a tablet computer 1012 or a mobile phone 1013. The network 102 is used to provide a medium for a communication link between the terminal device 101 and the server 103. The network 102 may include various connection types, such as wired, wireless communication links or optical fiber cables.

[0064] The user can use the terminal device 101 to interact with the server 103 through 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 any electronic device with a display screen and supporting web browsing. In addition to a laptop computer 1011, a tablet computer 1012 or a 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), a laptop computer, 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 a web page 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 comprises 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, which is a collection of texts that has been screened and organized, containing rich language 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, where 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 better captures 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-answer pairs based on the semantic features of the text obtained in the previous step using the pre-trained first language model. The question-answer generation process mainly relies on the recognition results of semantic features to ensure that the generated question-answer content is closely related to the original text and can cover the key information in the original text. The generation of question-answer pairs has multiple uses in language understanding tasks. It can not only help the model better understand the semantic structure of the content, but also clarify the main information points in the text through questions and answers. When generating question-answer pairs, deep learning-based models such as GPT or T5 models are usually used. These models have mastered a large amount of question-answer knowledge during training and can generate logical question-answer content based on given semantic features. The generated questions and answers can further enrich the expression level of text semantics. In addition, question-answer pairs also help improve the information completeness of the model when generating long texts, ensuring that important information in the original text can be reflected in the generated long text, thereby effectively avoiding information omissions and semantic distortion.

[0074] S203, 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.

[0075] Furthermore, this step mainly involves the determination of the embedding position of the question-answer pair and the text combination. After obtaining the question-answer pair related to the original text, the system needs to reasonably select the best position for inserting the question-answer pair in the text. Usually, this position should be able to connect coherently 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 according to the logical structure of the context. For example, inserting questions and answers at the end of each chapter or paragraph so that readers can review the key points after reading, or adding question-answer pairs after some content that needs further explanation and deepening, so as to enhance understanding. After determining the embedding position, the system combines the original text and the question-answer pair to generate a preliminary long text. The combination process is not only 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 to improve the integrity of the text structure. By reasonably embedding the question-answer pair, the content of the long text is more layered and the semantic expression is clearer.

[0076] S204, combining the initial long text and the question-answer pair 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, which contains a large number of long text samples embedded with question-answer pairs, and can provide high-quality corpus support for model training. By systematically grouping the initial long text with the 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 construction process of this dataset requires reviewing the accuracy and logic of the question-answer pairs to ensure that each question-answer pair is reasonably embedded in the appropriate position. 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 the user's needs for the completeness of long text information.

[0078] S205, 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.

[0079] Furthermore, at this stage, based on the constructed long text question and answer dataset, the preset second largest language model is specially trained for long text generation. The goal of this training process is to enhance the performance of the model in the long text generation task, so that it can not only generate coherent text, but also reduce information loss when generating long text. Long text generation training mainly uses the question and answer pairs and text structure in the dataset to let the model learn to maintain information density when generating content, while effectively integrating question and answer information, so as to more accurately reproduce key content and logical relationships when generating. During the training process, the model will continue to learn how to embed question and answer pairs into the generated text, improve the model's contextual understanding and long paragraph structure processing capabilities, and 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 situations.

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

[0081] Furthermore, the system receives the user's long text generation instruction, 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 achieve the coherence and semantic integrity of the content in the process. The model parses the user's specific needs according to the instruction, such as the detail of the information, the expression of logical relationships, etc., and then uses the text to be processed as the 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 embodiments, 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 the 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, 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 data set, the model's ability to retain information 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.

[0083] Furthermore, the steps of obtaining the original text from a preset corpus and performing semantic recognition on the original text to obtain the semantic features of the text 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 according to the semantic analysis results of the original text segmentation;

[0087] Feature extraction is performed on semantic keywords to obtain text semantic features.

[0088] In this embodiment, the original text is first segmented by word to obtain several 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, according to the semantic analysis results of the segmented words, the 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 the semantic feature representation of the text. In this process, the system applies deep learning models and natural language processing technology, so that the text semantic features can more accurately express the core meaning of the original text.

[0089] For example, in the application of the property insurance customer service robot, the system first obtains the original text from the user's description, such as "My car hit the guardrail on a rainy day, what should I do?" Then the system performs word segmentation on the text and generates word segmentation results, such as "car", "rainy day", "hit", "guardrail", etc. Then, the system performs semantic analysis on these word segments, identifying "car" as the accident object, "rainy day" represents environmental factors, "hit" is an event verb, "guardrail" is a collision object, etc. Based on the semantic analysis results, core keywords are extracted, such as "accident vehicle", "rainy day accident", "collision handling", etc., and semantic features are further generated for each keyword to facilitate the model to understand the core of the user's problem. Such semantic features can help the robot generate more accurate answers, such as suggesting that users report the incident or contact rescue services, thereby improving the accuracy of customer service responses and service efficiency.

[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 the original text from a preset corpus and performing semantic recognition on the original text to obtain the semantic features of the text 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 firstly processed by word segmentation, so that the text content is decomposed into several smaller independent semantic fragments, which are convenient for semantic analysis and processing. On the basis of word segmentation, semantic analysis is performed on each word segmentation result, so as to obtain the semantic information represented by each word segmentation, and these semantic information further constitute the semantic analysis result of the original text. Based on the semantic analysis result, semantic fragments 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 fragment to better express the core content of the fragment. For each semantic keyword, its text semantic features are extracted by 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, each segmentation is semantically analyzed to parse the role and meaning of the segmentation, 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 fragments contained in the text, such as "driving in the rain", "guardrail collision", and "vehicle damage". Then, the corresponding semantic keywords are extracted for each semantic fragment, and these keywords are feature extracted and converted into a semantic feature matrix. This method breaks down complex text into multiple semantic fragments and features the core semantic keywords of each fragment, 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 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 the initial long text specifically includes:

[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 position 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 according to the position 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, feature encoding is first performed on the original text after word segmentation processing 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 to extract the core semantic features contained in the question-answer pair 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 and answer and text generation.

[0107] Further, 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:

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

[0109] Vectorize 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;

[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 semantic feature vector of the question-answer pair 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, and the semantic features in the text are converted into a structured feature matrix to embed the semantic content of the text into 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, and a new text feature matrix containing enhanced semantics is generated. 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 degree 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 specifically 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] 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;

[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 a question-answer pair semantic feature vector are first obtained, and the new text feature matrix is ​​associated with the question-answer pair semantic feature vector through a feature association step to construct 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, according to the result of feature association, the new text feature matrix and the question-answer pair semantic feature vector are feature labeled, that is, a unique label is generated for each associated feature, and the generated feature association label can effectively identify the corresponding relationship between the text content and the question-answer pair semantic feature, 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 data set. This data set 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 data set, making it more suitable for various natural language processing tasks, such as text generation, semantic matching, etc.

[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 perform long text generation training on the preset second largest language model to obtain the long text generation model, specifically including:

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

[0123] During the feature learning process, the second largest language model outputs the predicted long text and the predicted question-answer pair matching 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, feature learning is performed using the second largest language model through feature association labels, a new text feature matrix, and a question-answer pair semantic feature vector as input, so that the model can more deeply understand and generate the semantic relationship between the text and the question-answer pair. In the feature learning process, the second largest language model continuously optimizes the output based on the input features to generate the predicted long text and its matching predicted question-answer pair. The predicted long text and question-answer pair 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 pair, so that the generated text is more semantically rich and in line with the context. In this process, the second largest language model is updated for multiple rounds of iterations in combination with the predicted long text and question-answer pair, as well as the original long text and question-answer pair, until the model training reaches stability and the best fitting effect. This iterative process helps the model continuously optimize its semantic generation ability, gradually adjusts the quality of the generated text, and enables the model to accurately reproduce or generate long text content with high semantic consistency. Finally, after multiple optimizations and updates, a language model specifically used to generate long text is obtained, which has highly accurate semantic matching capabilities and high-quality text generation effects.

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

[0127] Furthermore, the second largest language model is configured with a first loss function and a second loss function, and 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 to obtain the long text generation model, specifically including:

[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 largest 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 initial long text, and the second loss function is used to evaluate the difference between the predicted question-answer pair and the real question-answer pair. During the model training process, the similarity between the predicted long text and the initial long text is first calculated based on the first loss function, thereby obtaining the first prediction loss, which reflects the semantic and structural differences between the long text generated by the model and the original long text. Then, the similarity between the predicted question-answer pair and the real question-answer pair is calculated using the second loss function to obtain the second prediction loss to evaluate the generation effect of the model on the question-answer pair. Then, through the back propagation algorithm, the first prediction loss and the second prediction loss are fed back to the model, and the model parameters are adjusted according to the two loss values. In this way, the model continuously optimizes its generation effect on long texts and question-answer pairs, and after multiple rounds of iterative updates, the loss value is gradually reduced until the model reaches the best fit state. Finally, the trained long text generation model can not only generate long text content that meets semantic requirements, but also ensure the semantic consistency and correctness of the question-answer pair content 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, 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 the 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 the 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, 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 largest language model based on the long text question-answer data set, 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 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 of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanism, encryption algorithm, etc. Blockchain is essentially a decentralized database, a string of data blocks generated by cryptographic methods. Each data block contains a batch of network transaction information, which is used to verify the validity of its information (anti-counterfeiting) and generate the next block. Blockchain can include the underlying blockchain platform, platform product service layer, and application service layer.

[0137] The embodiments of the present application can acquire and process relevant data based on artificial intelligence technology. Among them, 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 obtain the best results.

[0138] AI basic technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing technology, operation / interaction systems, mechatronics, etc. AI software technologies mainly include computer vision technology, robotics technology, biometrics technology, speech processing technology, natural language processing technology, and machine learning / deep learning.

[0139] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through computer-readable instructions, and the computer-readable instructions can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, the aforementioned storage medium can be a non-volatile storage medium such as a 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 flowchart of the accompanying drawings are displayed in sequence as indicated by the arrows, these steps are not necessarily executed in sequence 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 a part of the steps in the flowchart 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 part 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, and the device embodiment is similar to 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] The semantic recognition module 301 is used to obtain the original text from the preset corpus and perform semantic recognition on the original text to obtain the text semantic features;

[0144] A question-answer pair generation module 302 is used 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 data set construction module 304 is used to combine the initial long text and the question-answer pair to construct a long text question-answer data set;

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

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

[0149] Furthermore, the semantic recognition module 301 is specifically used for:

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

[0151] Furthermore, the semantic recognition module 301 is also used for:

[0152] The original text is segmented to obtain several original text segments; semantic analysis is performed on the original text segments to obtain semantic analysis results of the original text segments; independent semantic segments contained in the original text are identified based on the semantic analysis results of the original text segments; semantic keywords corresponding to each independent semantic segment are determined based on the semantic analysis results of the original text segments; 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 for:

[0154] Perform feature encoding on the original text after word segmentation processing to obtain the original text feature set; perform semantic recognition on the question and answer pairs to obtain the semantic features of the question and answer pairs; determine the position information of the semantic keywords in the original text, and use the semantic features of the question and answer pairs to replace the text semantic features in the original text feature set according to the position information to obtain a new text feature set; perform feature decoding on the new text feature set to obtain the initial long text.

[0155] Furthermore, the text combination module 303 is further used for:

[0156] The original text feature set is vectorized to obtain an original text feature matrix; the text semantic features and question-answer pair semantic features are vectorized respectively to obtain a text semantic feature vector and a question-answer pair semantic feature vector; the position information of the text semantic feature vector in the original text feature matrix is ​​identified to obtain the position information of the semantic keywords in the original text; 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; 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 used for:

[0158] 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; perform feature annotation on the new text feature matrix and the question-answer pair semantic feature vector 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 vector, 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 for:

[0160] Based on feature association labels, a new text feature matrix and semantic feature vectors of question-answer pairs, the 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, 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.

[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 used 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 the 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 the 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, 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 largest language model based on the long text question-answer data set, the information retention ability of the model 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 and communicated 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 microprocessors, application specific integrated circuits (Application Specific Integrated Circuit, ASIC), programmable gate arrays (Field-Programmable Gate Array, FPGA), digital processors (Digital Signal Processor, DSP), embedded devices, etc.

[0166] The computer device may be a computing device such as a desktop computer, a notebook, a PDA, a cloud server, etc. The computer device may interact with a user through a keyboard, a mouse, a remote controller, a touch pad, or a voice control device.

[0167] The memory 41 includes at least one type of readable storage medium, and the readable storage medium includes flash memory, hard disk, multimedia card, card-type memory (for example, SD or DX memory, etc.), 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, disk, optical disk, etc. In some embodiments, the memory 41 can be an internal storage unit of the computer device 4, such as a 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, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (FlashCard), etc. equipped on the computer device 4. 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 of a long text information processing method, etc. 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] The processor 42 may be a central processing unit (CPU), a controller, a microcontroller, a microprocessor, or other data processing chips in some embodiments. 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 run the computer-readable instructions stored in the memory 41 or process data, such as running the computer-readable instructions of 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 the 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, 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 largest language model based on the long text question-answer data set, 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 implementation, 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 the 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, 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 largest language model based on the long text question-answer data set, 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 a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an 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 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 through 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 embodiments of the present application, rather than all 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 is described in detail with reference to the aforementioned embodiments, for those skilled in the art, it is still possible to modify the technical solutions recorded in the aforementioned specific implementation methods, or to perform equivalent replacement of some of the technical features therein. Any equivalent structure made using the contents of the specification and drawings of this application, directly or indirectly used in other related technical fields, is similarly within the scope of patent protection of this application.

Claims

1. A long text information processing method, characterized in that: include: Acquire original text from a preset corpus, and perform 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; 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; Combining the initial long text and the question-answer pair to construct a long text question-answer dataset; Using the long text question-answering dataset to perform long text generation training on a preset second largest language model to obtain a long text generation model; A long text generation instruction is received, a text to be processed input by a user is obtained, the text to be processed is input into the long text generation model, and a long text generation result is obtained.

2. The long text information processing method according to claim 1, characterized in that: The step of obtaining the original text from the preset corpus and performing semantic recognition on the original text to obtain the 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; Determine the semantic keywords of the original text according to the semantic analysis result of the original text segmentation; Feature extraction is performed on the semantic keywords to obtain the text semantic features.

3. The long text information processing method according to any one of claim 2, characterized in that: 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; Determine the position information of the semantic keyword in the original text, and replace 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.

4. The long text information processing method according to claim 3, characterized in that: The step of determining the 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 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; Identify the position information of the text semantic feature vector in the original text feature matrix to obtain the 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.

5. The long text information processing method according to claim 4, characterized in that: The step of combining the initial long text and the question-answer pair 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 respectively 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.

6. The long text information processing method according to claim 4, 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: Based on the feature association label, the new text feature matrix and the question-answer pair semantic feature vector, using the second largest language model to perform feature learning; In the process of acquiring the feature learning, 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 in combination with 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.

7. The long text information processing method according to claim 6, 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: Based on the predicted long text and the initial long text, using the first loss function to calculate a first prediction loss; Based on the predicted question-answer pair and the question-answer pair, calculating a second prediction loss using the second loss function; 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.

8. A long text information processing device, characterized in that: include: 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 text semantic features; A text combination module, used to 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; A data set construction module, used to combine the initial long text and the question-answer pair to construct a long text question-answer data set; A model training module, used to use the long text question-answering dataset to perform long text generation training on a preset second largest 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.

9. 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 7 when executing the computer-readable instructions.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-readable instructions, and when the computer-readable instructions are executed by a processor, the steps of the long text information processing method according to any one of claims 1 to 7 are implemented.

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

  • Knowledge graph-based medicine supply chain question-answering method and system

    CN117251543A

  • Question and answer pair generation method and system, electronic equipment and storage medium

    CN117271736A

Cited By

  • Text processing method and system based on semantic density

    CN120235162A

  • A text processing method and system based on semantic density

    CN120235162B

  • Large model optimization method and device, equipment and storage medium

    CN120373404A