• Stars
    star
    748
  • Rank 60,661 (Top 2 %)
  • Language
    Python
  • License
    Apache License 2.0
  • Created about 14 years ago
  • Updated over 4 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Train NLTK objects with zero code

NLTK Trainer

NLTK Trainer exists to make training and evaluating NLTK objects as easy as possible.

Requirements

The scripts with default arguments have been tested for compatibility with Python3.7 and NLTK 3.4.5. If something does not work for you, please open an issue. Include the script with arguments and failure or exception output. To use the sklearn classifiers, you must also install scikit-learn.

If you want to use any of the corpora that come with NLTK, you should install the NLTK data.

Documentation

Documentation can be found at nltk-trainer.readthedocs.org (you can also find these documents in the docs directory. Many of the scripts are covered in Python 3 Text Processing with NLTK 3 Cookbook, and every script provides a --help option that describes all available parameters.

Using Trained Models

The trained models are pickle files that by default are put into your nltk_data directory. You can load them using nltk.data.load, for example:

import nltk.data
classifier = nltk.data.load('classifiers/movie_reviews_NaiveBayes.pickle')

You now have a NLTK classifier object you can work with.