nlplab / brat

brat rapid annotation tool (brat) - for all your textual annotation needs
http://brat.nlplab.org
Other
1.81k stars 509 forks source link

Adding to existing Spacy NER annotations with brat #1284

Open tylernwatson opened 5 years ago

tylernwatson commented 5 years ago

Hi everybody,

I'm working on a project that involves annotating entities in emails. Spacy has been doing a good job with named entity recognition, but there are a few new entities that I'd like to add (for example, job title). I imagine there is a way to convert Spacy documents and the entity type annotations of tokens in that document into a format that brat can use, but I haven't had any luck figuring out how to do that.

Ideally, I would like to open text in brat that already has entities labeled by Spacy and then go through and add my own entity type as an annotation. Once this is done, all the annotations (those generated by Spacy and the ones that I manually added) will be used as training data for an NLP model. Does anybody have experience with this? This page on the brat website references examples created with other tools and converted to brat format, but I can't find more info on how to do that.

Thank you,

Tyler

jcklie commented 5 years ago

Hello, my university lab is working right now on an annotation platform called INCEpTION which combines annotation and interactive recommendations (and many more features) together into one tool. It uses brat as an annotation editor. You can find more information under https://inception-project.github.io/.

We have an example for your use case: whenever you make annotations, machine learning models (you can configure for which layers and features and what for a model) are trained in the background and give you recommendations. These recommendations are shown in the editor on the fly. They can then added as an annotation with just one click. The spacy version of this can be found under https://github.com/inception-project/external-recommender-spacy . If you have any questions, do not hesitate me or the INCEpTION team. You then can export the annotations you made and train your own models on the resulting gold corpus.

qiuwei commented 5 years ago

@Rentier wow, that's very impressive. I somehow feel the development of brat is stalled. Your project looks really promising.

ParthBarot-BoTreeConsulting commented 5 years ago

@jcklie

But, can we export annotations from inception and use it for training spaCy? This is really not mentioned anywhere in the inception docs I believe. Can you please help?

jcklie commented 5 years ago

@ParthBarot-BoTreeConsulting You can export the data from INCEpTION in many different file formats. Then you can convert it to something spacy understands and train on it.