Target type document classification method and device and storage medium

By constructing a confusion matrix and calculating the triangular comparison measurement TCM, the distinguishing value of a specific term is determined, and the target type documents are classified based on the term, and the problem of inaccurate document classification caused by ignoring the non-existence of the term in the prior art is solved, and the inaccurate document classification is achieved. More accurate document classification.

CN119441479APending Publication Date: 2025-02-14HUANENG CLEAN ENERGY RES INST
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411470922.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-21
Publication Date
2025-02-14

AI Technical Summary

Technical Problem

The non-existence of terms in a particular category is ignored in the prior art, resulting in inaccurate classification of target type documents.

Method used

By constructing a confusion matrix, the true class rate TPR and false positive class rate FPR of the first term are determined, and the triangular comparison measure TCM is then calculated. When the difference between the TCM and the target value is less than the preset threshold, the term that TCM is determined to be higher than the preset value is a second term, and the target type document is classified based on the term.

Benefits of technology

It effectively solves the problem of inaccurate document classification caused by ignoring the non-existence of the term, and improves the accuracy of document classification.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119441479A_ABST
    Figure CN119441479A_ABST
Patent Text Reader

Abstract

The invention discloses a target type document classification method and device and a storage medium, and relates to the field of artificial intelligence, and the target type document classification method comprises the steps: constructing a confusion matrix according to a first term of a target type document, and determining a true class rate TPR and a false positive class rate FPR of the first term according to the confusion matrix; determining a triangular comparison measure TCM according to the true class rate TPR and the false positive class rate FPR; under the condition that the difference value between the triangular comparison measure TCM and a target value is smaller than a preset threshold value, the term with the triangular comparison measure TCM higher than the preset value is determined as a second term, and the target type document is classified according to the second term. By the adoption of the technical scheme, the problem that due to the fact that nonexistence of terms in specific categories is ignored, classification of the target type documents is inaccurate is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of artificial intelligence, and more specifically, to a method and device for classifying target type documents, and a storage medium. Background Art

[0002] The non-existence of a term in a specific category, that is, a term that hardly appears or does not appear at all in a certain type of document, is an important basis for distinguishing different categories in the classification of target type documents. For example, when comparing two scientific research project applications, if a term frequently appears in the project application with high innovation, but hardly appears in the project application with low innovation, then this term has a high distinguishing value and can help the classifier accurately distinguish different types of applications. However, the existing related technologies often ignore the non-existence of terms in specific categories, resulting in inaccurate classification of target type documents (such as scientific documents).

[0003] Currently, no effective solution has been proposed to the problem that in the related art, the non-existence of terms in specific categories is ignored, resulting in inaccurate classification of target type documents.

[0004] Therefore, it is necessary to improve the related technology to overcome the above-mentioned defects in the related technology. Summary of the invention

[0005] The embodiments of the present application provide a method and device for classifying target type documents, and a storage medium, so as to at least solve the problem in the related art that the classification of target type documents is inaccurate due to ignoring the non-existence of terms in specific categories.

[0006] According to one aspect of an embodiment of the present application, a method for classifying a target type document is provided, comprising: constructing a confusion matrix based on a first term of the target type document, and determining a true positive rate TPR and a false positive rate FPR of the first term based on the confusion matrix; determining a triangular comparison measure TCM based on the true positive rate TPR and the false positive rate FPR; when the difference between the triangular comparison measure TCM and a target value is less than a preset threshold, determining a term whose triangular comparison measure TCM is higher than a preset value as a second term, and classifying the target type document based on the second term.

[0007] In an exemplary embodiment, before constructing a confusion matrix based on the first term of the target type document, the method further includes: removing target type words in the target type document, wherein the target type words include at least one of the following: stop words, low-frequency words, and high-frequency words; and performing lemma restoration or stemming on the target type document without the target type words.

[0008] In an exemplary embodiment, constructing a confusion matrix based on the first term of the target type document includes: determining positive documents containing the first term and negative documents not containing the first term from the target type document; obtaining true positive examples TP of the first term in the positive document, false positive examples FP of the first term in the negative document, true negative examples TN of the first term in the negative document, and false negative examples FN of the first term in the positive document; constructing the confusion matrix based on the true positive examples TP, the false positive examples FP, the true negative examples TN, and the false negative examples FN.

[0009] In an exemplary embodiment, determining a true positive rate TPR and a false positive rate FPR of the first term according to the confusion matrix includes: determining the true positive rate TPR according to the following formula: And the false positive rate FPR is determined according to the following formula:

[0010] In an exemplary embodiment, determining a triangular comparison measure TCM according to the true positive rate TPR and the false positive rate FPR includes: determining the triangular comparison measure TCM according to the following formula:

[0011]

[0012] In an exemplary embodiment, a term whose triangular comparison measure TCM is higher than a preset value is determined as a second term, including: determining a target triangular comparison measure TCM that exceeds the preset value from the triangular comparison measures TCM corresponding to multiple first terms; and determining a preset number of terms corresponding to the target triangular comparison measure TCM as the second term.

[0013] In an exemplary embodiment, classifying the target type document according to the second term includes: converting the second term into a feature vector; inputting the feature vector into a target classifier used to train the second term to obtain an output result of the target classifier; and classifying the target type document according to the output result to obtain a classification result of the target type document.

[0014] According to another aspect of an embodiment of the present application, a device for classifying target type documents is also provided, including: a first determination module, used to construct a confusion matrix according to a first term of the target type document, and determine the true positive rate TPR and the false positive rate FPR of the first term according to the confusion matrix; a second determination module, used to determine a triangular comparison measure TCM according to the true positive rate TPR and the false positive rate FPR; a classification module, used to determine a term with the triangular comparison measure TCM higher than a preset value as a second term when the difference between the triangular comparison measure TCM and a target value is less than a preset threshold, and classify the target type document according to the second term.

[0015] According to another aspect of the embodiments of the present application, a computer-readable storage medium is provided, in which a computer program is stored, wherein the computer program is configured to execute the above-mentioned method for classifying target type documents when running.

[0016] According to another aspect of an embodiment of the present application, an electronic device is also provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the classification method of the target type document through the computer program.

[0017] According to another aspect of the embodiments of the present application, a computer program product is provided, including a computer program, and when the computer program is executed by a processor, the steps of the method described in each embodiment of the present application are implemented.

[0018] Through the present application, the confusion matrix constructed according to the first term of the target type document determines the true positive rate TPR and the false positive rate FPR of the first term; then the triangular comparison measure TCM is determined according to the true positive rate TPR and the false positive rate FPR; when the difference between the triangular comparison measure TCM and the target value is less than a preset threshold, the term whose triangular comparison measure TCM is higher than the preset value is determined to be the second term, and the target type document is classified according to the second term. This solves the problem of inaccurate classification of target type documents due to ignoring the non-existence of terms in specific categories in the related art. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0020] 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, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0021] Figure 1 It is a hardware structure block diagram of a computer terminal of a method for classifying target type documents in an embodiment of the present application;

[0022] Figure 2 is a flow chart of a method for classifying target type documents according to an embodiment of the present application;

[0023] Figure 3 is a schematic flow chart of a method for classifying target type documents according to an embodiment of the present application;

[0024] Figure 4 It is a structural block diagram of a target type document classification device according to an embodiment of the present application. DETAILED DESCRIPTION

[0025] 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 should fall within the scope of protection of the present application.

[0026] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0027] The method embodiments provided in the embodiments of the present application can be executed in a computer terminal or a similar computing device. Taking running on a computer terminal as an example, Figure 1 1 is a hardware structure block diagram of a computer terminal for a method for classifying target type documents according to an embodiment of the present application. Figure 1As shown, the computer terminal may include one or more ( Figure 1 Only one is shown in the figure) a processor 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor (Central Processing Unit, MCU) or a programmable logic device (Field Programmable Gate Array, FPGA)) and a memory 104 for storing data, wherein the above-mentioned computer terminal may also include a transmission device 106 and an input and output device 108 for communication functions. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the above-mentioned computer terminal. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations are shown.

[0028] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the classification method of the target type document in the embodiment of the present application. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, to implement the above method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the computer terminal via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0029] A wireless network provided by a communication provider of a computer terminal. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (Radio Frequency, referred to as RF) module, which is used to communicate with the Internet wirelessly.

[0030] In this embodiment, a method for classifying target type documents is provided, which is applied to the above-mentioned computer terminal. Figure 2 is a flow chart of a method for classifying target type documents according to an embodiment of the present application, such as Figure 2 As shown, the process includes the following steps:

[0031] Step S202, constructing a confusion matrix according to the first term of the target type document, and determining a true positive rate TPR and a false positive rate FPR of the first term according to the confusion matrix;

[0032] Step S204, determining a triangular comparison measure TCM according to the true positive rate TPR and the false positive rate FPR;

[0033] Step S206, when the difference between the triangular comparison measure TCM and the target value is less than a preset threshold, determine the term whose triangular comparison measure TCM is higher than the preset value as a second term, and classify the target type document according to the second term.

[0034] Through the above steps, the true positive rate TPR and false positive rate FPR of the first term of the target type document are determined according to the confusion matrix constructed according to the first term; the triangular comparison measure TCM is determined according to the true positive rate TPR and the false positive rate FPR; when the difference between the triangular comparison measure TCM and the target value is less than a preset threshold, the term whose triangular comparison measure TCM is higher than the preset value is determined to be the second term, and the target type document is classified according to the second term. This solves the problem of inaccurate classification of target type documents due to ignoring the non-existence of terms in specific categories in the related art.

[0035] In an exemplary embodiment, before constructing a confusion matrix based on the first term of the target type document, the method further includes: removing target type words in the target type document, wherein the target type words include at least one of the following: stop words, low-frequency words, and high-frequency words; and performing lemma restoration or stemming on the target type document without the target type words.

[0036] In this embodiment, stop words refer to words that frequently appear in target type documents but contribute little to the subject or content analysis of target type documents, for example, of, and, is, etc.; low-frequency words refer to those words that appear very rarely in target type documents, and high-frequency words refer to words that frequently appear in target type documents but do not contribute to the classification of target type documents, for example, research, experiment, etc.; morphological restoration is the process of converting words into basic forms, for example, converting "running" and "ran" in English into "run", and stemming is the process of simplifying words into a common stem, such as simplifying "running" and "runner" into "run". The purpose of morphological restoration and stemming is to reduce vocabulary variants so that words with the same or similar meanings are treated uniformly in classification, thereby improving the efficiency and accuracy of text classification.

[0037] In an exemplary embodiment, constructing a confusion matrix based on the first term of the target type document includes: determining positive documents containing the first term and negative documents not containing the first term from the target type document; obtaining true positive examples TP of the first term in the positive document, false positive examples FP of the first term in the negative document, true negative examples TN of the first term in the negative document, and false negative examples FN of the first term in the positive document; constructing the confusion matrix based on the true positive examples TP, the false positive examples FP, the true negative examples TN, and the false negative examples FN.

[0038] Optionally, assuming that the first term is solar energy, the positive documents are documents about clean energy, and the negative documents are documents other than clean energy, the number of positive documents is 20, and the number of negative documents is 60. Among the 20 positive documents, 15 are correctly identified by the target classifier as containing the first term solar energy, so the true positive TP=15; among the 60 negative documents, 5 are incorrectly identified by the target classifier as containing the first term solar energy, so the false positive FP=5; among the 60 negative documents, 55 are correctly identified by the target classifier as not containing the first term solar energy, so the true negative TN=55; among the 20 positive documents, 5 are incorrectly identified by the target classifier as not containing the first term solar energy, so the false negative FN=5. According to the above true positive TP, false positive FP, true negative TN and false negative FN, a 2*2 confusion matrix is ​​constructed.

[0039] In an exemplary embodiment, determining a true positive rate TPR and a false positive rate FPR of the first term according to the confusion matrix includes: determining the true positive rate TPR according to the following formula: And the false positive rate FPR is determined according to the following formula:

[0040] Optionally, assuming that true positive examples TP = 15, false positive examples FP = 5, true negative examples TN = 55, and false negative examples FN = 5, by formula and The calculated true positive rate TPR = 0.75 and the false positive rate FPR = 0.083.

[0041] In an exemplary embodiment, determining a triangular comparison measure TCM according to the true positive rate TPR and the false positive rate FPR includes: determining the triangular comparison measure TCM according to the following formula:

[0042]

[0043] According to the formula Determine the trigonometric comparison measure TCM. The above formula utilizes the deformation characteristics of trigonometric functions, especially the inverse tangent function, to map the difference between the true positive rate TPR and the false positive rate FPR to a range of [0,1]. The greater the difference between the true positive rate TPR and the false positive rate FPR, the closer the trigonometric comparison measure TCM value is to 1.

[0044] In an exemplary embodiment, a term whose triangular comparison measure TCM is higher than a preset value is determined as a second term, including: determining a target triangular comparison measure TCM that exceeds the preset value from the triangular comparison measures TCM corresponding to multiple first terms; and determining a preset number of terms corresponding to the target triangular comparison measure TCM as the second term.

[0045] The calculated triangular comparison measures TCM are sorted. In this embodiment, the triangular comparison measures TCM are sorted in order from large to small. Assume that the sorted triangular comparison measures TCM are: 0.9, 0.87, 0.84, 0.75, 0.64, 0.58, 0.53, 0.32, 0.24, 0.11. The target triangular comparison measures TCM greater than 0.6 are obtained from the above triangular comparison measures TCM, that is, the target triangular comparison measures TCM are determined to be 0.9, 0.87, 0.84, 0.75, 0.64, and the terms corresponding to the first three target triangular comparison measures TCM are selected from the determined target triangular comparison measures TCM as the second terms, that is, the terms corresponding to 0.9, 0.87, and 0.84 in the target triangular comparison measures TCM are determined to be the second terms. It should be clear that the preset value and the preset number can be set arbitrarily, and are not limited in this embodiment.

[0046] In an exemplary embodiment, classifying the target type document according to the second term includes: converting the second term into a feature vector; inputting the feature vector into a target classifier used to train the second term to obtain an output result of the target classifier; and classifying the target type document according to the output result to obtain a classification result of the target type document.

[0047] It should be clear that the target classifier includes Support Vector Machine (SVM for short), Naive Bayes classifier (NB for short), Decision Tree (DT for short), etc., which are not specifically limited in this embodiment. The output result is the predicted probability for each category or a direct category prediction. Optionally, assume that a scientific research project application needs to be classified, and the categories are: new energy technology, information technology, or biotechnology. The output result shows: new energy technology: 0.65, information technology: 0.20, biotechnology: 0.15, which means that this scientific research project application belongs to the new energy technology category. In another case, the output result will directly show that the category of the scientific research project application is new energy technology.

[0048] Obviously, the above-described embodiments are only a part of the embodiments of the present application, rather than all of the embodiments. To better understand the above classification method for the target type document, the following will describe the above process in conjunction with embodiments, but it is not used to limit the technical solutions of the embodiments of the present application. Specifically:

[0049] Figure 3 It is a schematic flowchart of a classification method for a target type document according to an embodiment of the present application, as Figure 3 shown, and specifically includes the following steps:

[0050] Step S302: Perform data preprocessing on the target type document (such as a scientific and technological document). The data preprocessing includes: removing stop words, low-frequency words, and high-frequency words in the target type document, and performing word form reduction or stemming on the target type document. Among them, stop words refer to words that frequently appear in the target type document but contribute little to the analysis of the theme or content of the target type document, such as "of", "and", "is", etc.; low-frequency words refer to those words that appear very rarely in the target type document, while high-frequency words are words that frequently appear in the target type document but do not contribute to the classification of the target type document; word form reduction is the process of converting words into their basic forms, such as converting "running" and "ran" in English to "run", and stemming is to simplify words to a common stem, such as simplifying "running" and "runner" to "run". The purpose of word form reduction and stemming is to reduce the variants of words so that words with the same or similar meanings are treated uniformly in classification, thereby improving the efficiency and accuracy of text classification.

[0051] Step S304: Determine the positive documents containing the first term and the negative documents not containing the first term from the target type documents, obtain the true positive examples TP, false positive examples FP, true negative examples TN and false negative examples FN of the first term, and construct a confusion matrix according to the true positive examples TP, false positive examples FP, true negative examples TN and false negative examples FN. Optionally, assuming that the first term is solar energy, the positive documents are documents about clean energy, the negative documents are documents other than clean energy, the number of positive documents is 20, and the number of negative documents is 60. Among the 20 positive documents, 15 are correctly identified by the target classifier as containing the first term solar energy, so the true positive TP = 15; among the 60 negative documents, 5 are incorrectly identified by the target classifier as containing the first term solar energy, so the false positive FP = 5; among the 60 negative documents, 55 are correctly identified by the target classifier as not containing the first term solar energy, so the true negative TN = 55; among the 20 positive documents, 5 are incorrectly identified by the target classifier as not containing the first term solar energy, so the false negative FN = 5. Based on the above true positive TP, false positive FP, true negative TN and false negative FN, a 2*2 confusion matrix is ​​constructed.

[0052] Step S306: According to the formula and Determine the true positive rate TPR and the false positive rate FPR. Optionally, when the true positive rate TP=15, the false positive rate FP=5, the true negative rate TN=55, and the false negative rate FN=5, the true positive rate TPR=0.75 and the false positive rate FPR=0.083.

[0053] Step S308: According to the formula Determine the trigonometric comparison measure TCM. The above formula utilizes the deformation characteristics of trigonometric functions, especially the inverse tangent function, to map the difference between the true positive rate TPR and the false positive rate FPR to a range of [0,1]. The greater the difference between the true positive rate TPR and the false positive rate FPR, the closer the trigonometric comparison measure TCM value is to 1.

[0054] Step S310: Sort the calculated triangular comparison measure TCM. In this embodiment, the triangular comparison measure TCM is sorted in descending order. Assume that the sorted triangular comparison measure TCM is: 0.9, 0.87, 0.84, 0.75, 0.64, 0.58, 0.53, 0.32, 0.24, 0.11, and obtain the target triangular comparison measure TCM greater than 0.6 from the triangular comparison measure TCM, that is, determine the target triangular comparison measure TCM to be 0.9, 0.87, 0.84, 0.75, 0.64, and select the terms corresponding to the first three target triangular comparison measures TCM from the determined target triangular comparison measure TCM as the second terms, that is, determine the terms corresponding to 0.9, 0.87, and 0.84 in the target triangular comparison measure TCM as the second terms.

[0055] Step S312: convert the second term into a feature vector and determine a target classifier, wherein the target classifier includes but is not limited to a support vector machine SVM and a naive Bayes NB, which are not limited in this embodiment. Input the feature matrix into the target classifier to obtain an output result, and classify the target type document according to the output result.

[0056] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods of each embodiment of the present application.

[0057] In the present embodiment, a classification device for target type documents is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can implement a combination of software and / or hardware of a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.

[0058] Figure 4 : is a structural block diagram of a target type document classification device according to an embodiment of the present application, the device comprising:

[0059] A first determination module 42, configured to construct a confusion matrix according to the first term of the target type document, and determine a true positive rate TPR and a false positive rate FPR of the first term according to the confusion matrix;

[0060] A second determination module 44 is used to determine a triangular comparison measure TCM according to the true positive rate TPR and the false positive rate FPR;

[0061] The classification module 46 is used to determine the term whose triangular comparison measure TCM is higher than the preset value as a second term when the difference between the triangular comparison measure TCM and the target value is less than a preset threshold, and classify the target type document according to the second term.

[0062] Through the above device, a confusion matrix is ​​constructed according to the first term of the target type document, and the true positive rate TPR and false positive rate FPR of the first term are determined according to the confusion matrix; the triangular comparison measure TCM is determined according to the true positive rate TPR and the false positive rate FPR; when the difference between the triangular comparison measure TCM and the target value is less than a preset threshold, the term whose triangular comparison measure TCM is higher than the preset value is determined as the second term, and the target type document is classified according to the second term. This solves the problem of inaccurate classification of target type documents due to ignoring the non-existence of terms in specific categories in the related art.

[0063] In an exemplary embodiment, the first determination module 42 is also used to remove target type words in the target type document, wherein the target type words include at least one of the following: stop words, low-frequency words and high-frequency words; and perform lemma restoration or stem extraction on the target type document with the target type words removed.

[0064] In an exemplary embodiment, the first determination module 42 is further used to determine positive documents containing the first term and negative documents not containing the first term from the target type document; obtain true positive examples TP of the first term in the positive document, false positive examples FP of the first term in the negative document, true negative examples TN of the first term in the negative document, and false negative examples FN of the first term in the positive document; and construct the confusion matrix according to the true positive examples TP, the false positive examples FP, the true negative examples TN, and the false negative examples FN.

[0065] In an exemplary embodiment, the first determination module 42 is further configured to determine the true positive rate TPR according to the following formula: And the false positive rate FPR is determined according to the following formula:

[0066]

[0067] In an exemplary embodiment, the second determination module 44 is further configured to determine the triangular comparison measure TCM according to the following formula:

[0068] In an exemplary embodiment, the classification module 46 is further used to determine a target triangular comparison measure TCM that exceeds the preset value from the triangular comparison measures TCM corresponding to multiple first terms; and determine the terms corresponding to a preset number of the target triangular comparison measures TCM as the second terms.

[0069] In an exemplary embodiment, the classification module 46 is also used to convert the second term into a feature vector; input the feature vector into a target classifier used to train the second term to obtain an output result of the target classifier; and classify the target type document according to the output result to obtain a classification result of the target type document.

[0070] An embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above method embodiments when running.

[0071] Optionally, in this embodiment, the storage medium may be configured to store a computer program for performing the following steps:

[0072] S1, constructing a confusion matrix according to a first term of the target type document, and determining a true positive rate TPR and a false positive rate FPR of the first term according to the confusion matrix;

[0073] S2, determining a triangular comparison measure TCM according to the true positive rate TPR and the false positive rate FPR;

[0074] S3, when the difference between the triangular comparison measure TCM and the target value is less than a preset threshold, determine the term whose triangular comparison measure TCM is higher than the preset value as a second term, and classify the target type document according to the second term.

[0075] In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to, various media that can store computer programs, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk.

[0076] For specific examples in this embodiment, reference may be made to the examples described in the above embodiments and exemplary implementation modes, and this embodiment will not be described in detail herein.

[0077] An embodiment of the present application further provides an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.

[0078] Optionally, in this embodiment, the processor may be configured to perform the following steps through a computer program:

[0079] S1, constructing a confusion matrix according to a first term of the target type document, and determining a true positive rate TPR and a false positive rate FPR of the first term according to the confusion matrix;

[0080] S2, determining a triangular comparison measure TCM according to the true positive rate TPR and the false positive rate FPR;

[0081] S3, when the difference between the triangular comparison measure TCM and the target value is less than a preset threshold, determine the term whose triangular comparison measure TCM is higher than the preset value as a second term, and classify the target type document according to the second term.

[0082] In an exemplary embodiment, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.

[0083] An embodiment of the present application further provides a computer program product, comprising a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium stores a computer program product, and when the computer program is executed by a processor, the steps of the method described in each embodiment of the present application are implemented.

[0084] Optionally, in this embodiment, the above computer program may be configured to implement the following steps when executed by a processor:

[0085] S1, constructing a confusion matrix according to a first term of the target type document, and determining a true positive rate TPR and a false positive rate FPR of the first term according to the confusion matrix;

[0086] S2, determining a triangular comparison measure TCM according to the true positive rate TPR and the false positive rate FPR;

[0087] S3, when the difference between the triangular comparison measure TCM and the target value is less than a preset threshold, determine the term whose triangular comparison measure TCM is higher than the preset value as a second term, and classify the target type document according to the second term.

[0088] For specific examples in this embodiment, reference may be made to the examples described in the above embodiments and exemplary implementation modes, and this embodiment will not be described in detail herein.

[0089] Obviously, those skilled in the art should understand that the above modules or steps of the present application can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order from that herein, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present application is not limited to any specific combination of hardware and software.

[0090] The above is only a preferred implementation of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.

Claims

1. A method for classifying target type documents, characterized in that: include: Constructing a confusion matrix according to the first term of the target type document, and determining a true positive rate TPR and a false positive rate FPR of the first term according to the confusion matrix; Determine a triangular comparison measure TCM according to the true positive rate TPR and the false positive rate FPR; When the difference between the triangular comparison measure TCM and the target value is less than a preset threshold, the term whose triangular comparison measure TCM is higher than the preset value is determined as a second term, and the target type document is classified according to the second term.

2. The method according to claim 1, characterized in that Before constructing a confusion matrix according to the first term of the target type document, the method further includes: Removing target type words in the target type document, wherein the target type words include at least one of the following: stop words, low frequency words and high frequency words; Perform lemma restoration or stem extraction on the target type document from which the target type words are removed.

3. The method according to claim 1, characterized in that Constructing a confusion matrix based on the first term of the target type document, including: Determining, from the target type documents, positive documents containing the first term and negative documents not containing the first term; Obtaining a true positive example TP of the first term in the positive document, a false positive example FP of the first term in the negative document, a true negative example TN of the first term in the negative document, and a false negative example FN of the first term in the positive document; The confusion matrix is ​​constructed according to the true positive examples TP, the false positive examples FP, the true negative examples TN and the false negative examples FN.

4. The method according to claim 3, characterized in that Determining a true positive rate TPR and a false positive rate FPR of the first term according to the confusion matrix includes: The true positive rate TPR is determined according to the following formula: as well as The false positive rate FPR is determined according to the following formula:

5. The method according to claim 1, characterized in that Determining a triangular comparison measure TCM according to the true positive rate TPR and the false positive rate FPR includes: The triangular comparison measure TCM is determined according to the following formula:

6. The method according to claim 1, characterized in that Determining the term whose triangular comparison measure TCM is higher than a preset value as a second term comprises: Determine a target triangular comparison measure TCM exceeding the preset value from the triangular comparison measures TCM corresponding to the plurality of first terms; The terms corresponding to a preset number of the target triangular comparison measures TCM are determined as the second terms.

7. The method according to claim 1, characterized in that Classifying the target type document according to the second term includes: converting the second term into a feature vector; Inputting the feature vector into a target classifier for training the second term to obtain an output result of the target classifier; The target type document is classified according to the output result to obtain a classification result of the target type document.

8. A device for classifying target type documents, characterized in that: include: A first determination module is used to construct a confusion matrix according to the first term of the target type document, and determine a true positive rate TPR and a false positive rate FPR of the first term according to the confusion matrix; A second determination module is used to determine a triangular comparison measure TCM according to the true positive rate TPR and the false positive rate FPR; The classification module is used to determine the term whose triangular comparison measure TCM is higher than the preset value as a second term when the difference between the triangular comparison measure TCM and the target value is less than a preset threshold, and classify the target type document according to the second term.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored program, wherein the program executes the method according to any one of claims 1 to 7 when executed.

10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.