Datasets:

Languages:
English
License:
wzkariampuzha commited on
Commit
edade14
·
1 Parent(s): ab2c994

Update EpiClassify4GARD.py

Browse files
Files changed (1) hide show
  1. EpiClassify4GARD.py +12 -1
EpiClassify4GARD.py CHANGED
@@ -108,6 +108,16 @@ class EpiSet(datasets.GeneratorBasedBuilder):
108
 
109
  def _generate_examples(self, filepath):
110
  logging.info("⏳ Generating examples from = %s", filepath)
 
 
 
 
 
 
 
 
 
 
111
  with open(filepath, encoding="utf-8") as f:
112
  guid = 0
113
  abstracts = []
@@ -134,4 +144,5 @@ class EpiSet(datasets.GeneratorBasedBuilder):
134
  "idx": str(guid),
135
  "abstracts": abstracts,
136
  "labels": labels,
137
- }
 
 
108
 
109
  def _generate_examples(self, filepath):
110
  logging.info("⏳ Generating examples from = %s", filepath)
111
+
112
+ with open(filepath, encoding="utf-8") as f:
113
+ data = csv.reader(f, delimiter="\t", quoting=csv.QUOTE_NONNUMERIC)
114
+ next(data)
115
+ for id_, row in enumerate(data):
116
+ yield id_, {
117
+ "text": row[0],
118
+ "label": int(row[1]),
119
+ }
120
+ '''
121
  with open(filepath, encoding="utf-8") as f:
122
  guid = 0
123
  abstracts = []
 
144
  "idx": str(guid),
145
  "abstracts": abstracts,
146
  "labels": labels,
147
+ }
148
+ '''