简体   繁体   中英

Review of Name Entity Recognition NLTK

I am trying to create one entity recognition(NER) application, where I am trying to take Parts of Speech Tagging(PoS) approach. I am trying to exploit Python's NLTK library, and using it as hmm_tagger=nltk.HiddenMarkovModelTagger.train(train_set) . In train set, I am trying to give data in the format of Brown corpus's tagged_sents(). It is as below for PoS Tagging

brown_a = nltk.corpus.brown.tagged_sents()[:2]
>>> brown_a
[[(u'The', u'AT'), (u'Fulton', u'NP-TL'), (u'County', u'NN-TL'), (u'Grand', u'JJ-TL'), (u'Jury', u'NN-TL'), (u'said', u'VBD'), (u'Friday', u'NR'), (u'an', u'AT'), (u'investigation', u'NN'), (u'of', u'IN'), (u"Atlanta's", u'NP$'), (u'recent', u'JJ'), (u'primary', u'NN'), (u'election', u'NN'), (u'produced', u'VBD'), (u'``', u'``'), (u'no', u'AT'), (u'evidence', u'NN'), (u"''", u"''"), (u'that', u'CS'), (u'any', u'DTI'), (u'irregularities', u'NNS'), (u'took', u'VBD'), (u'place', u'NN'), (u'.', u'.')], [(u'The', u'AT'), (u'jury', u'NN'), (u'further', u'RBR'), (u'said', u'VBD'), (u'in', u'IN'), (u'term-end', u'NN'), (u'presentments', u'NNS'), (u'that', u'CS'), (u'the', u'AT'), (u'City', u'NN-TL'), (u'Executive', u'JJ-TL'), (u'Committee', u'NN-TL'), (u',', u','), (u'which', u'WDT'), (u'had', u'HVD'), (u'over-all', u'JJ'), (u'charge', u'NN'), (u'of', u'IN'), (u'the', u'AT'), (u'election', u'NN'), (u',', u','), (u'``', u'``'), (u'deserves', u'VBZ'), (u'the', u'AT'), (u'praise', u'NN'), (u'and', u'CC'), (u'thanks', u'NNS'), (u'of', u'IN'), (u'the', u'AT'), (u'City', u'NN-TL'), (u'of', u'IN-TL'), (u'Atlanta', u'NP-TL'), (u"''", u"''"), (u'for', u'IN'), (u'the', u'AT'), (u'manner', u'NN'), (u'in', u'IN'), (u'which', u'WDT'), (u'the', u'AT'), (u'election', u'NN'), (u'was', u'BEDZ'), (u'conducted', u'VBN'), (u'.', u'.')]]

{Here size of brown_a we may increase. It is given only as an example.}

I am now trying to build an NER, where, I am changing above data as,

[[(u'The', u'NameP'), (u'Fulton', u'Name'), (u'County', u'NameC'), (u'Grand', u'NameCC'), (u'Jury', u'NameCCC'), (u'said', u'VBD'), (u'Friday', u'NR'), (u'an', u'AT'), (u'investigation', u'NA'), (u'of', u'NA'), (u"Atlanta's", u'Name'), (u'recent', u'NA'), (u'primary', u'NA'), (u'election', u'NA'), (u'produced', u'NA'), (u'``', u'NA'), (u'no', u'NA'), (u'evidence', u'NA'), (u"''", u"NA"), (u'that', u'NA'), ...]

Here, I am keeping data format but changing the tagset to my definition as, NA for Not Available(anything which is not NE), NameP for Previous to Name, Name for Name,..etc.

I am now making this new data as training set and training.

Is my approach fine or do I need to change anything major?

Please suggest.

Why not to use a ready NER system, such as CRF-NER or Mallet ? Are you doing this for academic purposes or you have a business problem, which needs to be solved? In case of the latter, try working with something already built to get the initial results and if they don't meet your expectation, only then consider your implementation.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM