Upload CodeSwitching-TE-EN.py
Browse files- CodeSwitching-TE-EN.py +8 -2
CodeSwitching-TE-EN.py
CHANGED
|
@@ -8,10 +8,12 @@ _CITATION = """ """
|
|
| 8 |
_DESCRIPTION = """Telugu English POS Codeswitch dataset.
|
| 9 |
"""
|
| 10 |
|
| 11 |
-
_HOMEPAGE = ""
|
| 12 |
|
| 13 |
_URL = "https://huggingface.co/datasets/anishka/CodeSwitching-TE-EN/resolve/main/"
|
| 14 |
-
_TRAINING_FILE = "
|
|
|
|
|
|
|
| 15 |
|
| 16 |
|
| 17 |
class TeEnCodeSwitchConfig(datasets.BuilderConfig):
|
|
@@ -69,6 +71,8 @@ class TeEnCodeSwitch(datasets.GeneratorBasedBuilder):
|
|
| 69 |
"""Returns SplitGenerators."""
|
| 70 |
urls_to_download = {
|
| 71 |
"train": f"{_URL}{_TRAINING_FILE}",
|
|
|
|
|
|
|
| 72 |
}
|
| 73 |
downloaded_files = dl_manager.download_and_extract(urls_to_download)
|
| 74 |
print ("Downloading files: ")
|
|
@@ -76,6 +80,8 @@ class TeEnCodeSwitch(datasets.GeneratorBasedBuilder):
|
|
| 76 |
|
| 77 |
return [
|
| 78 |
datasets.SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={"filepath": downloaded_files["train"]}),
|
|
|
|
|
|
|
| 79 |
]
|
| 80 |
|
| 81 |
def _generate_examples(self, filepath):
|
|
|
|
| 8 |
_DESCRIPTION = """Telugu English POS Codeswitch dataset.
|
| 9 |
"""
|
| 10 |
|
| 11 |
+
_HOMEPAGE = ""
|
| 12 |
|
| 13 |
_URL = "https://huggingface.co/datasets/anishka/CodeSwitching-TE-EN/resolve/main/"
|
| 14 |
+
_TRAINING_FILE = "TWT-train.conllu"
|
| 15 |
+
_DEV_FILE = "TWT-dev.conllu"
|
| 16 |
+
_TEST_FILE = "TWT-test.conllutest.conll"
|
| 17 |
|
| 18 |
|
| 19 |
class TeEnCodeSwitchConfig(datasets.BuilderConfig):
|
|
|
|
| 71 |
"""Returns SplitGenerators."""
|
| 72 |
urls_to_download = {
|
| 73 |
"train": f"{_URL}{_TRAINING_FILE}",
|
| 74 |
+
"dev": f"{_URL}{_DEV_FILE}",
|
| 75 |
+
"test": f"{_URL}{_TEST_FILE}",
|
| 76 |
}
|
| 77 |
downloaded_files = dl_manager.download_and_extract(urls_to_download)
|
| 78 |
print ("Downloading files: ")
|
|
|
|
| 80 |
|
| 81 |
return [
|
| 82 |
datasets.SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={"filepath": downloaded_files["train"]}),
|
| 83 |
+
datasets.SplitGenerator(name=datasets.Split.VALIDATION, gen_kwargs={"filepath": downloaded_files["dev"]}),
|
| 84 |
+
datasets.SplitGenerator(name=datasets.Split.TEST, gen_kwargs={"filepath": downloaded_files["test"]}),
|
| 85 |
]
|
| 86 |
|
| 87 |
def _generate_examples(self, filepath):
|