From f188487662ef9e05affeb653134ca1a6b3e05dd6 Mon Sep 17 00:00:00 2001 From: Neil Smith Date: Thu, 17 Jul 2014 23:20:50 +0100 Subject: [PATCH] Tweaked some slides. --- language_models.py | 2 +- slides/word-segmentation.html | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/language_models.py b/language_models.py index 59d8588..63aac6b 100644 --- a/language_models.py +++ b/language_models.py @@ -100,7 +100,7 @@ def ngrams(text, n): """ return [text[i:i+n] for i in range(len(text)-n+1)] - + class Pdist(dict): """A probability distribution estimated from counts in datafile. Values are stored and returned as log probabilities. diff --git a/slides/word-segmentation.html b/slides/word-segmentation.html index 6215255..9c3b309 100644 --- a/slides/word-segmentation.html +++ b/slides/word-segmentation.html @@ -149,9 +149,9 @@ def Pwords(words): ```python >>> 'hello' in Pw.keys() >>> Pwords(['hello']) True -4.25147684171819 ->>> 'inigo' in Pw.keys() >>> Pwords(['hello', 'my']) +>>> 'inigo' in Pw >>> Pwords(['hello', 'my']) True -6.995724679281423 ->>> 'blj' in Pw.keys() >>> Pwords(['hello', 'my', 'name']) +>>> 'blj' in Pw >>> Pwords(['hello', 'my', 'name']) False -10.098177451501074 >>> Pw['hello'] >>> Pwords(['hello', 'my', 'name', 'is']) -4.25147684171819 -12.195018236240843 -- 2.34.1