A content embedding-based text abstract generation method, storage medium and device
By training a word embedding model using the Word2Vec algorithm and combining iterative similarity calculations in multiple rounds, semantically relevant text summaries are generated. This solves the problems of high computational cost and insufficient semantic feature mining in traditional methods, and achieves efficient and accurate summary generation.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- CHINA TELECOM DIGITAL INTELLIGENCE TECH CO LTD
- Filing Date
- 2023-11-15
- Publication Date
- 2026-07-14
AI Technical Summary
Traditional text summarization methods struggle to effectively uncover the deep semantic features of document content, and machine learning-based methods are computationally expensive and cannot efficiently generate semantically relevant summaries.
The Word2Vec algorithm is used to train a word embedding model. Through multiple rounds of iteration, the embedding information of sentences, paragraphs and documents is calculated. Cosine similarity or Euclidean distance is used to calculate similarity, and the most relevant sentences and paragraphs are selected to generate summaries.
The generated summaries are semantically closer to the original text, have lower computational overhead, and produce more accurate results, enabling efficient mining of semantic relevance in document content.
Smart Images

Figure CN117493547B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of knowledge management technology, specifically relating to a text summarization method, storage medium, and device based on content embedding. Background Technology
[0002] The world economy is now moving towards economic integration and a knowledge economy. Networking, virtualization, digitalization, and knowledge-based approaches are becoming key characteristics of modern economic development, making the business environment increasingly complex and volatile for enterprises. In the face of increasingly fierce market competition, knowledge has become the primary resource for business operations. A company's competitive advantage increasingly reflects its substantial knowledge capital and unique operational capabilities. Therefore, knowledge management is becoming a core aspect of enterprise management.
[0003] In recent years, large enterprises and institutions have gradually begun to deploy knowledge management platforms. With the launch of these platforms and the rapid growth of users, a vast amount of knowledge documents have accumulated, and the number of documents stored is increasing rapidly. Faced with millions of documents, in order to enable users to quickly find content of interest on the platform, in addition to providing a search function, the platform also provides a text summary of the corresponding content for each search item on the search results page, allowing users to quickly understand the content of the document.
[0004] Traditional extractive summarization methods include statistical feature-based methods and machine learning-based methods. Among them, statistical feature-based methods are difficult to extract deep semantic features from document content; machine learning-based methods require complex feature engineering as support, and the computational cost of model training and inference is high. Summary of the Invention
[0005] To address the problems existing in the prior art, this invention provides a text summarization method, storage medium, and device based on content embedding, which can simply and efficiently mine the sentences that are most semantically relevant to the document content and form a summary.
[0006] To achieve the above technical objectives, the present invention adopts the following technical solution: a text summarization method based on content embedding, specifically including the following steps:
[0007] Step 1: Extract text from documents on the knowledge management platform to form a corpus, and train a word embedding model using the Word2Vec algorithm;
[0008] Step 2: After removing stop words from each word in a sentence, input the result into the trained word embedding model, output the embedding information corresponding to each word, and take the arithmetic mean of the embedding information corresponding to each word in the sentence as the embedding information of the sentence.
[0009] Step 3: Calculate the arithmetic mean of the embedding information of each sentence in the paragraph, and use it as the embedding information of the paragraph. Calculate the similarity between the embedding information of all sentences in the paragraph and the embedding information of the paragraph, and update the embedding information of the paragraph.
[0010] Step 4: Calculate the arithmetic mean of the embedding information of all paragraphs in the document to obtain the embedding information of the document. Then, calculate the similarity between the embedding information of all paragraphs in the document and the embedding information of the document, and update the embedding information of the document.
[0011] Step 5: Sort all paragraphs involved in calculating the final embedding information of the document in descending order of similarity to the final embedding information of the document. Select the sentence with the highest similarity to the final embedding information of each paragraph as a candidate sentence for the summary. Arrange them in the order in which they appear in the document to form the final content summary.
[0012] Furthermore, step 1 includes the following sub-steps:
[0013] Step 101: Extract text from documents on the knowledge management platform to form a corpus;
[0014] Step 102: Set the size of the sliding window, traverse all sentences in all texts in the corpus, and form training data line by line;
[0015] Step 103: Input the generated training data into the word embedding model sequentially, and train the word embedding model using the Word2Vec algorithm with backpropagation.
[0016] Furthermore, step 3 includes the following sub-steps:
[0017] Step 301: Calculate the arithmetic mean of the embedding information of each sentence in the paragraph, and use it as the embedding information of the paragraph.
[0018] Step 302: Calculate the similarity between the embedding information of all sentences in the paragraph and the embedding information of the paragraph in turn; perform an arithmetic average on the embedding information of sentences with similarity above the first threshold; and update the embedding information of the paragraph.
[0019] Step 303: Repeat step 302 until the calculated similarity is above the first threshold. Then, perform an arithmetic average on the embedding information of sentences with similarity above the first threshold to obtain the final embedding information of the paragraph.
[0020] Furthermore, step 4 includes the following sub-steps:
[0021] Step 401: Calculate the arithmetic mean of the final embedding information of all paragraphs in the document to obtain the embedding information of the document;
[0022] Step 402: Calculate the similarity between the final embedding information of all paragraphs in the document and the embedding information of the document in turn; arithmetically average the embedding information of paragraphs with similarity above the second threshold; and update the embedding information of the document.
[0023] Step 403: Repeat step 402 until the similarity is above the second threshold. Then, perform an arithmetic average on the embedding information of the paragraphs with similarity above the second threshold to obtain the final embedding information of the document.
[0024] Furthermore, the similarity calculation is achieved through cosine similarity or Euclidean distance.
[0025] Furthermore, step 5 includes the following sub-steps:
[0026] Step 501: Sort all paragraphs involved in calculating the final embedding information of the document in descending order of similarity to the final embedding information of the document;
[0027] Step 502: Select the sentence with the highest similarity to the final embedded information of each sorted paragraph in turn, and add it to the candidate sentence set of the summary.
[0028] Step 503: Repeatedly select the sentence with the highest similarity to the final embedded information of each sorted paragraph that is not in the candidate sentence set of the summary, and add it to the candidate sentence set of the summary until the word count meets the requirements of the summary, then stop generating the summary;
[0029] Step 504: Arrange all sentences in the candidate sentence set of the summary in the order in which they appear in the document to form a text, thus forming the final content summary.
[0030] Furthermore, the present invention also provides a computer-readable storage medium storing a computer program that causes a computer to execute the content-embedded text summarization generation method described above.
[0031] Furthermore, the present invention also provides an electronic device, including: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, it implements the content-embedded text summarization generation method described above.
[0032] Compared with existing technologies, this invention has the following advantages: The text summarization method based on content embedding in this invention, through multiple iterations, mines the sentences most semantically relevant to the paragraph content and generates the final embedding information for the paragraph, thereby ignoring sentences in the paragraph that are not closely related to the paragraph content, making the calculation of the paragraph's embedding information more accurate. Through multiple iterations, it mines the paragraphs most semantically relevant to the document content and generates the final embedding information for the document, thereby ignoring paragraphs in the document that are not closely related to the document content, making the calculation of the document's embedding information more accurate. Furthermore, this invention sequentially finds the most semantically relevant sentences from the most semantically relevant paragraphs until the word count meets the summarization requirements, and then arranges all the found sentences in the order they appear in the original document to form the final content summary. This has the advantage of the summary information being closer to the original document at the semantic level. This invention, through simple embedding calculations, finds the paragraphs and sentences that best represent the document content semantically, forming a text summary. The algorithm results are more accurate, and the computational cost is low. Attached Figure Description
[0033] Figure 1 This is a flowchart of the text summarization method based on content embedding of the present invention. Detailed Implementation
[0034] The technical solution of the present invention will be further explained and described below with reference to the accompanying drawings.
[0035] like Figure 1 This is a flowchart of the text summarization method based on content embedding of the present invention. The text summarization method specifically includes the following sub-steps:
[0036] Step 1: Extract text from documents on the knowledge management platform to form a corpus, and train a word embedding model using the Word2Vec algorithm. The Word2vec algorithm fully considers the contextual information of words in the text, outperforming traditional methods, and is simple and efficient. Specifically, it includes the following sub-steps:
[0037] Step 101: Extract text from documents on the knowledge management platform to form a corpus;
[0038] Step 102: Set the size of the sliding window, traverse all sentences in all texts in the corpus, and form training data line by line;
[0039] Step 103: Input the formed training data into the word embedding model sequentially. Train the word embedding model using the Word2Vec algorithm with backpropagation. Input the word into the trained word embedding model and output the embedding information corresponding to the word. The length of the embedding information can be set. The longer the length, the richer the semantic information it represents, but the greater the computational cost. In practical applications, it is necessary to balance accuracy and computational cost. In this invention, the length of the word embedding information is 1024, and the maximum recommended value is no more than 2048.
[0040] Step 2: After removing stop words from each word in a sentence, input the result into the trained word embedding model, output the embedding information corresponding to each word, and take the arithmetic mean of the embedding information corresponding to each word in the sentence as the embedding information of the sentence.
[0041] Step 3: Calculate the arithmetic mean of the embedding information of each sentence in the paragraph, using this as the paragraph's embedding information. Then, calculate the similarity between the embedding information of all sentences in the paragraph and the paragraph's embedding information, updating the paragraph's embedding information. Sentences that are not highly relevant to the paragraph's content are ignored, as their semantic distance from the paragraph's embedding information is far. Ignoring these sentences makes the paragraph's embedding information calculation more accurate. Specifically, this includes the following sub-steps:
[0042] Step 301: Calculate the arithmetic mean of the embedding information of each sentence in the paragraph, and use it as the embedding information of the paragraph.
[0043] Step 302: Calculate the similarity between the embedding information of all sentences in the paragraph and the embedding information of the paragraph in turn. Ignore all sentences with similarity less than the first threshold, and perform an arithmetic average on the embedding information of sentences with similarity greater than the first threshold to update the embedding information of the paragraph.
[0044] Step 303: Repeat step 302 until the calculated similarity is above the first threshold. Then, perform an arithmetic average on the embedding information of sentences with similarity above the first threshold to obtain the final embedding information of the paragraph.
[0045] Step 4: Calculate the arithmetic mean of the embedding information of all paragraphs in the document to obtain the document's embedding information. Then, calculate the similarity between the embedding information of each paragraph and the document's embedding information, updating the document's embedding information. This process ignores paragraphs that are not highly relevant to the document's content, as their semantic distance is far from the document's embedding information. Ignoring these paragraphs makes the document's embedding information calculation more accurate. Specifically, this includes the following sub-steps:
[0046] Step 401: Calculate the arithmetic mean of the final embedding information of all paragraphs in the document to obtain the embedding information of the document;
[0047] Step 402: Calculate the similarity between the final embedding information of all paragraphs in the document and the embedding information of the document in turn; arithmetically average the embedding information of paragraphs with similarity above the second threshold; and update the embedding information of the document.
[0048] Step 403: Repeat step 402 until the similarity is above the second threshold. Then, perform an arithmetic average on the embedding information of the paragraphs with similarity above the second threshold to obtain the final embedding information of the document.
[0049] Step 5: Sort all paragraphs involved in calculating the final embedding information of the document in descending order of similarity to the final embedding information. Then, select the sentence with the highest similarity to the final embedding information of each paragraph as a candidate sentence for the summary. Arrange these sentences in the order they appear in the document to form the final content summary. The summary formed by finding the sentence in each paragraph that is semantically closest to the full document and arranging it in its original order is semantically closer to the original text and has higher fluency. Specifically, this includes the following sub-steps:
[0050] Step 501: Sort all paragraphs involved in calculating the final embedding information of the document in descending order of similarity to the final embedding information of the document;
[0051] Step 502: Select the sentence with the highest similarity to the final embedded information of each sorted paragraph in turn, and add it to the candidate sentence set of the summary.
[0052] Step 503: Repeatedly select the sentence with the highest similarity to the final embedded information of each sorted paragraph that is not in the candidate sentence set of the summary, and add it to the candidate sentence set of the summary until the word count meets the requirements of the summary, then stop generating the summary;
[0053] Step 504: Arrange all sentences in the candidate sentence set of the summary in the order in which they appear in the document to form a text, thus forming the final content summary.
[0054] The present invention provides a text summarization method based on content embedding. Through simple embedding calculations, it identifies the paragraphs and sentences that best represent the content of a document semantically, thus forming a text summary. The algorithm results are more accurate, has low computational overhead, and is simple and easy to implement.
[0055] In one embodiment of the present invention, a computer-readable storage medium is also provided, storing a computer program that causes a computer to execute the content-embedded text summarization generation method described above.
[0056] In one technical solution of the present invention, an electronic device is also provided, including: a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the content-embedded text summarization generation method.
[0057] In the embodiments disclosed in this application, a computer storage medium may be a tangible medium that may contain or store programs for use by or in conjunction with an instruction execution system, apparatus, or device. The computer storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of computer storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0058] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed in this application can be implemented in electronic hardware or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0059] The above are merely preferred embodiments of the present invention. The scope of protection of the present invention is not limited to the above embodiments. All technical solutions falling within the scope of the present invention's concept are within the scope of protection of the present invention. It should be noted that for those skilled in the art, any improvements and modifications made without departing from the principles of the present invention should be considered within the scope of protection of the present invention.
Claims
1. A text summarization method based on content embedding, characterized in that, Specifically, the steps include the following: Step 1: Extract text from documents on the knowledge management platform to form a corpus, and train a word embedding model using the Word2Vec algorithm; Step 2: After removing stop words from each word in a sentence, input the result into the trained word embedding model, output the embedding information corresponding to each word, and take the arithmetic mean of the embedding information corresponding to each word in the sentence as the embedding information of the sentence. Step 3: Calculate the arithmetic mean of the embedding information of each sentence in the paragraph, using this as the embedding information of the paragraph. Then, calculate the similarity between the embedding information of all sentences in the paragraph and the embedding information of the paragraph, updating the embedding information of the paragraph. This includes the following sub-steps: Step 301: Calculate the arithmetic mean of the embedding information of each sentence in the paragraph, and use it as the embedding information of the paragraph. Step 302: Calculate the similarity between the embedding information of all sentences in the paragraph and the embedding information of the paragraph in turn; perform an arithmetic average on the embedding information of sentences with similarity above the first threshold; and update the embedding information of the paragraph. Step 303: Repeat step 302 until the calculated similarity is above the first threshold. Then, perform an arithmetic average on the embedding information of sentences with similarity above the first threshold to obtain the final embedding information of the paragraph. Step 4: Calculate the arithmetic mean of the embedding information of all paragraphs in the document to obtain the document's embedding information. Then, calculate the similarity between the embedding information of all paragraphs in the document and the document's embedding information, and update the document's embedding information. This includes the following sub-steps: Step 401: Calculate the arithmetic mean of the final embedding information of all paragraphs in the document to obtain the embedding information of the document; Step 402: Calculate the similarity between the final embedding information of all paragraphs in the document and the embedding information of the document in turn; arithmetically average the embedding information of paragraphs with similarity above the second threshold; and update the embedding information of the document. Step 403: Repeat step 402 until the similarity is above the second threshold. Then, perform an arithmetic average on the embedding information of the paragraphs with similarity above the second threshold to obtain the final embedding information of the document. Step 5: Sort all paragraphs involved in calculating the final embedding information of the document in descending order of similarity to the final embedding information of the document. Select the sentence with the highest similarity to the final embedding information of each paragraph as a candidate sentence for the summary. Arrange them in the order in which they appear in the document to form the final content summary.
2. The text summarization method based on content embedding according to claim 1, characterized in that, Step 1 includes the following sub-steps: Step 101: Extract text from documents on the knowledge management platform to form a corpus; Step 102: Set the size of the sliding window, traverse all sentences in all texts in the corpus, and form training data line by line; Step 103: Input the generated training data into the word embedding model sequentially, and train the word embedding model using the Word2Vec algorithm with backpropagation.
3. The text summarization method based on content embedding according to claim 1, characterized in that, The similarity calculation is achieved through cosine similarity or Euclidean distance.
4. The text summarization method based on content embedding according to claim 1, characterized in that, Step 5 includes the following sub-steps: Step 501: Sort all paragraphs involved in calculating the final embedding information of the document in descending order of similarity to the final embedding information of the document; Step 502: Select the sentence with the highest similarity to the final embedded information of each sorted paragraph in turn, and add it to the candidate sentence set of the summary. Step 503: Repeatedly select the sentence with the highest similarity to the final embedded information of each sorted paragraph that is not in the candidate sentence set of the summary, and add it to the candidate sentence set of the summary until the word count meets the requirements of the summary, then stop generating the summary; Step 504: Arrange all sentences in the candidate sentence set of the summary in the order in which they appear in the document to form a text, thus forming the final content summary.
5. A computer-readable storage medium storing a computer program, characterized in that, The computer program causes the computer to perform the content-embedded text summarization method as described in any one of claims 1-4.
6. An electronic device, characterized in that, include: The memory, the processor, and the computer program stored in the memory and executable on the processor, wherein the processor, when executing the computer program, implements the content-embedded text summarization method as described in any one of claims 1-4.