Text theme extraction method and device based on knowledge enhancement and electronic equipment

Through knowledge enhancement-based methods, combined with BertTopic and KeyBert algorithms, domain features and vector knowledge bases are used to extract text topics, which solves the problems of text feature differences in different fields and high text quality and length requirements, and achieves efficient and robust text topics. Extraction.

CN118779447APending Publication Date: 2024-10-15WUHAN TIANYU INFORMATION IND
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202410819232.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-24
Publication Date
2024-10-15

AI Technical Summary

Technical Problem

Existing text topic extraction technology is difficult to handle the feature differences of texts in different fields, and has high requirements on text quality and length, resulting in poor extraction results when faced with low-quality or short texts, and the amount of early data processing is large, making it difficult to adapt to the text content. diversity and complexity.

Method used

Using a method based on knowledge enhancement, through word embedding and feature fusion, combined with BertTopic and KeyBert algorithms, topic extraction is performed on texts of different sizes and qualities, and domain features and vector knowledge bases are used for feature matching and fusion to reduce text quality and length. requirements to improve robustness.

Benefits of technology

It achieves effective capture of topics in texts in different fields, improves the pertinence and robustness of the extraction model, can handle texts of various qualities and lengths, avoids the problem of low quality short text extraction, and enhances the adaptability and robustness of the algorithm. efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118779447A_ABST
    Figure CN118779447A_ABST
Patent Text Reader

Abstract

The invention discloses a text topic extraction method and device based on knowledge enhancement and electronic equipment. The method comprises the following steps: preprocessing a to-be-extracted text; performing length judgment on the preprocessed to-be-extracted text, and dividing the to-be-extracted text into a long text and a short text; when the to-be-extracted text is a long text, performing word embedding processing on the preprocessed to-be-extracted text to obtain to-be-extracted text features; performing feature fusion on the to-be-extracted text features and the obtained domain features matched with the to-be-extracted text features to obtain fusion features; performing topic extraction on the fusion features to obtain a text topic; and when the to-be-extracted text is a short text, performing keyword extraction on the preprocessed to-be-extracted text to obtain a text theme. The invention provides a topic extraction method which is universal in industry and effective for texts with different scales and different qualities, and solves the problems that a related topic extraction model cannot distinguish domain features, is low in robustness and excessively depends on text features.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of text processing technology, and in particular to a text topic extraction method, device and electronic equipment based on knowledge enhancement. Background Art

[0002] With the rapid development of informatization, text data in all walks of life on the Internet has exploded. The increasing amount of network data has made it increasingly difficult to obtain high-quality and valuable data, and different industries and fields have their own standards for data quality. Therefore, how to efficiently and accurately extract valuable and targeted topic information from massive amounts of text has become an important issue in current research and practice. Traditional topic extraction is usually done through unsupervised algorithms, such as TF-IDF and YAKE based on statistics, as well as TopicRank based on clustering and the classic LAD algorithm.

[0003] However, the above technical solutions still have some objective problems:

[0004] 1) The quality of the text itself is high, and the quality of the text determines the effect of topic extraction. The core idea of ​​the clustering algorithm is to group and cluster the text vocabulary features by similarity, and each cluster center is an abstract topic. Therefore, all the characteristics of the document set that affect the clustering results will affect the results of the clustering algorithm. The statistical-based algorithm is greatly affected by the frequency distribution of the article words. Faced with texts containing fewer feature words or texts with low vocabulary frequency and more noise, it is difficult for the algorithm to extract effective information from them, resulting in poor topic extraction results.

[0005] 2) The length and quantity of texts are high. Whether using statistical methods or clustering methods to extract topics, a large amount of text is required as data support. For shorter texts, the identifiable and statistical features are limited, which makes the algorithm less feasible.

[0006] 3) The initial workload is large. Statistical and clustering algorithms are too dependent on initial data preprocessing, such as feature selection and data cleaning. In addition, the preprocessing script rules designed manually for different types of text are different, which makes it difficult for the algorithm itself to adapt to the diversity and complexity of text content and the specificity of different industries. In order to meet the needs of topic extraction, it is necessary to continuously adjust the rule script according to the changes in text features, which adds a lot of extra workload.

[0007] 4) Data distribution varies between different fields. When dealing with texts with different feature distributions, if only one feature processing method is used, the results obtained will often lose the specificity of the text. For example, in some texts involving field characteristics, the words and terms used in the text are all professional, and the meaning of the words and semantics may change with the change of context, and the impact on the text theme will also be different. Summary of the invention

[0008] The present invention aims to solve at least one of the technical problems existing in the prior art, and proposes a text topic extraction method, device and electronic device based on knowledge enhancement.

[0009] In order to solve the problems that the relevant topic extraction model cannot distinguish domain features, is not robust, and is overly dependent on text characteristics, the present invention proposes a topic extraction method that is universal in the industry and effective for texts of different sizes and qualities.

[0010] The technical solution of the present invention is implemented as follows: The present invention discloses a text topic extraction method based on knowledge enhancement, comprising the following steps:

[0011] S1: Pre-process the text to be extracted;

[0012] S2: Perform word embedding processing on the text to be extracted after pre-processing to obtain the features of the text to be extracted;

[0013] The feature of the text to be extracted is fused with the obtained domain feature matching the feature of the text to be extracted to obtain a fused feature;

[0014] Perform topic extraction on the fused features to obtain the text topic.

[0015] Furthermore, after step S1, the following steps are also included: judging the length of the pre-processed text to be extracted, and dividing the text to be extracted into long text and short text;

[0016] When the text to be extracted is a long text, execute step S2;

[0017] When the text to be extracted is a short text, keyword extraction is performed on the text to be extracted after pre-processing, and the extracted keywords are used as the text theme.

[0018] Furthermore, the length of the text to be extracted after pre-processing is judged, and the text to be extracted is divided into long text and short text, specifically including: obtaining the number of words in the text to be extracted after pre-processing, classifying the text to be extracted whose number of words is greater than a preset threshold as long text, and classifying the text to be extracted whose number of words is less than or equal to the preset threshold as short text.

[0019] Furthermore, keyword extraction is performed on the pre-processed text to be extracted, specifically including: using the KeyBert algorithm to extract keywords from the pre-processed text to be extracted to obtain keywords that best describe the entire text.

[0020] Furthermore, the extracted text is pre-processed, specifically including: data cleaning, word segmentation and stop word removal for the extracted text.

[0021] Furthermore, the text topic extraction method based on knowledge enhancement of the present invention also includes obtaining domain features that match the features of the text to be extracted;

[0022] Obtaining a domain feature that matches the text feature to be extracted, specifically including: using an inverted index, searching for N vector documents with top N similarities to the text feature to be extracted from a vector knowledge base as domain features, wherein the vector knowledge base stores preset knowledge vectors of various fields;

[0023] The feature fusion of the text features to be extracted and the obtained domain features specifically includes: merging the N vector documents with the top N similarity rankings searched out with the text features to be extracted to achieve feature fusion.

[0024] Furthermore, the text topic extraction method based on knowledge enhancement of the present invention also includes:

[0025] Segment all preset documents in the database, remove stop words and deduplicate to form a vocabulary, and assign a unique identifier to each word in the vocabulary;

[0026] Traverse each document, segment each document, remove stop words and deduplicate, obtain several words, map each word of the document to the identifier, form the document ID of the document, and save it;

[0027] Creating an inverted list for each word in the vocabulary, the list containing all document IDs that map to the word, and associating the word with the document containing the word;

[0028] After the list is constructed, the list content is converted into feature vectors, and the words and document content are embedded to form a vector knowledge base.

[0029] Furthermore, searching the vector knowledge base for N vector documents with top N similarities to the text features to be extracted as domain features, specifically including: matching the text features to be extracted with the vector knowledge base to obtain all vector documents containing the text features to be extracted;

[0030] After that, similarity calculations are performed one by one, and the top N vector documents ranked by similarity are extracted as domain features.

[0031] Furthermore, the N vector documents ranked top N in similarity that are searched out are merged with the text features to be extracted, specifically including: concatenating and merging the N vector documents ranked top N in similarity that are searched out with the text features to be extracted to achieve feature fusion.

[0032] Furthermore, the fusion features are subjected to topic extraction, specifically including: extracting the fusion features using the BertTopic algorithm;

[0033] The BertTopic algorithm is used to extract the fused features, which includes: reducing the dimension and clustering the fused features, and then using the c-TF-IDF algorithm to select the top M words with the highest scores in the category as the final topic.

[0034] The present invention also discloses a multi-domain text topic extraction device based on knowledge enhancement, comprising:

[0035] A pre-processing module, wherein the pre-processing module is used to pre-process the text to be extracted;

[0036] A word embedding module, which is used to perform word embedding processing on the pre-processed text to be extracted to obtain features of the text to be extracted;

[0037] A feature fusion module, wherein the feature fusion module is used to fuse the features of the text to be extracted with the obtained domain features that match the features of the text to be extracted to obtain fused features;

[0038] The topic extraction module is used to extract topics from the fused features to obtain text topics.

[0039] Furthermore, the multi-domain text topic extraction device based on knowledge enhancement of the present invention also includes a classification module, which is used to judge the length of the pre-processed text to be extracted and divide the text to be extracted into long text and short text;

[0040] When the text to be extracted is a long text, the topic extraction module is used to extract the topic of the fused features to obtain the text topic;

[0041] When the text to be extracted is a short text, the topic extraction module is used to extract keywords from the pre-processed text to be extracted, and use the extracted keywords as the text topic.

[0042] The present invention also discloses an electronic device, comprising: 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, the steps of the text topic extraction method based on knowledge enhancement as described above are implemented.

[0043] The present invention also discloses a readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, the steps of the text topic extraction method based on knowledge enhancement as described above are implemented.

[0044] Compared with the prior art, the present invention has the following beneficial effects:

[0045] The text topic extraction method based on knowledge enhancement of the present invention comprises the following steps: pre-processing the text to be extracted; word embedding processing is performed on the text to be extracted after the pre-processing to obtain the text features to be extracted; feature fusion is performed on the text features to be extracted and the obtained field features matching the text features to be extracted to obtain fusion features; topic extraction is performed on the fusion features to obtain the text topics. The present invention adopts the above scheme to realize knowledge enhancement in the face of texts in different fields, effectively handles the problem that a single algorithm cannot accurately capture topics in the face of multi-field feature texts, emphasizes the special proprietary words in texts in different fields, and uses them to enrich text resources, help improve the extraction results, and improve the pertinence and robustness of the topic extraction model when facing field texts with different feature distributions. Knowledge enhancement is realized in the face of texts in different fields, effectively handles the problem that a single algorithm cannot accurately capture topics in the face of multi-field feature texts.

[0046] The present invention also uses the BertTopic and KeyBert algorithms themselves to avoid the requirements of previous topic extraction models on the quality of input texts, increase the robustness of the algorithm, and enable the model to complete the task well even when faced with texts of varying quality; secondly, faced with texts of varying lengths, this patent introduces the BertTopic and KeyBert algorithms to process long and short texts respectively, avoiding the situation where the quality of short text topic extraction is low or even normal extraction cannot be performed. BRIEF DESCRIPTION OF THE DRAWINGS

[0047] Figure 1 A method flow chart of a text topic extraction method based on knowledge enhancement provided by an embodiment of the present invention;

[0048] Figure 2 A method flow chart of a text topic extraction method based on knowledge enhancement provided by another embodiment of the present invention;

[0049] Figure 3 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention;

[0050] Figure 4 A schematic diagram of the structure of a storage medium provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0051] In order to enable those skilled in the art to better understand the technical solution of the present invention, the technical solution in the embodiment of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiment of the present invention. Obviously, the described embodiment is a part of the embodiment of the present invention, not all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0052] See also Figure 1 ,An embodiment of the present invention discloses a text topic extraction method based on knowledge enhancement, including the following steps: S1: pre-processing the text to be extracted;

[0053] S2: Perform word embedding processing on the text to be extracted after pre-processing to obtain the features of the text to be extracted;

[0054] The feature of the text to be extracted is fused with the obtained domain feature matching the feature of the text to be extracted to obtain a fused feature;

[0055] Perform topic extraction on the fused features to obtain the text topic.

[0056] The embodiment of the present invention fuses the features of the text to be extracted with the obtained domain features that match the features of the text to be extracted to obtain fused features, and extracts themes from the fused features. This can achieve knowledge enhancement for texts in different fields, effectively dealing with the problem that a single algorithm cannot accurately capture themes when facing multi-domain feature texts, and emphasizes special proprietary words in texts in different fields, and uses them to enrich text resources, helping to improve the extraction results, so as to enhance the pertinence and robustness of the topic extraction model when facing domain texts with different feature distributions. This can achieve knowledge enhancement for texts in different fields, and effectively deal with the problem that a single algorithm cannot accurately capture themes when facing multi-domain feature texts.

[0057] See also Figure 2 Another embodiment of the present invention discloses a text topic extraction method based on knowledge enhancement, comprising the following steps:

[0058] Pre-process the text to be extracted;

[0059] The length of the pre-processed text to be extracted is judged, and the text to be extracted is divided into long text and short text;

[0060] When the text to be extracted is a long text, the pre-processed text to be extracted is subjected to word embedding processing to obtain the features of the text to be extracted, and the features of the text to be extracted are fused with the obtained domain features that match the features of the text to be extracted to obtain fused features, and the fused features are subjected to topic extraction to obtain the text topic;

[0061] When the text to be extracted is a short text, keyword extraction is performed on the text to be extracted after pre-processing, and the extracted keywords are used as the text theme.

[0062] The embodiment of the present invention introduces a knowledge enhancement module into the topic extraction algorithm to achieve domain differentiation of the input text, and performs more targeted topic extraction on texts involving different feature distributions. First, the use of the BertTopic and KeyBert algorithms themselves avoids the requirements of the previous topic extraction model on the quality of the input text, increases the robustness of the algorithm, and enables the model to complete the task well even when faced with various texts of varying quality; secondly, in the face of texts of varying lengths, this patent introduces the BertTopic and KeyBert algorithms to process long and short texts respectively, avoiding the situation where the quality of short text topic extraction is low or even normal extraction cannot be performed; finally, knowledge enhancement is achieved for texts in different fields, effectively dealing with the problem that a single algorithm cannot accurately capture topics when faced with multi-field feature texts.

[0063] Furthermore, the pre-processed text to be extracted is subjected to word embedding processing, specifically including: embedding the text into word vectors through the Bert pre-training model, and converting discrete and non-continuous text data into continuous vector feature representation.

[0064] Furthermore, the length of the text to be extracted after pre-processing is judged, and the text to be extracted is divided into long text and short text, which specifically includes: obtaining the number of words in the text to be extracted after pre-processing, classifying the text to be extracted with a number of words greater than a preset threshold as a long text, and classifying the text to be extracted with a number of words less than or equal to the preset threshold as a short text. The preset threshold can be customized according to the specific scenario. In this patent, the judgment of long and short chapters is set to a length of 50 words based on the algorithm test results, that is, the preset threshold is set to 50 words. When the number of words is greater than 50 words, the text to be extracted is classified as a long text. When the number of words is less than 50 words, the text to be extracted is classified as a short text.

[0065] For short texts, since their content is limited, KeyBert is directly used to extract keywords as the topic results.

[0066] Furthermore, keyword extraction is performed on the pre-processed text to be extracted, specifically including: using the KeyBert algorithm to extract keywords from the pre-processed text to be extracted to obtain keywords that best describe the entire text.

[0067] The KeyBert algorithm is used to extract keywords from the pre-processed text to be extracted, including:

[0068] Perform word embedding processing on the text to be extracted after pre-processing;

[0069] Candidate word generation: Candidate words are obtained through word segmentation (such as jieba word segmentation, pkuseg word segmentation, etc.) and removal of stop words. In addition, candidate words can also be accumulated from a business perspective, such as through accumulated app names, various entity library data, etc.

[0070] Keyword extraction: Use BERT embedding and cosine similarity calculation to find the words / phrases most similar to the document. Specifically, KeyBert uses the BERT pre-trained model to obtain the embedding representation of the document / candidate word, then uses the word embedding model to extract n-gram words or keywords as candidate words, and uses cosine similarity to calculate the similarity between the candidate word and the document embedding. Then, the most similar word / phrase is identified as the keyword that best describes the entire document.

[0071] Furthermore, the extracted text is pre-processed, including data cleaning, word segmentation, stop word removal, and deduplication. Data cleaning mainly uses regular expressions to delete special symbols and some useless words that appear in the text to ensure that the text is clean and tidy. Stop word removal is to remove some high-frequency and meaningless words and characters such as function words and conjunctions that appear in the text according to the stop word list, so as not to affect the results of the subsequent topic extraction algorithm.

[0072] Furthermore, the text topic extraction method based on knowledge enhancement of the present invention also includes obtaining domain features that match the features of the text to be extracted;

[0073] Obtaining a domain feature that matches the text feature to be extracted, specifically including: using an inverted index, searching for N vector documents with top N similarities to the text feature to be extracted from a vector knowledge base as domain features, wherein the vector knowledge base stores preset knowledge vectors of various fields;

[0074] The feature fusion of the text features to be extracted and the obtained domain features specifically includes: merging the N vector documents with the top N similarity rankings searched out with the text features to be extracted to achieve feature fusion.

[0075] An inverted index is a data structure used to quickly locate documents containing specific keywords in a large collection of documents. The inverted index is keyword-centric and maps each keyword to a list of documents containing the keyword. This inverted structure enables search engines to efficiently respond to each query and quickly return relevant documents.

[0076] The text topic extraction method based on knowledge enhancement of the present invention also includes:

[0077] Segment all documents in the database (i.e., preset domain features, selected as needed) to form a vocabulary, remove stop words, and deduplicate words, and assign a unique identifier to each word in the vocabulary;

[0078] Traverse each document, segment each document, remove stop words and deduplicate, obtain several words, map each word and identifier of the document to each other, form the document ID of the document, and save it in the form of a dictionary;

[0079] For each word in the vocabulary, an inverted list is created, the list containing all document IDs mapped to the word, and the word is associated with the document containing the word.

[0080] After the list is constructed, the list content is converted into feature vectors, and the words and document content are embedded to form a vector knowledge base.

[0081] After embedding, the document is converted into a vector document.

[0082] Searching the vector knowledge base for the top N vector documents with the similarity to the text feature to be extracted as the domain feature, specifically including: matching the text feature to be extracted (the words remaining after the text to be extracted is equivalent to its feature) with the vector knowledge base to obtain all vector documents containing the text feature to be extracted (containing the text feature to be extracted means containing at least one word after the text to be extracted is segmented);

[0083] After that, similarity calculations are performed one by one, and the top N vector documents ranked by similarity are extracted as domain features.

[0084] The N vector documents ranked top N in similarity after searching are merged with the text features to be extracted, specifically including: concatenating and merging the N vector documents with the text features to be extracted to achieve feature fusion.

[0085] Furthermore, the similarity calculation may adopt cosine similarity calculation.

[0086] The vector knowledge base stores preset knowledge vectors in various fields. The knowledge base only contains a list of some important proper nouns in the field to enhance the domain characteristics, and does not introduce additional text information into the text to be extracted.

[0087] A specific implementation method is: the text to be extracted is embedded through a general pre-trained model, and then the inverted index is used to search the vector knowledge base for the top three similarity vector documents and merge them with the vector of the text to be extracted after embedding to achieve feature fusion. The fused features will enter the topic extraction module for the final extraction work.

[0088] Furthermore, the fusion features are subjected to topic extraction, specifically including: extracting the fusion features using the BertTopic algorithm;

[0089] The BertTopic algorithm is used to extract the fused features, which includes: reducing the dimension and clustering the fused features, and then using the c-TF-IDF algorithm to select the top M words with the highest scores in the category as the final topic. BertTopic is more suitable for topic extraction of long texts.

[0090] Dimensionality Reduction: Since the dimensionality of BERT embeddings is usually high, the BertTopic algorithm uses dimensionality reduction techniques such as UMAP to map the embeddings to a lower dimensional space for more effective clustering.

[0091] Clustering: Apply a clustering algorithm (such as HDBSCAN) on the embedded space after dimensionality reduction to divide the documents into different clusters, each cluster representing a topic.

[0092] Topic representation: For each cluster (i.e. topic), the c-TF-IDF algorithm is used to extract topic words. These topic words are the most representative words in the cluster and are used to represent the content of the topic.

[0093] Based on the same inventive concept, an embodiment of the present invention further discloses a multi-domain text topic extraction device based on knowledge enhancement, comprising:

[0094] A pre-processing module, wherein the pre-processing module is used to pre-process the text to be extracted;

[0095] A word embedding module, which is used to perform word embedding processing (embedding) on ​​the pre-processed text to be extracted to obtain features of the text to be extracted;

[0096] A feature fusion module, wherein the feature fusion module is used to fuse the features of the text to be extracted with the obtained domain features that match the features of the text to be extracted to obtain fused features;

[0097] The topic extraction module is used to extract topics from the fused features to obtain text topics.

[0098] The function of the pre-processing module is to use the stop word list to delete some frequently appearing function words in the text to prevent the high word frequency from affecting the algorithm clustering effect, and ultimately causing the model to output a large number of meaningless words. Some rule matching will also be inserted to process special symbols and dirty information that may appear in the text.

[0099] The feature fusion module performs domain feature fusion on the long text after embedding to ensure sufficient injection of domain information.

[0100] The pre-processing module removes stop words from the text to be extracted, and inputs the relatively clean text containing only key information into the subsequent module. The feature fusion module extracts and fuses the features of the text to be extracted with the shared features between fields to ensure the richness of the distribution of the features of the text to be extracted. The topic extraction module uses two methods to extract topics from texts of different lengths, mainly to ensure that short texts can also be effectively implemented under this framework.

[0101] In other embodiments, the multi-domain text topic extraction device based on knowledge enhancement of the present invention further includes a classification module, wherein the classification module is used to judge the length of the pre-processed text to be extracted and divide the text to be extracted into long text and short text;

[0102] When the text to be extracted is a long text, the topic extraction module is used to extract the topic of the fused features to obtain the text topic;

[0103] When the text to be extracted is a short text, the topic extraction module is used to extract keywords from the pre-processed text to be extracted, and the extracted keywords are used as the text theme. The topic extraction module of this embodiment applies the Berttopic algorithm and the KeyBert algorithm to texts of different lengths to ensure the effectiveness and readability of the topic extraction results.

[0104] Figure 3 An electronic device provided by an embodiment of the present disclosure, such as Figure 3 As shown, the electronic device 100 includes: a memory 101 and a processor 102, and the memory 101 stores a computer program, wherein the computer program implements the above-mentioned text topic extraction method based on knowledge enhancement when executed by the processor 102.

[0105] The electronic device 100 may include, but is not limited to, a processor 102 and a memory 101. Those skilled in the art will appreciate that Figure 3 It is only an example of the electronic device 100 and does not constitute a limitation of the electronic device 100. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, the electronic device 100 may also include input and output devices, network access devices, buses, etc.

[0106] The processor 102 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor 102 may be a microprocessor or any conventional processor, etc.

[0107] The memory 101 may be an internal storage unit of the electronic device 100, such as a hard disk or memory of the electronic device 100. The memory 101 may also be an external storage device of the electronic device 100, 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 (Flash Card), etc. equipped on the electronic device 100. Further, the memory 101 may also include both an internal storage unit of the electronic device 100 and an external storage device. The memory 101 is used to store the computer program and other programs and data required by the terminal device. The memory 101 may also be used to temporarily store data that has been output or is to be output.

[0108] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.

[0109] Figure 4 A schematic diagram of a storage medium provided in an embodiment of the present disclosure is shown in FIG. Figure 4As shown, a computer program 201 is stored on the storage medium 200, wherein the computer program 201 implements the above-mentioned text topic extraction method based on knowledge enhancement when executed by the processor. The storage medium 200 includes, but is not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disk (DVD) or other optical disk storage, magnetic cassette, magnetic tape, magnetic disk storage or other magnetic storage device, or any other medium that can be used to store the desired information and can be accessed by the computer. In addition, it is well known to those of ordinary skill in the art that communication media generally contain computer-readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier or other transmission mechanism, and may include any information delivery medium.

[0110] It is to be understood that the above embodiments are merely exemplary embodiments used to illustrate the principles of the present invention, but the present invention is not limited thereto. For those of ordinary skill in the art, various modifications and improvements can be made without departing from the spirit and essence of the present invention, and these modifications and improvements are also considered to be within the scope of protection of the present invention.

Claims

1. A text topic extraction method based on knowledge enhancement, It is characterized in that The steps include: S1: Pre-process the text to be extracted; S2: Perform word embedding processing on the text to be extracted after pre-processing to obtain the features of the text to be extracted; The feature of the text to be extracted is fused with the obtained domain feature matching the feature of the text to be extracted to obtain a fused feature; Perform topic extraction on the fused features to obtain the text topic.

2. According to the text topic extraction method based on knowledge enhancement according to claim 1, Features: After step S1, the following steps are also included: judging the length of the pre-processed text to be extracted, and dividing the text to be extracted into long text and short text; When the text to be extracted is a long text, execute step S2; When the text to be extracted is a short text, keyword extraction is performed on the text to be extracted after pre-processing, and the extracted keywords are used as the text theme.

3. According to the text topic extraction method based on knowledge enhancement according to claim 2, Features: The length of the text to be extracted after pre-processing is judged, and the text to be extracted is divided into long text and short text, specifically including: obtaining the number of words in the text to be extracted after pre-processing, classifying the text to be extracted with a number of words greater than a preset threshold as a long text, and classifying the text to be extracted with a number of words less than or equal to the preset threshold as a short text.

4. According to the text topic extraction method based on knowledge enhancement according to claim 2, Features: The keyword extraction is performed on the pre-processed text to be extracted, specifically including: using the KeyBert algorithm to extract keywords from the pre-processed text to be extracted, and obtaining keywords that best describe the entire text.

5. According to the text topic extraction method based on knowledge enhancement according to claim 1, Features: Pre-process the extracted text, including data cleaning, word segmentation and stop word removal.

6. The text topic extraction method based on knowledge enhancement according to claim 1, Features: It also includes obtaining domain features that match the text features to be extracted; Obtaining a domain feature that matches the text feature to be extracted, specifically comprising: searching for N vector documents with top N similarities to the text feature to be extracted from a vector knowledge base as domain features, wherein the vector knowledge base stores preset knowledge vectors of various fields; The feature fusion of the text features to be extracted and the obtained domain features specifically includes: merging the N vector documents with the top N similarity rankings searched out with the text features to be extracted to achieve feature fusion.

7. The text topic extraction method based on knowledge enhancement according to claim 1, Features: Extracting topics from fused features, specifically including: extracting fused features using the BertTopic algorithm; The BertTopic algorithm is used to extract the fused features, which includes: reducing the dimension and clustering the fused features, and then using the c-TF-IDF algorithm to select the top M words with the highest scores in the category as the final topic.

8. A multi-domain text topic extraction device based on knowledge enhancement, It is characterized in that include: A pre-processing module, wherein the pre-processing module is used to pre-process the text to be extracted; A word embedding module, which is used to perform word embedding processing on the pre-processed text to be extracted to obtain features of the text to be extracted; A feature fusion module, wherein the feature fusion module is used to fuse the features of the text to be extracted with the obtained domain features that match the features of the text to be extracted to obtain fused features; The topic extraction module is used to extract topics from the fused features to obtain text topics.

9. The multi-domain text topic extraction device based on knowledge enhancement according to claim 8, Features: It also includes a classification module, which is used to judge the length of the pre-processed text to be extracted and divide the text to be extracted into long text and short text; When the text to be extracted is a long text, the topic extraction module is used to extract the topic of the fused features to obtain the text topic; When the text to be extracted is a short text, the topic extraction module is used to extract keywords from the pre-processed text to be extracted, and use the extracted keywords as the text topic.

10. An electronic device, include: It includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the text topic extraction method based on knowledge enhancement as described in any one of claims 1 to 7 when executing the computer program.

Citation Information

Patent Citations

  • Multi-source information oriented mixed text topic discovery methodixed text topic discovery method for multi-source information

    CN110263153A

  • Theme generation method and device, equipment and medium

    CN110442733A

  • Chinese word segmentation method and device

    CN110543637A

  • Method for calculating similarity of Chinese-Vietnamese text by fusing keywords and semantic features

    CN112257453A

  • Video bullet screen and comment theme fusion method based on text clustering

    CN115470344A