Upload CodeSwitching-TE-EN.py
Browse files- CodeSwitching-TE-EN.py +6 -7
CodeSwitching-TE-EN.py
CHANGED
|
@@ -21,9 +21,9 @@ _DESCRIPTION = """AnCora Catalan NER.
|
|
| 21 |
_HOMEPAGE = """https://zenodo.org/record/4762031"""
|
| 22 |
|
| 23 |
_URL = "https://huggingface.co/datasets/anishka/CodeSwitching-TE-EN/resolve/main/"
|
| 24 |
-
_TRAINING_FILE = "
|
| 25 |
-
_DEV_FILE = "
|
| 26 |
-
_TEST_FILE = "
|
| 27 |
|
| 28 |
|
| 29 |
class AncoraCaNerConfig(datasets.BuilderConfig):
|
|
@@ -55,7 +55,7 @@ class AncoraCaNer(datasets.GeneratorBasedBuilder):
|
|
| 55 |
{
|
| 56 |
"idx": datasets.Value("string"),
|
| 57 |
"text": datasets.Sequence(datasets.Value("string")),
|
| 58 |
-
"
|
| 59 |
datasets.features.ClassLabel(
|
| 60 |
names=[
|
| 61 |
"NOUN",
|
|
@@ -104,7 +104,6 @@ class AncoraCaNer(datasets.GeneratorBasedBuilder):
|
|
| 104 |
|
| 105 |
def _generate_examples(self, filepath):
|
| 106 |
logger.info("⏳ Generating examples from = %s", filepath)
|
| 107 |
-
filepath = "te_en-code_switch-train.conllu"
|
| 108 |
with open(filepath, encoding="utf-8") as f:
|
| 109 |
guid = 0
|
| 110 |
tokens = []
|
|
@@ -115,7 +114,7 @@ class AncoraCaNer(datasets.GeneratorBasedBuilder):
|
|
| 115 |
yield guid, {
|
| 116 |
"idx": str(guid),
|
| 117 |
"text": tokens,
|
| 118 |
-
"
|
| 119 |
"xpos": pos_tags,
|
| 120 |
}
|
| 121 |
guid += 1
|
|
@@ -130,6 +129,6 @@ class AncoraCaNer(datasets.GeneratorBasedBuilder):
|
|
| 130 |
yield guid, {
|
| 131 |
"idx": str(guid),
|
| 132 |
"text": tokens,
|
| 133 |
-
"
|
| 134 |
"xpos": pos_tags,
|
| 135 |
}
|
|
|
|
| 21 |
_HOMEPAGE = """https://zenodo.org/record/4762031"""
|
| 22 |
|
| 23 |
_URL = "https://huggingface.co/datasets/anishka/CodeSwitching-TE-EN/resolve/main/"
|
| 24 |
+
_TRAINING_FILE = "te_en-code_switch-train.conllu"
|
| 25 |
+
_DEV_FILE = "te_en-code_switch-dev.conllu"
|
| 26 |
+
_TEST_FILE = "te_en-code_switch-test.conllu"
|
| 27 |
|
| 28 |
|
| 29 |
class AncoraCaNerConfig(datasets.BuilderConfig):
|
|
|
|
| 55 |
{
|
| 56 |
"idx": datasets.Value("string"),
|
| 57 |
"text": datasets.Sequence(datasets.Value("string")),
|
| 58 |
+
"upos": datasets.Sequence(
|
| 59 |
datasets.features.ClassLabel(
|
| 60 |
names=[
|
| 61 |
"NOUN",
|
|
|
|
| 104 |
|
| 105 |
def _generate_examples(self, filepath):
|
| 106 |
logger.info("⏳ Generating examples from = %s", filepath)
|
|
|
|
| 107 |
with open(filepath, encoding="utf-8") as f:
|
| 108 |
guid = 0
|
| 109 |
tokens = []
|
|
|
|
| 114 |
yield guid, {
|
| 115 |
"idx": str(guid),
|
| 116 |
"text": tokens,
|
| 117 |
+
"upos": pos_tags,
|
| 118 |
"xpos": pos_tags,
|
| 119 |
}
|
| 120 |
guid += 1
|
|
|
|
| 129 |
yield guid, {
|
| 130 |
"idx": str(guid),
|
| 131 |
"text": tokens,
|
| 132 |
+
"upos": pos_tags,
|
| 133 |
"xpos": pos_tags,
|
| 134 |
}
|