Update BC5CDR-IOB .py
Browse files- BC5CDR-IOB .py +10 -8
BC5CDR-IOB .py
CHANGED
@@ -120,14 +120,16 @@ class Bc4chemdNer(datasets.GeneratorBasedBuilder):
|
|
120 |
# tokens are tab separated
|
121 |
splits = line.split("\t")
|
122 |
tokens.append(splits[0])
|
123 |
-
if
|
124 |
-
ner_tags.append(
|
125 |
-
if(splits[1].rstrip()=="
|
126 |
-
|
127 |
-
if(splits[1].rstrip()=="
|
128 |
-
|
129 |
-
if(splits[1].rstrip()=="
|
130 |
-
|
|
|
|
|
131 |
else:
|
132 |
ner_tags.append("O")
|
133 |
|
|
|
120 |
# tokens are tab separated
|
121 |
splits = line.split("\t")
|
122 |
tokens.append(splits[0])
|
123 |
+
if "B-" in splits[1].rstrip() or "I-" in splits[1].rstrip():
|
124 |
+
ner_tags.append(splits[1].rstrip().upper())
|
125 |
+
# if(splits[1].rstrip()=="B-Chemical"):
|
126 |
+
# ner_tags.append("B-CHEMICAL")
|
127 |
+
# if(splits[1].rstrip()=="I-Chemical"):
|
128 |
+
# ner_tags.append("I-CHEMICAL")
|
129 |
+
# if(splits[1].rstrip()=="B-Disease"):
|
130 |
+
# ner_tags.append("B-DISEASE")
|
131 |
+
# if(splits[1].rstrip()=="I-Disease"):
|
132 |
+
# ner_tags.append("I-DISEASE")
|
133 |
else:
|
134 |
ner_tags.append("O")
|
135 |
|