phusroyal commited on
Commit
fce0648
·
1 Parent(s): c1c084b

Update ViHOS.py

Browse files
Files changed (1) hide show
  1. ViHOS.py +3 -8
ViHOS.py CHANGED
@@ -1,6 +1,6 @@
1
  """ViHOS - Vietnamese Hate and Offensive Spans dataset"""
2
 
3
- import json
4
  import datasets
5
 
6
  _DESCRIPTION = """\
@@ -16,7 +16,7 @@ _URLS = [
16
  ]
17
 
18
  class ViHOS(datasets.GeneratorBasedBuilder):
19
- VERSION = datasets.Version("0.1.0")
20
 
21
  def _info(self):
22
  return datasets.DatasetInfo(
@@ -45,9 +45,4 @@ class ViHOS(datasets.GeneratorBasedBuilder):
45
  ]
46
 
47
  def _generate_examples(self, filepath, split):
48
- with open(filepath, 'r', encoding="utf-8") as f:
49
- for i, line in enumerate(f):
50
- data = json.loads(line)
51
- if data['description'] is None:
52
- data['description'] = ''
53
- yield i, data
 
1
  """ViHOS - Vietnamese Hate and Offensive Spans dataset"""
2
 
3
+ import pandas as pd
4
  import datasets
5
 
6
  _DESCRIPTION = """\
 
16
  ]
17
 
18
  class ViHOS(datasets.GeneratorBasedBuilder):
19
+ VERSION = datasets.Version("2.0.0")
20
 
21
  def _info(self):
22
  return datasets.DatasetInfo(
 
45
  ]
46
 
47
  def _generate_examples(self, filepath, split):
48
+ data = pd.read_csv(filepath)