asahi417 commited on
Commit
66855b1
1 Parent(s): a93ee1f

fix dataset

Browse files
Files changed (1) hide show
  1. 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
- pprint(entities)
76
- [e['types'] for e in entities]
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