IP Library Granted Patent US 12,632,786
Granted Patent B2
US 12,632,786 · App. 17/984,717 · Granted May 19, 2026

Named entity bias detection and mitigation techniques for sentence sentiment analysis

Inventors: Duy Vu (Melbourne, AU); Varsha Kuppur Rajendra (Bellevue, WA); Shivashankar Subramanian (Melbourne, AU); Ahmed Ataallah Ataallah Abobakr (Geelong, AU); Thanh Long Duong (Seabrook, AU); Mark Edward Johnson (Castle Cove, AU)
Assignee: ORACLE INTERNATIONAL CORPORATION
G06N20/00G06F18/2155G06F18/217
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 12,632,786
App. No.
17/984,717
Granted
May 19, 2026
Kind
B2
Abstract

Techniques for named entity bias detection and mitigation for sentence sentiment analysis. In one particular aspect, a method is provided that includes obtaining a training set of labeled examples for training a machine learning model to classify sentiment, preparing a list of named entities using one or more data sources, for each example in the training set of labeled examples with a named entity, replacing the named entity with a corresponding entity type tag to generate a labeled template data set, executing a sampling process for each entity type t within the labeled template data set to generate a augmented invariance data set comprising one or more invariance groups having labeled examples for each entity type t, and training the machine learning model using labeled examples from the augmented invariance data set.

Claims (61)

1 . A computer-implemented method comprising:

obtaining an original labeled data set for training a machine learning model to classify sentiment, wherein each example from the original labeled data set is labeled with at least a sentiment classification;

preparing a list of named entities using one or more data sources;

for each example in the original labeled data set with one or more named entities, replacing each named entity with a corresponding entity type tag to generate a labeled template data set;

executing a sampling process for each entity type/within the labeled template data set to generate a first augmented invariance data set comprising one or more invariance groups having labeled examples for each entity type 1 , wherein the sampling process comprises: (i) selecting an example from the labeled template data set comprising an entity type tag of entity type r; and (ii) generating an invariance group by iteratively replacing the entity type tag in the labeled example with a named entity selected from the list of named entities; and

training the machine learning model using the labeled examples from the first augmented invariance data set, wherein the training comprises:

batching the labeled examples from the first augmented invariance data set into data batches, wherein the first augmented invariance data set is assigned a sampling weight hypertuned based on performance of the machine learning model in named entity behavioral tests;

evaluating, using a first objective function, performance of the machine learning model on the labeled examples in each data batch, wherein the first objective function is modified by the sampling weight during the evaluating; and

updating, using an optimization function, model parameters of the machine learning model based on the evaluating of the performance of the machine learning model.

2 . The computer-implemented method of claim 1 , further comprising:

obtaining an original unlabeled data set for training the machine learning model to classify sentiment, wherein examples for the original unlabeled data set are obtained from a corpus of sentences and are unlabeled for the sentiment classification;

for each example in the original unlabeled data set with one or more named entities, replacing each named entity with a corresponding entity type tag to generate an unlabeled template data set; and

executing another sampling process for each entity type/within the unlabeled template data set to generate a second augmented invariance data set comprising one or more invariance groups having unlabeled examples for each entity type t, wherein the another sampling process comprises: (i) selecting an example from the unlabeled template data set comprising an entity type tag of entity type t; and (ii) generating an invariance group by iteratively replacing the entity type tag in the unlabeled example with a named entity selected from the list of named entities, wherein the training is performed using the labeled examples from the first augmented invariance data set and the unlabeled examples from the second augmented invariance data set.

3 . The computer-implemented method of claim 2 , wherein the training comprises:

batching the unlabeled examples from the second augmented invariance data set into data batches;

evaluating, using a second objective function, performance of the machine learning model on the unlabeled examples in each data batch; and

updating, using the optimization function, the model parameters of the machine learning model based on the evaluating of the performance of the machine learning model using the first objective function and the second objective function.

4 . The computer-implemented method of claim 3 , wherein the training is performed by batching the labeled examples from the first augmented invariance data set and the unlabeled examples from the second augmented invariance data set and sampling the data batches interleavingly between the first augmented invariance data set and the second augmented invariance data set.

5 . The computer-implemented method of claim 4 , wherein the second augmented invariance data set is assigned a sampling weight, and the second objective function is modified by the sampling weight during the evaluating of the performance of the machine learning model.

6 . The computer-implemented method of claim 5 , wherein the first objective function is cross-entropy loss and the second objective function is Kullback-Leibler divergence, sum of squared differences, or max of absolute differences.

7 . A system comprising:

one or more data processors; and

one or more non-transitory computer readable media storing instructions which, when executed by the one or more data processors, cause the one or more data processors to perform the following operations:

obtaining an original labeled data set for training a machine learning model to classify sentiment, wherein each example from the original labeled data set is labeled with at least a sentiment classification;

preparing a list of named entities using one or more data sources;

for each example in the original labeled data set with one or more named entities, replacing each named entity with a corresponding entity type tag to generate a labeled template data set;

executing a sampling process for each entity type/within the labeled template data set to generate a first augmented invariance data set comprising one or more invariance groups having labeled examples for each entity type/, wherein the sampling process comprises: (i) selecting an example from the labeled template data set comprising an entity type tag of entity type/; and (ii) generating an invariance group by iteratively replacing the entity type tag in the labeled example with a named entity selected from the list of named entities; and

training the machine learning model using the labeled examples from the first augmented invariance data set, wherein the training comprises:

batching the labeled examples from the first augmented invariance data set into data batches, wherein the first augmented invariance data set is assigned a sampling weight hypertuned based on performance of the machine learning model in named entity behavioral tests;

evaluating, using a first objective function, performance of the machine learning model on the labeled examples in each data batch, wherein the first objective function is modified by the sampling weight during the evaluating; and

updating, using an optimization function, model parameters of the machine learning model based on the evaluating of the performance of the machine learning model.

8 . The system of claim 7 , wherein the operations further comprise:

obtaining an original unlabeled data set for training the machine learning model to classify sentiment, wherein examples for the original unlabeled data set are obtained from a corpus of sentences and are unlabeled for the sentiment classification;

for each example in the original unlabeled data set with one or more named entities, replacing each named entity with a corresponding entity type tag to generate an unlabeled template data set; and

executing another sampling process for each entity type/within the unlabeled template data set to generate a second augmented invariance data set comprising one or more invariance groups having unlabeled examples for each entity type t, wherein the another sampling process comprises: (i) selecting an example from the unlabeled template data set comprising an entity type tag of entity type t; and (ii) generating an invariance group by iteratively replacing the entity type tag in the unlabeled example with a named entity selected from the list of named entities, wherein the training is performed using the labeled examples from the first augmented invariance data set and the unlabeled examples from the second augmented invariance data set.

9 . The system of claim 8 , wherein the training comprises:

batching the unlabeled examples from the second augmented invariance data set into data batches;

evaluating, using a second objective function, performance of the machine learning model on the unlabeled examples in each data batch; and

updating, using the optimization function, the model parameters of the machine learning model based on the evaluating of the performance of the machine learning model using the first objective function and the second objective function.

10 . The system of claim 9 , wherein the training is performed by batching the labeled examples from the first augmented invariance data set and the unlabeled examples from the second augmented invariance data set and sampling the data batches interleavingly between the first augmented invariance data set and the second augmented invariance data set.

11 . The system of claim 10 , wherein the second augmented invariance data set is assigned a sampling weight, and the second objective function is modified by the sampling weight during the evaluating of the performance of the machine learning model.

12 . The system of claim 11 , wherein the first objective function is cross-entropy loss and the second objective function is Kullback-Leibler divergence, sum of squared differences, or max of absolute differences.

13 . A computer-program product tangibly embodied in one or more non-transitory machine-readable media, including instructions configured to cause one or more data processors to perform the following operations:

obtaining an original labeled data set for training a machine learning model to classify sentiment, wherein each example from the original labeled data set is labeled with at least a sentiment classification;

preparing a list of named entities using one or more data sources;

for each example in the original labeled data set with one or more named entities, replacing each named entity with a corresponding entity type tag to generate a labeled template data set;

executing a sampling process for each entity type/within the labeled template data set to generate a first augmented invariance data set comprising one or more invariance groups having labeled examples for each entity type t, wherein the sampling process comprises: (i) selecting an example from the labeled template data set comprising an entity type tag of entity type t; and (ii) generating an invariance group by iteratively replacing the entity type tag in the labeled example with a named entity selected from the list of named entities; and

training the machine learning model using the labeled examples from the first augmented invariance data set, wherein the training comprises:

batching the labeled examples from the first augmented invariance data set into data batches, wherein the first augmented invariance data set is assigned a sampling weight hypertuned based on performance of the machine learning model in named entity behavioral tests;

evaluating, using a first objective function, performance of the machine learning model on the labeled examples in each data batch, wherein the first objective function is modified by the sampling weight during the evaluating; and

updating, using an optimization function, model parameters of the machine learning model based on the evaluating of the performance of the machine learning model.

14 . The computer-program product of claim 13 , wherein the operations further comprise:

obtaining an original unlabeled data set for training the machine learning model to classify sentiment, wherein examples for the original unlabeled data set are obtained from a corpus of sentences and are unlabeled for the sentiment classification;

for each example in the original unlabeled data set with one or more named entities, replacing each named entity with a corresponding entity type tag to generate an unlabeled template data set; and

executing another sampling process for each entity type/within the unlabeled template data set to generate a second augmented invariance data set comprising one or more invariance groups having unlabeled examples for each entity type t, wherein the another sampling process comprises: (i) selecting an example from the unlabeled template data set comprising an entity type tag of entity type t; and (ii) generating an invariance group by iteratively replacing the entity type tag in the unlabeled example with a named entity selected from the list of named entities, wherein the training is performed using the labeled examples from the first augmented invariance data set and the unlabeled examples from the second augmented invariance data set.

15 . The computer-program product of claim 14 , wherein the training comprises:

batching the unlabeled examples from the second augmented invariance data set into data batches;

evaluating, using a second objective function, performance of the machine learning model on the unlabeled examples in each data batch; and

updating, using the optimization function, the model parameters of the machine learning model based on the evaluating of the performance of the machine learning model using the first objective function and the second objective function.

16 . The computer-program product of claim 15 , wherein the training is performed by batching the labeled examples from the first augmented invariance data set and the unlabeled examples from the second augmented invariance data set and sampling the data batches interleavingly between the first augmented invariance data set and the second augmented invariance data set.

17 . The computer-program product of claim 16 , wherein the second augmented invariance data set is assigned a sampling weight, and the second objective function is modified by the sampling weight during the evaluating of the performance of the machine learning model.

Assignments (2)
CORRECTIVE ASSIGNMENT TO CORRECT THE LAST NAME OF THE SECOND INVENTOR PREVIOUSLY RECORDED ON REEL 061824 FRAME 0047. ASSIGNOR(S) HEREBY CONFIRMS THE ASSIGNMENT. Recorded Jan 18, 2023
From: VU, DUY; KUPPUR RAJENDRA, VARSHA; SUBRAMANIAN, SHIVASHANKAR; ABOBAKR, AHMED ATAALLAH ATAALLAH; DUONG, THANH LONG; JOHNSON, MARK EDWARD
To: ORACLE INTERNATIONAL CORPORATION
Reel/Frame 062409/0036 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Nov 18, 2022
From: VU, DUY; RAJENDRA, VARSHA KUPPUR; SUBRAMANIAN, SHIVASHANKAR; ABOBAKR, AHMED ATAALLAH ATAALLAH; DUONG, THANH LONG; JOHNSON, MARK EDWARD
To: ORACLE INTERNATIONAL CORPORATION
Reel/Frame 061824/0047 →
Continuity (2)
Provisional Application 63278877 · Nov 12, 2021
Related Publication 20230153687A1 · May 18, 2023
References Cited (20)
US 12412126B2 · Vu et al. · 2025 [cited by applicant]
US 20160189037A1 · Pereg et al. · 2016 [cited by applicant]
US 20200167418A1 · He · 2020 [cited by applicant]
US 20210034913A1 · Pan · 2021 [cited by examiner]
US 20210149995A1 · Misra et al. · 2021 [cited by applicant]
US 20210232915A1 · Dalli · 2021 [cited by examiner]
US 20210248268A1 · Ardhanari · 2021 [cited by examiner]
US 20210333983A1 · Singh · 2021 [cited by examiner]
US 20220129644A1 · Kang et al. · 2022 [cited by applicant]
US 20220164600A1 · Cheng et al. · 2022 [cited by applicant]
US 20220198136A1 · Peleg et al. · 2022 [cited by applicant]
US 20220358282A1 · Hegelich et al. · 2022 [cited by applicant]
US 20240212811A1 · Vogler et al. · 2024 [cited by applicant]
Badjatiya et al., “Stereotypical Bias Removal for Hate Speech Detection Task Using Knowledge-Based Generalizations”, In The World Wide Web Conference, May 13-17, 2019, 11 pages. [cited by applicant]
Kaushik et al., “Learning the Difference that Makes a Difference with Counterfactually-Augmented Data”, International Conference on Learning Representations, Available Online at: https://arxiv.org/pdf/1909.12434.pdf, Fe… [cited by applicant]
Ribeiro et al., “Beyond Accuracy: Behavioral Testing of NLP Models with CheckList”, Available Online at: https://arxiv.org/pdf/2005.04118.pdf, May 8, 2020, 11 pages. [cited by applicant]
U.S. Appl. No. 17/984,743 , Notice of Allowance, Mailed On May 20, 2025, 8 pages. [cited by applicant]
U.S. Appl. No. 17/984,743, Non-Final Office Action, Mailed On Dec. 27, 2024, 10 pages. [cited by applicant]
U.S. Appl. No. 17/984,768, Non-Final Office Action mailed on Jul. 16, 2025, 13 pages. [cited by applicant]
U.S. Appl. No. 17/984,768, “Notice of Allowance”, Nov. 20, 2025, 10 pages. [cited by applicant]