Browse files

corpus argument is first

  • Loading branch information...
1 parent aeaaae9 commit 841f261df935059d16b02d3259475f4c08b818af @japerk committed Mar 31, 2013
Showing with 9 additions and 9 deletions.
  1. +9 −9 docs/train_classifier.rst
@@ -4,31 +4,31 @@ Training Classifiers
Example usage with the movie_reviews corpus can be found in `Training Binary Text Classifiers with NLTK Trainer <>`_.
Train a binary NaiveBayes classifier on the movie_reviews corpus, using paragraphs as the training instances:
- ``python --instances paras --classifier NaiveBayes movie_reviews``
+ ``python movie_reviews --instances paras --classifier NaiveBayes``
Include bigrams as features:
- ``python --instances paras --classifier NaiveBayes --ngrams 1 --ngrams 2 movie_reviews``
+ ``python movie_reviews --instances paras --classifier NaiveBayes --ngrams 1 --ngrams 2``
Minimum score threshold:
- ``python --instances paras --classifier NaiveBayes --ngrams 1 --ngrams 2 --min_score 3 movie_reviews``
+ ``python movie_reviews --instances paras --classifier NaiveBayes --ngrams 1 --ngrams 2 --min_score 3``
Maximum number of features:
- ``python --instances paras --classifier NaiveBayes --ngrams 1 --ngrams 2 --max_feats 1000 movie_reviews``
+ ``python movie_reviews --instances paras --classifier NaiveBayes --ngrams 1 --ngrams 2 --max_feats 1000``
Use the default Maxent algorithm:
- ``python --instances paras --classifier Maxent movie_reviews``
+ ``python movie_reviews --instances paras --classifier Maxent``
Use the MEGAM Maxent algorithm:
- ``python --instances paras --classifier MEGAM movie_reviews``
+ ``python movie_reviews --instances paras --classifier MEGAM``
Train on files instead of paragraphs:
- ``python --instances files --classifier MEGAM movie_reviews``
+ ``python movie_reviews --instances files --classifier MEGAM``
Train on sentences:
- ``python --instances sents --classifier MEGAM movie_reviews``
+ ``python movie_reviews --instances sents --classifier MEGAM``
Evaluate the classifier by training on 3/4 of the paragraphs and testing against the remaing 1/4, without pickling:
- ``python --instances paras --classifier NaiveBayes --fraction 0.75 --no-pickle movie_reviews``
+ ``python movie_reviews --instances paras --classifier NaiveBayes --fraction 0.75 --no-pickle``
The following classifiers are available:

0 comments on commit 841f261

Please sign in to comment.