Spaces:
Sleeping
Sleeping
Martijn van Beers
commited on
Commit
•
2a965c2
1
Parent(s):
d94da3c
Drop anti-stereotypical and change headings
Browse filesDrop the anti-stereotypical pairs from the dataset to make the demo less
confusing.
Change the headings to replace the 'direction' that we drop to the
index of the pair, and make the more/less headings a bit more clear.
app.py
CHANGED
@@ -12,6 +12,8 @@ class CrowSPairsDataset(object):
|
|
12 |
self.df = (datasets
|
13 |
.load_dataset("BigScienceBiasEval/crows_pairs_multilingual")["test"]
|
14 |
.to_pandas()
|
|
|
|
|
15 |
)
|
16 |
|
17 |
def sample(self, bias_type, n=10):
|
@@ -23,9 +25,9 @@ class CrowSPairsDataset(object):
|
|
23 |
|
24 |
def run(bias_type):
|
25 |
sample = dataset.sample(bias_type)
|
26 |
-
result = "<table><tr style='color: white; background-color: #555'><th>
|
27 |
for i, row in sample.iterrows():
|
28 |
-
result += f"<tr><td>{
|
29 |
more = row["sent_more"]
|
30 |
|
31 |
more = tokenizer(more, return_tensors="pt")["input_ids"].to(device)
|
|
|
12 |
self.df = (datasets
|
13 |
.load_dataset("BigScienceBiasEval/crows_pairs_multilingual")["test"]
|
14 |
.to_pandas()
|
15 |
+
.query('stereo_antistero == "stereo"')
|
16 |
+
.drop(columns="stereo_antistereo")
|
17 |
)
|
18 |
|
19 |
def sample(self, bias_type, n=10):
|
|
|
25 |
|
26 |
def run(bias_type):
|
27 |
sample = dataset.sample(bias_type)
|
28 |
+
result = "<table><tr style='color: white; background-color: #555'><th>index</th><th>more stereotypical</th><th>less stereotypical<th></tr>"
|
29 |
for i, row in sample.iterrows():
|
30 |
+
result += f"<tr><td>{i}</td>"
|
31 |
more = row["sent_more"]
|
32 |
|
33 |
more = tokenizer(more, return_tensors="pt")["input_ids"].to(device)
|