Monday, April 2, 2012

Language Models and Python Reflexes

So I burnt slightly more time than necessary on the NLP homework writing my own bigram/unigram calculating code in order to calculate plus one smoothing values on a small corpus.   However it was interesting Python background in terms of the much tripped over integer division issue in Python:

As well as an interesting review of the multitude of quick ways to get an item count from a list in Python:

and my old favorite how to grab a list pairwise in Python:

No comments: