Skip to content
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

Enforce stricter NLTK version. #32

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Enforce stricter NLTK version. #32

wants to merge 1 commit into from

Conversation

mrdrozdov
Copy link

Certain tagging apis break in more recent versions of NLTK.

Certain tagging apis break in more recent versions of NLTK.
@japerk
Copy link
Owner

japerk commented Dec 4, 2015

I've tested this with NLTK 3 before. Can you tell me what version broke & how?

@mrdrozdov
Copy link
Author

Was using the most recent version of NLTK. Broke when running this command.

python train_tagger.py treebank --brill
$ python --version
Python 2.7.9
$ pip --version
pip 7.1.2 from /Users/Andrew/Developer/nltk-trainer/.test-env/lib/python2.7/site-packages (python 2.7)
$ virtualenv --version
12.1.1
$ pip install -r requirements.txt
Collecting argparse>=1.1 (from -r requirements.txt (line 1))
  Using cached argparse-1.4.0-py2.py3-none-any.whl
Collecting nltk>=2.0b8 (from -r requirements.txt (line 2))
  Using cached nltk-3.1.tar.gz
Collecting numpy>=1.3.0 (from -r requirements.txt (line 3))
  Using cached numpy-1.10.1-cp27-none-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl
Collecting scipy>=0.7.0 (from -r requirements.txt (line 4))
  Using cached scipy-0.16.1-cp27-none-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl
Installing collected packages: argparse, nltk, numpy, scipy
  Running setup.py install for nltk
Successfully installed argparse-1.4.0 nltk-3.1 numpy-1.10.1 scipy-0.16.1
$ pip freeze
docopt==0.6.1
nltk==3.1
numpy==1.10.1
scipy==0.16.1
virtualenv==12.0.7
$ python train_tagger.py treebank --brill
loading treebank
3914 tagged sents, training on 3914
training AffixTagger with affix -3 and backoff <DefaultTagger: tag=-None->
training <class 'nltk.tag.sequential.UnigramTagger'> tagger with backoff <AffixTagger: size=2536>
training <class 'nltk.tag.sequential.BigramTagger'> tagger with backoff <UnigramTagger: size=4940>
training <class 'nltk.tag.sequential.TrigramTagger'> tagger with backoff <BigramTagger: size=2328>
Traceback (most recent call last):
  File "train_tagger.py", line 264, in <module>
    trace=args.trace, max_rules=args.max_rules, min_score=args.min_score)
  File "/Users/Andrew/Developer/nltk-trainer/nltk_trainer/tagging/training.py", line 7, in train_brill_tagger
    brill.SymmetricProximateTokensTemplate(brill.ProximateTagsRule, *bounds),
AttributeError: 'module' object has no attribute 'SymmetricProximateTokensTemplate'

@mrdrozdov
Copy link
Author

Have read elsewhere that Brill Tagger (maybe all taggers?) have changed API in NLTK 3.

@japerk
Copy link
Owner

japerk commented Dec 5, 2015

Ok, thanks for the details. I think everything else should work with NLTK 3, but I'll work on an update for brill.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants