Text classification method, device, equipment and computer-readable storage medium

By importing the abstract corpus, title, and keyword corpus of the target text into the text representation model, generating feature vectors and classifying them, the problem of low text classification accuracy and efficiency in the existing technology is solved, and more efficient text classification is achieved.

CN112784052BActive Publication Date: 2024-09-20CHINA PING AN LIFE INSURANCE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202110276830.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-03-15
Publication Date
2024-09-20
Estimated Expiration
2041-03-15

AI Technical Summary

Technical Problem

Existing text classification methods rely on external knowledge bases and files for feature expansion, resulting in low accuracy and efficiency, and cannot handle terms that are not in the knowledge base.

Method used

By obtaining the summary corpus, title, and keyword corpus of the target text, import the preset text representation model, generate the first feature vector, and input it into the classifier to improve classification accuracy and efficiency.

Benefits of technology

It improves the accuracy and efficiency of text classification, can effectively handle terms that are not in the knowledge base, and improves the accuracy of classification results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112784052B
    Figure CN112784052B
Patent Text Reader

Abstract

The embodiment of the present application discloses a text classification method, apparatus, device and computer-readable storage medium, the method comprising: first, obtaining a target corpus of a target text, the target text comprising a title, an abstract and keywords, the target corpus comprising an abstract corpus and a title and keyword corpus, then, importing the target corpus into a trained text representation model, obtaining a first feature vector of the target text, the first feature vector being used to reflect the title, abstract and keywords of the target text, then, importing the first feature vector into a first classifier, obtaining a classification result of the target text, the classification result comprising a first classification category and a confidence level, if the confidence level is greater than or equal to a first threshold, determining the first classification category as the category of the target text. The embodiment of the present application is conducive to improving the accuracy and efficiency of text classification.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of data classification, and in particular to a text classification method, apparatus, device and computer-readable storage medium. Background Art

[0002] With the development of data classification technology, in order to facilitate users to quickly obtain the required data, it is often necessary to classify the data. At present, with the continuous growth of the number of scientific researchers, academic literature has also increased dramatically. As an important part of the data, text classification is particularly important.

[0003] In the prior art, the main methods of text classification include using an external knowledge base to explore the relationship between words within a language, or using external files to expand the features of short texts. In this way, the semantic relationship between most words can be discovered, but the features of words that are not in the knowledge base cannot be expanded. Therefore, the accuracy of text classification is low, and expansion with the help of external files requires a lot of time, resulting in low efficiency of text classification. Summary of the invention

[0004] The embodiments of the present application provide a text classification method, apparatus, device and computer-readable storage medium, so as to obtain a first feature vector of the target text by importing the acquired abstract corpus and title and keyword corpus of the target text into a pre-set text representation model, and then import the first feature vector into a first classifier to obtain a classification result of the target text, thereby improving the accuracy and efficiency of text classification.

[0005] In a first aspect, an embodiment of the present application provides a text classification method, comprising:

[0006] Obtain a target corpus of a target text, wherein the target text includes a title, an abstract, and keywords, and the target corpus includes an abstract corpus and a title and keyword corpus;

[0007] Importing the target corpus into the trained text representation model to obtain a first feature vector of the target text, where the first feature vector is used to reflect the title, abstract, and keywords of the target text;

[0008] Importing the first feature vector into a first classifier to obtain a classification result of the target text, wherein the classification result includes a first classification category and a confidence level;

[0009] If the confidence level is greater than or equal to a first threshold, the first classification category is determined to be the category of the target text.

[0010] In a possible example, the step of obtaining a target corpus set of a target text includes: performing sentence processing on a summary of the target text to obtain a plurality of sentences; obtaining a Euclidean distance between every two sentences in the plurality of sentences; and obtaining the summary corpus according to the Euclidean distance between every two sentences.

[0011] In a possible example, obtaining the summary corpus according to the Euclidean distance between each two sentences includes: judging whether the Euclidean distance between the two sentences currently being processed is greater than a preset threshold; if the Euclidean distance between the two sentences currently being processed is less than or equal to the preset threshold, determining that the two sentences currently being processed are corpus in the summary corpus; if the Euclidean distance between the two sentences currently being processed is greater than the preset threshold, determining that the two sentences currently being processed are not corpus in the summary corpus.

[0012] In a possible example, the text representation model is obtained by performing the following operations: obtaining an original corpus; preprocessing the original corpus; obtaining a first corpus based on the preprocessed original corpus; performing Word2Vec word vector training based on the first corpus to obtain a first result; obtaining a long text corpus; obtaining a second corpus based on the preprocessed long text corpus; processing the second corpus according to a text summary extraction algorithm to obtain a summary corpus; obtaining a title and a keyword corpus based on the second corpus; obtaining a third corpus based on the summary corpus and the title and keyword corpus; removing high-frequency words in the third corpus to obtain a clean corpus; performing LDA training on the clean corpus to obtain a topic-word distribution matrix; and obtaining the text representation model based on the first result and the topic-word distribution matrix.

[0013] In one possible example, after importing the first feature vector into the first classifier to obtain the classification result of the target text, the method also includes: if the confidence level is less than the first threshold, importing the first feature vector into the second model and the third model respectively to obtain the second classification result and the third classification result; and obtaining the category of the target text according to the first classification result, the second classification result and the third classification result.

[0014] In a second aspect, an embodiment of the present application provides a text classification device, the device comprising:

[0015] An acquisition unit, configured to acquire a target corpus of a target text, wherein the target text includes a title, an abstract, and keywords, and the target corpus includes an abstract corpus and a title and keyword corpus;

[0016] A first feature vector acquisition unit, used for importing the target corpus into the trained text representation model to obtain a first feature vector of the target text, wherein the first feature vector is used to reflect the title, abstract and keywords of the target text;

[0017] A classification result acquisition unit, used for importing the first feature vector into a first classifier to obtain a classification result of the target text, wherein the classification result includes a first classification category and a confidence level;

[0018] The text category determination unit is configured to determine that the first classification category is the category of the target text if the confidence level is greater than or equal to a first threshold.

[0019] In a possible example, in terms of acquiring the target corpus of the target text, the acquisition unit is specifically used to: perform sentence processing on the summary of the target text to obtain a plurality of sentences; obtain the Euclidean distance between every two sentences in the plurality of sentences; and obtain the summary corpus based on the Euclidean distance between every two sentences.

[0020] In a possible example, in the aspect of obtaining the summary corpus according to the Euclidean distance between each two sentences, the acquisition unit is specifically used to: determine whether the Euclidean distance between the two sentences currently being processed is greater than a preset threshold; if the Euclidean distance between the two sentences currently being processed is less than or equal to the preset threshold, determine that the two sentences currently being processed are corpus in the summary corpus; if the Euclidean distance between the two sentences currently being processed is greater than the preset threshold, determine that the two sentences currently being processed are not corpus in the summary corpus.

[0021] In a possible example, the text representation model is obtained by performing the following operations: obtaining an original corpus; preprocessing the original corpus; obtaining a first corpus based on the preprocessed original corpus; performing Word2Vec word vector training based on the first corpus to obtain a first result; obtaining a long text corpus; obtaining a second corpus based on the preprocessed long text corpus; processing the second corpus according to a text summary extraction algorithm to obtain a summary corpus; obtaining a title and a keyword corpus based on the second corpus; obtaining a third corpus based on the summary corpus and the title and keyword corpus; removing high-frequency words in the third corpus to obtain a clean corpus; performing LDA training on the clean corpus to obtain a topic-word distribution matrix; and obtaining the text representation model based on the first result and the topic-word distribution matrix.

[0022] In a possible example, the text category determination unit 404 is also used to: import the first feature vector into the first classifier to obtain the classification result of the target text, and if the confidence is less than the first threshold, import the first feature vector into the second model and the third model respectively to obtain the second classification result and the third classification result; obtain the category of the target text according to the first classification result, the second classification result and the third classification result.

[0023] In a third aspect, an embodiment of the present application provides an electronic device, comprising a processor, a memory, a communication interface, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the processor, and the program includes instructions for executing the steps of any method in the first aspect of the embodiment of the present application.

[0024] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program for electronic request exchange, wherein the computer program enables a computer to execute part or all of the steps described in any method of the first aspect of the embodiment of the present application.

[0025] In a fifth aspect, an embodiment of the present application provides a computer program product, wherein the computer program product includes a non-transitory computer-readable storage medium storing a computer program, and the computer program is operable to cause a computer to execute some or all of the steps described in any method of the first aspect of the embodiment of the present application. The computer program product may be a software installation package.

[0026] It can be seen that in the embodiment of the present application, first, a target corpus of a target text is obtained, the target text includes a title, an abstract and keywords, and the target corpus includes an abstract corpus and a title and keyword corpus. After that, the target corpus is imported into a trained text representation model to obtain a first feature vector of the target text, and the first feature vector is used to reflect the title, abstract and keywords of the target text. Then, the first feature vector is imported into a first classifier to obtain a classification result of the target text, and the classification result includes a first classification category and a confidence level. If the confidence level is greater than or equal to a first threshold, the first classification category is determined to be the category of the target text. It can be seen that the embodiment of the present application obtains the first feature vector of the target text by importing the abstract corpus and the title and keyword corpus of the acquired target text into a pre-set text representation model, and then imports the first feature vector into a first classifier to obtain a classification result of the target text, thereby improving the accuracy and efficiency of text classification. BRIEF DESCRIPTION OF THE DRAWINGS

[0027] In order to more clearly illustrate the embodiments of the present application 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 application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0028] Figure 1 It is a flowchart of a text classification method provided in an embodiment of the present application;

[0029] Figure 2 It is a flowchart of another text classification method provided in an embodiment of the present application;

[0030] Figure 3 It is a structural schematic diagram of an electronic device provided in an embodiment of the present application;

[0031] Figure 4 It is a block diagram of the functional units of a text classification device provided in an embodiment of the present application. DETAILED DESCRIPTION

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

[0033] The terms "first", "second", etc. in the specification and claims of this application and the above-mentioned drawings are used to distinguish different objects, rather than to describe a specific order. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but optionally includes steps or units that are not listed, or optionally includes other steps or units inherent to these processes, methods, products or devices.

[0034] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.

[0035] At present, the main methods of text classification include using external knowledge bases to explore the relationship between words within the language, or using external files to expand the features of short texts. This can discover the semantic relationship between most words, but the words that are not in the knowledge base cannot be expanded. Therefore, the accuracy of text classification is low, and expansion with the help of external files requires a lot of time, resulting in low efficiency of text classification.

[0036] In view of the above problems, the present application proposes a text classification method, and an embodiment of the present application is described in detail below with reference to the accompanying drawings.

[0037] See also Figure 1 , Figure 1 1 is a flowchart of a text classification method provided in an embodiment of the present application. As shown in FIG. 1 , the text classification method includes steps S101 to S104:

[0038] S101, obtaining a target corpus of a target text, wherein the target text includes a title, an abstract, and keywords, and the target corpus includes an abstract corpus and a title and keyword corpus.

[0039] Among them, the category of the text can be pre-set based on different classification habits. Optionally, the category of the text can be pre-set to news, papers, novels, etc. In this classification method, the target text can include news text, paper text, novel text, etc.; Optionally, the category of the text can be pre-set to voiceprint recognition, fingerprint recognition, face recognition, etc. In this classification method, the target text can include voiceprint recognition text, fingerprint recognition text, face recognition text, etc. It can be understood that there is no specific limitation on the setting of the text category, that is, there is no specific limitation on the category of the target text. In specific implementation, the user can pre-set the category of the text according to needs.

[0040] Optionally, the step of obtaining a target corpus of a target text includes: performing sentence processing on a summary of the target text to obtain a plurality of sentences; obtaining a Euclidean distance between every two sentences in the plurality of sentences; and obtaining the summary corpus according to the Euclidean distance between every two sentences.

[0041] The summary of the target text may be segmented into sentences to obtain a plurality of sentences by using punctuation marks as semantic segmentation criteria, for example, in the summary, except for the words and sentences before the first punctuation mark as one corpus, the words and sentences between two punctuation marks are one corpus.

[0042] Further, obtaining the summary corpus according to the Euclidean distance between each two sentences includes: judging whether the Euclidean distance between the two sentences currently being processed is greater than a preset threshold; if the Euclidean distance between the two sentences currently being processed is less than or equal to the preset threshold, determining that the two sentences currently being processed are corpus in the summary corpus; if the Euclidean distance between the two sentences currently being processed is greater than the preset threshold, determining that the two sentences currently being processed are not corpus in the summary corpus.

[0043] The user may set the preset threshold as required, and there is no specific limitation on the preset threshold.

[0044] Optionally, the obtaining of the target corpus set of the target text includes: determining the title as one corpus, and determining each of the multiple keywords as one corpus.

[0045] The method involved in the present application is applied to electronic equipment.

[0046] S102, importing the target corpus into a trained text representation model to obtain a first feature vector of the target text, where the first feature vector is used to reflect the title, abstract, and keywords of the target text.

[0047] Optionally, the text representation model is obtained by performing the following operations: obtaining an original corpus; preprocessing the original corpus; obtaining a first corpus based on the preprocessed original corpus; performing Word2Vec word vector training based on the first corpus to obtain a first result; obtaining a long text corpus; obtaining a second corpus based on the preprocessed long text corpus; processing the second corpus according to a text summary extraction algorithm to obtain a summary corpus; obtaining a title and keyword corpus based on the second corpus; obtaining a third corpus based on the summary corpus and the title and keyword corpus; removing high-frequency words in the third corpus to obtain a clean corpus; performing LDA training on the clean corpus to obtain a topic-word distribution matrix; and obtaining the text representation model based on the first result and the topic-word distribution matrix.

[0048] The original corpus refers to a short text corpus, and the difference between the original text and the long text can be distinguished by the number of words. The specific determination method can be to determine whether the number of words in the text is more than a preset number of words; if so, the text is indeed an original text; if not, the text is indeed a long text. The preset number of words can be one thousand words, ten thousand words, two thousand words, etc., without specific limitation.

[0049] The method for obtaining the original corpus may be: determining multiple original samples in the training sample set; performing word segmentation on each of the multiple original samples to obtain the original corpus. Similarly, the method for obtaining the long text corpus may be: determining multiple long text samples in the training sample set; performing word segmentation on each of the multiple long text samples to obtain the long text corpus.

[0050] Among them, preprocessing refers to word segmentation and stop word removal of the text corpus (including the original corpus and the long text corpus).

[0051] The implementation method of processing the second corpus set according to the text summary extraction algorithm to obtain the summary corpus may be: the Euclidean distance between each two corpora among the multiple corpora corresponding to the summary in the second corpus set; and obtaining the summary corpus according to the Euclidean distance between each two corpora. Further, obtaining the summary corpus according to the Euclidean distance between each two corpora includes: judging whether the Euclidean distance between the two corpora currently being processed is greater than a preset threshold; if the Euclidean distance between the two corpora currently being processed is greater than the preset threshold, determining that the two corpora currently being processed are corpora in the summary corpus; if the Euclidean distance between the two corpora currently being processed is greater than the preset threshold, determining that the two corpora currently being processed are not corpora in the summary corpus.

[0052] The method of obtaining the topic and keyword corpus according to the second corpus set may be: determining the topic as one corpus, and determining each of the multiple keywords as one corpus.

[0053] The high-frequency words in the third corpus may be words that appear in the top 20 percent of frequency in the third corpus.

[0054] S103, importing the first feature vector into a first classifier to obtain a classification result of the target text, wherein the classification result includes a first classification category and a confidence level.

[0055] The first classifier includes but is not limited to an svm classifier.

[0056] S104: If the confidence level is greater than or equal to a first threshold, determining that the first classification category is the category of the target text.

[0057] The first threshold may be 0.8, 0.7, or 0.9, and there is no specific limitation on the first threshold. In a specific implementation, the user may set the first threshold as needed.

[0058] It can be seen that in the embodiment of the present application, first, a target corpus of a target text is obtained, the target text includes a title, an abstract and keywords, and the target corpus includes an abstract corpus and a title and keyword corpus. After that, the target corpus is imported into a trained text representation model to obtain a first feature vector of the target text, and the first feature vector is used to reflect the title, abstract and keywords of the target text. Then, the first feature vector is imported into a first classifier to obtain a classification result of the target text, and the classification result includes a first classification category and a confidence level. If the confidence level is greater than or equal to a first threshold, the first classification category is determined to be the category of the target text. It can be seen that the embodiment of the present application obtains the first feature vector of the target text by importing the abstract corpus and the title and keyword corpus of the acquired target text into a pre-set text representation model, and then imports the first feature vector into a first classifier to obtain a classification result of the target text, thereby improving the accuracy and efficiency of text classification.

[0059] In one possible example, after importing the first feature vector into the first classifier to obtain the classification result of the target text, the method also includes: if the confidence level is less than the first threshold, importing the first feature vector into the second model and the third model respectively to obtain the second classification result and the third classification result; and obtaining the category of the target text according to the first classification result, the second classification result and the third classification result.

[0060] The second model includes but is not limited to a trained KNN model, and the third model includes but is not limited to a trained NB model.

[0061] Among them, the implementation method of obtaining the category of the target text based on the first classification result, the second classification result and the third classification result can be: if any two classification results among the first classification result, the second classification result and the third classification result are different from each other, then the first classification result is determined to be the category of the target text; if at least two classification results among the first classification result, the second classification result and the third classification result are the same, then the classification result with the highest frequency is determined as the category of the target text.

[0062] For example, if the first classification result of text A is face recognition, the second classification result is fingerprint recognition, and the third classification result is vein recognition, then face recognition is determined as the category of the target text; for another example, if the first classification result and the second classification result of text A are vein recognition, and the third classification result is iris recognition, then vein recognition is determined as the category of the target text; for another example, if the second classification result and the third classification result of text A are voiceprint recognition, and the first classification result is iris recognition, then voiceprint recognition is determined as the category of the target text; for another example, if the first classification result, the second classification result, and the third classification result of text A are all voiceprint recognition, then voiceprint recognition is determined as the category of the target text.

[0063] It can be seen that in this example, when the confidence of the acquired target text is less than the first threshold, the first feature vector can be imported into the second model and the third model respectively to obtain the second classification result and the third classification result. After that, the first classification result, the second classification result and the third classification result are imported into the voting mechanism to obtain the voting result. Finally, the category of the target text is determined according to the voting result.

[0064] and Figure 1 For details of the embodiments shown, please refer to Figure 2 , Figure 2 FIG2 is a flow chart of another text classification method provided in an embodiment of the present application. As shown in FIG2 , the text classification method includes steps S201 to S206:

[0065] S201, obtaining a target corpus of a target text, wherein the target text includes a title, an abstract, and keywords, and the target corpus includes an abstract corpus and a title and keyword corpus;

[0066] S202, importing the target corpus into the trained text representation model to obtain a first feature vector of the target text, where the first feature vector is used to reflect the title, abstract, and keywords of the target text;

[0067] S203, importing the first feature vector into a first classifier to obtain a classification result of the target text, wherein the classification result includes a first classification category and a confidence level;

[0068] S204, if the confidence level is greater than or equal to a first threshold, determining that the first classification category is the category of the target text;

[0069] S205, if the confidence level is less than the first threshold, importing the first feature vector into a second model and a third model respectively to obtain a second classification result and a third classification result;

[0070] S206: Obtain a category of the target text according to the first classification result, the second classification result, and the third classification result.

[0071] It can be seen that in the embodiment of the present application, first, a target corpus of a target text is obtained, the target text includes a title, an abstract and keywords, and the target corpus includes an abstract corpus and a title and keyword corpus. After that, the target corpus is imported into a trained text representation model to obtain a first feature vector of the target text, and the first feature vector is used to reflect the title, abstract and keywords of the target text. Then, the first feature vector is imported into a first classifier to obtain a classification result of the target text, and the classification result includes a first classification category and a confidence level. If the confidence level is greater than or equal to a first threshold, the first classification category is determined to be the category of the target text. It can be seen that the embodiment of the present application obtains the first feature vector of the target text by importing the abstract corpus and the title and keyword corpus of the acquired target text into a pre-set text representation model, and then imports the first feature vector into a first classifier to obtain a classification result of the target text, thereby improving the accuracy and efficiency of text classification.

[0072] In addition, the embodiment of the present application can import the first feature vector into the second model and the third model respectively to obtain the second classification result and the third classification result when the confidence of the acquired target text is less than the first threshold value. Thereafter, the first classification result, the second classification result and the third classification result are imported into the voting mechanism to obtain the voting result. Finally, the category of the target text is determined according to the voting result.

[0073] With the above Figure 1 , Figure 2 For details on the embodiments shown in the drawings, please refer to Figure 3 , Figure 3 3 is a structural diagram of an electronic device 300 provided in an embodiment of the present application. As shown in the figure, the electronic device 300 includes a processor 310, a memory 320, a communication interface 330, and one or more programs 321, wherein the one or more programs 321 are stored in the memory 320 and are configured to be executed by the processor 310, and the one or more programs 321 include instructions for executing the following steps;

[0074] Obtain a target corpus of a target text, wherein the target text includes a title, an abstract, and keywords, and the target corpus includes an abstract corpus and a title and keyword corpus;

[0075] Importing the target corpus into the trained text representation model to obtain a first feature vector of the target text, where the first feature vector is used to reflect the title, abstract, and keywords of the target text;

[0076] Importing the first feature vector into a first classifier to obtain a classification result of the target text, wherein the classification result includes a first classification category and a confidence level;

[0077] If the confidence level is greater than or equal to a first threshold, the first classification category is determined to be the category of the target text.

[0078] It can be seen that in the embodiment of the present application, first, a target corpus of a target text is obtained, the target text includes a title, an abstract and keywords, and the target corpus includes an abstract corpus and a title and keyword corpus. After that, the target corpus is imported into a trained text representation model to obtain a first feature vector of the target text, and the first feature vector is used to reflect the title, abstract and keywords of the target text. Then, the first feature vector is imported into a first classifier to obtain a classification result of the target text, and the classification result includes a first classification category and a confidence level. If the confidence level is greater than or equal to a first threshold, the first classification category is determined to be the category of the target text. It can be seen that the embodiment of the present application obtains the first feature vector of the target text by importing the abstract corpus and the title and keyword corpus of the acquired target text into a pre-set text representation model, and then imports the first feature vector into a first classifier to obtain a classification result of the target text, thereby improving the accuracy and efficiency of text classification.

[0079] In one possible example, in terms of obtaining the target corpus of the target text, the instructions in the one or more programs 321 are specifically used to: perform sentence processing on the summary of the target text to obtain a plurality of sentences; obtain the Euclidean distance between every two sentences in the plurality of sentences; and obtain the summary corpus based on the Euclidean distance between every two sentences.

[0080] In a possible example, in terms of obtaining the summary corpus according to the Euclidean distance between each two sentences, the instructions in the one or more programs 321 are specifically used to: determine whether the Euclidean distance between the two sentences currently being processed is greater than a preset threshold; if the Euclidean distance between the two sentences currently being processed is less than or equal to the preset threshold, determine that the two sentences currently being processed are corpus in the summary corpus; if the Euclidean distance between the two sentences currently being processed is greater than the preset threshold, determine that the two sentences currently being processed are not corpus in the summary corpus.

[0081] In a possible example, the text representation model is obtained by performing the following operations: obtaining an original corpus; preprocessing the original corpus; obtaining a first corpus based on the preprocessed original corpus; performing Word2Vec word vector training based on the first corpus to obtain a first result; obtaining a long text corpus; obtaining a second corpus based on the preprocessed long text corpus; processing the second corpus according to a text summary extraction algorithm to obtain a summary corpus; obtaining a title and a keyword corpus based on the second corpus; obtaining a third corpus based on the summary corpus and the title and keyword corpus; removing high-frequency words in the third corpus to obtain a clean corpus; performing LDA training on the clean corpus to obtain a topic-word distribution matrix; and obtaining the text representation model based on the first result and the topic-word distribution matrix.

[0082] In one possible example, the one or more programs 321 also include instructions for performing the following steps: after importing the first feature vector into the first classifier to obtain the classification result of the target text, if the confidence is less than the first threshold, importing the first feature vector into the second model and the third model respectively to obtain the second classification result and the third classification result; and obtaining the category of the target text according to the first classification result, the second classification result and the third classification result.

[0083] The above mainly introduces the scheme of the embodiment of the present application from the perspective of the execution process on the method side. It is understandable that, in order to realize the above functions, the electronic device includes a hardware structure and / or software unit corresponding to the execution of each function. It should be easily appreciated by those skilled in the art that, in combination with the units and algorithm steps of each example described in the embodiments provided herein, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present application.

[0084] The embodiment of the present application can divide the electronic device into functional units according to the above method example. For example, each functional unit can be divided according to each function, or two or more functions can be integrated into one processing unit. The above integrated unit can be implemented in the form of hardware or in the form of software functional units. It should be noted that the division of units in the embodiment of the present application is schematic and is only a logical function division. There may be other division methods in actual implementation.

[0085] With the above Figure 1 , Figure 2For details on the embodiments shown in the drawings, please refer to Figure 4 , Figure 4 4 is a functional unit block diagram of a text classification device 400 involved in an embodiment of the present application, wherein the text classification device comprises:

[0086] An acquisition unit 401 is used to acquire a target corpus of a target text, wherein the target text includes a title, an abstract, and keywords, and the target corpus includes an abstract corpus and a title and keyword corpus;

[0087] A first feature vector acquisition unit 402 is used to import the target corpus into the trained text representation model to obtain a first feature vector of the target text, where the first feature vector is used to reflect the title, abstract and keywords of the target text;

[0088] A classification result acquisition unit 403 is used to import the first feature vector into a first classifier to obtain a classification result of the target text, wherein the classification result includes a first classification category and a confidence level;

[0089] The text category determination unit 404 is configured to determine that the first classification category is the category of the target text if the confidence level is greater than or equal to a first threshold.

[0090] The text classification device 400 may further include a storage unit 405 for storing program codes and requests. The storage unit 405 may be a memory.

[0091] It can be seen that in the embodiment of the present application, first, a target corpus of a target text is obtained, the target text includes a title, an abstract and keywords, and the target corpus includes an abstract corpus and a title and keyword corpus. After that, the target corpus is imported into a trained text representation model to obtain a first feature vector of the target text, and the first feature vector is used to reflect the title, abstract and keywords of the target text. Then, the first feature vector is imported into a first classifier to obtain a classification result of the target text, and the classification result includes a first classification category and a confidence level. If the confidence level is greater than or equal to a first threshold, the first classification category is determined to be the category of the target text. It can be seen that the embodiment of the present application obtains the first feature vector of the target text by importing the abstract corpus and the title and keyword corpus of the acquired target text into a pre-set text representation model, and then imports the first feature vector into a first classifier to obtain a classification result of the target text, thereby improving the accuracy and efficiency of text classification.

[0092] In a possible example, in terms of obtaining the target corpus of the target text, the obtaining unit 401 is specifically used to: perform sentence processing on the summary of the target text to obtain multiple sentences; obtain the Euclidean distance between every two sentences in the multiple sentences; and obtain the summary corpus according to the Euclidean distance between every two sentences.

[0093] In a possible example, in the aspect of obtaining the summary corpus according to the Euclidean distance between each two sentences, the acquisition unit 401 is specifically used to: determine whether the Euclidean distance between the two sentences currently being processed is greater than a preset threshold; if the Euclidean distance between the two sentences currently being processed is less than or equal to the preset threshold, determine that the two sentences currently being processed are corpus in the summary corpus; if the Euclidean distance between the two sentences currently being processed is greater than the preset threshold, determine that the two sentences currently being processed are not corpus in the summary corpus.

[0094] In a possible example, the text representation model is obtained by performing the following operations: obtaining an original corpus; preprocessing the original corpus; obtaining a first corpus based on the preprocessed original corpus; performing Word2Vec word vector training based on the first corpus to obtain a first result; obtaining a long text corpus; obtaining a second corpus based on the preprocessed long text corpus; processing the second corpus according to a text summary extraction algorithm to obtain a summary corpus; obtaining a title and a keyword corpus based on the second corpus; obtaining a third corpus based on the summary corpus and the title and keyword corpus; removing high-frequency words in the third corpus to obtain a clean corpus; performing LDA training on the clean corpus to obtain a topic-word distribution matrix; and obtaining the text representation model based on the first result and the topic-word distribution matrix.

[0095] In a possible example, the text category determination unit 404 is also used to: import the first feature vector into the first classifier to obtain the classification result of the target text, and if the confidence is less than the first threshold, import the first feature vector into the second model and the third model respectively to obtain the second classification result and the third classification result; obtain the category of the target text according to the first classification result, the second classification result and the third classification result.

[0096] It can be understood that since the text classification method embodiment and the text classification device embodiment are different presentation forms of the same technical concept, the content of the text classification method embodiment part in this application should be synchronously adapted to the text classification device embodiment part, and will not be repeated here.

[0097] An embodiment of the present application also provides a computer storage medium, wherein the computer storage medium stores a computer program for electronic request exchange, and when the computer program is executed by a computer, it implements part or all of the steps of any method recorded in the above method embodiment, and the above computer includes an electronic device.

[0098] The embodiment of the present application also provides a computer program product, the computer program product includes a non-transitory computer-readable storage medium storing a computer program, the computer program is operable to cause a computer to execute some or all of the steps of any method described in the method embodiment. The computer program product may be a software installation package, and the computer includes an electronic device.

[0099] It should be noted that, for the above-mentioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described action sequence, because according to the present application, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and units involved are not necessarily required by the present application.

[0100] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0101] In the several embodiments provided in the present application, it should be understood that the disclosed device can be implemented in other ways. For example, the device embodiments described above are only schematic, such as the division of the above-mentioned units, which is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, and the indirect coupling or communication connection of devices or units can be electrical or other forms.

[0102] The units described above as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0103] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0104] If the above-mentioned integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable memory. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a memory, including a number of instructions to enable a computer device (which can be a personal computer, server or network device, etc.) to perform all or part of the steps of the above-mentioned methods of each embodiment of the present application. The aforementioned memory includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, disk or CD-ROM and other media that can store program codes.

[0105] A person skilled in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing related hardware through a program, and the program can be stored in a computer-readable memory, and the memory can include: a flash drive, a read-only memory (English: Read-Only Memory, abbreviated as: ROM), a random access memory (English: Random Access Memory, abbreviated as: RAM), a magnetic disk or an optical disk, etc.

[0106] The embodiments of the present application are introduced in detail above. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method and core idea of ​​the present application. At the same time, for general technical personnel in this field, according to the idea of ​​the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.

Claims

1. A text classification method, characterized in that: The method comprises: Obtain a target corpus of a target text, wherein the target text includes a title, an abstract, and keywords, and the target corpus includes an abstract corpus and a title and keyword corpus; Import the target corpus into the trained text representation model to obtain the first feature vector of the target text, which is used to reflect the title, abstract and keywords of the target text; the text representation model is obtained by performing the following operations: obtaining the original corpus; preprocessing the original corpus; obtaining the first corpus based on the original corpus after preprocessing; performing Word2Vec word vector training based on the first corpus to obtain a first result; obtaining a long text corpus; obtaining a second corpus based on the long text corpus after preprocessing; processing the second corpus according to the text abstract extraction algorithm to obtain an abstract corpus; obtaining a title and keyword corpus based on the second corpus; obtaining a third corpus based on the abstract corpus and the title and keyword corpus; removing high-frequency words in the third corpus to obtain a clean corpus; performing LDA training on the clean corpus to obtain a topic-word distribution matrix; obtaining the text representation model based on the first result and the topic-word distribution matrix; Importing the first feature vector into a first classifier to obtain a first classification result of the target text, wherein the first classification result includes a first classification category and a confidence level, and the first classifier includes an SVM classifier; If the confidence level is greater than or equal to a first threshold, determining the first classification category to be the category of the target text; If the confidence is less than the first threshold, the first feature vector is respectively imported into a second model and a third model to obtain a second classification result and a third classification result, wherein the second model includes a trained KNN model, and the third model includes a trained NB model; If any two of the first classification result, the second classification result and the third classification result are different from each other, determining that the first classification result is the category of the target text; If at least two of the first classification result, the second classification result, and the third classification result are the same, the classification result with the highest frequency is determined as the category of the target text.

2. The method according to claim 1, characterized in that The step of obtaining a target corpus set of a target text comprises: Segment processing is performed on the abstract of the target text to obtain a plurality of sentences; Obtaining the Euclidean distance between every two sentences in the plurality of sentences; The summary corpus is obtained according to the Euclidean distance between every two sentences.

3. The method according to claim 2, characterized in that The step of obtaining the summary corpus according to the Euclidean distance between each two sentences includes: Determine whether the Euclidean distance between the two sentences currently being processed is greater than a preset threshold; If the Euclidean distance between the two sentences currently being processed is less than or equal to a preset threshold, determining that the two sentences currently being processed are corpora in the summary corpus; If the Euclidean distance between the two sentences currently being processed is greater than a preset threshold, it is determined that the two sentences currently being processed are not corpora in the summary corpus.

4. A text classification device, characterized in that: The device comprises: An acquisition unit, configured to acquire a target corpus of a target text, wherein the target text includes a title, an abstract, and keywords, and the target corpus includes an abstract corpus and a title and keyword corpus; A first feature vector acquisition unit is used to import the target corpus into the trained text representation model to obtain a first feature vector of the target text, wherein the first feature vector is used to reflect the title, abstract and keywords of the target text; the text representation model is obtained by performing the following operations: obtaining an original corpus; preprocessing the original corpus; obtaining a first corpus based on the original corpus after preprocessing; performing Word2Vec word vector training based on the first corpus to obtain a first result; obtaining a long text corpus; obtaining a second corpus based on the long text corpus after preprocessing; processing the second corpus according to a text abstract extraction algorithm to obtain an abstract corpus; obtaining a title and a keyword corpus based on the second corpus; obtaining a third corpus based on the abstract corpus and the title and keyword corpus; removing high-frequency words in the third corpus to obtain a clean corpus; performing LDA training on the clean corpus to obtain a topic-word distribution matrix; obtaining the text representation model based on the first result and the topic-word distribution matrix; A classification result acquisition unit, used for importing the first feature vector into a first classifier to obtain a first classification result of the target text, wherein the first classification result includes a first classification category and a confidence level; A text category determination unit is used to determine that the first classification category is the category of the target text if the confidence is greater than or equal to a first threshold; if the confidence is less than the first threshold, the first feature vector is respectively imported into a second model and a third model to obtain a second classification result and a third classification result, wherein the second model includes a trained KNN model and the third model includes a trained NB model; if any two of the first classification result, the second classification result and the third classification result are different from each other, the first classification result is determined to be the category of the target text; if at least two of the first classification result, the second classification result and the third classification result are the same, the classification result with the highest frequency is determined to be the category of the target text.

5. The device according to claim 4, characterized in that In the aspect of acquiring the target corpus of the target text, the acquiring unit is specifically used for: Segment processing is performed on the abstract of the target text to obtain a plurality of sentences; Obtaining the Euclidean distance between every two sentences in the plurality of sentences; The summary corpus is obtained according to the Euclidean distance between every two sentences.

6. The device according to claim 5, characterized in that In the aspect of obtaining the summary corpus according to the Euclidean distance between each two sentences, the acquisition unit is specifically used for: Determine whether the Euclidean distance between the two sentences currently being processed is greater than a preset threshold; If the Euclidean distance between the two sentences currently being processed is less than or equal to a preset threshold, determining that the two sentences currently being processed are corpora in the summary corpus; If the Euclidean distance between the two sentences currently being processed is greater than a preset threshold, it is determined that the two sentences currently being processed are not corpora in the summary corpus.

7. An electronic device, characterized in that: The method comprises a processor, a memory, a communication interface and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the processor, and the programs include instructions for executing the steps in any one of the methods of claims 1-3.

8. A computer-readable storage medium, wherein: The computer-readable storage medium stores a computer program for electronic request exchange, wherein the computer program enables a computer to execute part or all of the steps described in any one of the methods of claims 1-3.