A multi-document summarization method based on large language model of NLP technology
Through the large language model multi-document excerpting method based on NLP technology, the problem of large language model input length limitation is solved, automatic summarization of a large number of documents is realized, text processing efficiency and quality are improved, and data security and reliability are ensured. sex.
Patent Information
- Application Number
- CN202410398209.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-03
- Publication Date
- 2024-09-27
- Estimated Expiration
- 2044-04-03
AI Technical Summary
Due to the limitation of input length, existing large language models cannot effectively process and analyze a large number of multiple documents, making it impossible to achieve automatic summary extraction of multiple documents, especially a large number of text structures such as tens of thousands or even billions of documents.
The large language model multi-document excerpting method based on NLP technology is adopted. By storing multiple documents in the database, the review title is obtained and the pre-trained large language model is used to automatically generate review subtitles. It combines keyword matching and topic modeling, and uses vector similarity. The documents are classified and sliced, and finally the large language model and Langchain technology are used to generate the final review text.
It realizes the automatic summarization and refining of a large number of documents, improves the processing efficiency and quality of text data, ensures the security and reliability of data, and supports fast browsing, understanding and management.
Smart Images

Figure CN118350368B
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of text processing, and in particular to a multi-document excerpting method based on a large language model of NLP technology. Background Art
[0002] With the rapid development of the information age, the demand for processing and analyzing government texts in the government field is growing. In addition, some education and teaching fields also need to process some text content, and the demand is gradually increasing. At present, most of the processing and analysis of government texts and text processing and analysis in the field of education and teaching mainly rely on manual processing. In order to improve the processing efficiency and quality of texts, with the development and popularization of large language model applications, some text intelligent assistant software has emerged, which can automatically realize some document excerpts, reduce manual operations, and is simple and convenient.
[0003] However, these software have many drawbacks. Due to the input length limit of large language models, the number of tokens input by domestic large language models is difficult to meet the input of long articles. However, it is also due to this limitation that if you want to summarize multiple documents into a review, it is impossible. At this time, the number of multiple documents refers to several, dozens, or hundreds of documents. Such a large text structure cannot be achieved by relying on existing technologies. Therefore, it is urgent to provide a multi-document excerpting method for a large language model to provide strong support for rapid browsing, understanding, and management of texts.
[0004] It should be noted that the above introduction to the technical background is only for the convenience of providing a clear and complete description of the technical solutions of the present invention and for the convenience of understanding by those skilled in the art. It cannot be considered that the above technical solutions are well known to those skilled in the art simply because they are described in the technical background section of the present invention. Summary of the invention
[0005] The purpose of the present invention is to provide a multi-document excerpting method based on a large language model of NLP technology, which is mainly aimed at a large number of documents, has a powerful multi-text excerpting and summarizing function, can automatically obtain summaries of multiple documents, can help users quickly process and analyze large amounts of text data, improve work efficiency and quality, and at the same time ensure the security and reliability of data, and has important research significance and use value.
[0006] To achieve the above object, the present invention provides the following technical solutions:
[0007] The present invention provides a multi-document excerpting method based on a large language model of NLP technology. The multi-document excerpting method based on a large language model of NLP technology comprises the following steps:
[0008] Step 1:
[0009] Storing multiple documents in a database to form a document library;
[0010] Step 2:
[0011] Obtaining a review title, and inputting the review title into a pre-trained large language model;
[0012] Step 3:
[0013] The pre-trained large language model automatically generates a first review subtitle according to the review title;
[0014] Step 4:
[0015] The second review subtitle is obtained using NLP technology. The acquisition of the second review subtitle is based on keyword matching and topic modeling. The specific process includes:
[0016] Collect and prepare documents and review titles to ensure that the documents contain sufficient information as well as key words and phrases relevant to the review title;
[0017] Text segmentation: Use the word segmentation library to segment documents and review titles, breaking the text into sequences of words or phrases;
[0018] Feature extraction: Extract keywords and phrases from documents using TF-IDF technology to identify information in the document;
[0019] Topic Modeling: Use topic modeling techniques to identify topics in documents to capture the main focus of the document;
[0020] Keyword matching: Use NLP techniques to match keywords and phrases in the document with keywords in the review title to determine which parts of the document are directly related to the review title;
[0021] Generate the second review subtitle: Based on the matched keywords and phrases, combined with the information in the document, use text generation technology to generate the second review subtitle;
[0022] The correction process also includes integrating the first review subtitle and the second review subtitle, inputting the integrated first review subtitle and the second review subtitle into the pre-trained large language model, and the pre-trained large language model generates a revised review subtitle called a third review subtitle;
[0023] Step 5:
[0024] The documents in the document library are classified and sliced using vector similarity, and the classification and slicing specifically include:
[0025] Get subtitle vector representation: Use the word segmentation method to convert each subtitle into a vector representation;
[0026] Document vector construction: For each document, average or weighted average the vector representations of all its paragraphs to obtain the paragraph vector representation of the document;
[0027] Similarity calculation: Use cosine similarity or other similarity metrics to compare the similarity between paragraphs and subheadings of the document;
[0028] Document classification: classify the paragraphs of the document under the subheadings according to their similarity to the subheadings, forming a vector library of single subheadings and their corresponding document paragraphs;
[0029] Step 6:
[0030] Generate subheading paragraphs based on the vector library of a single subheading and its corresponding document paragraph using a large language model and Langchain technology;
[0031] Step 7:
[0032] Input the subheading paragraph into the pre-trained large language model to generate a summary text;
[0033] Step 8:
[0034] The review text is polished by the pre-trained large language model to output a final review text, and the final review text is a review article stored in a document library that is generated by extracting relevant contents of multiple documents from the review title.
[0035] Optionally, in step 2, the process of obtaining the review title is: based on the content of the document, the review title is manually specified or multiple review titles are generated based on the preliminary understanding of the content of the document by the pre-trained large language model and provided to humans for selection, thereby obtaining the review title.
[0036] Optionally, the correction process further includes:
[0037] Evaluation and screening: Evaluate and screen the generated revised review subheadings, using evaluation indicators to determine whether the revised review subheadings meet the requirements. Evaluation indicators include grammatical correctness, coherence, and information coverage;
[0038] Fine-tuning: Fine-tune the model based on the evaluation results, including adjusting the parameters of the generation model and optimizing the keyword matching algorithm.
[0039] In the existing technology, most of the processing and analysis of government texts and text processing and analysis in the field of education and teaching mainly rely on manual processing. In order to improve the processing efficiency and quality of texts, with the development and popularization of large language model applications, some text intelligent assistant software has emerged, which can automatically realize some document excerpts, reduce manual operations, and are simple and convenient. However, these softwares have many disadvantages. Due to the input length limit of the large language model, most of the domestic ones are 8k, 16k, and some are 32k. However, it is precisely because of this limitation that if you want to extract a summary from multiple documents, it is impossible to achieve it. At this time, the number of multiple documents does not only refer to a few or dozens of articles, but also to tens of thousands or even hundreds of millions. Such a huge text structure cannot be achieved by relying on existing technology. The present invention is a multi-document excerpting method of a large language model, which provides strong support for the rapid browsing, understanding and management of texts. The multi-document excerpting method of a large language model based on NLP technology is mainly aimed at a large number of documents of tens of thousands or even hundreds of millions. It has a powerful multi-text excerpting and summarizing function, can automatically obtain summaries of multiple documents, can help users quickly process and analyze large amounts of text data, improve work efficiency and quality, and ensure data security and reliability. It has important research significance and use value. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0041] Figure 1 This is the process of the multi-document excerpting method based on the large language model of NLP technology in the embodiment of the present invention Figure 1 ;
[0042] Figure 2 This is the process of the multi-document excerpting method based on the large language model of NLP technology in the embodiment of the present invention Figure 2 . DETAILED DESCRIPTION
[0043] To make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be described in detail below. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other implementation methods obtained by ordinary technicians in this field without creative work belong to the scope of protection of the present invention.
[0044] In the existing technology, most of the processing and analysis of government texts and text processing and analysis in the field of education and teaching mainly rely on manual processing. In order to improve the processing efficiency and quality of texts, with the development and popularization of large language model applications, some text intelligent assistant software has emerged, which can automatically realize some document excerpts, reduce manual operations, and are simple and convenient. However, these softwares have many disadvantages. Due to the input length limit of the large language model, most of the domestic ones are 8k, 16k, and some are 32k. However, it is precisely because of this limitation that if you want to extract a summary from multiple documents, it is impossible to achieve it. At this time, the number of multiple documents does not only refer to a few or dozens of articles, but also to tens of thousands or even hundreds of millions. Such a huge text structure cannot be achieved by relying on existing technology. The present invention is a multi-document excerpting method of a large language model, which provides strong support for the rapid browsing, understanding and management of texts. The multi-document excerpting method of a large language model based on NLP technology is mainly aimed at a large number of documents of tens of thousands or even hundreds of millions. It has a powerful multi-text excerpting and summarizing function, can automatically obtain summaries of multiple documents, can help users quickly process and analyze large amounts of text data, improve work efficiency and quality, and ensure data security and reliability. It has important research significance and use value.
[0045] The present invention provides a multi-document excerpting method based on a large language model of NLP technology, such as Figure 1-2 As shown, the multi-document summarization method based on the large language model of NLP technology includes the following steps:
[0046] Step 1:
[0047] Storing multiple documents in a database to form a document library;
[0048] Step 2:
[0049] Obtaining a review title, and inputting the review title into a pre-trained large language model;
[0050] Step 3:
[0051] The pre-trained large language model automatically generates a first review subtitle according to the review title;
[0052] Step 4:
[0053] The NLP technology is used to obtain the subtitle of the second review. The acquisition of the subtitle of the second review is based on keyword matching and topic modeling. The specific process includes:
[0054] Collect and prepare documents and review titles to ensure that the documents contain sufficient information as well as key words and phrases relevant to the review title;
[0055] Text segmentation: Use the word segmentation library to segment documents and review titles, breaking the text into sequences of words or phrases;
[0056] Feature extraction: Extract keywords and phrases from documents using TF-IDF technology to identify information in the document;
[0057] Topic Modeling: Use topic modeling techniques to identify topics in documents to capture the main focus of the document;
[0058] Keyword matching: Use NLP techniques to match keywords and phrases in the document with keywords in the review title to determine which parts of the document are directly related to the review title;
[0059] Generate the second review subtitle: Based on the matched keywords and phrases, combined with the information in the document, use text generation technology to generate the second review subtitle;
[0060] The correction process also includes integrating the first review subtitle and the second review subtitle, inputting the integrated first review subtitle and the second review subtitle into the pre-trained large language model, and the pre-trained large language model generates a revised review subtitle called a third review subtitle;
[0061] Step 5:
[0062] The documents in the document library are classified and sliced using vector similarity, and the classification and slicing specifically include:
[0063] Get subtitle vector representation: Use the word segmentation method to convert each subtitle into a vector representation;
[0064] Document vector construction: For each document, average or weighted average the vector representations of all its paragraphs to obtain the paragraph vector representation of the document;
[0065] Similarity calculation: Use cosine similarity or other similarity metrics to compare the similarity between paragraphs and subheadings of the document;
[0066] Document classification: classify the paragraphs of the document under the subheadings according to their similarity to the subheadings, forming a vector library of single subheadings and their corresponding document paragraphs;
[0067] Step 6:
[0068] Generate subheading paragraphs based on the vector library of a single subheading and its corresponding document paragraph using a large language model and Langchain technology;
[0069] Step 7:
[0070] Input the subheading paragraph into the pre-trained large language model to generate a summary text;
[0071] Step 8:
[0072] The review text is polished by the pre-trained large language model to output a final review text, and the final review text is a review article stored in the document library that is generated by extracting relevant contents of multiple documents from the review title.
[0073] In this way, a huge number of documents, tens of thousands or even hundreds of millions, can be processed at one time. It has a powerful multi-text excerpting and summarizing function, which can automatically obtain summaries of so many documents, and can help users quickly process and analyze large amounts of text data, improve work efficiency and quality, and ensure data security and reliability.
[0074] In a specific embodiment of the present invention, in step 2, the process of obtaining the review title is: according to the content of the document, a review title is manually specified or multiple review titles are generated based on the preliminary understanding of the content of the document by the pre-trained large language model and provided to manual selection, thereby obtaining the review title. Therefore, if it is a technical solution to manually specify the review title: multiple documents are stored in a database to form a document library; the review title is obtained by manually specifying the review title, and the review title is input into the pre-trained large language model, and the pre-trained large language model automatically generates a first review subheading according to the review title; the second review subheading is obtained using NLP technology, and the acquisition of the second review subheading is based on keyword matching and topic modeling, and also includes a correction process, which includes integrating the first review subheading and the second review subheading, and inputting the integrated first review subheading and second review subheading into the pre-trained large language model, and the pre-trained large language model generates a revised review subheading It is called the third review subheading; the documents in the document library are classified and sliced using vector similarity to form a vector library of a single subheading and its corresponding document paragraph, the large language model and Langchain technology are used to generate a subheading paragraph based on the vector library of a single subheading and its corresponding document paragraph, the subheading paragraph is input into the pre-trained large language model to generate a review text, the review text is polished by the pre-trained large language model to output the final review text, the final review text is a review of multiple documents stored in the document library, which can help users quickly process and analyze large amounts of text data, improve work efficiency and quality, and ensure data security and reliability.
[0075] If a technical solution is provided for obtaining review titles by generating multiple review titles based on a preliminary understanding of the content of a document by a pre-trained large language model and providing them to manual selection, the following steps are taken: storing multiple documents in a database to form a document library; generating multiple review titles based on a preliminary understanding of the content of the document by the pre-trained large language model and providing them to manual selection, thereby obtaining review titles, and inputting the review titles into the pre-trained large language model, which automatically generates a first review subtitle based on the review titles; obtaining a second review subtitle using NLP technology, wherein the acquisition of the second review subtitle is based on keyword matching and topic modeling, and also includes a correction process, which includes integrating the first review subtitle and the second review subtitle, and integrating the integrated first review subtitle and the second review subtitle. The subheading is input into the pre-trained large language model, and the pre-trained large language model generates a revised review subheading called the third review subheading; the documents in the document library are classified and sliced using vector similarity to form a vector library of a single subheading and its corresponding document paragraph, and the large language model and Langchain technology are used to generate a subheading paragraph based on the vector library of a single subheading and its corresponding document paragraph, and the subheading paragraph is input into the pre-trained large language model to generate a review text, and the review text is polished by the pre-trained large language model to output the final review text, which is a review of multiple documents stored in the document library, and can help users quickly process and analyze large amounts of text data, improve work efficiency and quality, and ensure data security and reliability.
[0076] Among them, step three and step four can be carried out simultaneously and implemented in parallel, that is, the overall content includes three processes, as follows: the first process: input the review title into the pre-trained large language model, and the pre-trained large language model automatically generates a first review subtitle based on the review title; the second process: based on the review title, use NLP technology to obtain the second review subtitle; the third process: integrate the first review subtitle and the second review subtitle, and input the integrated first review subtitle and second review subtitle into the pre-trained large language model. The pre-trained large language model generates a revised review subtitle called the third review subtitle.
[0077] It should be noted that the acquisition of the first review subtitle and the acquisition of the second review subtitle are two independent processes. The acquisition of the second review subtitle is not based on the first review subtitle. Figure 1 As shown, the third review subheading is obtained by integrating the first review subheading and the second review subheading. This process is called the correction process.
[0078] In a specific embodiment of the present invention, the correction process also includes: evaluation and screening and fine-tuning, wherein evaluation and screening: evaluating and screening the generated revised review subheadings, using evaluation indicators to determine whether the revised review subheadings meet the requirements, and the evaluation indicators include grammatical correctness, coherence, and information coverage; fine-tuning: fine-tuning is performed according to the evaluation results, including adjusting the parameters of the generation model and optimizing the keyword matching algorithm. Among them, the revised subheadings are generated using a large language model, and the large language model can better understand the context and context, thereby generating more natural and accurate text. During the evaluation and screening process, by evaluating the generated revised subheadings, some evaluation indicators, such as grammatical correctness, coherence, information coverage, etc., can be used to determine whether the generated subheadings meet the requirements. Regarding fine-tuning: necessary fine-tuning can be performed according to the results of the evaluation, which may include adjusting the parameters of the generation model, optimizing the keyword matching algorithm, etc.
[0079] In a specific embodiment of the present invention, the bge word segmentation method can be used to obtain the subtitle vector representation.
[0080] In a specific embodiment of the present invention, the text generation technology in the multi-document excerpting method of the large language model based on NLP technology adopts Transformer and the like.
[0081] In a specific embodiment of the present invention, document data and review titles are collected and prepared to ensure that the documents contain sufficient information as well as keywords and phrases related to the review.
[0082] About text segmentation: You can use bge and other word segmentation libraries to segment documents and reviews, splitting the text into sequences of words or phrases.
[0083] About TF-IDF feature extraction: Using TF-IDF (term frequency-inverse document frequency) and other technologies to extract keywords and phrases from documents can help identify important information in the document.
[0084] About Topic Modeling: Topic modeling techniques are used to identify topics in documents and to capture the main focus of the document.
[0085] In a specific embodiment of the present invention, keyword matching is added, and NLP technology is used to match keywords and phrases in the document with keywords in the review title, which can help determine which parts of the document are directly related to the review title.
[0086] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.
Claims
1. A multi-document summarization method based on a large language model of NLP technology, characterized in that: The multi-document summarization method based on a large language model of NLP technology includes the following steps: Step 1: Storing multiple documents in a database to form a document library; Step 2: Obtain the review title and input the review title into the pre-trained large language model; Step 3: The pre-trained large language model automatically generates a first review subtitle according to the review title; Step 4: The second review subtitle is obtained using NLP technology. The acquisition of the second review subtitle is based on keyword matching and topic modeling. The specific process includes: Collect and prepare documents and review titles to ensure that the documents contain sufficient information as well as key words and phrases relevant to the review title; Text segmentation: Use the word segmentation library to segment documents and review titles, breaking the text into sequences of words or phrases; Feature extraction: Extract keywords and phrases from documents using TF-IDF technology to identify information in the document; Topic Modeling: Use topic modeling techniques to identify topics in documents to capture the main focus of the document; Keyword matching: Use NLP techniques to match keywords and phrases in the document with keywords in the review title to determine which parts of the document are directly related to the review title; Generate the second review subtitle: Based on the matched keywords and phrases, combined with the information in the document, use text generation technology to generate the second review subtitle; The correction process also includes integrating the first review subtitle and the second review subtitle, inputting the integrated first review subtitle and the second review subtitle into the pre-trained large language model, and the pre-trained large language model generates a revised review subtitle called a third review subtitle; Step 5: The documents in the document library are classified and sliced using vector similarity, and the classification and slicing specifically include: Get subtitle vector representation: Use the word segmentation method to convert each subtitle into a vector representation; Document vector construction: For each document, average or weighted average the vector representations of all its paragraphs to obtain the paragraph vector representation of the document; Similarity calculation: Use cosine similarity or other similarity metrics to compare the similarity between paragraphs and subheadings of the document; Document classification: classify the paragraphs of the document under the subheadings according to their similarity to the subheadings, forming a vector library of single subheadings and their corresponding document paragraphs; Step 6: Generate subheading paragraphs based on the vector library of a single subheading and its corresponding document paragraph using a large language model and Langchain technology; Step 7: Input the subheading paragraph into the pre-trained large language model to generate a summary text; Step 8: The review text is polished by the pre-trained large language model to output a final review text, and the final review text is a review article stored in a document library that is generated by extracting relevant contents of multiple documents from the review title.
2. The multi-document excerpting method based on a large language model of NLP technology according to claim 1, characterized in that: In the step 2, the process of obtaining the review title is: according to the content of the document, the review title is manually specified or multiple review titles are generated based on the preliminary understanding of the content of the document by the pre-trained large language model and provided to humans for selection, thereby obtaining the review title.
3. The multi-document excerpting method based on a large language model of NLP technology according to claim 2 is characterized in that: The correction process also includes: Evaluation and screening: Evaluate and screen the generated revised review subheadings, using evaluation indicators to determine whether the revised review subheadings meet the requirements. Evaluation indicators include grammatical correctness, coherence, and information coverage; Fine-tuning: Fine-tune the model based on the evaluation results, including adjusting the parameters of the generation model and optimizing the keyword matching algorithm.
