Text classification method, apparatus, device, medium, and product

CN121144520BActive Publication Date: 2026-09-29BEIJING ZITIAO NETWORK TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511554903.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-10-28
Publication Date
2026-09-29
Estimated Expiration
2045-10-28

AI Technical Summary

Technical Problem

[0003]本公开提供了一种文本分类的方法、装置、设备、介质及产品,以解决文本分类不精准的问题

Benefits of technology

[0009]本公开提供的文本分类的方法,基于初始分类标准以及初始分类标准对应的第二文本生成针对初始分类标准的变体分类标准,再基于初始分类标准与第二文本之间的关联程度以及变体分类标准与第二文本之间的关联程度,对初始分类标准和变体分类标准进行迭代优化,可以生成边界清晰、描述精确且鲁棒性强的目标分类标准,确保了最终产出的目标分类标准具有高度的客观性和一致性,避免了不同专家或团队之间制定的分类标准不一的问题。基于目标分类标准对第一文本进行分类,可以较为准确地确定出第一文本对应的文本类别,从而解决了文本分类不精准的问题。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121144520B_ABST
    Figure CN121144520B_ABST
Patent Text Reader

Abstract

The present disclosure relates to the technical field of text classification, and discloses a text classification method, device, equipment, medium and product. The method comprises: obtaining a first text; classifying the first text based on a target classification standard to obtain a text category corresponding to the first text; wherein the target classification standard is obtained by iteratively optimizing an initial classification standard and a variant classification standard corresponding to the initial classification standard, the variant classification standard is generated based on the initial classification standard and a second text corresponding to the initial classification standard, and the iterative optimization is based on the relevance of the initial classification standard and the second text and the relevance of the variant classification standard and the second text. By implementing the method of the present disclosure, a target classification standard with clear boundaries, accurate description and strong robustness can be generated, and the text category corresponding to the first text can be accurately determined, thereby solving the problem of inaccurate text classification.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of text classification technology, specifically to a method, apparatus, device, medium, and product for text classification. Background Technology

[0002] Typically, text classification techniques combined with text classification criteria can be used to add pre-defined text labels or categories to text. The traditional method of manually developing text classification criteria suffers from inherent drawbacks such as long development cycles, high costs, and strong subjectivity. Traditional machine learning methods, often based on word frequency or co-occurrence to generate text classification criteria, suffer from poor accuracy and robustness due to their inability to understand complex linguistic phenomena such as context. These criteria are easily circumvented and fail to cover texts with diverse expressions. Consequently, the text labels or categories added to the text may also be inaccurate. Summary of the Invention

[0003] This disclosure provides a method, apparatus, device, medium, and product for text classification to solve the problem of inaccurate text classification.

[0004] In a first aspect, this disclosure provides a method for text classification, the method comprising: obtaining a first text; classifying the first text based on a target classification standard to obtain a text category corresponding to the first text; wherein the target classification standard is configured to be obtained by iterative optimization based on an initial classification standard and a variant classification standard corresponding to the initial classification standard, the variant classification standard is configured to be generated based on the initial classification standard and a second text corresponding to the initial classification standard, and the iterative optimization is configured to be performed based on the degree of correlation between the initial classification standard and the second text and the degree of correlation between the variant classification standard and the second text.

[0005] Secondly, this disclosure provides a text classification apparatus, comprising: a first acquisition module for acquiring a first text; and a classification module for classifying the first text based on a target classification standard to obtain a text category corresponding to the first text; wherein the target classification standard is configured to be obtained by iterative optimization based on an initial classification standard and a variant classification standard corresponding to the initial classification standard, the variant classification standard is configured to be generated based on the initial classification standard and a second text corresponding to the initial classification standard, and the iterative optimization is configured to be performed based on the degree of correlation between the initial classification standard and the second text and the degree of correlation between the variant classification standard and the second text.

[0006] Thirdly, this disclosure provides an electronic device, including: a memory and a processor, which are communicatively connected to each other. The memory stores computer instructions, and the processor executes the computer instructions to perform the text classification method described in the first aspect or any corresponding embodiment.

[0007] Fourthly, this disclosure provides a computer-readable storage medium storing computer instructions for causing a computer to perform the text classification method described in the first aspect or any corresponding embodiment thereof.

[0008] Fifthly, this disclosure provides a computer program product, including computer instructions for causing a computer to perform the text classification method described in the first aspect or any corresponding embodiment thereof.

[0009] The text classification method disclosed herein generates variant classification standards based on an initial classification standard and a corresponding second text. Then, based on the correlation between the initial and second texts, and the correlation between the variant classification standards and the second text, the initial and variant classification standards are iteratively optimized. This generates target classification standards with clear boundaries, precise descriptions, and strong robustness, ensuring a high degree of objectivity and consistency in the final target classification standards and avoiding inconsistencies in classification standards developed by different experts or teams. Classifying the first text based on the target classification standards can accurately determine the text category corresponding to the first text, thus solving the problem of inaccurate text classification. Attached Figure Description

[0010] To more clearly illustrate the technical solutions in the specific embodiments of this disclosure or the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this disclosure. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0011] Figure 1 This is a schematic diagram of an optional application scenario according to an embodiment of the present disclosure; Figure 2 This is a schematic flowchart of a first method for text classification according to an embodiment of the present disclosure; Figure 3 This is a second flowchart illustrating a text classification method according to an embodiment of the present disclosure; Figure 4 This is a schematic diagram of a third method for text classification according to an embodiment of the present disclosure; Figure 5 This is a schematic flowchart of a fourth method for text classification according to an embodiment of the present disclosure; Figure 6 This is a schematic diagram of the expansion process of a target iterative optimization tree according to an embodiment of the present disclosure; Figure 7This is a fifth flowchart illustrating a text classification method according to an embodiment of the present disclosure; Figure 8 This is a structural block diagram of a text classification apparatus according to an embodiment of the present disclosure; Figure 9 This is a schematic diagram of the hardware structure of an electronic device according to an embodiment of this disclosure. Detailed Implementation

[0012] To make the objectives, technical solutions, and advantages of the embodiments of this disclosure clearer, the technical solutions of the embodiments of this disclosure will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this disclosure, not all embodiments. Based on the embodiments of this disclosure, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this disclosure.

[0013] It is understood that before using the technical solutions disclosed in the various embodiments of this disclosure, users should be informed of the types, scope of use, and usage scenarios of the personal information involved in this disclosure in an appropriate manner in accordance with relevant laws and regulations, and user authorization should be obtained.

[0014] For example, upon receiving a user's active request, a prompt message is sent to the user to explicitly inform them that the requested operation will require the acquisition and use of the user's personal information. This allows the user to independently choose whether to provide personal information to the software or hardware, such as the electronic device, application, server, or storage medium performing the operations of this disclosed technical solution, based on the prompt message.

[0015] As an optional but non-limiting implementation, in response to a user's active request, sending a prompt message to the user can be done via a pop-up window, where the prompt message can be presented in text format. Furthermore, the pop-up window can also include a selection control allowing the user to choose "agree" or "disagree" to provide personal information to the electronic device.

[0016] It is understood that the above notification and user authorization process are merely illustrative and do not constitute a limitation on the implementation of this disclosure. Other methods that comply with relevant laws and regulations may also be applied to the implementation of this disclosure.

[0017] It is understood that the data involved in this technical solution (including but not limited to the data itself, the acquisition or use of the data) shall comply with the requirements of relevant laws, regulations and related provisions.

[0018] The terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of this disclosure, "a plurality of" means two or more, unless otherwise expressly specified.

[0019] Text classification techniques are frequently used in daily life. For example, they are used to categorize news reports, emails, and perform sentiment analysis on public comments on social media. Since most text (such as the content of news reports and public comments on social media) is unstructured, it lacks a predefined format, making it difficult to analyze directly. Text classification techniques, through Natural Language Processing (NLP) and machine learning, can automatically add predefined text labels or categories to this text, thereby achieving the ordering and structuring of information.

[0020] By establishing clear and unified classification standards, all participants (such as annotators and machine learning models) can follow the same set of clear classification standards to add preset text labels or text categories to text. This can minimize the inconsistencies caused by differences in personal understanding and subjective judgment, and also ensure that similar texts always receive consistent text labels or text categories. This achieves the goal of accurately assigning preset text labels or text categories to texts, thereby making the entire classification system reliable and predictable.

[0021] Currently, classification standards can be manually developed, for example, by domain experts through discussions and experience summaries. However, this traditional model of manually developing standards is no longer suitable for the rapidly changing market due to inherent drawbacks such as long development cycles, high costs, and strong subjectivity. Therefore, exploring technological pathways to automatically generate classification standards from massive amounts of real-world classification cases has become a pressing area for the industry to explore.

[0022] Traditional machine learning methods such as support vector machines, decision trees or deep learning classifiers are mainly used as judges in the field of text classification. By learning a large number of labeled cases, they construct models to automatically judge text labels or text categories of new texts. Although these models have achieved success in improving classification efficiency, the inherent defects of traditional machine learning methods are very obvious when it comes to the goal of "generating standards from cases". For example, classification standards are generated based on rule mining algorithms such as association rule learning. Because rule mining algorithms are originally designed to discover patterns and associations from data, and traditional rule mining algorithms tend to discover strong associations on the surface of data. However, on text data, the use of rule mining algorithms may generate massive trivial classification standards with no actual business significance (for example, texts containing the words "de" and "shi" belong to classification standard A), which adds a huge burden to manual screening and verification. Meanwhile, such algorithms are usually based on word frequency or co-occurrence, and cannot understand complex linguistic phenomena such as context.

[0023] Therefore, the classification standards generated by the above solutions are poor in both accuracy and robustness, are easily avoided simply, and cannot cover texts with varied expression ways. Correspondingly, this will also result in inaccurate text labels or text categories assigned to texts.

[0024] In view of this, the present disclosure proposes a text classification method, which relies on the Monte Carlo tree search algorithm to continuously iteratively optimize the initial classification standards, and can generate target classification standards with clear boundaries, accurate descriptions and strong robustness, ensuring that the finally produced target classification standards have high objectivity and internal consistency, and avoiding the problem of inconsistent classification standards formulated by different experts or teams. Classifying the first text based on the target classification standards can relatively accurately determine the text category corresponding to the first text, thereby solving the problem of inaccurate text classification.

[0025] As an optional application scenario of the embodiments of the present disclosure, such as Figure 1 shown, a text classification system is deployed on an electronic device. The text classification system has a built-in second generation model, and the text classification system has an upload page. The upload page has an upload area for a training sample data set and an upload area for an initial classification standard data set. When a user operates the upload areas, the electronic device responds to the user's upload operation and receives the training sample data set and the initial classification standard data set uploaded by the user. Wherein, the training sample data set includes a plurality of third texts, text categories corresponding to each third text, and category generation sources corresponding to each text category; the initial classification standard data set includes a plurality of classification standards.

[0026] After receiving the training sample dataset and the initial classification standard dataset, the electronic device queries the initial classification standard dataset for the classification standard corresponding to each third text. If no classification standard is found for each third text in the initial classification standard dataset, a classification standard is generated for each third text based on the second generative model. The classification standards corresponding to each third text are clustered to obtain multiple initial classification standards, and the third text corresponding to each initial classification standard is determined as the second text, thus obtaining multiple initial classification standards and their corresponding second texts. Each initial classification standard is used as the root node of the iterative optimization tree. The root node is determined as the target split node, and variant classification standards generated by rewriting or fine-tuning the initial classification standards based on the second text are used as child nodes to expand the iterative optimization tree, i.e., generating the candidate iterative optimization tree. By continuously iterating and expanding the candidate iterative optimization tree, the target iterative optimization tree is obtained. The node corresponding to the largest correlation index in the target iterative optimization tree is determined as the node containing the target classification standard. After obtaining the target classification standard, the first text can be classified based on the target classification standard to obtain the text category corresponding to the first text.

[0027] According to an embodiment of this disclosure, a method for text classification is provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.

[0028] This embodiment provides a text classification method that can be used in electronic devices. Figure 2 This is a flowchart of a text classification method according to an embodiment of the present disclosure, such as... Figure 2 As shown, the process includes the following steps: Step S201: Obtain the first text.

[0029] The first text can be the text to be classified. As mentioned earlier, the first text can be a news report, an email, etc., and there are no specific limitations on the content of the first text. In addition, the first text can be uploaded to the text classification system by the user through the upload page shown earlier, or it can be obtained by the text classification system from the corresponding database.

[0030] Step S202: Classify the first text based on the target classification standard to obtain the text category corresponding to the first text; wherein, the target classification standard is configured to be obtained by iterative optimization based on the initial classification standard and the variant classification standard corresponding to the initial classification standard, the variant classification standard is configured to be generated based on the initial classification standard and the second text corresponding to the initial classification standard, and the iterative optimization is configured to be based on the degree of correlation between the initial classification standard and the second text and the degree of correlation between the variant classification standard and the second text.

[0031] Text categories can be predefined tags used to categorize the domain / attribute / purpose of text.

[0032] A classification criterion can be a standard for determining the text category to which a text belongs; that is, a classification criterion can be used to define text categories. The initial classification criterion can be an unoptimized criterion, while variant classification criteria can be obtained by fine-tuning or rewriting the initial criterion. The target classification criterion is obtained by iteratively optimizing the initial and variant classification criteria. For example, the initial classification criterion can be a standard for defining the text category "sports news," while the variant classification criterion can be a standard for defining the text category "event reports." Iteratively optimizing the initial and variant classification criteria yields a standard for defining the text category "sports."

[0033] The second text can be text already associated with the initial classification criterion. The degree of association can be used to characterize the fit between the category rules of the initial or variant classification criterion and the content features of the second text. Here, the content features of the first text can be matched with the category rules in the target classification criterion to determine the text category corresponding to the first text.

[0034] The text classification method provided in this embodiment generates variant classification standards based on an initial classification standard and the corresponding second text. Then, based on the correlation between the initial and second texts, and the correlation between the variant classification standards and the second text, the method iteratively optimizes both the initial and variant classification standards. This generates target classification standards with clear boundaries, precise descriptions, and strong robustness, ensuring a high degree of objectivity and consistency in the final target classification standards and avoiding inconsistencies between classification standards developed by different experts or teams. Classifying the first text based on the target classification standards can accurately determine the text category corresponding to the first text, thus solving the problem of inaccurate text classification.

[0035] This embodiment provides a text classification method that can be used in electronic devices. Figure 3 This is a flowchart of a text classification method according to an embodiment of the present disclosure, such as... Figure 3As shown, the process includes the following steps: Step S301: Obtain the initial classification criteria and the corresponding second text. Please refer to the previous text for details regarding the initial classification criteria and the second text.

[0036] Here, we can obtain the second text and its corresponding text category using the training dataset shown above. Simultaneously, we can determine the initial classification standard for the second text from the initial classification standard dataset based on the second text and its corresponding text category, or we can generate the initial classification standard for the second text based on the model. Furthermore, when determining the initial classification standard for the second text, we can categorize its source as either manually defined or model-generated, i.e., the source of the classification standard.

[0037] Step S302: Based on the second text and the initial classification standard, generate a variant classification standard corresponding to the initial classification standard.

[0038] Variant classification criteria can be derived by rewriting or fine-tuning the initial classification criteria. As a concrete example, a second text, the initial classification criteria, and the corresponding source of the initial classification criteria can be input into a classification criterion generation model. This model can then rewrite or fine-tune the initial classification criteria to obtain variant classification criteria. The source of the classification criteria indicates whether the initial classification criteria were manually defined or generated by a model. The classification criterion generation model can generate variant classification criteria based on the input second text, the initial classification criteria, and the corresponding source of the initial classification criteria. This model can be trained on a large language model architecture, a machine learning model architecture, or a combination of multiple model architectures; no specific limitation is made here, as long as it can generate variant classification criteria.

[0039] Step S303: Based on the degree of correlation between the initial classification criteria and the second text, determine the first correlation index of the initial classification criteria.

[0040] The first association metric can be used to assess the degree of association between the initial classification criteria and the corresponding second text. As a specific example, the first association metric can be determined by fusing the matching degree between the initial classification criteria and the second text with the semantic similarity between the initial classification criteria and the second text.

[0041] Step S304: Based on the degree of correlation between the variant classification criteria and the second text, determine the second correlation index of the variant classification criteria.

[0042] The second association metric can be used to assess the degree of association between the variant classification criteria and the corresponding second text. As a specific example, the second association metric can be determined by fusing the degree of matching between the variant classification criteria and the second text, as well as the semantic similarity between the variant classification criteria and the second text.

[0043] Step S305: Based on the first correlation index and the second correlation index, iteratively optimize the initial classification standard and the variant classification standard to obtain the target classification standard.

[0044] Here, a tree structure can be built based on the initial classification criteria and variant classification criteria. The tree structure can then undergo multiple expansion, simulation, backpropagation, and selection steps until it converges, yielding the target tree structure. The target classification criteria are then determined from this target tree structure. The tree structure can be a Monte Carlo tree.

[0045] Of course, here we can also create initial individuals based on initial classification criteria and variant classification criteria, and iteratively optimize the initial individuals using genetic algorithms or particle swarm optimization algorithms to generate the final target individuals, and determine the initial classification criteria or variant classification criteria corresponding to the target individuals as the target classification criteria.

[0046] The text classification method provided in this embodiment generates variant classification standards corresponding to the initial classification standards based on the second text and the initial classification standards. It iteratively optimizes the initial classification standards and variant classification standards by using the first correlation index corresponding to the initial classification standards and the second correlation index corresponding to the variant classification standards. This generates target classification standards with clear boundaries, accurate descriptions, and strong robustness, further ensuring that the final target classification standards have high objectivity and internal consistency, and further avoiding the problem of inconsistent classification standards developed by different experts or teams.

[0047] This embodiment provides a text classification method that can be used in electronic devices. Figure 4 This is a flowchart of a text classification method according to an embodiment of the present disclosure, such as... Figure 4 As shown, the process includes the following steps: Step S401: Obtain the initial classification criteria and the second text corresponding to the initial classification criteria.

[0048] Specifically, step S401 includes: Step S4011: Obtain the training sample dataset and the initial classification standard dataset. The training sample dataset includes multiple third-party texts, and the initial classification standard dataset includes multiple classification standards.

[0049] The training sample dataset may include each third text and its corresponding text category, as well as the category generation source for each text category. The category generation source indicates whether the text category corresponding to the third text was manually labeled or generated by a model. The multiple classification criteria in the initial classification standard dataset can be manually defined or generated by a model; no specific limitation is made here.

[0050] After obtaining the initial classification standard dataset, if the document format of the initial classification standard dataset is unstructured or semi-structured, a document format conversion model can be used to convert the initial classification standard dataset into a unified document format readable by electronic devices. For example, the document format of the initial classification standard dataset can be converted to comma-separated values ​​(CSV) format. By converting the document format of the initial classification standard dataset, it is ensured that the initial classification standard dataset is effectively integrated as external knowledge into the process of optimizing the initial classification standard.

[0051] Step S4012: For any third text, based on the semantic similarity between the third text and each classification standard, determine the classification standard corresponding to the third text from each classification standard.

[0052] Semantic similarity can be used to characterize the semantic association between the content features of a third text and the classification rules of a classification standard. Here, we can iterate through the data, calculating the semantic similarity between the third text and each classification standard one by one, thus determining the corresponding classification standard for the third text from the initial classification standard dataset. Alternatively, we can query the classification standard corresponding to the third text from the initial classification standard dataset based on the text category. For example, we can associate a third text containing "sports events" with the classification standard for the text category "sports"; and associate a third text containing "economic trends" with the classification standard for the text category "finance".

[0053] Of course, in an optional implementation, if the semantic similarity between the third text and each classification standard fails to determine the corresponding classification standard for the third text, then the classification standard for the third text is generated based on the second generative model. Here, the second generative model can utilize its inductive ability to summarize and generalize the third text to generate the corresponding classification standard. The training process of the second generative model is similar to the training process of the classification standard generation model shown above, and will not be repeated here.

[0054] When the classification criteria for the third text cannot be determined through semantic similarity, the classification criteria for the third text can be generated by the second generative model, which can ensure that each third text in the training dataset has a corresponding classification criterion.

[0055] Step S4013: Cluster the classification criteria corresponding to each third text to obtain multiple initial classification criteria, and determine the third text corresponding to the initial classification criteria as the second text.

[0056] Here, based on the similarity of the embeddings of the classification criteria corresponding to the third texts, classification criteria with similar meanings can be merged into one class, thus obtaining multiple initial classification criteria. Since clustering will result in each initial classification criterion corresponding to one or more third texts, for ease of description, the one or more third texts corresponding to each initial classification criterion can be referred to as second texts. Furthermore, it should be understood that when the meanings of the third texts are similar, the text categories corresponding to the similar-meaning third texts are the same. Therefore, multiple second texts corresponding to the same initial classification criterion can have the same text category.

[0057] Clustering the classification criteria corresponding to each third text can group a large number of semantically similar or overlapping classification criteria into an initial classification criterion, which can reduce the redundancy between classification criteria.

[0058] Step S402: Based on the second text and the initial classification criteria, generate variant classification criteria corresponding to the initial classification criteria. For details, please refer to [link to relevant documentation]. Figure 3 Step S302 of the illustrated embodiment will not be described again here.

[0059] Step S403: Based on the degree of correlation between the initial classification criteria and the second text, determine the first correlation index of the initial classification criteria.

[0060] Specifically, step S403 includes: Step S4031: Based on the degree of correlation between the initial classification criteria and the second text, determine multiple correlation indicators corresponding to the initial classification criteria.

[0061] The degree of correlation characterizes the consistency between the initial classification criteria and the second text in terms of meaning, content, and logic. As a concrete example, a correlation index evaluation model can be used to evaluate the initial classification criteria and the second text multiple times, generating multiple correlation indices corresponding to the initial classification criteria. The training process of the correlation index evaluation model is similar to that of the classification criterion generation model shown earlier, and will not be repeated here.

[0062] Step S4032: Determine the statistical values ​​of the related indicators corresponding to multiple related indicators, and determine the smallest related indicator among the multiple related indicators.

[0063] As a concrete example, multiple related indicators can be averaged, and the average value of these indicators can be used as the statistical value of the related indicator. The smallest related indicator among these indicators can then be taken as the minimum related indicator.

[0064] Step S4033: Based on the fusion result of the statistical value of the correlation indicator and the minimum correlation indicator, determine the first correlation indicator.

[0065] As a concrete example, the first correlation index for the initial classification standard can be obtained by weighted fusion of the statistical values ​​of correlation indicators and the minimum correlation index. For example, the first correlation index can be determined by the following expression. Where Q represents the first correlation index, Used to represent a set corresponding to multiple related indicators. Used to represent a set The number of elements in the middle. Used to represent the i-th element, i.e., the i-th related index.

[0066] In some optional implementations, step S4031 above includes: Step a1: Input the second text and the initial classification criteria into the first generation model to obtain multiple matching indicators.

[0067] Step a2: Determine the semantic similarity between the initial classification criteria and the second text to obtain the semantic similarity index.

[0068] Step a3: Each matching indicator is fused with the semantic similarity indicator to obtain multiple association indicators.

[0069] Here, the clarity, accuracy, and unambiguity between the second text and the initial classification criteria can be evaluated by calling the first generation model multiple times, generating multiple matching metrics. Alternatively, the initial classification criteria, the second text, and the source of the classification criteria corresponding to the initial classification criteria can be input into the first generation model, and multiple matching metrics can be obtained by calling the first generation model multiple times. The training process of the first generation model is similar to that of the model shown earlier, and will not be repeated here.

[0070] Here, semantic similarity metrics can be obtained by calculating the semantic similarity between the initial classification standard and the second text using retrieval enhancement techniques. When the initial classification standard corresponds to one second text, the semantic similarity between the initial classification standard and the second text can be used as the semantic similarity metric. When the initial classification standard corresponds to multiple second texts, the average semantic similarity between the initial classification standard and each of the second texts can be used as the semantic similarity metric.

[0071] Here, a matching metric and a semantic similarity metric can be fused to obtain an association metric. Since there are multiple matching metrics, multiple association metrics can be obtained. As a specific example, a weighted fusion of a matching metric and a semantic similarity metric can be used to obtain an association metric. For example, the association metric can be calculated using the following expression. In this context, `text` represents the second text, `reason` represents the source of the initial classification standard, and `rule` represents the initial classification standard. A matching metric is used to represent the output of the first generative model, in the case that there are multiple matching metrics in the second text. The 'i' represents the i-th second text, and 'n' represents the total number of second texts. The semantic similarity metric is used to represent the semantic similarity between the i-th second text and the initial classification criteria. α is a hyperparameter; for example, α can take values ​​that are, but are not limited to, 1. α represents the weight of the matching metric and the semantic similarity metric. Therefore, the specific value of α can be adjusted based on the importance of the matching metric or the semantic similarity metric. It should be understood that when there is only one second text, n is 1.

[0072] By fusing the matching metrics and semantic similarity metrics output by the first generative model, the initial classification criteria can be evaluated relatively accurately.

[0073] Step S404: Based on the degree of correlation between the variant classification criteria and the second text, determine the second correlation index of the variant classification criteria.

[0074] The process for determining the correlation between the variant classification criteria and the second text is the same as that for determining the correlation between the initial classification criteria and the second text, and will not be repeated here.

[0075] Step S405: Based on the first and second correlation indices, iteratively optimize the initial classification criteria and variant classification criteria to obtain the target classification criteria. For details, please refer to [link to relevant documentation]. Figure 3 Step S305 of the illustrated embodiment will not be described again here.

[0076] The text classification method provided in this embodiment can accurately determine the first correlation index by fusing the statistical value of the correlation index with the minimum correlation index, and the quality of the first index can balance the relationship between the minimum correlation index and the statistical value of the correlation index.

[0077] This embodiment provides a text classification method that can be used in electronic devices. Figure 5 This is a flowchart of a text classification method according to an embodiment of the present disclosure, such as... Figure 5 As shown, the process includes the following steps: Step S501: Obtain the initial classification criteria and the corresponding second text. For details, please refer to [link to relevant documentation]. Figure 3 Step S301 of the illustrated embodiment will not be described again here.

[0078] Step S502: Based on the second text and the initial classification criteria, generate variant classification criteria corresponding to the initial classification criteria. For details, please refer to [link to relevant documentation]. Figure 3 Step S302 of the illustrated embodiment will not be described again here.

[0079] Step S503: Based on the degree of correlation between the initial classification criteria and the second text, determine the first correlation index of the initial classification criteria. For details, please refer to [link to relevant documentation]. Figure 3 Step S303 of the illustrated embodiment will not be described again here.

[0080] Step S504: Based on the correlation between the variant classification criteria and the second text, determine the second correlation index of the variant classification criteria. See details below. Figure 3 Step S304 of the illustrated embodiment will not be described again here.

[0081] Step S505: Based on the first correlation index and the second correlation index, iteratively optimize the initial classification standard and the variant classification standard to obtain the target classification standard.

[0082] Specifically, step S505 includes: Step S5051: Construct an iterative optimization tree with the initial classification criteria as the root node.

[0083] The root node represents the initial classification criterion, and at this point, the iterative optimization tree has only one node, the root node. As a specific example, the iterative optimization tree can be a Monte Carlo tree, but it is not limited to Monte Carlo trees. For example, iterative optimization trees can also be UCT (Upper Confidence Bound for Trees) trees, α-β pruning trees, and heuristic search trees.

[0084] Step S5052: Using the root node as the target splitting node, and using the variant classification criteria as the child nodes of the target splitting node to expand the iterative optimization tree, a candidate iterative optimization tree is obtained.

[0085] After constructing the iterative optimization tree, the root node can be used as the target split node, and child nodes can be expanded for the target split node. This expands the iterative optimization tree to obtain a candidate iterative optimization tree. At this point, the candidate iterative optimization tree has two nodes: the root node (target split node) and the child nodes corresponding to the root node.

[0086] Step S5053: Determine the first exploration index of the target split node based on multiple correlation indicators corresponding to the target split node, and determine the second exploration index of the child node based on multiple correlation indicators corresponding to the child node.

[0087] The first exploration metric can be used to characterize the potential value of exploring the target split node, and the second exploration metric can be used to characterize the potential value of exploring the child nodes.

[0088] In an optional implementation, the process of determining the first exploration index of the target split node based on multiple correlation indices corresponding to the target split node in step S5053 above may include: Step b1: Obtain the first access count of the target split node and the second access count of the child nodes of the target split node. The first access count is used to characterize the number of times the child nodes update the target split node in reverse.

[0089] Step b2: Determine the exploration factor based on the ratio of the first number of visits to the second number of visits.

[0090] Step b3: Based on the fusion result of the correlation index statistics corresponding to the target split node and the exploration factor, determine the first exploration index.

[0091] For a node in the candidate iterative optimization tree, the number of times its child nodes perform reverse updates on that node can be determined as the number of visits. In the candidate iterative optimization tree, after expanding child nodes for the target split node, the child nodes can perform reverse updates on the target split node's first association index using their own second association index. Therefore, the number of times the child nodes perform reverse updates on the target split node can be determined as the target split node's first visit count. Since child nodes do not have their own child nodes, there is no visit count for reverse updates on child nodes; thus, a very small value such as 1× can be set. This is the second visit count for a child node.

[0092] Here, the statistical values ​​of the correlation indicators of the target split node can be directly fused with the exploration factors, or the statistical values ​​of the correlation indicators of the target split node can be weighted and fused with the exploration factors to determine the first exploration indicator. For example, the first exploration indicator can be determined by the following expression. ,in, Used to represent the exploration index of the j-th node in the candidate iterative optimization tree. This is used to represent the average return of the j-th node, i.e., the statistical value of the correlation indicator of the j-th node. Used to represent the number of visits to the parent node of the j-th node. The value of C represents the number of visits to the j-th node. C is used to represent a constant. The specific value of C can be flexibly adjusted according to the actual situation, and no specific limit is made here.

[0093] It should be understood that the process of determining the second exploration index of the child node based on multiple association indicators corresponding to the child node in step S5053 above is the same as the process of determining the first exploration index of the target split node based on multiple association indicators corresponding to the target split node, and will not be repeated here.

[0094] The first exploration index is determined by the ratio of the statistical value of the correlation index of the target split node to the first access number and the second access number, which can accurately assess the exploration value of the target split node.

[0095] Step S5054: Perform a collaborative analysis on the first correlation index and the first exploration index corresponding to the target split node, as well as the second correlation index and the second exploration index corresponding to the child node, to determine a new target split node from the candidate iterative optimization tree, and continue to expand the candidate iterative optimization tree until convergence, thus obtaining the target iterative optimization tree.

[0096] Here, by jointly analyzing the first association index and the first exploration index corresponding to the target splitting node, and the second association index and the second exploration index corresponding to the child nodes, high-quality new target splitting nodes can be identified from the candidate iterative optimization tree. New variant classification criteria, modified from the initial classification criteria or fine-tuned, are then used as new target splitting nodes to further expand the candidate iterative optimization tree until it converges, thus obtaining the target iterative optimization tree. Convergence is determined when no new target splitting nodes can be identified from the candidate iterative optimization tree, or when the depth of the candidate iterative optimization tree reaches a preset depth.

[0097] As an optional implementation, the process of performing a collaborative analysis on the first correlation index and the first exploration index corresponding to the target splitting node, and the second correlation index and the second exploration index corresponding to the child nodes in step S5054, to determine a new target splitting node from the candidate iterative optimization tree, may include: Step c1: Based on the second association index corresponding to the child node, the first association index of the target split node is updated in reverse to obtain the updated association index of the target split node.

[0098] Step c2 involves performing a collaborative analysis of the updated correlation index and the first exploration index corresponding to the target split node, as well as the second correlation index and the second exploration index corresponding to the child nodes, to determine a new target split node from the candidate iterative optimization tree.

[0099] Updating the first association index of the target split node by reversing the second association index corresponding to the child nodes can give the target split node a more accurate association index, i.e., an updated association index. Then, by performing a collaborative analysis based on the updated association index and the first exploration index corresponding to the target split node, as well as the second association index and the second exploration index corresponding to the child nodes, it is possible to more accurately identify new target split nodes with high-quality classification potential value.

[0100] As an optional implementation, step c1 above may include: Step c11: Based on the fusion result of the second association index of the child node and the first association index of the target split node, determine the updated association index.

[0101] When the target split node has only one child node, the updated correlation index of the target split node is obtained by averaging the first correlation index of the target split node and the second correlation index of the child node. When the target split node has two child nodes, the updated correlation index of the target split node can be determined by the following expression. ,in, Used to represent the updated correlation index corresponding to the target split node. Used to represent the first association index corresponding to the target split node. The second association index is used to represent the i-th child node of the target split node, and Children is used to represent the total number of child nodes of the target split node.

[0102] When a child node obtains a better second association metric through further exploration, the updated association metric of the target split node will be improved by merging the child node's second association metric with the target split node's first association metric, thus allowing the target split node to be prioritized in the subsequent "selection phase." Conversely, if a child node's second association metric is poor, merging the child node's second association metric with the target split node's first association metric will lower the target split node's value, reducing ineffective exploration of that path.

[0103] As an optional implementation, step c2 above may include: Step c21: If the second association index of the child node is greater than or equal to the updated association index of the target split node, and the second exploration index of the child node is less than or equal to the first exploration index of the target split node, then the child node is determined as the new target split node.

[0104] If the first exploration index of the target split node is greater than the second exploration index of its child nodes, and the updated correlation index of the target split node is less than the second correlation index of its child nodes, then the target split node has low exploration value and will not be selected as a new target split node. Conversely, if the second exploration index of a child node is less than or equal to the first exploration index of the target split node, but the second correlation index of the child node is greater than or equal to the updated correlation index of the target split node, then the child node has high exploration value and can be identified as a new target split node.

[0105] Since the target split node in the candidate iterative optimization tree has only one child node, the new target split node can be determined using the method described above. When the tree structure of the candidate iterative optimization tree is more complex, the new target split node can be determined using the steps corresponding to the specific embodiments shown below.

[0106] Step S5055: In the target iterative optimization tree, determine the node corresponding to the largest correlation index as the node where the target classification standard is located.

[0107] Since the association index is used to characterize the degree of matching between the classification standard and the second text, the target node can be determined by selecting the node corresponding to the largest association index in the entire target iterative optimization tree, and the classification standard represented by the target node can be determined as the target classification standard.

[0108] To facilitate understanding of the iterative optimization process described above, the following will use... Figure 6 The Monte Carlo tree shown further illustrates the iterative optimization process described above. Specifically, it includes the tree-building step, the expansion step, the simulation step, the backpropagation step, and the selection step. Among these, The tree construction step involves using the initial classification criteria as the root node ruleA_0 to build an iterative optimization tree.

[0109] The extension step involves rewriting or fine-tuning the initial classification criteria to obtain a variant classification criterion. This variant classification criterion is then used as a child node of the root node ruleA_0, ruleA_1, to obtain the candidate iterative optimization tree.

[0110] The simulation process involves calculating multiple related indicators for the root nodes ruleA_0 and ruleA_1 using the method described above, resulting in the set of related indicators corresponding to ruleA_0 and the set of related indicators corresponding to ruleA_1.

[0111] The backpropagation step calculates the correlation metrics between ruleA_0 and ruleA_1 using the correlation metric calculation method described above. Then, it updates the correlation metrics of ruleA_0 using the correlation metrics of ruleA_1 to obtain the updated correlation metrics of ruleA_0, and updates the access count of ruleA_0.

[0112] The selection step involves calculating the exploration metrics of ruleA_0 and ruleA_1 using the method described above. Next, new target split nodes are selected from the candidate iterative optimization tree. Taking the candidate iterative optimization tree obtained after the third expansion (containing only ruleA_0, ruleA_1, ruleA_2, and ruleA_3) as an example, the process for selecting new target split nodes is as follows: Since ruleA_1 already has two child nodes, ruleA_2 and ruleA_3, ruleA_1 cannot split further (of course, if ruleA_1 has only one child node, ruleA_2, and the exploration metric of ruleA_1 is greater than the exploration metric of ruleA_2, and the quality sub-table of ruleA_1 is less than the association metric of the child node, then ruleA_1 cannot split further). In this case, ruleA_0, ruleA_2, and ruleA_3 can be selected as new target split nodes. Then, the node with the largest exploration metric among ruleA_0, ruleA_2, and ruleA_3 can be selected as the new target split node. like Figure 6 As shown, it can be seen that when expanding the candidate iteration optimization tree for the 4th time, ruleA_0 is selected as the new target split node.

[0113] After multiple iterations (selection step, expansion, simulation, and backpropagation steps), the Monte Carlo tree will eventually converge, as shown below. Figure 6 The image shows the target iterative optimization tree obtained after four expansions. At this point, the node with the highest correlation index in the entire Monte Carlo tree can be selected to determine the node containing the target classification criterion.

[0114] As an optional implementation, the method further includes: Step d1: Obtain the validation test set, which includes multiple validation texts and validation text categories.

[0115] Step d2: Using the third generative model based on multiple target classification criteria, generate the predicted text category corresponding to each validation text.

[0116] Step d3 involves evaluating multiple target classification criteria and outputting the verification results by considering the differences between the predicted text categories corresponding to each verification text and the verification text categories.

[0117] By calling a third generative model to generate predicted text categories for multiple validation texts in the validation test set according to multiple target classification criteria, and then evaluating the multiple target classification criteria by comparing the differences between the predicted text categories and the validation text categories, the validation of multiple target classification criteria can be performed more accurately, avoiding scenarios where multiple target classification criteria remain only "theoretically reasonable" but cannot be implemented. The training process of the third generative model is similar to that of the classification criterion generation model shown above, and will not be repeated here.

[0118] The text classification method provided in this embodiment establishes an iterative optimization tree by using the initial classification standard as the root node. The iterative optimization tree is continuously expanded until convergence to obtain the target iterative optimization tree. The node corresponding to the largest correlation index in the entire target iterative optimization tree is then determined as the target node, and the classification standard represented by the target node is determined as the target classification standard. In this way, a target classification standard with clear boundaries, accurate description, and strong robustness can be obtained.

[0119] As a specific application embodiment of this disclosure, such as Figure 7 The diagram shown is a flowchart of a specific text classification method of this disclosure, including steps S701 to S710.

[0120] Step S701: Receive the training sample dataset uploaded by the user. The training sample dataset includes multiple third texts, the text categories corresponding to each third text, and the category generation source corresponding to each text category.

[0121] Step S702: Receive the initial classification standard dataset uploaded by the user. The initial classification standard dataset includes multiple classification standards, which can be manually defined or generated by the model.

[0122] Step S703: If the initial classification standard dataset is received, the classification standard that best matches each third text is selected based on the initial classification standard dataset; if the initial classification standard dataset is not received or the classification standard that best matches each third text is not selected based on the initial classification standard dataset, the classification standard for each third text is generated based on the second generation model.

[0123] Step S704: Cluster the classification criteria corresponding to each third text to obtain multiple initial classification criteria, and use one or more third texts corresponding to each initial classification criterion as second texts.

[0124] Step S705: Based on steps S703 and S704, obtain the source of the classification criteria corresponding to the initial classification criteria (manually formulated or model-generated).

[0125] Step S706: For each initial classification criterion, a Monte Carlo tree is built for that initial classification criterion. By continuously expanding the Monte Carlo tree, the initial classification criterion is iteratively optimized to obtain the target classification criterion corresponding to the initial classification criterion.

[0126] Step S707: In the converged Monte Carlo tree, the node with the largest correlation index is determined as the node where the target classification standard is located, thereby obtaining multiple target classification standards.

[0127] Step S708: Receive the verification test set uploaded by the user.

[0128] Step S709: Using the third generative model, predictive text categories are generated for the verification texts in the verification test set based on multiple target classification criteria, and verification results are generated based on the differences between the predicted text categories and the verification text categories of each verification text.

[0129] Step S710: Output the verification result.

[0130] This embodiment also provides a text classification apparatus for implementing the above embodiments and preferred embodiments; details already described will not be repeated. As used below, the term "module" can refer to a combination of software and / or hardware that performs a predetermined function. Although the apparatus described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.

[0131] This embodiment provides a text classification device, such as... Figure 8 As shown, it includes: The first acquisition module 810 is used to acquire the first text.

[0132] The classification module 820 is used to classify the first text based on the target classification standard to obtain the text category corresponding to the first text. The target classification standard is configured to be obtained by iterative optimization based on the initial classification standard and the variant classification standard corresponding to the initial classification standard. The variant classification standard is configured to be generated based on the initial classification standard and the second text corresponding to the initial classification standard. The iterative optimization is configured to be based on the degree of correlation between the initial classification standard and the second text and the degree of correlation between the variant classification standard and the second text.

[0133] In some optional implementations, the second acquisition module is used to acquire text categories, corresponding initial classification criteria, and second text. The first generation module is used to generate variant classification criteria for the text categories based on the second text and the initial classification criteria. The first determination module is used to determine a first correlation index for the initial classification criteria based on the degree of correlation between the initial classification criteria and the second text. The second determination module is used to determine a second correlation index for the variant classification criteria based on the degree of correlation between the variant classification criteria and the second text. The iterative optimization module is used to iteratively optimize the initial classification criteria and variant classification criteria based on the first and second correlation indices to obtain the target classification criteria corresponding to the text categories.

[0134] In some optional implementations, the first determining module is further configured to determine multiple correlation indicators corresponding to the initial classification standard based on the degree of correlation between the initial classification standard and the second text; determine the correlation indicator statistical values ​​corresponding to the multiple correlation indicators, and determine the minimum correlation indicator among the multiple correlation indicators; and determine the first correlation indicator based on the fusion result of the correlation indicator statistical values ​​and the minimum correlation indicator.

[0135] In some optional implementations, the first determining module is further configured to input the second text and the initial classification criteria into the first generating model to obtain multiple matching indicators; determine the semantic similarity between the initial classification criteria and the second text to obtain a semantic similarity indicator; and fuse each matching indicator with the semantic similarity indicator to obtain multiple association indicators.

[0136] In some optional implementations, the iterative optimization module is further configured to: construct an iterative optimization tree with the initial classification criterion as the root node; expand the iterative optimization tree by using the root node as the target split node and the variant classification criterion as the child node of the target split node to obtain a candidate iterative optimization tree; determine a first exploration index of the target split node based on multiple correlation indices corresponding to the target split node, and determine a second exploration index of the child node based on multiple correlation indices corresponding to the child node; perform a collaborative analysis on the first correlation index and the first exploration index corresponding to the target split node, as well as the second correlation index and the second exploration index corresponding to the child node, to determine a new target split node from the candidate iterative optimization tree, and continue to expand the candidate iterative optimization tree until convergence to obtain the target iterative optimization tree; and in the target iterative optimization tree, determine the node corresponding to the largest correlation index as the node where the target classification criterion is located.

[0137] In some optional implementations, the iterative optimization module is further configured to obtain the first access count of the target split node and the second access count of the child nodes of the target split node, wherein the first access count is used to characterize the number of times the child nodes update the target split node in reverse; based on the ratio of the first access count to the second access count, an exploration factor is determined; and based on the fusion result of the correlation index statistics corresponding to the target split node and the exploration factor, a first exploration index is determined.

[0138] In some optional implementations, the iterative optimization module is further configured to reverse update the first association index of the target split node based on the second association index corresponding to the child node, to obtain the updated association index of the target split node; and to perform collaborative analysis on the updated association index and the first exploration index corresponding to the target split node, as well as the second association index and the second exploration index corresponding to the child node, to determine a new target split node from the candidate iterative optimization tree.

[0139] In some optional implementations, the iterative optimization module is also used to determine the updated association index based on the fusion result of the second association index of the child node and the first association index of the target split node.

[0140] In some optional implementations, the iterative optimization module is further configured to determine the child node as a new target split node if the second association index of the child node is greater than or equal to the updated association index of the target split node, and the second exploration index of the child node is less than or equal to the first exploration index of the target split node.

[0141] In some optional implementations, the second acquisition module is further configured to acquire a training sample dataset and an initial classification standard dataset. The training sample dataset includes multiple third texts, and the initial classification standard dataset includes multiple classification standards. For any third text, based on the semantic similarity between the third text and each classification standard, the classification standard corresponding to the third text is determined from each classification standard. The classification standards corresponding to each third text are clustered to obtain multiple initial classification standards, and the third text corresponding to the initial classification standard is determined as the second text.

[0142] In some optional implementations, the second acquisition module is further configured to generate a classification standard corresponding to the third text based on the second generation model if the classification standard corresponding to the third text cannot be determined by the semantic similarity between the third text and each classification standard.

[0143] In some alternative embodiments, the device further includes: The third acquisition module is used to acquire the verification test set, which includes multiple verification texts and verification text categories.

[0144] The second generation module is used to generate the predicted text category corresponding to each validation text based on multiple target classification criteria using the third generation model.

[0145] The validation module is used to validate multiple target classification criteria by using the predicted text categories corresponding to each validation text and the differences between the validation text categories, and then output the validation results.

[0146] The text classification apparatus provided in this disclosure can execute the text classification method provided in any embodiment of this disclosure, and has the corresponding functional modules and beneficial effects for executing the method. Further functional descriptions of the various modules and units described above are the same as in the corresponding embodiments described above, and will not be repeated here.

[0147] Figure 9 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this disclosure.

[0148] The following is a detailed reference. Figure 9 The diagram illustrates a structural schematic suitable for implementing an electronic device according to embodiments of the present disclosure. The electronic device may include a processor (e.g., a central processing unit, graphics processor, etc.) 901, which can perform various appropriate actions and processes according to a program stored in read-only memory (ROM) 902 or a program loaded from memory 909 into random access memory (RAM) 903. The RAM 903 also stores various programs and data required for the operation of the electronic device. The processor 901, ROM 902, and RAM 903 are interconnected via a bus 904. An input / output (I / O) interface 905 is also connected to the bus 904.

[0149] Typically, the following devices can be connected to I / O interface 905: input devices 906 including, for example, touchscreens, touchpads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; output devices 907 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; memory devices 909 including, for example, magnetic tapes, hard disks, etc.; and communication devices 909. Communication device 909 allows electronic devices to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 9 Electronic devices with various devices are shown, but it should be understood that it is not required to implement or have all of the devices shown, and more or fewer devices may be implemented or have instead.

[0150] In particular, according to embodiments of this disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this disclosure include a computer program product comprising a computer program carried on a non-transitory computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device 909, or installed from a memory 909, or installed from a ROM 902. When the computer program is executed by the processor 901, it performs the functions defined in the text classification method of embodiments of this disclosure.

[0151] Figure 9 The electronic device shown is merely an example and should not be construed as limiting the functionality and scope of the embodiments disclosed herein.

[0152] This disclosure also provides a computer-readable storage medium in which the methods described in this disclosure can be implemented in hardware or firmware, or implemented as recordable on a storage medium, or implemented as computer code originally stored on a remote storage medium or a non-transitory machine-readable storage medium and subsequently stored on a local storage medium after being downloaded over a network. Thus, the methods described herein can be processed by software stored on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. The storage medium can be a magnetic disk, optical disk, read-only memory, random access memory, flash memory, hard disk, or solid-state drive, etc.; further, the storage medium may also include combinations of the above types of memory. It is understood that computers, processors, microprocessor controllers, or programmable hardware include storage components capable of storing or receiving software or computer code that, when accessed and executed by the computer, processor, or hardware, implements the text classification method shown in the above embodiments.

[0153] A portion of this disclosure can be applied to computer program products, such as computer program instructions, which, when executed by a computer, can invoke or provide methods and / or technical solutions according to this disclosure through the operation of the computer. Those skilled in the art will understand that the forms in which computer program instructions exist in a computer-readable medium include, but are not limited to, source files, executable files, and installation package files. Accordingly, the ways in which computer program instructions are executed by a computer include, but are not limited to: the computer directly executing the instructions; the computer compiling the instructions and then executing the corresponding compiled program; the computer reading and executing the instructions; or the computer reading and installing the instructions and then executing the corresponding installed program. Here, the computer-readable medium can be any available computer-readable storage medium or communication medium accessible to a computer.

[0154] Although embodiments of the present disclosure have been described in conjunction with the accompanying drawings, those skilled in the art can make various modifications and variations without departing from the spirit and scope of the present disclosure, and such modifications and variations all fall within the scope defined by the appended claims.

Claims

1. A method for text classification, characterized in that, The method includes: Get the first text; The first text is classified based on the target classification criteria to obtain the text category corresponding to the first text; The target classification criterion is configured to be obtained by iterative optimization based on an initial classification criterion and a variant classification criterion corresponding to the initial classification criterion. The variant classification criterion is configured to be generated based on the initial classification criterion and a second text corresponding to the initial classification criterion. The iterative optimization is configured to be performed based on the degree of correlation between the initial classification criterion and the second text and the degree of correlation between the variant classification criterion and the second text.

2. The method according to claim 1, characterized in that, The target classification criteria are obtained in the following way: Obtain the initial classification criteria and the second text corresponding to the initial classification criteria; Based on the second text and the initial classification criteria, a variant classification criteria corresponding to the initial classification criteria is generated; Based on the initial classification criteria and the degree of correlation between the second text, a first correlation index of the initial classification criteria is determined; Based on the variant classification criteria and the degree of correlation between the second text, a second correlation index for the variant classification criteria is determined; Based on the first correlation index and the second correlation index, the initial classification standard and the variant classification standard are iteratively optimized to obtain the target classification standard.

3. The method according to claim 2, characterized in that, The determination of the first correlation index of the initial classification standard based on the correlation between the initial classification standard and the second text includes: Based on the degree of correlation between the initial classification criteria and the second text, multiple correlation indicators corresponding to the initial classification criteria are determined; Determine the statistical values ​​of the associated indicators corresponding to the plurality of associated indicators, and determine the smallest associated indicator among the plurality of associated indicators; The first correlation index is determined based on the fusion result of the statistical value of the correlation index and the minimum correlation index.

4. The method according to claim 3, characterized in that, The determination of multiple correlation indicators corresponding to the initial classification standard based on the degree of correlation between the initial classification standard and the second text includes: The second text and the initial classification criteria are input into the first generation model to obtain multiple matching indicators; Determine the semantic similarity between the initial classification criteria and the second text to obtain a semantic similarity index; Each of the matching metrics is fused with the semantic similarity metric to obtain the multiple association metrics.

5. The method according to claim 3, characterized in that, The step of iteratively optimizing the initial classification standard and the variant classification standard based on the first correlation index and the second correlation index to obtain the target classification standard includes: Using the initial classification criteria as the root node, construct an iterative optimization tree; The root node is used as the target splitting node, and the variant classification criteria are used as the child nodes of the target splitting node to expand the iterative optimization tree, thereby obtaining a candidate iterative optimization tree; A first exploration index for the target split node is determined based on the multiple association indicators corresponding to the target split node, and a second exploration index for the child node is determined based on the multiple association indicators corresponding to the child node. A collaborative analysis is performed on the first correlation index and the first exploration index corresponding to the target split node, and the second correlation index and the second exploration index corresponding to the child node. A new target split node is determined from the candidate iterative optimization tree, and the candidate iterative optimization tree is continued to be expanded until convergence, thus obtaining the target iterative optimization tree. In the target iterative optimization tree, the node corresponding to the largest correlation index is determined as the node where the target classification criterion is located.

6. The method according to claim 5, characterized in that, The step of determining the first exploration index of the target split node based on the multiple correlation indices corresponding to the target split node includes: Obtain the first access count of the target split node and the second access count of the child nodes of the target split node, wherein the first access count is used to characterize the number of times the child nodes reverse update the target split node; The exploration factor is determined based on the ratio of the first number of visits to the second number of visits; The first exploration index is determined based on the fusion result of the correlation index statistical value corresponding to the target split node and the exploration factor.

7. The method according to claim 5, characterized in that, The step of performing collaborative analysis on the first correlation index and the first exploration index corresponding to the target splitting node, and the second correlation index and the second exploration index corresponding to the child node, to determine a new target splitting node from the candidate iterative optimization tree, includes: Based on the second association index corresponding to the child node, the first association index of the target split node is updated in reverse to obtain the updated association index of the target split node. A collaborative analysis is performed on the updated correlation index and the first exploration index corresponding to the target split node, and the second correlation index and the second exploration index corresponding to the child node, to determine the new target split node from the candidate iterative optimization tree.

8. The method according to claim 7, characterized in that, The step of reversing the first association index of the target split node based on the second association index corresponding to the child node to obtain the updated association index of the target split node includes: The updated association index is determined based on the fusion result of the second association index of the child node and the first association index of the target split node.

9. The method according to claim 7, characterized in that, The step of performing collaborative analysis on the updated correlation index and the first exploration index corresponding to the target split node, and the second correlation index and the second exploration index corresponding to the child node, to determine the new target split node from the candidate iterative optimization tree, includes: If the second association index of the child node is greater than or equal to the updated association index of the target split node, and the second exploration index of the child node is less than or equal to the first exploration index of the target split node, then the child node is determined as the new target split node.

10. The method according to claim 2, characterized in that, The process of obtaining the initial classification criteria and the second text corresponding to the initial classification criteria includes: Obtain a training sample dataset and an initial classification standard dataset, wherein the training sample dataset includes multiple third-party texts and the initial classification standard dataset includes multiple classification standards; For any of the third texts, based on the semantic similarity between the third text and each of the classification criteria, the classification criteria corresponding to the third text are determined from each of the classification criteria; Clustering is performed on the classification criteria corresponding to each of the third texts to obtain multiple initial classification criteria, and the third text corresponding to the initial classification criteria is determined as the second text.

11. The method according to claim 10, characterized in that, Also includes: If the classification standard corresponding to the third text cannot be determined by the semantic similarity between the third text and each of the classification standards, then the classification standard corresponding to the third text is generated based on the second generation model.

12. The method according to claim 1, characterized in that, Also includes: Obtain a verification test set, which includes multiple verification texts and verification text categories; The third generative model is used to generate predicted text categories corresponding to each of the verification texts based on multiple target classification criteria; The verification results are obtained and output by verifying multiple target classification criteria through the difference between the predicted text category corresponding to each verification text and the verification text category.

13. A text classification device, characterized in that, The device includes: The first acquisition module is used to acquire the first text; The classification module is used to classify the first text based on the target classification criteria to obtain the text category corresponding to the first text; The target classification criterion is configured to be obtained by iterative optimization based on an initial classification criterion and a variant classification criterion corresponding to the initial classification criterion. The variant classification criterion is configured to be generated based on the initial classification criterion and a second text corresponding to the initial classification criterion. The iterative optimization is configured to be performed based on the degree of correlation between the initial classification criterion and the second text and the degree of correlation between the variant classification criterion and the second text.

14. An electronic device, characterized in that, include: A memory and a processor are communicatively connected, the memory storing computer instructions, and the processor executing the computer instructions to perform the text classification method according to any one of claims 1 to 12.

15. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions for causing a computer to perform the text classification method according to any one of claims 1 to 12.

16. A computer program product, characterized in that, Includes computer instructions for causing a computer to perform the text classification method according to any one of claims 1 to 12.

Citation Information

Patent Citations

  • Prompt optimization method and device based on Monte Carlo tree and electronic equipment

    CN119669383A

  • Updating method and device of data classification and grading standard, equipment, medium and product

    CN119760201A