¿Cómo etiqueto archivos de texto con hunpos en nltk?
¿Puede alguien ayudarme con la sintaxis de los hunpos que etiquetan un corpus en nltk?
¿Qué importo para lahunpos.HunPosTagger
módulo?
¿Cómo hago HunPosTag el corpus? Vea el código a continuación.
import nltk
from nltk.corpus import PlaintextCorpusReader
from nltk.corpus.util import LazyCorpusLoader
corpus_root = './'
reader = PlaintextCorpusReader (corpus_root, '.*')
ntuen = LazyCorpusLoader ('ntumultien', PlaintextCorpusReader, reader)
ntuen.fileids()
isinstance (ntuen, PlaintextCorpusReader)
# So how do I hunpos tag `ntuen`? I can't get the following code to work.
# please help me to correct my python syntax errors, I'm new to python
# but i really need this to work. sorry
##from nltk.tag import hunpos.HunPosTagger
ht = HunPosTagger('english.model')
for sentence in ntu.sent() ##looping through the no. of sentence
ht.tag(ntusent()[i])