Created
September 19, 2010 19:52
-
-
Save aria42/587062 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (defn obs-emissions | |
| "if a word has been assigned to a tag, we increment num-keys by 1 | |
| and add weight * num-occurences of the word to counts" | |
| [tag-emission-distr word-info weight] | |
| (-> tag-emission-distr | |
| (update-in [:num-keys] (if (> weight 0) inc dec)) | |
| (observe (:word word-info) (* weight (:count word-info))))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment