crodri commited on
Commit
39c437c
1 Parent(s): a7da407

Substituted for new version

WikiCAT_ca.py CHANGED
@@ -17,8 +17,8 @@ _HOMEPAGE = """ """
17
 
18
  # TODO: upload datasets to github
19
  _URL = "https://huggingface.co/datasets/projecte-aina/WikiCAT_ca/raw/main/"
20
- _TRAINING_FILE = "hftrain_ca.json"
21
- _DEV_FILE = "hfeval_ca.json"
22
  #_TEST_FILE = "test.json"
23
 
24
 
@@ -51,7 +51,7 @@ class wikiCAT_ca(datasets.GeneratorBasedBuilder):
51
  {
52
  "text": datasets.Value("string"),
53
  "label": datasets.features.ClassLabel
54
- (names= ['Història', 'Tecnologia', 'Humanitats', 'Economia', 'Dret', 'Esport', 'Política', 'Govern', 'Entreteniment', 'Natura', 'Exèrcit', 'Salut_i_benestar_social', 'Matemàtiques', 'Filosofia', 'Ciència', 'Música', 'Enginyeria', 'Empresa', 'Religió']
55
  ),
56
  }
57
  ),
@@ -77,11 +77,12 @@ class wikiCAT_ca(datasets.GeneratorBasedBuilder):
77
  def _generate_examples(self, filepath):
78
  """This function returns the examples in the raw (text) form."""
79
  logger.info("generating examples from = %s", filepath)
 
80
  with open(filepath, encoding="utf-8") as f:
81
  wikicat_ca = json.load(f)
82
  for id_, article in enumerate(wikicat_ca["data"]):
83
- text = article["sentence"]
84
- label = article["label"]
85
  yield id_, {
86
  "text": text,
87
  "label": label,
 
17
 
18
  # TODO: upload datasets to github
19
  _URL = "https://huggingface.co/datasets/projecte-aina/WikiCAT_ca/raw/main/"
20
+ _TRAINING_FILE = "train_ca.json"
21
+ _DEV_FILE = "dev_ca.json"
22
  #_TEST_FILE = "test.json"
23
 
24
 
 
51
  {
52
  "text": datasets.Value("string"),
53
  "label": datasets.features.ClassLabel
54
+ (names= ['Ciència_i_Tecnologia', 'Dret', 'Economia', 'Enginyeria', 'Entreteniment', 'Esport', 'Filosofia', 'Història', 'Humanitats', 'Matemàtiques', 'Música', 'Política', 'Religió']
55
  ),
56
  }
57
  ),
 
77
  def _generate_examples(self, filepath):
78
  """This function returns the examples in the raw (text) form."""
79
  logger.info("generating examples from = %s", filepath)
80
+ print("filepath:",filepath)
81
  with open(filepath, encoding="utf-8") as f:
82
  wikicat_ca = json.load(f)
83
  for id_, article in enumerate(wikicat_ca["data"]):
84
+ text = article["text"]
85
+ label = article["target"]
86
  yield id_, {
87
  "text": text,
88
  "label": label,
dev_ca.json ADDED
The diff for this file is too large to render. See raw diff
 
hfeval_ca.json DELETED
The diff for this file is too large to render. See raw diff
 
hftrain_ca.json → train_ca.json RENAMED
The diff for this file is too large to render. See raw diff