Hidden Markov Model and Part of Speech Tagging
This repository includes demo codes on how to use hidden Markov model (HMM) to perform part of speech (POS) tagging. It involves model training, testing and evaluation.
- How it works
- Contributor(s)
- Additional information
- To save space, the data is not included in this repository. After cloning this repository, you can find some public data, and make sure they follow the formats below:
- Training data in "training.txt" (each line): word1 tag1 word2 tag2 ... wordN tagN
- Testing data in "testing.txt" (each line): word1 word2 ... wordN
- Evaluation data in "evaluation.txt" (each line): tag1 tag2 ... tagN (corresponds to each line in testing data)
- Place all data in the same directory as the codes (HMM.java and POS.java)
- Compile using command: javac POS.java HMM.java
- Run using commnad: java POS
- Enter the probability smoothing coefficient lambda (0~1) at the prompted line for parameter configuration
- See the POS tagged sentences for testing.txt in "report.txt" (at the same location as the codes)
- Tianlong Song
Please refer to Tianlong's blog for theoretical details about HMM and POS tagging.