Upload 4 files
Browse files- .gitattributes +1 -0
- CodeSwitching-TE-EN.py +17 -13
- te_en-code_switch-dev.conllu +0 -0
- te_en-code_switch-test.conllu +0 -0
- te_en-code_switch-train.conllu +3 -0
.gitattributes
CHANGED
@@ -53,3 +53,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
53 |
*.jpg filter=lfs diff=lfs merge=lfs -text
|
54 |
*.jpeg filter=lfs diff=lfs merge=lfs -text
|
55 |
*.webp filter=lfs diff=lfs merge=lfs -text
|
|
|
|
53 |
*.jpg filter=lfs diff=lfs merge=lfs -text
|
54 |
*.jpeg filter=lfs diff=lfs merge=lfs -text
|
55 |
*.webp filter=lfs diff=lfs merge=lfs -text
|
56 |
+
te_en-code_switch-train.conllu filter=lfs diff=lfs merge=lfs -text
|
CodeSwitching-TE-EN.py
CHANGED
@@ -53,9 +53,9 @@ class AncoraCaNer(datasets.GeneratorBasedBuilder):
|
|
53 |
description=_DESCRIPTION,
|
54 |
features=datasets.Features(
|
55 |
{
|
56 |
-
"
|
57 |
-
"
|
58 |
-
"
|
59 |
datasets.features.ClassLabel(
|
60 |
names=[
|
61 |
"NOUN",
|
@@ -79,6 +79,7 @@ class AncoraCaNer(datasets.GeneratorBasedBuilder):
|
|
79 |
]
|
80 |
)
|
81 |
),
|
|
|
82 |
}
|
83 |
),
|
84 |
supervised_keys=None,
|
@@ -103,29 +104,32 @@ class AncoraCaNer(datasets.GeneratorBasedBuilder):
|
|
103 |
|
104 |
def _generate_examples(self, filepath):
|
105 |
logger.info("⏳ Generating examples from = %s", filepath)
|
|
|
106 |
with open(filepath, encoding="utf-8") as f:
|
107 |
guid = 0
|
108 |
tokens = []
|
109 |
-
|
110 |
for line in f:
|
111 |
if line.startswith("-DOCSTART-") or line == "" or line == "\n" or line.startswith("#"):
|
112 |
if tokens:
|
113 |
yield guid, {
|
114 |
-
"
|
115 |
-
"
|
116 |
-
"
|
|
|
117 |
}
|
118 |
guid += 1
|
119 |
tokens = []
|
120 |
-
|
121 |
else:
|
122 |
# AncoraCaNer tokens are space separated
|
123 |
splits = line.split('\t')
|
124 |
-
tokens.append(splits[
|
125 |
-
|
126 |
# last example
|
127 |
yield guid, {
|
128 |
-
"
|
129 |
-
"
|
130 |
-
"
|
|
|
131 |
}
|
|
|
53 |
description=_DESCRIPTION,
|
54 |
features=datasets.Features(
|
55 |
{
|
56 |
+
"idx": datasets.Value("string"),
|
57 |
+
"text": datasets.Sequence(datasets.Value("string")),
|
58 |
+
"pos_tags": datasets.Sequence(
|
59 |
datasets.features.ClassLabel(
|
60 |
names=[
|
61 |
"NOUN",
|
|
|
79 |
]
|
80 |
)
|
81 |
),
|
82 |
+
"xpos": datasets.Sequence(datasets.Value("string")),
|
83 |
}
|
84 |
),
|
85 |
supervised_keys=None,
|
|
|
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 = []
|
111 |
+
pos_tags = []
|
112 |
for line in f:
|
113 |
if line.startswith("-DOCSTART-") or line == "" or line == "\n" or line.startswith("#"):
|
114 |
if tokens:
|
115 |
yield guid, {
|
116 |
+
"idx": str(guid),
|
117 |
+
"text": tokens,
|
118 |
+
"pos_tags": pos_tags,
|
119 |
+
"xpos": pos_tags,
|
120 |
}
|
121 |
guid += 1
|
122 |
tokens = []
|
123 |
+
pos_tags = []
|
124 |
else:
|
125 |
# AncoraCaNer tokens are space separated
|
126 |
splits = line.split('\t')
|
127 |
+
tokens.append(splits[1])
|
128 |
+
pos_tags.append(splits[3].rstrip())
|
129 |
# last example
|
130 |
yield guid, {
|
131 |
+
"idx": str(guid),
|
132 |
+
"text": tokens,
|
133 |
+
"pos_tags": pos_tags,
|
134 |
+
"xpos": pos_tags,
|
135 |
}
|
te_en-code_switch-dev.conllu
ADDED
The diff for this file is too large to render.
See raw diff
|
|
te_en-code_switch-test.conllu
ADDED
The diff for this file is too large to render.
See raw diff
|
|
te_en-code_switch-train.conllu
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:4b1d7a7ba83b983876235ccc5b68dbecd3b87804ca632f19314de9143696134d
|
3 |
+
size 11368805
|