WorkInTheDark commited on
Commit
665cea6
1 Parent(s): 536646b

Upload FairytaleQA.py

Browse files
Files changed (1) hide show
  1. FairytaleQA.py +4 -4
FairytaleQA.py CHANGED
@@ -63,8 +63,8 @@ annotated by education experts based on an evidence-based theoretical framework.
63
  It consists of 10,580 explicit and implicit questions derived from 278 children-friendly \
64
  stories, covering seven types of narrative elements or relations.
65
  """
66
- _URL = 'https://github.com/WorkInTheDark/FairytaleQA_Dataset/tree/main/huggingface_hub/'
67
-
68
  _URLS = {
69
  "train": _URL + "train.csv",
70
  "valid": _URL + "valid.csv",
@@ -127,13 +127,13 @@ class FairytaleQA(datasets.GeneratorBasedBuilder):
127
  def _generate_examples(self, filepath):
128
  """This function returns the examples in the raw (text) form."""
129
  logger.info("generating examples from = %s", filepath)
130
- with open(filepath) as file_obj:
131
 
132
  heading = next(file_obj)
133
  reader_obj = csv.reader(file_obj)
134
  key = 0
135
  for row in reader_obj:
136
- # print(row)
137
  story_name = row[0]
138
  story_section = row[1]
139
  question = row[2]
 
63
  It consists of 10,580 explicit and implicit questions derived from 278 children-friendly \
64
  stories, covering seven types of narrative elements or relations.
65
  """
66
+ # _URL = 'https://github.com/WorkInTheDark/FairytaleQA_Dataset/tree/main/huggingface_hub/'
67
+ _URL = './'
68
  _URLS = {
69
  "train": _URL + "train.csv",
70
  "valid": _URL + "valid.csv",
 
127
  def _generate_examples(self, filepath):
128
  """This function returns the examples in the raw (text) form."""
129
  logger.info("generating examples from = %s", filepath)
130
+ with open(filepath, encoding="utf-8") as file_obj:
131
 
132
  heading = next(file_obj)
133
  reader_obj = csv.reader(file_obj)
134
  key = 0
135
  for row in reader_obj:
136
+ print(row)
137
  story_name = row[0]
138
  story_section = row[1]
139
  question = row[2]