Giter VIP home page Giter VIP logo

hmm-pos-tagger-with-viterbi-decoding's Introduction

HMM POS Tagger with Viterbi Decoding

This is a bigram Hidden Markov Model part of speech tagger that uses the Viterbi algorithm for decoding. The model is trained on the Wall Street Journal POS corpus and attempts to handle unknown words by performing suffix analysis using suffix trees as described by (Brants, 2000).

Try out a trained version of the model

Trained POS tagger

The code for that application can be found here.

To Run

This was primarily tested on Java 11.

Compile

To run from the command line, make sure you are in the root directory viterbi. This is the directory that contains src and WSJ_POS_CORPUS_FOR_STUDENTS. Run

javac src/viterbi/*.java

Run

Then to train and evaluate

java -cp src viterbi.WSJPOSTagger WSJ_POS_CORPUS_FOR_STUDENTS/WSJ_02-21.pos TEST_FILE MAX_SUFFIX_LENGTH MAX_WORD_FREQUENCY

where TEST_FILE is the file with sentences that you want to tag, MAX_SUFFIX_LENGTH is the maximum suffix length to use for the suffix tree and MAX_WORD_FREQUENCY is the maximum word frequency as found in the training set of the words to use for the suffix tree.

Note: The sentences in the test file must have the same format as the sentences in WSJ_POS_CORPUS_FOR_STUDENTS/WSJ_23.words.

References

Brants, T. (2000). TnT: A statistical part-of-speech tagger. In ANLP 2000, Seattle, WA, pp. 224โ€“231.

hmm-pos-tagger-with-viterbi-decoding's People

Contributors

aaronccwong avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Forkers

radman13666

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.