How To Call The Classifierbasedtagger() In Nltk
I have followed in the documentation from nltk book (chapter 6 and 7) and other ideas to train my own model for named entity recognition. After building a feature function and Cla
Solution 1:
I finally realised what I was missing: when defining BasedTagger you have to pass an argument for "tagged_sents", like this:
#self.tagger = ClassifierBasedTagger(train=train_sents, feature_detector=features, **kwargs)
now when I call the chunker NamedEntityChunker() everything is working.
Solution 2:
Are you sure your code is exactly as you report it? This should not produce the problem you report; but you will get this behavior if you pass a keyword argument that is also a key in the kwargs
variable:
>>>deftest(a, b): # In fact the signature of `test` is irrelevant
pass
>>>args = { 'a'=1, 'b'=2 }>>>test(a=0, **args)
TypeError: test() got multiple values for keyword argument 'a'
So, figure out where the problem arises and fix it. Have your methods print out their arguments to help you debug the problem.
Post a Comment for "How To Call The Classifierbasedtagger() In Nltk"