Text classification method and device, computer device and storage medium

By using a pipeline approach to collaboratively identify and optimize easily confused tags using a large model agent, a stable set of target tags and high-quality synthetic samples are generated. This solves the accuracy problem in classifying professional domains and colloquial texts, and achieves efficient and reliable automatic text classification.

CN120744126BActive Publication Date: 2025-12-16BEIJING CENTURY TAL EDUCATION TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511232178.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-08-29
Publication Date
2025-12-16
Estimated Expiration
2045-08-29

AI Technical Summary

Technical Problem

Existing technologies are inaccurate in text classification when dealing with professional terminology or colloquial expressions, especially when there are multiple types of labels or ambiguous expressions, making it difficult to adapt to the classification needs of complex scenarios.

Method used

A pipeline approach is adopted to control the labeling agent, reflexive agent, and summarizing agent of the large model. The original samples are labeled, conflicting samples are identified to generate a set of easily confused labels, and then abstracted and merged to generate a stable set of target labels. High-quality synthetic target samples are generated by stratified sampling for classification.

Benefits of technology

It significantly improves the accuracy of text classification, achieves efficient and reliable automatic classification in complex scenarios, optimizes the label system, prunes and merges labels, and provides better data support.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120744126B_ABST
    Figure CN120744126B_ABST
Patent Text Reader

Abstract

The present disclosure provides a text classification method, device, computer equipment and storage medium. The method comprises: sequentially controlling a large model labeling agent, a large model reflection agent and a large model summary agent to perform corresponding operations in a pipeline manner to obtain a target label set; for each target label in the target label set, at least two sampling samples corresponding to the target label are sampled from original samples in a hierarchical sampling manner, and the at least two sampling samples corresponding to the target label are synthesized to generate a target synthetic sample, and the target label is used as the target label of the target synthetic sample; wherein the target label of the target synthetic sample is used for classifying the text to be classified. Through the method, the problem of label confusion in a complex scene can be effectively solved, the text classification accuracy is significantly improved, and a more efficient and reliable effect of automatically classifying the text is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of artificial intelligence technology, and in particular to text classification methods, apparatus, computer devices, and storage media. Background Technology

[0002] With the rapid development of artificial intelligence technology, text classification technology has evolved from early rule-based methods based on keyword matching to traditional machine learning algorithms, and then to deep learning models. In particular, the emergence of pre-trained large models in recent years, with their powerful semantic understanding capabilities and transfer learning characteristics, has significantly improved the performance of text classification.

[0003] In related technologies, text classification mainly relies on manually designed prompt word templates or a small number of labeled samples, directly using large language models for text classification. However, this approach often suffers from inaccurate classification results when dealing with texts containing specialized terminology or colloquial expressions. Summary of the Invention

[0004] To overcome the problems existing in related technologies, this disclosure provides a text classification method, apparatus, computer device, and storage medium.

[0005] According to a first aspect of the present disclosure, this application provides a text classification method, the method comprising:

[0006] The large model annotation agent, large model reflection agent, and large model summary agent are sequentially controlled in a pipeline manner to perform corresponding operations to obtain the target label set. The operations performed by the large model annotation agent include: labeling the original samples; the large model annotation agent uses its memory function to assign different labels to the same original sample from different inputs; the operations performed by the large model reflection agent include: for special samples where the original label conflicts with the latest label recently labeled by the large model annotation agent, reflection is performed to generate a set of easily confused labels based on the original and latest labels of the special samples; the operations performed by the large model summary agent include: abstracting and / or merging the labels in the confused label set to obtain the processing result; and if the iteration stopping condition is not currently met, the operations of the large model annotation agent, large model reflection agent, and large model summary agent continue to be sequentially controlled in a pipeline manner to obtain the target label set; if the iteration stopping condition is currently met, the target label set is determined based on the processing result.

[0007] For each target label in the target label set, at least two samples corresponding to the target label are sampled from the original samples using stratified sampling. These at least two samples are then combined to generate a target composite sample, and the target label is used as the target label of the target composite sample. The target label of the target composite sample is used to classify the text to be classified.

[0008] In any embodiment of this disclosure, the iteration stopping condition includes at least one of the following:

[0009] The current number of iterations is greater than or equal to a preset iteration threshold; wherein, the current number of iterations is increased by a set value each time it is determined that the iteration stop condition is not met.

[0010] In N consecutive iterations, the improvement in the accuracy of the original sample labels by the large model annotation agent in each iteration is less than the preset accuracy improvement threshold, where N is greater than 1.

[0011] In any embodiment of this disclosure, the operations performed by the large model reflection agent specifically include:

[0012] Based on the input reflection prompts, and according to the input confusion matrix, reflect on whether the original labels of the input special samples are correct, and reflect on whether the latest labels of the input special samples are correct; based on the reflection results, obtain a set of easily confused labels; wherein, the confusion matrix is ​​obtained by comparing the original labels of the original samples with the latest labels of the original samples labeled by the large model labeling agent, and the reflection prompts include reflection task requirements and reflection output format requirements.

[0013] In any embodiment of this disclosure, the operations performed by the large model summary agent specifically include:

[0014] The dynamically input summary prompts, the latest tag system, and the obfuscated tag set are input into the large model summary agent. The large model summary agent then abstracts and / or merges the obfuscated tag set based on the summary prompts, and integrates the abstracted and / or merged obfuscated tag set with the latest tag system. The latest tag system is the target tag set obtained in the previous iteration by controlling the large model annotation agent, large model reflection agent, and large model summary agent to perform operations. The summary prompts include summary task requirements and summary output format requirements.

[0015] In any embodiment of this disclosure, each target tag in the target tag set corresponds to at least one original tag in the original tag set;

[0016] For any target label, the original labels of at least two sampled samples correspond to that target label.

[0017] In conjunction with any embodiment of this disclosure, the step of synthesizing at least two sampled samples corresponding to the target label to generate a target composite sample includes:

[0018] The synthesis prompt word and at least two sampled samples corresponding to the target label are input into the large model sample synthesis agent, so that the large model sample synthesis agent synthesizes at least two sampled samples corresponding to the target label based on the synthesis prompt word, generating multiple candidate synthesized samples corresponding to the target label; wherein, the synthesis prompt word includes synthesis task requirements and synthesis output format requirements;

[0019] The scoring prompts and multiple candidate synthetic samples corresponding to the target label are input into a large model scoring and ranking agent. The agent then scores and ranks these samples based on the scoring prompts, outputting each sample in descending order of score. At least two samples with scores greater than a preset threshold are identified as the target synthetic sample corresponding to the target label. The scoring prompts include scoring task requirements and scoring output format requirements. The scoring task requirements include preset scoring criteria, which include at least one of the following: language fluency, vocabulary diversity, and sentence structure variation.

[0020] In conjunction with any embodiment of this disclosure, the method further includes:

[0021] In response to receiving a classification request for the text to be classified, at least two similar synthetic samples that are similar to the text to be classified are determined from a plurality of target synthetic samples;

[0022] The classification prompt words, the target label set, the text to be classified, and the at least two similar synthetic samples are input into the large model classification agent, so that the large model classification agent determines at least one target label from the target label set as the classification label of the text to be classified based on the classification prompt words and the similar labels of the at least two similar synthetic samples; wherein, the classification prompt words include classification task requirements and classification output format requirements.

[0023] In any embodiment of this disclosure, determining at least two similar synthetic samples from the plurality of target synthetic samples that are similar to the sample to be classified includes:

[0024] Each of the target synthetic samples is input into a text representation model so that the text representation model generates a text vector for each of the target synthetic samples;

[0025] For each target synthetic sample, determine the vector similarity between the text vector of the target synthetic sample and the text vector of the text to be classified;

[0026] The target synthetic samples corresponding to at least two text vectors whose vector similarity is greater than a preset similarity threshold are regarded as similar synthetic samples to the sample to be classified.

[0027] Secondly, this application also provides a text classification device, comprising:

[0028] The set acquisition module is used to sequentially control the large model annotation agent, large model reflection agent, and large model summary agent to perform corresponding operations in a pipeline manner to obtain the target label set. The operations performed by the large model annotation agent include: labeling the original samples; the large model annotation agent uses a memory function to ensure that the same original sample is labeled differently at different inputs; the operations performed by the large model reflection agent include: for special samples where the original label conflicts with the latest label recently labeled by the large model annotation agent, reflection is performed to generate a set of easily confused labels based on the original and latest labels of the special samples; the operations performed by the large model summary agent include: abstracting and / or merging the labels in the confused label set to obtain a processing result; and if the iteration stopping condition is not currently met, the operations of the large model annotation agent, large model reflection agent, and large model summary agent continue to be executed sequentially in a pipeline manner to obtain the target label set; if the iteration stopping condition is currently met, the target label set is determined based on the processing result.

[0029] The text classification module is used to sample at least two samples corresponding to each target label in the target label set from the original samples using stratified sampling, and to synthesize the at least two samples corresponding to the target label to generate a target composite sample, and to use the target label as the target label of the target composite sample; wherein, the target label of the target composite sample is used to classify the text to be classified.

[0030] In one embodiment, the iteration stopping condition includes at least one of the following:

[0031] The current number of iterations is greater than or equal to a preset iteration threshold; wherein, the current number of iterations is increased by a set value each time it is determined that the iteration stop condition is not met.

[0032] In N consecutive iterations, the improvement in the accuracy of the original sample labels by the large model annotation agent in each iteration is less than the preset accuracy improvement threshold, where N is greater than 1.

[0033] In one embodiment, the set acquisition module is specifically used for:

[0034] Based on the input reflection prompts, and according to the input confusion matrix, reflect on whether the original labels of the input special samples are correct, and reflect on whether the latest labels of the input special samples are correct; based on the reflection results, obtain a set of easily confused labels; wherein, the confusion matrix is ​​obtained by comparing the original labels of the original samples with the latest labels of the original samples labeled by the large model labeling agent, and the reflection prompts include reflection task requirements and reflection output format requirements.

[0035] In one embodiment, the set acquisition module is specifically used for:

[0036] The dynamically input summary prompts, the latest tag system, and the obfuscated tag set are input into the large model summary agent. The large model summary agent then abstracts and / or merges the obfuscated tag set based on the summary prompts, and integrates the abstracted and / or merged obfuscated tag set with the latest tag system. The latest tag system is the target tag set obtained in the previous iteration by controlling the large model annotation agent, large model reflection agent, and large model summary agent to perform operations. The summary prompts include summary task requirements and summary output format requirements.

[0037] In one embodiment, each target tag in the target tag set corresponds to at least one original tag in the original tag set;

[0038] For any target label, the original labels of at least two sampled samples correspond to that target label.

[0039] In one embodiment, the text classification module is specifically used for:

[0040] The synthesis prompt word and at least two sampled samples corresponding to the target label are input into the large model sample synthesis agent, so that the large model sample synthesis agent synthesizes at least two sampled samples corresponding to the target label based on the synthesis prompt word, generating multiple candidate synthesized samples corresponding to the target label; wherein, the synthesis prompt word includes synthesis task requirements and synthesis output format requirements;

[0041] The scoring prompts and multiple candidate synthetic samples corresponding to the target label are input into a large model scoring and ranking agent. The agent then scores and ranks these samples based on the scoring prompts, outputting each sample in descending order of score. At least two samples with scores greater than a preset threshold are identified as the target synthetic sample corresponding to the target label. The scoring prompts include scoring task requirements and scoring output format requirements. The scoring task requirements include preset scoring criteria, which include at least one of the following: language fluency, vocabulary diversity, and sentence structure variation.

[0042] In one embodiment, the text classification device further includes a label determination module for:

[0043] In response to receiving a classification request for the text to be classified, at least two similar synthetic samples that are similar to the text to be classified are determined from a plurality of target synthetic samples;

[0044] The classification prompt words, the target label set, the text to be classified, and the at least two similar synthetic samples are input into the large model classification agent, so that the large model classification agent determines at least one target label from the target label set as the classification label of the text to be classified based on the classification prompt words and the similar labels of the at least two similar synthetic samples; wherein, the classification prompt words include classification task requirements and classification output format requirements.

[0045] In one embodiment, the label determination module is specifically used for:

[0046] Each of the target synthetic samples is input into a text representation model so that the text representation model generates a text vector for each of the target synthetic samples;

[0047] For each target synthetic sample, determine the vector similarity between the text vector of the target synthetic sample and the text vector of the text to be classified;

[0048] The target synthetic samples corresponding to at least two text vectors whose vector similarity is greater than a preset similarity threshold are regarded as similar synthetic samples to the sample to be classified.

[0049] Thirdly, this application provides a computer program product, including a computer program / instructions, which, when executed by a processor, implement the steps of the method described in any embodiment.

[0050] Fourthly, this application provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the steps of the method described in any of the above embodiments.

[0051] Fifthly, this application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the method described in any of the above embodiments.

[0052] The technical solutions provided by the embodiments of this disclosure may include the following beneficial effects:

[0053] In this embodiment, a pipelined approach is used to sequentially control the collaborative work of a large model annotation agent, a reflexive agent, and a summarizing agent. This automatically identifies and optimizes easily confused labels, achieving intelligent pruning and merging of the label system. The annotation agent performs initial annotation on the original samples, the reflexive agent accurately locates samples with conflicting labels and generates a set of easily confused labels, and the summarizing agent abstracts and merges the labels. This iterative optimization continues until a stopping condition is met, ultimately resulting in a stable and accurate set of target labels. Simultaneously, high-quality target synthetic samples are synthesized through stratified sampling based on the target labels, providing better data support for target classification. This method effectively solves the problem of label confusion in complex scenarios, significantly improves text classification accuracy, and achieves a more efficient and reliable automatic text classification effect.

[0054] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this disclosure. Attached Figure Description

[0055] The accompanying drawings, which are incorporated in and form part of this disclosure, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure.

[0056] Figure 1 This is a flowchart illustrating a text classification method using some exemplary embodiments.

[0057] Figure 2 This is a flowchart illustrating another text classification method using some exemplary embodiments.

[0058] Figure 3 This is a flowchart illustrating another text classification method using some exemplary embodiments.

[0059] Figure 4 This is a flowchart illustrating yet another text classification method using some exemplary embodiments.

[0060] Figure 5 This is a block diagram illustrating a text classification device through some exemplary embodiments.

[0061] Figure 6 These are hardware structure diagrams of a computer device illustrating some exemplary embodiments. Detailed Implementation

[0062] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numerals in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this disclosure. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this disclosure as detailed in the appended claims.

[0063] The terminology used in this disclosure is for the purpose of describing particular embodiments only and is not intended to be limiting of the disclosure. The singular forms “a,” “the,” and “the” as used in this disclosure and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used herein refers to and includes any and all possible combinations of one or more of the associated listed items.

[0064] It should be understood that although the terms first, second, third, etc., may be used in this disclosure to describe various information, such information should not be limited to these terms. These terms are used only to distinguish information of the same type from one another. For example, without departing from the scope of this disclosure, first information may also be referred to as second information, and similarly, second information may also be referred to as first information. Depending on the context, the word "if" as used herein may be interpreted as "when," "when," or "in response to determination."

[0065] In related technologies, text classification mainly relies on manually designed prompt word templates or a small number of labeled samples to directly call large language models. However, when dealing with texts dense with professional terminology or highly colloquial, this approach often results in low classification accuracy due to insufficient understanding of domain ontology terms and semantic ambiguity in colloquial expressions. Especially when texts contain multiple types of labels or ambiguous expressions, traditional methods struggle to effectively adapt to complex scenarios. Optimization techniques such as prompt word engineering rely on customized templates created by professionals, resulting in poor versatility and limited scalability. Fine-tuning based on large model training requires extensive domain corpora and manually labeled data, combined with repeated adjustments using general datasets, leading to high costs, long cycles, and limited performance improvements. This approach cannot meet the high-precision classification requirements for complex texts in real-world scenarios such as enterprise public opinion monitoring and e-commerce review analysis.

[0066] In view of this, this disclosure provides a text classification method, apparatus, computer device, and storage medium. This method can be applied to scenarios requiring automatic classification of unstructured text data. Optionally, this method can be executed by a large-model automatic text classification system enhanced by domain knowledge base retrieval, which can be integrated on a local server or a cloud server.

[0067] The embodiments disclosed herein will be described in detail.

[0068] The first aspect of this disclosure provides a text classification method. Please refer to [link to relevant documentation]. Figure 1 It includes the following steps:

[0069] S101, in a pipeline manner, control the large model annotation agent, large model reflection agent and large model summary agent to perform corresponding operations in sequence to obtain the target label set.

[0070] The operations performed by the large model annotation agent include: labeling the original samples; the large model annotation agent assigning different labels to the same original sample from different inputs based on its memory function; the operations performed by the large model reflection agent include: for special samples where there is a conflict between the original label and the latest label recently annotated by the large model annotation agent, reflection is performed to generate a set of easily confused labels based on the original label and the latest label of the special sample; the operations performed by the large model summarization agent include: abstracting and / or merging the labels in the set of confused labels to obtain a processing result; and if the iteration stopping condition is not currently met, the large model annotation agent, the large model reflection agent, and the large model summarization agent continue to perform operations in a pipeline manner to obtain a target label set; if the iteration stopping condition is currently met, the target label set is determined based on the processing result.

[0071] The original sample refers to the initial text data provided in advance (such as user comments, customer service dialogues, etc.); the original label of the original sample refers to the label pre-annotated for the original sample, which can be a manually defined original label; the special sample refers to the original sample whose label conflicts with the latest label annotated by the large model annotation agent; the target label set refers to the final label system obtained after multiple rounds of pipeline iteration by the large model annotation agent, the large model reflection agent, and the large model summary agent; the latest label refers to the label of a certain original sample in the latest time it was annotated by the large model annotation agent; the confused label set refers to the sample label set whose latest label annotated by the large model annotation agent is different from the original label due to the ambiguity of semantic boundaries; the iteration stopping condition refers to the preset rule for determining the termination of the label optimization process, and the iteration stopping condition includes at least one of the following: the current number of iterations is greater than or equal to the preset number of iterations threshold; wherein, the current number of iterations increases by a set value each time it is determined that the current iteration stopping condition is not met; in N consecutive iterations, the improvement in the accuracy of the labels annotated by the large model annotation agent for the original samples in each iteration is less than the preset accuracy improvement threshold, and N is greater than 1.

[0072] Optionally, the large model annotation agent is used to perform basic label annotation on the original samples. Based on the task rules in the user-inputted or pre-defined annotation prompts (e.g., "Please classify and annotate the input text according to the label system, extract the content corresponding to the labels, and merge similar content") and output format requirements (e.g., output the annotation results in a structured JSON format), the large model annotation agent performs semantic analysis on each original sample and matches the most suitable label category. For example, when the input original sample is "Every customer service representative very seriously taught us how to start up and update the system and course guidance," and the latest label system includes the label "usage process," the annotation agent will output the label corresponding to the sample as "usage process" and present the annotation results in a structured format.

[0073] It should be noted that, due to the memory characteristics and context sensitivity of the large language model itself, when the agent processes the same original sample multiple times, it may output inconsistent label results due to differences in internal state or subtle changes in prompt words (for example, the same sample may be labeled as "usage process" in the first instance, but as "service attitude" in the second instance). This label instability directly reflects the possible problems of ambiguous semantic boundaries or unclear definitions in the current label system, providing a basis for problem localization for subsequent optimization processes.

[0074] The operations performed by the large model reflection agent specifically include: reflecting on whether the original labels of the input special samples are correct based on the input reflection prompt words and the input confusion matrix, and reflecting on whether the latest labels of the input special samples are correct; and obtaining a set of easily confused labels based on the reflection results.

[0075] The confusion matrix is ​​obtained by comparing the original labels of the original samples with the latest labels labeled by the large model annotation agent, which are the confused labels (including the original labels and the latest labels of special samples). The reflection prompts include reflection task requirements and reflection output format requirements.

[0076] The large model reflexive agent compares and analyzes the original and latest labels of special samples, combining this with the label error mapping relationships recorded in the confusion matrix (e.g., a special sample with the original label "logistics" in the confusion matrix has the latest label "express delivery" labeled by the large model labeling agent). This allows for precise identification of which label combinations are prone to model confusion (e.g., "logistics" is often confused with "express delivery," and "service attitude" is often confused with "response speed"). Finally, the large model reflexive agent summarizes the latest labels corresponding to these frequently misclassified special samples, obtaining a set of easily confused labels.

[0077] For example, if the input sample is a user comment "fast delivery", its original label (manually labeled) is "logistics delivery", but the latest label output by the large model labeling agent is "express delivery service". At this time, the system generates a corresponding confusion matrix (e.g., the row corresponding to the "logistics delivery" label shows that the model predicts "express delivery service" multiple times). The reflective agent analyzes this matrix and the sample text, and concludes that the two labels "logistics" and "express delivery" are often used interchangeably in users' colloquial expressions (e.g., users may regard "slow delivery" and "logistics delay" as the same problem but with different labels). Therefore, the latest label corresponding to this special sample (i.e., "express delivery service") is included in the confusion label set.

[0078] The operations performed by the large model summary agent specifically include: inputting dynamically input summary prompts, the latest tag system, and the obfuscated tag set into the large model summary agent, so that the large model summary agent can abstract and / or merge the obfuscated tag set based on the summary prompts, and integrate the abstracted and / or merged obfuscated tag set with the latest tag system.

[0079] The latest tagging system is the set of target tags obtained by controlling the large model annotation agent, large model reflection agent and large model summary agent to perform operations in the previous iteration, and the summary prompts include summary task requirements and summary output format requirements.

[0080] The large model summary agent intelligently analyzes the common features of easily confused tags, merges semantically similar but semantically disparate tags, and retains clear and independent tags, ultimately outputting a concise and highly distinguishable set of target tags. The large model summary agent receives three key inputs: a set of confused tags, the latest tag system, and summary prompts (containing summary task requirements and output format requirements). Based on the explicit rules in the summary prompts (e.g., "Please merge easily confused tags in the confused tag set into a more generalized unified tag, and explain the reason for merging; retain the original unconfused independent tags"), the large model summary agent performs abstract summarization or merging and classification operations on the tags in the confused tag set. For example, when the confused tag set contains the tags "logistics" and "express delivery," which are often confused by users but have similar semantics, the summary agent will merge them into the more generalized tag "logistics delivery timeliness issue," and indicate the reason for merging in the output (e.g., "Users often confuse slow logistics with express delivery delays, both pointing to dissatisfaction with delivery timeliness"). For independent tags that are semantically clear and conflict-free outside the obfuscated tag set (such as "service attitude" and "product function"), the large model summary agent directly retains their original definitions. Finally, the agent integrates the merged or retained tags with the latest tag system to obtain the final target tag set.

[0081] It should be noted that the iteration stopping condition includes at least one of the following: the current number of iterations is greater than or equal to a preset iteration number threshold; wherein, the current number of iterations is increased by a set value each time it is determined that the current iteration stopping condition is not met; in N consecutive iterations, the improvement in the accuracy of the labels of the original sample labels by the large model labeling agent in each iteration is less than a preset accuracy improvement threshold, and N is greater than 1.

[0082] During the generation of the target label set, each time a new label system is generated, it is determined whether the iteration stopping condition is met. If the iteration stopping condition is met, the newest label system is used as the target label set; if the iteration stopping condition is not met, the newest label system is re-inputted into the large model annotation agent, large model reflection agent, and large model summary agent to regenerate the newest label system. Optionally, two iteration stopping conditions are preset: one is that the current iteration count reaches a preset threshold (e.g., 100 times), and the count is incremented by 1 each round if it does not stop; the other is that the annotation accuracy improvement is less than a preset value (e.g., 0.01) for N consecutive rounds (e.g., 10 rounds). In each iteration, the large model annotation agent annotates the original samples to obtain the original labels and the newest labels of the original samples. The large model reflection agent finds special samples whose original labels conflict with the newest labels and generates a confused label set. The large model summary agent abstracts and... or merges the labels in the confused label set to obtain the newest label system. Furthermore, if the initial labeling system contains easily confused labels such as "logistics" and "express delivery," the first-round labeling agent may mislabel them. After the agent identifies the confusion, it summarizes and merges them into "logistics and delivery issues," improving labeling accuracy. Subsequent rounds continue to optimize. If the improvement in labeling accuracy in a certain round is less than a preset value, and this continues for N consecutive rounds, or the number of iterations reaches a preset threshold, the iteration stops, and the final optimized target label set is output, ensuring that the generated target label set is more concise and the classification is more accurate.

[0083] S102, for each target label in the target label set, at least two sampling samples corresponding to the target label are sampled from the original sample according to the stratified sampling method, and the at least two sampling samples corresponding to the target label are synthesized to generate a target synthetic sample, and the target label is used as the target label of the target synthetic sample.

[0084] The target labels of the synthesized target samples are used to classify the text to be classified. Stratified sampling refers to the operation of selecting representative samples proportionally from the original samples corresponding to the target label (ensuring coverage of diverse expressions under the label, such as including samples that directly describe "fast logistics" as well as samples that indirectly mention "fast delivery"); the synthesized target samples are new samples obtained through generative expansion of a large model (semantically consistent with the original samples but with diverse expressions, such as changing sentence structure and replacing synonyms).

[0085] Optionally, for each tag in the target tag set (e.g., "logistics delivery"), at least two representative samples (covering diverse expressions of the tag) are selected from the original samples using stratified sampling. Furthermore, the large model synthesis agent generatively expands these sampled samples based on target synthetic samples with different but consistent core semantic synthesis languages ​​from the original samples (e.g., expanding "fast delivery" to "next-day delivery").

[0086] In this embodiment, a pipelined approach is used to sequentially control the collaborative work of a large model annotation agent, a reflexive agent, and a summarizing agent. This automatically identifies and optimizes easily confused labels, achieving intelligent pruning and merging of the label system. The annotation agent performs initial annotation on the original samples, the reflexive agent accurately locates samples with conflicting labels and generates a set of easily confused labels, and the summarizing agent abstracts and merges the labels. This iterative optimization continues until a stopping condition is met, ultimately resulting in a stable and accurate set of target labels. Simultaneously, high-quality target synthetic samples are synthesized through stratified sampling based on the target labels, providing better data support for target classification. This method effectively solves the problem of label confusion in complex scenarios, significantly improves text classification accuracy, and achieves a more efficient and reliable automatic text classification effect.

[0087] It should be noted that each target label in the target label set corresponds to at least one original label in the original label set; and the original labels of at least two sampled samples corresponding to any target label correspond to that target label.

[0088] Optionally, each target label in the target label set corresponds to at least one original label in the original label set. This correspondence reflects the inheritance and integration logic of label semantics. Specifically, the target labels are formed by abstracting and merging (e.g., merging "logistics" and "express delivery" in the original label set into "logistics delivery problem") the easily confused labels identified by the reflective agent through the large model summary agent. Essentially, it is a summary of semantically similar or often confused labels in the original label set. Therefore, each target label corresponds to at least one original label (e.g., "logistics delivery problem" corresponds to the original labels "logistics" and "express delivery").

[0089] Furthermore, for any target label in the target label set (such as "logistics and delivery problem"), when the system selects at least two samples through stratified sampling, the original labels of these samples must correspond to the target label—that is, the original labels originally marked on these samples (such as "logistics" or "express delivery") are the original labels that were merged to form the target label. This design ensures that the data source of the synthesized samples is consistent with the semantic scope of the target label, so that the subsequent classification reference based on the target synthesized samples not only conforms to the original business logic but also accurately covers the semantic range of the target label integration, thereby ensuring the accuracy and interpretability of the model classification.

[0090] Based on the above embodiments, in an exemplary embodiment, such as Figure 2 As shown, the above S102 is further refined, specifically including the following steps:

[0091] S201, the synthesis prompt word and at least two sampled samples corresponding to the target label are input into the large model sample synthesis agent, so that the large model sample synthesis agent synthesizes at least two sampled samples corresponding to the target label based on the synthesis prompt word, and generates multiple candidate synthetic samples corresponding to the target label.

[0092] The synthesized prompts include synthesis task requirements (e.g., "generate new samples with different language expressions but the same core meaning based on given samples") and synthesis output format requirements (e.g., candidate samples generated in JSON structured output).

[0093] Optionally, the large model sample synthesis agent expands the sampled samples based on the synthesis prompts including the synthesis task requirements, and uses its text generation capabilities to generate multiple candidate synthesis samples that are semantically consistent with the target label but have different linguistic expressions by changing sentence structure, replacing synonyms, etc. (for example, expanding the original sample "the logistics delivery is fast" to "the express delivery arrived the next day" and "the logistics delivery efficiency is very high").

[0094] S202, the scoring prompt word and multiple candidate synthetic samples corresponding to the target label are input into the large model scoring and ranking agent, so that the large model scoring and ranking agent scores and ranks the multiple candidate synthetic samples corresponding to the target label based on the scoring prompt word, outputs each candidate synthetic sample in descending order of score, and determines at least two candidate synthetic samples with scores greater than a preset score threshold as the target synthetic samples corresponding to the target label.

[0095] The scoring prompts include scoring task requirements (e.g., "to comprehensively evaluate the language quality of candidate samples") and scoring output format requirements. The scoring task requirements include preset scoring criteria (e.g., outputting results in descending order of scores). The preset scoring criteria include at least one of the following: language fluency (e.g., sentences are fluent and free of grammatical errors), vocabulary diversity (e.g., avoiding repeated words), and sentence structure variation (e.g., using different grammatical structures).

[0096] Optionally, the scoring prompts (including scoring task requirements and scoring output format requirements) and multiple candidate synthetic samples generated in step S201 are input into the large model scoring and ranking agent. The large model scoring and ranking agent performs in-depth analysis and quantitative scoring on each candidate synthetic sample based on the above multi-dimensional criteria. For example, it scores the sample from the perspectives of sentence coherence, vocabulary richness, and sentence flexibility (e.g., using a 1-5 point scale), and simultaneously generates specific evaluation reasons for each score (e.g., "This sample uses different expressions such as 'next-day delivery' and 'extremely high logistics efficiency,' the sentence structure includes declarative and exclamatory sentences, and the vocabulary covers a variety of words such as 'delivery' and 'shipment,' with excellent fluency and diversity, and a score of 5 points"). Subsequently, the agent outputs the ranking results of all candidate samples in descending order of scores, and strictly selects at least two high-quality candidate synthetic samples with scores exceeding a preset score threshold (e.g., 4 points or above), and determines them as the target synthetic samples corresponding to the target label.

[0097] In this embodiment, a large-model sample synthesis agent generatively expands the sampled samples corresponding to the target label based on the synthesis prompt words. This enables the synthesis of high-quality candidate samples with diverse language but consistent semantics for labels with simple expressions or sparse data in the original samples. Furthermore, a large-model scoring and ranking agent accurately filters the candidate samples based on preset criteria such as language fluency, word diversity, and sentence structure variability. This effectively eliminates low-quality samples and retains the most representative and generalizable synthesized samples as target synthesized samples. This enriches the sample coverage under the target label, enhances the model's ability to recognize different expressions of the same label, and provides a more comprehensive and reliable reference for subsequent classification tasks.

[0098] In one exemplary embodiment, such as Figure 3 As shown, a possible implementation method for text classification is provided, which specifically includes the following steps:

[0099] S301, in response to receiving a classification request for the text to be classified, at least two similar synthetic samples that are similar to the text to be classified are determined from a plurality of target synthetic samples.

[0100] The classification request for the text to be classified can be initiated by the user or automatically by the system. The text to be classified refers to the text that needs to be classified.

[0101] Optionally, upon receiving a classification request for the text to be classified, target synthetic samples containing the same or similar feature words as the text to be classified can be retrieved from multiple target synthetic samples. For example, if the text to be classified mentions "fast logistics delivery", at least two target synthetic samples containing keywords such as "logistics" and "delivery" can be selected from multiple target synthetic samples as similar synthetic samples to the text to be classified.

[0102] S302, the classification prompt words, the target label set, the text to be classified, and the at least two similar synthetic samples are input into the large model classification agent, so that the large model classification agent determines at least one target label from the target label set as the classification label of the text to be classified based on the classification prompt words and the similarity labels of the at least two similar synthetic samples.

[0103] The classification prompts include classification task requirements (such as "select the most matching label from the target label set") and classification output format requirements (such as returning classification labels in JSON structure). Similar labels refer to the labels corresponding to similar synthetic samples.

[0104] Optionally, the classification prompt words, the target label set, the text to be classified, and the at least two similar synthetic samples can be input into the large model classification agent. Based on the instructions of the classification prompt words, the large model classification agent analyzes the semantic features of the text to be classified. Furthermore, using the similar labels corresponding to the similar synthetic samples as a reference, it matches the target label that best matches the semantic features of the text to be classified from the target label set, and uses it as the classification label of the text to be classified.

[0105] In this embodiment, upon receiving a classification request for a text to be classified, similar synthetic samples with semantic similarity to the text to be classified are selected from the target synthetic samples. The classification prompts, the target label set, and the text to be classified are then input into the large model classification agent. This effectively utilizes the diverse expressive features of the similar synthetic samples and their corresponding similar labels to guide the large model classification agent to more accurately understand the core semantics of the text to be classified. Based on the reference guidance of the similar synthetic samples, the classification result that best matches the text to be classified is quickly matched from the clearly optimized target label set, significantly improving the accuracy of classifying text in complex scenarios.

[0106] Based on the above embodiments, in an exemplary embodiment, such as Figure 4 As shown, the above S301 is further refined, specifically including the following steps:

[0107] S401, each of the target synthetic samples is input into the text representation model so that the text representation model generates a text vector for each of the target synthetic samples.

[0108] Among them, the text representation model refers to the model used to transform text into computable text vectors based on general text encoding techniques (such as deep neural networks like BERT).

[0109] Optionally, each target synthetic sample can be input into a text representation model to convert the text content of each target synthetic sample into a numerical representation in a high-dimensional vector space, thereby obtaining the text vector of each target synthetic sample.

[0110] S402, for each target synthetic sample, determine the vector similarity between the text vector of the target synthetic sample and the text vector of the text to be classified.

[0111] Optionally, after obtaining the text vector of each target synthetic sample, the cosine similarity algorithm can be used to measure the directional consistency between the text vector of the target synthetic sample and the text vector of the text to be classified in the vector space for each target synthetic sample, thereby determining the vector similarity between the text vector of the target synthetic sample and the text vector of the text to be classified.

[0112] S403, the target synthetic samples corresponding to at least two text vectors whose vector similarity is greater than a preset similarity threshold are taken as similar synthetic samples similar to the sample to be classified.

[0113] The preset similarity threshold refers to the pre-set similarity threshold used to determine whether a target synthetic sample can be used as a similar synthetic sample of the text to be classified.

[0114] Optionally, after determining the vector similarity between the text vector of each target synthetic sample and the text vector of the text to be classified, each vector similarity can be compared with a preset similarity threshold. If the vector similarity is greater than the preset similarity threshold, the target synthetic sample corresponding to that vector similarity is taken as a similar synthetic sample to the text to be classified.

[0115] In this embodiment, by converting the target synthetic sample and the text to be classified into text vectors and calculating the vector similarity between the text vector of each target synthetic sample and the text vector of the text to be classified, the semantic association between the two can be quantified more accurately. Then, based on a preset similarity threshold, similar synthetic samples that are closely related to the semantics of the text to be classified can be screened more efficiently and accurately from a large number of target synthetic samples. This provides accurate semantic reference for subsequent large model classification agents, effectively solving the problem that traditional keyword retrieval is easily affected by differences in expression. It ensures that samples with core semantic matching are located from diverse text expressions, and significantly improves the accuracy and efficiency of retrieving similar synthetic samples that are similar to the text to be classified in complex scenarios.

[0116] Corresponding to the embodiments of the foregoing methods, this disclosure also provides embodiments of the apparatus and the terminal to which it is applied.

[0117] Secondly, this application also provides a text classification device, such as... Figure 5 As shown, it includes:

[0118] The set acquisition module 501 is used to sequentially control the large model annotation agent, the large model reflection agent, and the large model summary agent to perform corresponding operations in a pipeline manner to obtain the target label set. The operations performed by the large model annotation agent include: labeling the original samples; the large model annotation agent uses a memory function to assign different labels to the same original sample from different inputs; the operations performed by the large model reflection agent include: for special samples where the original label conflicts with the latest label recently annotated by the large model annotation agent, reflection is performed to generate a set of easily confused labels based on the original and latest labels of the special samples; the operations performed by the large model summary agent include: abstracting and / or merging the labels in the confused label set to obtain a processing result; and if the iteration stopping condition is not currently met, the operations of the large model annotation agent, the large model reflection agent, and the large model summary agent continue to be sequentially controlled in a pipeline manner to obtain the target label set; if the iteration stopping condition is currently met, the target label set is determined based on the processing result.

[0119] The text classification module 502 is used to sample at least two samples corresponding to each target label in the target label set from the original samples according to the stratified sampling method, and synthesize the at least two samples corresponding to the target label to generate a target composite sample, and use the target label as the target label of the target composite sample; wherein, the target label of the target composite sample is used to classify the text to be classified.

[0120] In one embodiment, the iteration stopping condition includes at least one of the following:

[0121] The current number of iterations is greater than or equal to a preset iteration threshold; wherein, the current number of iterations is increased by a set value each time it is determined that the iteration stop condition is not met.

[0122] In N consecutive iterations, the improvement in the accuracy of the original sample labels by the large model annotation agent in each iteration is less than the preset accuracy improvement threshold, where N is greater than 1.

[0123] In one embodiment, the collection acquisition module 501 is specifically used for:

[0124] Based on the input reflection prompts, and according to the input confusion matrix, reflect on whether the original labels of the input special samples are correct, and reflect on whether the latest labels of the input special samples are correct; based on the reflection results, obtain a set of easily confused labels; wherein, the confusion matrix is ​​obtained by comparing the original labels of the original samples with the latest labels of the original samples labeled by the large model labeling agent, and the reflection prompts include reflection task requirements and reflection output format requirements.

[0125] In one embodiment, the collection acquisition module 501 is specifically used for:

[0126] The dynamically input summary prompts, the latest tag system, and the obfuscated tag set are input into the large model summary agent. The large model summary agent then abstracts and / or merges the obfuscated tag set based on the summary prompts, and integrates the abstracted and / or merged obfuscated tag set with the latest tag system. The latest tag system is the target tag set obtained in the previous iteration by controlling the large model annotation agent, large model reflection agent, and large model summary agent to perform operations. The summary prompts include summary task requirements and summary output format requirements.

[0127] In one embodiment, each target tag in the target tag set corresponds to at least one original tag in the original tag set;

[0128] For any target label, the original labels of at least two sampled samples correspond to that target label.

[0129] In one embodiment, the text classification module 502 is specifically used for:

[0130] The synthesis prompt word and at least two sampled samples corresponding to the target label are input into the large model sample synthesis agent, so that the large model sample synthesis agent synthesizes at least two sampled samples corresponding to the target label based on the synthesis prompt word, generating multiple candidate synthesized samples corresponding to the target label; wherein, the synthesis prompt word includes synthesis task requirements and synthesis output format requirements;

[0131] The scoring prompts and multiple candidate synthetic samples corresponding to the target label are input into a large model scoring and ranking agent. The agent then scores and ranks these samples based on the scoring prompts, outputting each sample in descending order of score. At least two samples with scores greater than a preset threshold are identified as the target synthetic sample corresponding to the target label. The scoring prompts include scoring task requirements and scoring output format requirements. The scoring task requirements include preset scoring criteria, which include at least one of the following: language fluency, vocabulary diversity, and sentence structure variation.

[0132] In one embodiment, the text classification device further includes a label determination module for:

[0133] In response to receiving a classification request for the text to be classified, at least two similar synthetic samples that are similar to the text to be classified are determined from a plurality of target synthetic samples;

[0134] The classification prompt words, the target label set, the text to be classified, and the at least two similar synthetic samples are input into the large model classification agent, so that the large model classification agent determines at least one target label from the target label set as the classification label of the text to be classified based on the classification prompt words and the similar labels of the at least two similar synthetic samples; wherein, the classification prompt words include classification task requirements and classification output format requirements.

[0135] In one embodiment, the label determination module is specifically used for:

[0136] Each of the target synthetic samples is input into a text representation model so that the text representation model generates a text vector for each of the target synthetic samples;

[0137] For each target synthetic sample, determine the vector similarity between the text vector of the target synthetic sample and the text vector of the text to be classified;

[0138] The target synthetic samples corresponding to at least two text vectors whose vector similarity is greater than a preset similarity threshold are regarded as similar synthetic samples to the sample to be classified.

[0139] The specific implementation process of the functions and roles of each module in the above device can be found in the implementation process of the corresponding steps in the above method, and will not be repeated here.

[0140] A third aspect of this disclosure provides a computer program product including a computer program / instructions that, when executed by a processor, implement the method described in the first aspect.

[0141] For the device embodiments and computer program product embodiments, since they basically correspond to the method embodiments, the relevant parts can be referred to in the description of the method embodiments. Furthermore, the device embodiments described above are merely illustrative; the modules described as separate components may or may not be physically separate, and the components shown as modules may or may not be physical modules, i.e., they may be located in one place or distributed across multiple network modules. Some or all of the modules can be selected to achieve the purpose of this disclosure according to actual needs. Those skilled in the art can understand and implement this without any inventive effort.

[0142] Fourthly, embodiments of the text classification device provided in this disclosure can be applied to computer devices. Please refer to the appendix. Figure 6 The illustration exemplifies a hardware schematic of a computer device. For example, device 600 could be a mobile phone, computer, digital broadcasting terminal, messaging device, game console, tablet device, medical device, fitness equipment, personal digital assistant, etc.

[0143] Device 600 may include one or more of the following components: processing component 601, memory 602, power supply component 603, multimedia component 604, audio component 605, input / output (I / O) interface 606, sensor component 607, and communication component 608.

[0144] Processing component 601 typically controls the overall operation of device 600, such as actions associated with display, telephone calls, data communication, camera actions, and recording actions. Processing component 601 may include one or more processors 609 to execute instructions to complete all or part of the steps of the methods described above. Furthermore, processing component 601 may include one or more modules to facilitate interaction between processing component 601 and other components. For example, processing component 601 may include a multimedia module to facilitate interaction between multimedia component 604 and processing component 601.

[0145] Memory 602 is configured to store various types of data to support the operation of device 600. Examples of this data include instructions for any application or method operating on device 600, contact data, phonebook data, messages, pictures, videos, etc. Memory 602 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk.

[0146] The power supply component 603 provides power to the various components of the device 600. The power supply component 603 may include a power management system, one or more power sources, and other components associated with generating, managing, and distributing power to the device 600.

[0147] Multimedia component 604 includes a screen that provides an output interface between the device 600 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touchscreen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, swipe, and gestures on the touch panel. The touch sensors may sense not only the boundaries of the touch or swipe action but also the duration and pressure associated with the touch or swipe action. In some embodiments, multimedia component 604 includes a front-facing camera and / or a rear-facing camera. When the device 600 is in an active mode, such as a shooting mode or a video mode, the front-facing camera and / or the rear-facing camera may receive external multimedia data. Each front-facing camera and rear-facing camera may be a fixed optical lens system or have focal length and optical zoom capabilities.

[0148] Audio component 605 is configured to output and / or input audio signals. For example, audio component 605 includes a microphone (MIC) configured to receive external audio signals when device 600 is in an operational mode, such as call mode, recording mode, and voice recognition mode. The received audio signals may be further stored in memory 602 or transmitted via communication component 608. In some embodiments, audio component 605 also includes a speaker for outputting audio signals.

[0149] I / O interface 606 provides an interface between processing component 601 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to, home buttons, volume buttons, power buttons, and lock buttons.

[0150] Sensor assembly 607 includes one or more sensors for providing state assessments of various aspects of device 600. For example, sensor assembly 607 may detect the on / off state of device 600, the relative positioning of components such as the display and keypad of device 600, changes in the position of device 600 or a component of device 600, the presence or absence of user contact with device 600, the orientation or acceleration / deceleration of device 600, and temperature changes of device 600. Sensor assembly 607 may also include a proximity sensor configured to detect the presence of nearby objects without any physical contact. Sensor assembly 607 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, sensor assembly 607 may also include an accelerometer, a gyroscope, a magnetometer, a pressure sensor, or a temperature sensor.

[0151] Communication component 608 is configured to facilitate wired or wireless communication between device 600 and other devices. Device 600 can access wireless networks based on communication standards, such as WiFi, 2G or 3G, 4G or 5G, or combinations thereof. In one exemplary embodiment, communication component 608 receives broadcast signals or broadcast-related information from an external broadcast management system via a broadcast channel. In one exemplary embodiment, communication component 608 also includes a near-field communication (NFC) module to facilitate short-range communication. For example, the NFC module may be implemented based on radio frequency identification (RFID) technology, Infrared Data Association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.

[0152] In an exemplary embodiment, device 600 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the text classification method of the computer device described above.

[0153] Fifthly, in exemplary embodiments, this disclosure also provides a non-transitory computer-readable storage medium including instructions, such as a memory 602 including instructions, which can be executed by a processor 609 of device 600 to complete the text classification method of the computer device. For example, the non-transitory computer-readable storage medium may be a ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, and optical data storage device, etc.

[0154] The foregoing has described specific embodiments of this disclosure. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims may be performed in a different order than that shown in the embodiments and may still achieve the desired results. Furthermore, the processes depicted in the drawings do not necessarily require the specific or sequential order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0155] Other embodiments of this disclosure will readily occur to those skilled in the art upon consideration of the specification and practice of the invention applied herein. This disclosure is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not claimed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this disclosure are indicated by the following claims.

[0156] It should be understood that this disclosure is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this disclosure is limited only by the appended claims.

[0157] The above description is merely a preferred embodiment of this disclosure and is not intended to limit this disclosure. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this disclosure should be included within the scope of protection of this disclosure.

Claims

1. A method of text classification, characterized by, The method comprises: controlling the large model labeling agent, the large model reflection agent and the large model summary agent to perform corresponding operations in a pipeline manner to obtain a target label set; the operation performed by the large model labeling agent comprises: performing label labeling on an original sample; the large model labeling agent labels different labels for the same original sample input at different times based on the memory function; the operation performed by the large model reflection agent comprises: reflecting on a special sample in which a conflict exists between an original label and a latest label newly labeled by the large model labeling agent to generate an easily confused confusion label set according to the original label and the latest label of the special sample; the operation performed by the large model summary agent comprises: abstracting and / or merging the labels in the confusion label set to obtain a processing result; and when the current iteration stop condition is not met, the large model labeling agent, the large model reflection agent and the large model summary agent are controlled to perform operations in a pipeline manner to obtain a target label set; when the current iteration stop condition is met, the target label set is determined based on the processing result; the iteration stop condition is met at least when the accuracy of the label labeled by the large model labeling agent on the original sample in each of the last N iterations is less than a preset accuracy improvement threshold, and N is greater than 1; For each target label in the target label set, at least two sample samples corresponding to the target label are sampled from the original sample in a stratified sampling manner, and the at least two sample samples corresponding to the target label are synthesized to generate a target synthetic sample, and the target label is used as the target label of the target synthetic sample; wherein the target label of the target synthetic sample is used for classifying text.

2. The method of claim 1, wherein, The iteration stop condition further comprises: the current iteration number is greater than or equal to a preset iteration number threshold; wherein the current iteration number is increased by a set value each time it is determined that the current iteration stop condition is not met.

3. The method of claim 1, wherein, The operation performed by the large model reflection agent specifically comprises: based on the input reflection prompt word, and according to the input confusion matrix, reflecting whether the original label of the input special sample is correct and whether the latest label of the input special sample is correct; based on the reflection result, an easily confused confusion label set is obtained; wherein the confusion matrix is obtained by comparing the original label of the original sample with the latest label labeled by the large model labeling agent on the original sample; the reflection prompt word comprises a reflection task requirement and a reflection output format requirement.

4. The method of claim 3, wherein, The operation performed by the large model summary agent specifically comprises: The summary prompt word input based on the dynamic input, the latest label system and the confusion label set are input into a large model summary agent, so that the large model summary agent abstracts and / or merges the confusion label set based on the summary prompt word, and integrates the abstracted and / or merged confusion label set and the latest label system; wherein the latest label system is a target label set obtained by controlling the large model labeling agent, the large model reflection agent and the large model summary agent to perform operations in the last iteration, and the summary prompt word includes summary task requirements and summary output format requirements.

5. The method of claim 1, wherein, Each target label in the target label set has a corresponding relationship with at least one original label in the original label set; The original labels of at least two sampling samples corresponding to any target label have a corresponding relationship with the target label.

6. The method of claim 1, wherein, The synthesis of the at least two sampling samples corresponding to the target label to generate a target synthetic sample includes: The synthesis prompt word and the at least two sampling samples corresponding to the target label are input into a large model sample synthesis agent, so that the large model sample synthesis agent synthesizes the at least two sampling samples corresponding to the target label based on the synthesis prompt word to generate a plurality of candidate synthetic samples corresponding to the target label; wherein the synthesis prompt word includes synthesis task requirements and synthesis output format requirements; The scoring prompt word and the plurality of candidate synthetic samples corresponding to the target label are input into a large model scoring and sorting agent, so that the large model scoring and sorting agent scores and sorts the plurality of candidate synthetic samples corresponding to the target label based on the scoring prompt word, outputs each candidate synthetic sample in descending order of score, and determines at least two candidate synthetic samples with a score greater than a preset score threshold as target synthetic samples corresponding to the target label; wherein the scoring prompt word includes scoring task requirements and scoring output format requirements, and the scoring task requirements include a preset scoring standard, which includes at least one of the following: language fluency, word diversity and sentence variation.

7. The method of claim 1, wherein, The method further includes: In response to receiving a classification request for a text to be classified, determining at least two similar synthetic samples similar to the text to be classified from a plurality of target synthetic samples; The classification prompt word, the target label set, the text to be classified, and the at least two similar synthetic samples are input into a large model classification agent, so that the large model classification agent determines at least one target label from the target label set as a classification label of the text to be classified based on similar labels of the at least two similar synthetic samples according to the classification prompt word; wherein the classification prompt word includes classification task requirements and classification output format requirements.

8. The method of claim 7, wherein, The determination of at least two similar synthetic samples similar to the text to be classified from the plurality of target synthetic samples includes: Each target synthetic sample is input into a text representation model to generate a text vector of each target synthetic sample; For each target synthetic sample, determine a vector similarity between a text vector of the target synthetic sample and a text vector of the text to be classified; At least two target synthetic samples corresponding to text vectors with a vector similarity greater than a preset similarity threshold are determined as similar synthetic samples similar to the text to be classified.

9. A text classification apparatus characterized by comprising: The device comprises: The collection obtaining module is configured to sequentially control the large model labeling agent, the large model reflection agent and the large model summary agent to perform corresponding operations in a pipeline manner to obtain a target label set. The operation performed by the large model labeling agent includes labeling an original sample. The large model labeling agent labels different labels for the same original sample based on the memory function. The operation performed by the large model reflection agent includes reflecting on a special sample when a conflict exists between an original label and a latest label labeled by the large model labeling agent, to generate an ambiguous confusion label set according to the original label and the latest label of the special sample. The operation performed by the large model summary agent includes abstracting and / or merging the labels in the confusion label set to obtain a processing result. When the iteration stop condition is not met, the large model labeling agent, the large model reflection agent and the large model summary agent are sequentially controlled to perform operations in a pipeline manner to obtain a target label set. When the iteration stop condition is met, the target label set is determined based on the processing result. The iteration stop condition includes that in N consecutive iterations, the accuracy of the label labeled by the large model labeling agent for the original sample in each iteration is less than a preset accuracy improvement threshold, and N is greater than 1. The text classification module is configured to, for each target label in the target label set, sample at least two sample samples corresponding to the target label from the original sample in a stratified sampling manner, synthesize the at least two sample samples corresponding to the target label to generate a target synthetic sample, and set the target label as the target label of the target synthetic sample. The target label of the target synthetic sample is used to classify the text to be classified.

10. A computer program product comprising computer programs / instructions, characterized in that, The computer program / instructions are executed by the processor to implement the method of any one of claims 1-8.

11. A computer device, comprising: The computer program / instructions are executed by the processor to implement the method of any one of claims 1-8.

12. A computer readable storage medium having stored thereon a computer program, characterized in that, The program is executed by the processor to implement the method of any one of claims 1-8.

Citation Information

Patent Citations

  • Data classification method and device, equipment, medium and program product

    CN116958622A

  • Reader emotion prediction method and system based on text emotion behavior knowledge

    CN118503349A