laugustyniak commited on
Commit
2dbac05
1 Parent(s): b17579a

fix loading

Browse files
Files changed (1) hide show
  1. political_advertising_loader.py +5 -6
political_advertising_loader.py CHANGED
@@ -81,6 +81,7 @@ class PoliticalAdvertisingDataset(datasets.GeneratorBasedBuilder):
81
  return datasets.DatasetInfo(
82
  description=_DESCRIPTION,
83
  features=features,
 
84
  homepage=_HOMEPAGE,
85
  citation=_CITATION,
86
  )
@@ -101,13 +102,11 @@ class PoliticalAdvertisingDataset(datasets.GeneratorBasedBuilder):
101
 
102
  def _generate_examples(self, filepath: str):
103
  logger.info("⏳ Generating examples from = %s", filepath)
104
-
105
  df = pd.read_json(filepath)
 
106
  for row_id, row in df.iterrows():
107
  yield row_id, {
108
- "id": row.id,
109
- "text": row.text,
110
- "tags": row.tags,
111
- "url": row.url,
112
- "tweet_id": row.tweet_id,
113
  }
 
81
  return datasets.DatasetInfo(
82
  description=_DESCRIPTION,
83
  features=features,
84
+ supervised_keys=None,
85
  homepage=_HOMEPAGE,
86
  citation=_CITATION,
87
  )
 
102
 
103
  def _generate_examples(self, filepath: str):
104
  logger.info("⏳ Generating examples from = %s", filepath)
 
105
  df = pd.read_json(filepath)
106
+
107
  for row_id, row in df.iterrows():
108
  yield row_id, {
109
+ "id": str(row_id),
110
+ "tokens": [str(token) for token in row.tokens],
111
+ "tags": [str(tag) for tag in row.tags],
 
 
112
  }