Skip to content

Instantly share code, notes, and snippets.

View mohayl's full-sized avatar

Mohammed Ayalew Belay mohayl

  • NTNU
View GitHub Profile
@blumonkey
blumonkey / hmm-example.py
Created August 25, 2015 15:59
Python Code to train a Hidden Markov Model, using NLTK
__author__ = 'ssbushi'
# Import the toolkit and tags
import nltk
from nltk.corpus import treebank
# Train data - pretagged
train_data = treebank.tagged_sents()[:3000]
print train_data[0]