Active demand learning-based few-sample text mining method and apparatus, and electronic device

Through the method of active demand learning, structured prompts are generated and task tags are dynamically optimized, which solves the adaptability and efficiency of existing news text mining methods in complex news texts, and realizes efficient and accurate news information extraction, adapting to the rapid changes and personalized needs in the news field.

CN120541210APending Publication Date: 2025-08-26WUHAN UNIV OF TECH +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510648471.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-20
Publication Date
2025-08-26

AI Technical Summary

Technical Problem

The existing low-sample news text mining methods are limited in their performance when dealing with complex news texts, which is difficult to adapt to the rapid changes and personalized needs of the news field. The model fine-tuning resources are consumed and insufficient adaptability is insufficient.

Method used

Using a method based on active demand learning, a large-scale pre-trained model is input by generating structured prompts, uncertainty scores are calculated, task label descriptions and difficult samples are dynamically adjusted, and task labels are optimized using user annotation information to achieve news text mining without fine-tuning.

Benefits of technology

It improves the accuracy and efficiency of news text mining, reduces the cost of manual labeling, is highly adaptable, and can maintain high performance in different large model iterations, meeting the personalized needs of news practitioners.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120541210A_ABST
    Figure CN120541210A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of news mining, and provides a few-sample text mining method and device based on active demand learning and electronic equipment. Comprising the steps of generating a structured prompt according to a predefined task template; inputting the structured prompt into a large-scale pre-training model for reasoning to obtain a mining result; calculating an uncertainty score of a specified sample in the mining result, and if the uncertainty score is in a descending trend, returning to execute the step of generating the structured prompt according to the predefined task template; if the uncertainty score is in a rising trend, the number of the difficult samples is increased; receiving annotation information of a user on the difficult sample, updating task label description based on the annotation information, and returning to execute the step of generating the structured prompt according to the predefined task template; and when it is determined that the optimization termination condition is met, outputting a mining result. The demand of a news analysis task can be accurately captured, and the news text mining capability is effectively enhanced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of news mining technology, and in particular to a method, device and electronic device for mining a small number of sample texts based on active demand learning. Background Art

[0002] News text encompasses key information such as factual reporting, commentary and analysis, and event developments. Its data comes in a variety of formats, including semi-structured press releases, unstructured articles, and social media content. Compared to general-purpose text, news text is more timely and domain-specific, covering a wide range of topics and contexts, and containing a large number of specific formats for time, place, people, and causal relationships between events. In news reporting and analysis, accurately and effectively extracting key information from massive amounts of news text is crucial for news comprehension, event tracking, and information recommendation. However, news text mining still faces numerous challenges. The diverse language expression in the news field, especially in breaking news and hot news, creates many new words and expressions that are not yet standardized, complicating information extraction. Furthermore, data annotation is costly, requiring not only specialized news expertise and language analysis skills, but also significant human resources. Furthermore, the news dissemination environment is rapidly evolving, with new events, topics, and trends constantly emerging. Models trained on data struggle to adapt to these changes, impacting the accuracy and stability of information extraction.

[0003] In response to these challenges, few-shot text mining methods have become an effective solution. With the help of large-scale pre-trained models (referred to as "big models"), few-shot learning methods can achieve effective learning and reasoning under low-resource conditions. With its powerful language understanding and reasoning capabilities, big models can learn key information from limited samples even when labeled data is scarce, thereby improving the accuracy of news information extraction. By optimizing data selection, task modeling, and knowledge utilization strategies, few-shot learning methods can not only reduce the cost of manual annotation, but also better adapt to the content characteristics and data structure of the news field. With the in-depth application of few-shot learning methods in the field of news text, it will further promote the development of news text mining technology, provide news organizations, media analysts, and information platforms with more efficient and intelligent news analysis tools, effectively improve the utilization efficiency of news information, and assist in tasks such as accurate reporting, information recommendation, and monitoring.

[0004] Currently, the technical solution for small-sample news text mining is mainly based on large model generation methods. The following will explain its main technical solutions and the problems to be solved:

[0005] Large-scale model generation methods are represented by large-scale language models such as GPT and DeepSeek, which mainly perform text understanding and reasoning based on autoregressive generation mechanisms. Figure 1As shown in Figure 1, its implementation process typically consists of two steps: the task prompt design phase uses natural language prompts to set the corresponding task labels and guide the large model to complete the task; the model inference phase, after the prompt is input, the large model generates text based on its internal knowledge and produces prediction results. Compared with traditional news text mining models, large models can adapt to new tasks without requiring large amounts of labeled data and have a certain degree of zero-shot or few-shot learning capabilities. However, when handling complex news text mining tasks, the overall performance of large models is still limited, and they are unable to fully realize their potential.

[0006] Existing optimization methods mainly focus on building large models in the news field by fine-tuning them based on the news knowledge instruction library to improve the ability to understand news text. This type of method can improve the adaptability of large models in the news field to a certain extent, but it still has the following shortcomings in actual application scenarios: (1) This type of method still requires a lot of time and computing resources to fine-tune the model, which limits its adaptability and makes it difficult to effectively keep up with the rapid iteration and development of general large models; (2) It does not consider the personalized information needs of various news organizations and analysts in the reporting and research process, making it difficult for large models to accurately grasp the task objectives, resulting in limited performance.

[0007] Therefore, there is an urgent need for a more efficient and adaptable news text mining method to meet the needs of news reporting and analysis and improve the accuracy and practicality of information extraction. Summary of the Invention

[0008] In view of this, the embodiments of the present application provide a few-sample text mining method, device and electronic device based on active demand learning, which can make full use of a small number of samples for learning without fine-tuning, so as to accurately capture the needs of news analysis tasks and effectively enhance news text mining capabilities.

[0009] A first aspect of an embodiment of the present application provides a few-sample text mining method based on active demand learning, comprising:

[0010] Generate structured prompts based on predefined task templates;

[0011] Inputting the structured prompt into a large-scale pre-trained model for reasoning to obtain mining results;

[0012] Calculating an uncertainty score for a specified sample in the mining result;

[0013] If the uncertainty score shows a downward trend, returning to the step of generating structured prompts according to the predefined task template; if the uncertainty score shows an upward trend, increasing the number of difficult samples;

[0014] receiving user annotation information of the difficult sample, updating the task label description based on the annotation information, and returning to execute the step of generating a structured prompt according to a predefined task template;

[0015] When it is determined that the optimization termination conditions are met, the mining results are output.

[0016] A second aspect of an embodiment of the present application provides a few-sample text mining apparatus based on active demand learning, comprising:

[0017] A structured prompt generation module is used to generate structured prompts based on predefined task templates;

[0018] A large model inference module is used to input the structured prompts into a large-scale pre-trained model for inference to obtain mining results;

[0019] an optimization evaluation module, configured to calculate the uncertainty score of a specified sample in the mining result, and if the uncertainty score shows a downward trend, return to the step of generating structured prompts according to the predefined task template; if the uncertainty score shows an upward trend, increase the number of difficult samples;

[0020] An updating module, configured to receive user annotation information of the difficult sample, update the task label description based on the annotation information, and return to execute the step of generating a structured prompt according to a predefined task template;

[0021] The output module is used to output the mining results when it is determined that the optimization termination conditions are met.

[0022] A third aspect of an embodiment of the present application provides an electronic device, comprising a processor, a memory, and a computer program stored in the memory and runnable on the processor. When the processor executes the computer program, the electronic device implements the few-sample text mining method based on active demand learning as provided in the first aspect of an embodiment of the present application.

[0023] A fourth aspect of the embodiments of the present application provides a computer program product, including a computer program. When the computer program is executed, the method according to the first aspect of the embodiments of the present application is executed.

[0024] The first aspect of the embodiment of the present application provides a few-sample text mining method based on active demand learning. The method generates structured prompts based on a predefined task template; inputs the structured prompts into a large-scale pre-trained model for inference to obtain mining results; calculates the uncertainty score of a specified sample in the mining result; if the uncertainty score shows a downward trend, returns to the step of generating structured prompts based on the predefined task template; if the uncertainty score shows an upward trend, increases the number of difficult samples; receives user annotation information for the difficult samples, updates the task label description based on the annotation information, and returns to the step of generating structured prompts based on the predefined task template; and outputs the mining results when it is determined that the optimization termination condition is met. The method can fully utilize a small number of samples for learning without fine-tuning to accurately capture the requirements of news analysis tasks and effectively enhance news text mining capabilities. It gets rid of the dependence on domain fine-tuning, effectively lowers the technical threshold of news text mining, and enables news practitioners to more conveniently extract key information from massive news texts.

[0025] It can be understood that the beneficial effects of the second to fourth aspects mentioned above can be found in the relevant description of the first aspect mentioned above, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the embodiments or descriptions of the prior art. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0027] Figure 1 It is a schematic diagram of existing text mining methods;

[0028] Figure 2 This is a flow chart of a few-sample text mining method based on active demand learning provided by an embodiment of the present application;

[0029] Figure 3 Schematic diagram of the structure of a few-sample text mining device based on active demand learning provided by an embodiment of the present application;

[0030] Figure 4 It is a structural diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0031] In the following description, specific details such as specific system structures and techniques are provided for purposes of illustration rather than limitation to facilitate a thorough understanding of the embodiments of the present application. However, it will be apparent to those skilled in the art that the present application may be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to avoid obscuring the description of the present application with unnecessary detail.

[0032] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, integers, steps, operations, elements and / or components, but does not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or collections thereof.

[0033] References to "one embodiment" or "some embodiments" in this specification mean that a particular feature, structure, or characteristic described in conjunction with that embodiment is included in one or more embodiments of the present application. Thus, phrases such as "in one embodiment," "in some embodiments," "in other embodiments," and "in other embodiments" appearing in various places in this specification do not necessarily refer to the same embodiment, but rather mean "one or more but not all embodiments," unless otherwise specifically emphasized. The terms "including," "comprising," "having," and variations thereof all mean "including but not limited to," unless otherwise specifically emphasized.

[0034] like Figure 2 As shown, the few-sample text mining method based on active demand learning provided by the embodiment of the present application includes the following steps S1 to S6:

[0035] Step S1: Generate structured prompts based on predefined task templates;

[0036] Step S2: Input the structured prompt into a large-scale pre-trained model for inference to obtain mining results;

[0037] Step S3, calculating the uncertainty score of the specified sample in the mining result;

[0038] Step S4: If the uncertainty score shows a downward trend, return to the step of generating structured prompts based on the predefined task template; if the uncertainty score shows an upward trend, increase the number of difficult samples;

[0039] Step S5: Receive the user's annotation information for the difficult sample, update the task label description based on the annotation information, and return to the step of generating a structured prompt according to the predefined task template;

[0040] Step S6: When it is determined that the optimization termination condition is met, the mining result is output.

[0041] In the application, the large-scale pre-trained model in step 2 is mainly used to reason about the constructed structured prompts. By inputting a batch of structured prompts, the large model uses its powerful text understanding ability and generalization performance to generate answers that meet the task objectives, and obtains the news text mining results of the batch of data after parsing. Unlike existing methods, this patent focuses on optimizing the context learning process of the large model rather than fine-tuning the model. As a plug-and-play method, this method can directly use existing open source large models or general large models called by APIs, ensuring that competitive performance can be continuously obtained during the continuous development of the large model.

[0042] This embodiment of the application dynamically adjusts task label descriptions through an iterative optimization mechanism, combining uncertainty scores to determine whether to continue optimization or terminate the process, forming a closed-loop feedback loop. This method adapts to the complex needs of news text without fine-tuning the model, uses active learning to reduce manual annotation costs, and ensures a controllable optimization process, avoiding ineffective iterations.

[0043] The difficult sample construction and proactive demand learning methods proposed in this application fully consider the personalized information needs of journalists, which are overlooked by existing methods. Rather than requiring journalists to review large amounts of data and select appropriate samples for data annotation, this method allows the large model to select its most uncertain samples for journalists to judge. This improves the efficiency and effectiveness of sample annotation and further enables learning and optimization of existing label descriptions based on the large model, enabling personalized learning of journalists' needs and better meeting practical application requirements.

[0044] The framework proposed in the embodiment of the present application is a plug-and-play method that can be flexibly migrated to different large models compared to existing fine-tuning-based solutions, and continues to maintain reliable performance as general large models develop. For users who pursue high performance, they can choose the most advanced API to access the large model as the baseline model, while for data-sensitive users, they can choose open source large models to ensure data controllability. While ensuring continuous performance, the framework takes into account the specific preferences of different users in model selection.

[0045] As a task-independent solution, the embodiment of this application optimizes from the perspective of task labels rather than targeting specific tasks. Therefore, it can be widely applied to various news text mining tasks, including classification and extraction tasks. Furthermore, this method has good domain transferability and can flexibly adapt to text mining tasks in different fields, further expanding its application scenarios.

[0046] In one embodiment, the optimization termination condition includes at least one of the following: the number of iterations reaches a preset number, the uncertainty score is less than a preset score, and the uncertainty converges.

[0047] In applications, the optimization termination conditions may be any one or more of: 1) reaching a set threshold (eg, -0.01 or -0.005), 2) reaching a preset maximum number of optimization rounds, or 3) gradual convergence of uncertainty.

[0048] The present embodiment makes iterative termination more flexible by combining multiple optimization termination criteria (such as round number, score threshold, and convergence). This prevents resource waste caused by infinite loops and avoids missed optimization opportunities caused by premature termination, thus balancing computational efficiency and result reliability.

[0049] In one embodiment, a structured prompt is generated based on a predefined task template, including:

[0050] The news text, task objective description, task label and description are aggregated through a predefined task template to form a structured prompt.

[0051] In application, unlike traditional machine learning methods, the large model generation method does not rely on sequence annotation training of news text to learn weights. Instead, it converts news text mining tasks into prompt input, allowing the large model to fully utilize its powerful text understanding capabilities and news domain knowledge to perform reasoning and answer. Therefore, in this step, it is necessary to express various news text mining tasks in natural language to adapt to the input format of the large model. The constructed prompt mainly consists of the following three parts:

[0052] 1) News text: This refers to the input raw news text data, which may come from various sources such as news reports, editorials, interviews, and news summaries.

[0053] 2) Task objective description: Clearly inform the large model of the specific objectives of the task, such as named entity recognition (Named Entity Recognition), relation classification (Relation Classification), sentiment analysis (Sentiment Analysis), event extraction (Event Extraction), etc., to ensure that the large model can effectively reason according to the task requirements.

[0054] 3) Task Labels and Descriptions: These include the labels involved in the task and their detailed descriptions to help the large model understand the type of information to be extracted or classified and ensure the accuracy and consistency of the output. For example, in a news event extraction task, labels such as "event type," "time," "location," "related people," and "cause of the event" may be involved.

[0055] Finally, the three parts are combined using a predefined prompt template to form a complete prompt string. Through this process, a large amount of news text to be processed is effectively converted into structured prompt input to adapt to the reasoning mechanism of the large model.

[0056] This embodiment of the application integrates news text, task objectives, and label descriptions into structured prompts to clarify the task input format. By standardizing the template to unify the expression of different tasks, the probability of large models misinterpreting ambiguous instructions is reduced, and the compatibility and stability of cross-task migration are improved.

[0057] In one embodiment, calculating the uncertainty score of a specified sample in the mining result includes extracting the log probability of the mining result as the uncertainty score.

[0058] This embodiment of the application directly uses the logarithmic probability of the results generated by the large model as an uncertainty quantification indicator. This method does not require the design of an additional evaluation model. It uses the confidence information output by the large model itself, simplifies the calculation process, and naturally adapts to the model reasoning process to ensure the consistency of the evaluation results.

[0059] In one embodiment, extracting the log probability of the mining result as an uncertainty score includes:

[0060] Extract the log probability of a specified number of samples in the mining results as the uncertainty score;

[0061] The specified number is the minimum number of samples under the stable accuracy range obtained by evaluating the accuracy of different sample sizes.

[0062] In practice, learning from the entire news data set is difficult due to the limited context length of large models and the cost of large-scale data annotation. Therefore, in a few-shot learning setting, this patent aims to select a small number of samples with the highest uncertainty for the large model as difficult samples for learning. To effectively measure the model's predictive uncertainty, this patent extracts the log probabilities of the generated tokens from the output information as the large model generates news text analysis results as an uncertainty score. Based on this uncertainty score, the task data is sorted according to the uncertainty score, where lower log probabilities indicate higher uncertainty. Ultimately, the samples with the highest uncertainty are selected as difficult samples. These samples often correspond to the most ambiguous label definitions in the current news task, making it difficult for the large model to make high-confidence judgments. For example, in a news event classification task, "political news" and "social news" may overlap, resulting in low prediction confidence for the large model, and thus being selected as difficult samples. This process effectively filters out the most confusing samples for the large model, providing a critical foundation for subsequent learning. Finally, these difficult samples are provided to news analysis experts for judgment to obtain real labels as a basis for learning, thereby effectively introducing valuable supervision information and further optimizing the large model's understanding and adaptability to news tasks.

[0063] In applications, when evaluating the uncertainty of optimization results, it is necessary to re-infer based on the new labels to obtain a new uncertainty level. Therefore, multiple iterations often require multiple inferences on the target task data. A large number of inferences will greatly affect the time efficiency of the algorithm. Therefore, we considered randomly sampling a small amount of task data instead of the entire data for evaluation. In order to accurately obtain the number of samples in this subset, we conducted a distribution level assessment on the target task data in advance. Specifically, we evaluated the inference results by gradually increasing the number of samples, from 10 sample data to 20, then to 50, 100, 200, and 400 sample data, and evaluated the results based on the accuracy level. The results showed that the performance results fluctuated greatly within 10, 20, and 50, and approached stability at 100, 200, and 400. Therefore, we chose the minimum number of 100 as the evaluation sample to ensure that the distribution level of the entire dataset can be represented while using a smaller amount of data for evaluation.

[0064] The embodiment of the present application dynamically determines the minimum sample size for extracting logarithmic probability and selects the optimal sample size through the accuracy plateau interval. While ensuring the effectiveness of uncertainty assessment, it reduces unnecessary computational effort and is particularly suitable for efficient processing of large-scale news texts.

[0065] In one embodiment, after calculating the uncertainty score of a specified sample in the mining result, the method further includes:

[0066] If it is the first iteration, when the uncertainty score is greater than the preset score threshold, the sample with the highest uncertainty score is selected as the most difficult sample, otherwise the mining result is output;

[0067] If it is not the first iteration, when the uncertainty score is increasing, difficult samples are added in descending order of uncertainty score.

[0068] In applications, although the initial label descriptions can provide a general overview of the data type, large models may still not fully meet the personalized needs of news analysis given the complex and diverse news contexts. During this step, it is necessary to determine whether to optimize the current label descriptions, that is, whether to initiate active iterative learning. This can be controlled based on a preset number of learning rounds. Specifically, if the number of learning rounds does not reach a set threshold, the model will continue to enter the demand learning phase to continuously refine its understanding of the task. When the number of learning rounds reaches a preset value, the model is considered to have learned sufficiently, further iterations cease, and the final results are output. Furthermore, the number of learning rounds can be dynamically adjusted based on the changing uncertainty of the model during the learning process, ensuring that optimization continues when label descriptions remain ambiguous and that learning is terminated promptly when it stabilizes, thereby improving learning efficiency and the reliability of the final judgment. For example, in a news event classification task, if the boundaries of certain event categories (such as "breaking news" or "social events") are relatively vague, the system can automatically trigger demand optimization to refine the label definitions to improve classification accuracy.

[0069] In the application, when the first uncertainty assessment is completed, the uncertainty of the current result is recorded, for example, -0.5 in the first round (the closer the logarithmic probability is to 0, the more certain it is, and vice versa). After the second round, the uncertainty score can be judged based on whether it has decreased compared to the previous round. If the result after optimization is <= -0.5, the algorithm returns to increase the number of difficult samples and learns again. If it is > -0.5, the optimization is effective and the next round is entered.

[0070] The present embodiment sets differentiated processing rules for the first iteration and non-first iteration. During the first run, the availability of preliminary results is prioritized, while during non-first runs, the sample size is dynamically adjusted based on trends to avoid misjudgments due to insufficient initial data and enhance the robustness of the process.

[0071] In one embodiment, receiving user annotation information for difficult samples and updating the task label description based on the annotation information includes:

[0072] Receive the true labels annotated by users for each difficult sample;

[0073] Use the true labels to classify difficult samples and obtain the labels to be optimized. The labels to be optimized include the true labels and the corresponding descriptions.

[0074] Each label to be optimized and the corresponding difficult sample are organized into a structured prompt through a predefined task template;

[0075] Feeding structured prompts into a large-scale pre-trained model yields updated task labels.

[0076] In the application, difficult samples, after being judged by news analysts, are first assigned a true label. These difficult samples are then classified based on the labeled true labels, resulting in a corresponding set of difficult samples for each label. This forms the data foundation for optimization. Furthermore, each true label (including its label description) and its corresponding set of difficult samples are constructed as prompts using a predefined template and fed into the large model for learning. By analyzing these samples, the large model generates new label descriptions that better meet the needs of the news task and updates the label descriptions corresponding to the original true labels. Through this process, the large model improves its understanding of highly uncertain labels in news tasks. For example, in a news event classification task, the initially defined label "social news" may have a broad meaning. After this optimization step, it can be refined into more targeted labels such as "emergency" and "people's livelihood hotspots."

[0077] This embodiment of the application converts user annotation information into machine-understandable label descriptions through real-world label classification and secondary generation of structured prompts. This method leverages the contextual learning capabilities of large models to seamlessly integrate the results of human intervention into the automated process, achieving closed-loop optimization of demand understanding and task execution.

[0078] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.

[0079] The present application also provides a device for active demand learning-based few-shot text mining, which is configured to perform the steps of the active demand learning-based few-shot text mining method described above. The device for active demand learning-based few-shot text mining can be a virtual appliance in an electronic device, executed by a processor of the electronic device, or can be the electronic device itself.

[0080] like Figure 3 As shown, the few-sample text mining device 100 based on active demand learning provided by the embodiment of the present application includes:

[0081] The structured prompt generation module 101 is used to generate a structured prompt according to a predefined task template;

[0082] Large model reasoning module 102, used to input structured prompts into a large-scale pre-trained model for reasoning to obtain mining results;

[0083] The optimization evaluation module 103 is used to calculate the uncertainty score of the specified sample in the mining result. If the uncertainty score shows a downward trend, the process returns to the step of generating structured prompts based on the predefined task template; if the uncertainty score shows an upward trend, the number of difficult samples is increased;

[0084] An updating module 104 is configured to receive user annotation information for difficult samples, update the task label description based on the annotation information, and return to the step of generating a structured prompt according to a predefined task template;

[0085] The output module 105 is configured to output the mining result when it is determined that the optimization termination condition is met.

[0086] In application, each module in the active demand learning-based few-sample text mining device can be a software program module, or can be implemented by different logic circuits integrated in a processor, or can be implemented by multiple distributed processors.

[0087] like Figure 4 As shown, the embodiment of the present application further provides an electronic device 200, including: at least one processor 201 ( Figure 4 Only one processor is shown in the figure), a memory 202, and a computer program 203 stored in the memory 202 and executable on at least one processor 201. When the processor 201 executes the computer program 203, the steps in the above-mentioned various method embodiments are implemented.

[0088] In applications, electronic devices may include, but are not limited to, processors and memories. Those skilled in the art will appreciate that Figure 4 The electronic device is merely an example and does not limit the electronic device. The electronic device may include more or fewer components than shown in the figure, or may include a combination of certain components or different components.

[0089] In applications, the processor may be a central processing unit (CPU), other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.

[0090] In applications, in some embodiments, the memory can be an internal storage unit of an electronic device, such as a hard disk or memory of the electronic device. In other embodiments, the memory can also be an external storage device of the electronic device, such as a plug-in hard disk equipped on the electronic device, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card, etc. Furthermore, the memory can also include both an internal storage unit of the electronic device and an external storage device. The memory is used to store an operating system, application programs, a boot loader (BootLoader), data, and other programs, such as the program code of a computer program. The memory can also be used to temporarily store data that has been output or is about to be output.

[0091] It should be noted that the information interaction, execution process, etc. between the above-mentioned devices / units are based on the same concept as the method embodiment of this application. Their specific functions and technical effects can be found in the method embodiment section and will not be repeated here.

[0092] Those skilled in the art can clearly understand that, for the convenience and brevity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In actual applications, the above-mentioned functions can be distributed and completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated into one processing unit, or each unit can exist physically alone, or two or more units can be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.

[0093] An embodiment of the present application further provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments can be implemented.

[0094] An embodiment of the present application provides a computer program product, including a computer program. When the computer program product runs on an electronic device, the electronic device can implement the steps in the above-mentioned various method embodiments when executing the computer program product.

[0095] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, which can be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and when the computer program is executed by the processor, it can implement the steps of the above-mentioned various method embodiments. Among them, the computer program includes computer program code, which can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may at least include: any entity or device that can carry the computer program code to the device / electronic device, a recording medium, a computer memory, a read-only memory (ROM), a random access memory (RAM), an electric carrier signal, a telecommunication signal and a software distribution medium. For example, a USB flash drive, a mobile hard disk, a magnetic disk or an optical disk. In some jurisdictions, according to legislation and patent practice, a computer-readable medium cannot be an electric carrier signal or a telecommunication signal.

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

[0097] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

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

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

[0100] The above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the present application, and should all be included in the scope of protection of the present application.

Claims

1. A few-sample text mining method based on active demand learning, characterized by: include: Generate structured prompts based on predefined task templates; Inputting the structured prompt into a large-scale pre-trained model for reasoning to obtain mining results; Calculating the uncertainty score of the specified sample in the mining result, and if the uncertainty score shows a downward trend, returning to the step of generating structured prompts according to the predefined task template; if the uncertainty score shows an upward trend, increasing the number of difficult samples; receiving user annotation information of the difficult sample, updating the task label description based on the annotation information, and returning to execute the step of generating a structured prompt according to a predefined task template; When it is determined that the optimization termination conditions are met, the mining results are output.

2. The method for small-sample text mining based on active demand learning according to claim 1, characterized in that: The optimization termination condition includes at least one of the following: the number of iteration rounds reaches a preset number, the uncertainty score is less than a preset score, and the uncertainty converges.

3. The method for small-sample text mining based on active demand learning according to claim 1, wherein: Generating structured prompts according to predefined task templates includes: The news text, task objective description, task label and description are aggregated through a predefined task template to form a structured prompt.

4. The method for small-sample text mining based on active demand learning according to claim 1, wherein: The calculating the uncertainty score of the specified sample in the mining result includes extracting the logarithmic probability of the mining result as the uncertainty score.

5. The method for small-sample text mining based on active demand learning according to claim 4, characterized in that: The extracting the logarithmic probability of the mining result as the uncertainty score includes: extracting the logarithmic probability of a specified number of samples in the mining result as the uncertainty score; The specified number is the minimum number of samples within the accuracy plateau obtained by performing accuracy evaluation on different sample sizes.

6. The method for small-sample text mining based on active demand learning according to claim 1, wherein: After calculating the uncertainty score of the specified sample in the mining result, the method further includes: If it is the first iteration, when the uncertainty score is greater than the preset score threshold, the sample with the highest uncertainty score is selected as the difficult sample, otherwise the mining result is output; If it is not the first iteration, when the uncertainty score shows an upward trend, difficult samples are added in descending order of the uncertainty score.

7. The method for small-sample text mining based on active demand learning according to claim 1, wherein: The receiving the user's annotation information on the difficult sample, and updating the task label description based on the annotation information, includes: Receive the true labels annotated by users for each difficult sample; Using the true labels to classify the difficult samples, a label to be optimized is obtained, where the label to be optimized includes the true label and a corresponding description; Each label to be optimized and the corresponding difficult sample are organized into a structured prompt through a predefined task template; The structured prompt is input into the large-scale pre-trained model to obtain an updated task label.

8. A small sample text mining device based on active demand learning, characterized in that: include: A structured prompt generation module is used to generate structured prompts based on predefined task templates; A large model inference module is used to input the structured prompts into a large-scale pre-trained model for inference to obtain mining results; an optimization evaluation module, configured to calculate the uncertainty score of a specified sample in the mining result, and if the uncertainty score shows a downward trend, return to the step of generating structured prompts according to the predefined task template; if the uncertainty score shows an upward trend, increase the number of difficult samples; An updating module, configured to receive user annotation information of the difficult sample, update the task label description based on the annotation information, and return to execute the step of generating a structured prompt according to a predefined task template; The output module is used to output the mining results when it is determined that the optimization termination conditions are met.

9. An electronic device, characterized in that: The electronic device comprises a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the electronic device implements the method according to any one of claims 1 to 7.

10. A computer program product, characterized in that The invention comprises a computer program, which, when being executed, enables the method according to any one of claims 1 to 7 to be performed.