python - How to identify more than one label for an entity using Stanford NER -
i want identify word or entity 2 labels.
for example: john works in india.
output should be:
john per nnp
works o o
in o o
india loc nnp
so should identify named entity pos tags.
i have created own set of training data.
i using below property file
trainfile = training.tsv
serializeto = model.ser.gz
map = word=0,answer=1,tag=2
useclassfeature=true useword=true
usengrams=true
nomidngrams=true
maxngramleng=6
useprev=true
usenext=true
usesequences=true
useprevsequences=true
usetags = true
usewordtag = true
usegenericfeatures = true
mergetags = true
maxleft=1
usetypeseqs=true
usetypeseqs2=true
usetypeysequences=true
wordshape=chris2uselc
usedisjunctive=true
the training file looks this:
john per nnp
works o o
in o o
india loc nnp
i using below code run ner in python:
tagging_ner = stanfordnertagger('.../model.ser.gz','.../stanford-ner.jar',encoding='utf-8') token = stanfordtokenizer('.../stanford-ner.jar') tok = token.tokenize(text) tags = tagging_ner.tag(tok)
now code gives me named entities
. not return me pos tags
.
is there method both these things?
Comments
Post a Comment