An unsupervised classification method for long texts

By extracting and fusing the weight coefficients and feature vectors of long texts, and using Chinese word segmentation and word vector models for clustering, the problems of high time complexity and low accuracy in long text classification are solved, and more efficient and accurate texts are achieved. Classification.

CN113378950BActive Publication Date: 2024-09-20SHENZHEN CHACE NETWORK INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202110691284.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-06-22
Publication Date
2024-09-20
Estimated Expiration
2041-06-22

AI Technical Summary

Technical Problem

When classifying long texts, due to the long text and complex structure, the time complexity is high and the classification accuracy is low. There are few existing studies.

Method used

By extracting the weight coefficients of the title, text and publishing department, fuse them into a new long text, and use Chinese word segmentation and word vector models to calculate feature vectors for clustering and classification, reducing time complexity and improving accuracy.

Benefits of technology

The accuracy and efficiency of long text classification are improved. By fusing weight coefficients and feature vector information, the accuracy and effect of text classification are enhanced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113378950B
    Figure CN113378950B
Patent Text Reader

Abstract

The present invention relates to an unsupervised classification method for long texts, comprising the following steps: filtering the long text to be classified, extracting the three parts of the title text, the body text and the document issuing department text in the long text to be classified; extracting the weight coefficients of the three parts of the title text, the body text and the document issuing department text; fusing the title text, the body text and the document issuing department text into a new long text T according to the extracted weight coefficients; performing Chinese word segmentation on the new long text T, extracting word segmentation information; inputting the word segmentation information into a word vector model to obtain word vector information; calculating the feature vector of the long text T according to the word vector information; clustering the feature vectors of the long text T to obtain text classification. Through the present invention, the method for long text classification is improved, the time complexity of long text classification is reduced, the accuracy of long text classification is improved, and it is more convenient for users to interpret and classify long texts.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the field of network information technology, and in particular to an unsupervised classification method for long texts. Background Art

[0002] Accurately interpreting and classifying texts, especially long texts, has become an important development issue that needs to be solved urgently for enterprise development. Since long texts are longer, and their structure and word usage are somewhat different from ordinary texts, the time complexity of classification is high and the classification accuracy is low. Currently, there are relatively few studies on long text classification. Summary of the invention

[0003] The purpose of the present invention is to overcome the deficiencies of the prior art and provide an unsupervised classification method for long texts, thereby reducing the time complexity of long text classification, improving the accuracy of long text classification, and facilitating the interpretation and classification of long texts.

[0004] The objective of the present invention is achieved through the following technical solutions:

[0005] An unsupervised classification method for long texts, comprising the following steps:

[0006] (1) Filter the long text to be classified and extract the title text from the long text to be classified t 1 , Body Text t 2 And the issuing department text t 3 Three parts;

[0007] (2) Extract title text t 1 , Body Text t 2 And the issuing department text t 3 Weight coefficients of the three parts c 1 , c 2 , c 3 ;

[0008] (3) The title text is extracted according to the weight coefficient t 1 , Body Text t 2 And the issuing department text t 3 Merge into a new long text T ;

[0009] (4) For new long text TPerform Chinese word segmentation and extract word segmentation information; input the word segmentation information into the word vector model to obtain word vector information;

[0010] (5) Calculate long text based on word vector information T The eigenvector of

[0011] (6) For long texts T The feature vectors are clustered to obtain text classification.

[0012] Furthermore, the step (2) is specifically as follows:

[0013] 2.1. Title text t 1 , Body Text t 2 And the issuing department text t 3 Preprocessing, using x 2 The statistical method selects the characteristic words of each text respectively;

[0014] 2.2. According to the characteristic words of each text, use TF-IDF and x 2 The feature evaluation function of the statistical method extracts the weight coefficient of each text respectively.

[0015] Furthermore, the step (3) is specifically as follows:

[0016] 3.1. Calculate each text separately t i Length L i ,Pick L =max( L 1 , L 2 , L 3 ), c = max( c 1 , c 2 , c 3 ),in i = 1, 2, 3;

[0017] 3.2、Text t i copy L / L i * c i / c and concatenate them together to get the textT i ;

[0018] 3.3、Text T 1 , T 2 , T 3 Connect them together in sequence to get the new long text T.

[0019] Furthermore, in step (4), the open source Chinese word segmentation tool HanLP is used to segment the new long text. T Perform Chinese word segmentation, remove stop words, and extract word segmentation information.

[0020] Furthermore, in step (4), the word vector model is a CBOW model, which is constructed using the word2vec module of the gensim package.

[0021] Furthermore, the step (5) is specifically as follows:

[0022] 5.1. Sort the vectors in the word vector information in ascending order and take the first N vector, the N Smaller than the total number of vectors in the word vector information;

[0023] 5.2 Before calculation N The center of the vector gets the long text T The feature vector of .

[0024] The beneficial effects of the present invention are as follows: by extracting the weight coefficients of the title text, the body text and the issuing department text, the extracted texts are merged into a new long text; the weight coefficients of each text are extracted according to the characteristic words of each text. , The fused new long text includes the feature word pairs and the association information between the feature words, thereby improving the accuracy of text classification. Perform Chinese word segmentation on the new long text, extract the word segmentation information, filter out irrelevant information, and input the word segmentation information into the word vector model to obtain accurate word vector information, which can be used to measure the semantic similarity of sentences, accurately calculate the similarity between texts, and facilitate the classification of similar texts. According to the word vector information, calculate the long text T The feature vector is obtained by clustering the feature vector to obtain text classification. The method of long text classification is improved by weight coefficient and feature vector, which improves the accuracy and effect of the long text classification method. BRIEF DESCRIPTION OF THE DRAWINGS

[0025] Figure 1 The figure is a schematic diagram of the structure of an unsupervised classification method for long texts of the present invention. DETAILED DESCRIPTION

[0026] The present invention is further described in detail below in conjunction with embodiments and drawings, but the embodiments of the present invention are not limited thereto.

[0027] An unsupervised classification method for long texts, comprising the following steps:

[0028] (1) Since long texts are long, and the text structure is mainly composed of three parts: title, text, and issuing department, before classifying the long text to be classified, it is necessary to filter the long text to be classified and extract the title text from the long text to be classified. t 1 , Body Text t 2 And the issuing department text t 3 Three parts.

[0029] (2) Then extract the title text t 1 , Body Text t 2 And the issuing department text t 3 Weight coefficients of the three parts c 1 , c 2 , c 3 The weight coefficient is used to indicate the importance of each text in the long text to be tested.

[0030] Preferred technical solution for title text t 1 , Body Text t 2 And the issuing department text t 3 Preprocessing, using x 2 The statistical method selects the characteristic words of each text respectively; according to the characteristic words of each text, TF-IDF and x 2 The feature evaluation function of the statistical method extracts the weight coefficient of each text respectively. By extracting the weight coefficient of each text through the feature words, the correlation information between the feature words can be obtained, thereby improving the accuracy of text classification.

[0031] (3) Add the title text according to the weight coefficient t 1 , Body Text t 2 And the issuing department text t 3 Merge into a new long text T, including the association information between feature word pairs and feature words, can effectively improve the accuracy of text classification.

[0032] The preferred technical solution is to calculate each text separately t i Length L i ,Pick L =max( L 1 , L 2 , L 3 ), c = max( c 1 , c 2 , c 3 ),in i = 1, 2, 3; t i copy L / L i * c i / c and concatenate them together to get the text T i ; Text T 1 , T 2 , T 3 The extracted title text is connected in sequence to obtain a new long text T. By adjusting the length of the extracted text, the extracted title text t 1 , Body Text t 2 And the issuing department text t 3 Merge into new long text that is easier to interpret and classify T .

[0033] (4) For new long text T Perform Chinese word segmentation, extract word segmentation information, and filter out irrelevant information; input the word segmentation information into the word vector model to obtain word vector information, which is used to measure the semantic similarity of sentences, accurately calculate the similarity between texts, and facilitate the classification of similar texts.

[0034] The preferred technical solution uses the open source Chinese word segmentation tool HanLP to segment new long texts TPerform Chinese word segmentation, remove stop words, and extract word segmentation information. The open source Chinese word segmentation tool HanLP is a toolkit composed of a series of model budget methods, which can provide functions such as lexical analysis, syntactic analysis, text analysis, and sentiment analysis. It has the characteristics of complete functions, efficient performance, clear architecture, up-to-date corpus, and customizability. The underlying layer uses a series of high-speed data structures, and the word segmentation rate can reach 20 million words / second, while the relative memory usage is only 120MB; in terms of IO, the dictionary loading speed is extremely fast, and it can be quickly started in just 500 ms. Its efficiency and applicability are more suitable for Chinese word segmentation of long texts.

[0035] The preferred technical solution is that the word vector model is a CBOW model, which is constructed through the word2vec module of the gensim package. The model construction is simple and it is convenient to perform word vectorization. In the CBOW model, the central word is predicted by the surrounding words, and the prediction results of the central word are used to continuously adjust the vectors of the surrounding words using the GradientDesent method; after the word segmentation information is input into the CBOW model, each word will be used as the central word, and the CBOW model will uniformly adjust the surrounding words to obtain the word vectors of all words in the entire text, so that the gradient value obtained will also act on the word vectors of each surrounding word. The number of prediction behaviors of the CBOW model is almost equal to the number of words in the entire text, but it is more efficient and faster.

[0036] (5) Calculate long text based on word vector information T The eigenvector of

[0037] The preferred technical solution is to sort the vectors in the word vector information in ascending order and take the first N vectors, N Less than the total number of vectors in the word vector information; before calculation N The center of the vector gets the long text T The feature vector of .

[0038] (6) For long texts T The feature vectors are clustered to obtain text classification, which has higher accuracy and lower time complexity for classifying long texts.

[0039] The present invention solves the problem of high time complexity and low classification accuracy when executing classification due to the long text, text structure and word usage habits of long text. By improving the long text classification method, the accuracy and effect of the long text classification method are further improved, which is more suitable for interpreting and classifying long texts.

[0040] It should be stated that the above-mentioned specific implementation methods are only preferred embodiments of the present invention and the technical principles used. Within the technical scope disclosed by the present invention, any changes, modifications, substitutions, combinations and simplifications made by any technician familiar with the technical field without departing from the spirit and principles of the present invention should be equivalent replacement methods and should be covered by the protection scope of the present invention.

Claims

1. An unsupervised classification method for long texts, characterized in that: The following steps are involved: (1) Filter the long text to be classified and extract the title text from the long text to be classified t 1 , Body Text t 2 And the issuing department text t 3 Three parts; (2) Extract title text t 1 , Body Text t 2 And the issuing department text t 3 Weight coefficients of the three parts c 1 , c 2 , c 3 ; (3) The title text is extracted according to the weight coefficient t 1 , Body Text t 2 And the issuing department text t 3 Merge into a new long text T ; (4) For new long text T Perform Chinese word segmentation and extract word segmentation information; input the word segmentation information into the word vector model to obtain word vector information; (5) Calculate long text based on word vector information T The eigenvector of (6) For long texts T The feature vectors are clustered to obtain text classification. The step (2) is specifically as follows: 2.

1. Title text t 1 , Body Text t 2 And the issuing department text t 3 Preprocessing, using x 2 The statistical method selects the characteristic words of each text respectively; 2.

2. According to the characteristic words of each text, use TF-IDF and x 2 The characteristic evaluation function of the statistical method extracts the weight coefficient of each text respectively; The step (3) is specifically as follows: 3.

1. Calculate each text separately t i Length L i ,Pick L =max( L 1 , L 2 , L 3 ), c = max( c 1 , c 2 , c 3 ),in i = 1, 2, 3; 3.2、Text t i copy L / L i * c i / c and concatenate them together to get the text T i ; 3.3、Text T 1 , T 2 , T 3 Connect them together in sequence to get a new long text T, The step (5) is specifically as follows: 5.

1. Sort the vectors in the word vector information in ascending order and take the first N vector, the N Smaller than the total number of vectors in the word vector information; 5.2 Before calculation N The center of the vector gets the long text T The feature vector of .

2. The unsupervised classification method for long text according to claim 1, characterized in that: In step (4), the open source Chinese word segmentation tool HanLP is used to segment the new long text. T Perform Chinese word segmentation, remove stop words, and extract word segmentation information.

3. The unsupervised classification method for long text according to claim 1, characterized in that: In the step (4), the word vector model is a CBOW model, which is constructed using the word2vec module of the gensim package.