4 ms·
Gensim's implemention is better than the original and allows for Python API access to all the features. Highly recommended. Radim tends to write really memory
by lqdc13 11y ago
Gensim's implemention is better than the original and allows for Python API access to all the features. Highly recommended. Radim tends to write really memory efficient code unlike some other Python libs, so you can deal with large datasets.
If you want to do NER in a way that doesn't suck there is no way around making your own model on your own training data.
It honestly takes only a few days of labeling things yourself. I found that outsourcing the work to amazon turk is not a viable option because the graders there are terrible. And they work about 30x slower than you do. Even if you pay them $1/hr, that is like paying one person $30/hr. I'm not kidding.
Sure you can do a quick and dirty "send data to these guys and they'll do all the work", but I haven't come across a model that works well on all datasets. We're talking going from 30ish percent accuracy for a model not trained on your dataset to low 90s for something trained on your dataset. Of course, these are approximate numbers and it is definitely possible that your dataset is almost exactly like the ones they trained their model on.
It's incredibly simple to make your own model.
1. Label your data with brat:
http://brat.nlplab.org/index.html http://brat.nlplab.org/index.html
# 5 days for 2k one page documents.
2. Tokenize data with nltk/spaCy. Come up with features and label using pycrfsuite:
http://nbviewer.ipython.org/github/tpeng/python-crfsuite/blob/master/examples/CoNLL%202002.ipynb http://nbviewer.ipython.org/github/tpeng/python-crfsuite/blo...
# 1 day
3. Do more labeling, retokenizing, neural embedding from word2vec's similar words to the tokens you have, tune parameters or come up with better features such as your own dictionaries of entities, etc. Retrain the model.
#2 weeks.
4.Done. Now you have a memory efficient fast model tuned on your data. You can label anything you want. Not just Person/Company, but things like car vs bicycle brands, computer parts, obfuscated email addresses, etc.
- syllogism 11y agoI'd endorse pretty much all of this. I want to make "domain adaptation as a service" the key part of spaCy's business model: you send us text, we send you a good model. Internally this will probably involve annotating part of the text, but that's a tactical decision we'll make. I hope we can make some break-throughs that help NER be much more general than it is currently. But the current solution you describe works fine; it's just a pain in the ass for each organization to take on. We want to have the required infrastructure and expertise set up, and make the process seamless.