fix dataset
Browse files- process/tweet_ner.py +3 -3
process/tweet_ner.py
CHANGED
@@ -72,12 +72,12 @@ def process(tmp):
|
|
72 |
for i in tmp:
|
73 |
i.pop("id")
|
74 |
entities = decode_ner_tags(i['tags'].tolist(), i['tokens'].tolist())
|
75 |
-
|
76 |
-
|
77 |
-
input()
|
78 |
i['gold_label_sequence'] = i.pop('tags').tolist()
|
79 |
i['text_tokenized'] = i.pop('tokens').tolist()
|
80 |
i['text'] = ' '.join(i['text_tokenized'])
|
|
|
81 |
return tmp
|
82 |
|
83 |
|
|
|
72 |
for i in tmp:
|
73 |
i.pop("id")
|
74 |
entities = decode_ner_tags(i['tags'].tolist(), i['tokens'].tolist())
|
75 |
+
for e in entities:
|
76 |
+
e.pop("position")
|
|
|
77 |
i['gold_label_sequence'] = i.pop('tags').tolist()
|
78 |
i['text_tokenized'] = i.pop('tokens').tolist()
|
79 |
i['text'] = ' '.join(i['text_tokenized'])
|
80 |
+
i['entities'] = entities
|
81 |
return tmp
|
82 |
|
83 |
|