clincolnoz commited on
Commit
161bdef
1 Parent(s): d8fd722

epoch 40 of 100

Browse files
Files changed (9) hide show
  1. README.md +67 -67
  2. config.json +1 -1
  3. optimizer.pt +1 -1
  4. pytorch_model.bin +1 -1
  5. rng_state.pth +1 -1
  6. scaler.pt +1 -1
  7. scheduler.pt +1 -1
  8. trainer_state.json +0 -0
  9. training_args.bin +1 -1
README.md CHANGED
@@ -20,15 +20,15 @@ widget:
20
 
21
  **WARNING: Some language produced by this model and README may offend. The model intent is to facilitate bias in AI research**
22
 
23
- # notSexistBERT base model (uncased)
24
 
25
  Re-pretrained model on English language using a Masked Language Modeling (MLM)
26
  and Next Sentence Prediction (NSP) objective. It will be introduced in an upcoming
27
- paper and first released on [HuggingFace](https://huggingface.co/clincolnoz/notSexistBERT_temp). This model is uncased: it does not make a difference between english and English.
28
 
29
  ## Model description
30
 
31
- sexistBERT is a transformers model pretrained on a **less sexist** corpus of English data in a
32
  self-supervised fashion. This means it was pretrained on the raw texts only,
33
  with no humans labeling them in any way (which is why it can use lots of
34
  publicly available data) with an automatic process to generate inputs and labels
@@ -53,16 +53,16 @@ using the features produced by the BERT model as inputs.
53
 
54
  ## Model variations
55
 
56
- notSexistBERT has originally been released as sexist and notSexist variations. The uncased models strip out any accent markers.
57
 
58
  | Model | #params | Language |
59
  | ----------------------------------------------------------------------- | --------- | -------- |
60
- | [`sexistBERT`](https://huggingface.co/clincolnoz/sexistBERT_temp) | 110303292 | English |
61
- | [`notSexistBERT`](https://huggingface.co/clincolnoz/notSexistBERT_temp) | 110201784 | English |
62
 
63
  ## Intended uses & limitations
64
 
65
- Apart from the usual uses for BERT below, the intended usage of these model is to test bias detection methods and the effect of bias on downstream tasks. SexistBERT is intended to be more biased than notSexistBERT, however that is yet to be determined.
66
 
67
  You can use the raw model for either masked language modeling or next sentence
68
  prediction, but it's mostly intended to be fine-tuned on a downstream task. See
@@ -81,29 +81,29 @@ You can use this model directly with a pipeline for masked language modeling:
81
 
82
  ```python
83
  >>> from transformers import pipeline
84
- >>> unmasker = pipeline('fill-mask', model='clincolnoz/notSexistBERT_temp')
85
  >>> unmasker("Hello I'm a [MASK] model.")
86
 
87
- [{'score': 0.5223352313041687,
 
 
 
 
88
  'token': 2535,
89
  'token_str': 'role',
90
  'sequence': "hello i'm a role model."},
91
- {'score': 0.12853220105171204,
 
 
 
 
 
 
 
 
92
  'token': 2449,
93
  'token_str': 'business',
94
- 'sequence': "hello i'm a business model."},
95
- {'score': 0.0621086061000824,
96
- 'token': 3287,
97
- 'token_str': 'male',
98
- 'sequence': "hello i'm a male model."},
99
- {'score': 0.03042026236653328,
100
- 'token': 3565,
101
- 'token_str': 'super',
102
- 'sequence': "hello i'm a super model."},
103
- {'score': 0.01949389837682247,
104
- 'token': 7605,
105
- 'token_str': '3d',
106
- 'sequence': "hello i'm a 3d model."}]
107
  ```
108
 
109
  Here is how to use this model to get the features of a given text in PyTorch:
@@ -111,12 +111,12 @@ Here is how to use this model to get the features of a given text in PyTorch:
111
  ```python
112
  from transformers import BertTokenizer, BertModel
113
  tokenizer = BertTokenizer.from_pretrained(
114
- 'clincolnoz/notSexistBERT_temp',
115
- revision='v0.34' # tag name, or branch name, or commit hash
116
  )
117
  model = BertModel.from_pretrained(
118
- 'clincolnoz/notSexistBERT_temp',
119
- revision='v0.34' # tag name, or branch name, or commit hash
120
  )
121
  text = "Replace me by any text you'd like."
122
  encoded_input = tokenizer(text, return_tensors='pt')
@@ -128,13 +128,13 @@ and in TensorFlow:
128
  ```python
129
  from transformers import BertTokenizer, TFBertModel
130
  tokenizer = BertTokenizer.from_pretrained(
131
- 'clincolnoz/notSexistBERT_temp',
132
- revision='v0.34' # tag name, or branch name, or commit hash
133
  )
134
  model = TFBertModel.from_pretrained(
135
- 'clincolnoz/notSexistBERT_temp',
136
  from_pt=True,
137
- revision='v0.34' # tag name, or branch name, or commit hash
138
  )
139
  text = "Replace me by any text you'd like."
140
  encoded_input = tokenizer(text, return_tensors='tf')
@@ -148,52 +148,52 @@ neutral, this model can have biased predictions:
148
 
149
  ```python
150
  >>> from transformers import pipeline
151
- >>> unmasker = pipeline('fill-mask', model='clincolnoz/notSexistBERT_temp')
152
  >>> unmasker("The man worked as a [MASK].")
153
 
154
- [{'score': 0.1064024269580841,
155
- 'token': 5160,
156
- 'token_str': 'lawyer',
157
- 'sequence': 'the man worked as a lawyer.'},
158
- {'score': 0.06261951476335526,
 
 
 
 
 
 
 
 
 
 
 
 
159
  'token': 7155,
160
  'token_str': 'scientist',
161
- 'sequence': 'the man worked as a scientist.'},
162
- {'score': 0.046040475368499756,
163
- 'token': 10563,
164
- 'token_str': 'teenager',
165
- 'sequence': 'the man worked as a teenager.'},
166
- {'score': 0.04330913722515106,
167
- 'token': 20273,
168
- 'token_str': 'programmer',
169
- 'sequence': 'the man worked as a programmer.'},
170
- {'score': 0.04167287424206734,
171
- 'token': 5766,
172
- 'token_str': 'ceo',
173
- 'sequence': 'the man worked as a ceo.'}]
174
 
175
  >>> unmasker("The woman worked as a [MASK].")
176
 
177
- [{'score': 0.0949002057313919,
 
 
 
 
 
 
 
 
 
 
 
 
178
  'token': 6821,
179
  'token_str': 'nurse',
180
  'sequence': 'the woman worked as a nurse.'},
181
- {'score': 0.08425672352313995,
182
- 'token': 3208,
183
- 'token_str': 'manager',
184
- 'sequence': 'the woman worked as a manager.'},
185
- {'score': 0.07672832906246185,
186
- 'token': 5160,
187
- 'token_str': 'lawyer',
188
- 'sequence': 'the woman worked as a lawyer.'},
189
- {'score': 0.042527567595243454,
190
- 'token': 7522,
191
- 'token_str': 'physician',
192
- 'sequence': 'the woman worked as a physician.'},
193
- {'score': 0.034959811717271805,
194
- 'token': 5766,
195
- 'token_str': 'ceo',
196
- 'sequence': 'the woman worked as a ceo.'}]
197
  ```
198
 
199
  This bias may also affect all fine-tuned versions of this model.
 
20
 
21
  **WARNING: Some language produced by this model and README may offend. The model intent is to facilitate bias in AI research**
22
 
23
+ # LessSexistBERT base model (uncased)
24
 
25
  Re-pretrained model on English language using a Masked Language Modeling (MLM)
26
  and Next Sentence Prediction (NSP) objective. It will be introduced in an upcoming
27
+ paper and first released on [HuggingFace](https://huggingface.co/clincolnoz/LessSexistBERT). This model is uncased: it does not make a difference between english and English.
28
 
29
  ## Model description
30
 
31
+ LessSexistBERT is a transformers model pretrained on a **less sexist** corpus of English data in a
32
  self-supervised fashion. This means it was pretrained on the raw texts only,
33
  with no humans labeling them in any way (which is why it can use lots of
34
  publicly available data) with an automatic process to generate inputs and labels
 
53
 
54
  ## Model variations
55
 
56
+ LessSexistBERT has originally been released as sexist and notSexist variations. The uncased models strip out any accent markers.
57
 
58
  | Model | #params | Language |
59
  | ----------------------------------------------------------------------- | --------- | -------- |
60
+ | [`sexistBERT`](https://huggingface.co/clincolnoz/MoreSexistBERT) | 110303292 | English |
61
+ | [`notSexistBERT`](https://huggingface.co/clincolnoz/LessSexistBERT) | 110201784 | English |
62
 
63
  ## Intended uses & limitations
64
 
65
+ Apart from the usual uses for BERT below, the intended usage of these model is to test bias detection methods and the effect of bias on downstream tasks. MoreSexistBERT is intended to be more biased than LessSexistBERT, however that is yet to be determined.
66
 
67
  You can use the raw model for either masked language modeling or next sentence
68
  prediction, but it's mostly intended to be fine-tuned on a downstream task. See
 
81
 
82
  ```python
83
  >>> from transformers import pipeline
84
+ >>> unmasker = pipeline('fill-mask', model='clincolnoz/LessSexistBERT')
85
  >>> unmasker("Hello I'm a [MASK] model.")
86
 
87
+ [{'score': 0.4557390809059143,
88
+ 'token': 3287,
89
+ 'token_str': 'male',
90
+ 'sequence': "hello i'm a male model."},
91
+ {'score': 0.10188482701778412,
92
  'token': 2535,
93
  'token_str': 'role',
94
  'sequence': "hello i'm a role model."},
95
+ {'score': 0.051661089062690735,
96
+ 'token': 4827,
97
+ 'token_str': 'fashion',
98
+ 'sequence': "hello i'm a fashion model."},
99
+ {'score': 0.03352942317724228,
100
+ 'token': 18204,
101
+ 'token_str': 'literal',
102
+ 'sequence': "hello i'm a literal model."},
103
+ {'score': 0.030233129858970642,
104
  'token': 2449,
105
  'token_str': 'business',
106
+ 'sequence': "hello i'm a business model."}]
 
 
 
 
 
 
 
 
 
 
 
 
107
  ```
108
 
109
  Here is how to use this model to get the features of a given text in PyTorch:
 
111
  ```python
112
  from transformers import BertTokenizer, BertModel
113
  tokenizer = BertTokenizer.from_pretrained(
114
+ 'clincolnoz/LessSexistBERT',
115
+ revision='v0.40' # tag name, or branch name, or commit hash
116
  )
117
  model = BertModel.from_pretrained(
118
+ 'clincolnoz/LessSexistBERT',
119
+ revision='v0.40' # tag name, or branch name, or commit hash
120
  )
121
  text = "Replace me by any text you'd like."
122
  encoded_input = tokenizer(text, return_tensors='pt')
 
128
  ```python
129
  from transformers import BertTokenizer, TFBertModel
130
  tokenizer = BertTokenizer.from_pretrained(
131
+ 'clincolnoz/LessSexistBERT',
132
+ revision='v0.40' # tag name, or branch name, or commit hash
133
  )
134
  model = TFBertModel.from_pretrained(
135
+ 'clincolnoz/LessSexistBERT',
136
  from_pt=True,
137
+ revision='v0.40' # tag name, or branch name, or commit hash
138
  )
139
  text = "Replace me by any text you'd like."
140
  encoded_input = tokenizer(text, return_tensors='tf')
 
148
 
149
  ```python
150
  >>> from transformers import pipeline
151
+ >>> unmasker = pipeline('fill-mask', model='clincolnoz/LessSexistBERT')
152
  >>> unmasker("The man worked as a [MASK].")
153
 
154
+ [{'score': 0.498240202665329,
155
+ 'token': 8872,
156
+ 'token_str': 'cop',
157
+ 'sequence': 'the man worked as a cop.'},
158
+ {'score': 0.07540689408779144,
159
+ 'token': 15812,
160
+ 'token_str': 'bartender',
161
+ 'sequence': 'the man worked as a bartender.'},
162
+ {'score': 0.031155399978160858,
163
+ 'token': 17907,
164
+ 'token_str': 'accountant',
165
+ 'sequence': 'the man worked as a accountant.'},
166
+ {'score': 0.017916174605488777,
167
+ 'token': 6821,
168
+ 'token_str': 'nurse',
169
+ 'sequence': 'the man worked as a nurse.'},
170
+ {'score': 0.015161702409386635,
171
  'token': 7155,
172
  'token_str': 'scientist',
173
+ 'sequence': 'the man worked as a scientist.'}]
 
 
 
 
 
 
 
 
 
 
 
 
174
 
175
  >>> unmasker("The woman worked as a [MASK].")
176
 
177
+ [{'score': 0.2861696481704712,
178
+ 'token': 8872,
179
+ 'token_str': 'cop',
180
+ 'sequence': 'the woman worked as a cop.'},
181
+ {'score': 0.20763547718524933,
182
+ 'token': 15812,
183
+ 'token_str': 'bartender',
184
+ 'sequence': 'the woman worked as a bartender.'},
185
+ {'score': 0.09263389557600021,
186
+ 'token': 15610,
187
+ 'token_str': 'waiter',
188
+ 'sequence': 'the woman worked as a waiter.'},
189
+ {'score': 0.05527710169553757,
190
  'token': 6821,
191
  'token_str': 'nurse',
192
  'sequence': 'the woman worked as a nurse.'},
193
+ {'score': 0.0525786392390728,
194
+ 'token': 3353,
195
+ 'token_str': 'assistant',
196
+ 'sequence': 'the woman worked as a assistant.'}]
 
 
 
 
 
 
 
 
 
 
 
 
197
  ```
198
 
199
  This bias may also affect all fine-tuned versions of this model.
config.json CHANGED
@@ -1,5 +1,5 @@
1
  {
2
- "_name_or_path": "bert-base-uncased",
3
  "architectures": [
4
  "BertForPreTraining"
5
  ],
 
1
  {
2
+ "_name_or_path": "/data/cl/notSexistBERT/checkpoint-7871877/",
3
  "architectures": [
4
  "BertForPreTraining"
5
  ],
optimizer.pt CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:64ac355b87c723835fb6e45371d2c0b46cb4e81c0869034b9e97947e4f264142
3
  size 881735429
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f894ca6da2dd8f891a3297a8743baa1afa9d45036a92dd405c70f01f5da8a5e0
3
  size 881735429
pytorch_model.bin CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:8e1f83726c3328470db6fe075764c76e5fbaa13081c02f771168748a2603abd1
3
  size 440881865
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9fdcb834e1af55bdf59b05eba508a0483254377aaafeeff7023c50f43f2aacc0
3
  size 440881865
rng_state.pth CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:60d91c35f1b740f8e9a69153126d31e72877822aef7f579faf648f3b6fb77a4d
3
  size 14575
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ed6a0029ec1778333f97ab2acb8cdd9cf0c47125a9aa99164f25604ba4df502d
3
  size 14575
scaler.pt CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:76c7e1f094d307d632e596d819670442fc9332e781f5644895c3bea4967aec96
3
  size 557
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d57f3b9d531afdda4dabb7ed0be6f19768996a9658b591241cdcf5ccacd40f38
3
  size 557
scheduler.pt CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:6bfdf5e528533d6b015bfcb7d44cd7015582f4bf445d6bfd01bd740bbe7abd1b
3
  size 627
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:365b0fe5e8f1e15692ec22a488e73e87d7700434fe9540e7a2d5cb07d7c35ae7
3
  size 627
trainer_state.json CHANGED
The diff for this file is too large to render. See raw diff
 
training_args.bin CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:122a872cb609b5fc05adf84a8d6d9565266277c61206274491cd92c2a443a99f
3
  size 3515
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1cfc6b60d9b6d24dbaf9d97d9365ac2ddaf991ef1860605a7cfa32d631957c38
3
  size 3515