TensorFlow RNNs for named entity recognition
Asked Answered
F

1

8

I'm trying to work out what's the best model to adapt for an open named entity recognition problem (biology/chemistry, so no dictionary of entities exists but they have to be identified by context).

Currently my best guess is to adapt Syntaxnet so that instead of tagging words as N, V, ADJ etc, it learns to tag as BEGINNING, INSIDE, OUT (IOB notation).

However I am not sure which of these approaches is the best?

  • Syntaxnet
  • word2vec
  • seq2seq (I think this is not the right one as I need it to learn on two aligned sequences, whereas seq2seq is designed for sequences of differing lengths as in translation)

Would be grateful for a pointer to the right method! thanks!

Farnsworth answered 18/2, 2017 at 18:19 Comment(1)
Syntaxnet and seq2seq will work. There is also a linear chain CRF in contrib.Phipps
R
8

Syntaxnet can be used to for named entity recognition, e.g. see: Named Entity Recognition with Syntaxnet

word2vec alone isn't very effective for named entity recognition. I don't think seq2seq is commonly used either for that task.

As drpng mentions, you may want to look at tensorflow/tree/master/tensorflow/contrib/crf. Adding an LSTM before the CRF layer would help a bit, which gives something like:

enter image description here

LSTM+CRF code in TensorFlow: https://github.com/Franck-Dernoncourt/NeuroNER

Rozalie answered 19/2, 2017 at 0:43 Comment(2)
OK thank you very much! I used Syntaxnet in the end. I converted my entities to IOB notation and trained the Syntaxnet POS tagger according to the instructions here: github.com/tensorflow/models/tree/master/syntaxnet It worked very well, I got 78%Farnsworth
@Farnsworth good to know. For benchmarking NER systems, I personally use the conll2003 dataset as the first comparison point: it is free, small enough to be fast, large enough to train ANNs, it comes with an evolution script, and it is well studied.Rozalie

© 2022 - 2024 — McMap. All rights reserved.