Context learning depolarization framework, product and equipment for multi-language text classification

Through a context learning debias framework for multilingual text classification, the use of Sentence-BERT and context difference metric (CDM) to select and filter samples, the problem of model parameter update and bias in multilingual text classification is solved, and fairness, accuracy, adaptability and scalability are achieved in different languages and cultural contexts.

CN120448544APending Publication Date: 2025-08-08GUANGDONG UNIV OF TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510537022.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-25
Publication Date
2025-08-08

AI Technical Summary

Technical Problem

In the multilingual text classification task, the existing technology has problems such as model parameter updates leading to performance degradation or exacerbation of bias, single-language focus, insufficient generalization ability, insufficient context information, poor sample selection and poor multilingual adaptability, which is difficult to meet the needs of multilingual text classification.

Method used

A context learning debias framework for multilingual text classification is adopted, including a sample selection module and a sample filtering module. The semantic similarity is calculated by Sentence-BERT and samples with significant differences are selected through the context difference metric (CDM), and prediction results are generated based on large language models.

Benefits of technology

Without updating model parameters, this framework improves the fairness and accuracy of multilingual text classification, adapts to different languages and cultural backgrounds, alleviates bias, maintains model performance, and has good adaptability and scalability, enhancing the interpretability of the model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120448544A_ABST
    Figure CN120448544A_ABST
Patent Text Reader

Abstract

The invention discloses a context learning depolarization framework, a product and equipment for multi-language text classification, and belongs to the technical field of artificial intelligence. The framework comprises a sample selection module which is configured to be capable of calculating semantic similarity based on Sension-BERT and selecting a plurality of training samples most similar to test examples from a preset sample set according to the calculated semantic similarity; the sample filtering module is configured to be capable of screening out samples with significant differences under the sensitive attributes from the training samples selected by the sample selection module through context difference measurement; and the template filling and predicting module is configured to fill the samples screened out by the sample filtering module into a predefined template and input the samples into a large language model in combination with a test instance to generate a predicting result. According to the method, the fairness and the accuracy of the large language model during multi-language text processing can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of artificial intelligence technology, and specifically relates to a contextual learning debiasing framework, product, and device for multilingual text classification. Background Art

[0002] With the development of globalization, multilingual text classification tasks are increasingly used in cross-cultural communication, international social media analysis, multilingual content moderation, and other fields. Ensuring the fairness and accuracy of these tasks is crucial to avoiding negative social impacts and improving user experience.

[0003] In the existing technology, multilingual text classification tasks mainly adopt a context-based learning framework (such as TopK): leveraging the contextual learning capabilities of large language models to guide the model's predictions by providing relevant examples in the context. Methods for sentiment analysis and opinion extraction: identifying emotional tendencies and opinions in texts, which is very helpful for generating summaries that contain the author's attitudes. By analyzing the emotions (positive, negative, or neutral) and opinions (support, opposition, or neutral) expressed in the text, a summary that reflects the emotional color of the text can be generated. Visual annotation and data analysis: through visualization means, such as highlighting key words or annotated parts, key information is made more intuitive. This helps to quickly locate the core content of the text and generate a summary. Traditional debiasing methods: mainly for monolingual text classification, bias is reduced by adjusting model parameters, such as retraining or fine-tuning the model.

[0004] The defects of the above prior art include:

[0005] 1. The need to update model parameters: This may cause the model’s performance on other tasks to degrade or exacerbate other types of bias.

[0006] 2. Single language focus: It mainly targets single language tasks and is difficult to adapt to bias issues in multilingual environments.

[0007] 3. Limited generalization ability: It is effective on specific datasets or tasks, but lacks generalization ability in multilingual environments.

[0008] 4. Insufficient contextual information: There is a lack of sufficient contextual information to help the model understand the differences between different groups.

[0009] 5. Insufficient sample selection: Failure to consider differences in sample performance in different contexts may result in the selected samples being unable to effectively mitigate bias.

[0010] 6. Poor multilingual adaptability: Poor adaptability in a multilingual environment makes it difficult to effectively deal with biases between different languages.

[0011] The above defects have resulted in the existing technology being unable to meet the current task of multilingual text classification, and a new method for multilingual text classification is urgently needed. Summary of the Invention

[0012] The present invention aims to solve one of the technical problems in the above-mentioned related art at least to a certain extent.

[0013] To this end, the purpose of the present invention is to provide a contextual learning debiasing framework, product and device for multilingual text classification, which can improve the fairness and accuracy of large language models when processing multilingual text.

[0014] In order to solve the above-mentioned technical problems, the present invention is achieved as follows:

[0015] The embodiment of the present invention provides a contextual learning debiasing framework for multilingual text classification, the framework comprising: a sample selection module, a sample filtering module, and a template filling and prediction module;

[0016] The sample selection module is configured to calculate semantic similarity based on Sentence-BERT and select several training samples that are most similar to the test instance from a preset sample set according to the calculated semantic similarity;

[0017] The sample filtering module is configured to filter out samples with significant differences in performance under various sensitive attributes from the training samples selected by the sample selection module through context difference measurement;

[0018] The template filling and prediction module is configured to fill the samples screened by the sample filtering module into the predefined template, and input the combined test examples into the large language model to generate prediction results.

[0019] In addition, the contextual learning debiasing framework for multilingual text classification according to the present invention may also have the following additional technical features:

[0020] In some embodiments, the sample selection module includes performing semantic representation on all samples in the sample set, calculating the semantic similarity between the test instance and all samples in the sample set, sorting them according to the calculated semantic similarity, and selecting the k samples with the highest semantic similarity as the output of the module.

[0021] In some embodiments, the sample filtering module includes constructing context descriptions of different sensitive attributes for each input training sample, calculating the model loss difference of the same training sample under different context descriptions, and screening out samples with significant performance differences based on the model loss difference, so as to serve as input to the template filling and prediction module.

[0022] In some embodiments, the semantic representation is specifically: using Sentence-BERT to encode each sample and / or instance to generate a high-dimensional vector representation.

[0023] In some implementations, the semantic similarity is specifically cosine similarity.

[0024] In some implementations, constructing the content of the context description includes: constructing a context description containing sensitive attribute information for each training sample.

[0025] In some implementations, the cosine similarity is calculated as follows:

[0026]

[0027] Here, x and y are the vector representations of the two sentences, ˙ represents the vector dot product, and ||·|| represents the Euclidean norm of the vector.

[0028] In some embodiments, the model loss difference is obtained by calculating the CDM value of each training sample; the CDM value is calculated as follows:

[0029] CDM=|L(d u1 , dx)-L(d u2 ,dx)|,

[0030] Among them, L(d u1 , dx) and L(d u2 , dx) represent the model in context d u1 and d u2 The prediction loss for the input dx.

[0031] An embodiment of the present invention further provides a computer program product, including a computer program, which, when executed by a processor, implements the content of the contextual learning debiasing framework for multilingual text classification as described in any of the above items.

[0032] An embodiment of the present invention also provides a computer device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the content of the contextual learning debiasing framework for multilingual text classification as described in any one of the above items.

[0033] Compared with the prior art, the present invention has at least the following beneficial effects:

[0034] In the embodiments of the present invention, a two-stage contextual learning debiasing framework for multilingual text classification is provided. This framework mitigates bias through contextual learning and sample selection without updating model parameters. This means that the framework can be applied to any pre-trained large language models (LLMs) without retraining or fine-tuning the model. This not only saves computing resources and time, but also avoids the degradation of model performance or the exacerbation of other biases that may be caused by parameter updates.

[0035] The two-stage contextual learning debiasing framework for multilingual text classification provided in the embodiments of the present invention is specifically designed for multilingual text classification tasks and can adapt to different languages and cultural backgrounds. By selecting and filtering samples in different languages, the framework can effectively address bias issues in multilingual environments. This gives the framework a significant advantage in processing cross-lingual and cross-cultural data, ensuring the fairness and accuracy of the model across different languages and cultural backgrounds.

[0036] In an embodiment of the present invention, a two-stage contextual learning debiasing framework for multilingual text classification is provided. Through a sample selection module and a sample filtering module, samples are carefully selected and filtered. The sample selection module uses Sentence-BERT to generate semantic representations and selects samples most relevant to the test instance through cosine similarity. The sample filtering module introduces a contextual difference measure (CDM) to screen out samples that show significant differences between different groups by comparing model losses under different context descriptions. This sophisticated sample selection and filtering mechanism can more effectively reduce bias and improve the fairness and accuracy of the model.

[0037] In embodiments of the present invention, a two-stage contextual learning debiasing framework for multilingual text classification is provided. This framework can significantly improve the fairness of multilingual text classification tasks while maintaining model performance. Through contextual learning and sample selection, the framework can reduce the model's bias among different groups while maintaining or even improving the model's classification performance. This makes the framework highly valuable in practical applications and can ensure both classification accuracy and fairness when handling multilingual text classification tasks.

[0038] In the embodiments of the present invention, a two-stage contextual learning debiasing framework for multilingual text classification is provided, which has good adaptability and scalability. The framework can be applied to any language and is suitable for a variety of multilingual text classification tasks. In addition, the structural design of the framework allows it to be easily extended to other natural language processing tasks, showing a wide range of application prospects. By adjusting the sample selection and filtering strategies, the framework can adapt to different task requirements and dataset characteristics, showing strong flexibility.

[0039] In embodiments of the present invention, a two-stage contextual learning debiasing framework for multilingual text classification is provided. Through contextual learning and sample selection, this framework provides a more transparent decision-making process. By selecting and filtering samples with significant differences, the framework can reveal the model's biased behavior across different groups, thereby improving the model's interpretability. This enables researchers and developers to better understand and analyze the model's decision-making process, further optimizing and improving the model's performance and fairness.

[0040] In the embodiments of the present invention, the provided two-stage contextual learning debiasing framework for multilingual text classification was experimentally verified in multiple multilingual text classification tasks. The results showed that the framework has significant effects in reducing bias and improving fairness. The experimental results also showed that the framework can significantly improve the accuracy and fairness of classification while maintaining model performance. These experimental results further demonstrate the effectiveness and practicality of the WATER framework of the present invention.

[0041] Additional aspects and advantages of the present invention will be set forth in part in the description which follows and, in part, will be obvious from the description which follows, or may be learned by practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] Figure 1 A schematic diagram of a two-stage contextual learning debiasing framework for multilingual text classification disclosed in one embodiment of the present invention;

[0043] Figure 2 This is a diagram illustrating an example of a template structure disclosed in one embodiment of the present invention;

[0044] Figure 3 A schematic diagram of the workflow of a sample selection module disclosed in one embodiment of the present invention;

[0045] Figure 4 A schematic diagram of the workflow of a sample filtering module disclosed in one embodiment of the present invention;

[0046] Figure 5 A schematic diagram of the workflow of a template filling and prediction module disclosed in one embodiment of the present invention;

[0047] Figure 6 The effect of sample size on evaluation indicators disclosed in one embodiment of the present invention. DETAILED DESCRIPTION

[0048] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of them. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present invention without making any creative efforts shall fall within the scope of protection of the present invention.

[0049] The embodiments of the present invention are described in detail below through specific embodiments and application scenarios with reference to the accompanying drawings.

[0050] In some embodiments of the present invention, a two-stage contextual learning debiasing framework for multilingual text classification is provided. This framework employs the WATER framework to address the bias issues inherent in large language models used in multilingual text classification tasks, while overcoming the limitations of existing debiasing methods. This framework mitigates bias in multilingual environments through contextual learning and sample selection, eliminating the need to update model parameters and thus avoiding performance degradation on other tasks. The WATER framework is specifically designed for multilingual text classification tasks, mitigating bias in multilingual environments through contextual learning and sample selection, adapting to diverse languages and cultural backgrounds. Furthermore, the WATER framework uses a sample selection module and a sample filtering module to select and filter out samples that exhibit significant differences across different groups, thereby more effectively mitigating bias. While maintaining model performance, this framework significantly improves the fairness of multilingual text classification tasks, ensuring the fairness of classification results across diverse languages and cultural backgrounds. Finally, the WATER framework exhibits excellent adaptability and scalability, enabling it to process large-scale multilingual data and meet the demands of practical applications.

[0051] In some embodiments of the present invention, the WATER framework includes a sample selection module, a sample filtering module, and a template filling and prediction module. Figure 1 In the WATER framework, each component works together through sequential connections to achieve the goal of debiasing in multilingual text classification tasks.

[0052] In some embodiments of the present invention, the sample selection module first semantically represents all instances in the training dataset and calculates the semantic similarity between each test instance and the training instance. It then selects the k training instances that are most similar to the test instance as output. These instances are then passed to the sample filtering module.

[0053] The sample selection module of the present invention selects the samples most relevant to the test instance by calculating semantic similarity. This module uses Sentence-BERT to generate a high-dimensional vector representation, and selects the samples most relevant to the test instance by calculating cosine similarity. This method can effectively capture the semantic information of the sentence and ensure that the selected samples are highly semantically relevant to the test instance. Reduce search space: By selecting the samples most relevant to the test instance, the sample selection module reduces the search space for subsequent processing and improves processing efficiency. This enables the framework to run efficiently on large-scale datasets while maintaining high accuracy and fairness. The workflow of the sample selection module is as follows Figure 3 shown.

[0054] In the above embodiment, the sample selection module is the first stage of the WATER framework. Its main purpose is to select the samples that are most relevant to the test instance from the training dataset. The specific steps of this process are as follows:

[0055] (1) Input data: The sample selection module receives a training dataset and a test instance as input. The training dataset contains text samples in multiple languages, each with corresponding labels and user attribute information. The test instance is a text to be classified, such as a tweet.

[0056] (2) Semantic representation generation: Use Sentence-BERT to encode each training and test instance and generate a high-dimensional vector representation. Sentence-BERT is a BERT-based model that is trained to make semantically similar sentences close to each other in the vector space. For example, after encoding the training examples "This is a friendly tweet" and "This is a friendly comment", their vector representations are highly similar.

[0057] (3) Cosine similarity calculation: For each test instance, calculate the cosine similarity between it and all training instances. Cosine similarity measures the cosine value of the angle between two vectors. A larger value indicates a higher similarity. The specific calculation formula is:

[0058]

[0059] Here, x and y are the vector representations of the two sentences, ˙ represents the dot product of the vectors, and ||·|| represents the Euclidean norm of the vectors. For example, the vector of the test example "This tweet contains racist remarks" has a high cosine similarity with the vectors of tweets containing racist labels in the training sample.

[0060] (4) Sample selection: Based on cosine similarity, select the k training instances that are most similar to the test instance. The value of k can be adjusted according to the specific task and the size of the dataset. These selected training instances will serve as context examples for subsequent debiasing.

[0061] In some embodiments of the present invention, the sample filtering module constructs contextual descriptions of different sensitive attributes for each input training instance. By calculating the difference in model loss under different contextual descriptions (i.e., the contextual difference metric CDM), this module screens out samples that show significant differences between different groups. These screened samples serve as input to the subsequent template filling and prediction modules.

[0062] The sample filtering module of the present invention can perform contextual difference measurement (CDM): by introducing contextual difference measurement (CDM), by comparing the model loss under different context descriptions, samples that show significant differences in different groups are screened out. This method can effectively identify and filter out samples with potential bias, thereby improving the fairness of the model. The sample filtering module can also perform refined screening: based on the introduction of CDM, samples that are most helpful for debiasing can be selected to achieve refined sample screening. This refined screening mechanism can more effectively reduce the bias of the model in different groups and improve the accuracy and fairness of classification. The workflow of the sample filtering module is as follows: Figure 4 shown.

[0063] In the previous embodiment, the sample filtering module serves as the second stage of the WATER framework. Its main purpose is to filter out samples that show significant differences in different contexts from the samples output by the sample selection module. The specific steps of this process are as follows:

[0064] (1) Context description construction: A different context description is constructed for each selected training instance. These descriptions contain sensitive attribute information such as gender, age, race, and country. For example, for a training sample “This tweet was posted by a male user and contained discriminatory remarks against women.”, two context descriptions are constructed: “This is a comment posted by a male user” and “This is a comment posted by a female user.”

[0065] (2) Model loss calculation: Each training instance and its corresponding context description are input into the Large Language Model (LLM) to calculate the model's prediction loss. The model loss reflects the model's prediction performance under that context. For example, for the two context descriptions above, the model may produce different loss values when predicting whether there is hate speech.

[0066] (3) Contextual Difference Metric (CDM) calculation: The CDM value of each training instance is calculated using the following formula:

[0067] CDM=|L(d u1 , dx)-L(d u2 , dx)|

[0068] Among them, L(d u1 , dx) and L(d u2 , dx) represent the model in context d u1 and d u2 The prediction loss for the input dx is given by . A larger CDM value indicates that the performance of the example in different contexts varies greatly and may be biased.

[0069] (4) Sample screening: Sort and screen samples according to their CDM values, and select those with larger CDM values. These samples are more likely to reveal the biased behavior of the model in different groups, thus providing key information for subsequent debiasing processing.

[0070] In some embodiments of the present invention, in the template filling and prediction module, the filtered samples are filled into a predefined template. The samples in the template and the test instance are input into the Large Language Model (LLM). The model generates prediction results based on this contextual information, thus completing the multilingual text classification task.

[0071] The template filling and prediction module of the present invention can design a template structure: the module defines a template structure for integrating context examples and test instances. This template structure can effectively guide the model to make full use of context information in the prediction process, thereby improving the accuracy and fairness of classification. Context information integration: By filling context examples and test instances into the template, the model can comprehensively consider context information in the prediction process and reduce the impact of bias. This context information integration mechanism can improve the interpretability and transparency of the model, making the decision-making process of the model clearer and more reasonable. The workflow of the template filling and prediction module is as follows: Figure 5 shown.

[0072] In the previous examples, the template filling and prediction module is the third stage of the WATER framework. Its main purpose is to fill the template with selected and screened samples and input them into the model for prediction. The specific steps of this process are as follows:

[0073] (1) Template structure definition: define a template structure (such as Figure 2 (as shown in the figure), used to integrate context examples and test instances. A template typically includes a task instruction, context examples, and test instances. For example, the task instruction might be "Determine whether the following tweets contain hate speech (yes / no)." The context examples are selected and filtered training samples, and the test instances are the tweets to be classified.

[0074] (2) Template filling: Fill the selected and filtered context examples and test instances into the template.

[0075] (3) Model prediction: The filled template is fed into a large language model, which generates predictions based on contextual examples and test instances. The model comprehensively considers the contextual examples’ descriptions of different sensitive attributes, thereby reducing bias and improving classification accuracy and fairness.

[0076] Through this sequential connection, structure, and working process, the WATER framework can effectively utilize contextual information and sample selection strategies to mitigate bias issues in multilingual text classification tasks while maintaining model performance and fairness. It can also effectively utilize contextual information and sample selection strategies to mitigate bias issues in multilingual text classification tasks while maintaining model performance and fairness.

[0077] The present invention uses experiments to prove the effectiveness and accuracy of the above framework. The following is a description of the experiment.

[0078] Experimental datasets of the present invention: The datasets used are shown in Table 1, which mainly include a multilingual hate speech classification dataset and the Wikipedia harmful comment dataset and sentiment analysis dataset that may be involved. The multilingual hate speech classification dataset covers tweets in languages such as English, Italian, Polish, Portuguese and Spanish. Each tweet is annotated with sensitive attribute information such as whether there is hate speech and the gender, age, race and country of the publisher. The dataset is large in scale. These datasets provide the WATER framework with rich multilingual text and comprehensive annotation information, enabling it to be tested in different language environments, and to evaluate and mitigate the bias of the model on sensitive attributes. Experimental results show that the WATER framework significantly improves the fairness and accuracy of the model in multilingual text classification tasks, and also proves its effectiveness in maintaining model performance.

[0079] Experimental setup of the present invention: In the experiment, the PyTorch framework and the RTX A100 graphics card (equipped with 40GB memory) were used for all experiments, and the Llama2-13B model was selected as the basic model. In the experiment, the "TopK" strategy was first used to filter out 16 candidate examples, and then the context difference measure (CDM) was used to select and sort the 8 examples with the largest differences. In order to comprehensively evaluate the performance of the WATER framework, the researchers compared it with four widely used techniques, including the Prompting method that does not use context examples, the Random Baseline that randomly selects context examples, the TopK Baseline that uses the nearest neighbors of the test sample as context examples, and the sentence-level debiasing technology Sent-DebiasBERT for the BERT model. The evaluation indicators cover accuracy, macro-average F-value, weighted average F-value, monolingual equality difference (MED), multilingual equality difference (MUED) and multilingual equality performance difference (MEPD). Through these experimental settings, the researchers comprehensively evaluated the performance and fairness of the WATER framework in multilingual text classification tasks, verifying its effectiveness in mitigating bias and improving classification accuracy.

[0080] The experiment used the following evaluation metrics: performance metrics include accuracy, macro-average F-value, and weighted-average F-value, which are used to measure the classification performance of the model; fairness metrics include monolingual equality difference (MED), multilingual equality difference (MUED), and multilingual equality performance difference (MEPD), which are used to measure the fairness performance of the model in different languages and sensitive attribute groups. Through these metrics, researchers can evaluate the effectiveness and practicality of the WATER framework from multiple perspectives.

[0081] Baseline methods of the present invention: To comprehensively evaluate the performance and effectiveness of the WATER framework, the present invention conducts detailed comparisons with the following four baseline methods (Tables 2, 3, 4, and 5):

[0082] 1. Prompting: Prompting is a special contextual learning method that does not use any contextual examples and only guides the model to generate output through task instructions. This method relies on the model's ability to understand and generate task instructions and does not involve specific example selection and filtering. Prompting is suitable for tasks that do not require specific examples to guide the model, such as simple question answering or text generation tasks.

[0083] 2. Random Baseline: The Random Baseline method randomly selects context examples without considering their similarity or relevance to the test instance. This method selects examples through random sampling and does not involve any specific example selection strategy. Random Baseline is suitable for preliminary evaluation of model performance and can serve as a benchmark for comparison with other methods.

[0084] 3. TopK Baseline: The TopK Baseline method uses the k training examples that are most similar to the test example as context examples, usually based on cosine similarity or other similarity metrics. This method improves the model's prediction accuracy by selecting examples that are most relevant to the test example. TopK Baseline is suitable for tasks that need to exploit example similarity to improve model performance, such as text classification and information retrieval.

[0085] 4. Sent-Debias BERT: Sent-Debias BERT is a sentence-level debiasing technique for the BERT model. It aims to reduce bias in the BERT model by adjusting model parameters. This method trains a debiased model to make the model perform more fairly when processing text with different sensitive attributes. Sent-Debias BERT is suitable for text classification tasks that need to process multiple sensitive attributes, especially in scenarios where model bias needs to be reduced.

[0086] These baseline methods cover different debiasing strategies, ranging from simple to complex, providing a comprehensive comparative benchmark for the WATER framework. By comparing with these methods, researchers were able to verify the advantages of the WATER framework in mitigating bias and improving classification accuracy. Specifically, through sample selection and filtering mechanisms, the WATER framework is able to significantly improve the fairness of multilingual text classification tasks while maintaining model performance.

[0087] The results of the above experiments show that the WATER framework significantly improves the performance and fairness of the model in multilingual text classification tasks. In terms of performance indicators, the WATER framework achieves an average accuracy of 0.7277, a macro-average F-value of 0.6463, and a weighted average F-value of 0.7210, all of which are superior to other baseline methods. In terms of fairness indicators, the WATER framework has a mean monolingual equality difference (MED) of 0.0491, a multilingual equality difference (MUED) of 0.0457, and a multilingual equality performance difference (MEPD) of 0.1434, all of which are significantly lower than other baseline methods. Specifically, compared with the Prompting method, the WATER framework has significantly improved both accuracy and fairness indicators; compared with the Random Baseline and TopK Baseline, the WATER framework performs better on fairness indicators while maintaining a high accuracy; compared with Sent-Debias BERT, the WATER framework performs better on performance indicators and is also competitive on fairness indicators. These results validate the effectiveness of the WATER framework in mitigating bias and improving classification accuracy.

[0088] Ablation experiment: It aims to evaluate the contribution of each module in the WATER framework to the overall performance and fairness (such as Figure 5 ). Specifically, the experiments removed the contextual difference measure (CDM) in the sample filtering module and the specific strategy in the sample selection module to observe the impact of these modules on the model performance and fairness. The experimental results show that after removing CDM, the model's accuracy and fairness indicators have declined, indicating that CDM plays a key role in alleviating bias. In addition, the use of different sample selection strategies (such as random selection and traditional TopK strategy) also has a significant impact on the performance and fairness of the model, further verifying the effectiveness of the sample selection and filtering mechanism in the WATER framework. These ablation experiment results show that the various modules of the WATER framework work together to improve the performance and fairness of the model in multilingual text classification tasks.

[0089] Table 1: Summary of multilingual corpus statistics

[0090]

[0091] Table 2: Experimental results of gender attribute debiasing

[0092]

[0093] Table 3: Experimental results of age attribute debiasing

[0094]

[0095]

[0096] Table 4: Experimental results of racial attribute debiasing

[0097]

[0098] Table 5: Experimental results of national attribute debiasing

[0099]

[0100] Parts of the present invention that are not described in detail may refer to the prior art or are well known to those skilled in the art, and this embodiment does not limit this and will not be described in detail here.

[0101] The embodiments of the present invention are described above in conjunction with the accompanying drawings, but the present invention is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present invention, ordinary technicians in this field can also make many forms without departing from the scope of protection of the present invention and the claims, all of which are protected by the present invention.

Claims

1. A context-based learning debiasing framework for multilingual text classification, characterized by: The framework includes: a sample selection module, a sample filtering module, and a template filling and prediction module; The sample selection module is configured to calculate semantic similarity based on Sentence-BERT and select several training samples that are most similar to the test instance from a preset sample set according to the calculated semantic similarity; The sample filtering module is configured to filter out samples with significant differences in performance under various sensitive attributes from the training samples selected by the sample selection module through context difference measurement; The template filling and prediction module is configured to fill the samples screened by the sample filtering module into the predefined template, and input the combined test examples into the large language model to generate prediction results.

2. The context-based learning debiasing framework for multilingual text classification according to claim 1, characterized in that The sample selection module performs semantic representation on all samples in the sample set, calculates the semantic similarity between the test instance and all samples in the sample set, sorts them according to the calculated semantic similarity, and selects the k samples with the highest semantic similarity as the output of the module.

3. The context-based learning debiasing framework for multilingual text classification according to claim 1, characterized in that The sample filtering module works by constructing contextual descriptions of different sensitive attributes for each input training sample, calculating the model loss differences of the same training sample under different contextual descriptions, and screening out samples with significant performance differences based on the model loss differences so as to serve as inputs for the template filling and prediction modules.

4. The context-based learning debiasing framework for multilingual text classification according to claim 2, characterized in that: The semantic representation is specifically as follows: Sentence-BERT is used to encode each sample and / or instance to generate a high-dimensional vector representation.

5. The context-based learning debiasing framework for multilingual text classification according to claim 1, characterized in that The semantic similarity is specifically cosine similarity.

6. The context-based learning debiasing framework for multilingual text classification according to claim 3, characterized in that: The content of constructing the context description includes: constructing a context description containing sensitive attribute information for each training sample.

7. The context-based learning debiasing framework for multilingual text classification according to claim 5, characterized in that: The cosine similarity is calculated as: Here, x and y are the vector representations of the two sentences, ˙ represents the vector dot product, and ||·|| represents the Euclidean norm of the vector.

8. The context-based learning debiasing framework for multilingual text classification according to claim 3, characterized in that: The model loss difference is obtained by calculating the CDM value of each training sample; the CDM value is calculated as follows: CDM=|L(d u1 ,dx)-L(d u2 ,dx)|, Among them, L(d u1 , dx) and L(d u2 , dx) represent the model in context d u1 and d u2 The prediction loss for the input dx.

9. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the content of the context-based learning debiasing framework for multilingual text classification described in any one of claims 1 to 8 is implemented.

10. A computer device comprising: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the content of the context-based learning debiasing framework for multilingual text classification described in any one of claims 1-8.