New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Language parameter not being passed in nltk.tag.__init__.pos_tag_sents() #2184
Comments
Pull request: #2186 |
Thanks @ezhangsfl |
I am still receiving this error even though I've updated to the latest files and have also tried manually adding the |
Last release is the 17th whereas this was merged afterwards |
Replace the content of the (init.py) file with the following: -- coding: utf-8 --Natural Language Toolkit: TaggersCopyright (C) 2001-2019 NLTK ProjectAuthor: Edward Loper edloper@gmail.comSteven Bird stevenbird1@gmail.com (minor additions)URL: http://nltk.org/For license information, see LICENSE.TXT""" This package contains classes and interfaces for part-of-speech A "tag" is a case-sensitive string that specifies some property of a token,
An off-the-shelf tagger is available for English. It uses the Penn Treebank tagset:
A Russian tagger is also available if you specify lang="rus". It uses
This package defines several taggers, which take a list of tokens,
Note that words that the tagger has not seen during training receive a tag We evaluate a tagger on data that was not seen during training:
For more information, please consult chapter 5 of the NLTK Book. from nltk.tag.api import TaggerI from nltk.data import load, find RUS_PICKLE = ( def _get_tagger(lang=None): def _pos_tag(tokens, tagset=None, tagger=None, lang=None): def pos_tag(tokens, tagset=None, lang='eng'):
def pos_tag_sents(sentences, tagset=None, lang='eng'):
|
The
lang
parameter of pos_tag_sents() in nltk/tag/init.py is not being passed.Coupled with the change to exception ordering in commit 69583ce (lines 110-116 of nltk/tag/init.py), this now results in an error of "NotImplementedError('Currently, NLTK pos_tag only supports English and Russian (i.e. lang='eng' or lang='rus')'" when tagging a sentence.
The text was updated successfully, but these errors were encountered: