How to recognize Named Entity from a python list using Stanford NERTagger
up vote
1
down vote
favorite
I am a beginner in NLP and first time using StanfordNERTagger. For learning purpose I am playing with Stanford NERTagger. I have a python list of country name
['France', 'India', 'Bangladesh', 'England', 'Germany', 'Brazil', 'Egypt', 'Bhutan', 'Srilanka']
I want to get 'location' entity which belongs to NERTagger but i am getting the 'Organization' Entity
[('France', 'ORGANIZATION'),
('India', 'ORGANIZATION'),
('Bangladesh', 'ORGANIZATION'),
('England', 'ORGANIZATION'),
('Germany', 'ORGANIZATION'),
('Brazil', 'ORGANIZATION'),
('Egypt', 'ORGANIZATION'),
('Bhutan', 'ORGANIZATION'),
('Srilanka', 'ORGANIZATION')]
May be i am missing something here
nlp nltk stanford-nlp
add a comment |
up vote
1
down vote
favorite
I am a beginner in NLP and first time using StanfordNERTagger. For learning purpose I am playing with Stanford NERTagger. I have a python list of country name
['France', 'India', 'Bangladesh', 'England', 'Germany', 'Brazil', 'Egypt', 'Bhutan', 'Srilanka']
I want to get 'location' entity which belongs to NERTagger but i am getting the 'Organization' Entity
[('France', 'ORGANIZATION'),
('India', 'ORGANIZATION'),
('Bangladesh', 'ORGANIZATION'),
('England', 'ORGANIZATION'),
('Germany', 'ORGANIZATION'),
('Brazil', 'ORGANIZATION'),
('Egypt', 'ORGANIZATION'),
('Bhutan', 'ORGANIZATION'),
('Srilanka', 'ORGANIZATION')]
May be i am missing something here
nlp nltk stanford-nlp
It's very difficult for an NER tagger to work with single words since the tagging is context-dependent. If you give it full sentences containing a country name, I would expect it to work much better.
– Proyag
Nov 9 at 10:32
you are asking for entities in a list of counties. NER tags entities on tokenized sentences.
– Nathan McCoy
Nov 9 at 15:21
add a comment |
up vote
1
down vote
favorite
up vote
1
down vote
favorite
I am a beginner in NLP and first time using StanfordNERTagger. For learning purpose I am playing with Stanford NERTagger. I have a python list of country name
['France', 'India', 'Bangladesh', 'England', 'Germany', 'Brazil', 'Egypt', 'Bhutan', 'Srilanka']
I want to get 'location' entity which belongs to NERTagger but i am getting the 'Organization' Entity
[('France', 'ORGANIZATION'),
('India', 'ORGANIZATION'),
('Bangladesh', 'ORGANIZATION'),
('England', 'ORGANIZATION'),
('Germany', 'ORGANIZATION'),
('Brazil', 'ORGANIZATION'),
('Egypt', 'ORGANIZATION'),
('Bhutan', 'ORGANIZATION'),
('Srilanka', 'ORGANIZATION')]
May be i am missing something here
nlp nltk stanford-nlp
I am a beginner in NLP and first time using StanfordNERTagger. For learning purpose I am playing with Stanford NERTagger. I have a python list of country name
['France', 'India', 'Bangladesh', 'England', 'Germany', 'Brazil', 'Egypt', 'Bhutan', 'Srilanka']
I want to get 'location' entity which belongs to NERTagger but i am getting the 'Organization' Entity
[('France', 'ORGANIZATION'),
('India', 'ORGANIZATION'),
('Bangladesh', 'ORGANIZATION'),
('England', 'ORGANIZATION'),
('Germany', 'ORGANIZATION'),
('Brazil', 'ORGANIZATION'),
('Egypt', 'ORGANIZATION'),
('Bhutan', 'ORGANIZATION'),
('Srilanka', 'ORGANIZATION')]
May be i am missing something here
nlp nltk stanford-nlp
nlp nltk stanford-nlp
asked Nov 9 at 5:21
Kalyan
46221030
46221030
It's very difficult for an NER tagger to work with single words since the tagging is context-dependent. If you give it full sentences containing a country name, I would expect it to work much better.
– Proyag
Nov 9 at 10:32
you are asking for entities in a list of counties. NER tags entities on tokenized sentences.
– Nathan McCoy
Nov 9 at 15:21
add a comment |
It's very difficult for an NER tagger to work with single words since the tagging is context-dependent. If you give it full sentences containing a country name, I would expect it to work much better.
– Proyag
Nov 9 at 10:32
you are asking for entities in a list of counties. NER tags entities on tokenized sentences.
– Nathan McCoy
Nov 9 at 15:21
It's very difficult for an NER tagger to work with single words since the tagging is context-dependent. If you give it full sentences containing a country name, I would expect it to work much better.
– Proyag
Nov 9 at 10:32
It's very difficult for an NER tagger to work with single words since the tagging is context-dependent. If you give it full sentences containing a country name, I would expect it to work much better.
– Proyag
Nov 9 at 10:32
you are asking for entities in a list of counties. NER tags entities on tokenized sentences.
– Nathan McCoy
Nov 9 at 15:21
you are asking for entities in a list of counties. NER tags entities on tokenized sentences.
– Nathan McCoy
Nov 9 at 15:21
add a comment |
1 Answer
1
active
oldest
votes
up vote
2
down vote
Firs you need to install Stanford NER on your comp. Depending of OS, both procedures how to configure Stanford ner tagger
Now take a look at this sample code
import nltk
from nltk.tokenize.toktok import ToktokTokenizer
from nltk.tag import StanfordNERTagger
stanford_classifier = os.environ.get('STANFORD_MODELS').split(':')[0]
stanford_ner_path = os.environ.get('CLASSPATH').split(':')[0]
st = StanfordNERTagger(stanford_classifier, stanford_ner_path, encoding='utf-8')
Check st
<nltk.tag.stanford.StanfordNERTagger at 0x7f897c44e6d8>
My sentance
sentence = u'France is the biggest county in EU'
words = nltk.word_tokenize(sentence)
st.tag(words)
Result
[('France', 'LOCATION'),
('is', 'O'),
('the', 'O'),
('biggest', 'O'),
('county', 'O'),
('in', 'O'),
('EU', 'LOCATION')]
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
2
down vote
Firs you need to install Stanford NER on your comp. Depending of OS, both procedures how to configure Stanford ner tagger
Now take a look at this sample code
import nltk
from nltk.tokenize.toktok import ToktokTokenizer
from nltk.tag import StanfordNERTagger
stanford_classifier = os.environ.get('STANFORD_MODELS').split(':')[0]
stanford_ner_path = os.environ.get('CLASSPATH').split(':')[0]
st = StanfordNERTagger(stanford_classifier, stanford_ner_path, encoding='utf-8')
Check st
<nltk.tag.stanford.StanfordNERTagger at 0x7f897c44e6d8>
My sentance
sentence = u'France is the biggest county in EU'
words = nltk.word_tokenize(sentence)
st.tag(words)
Result
[('France', 'LOCATION'),
('is', 'O'),
('the', 'O'),
('biggest', 'O'),
('county', 'O'),
('in', 'O'),
('EU', 'LOCATION')]
add a comment |
up vote
2
down vote
Firs you need to install Stanford NER on your comp. Depending of OS, both procedures how to configure Stanford ner tagger
Now take a look at this sample code
import nltk
from nltk.tokenize.toktok import ToktokTokenizer
from nltk.tag import StanfordNERTagger
stanford_classifier = os.environ.get('STANFORD_MODELS').split(':')[0]
stanford_ner_path = os.environ.get('CLASSPATH').split(':')[0]
st = StanfordNERTagger(stanford_classifier, stanford_ner_path, encoding='utf-8')
Check st
<nltk.tag.stanford.StanfordNERTagger at 0x7f897c44e6d8>
My sentance
sentence = u'France is the biggest county in EU'
words = nltk.word_tokenize(sentence)
st.tag(words)
Result
[('France', 'LOCATION'),
('is', 'O'),
('the', 'O'),
('biggest', 'O'),
('county', 'O'),
('in', 'O'),
('EU', 'LOCATION')]
add a comment |
up vote
2
down vote
up vote
2
down vote
Firs you need to install Stanford NER on your comp. Depending of OS, both procedures how to configure Stanford ner tagger
Now take a look at this sample code
import nltk
from nltk.tokenize.toktok import ToktokTokenizer
from nltk.tag import StanfordNERTagger
stanford_classifier = os.environ.get('STANFORD_MODELS').split(':')[0]
stanford_ner_path = os.environ.get('CLASSPATH').split(':')[0]
st = StanfordNERTagger(stanford_classifier, stanford_ner_path, encoding='utf-8')
Check st
<nltk.tag.stanford.StanfordNERTagger at 0x7f897c44e6d8>
My sentance
sentence = u'France is the biggest county in EU'
words = nltk.word_tokenize(sentence)
st.tag(words)
Result
[('France', 'LOCATION'),
('is', 'O'),
('the', 'O'),
('biggest', 'O'),
('county', 'O'),
('in', 'O'),
('EU', 'LOCATION')]
Firs you need to install Stanford NER on your comp. Depending of OS, both procedures how to configure Stanford ner tagger
Now take a look at this sample code
import nltk
from nltk.tokenize.toktok import ToktokTokenizer
from nltk.tag import StanfordNERTagger
stanford_classifier = os.environ.get('STANFORD_MODELS').split(':')[0]
stanford_ner_path = os.environ.get('CLASSPATH').split(':')[0]
st = StanfordNERTagger(stanford_classifier, stanford_ner_path, encoding='utf-8')
Check st
<nltk.tag.stanford.StanfordNERTagger at 0x7f897c44e6d8>
My sentance
sentence = u'France is the biggest county in EU'
words = nltk.word_tokenize(sentence)
st.tag(words)
Result
[('France', 'LOCATION'),
('is', 'O'),
('the', 'O'),
('biggest', 'O'),
('county', 'O'),
('in', 'O'),
('EU', 'LOCATION')]
answered Nov 9 at 10:40
Richard Rublev
3,00841932
3,00841932
add a comment |
add a comment |
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53220273%2fhow-to-recognize-named-entity-from-a-python-list-using-stanford-nertagger%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
It's very difficult for an NER tagger to work with single words since the tagging is context-dependent. If you give it full sentences containing a country name, I would expect it to work much better.
– Proyag
Nov 9 at 10:32
you are asking for entities in a list of counties. NER tags entities on tokenized sentences.
– Nathan McCoy
Nov 9 at 15:21