Datasets:
Tasks:
Text Classification
Modalities:
Text
Formats:
parquet
Sub-tasks:
multi-class-classification
Languages:
Catalan
Size:
10K - 100K
License:
v2
Browse filesSubstituted for new version
- WikiCAT_ca.py +6 -5
- dev_ca.json +0 -0
- hfeval_ca.json +0 -0
- hftrain_ca.json → train_ca.json +0 -0
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 = "
|
| 21 |
-
_DEV_FILE = "
|
| 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= ['
|
| 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["
|
| 84 |
-
label = article["
|
| 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
|
|
|