Skip to content

An implementation of Matthew Honnibal's fast and accurate part-of-speech tagger based on the Averaged Perceptron

License

Notifications You must be signed in to change notification settings

turbolent/aptagger

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

aptagger

Build Status

An implementation of Matthew Honnibal's fast and accurate part-of-speech tagger based on the Averaged Perceptron, as described in ["A good POS tagger in about 200 lines of Python"] (https://honnibal.wordpress.com/2013/09/11/a-good-part-of-speechpos-tagger-in-about-200-lines-of-python/)

Usage

API

Path modelPath = Paths.get("<path-to-model>");
Tagger tagger = Tagger.loadFrom(modelPath);
List<String> words = Arrays.asList("Simple", "is", "better", "than", "complex");
List<String> tags = tagger.tag(words);

Command Line

$ mvn compile assembly:single
$ java -jar target/aptagger.jar
Usage:
  tag <model-file> <word>...
  train <corpus-file> <model-file>
  test <model-file> <corpus-file>

Commands:
  tag    Returns a tagged sentence of the given words using the given model.
  train  Creates a model from the given corpus, which should contain
         one tagged sentence per line.
  test   Tests how the given model performs for the given corpus.
         Prints the ratio of correct and total number of tags.

Format:
  A tagged sentence consists of tokens separated by spaces, where each token
  is a combination of a word and a tag, separated by an underscore.
  For example: "Simple_NN is_VBZ better_JJR than_IN complex_JJ ._."

About

An implementation of Matthew Honnibal's fast and accurate part-of-speech tagger based on the Averaged Perceptron

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages