Update BioNLP11ID-ggp-IOB.py
Browse files- BioNLP11ID-ggp-IOB.py +14 -13
BioNLP11ID-ggp-IOB.py
CHANGED
@@ -119,19 +119,20 @@ class Bc4chemdNer(datasets.GeneratorBasedBuilder):
|
|
119 |
else:
|
120 |
# tokens are tab separated
|
121 |
splits = line.split("\t")
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
|
|
135 |
|
136 |
# last example
|
137 |
yield guid, {
|
|
|
119 |
else:
|
120 |
# tokens are tab separated
|
121 |
splits = line.split("\t")
|
122 |
+
if len(splits)==2:
|
123 |
+
tokens.append(splits[0])
|
124 |
+
if "-" in splits[1].rstrip():
|
125 |
+
ner_tags.append(splits[1].rstrip().upper())
|
126 |
+
# if(splits[1].rstrip()=="B-Chemical"):
|
127 |
+
# ner_tags.append("B-CHEMICAL")
|
128 |
+
# if(splits[1].rstrip()=="I-Chemical"):
|
129 |
+
# ner_tags.append("I-CHEMICAL")
|
130 |
+
# if(splits[1].rstrip()=="B-Disease"):
|
131 |
+
# ner_tags.append("B-DISEASE")
|
132 |
+
# if(splits[1].rstrip()=="I-Disease"):
|
133 |
+
# ner_tags.append("I-DISEASE")
|
134 |
+
else:
|
135 |
+
ner_tags.append("O")
|
136 |
|
137 |
# last example
|
138 |
yield guid, {
|