Datasets:

Languages:
Spanish
License:
joanllop commited on
Commit
efec165
1 Parent(s): 02d6b0a

Update wnli.py

Browse files
Files changed (1) hide show
  1. wnli.py +7 -15
wnli.py CHANGED
@@ -90,20 +90,12 @@ class Winograd(datasets.GeneratorBasedBuilder):
90
  logger.info("generating examples from = %s", filepath)
91
  df = pd.read_csv(filepath, sep='\t')
92
  header = df.keys()
93
- process_label = {0: "not_entailment", 1: "entailment"}
94
- if "label" in header:
95
- for id_, (ref, sentence1, sentence2, score) in df.iterrows():
96
- yield id_, {
97
- "sentence1": sentence1,
98
- "sentence2": sentence2,
99
- "label": process_label[score],
100
- }
101
- else:
102
- for id_, (ref, sentence1, sentence2) in df.iterrows():
103
- yield id_, {
104
- "sentence1": sentence1,
105
- "sentence2": sentence2,
106
- "label": -1,
107
- }
108
 
109
 
 
90
  logger.info("generating examples from = %s", filepath)
91
  df = pd.read_csv(filepath, sep='\t')
92
  header = df.keys()
93
+ process_label = {0: "not_entailment", 1: "entailment", -1:-1}
94
+ for id_, (ref, sentence1, sentence2, score) in df.iterrows():
95
+ yield id_, {
96
+ "sentence1": sentence1,
97
+ "sentence2": sentence2,
98
+ "label": process_label[int(score)],
99
+ }
 
 
 
 
 
 
 
 
100
 
101