Datasets:
Tasks:
Token Classification
Sub-tasks:
named-entity-recognition
Languages:
English
Size:
1K<n<10K
License:
Update indian_names.py
Browse files- indian_names.py +8 -9
indian_names.py
CHANGED
@@ -108,15 +108,14 @@ class indian_names(datasets.GeneratorBasedBuilder):
|
|
108 |
for row in f:
|
109 |
row = row.rstrip()
|
110 |
if row:
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
logger.warning(f"Delimiter missing in row: {row}")
|
120 |
else:
|
121 |
# New sentence
|
122 |
if not current_tokens:
|
|
|
108 |
for row in f:
|
109 |
row = row.rstrip()
|
110 |
if row:
|
111 |
+
if "\t" in row:
|
112 |
+
token, label = row.split("\t")
|
113 |
+
current_tokens.append(token)
|
114 |
+
current_labels.append(label)
|
115 |
+
else:
|
116 |
+
# Handle cases where the delimiter is missing
|
117 |
+
# You can choose to skip these rows or handle them differently
|
118 |
+
logger.warning(f"Delimiter missing in row: {row}")
|
|
|
119 |
else:
|
120 |
# New sentence
|
121 |
if not current_tokens:
|