<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Smoothing on Arshad Siddiqui</title><link>https://arshadhs.github.io/tags/smoothing/</link><description>Recent content in Smoothing on Arshad Siddiqui</description><generator>Hugo</generator><language>en-us</language><atom:link href="https://arshadhs.github.io/tags/smoothing/index.xml" rel="self" type="application/rss+xml"/><item><title>N-gram Language Modelling</title><link>https://arshadhs.github.io/docs/ai/050-nlp/030-n-gram-language-modelling/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://arshadhs.github.io/docs/ai/050-nlp/030-n-gram-language-modelling/</guid><description>&lt;h1 id="n-gram-language-modelling">
 N-gram Language Modelling
 
 &lt;a class="anchor" href="#n-gram-language-modelling">#&lt;/a>
 
&lt;/h1>
&lt;p>A language model assigns probabilities to sequences of words. It can compare complete sentences or predict which word is likely to come next.&lt;/p>
&lt;p>Key ideas include:&lt;/p>
&lt;ul>
&lt;li>word prediction and sequence probability&lt;/li>
&lt;li>the chain rule and Markov assumption&lt;/li>
&lt;li>unigram, bigram and trigram models&lt;/li>
&lt;li>Maximum Likelihood Estimation&lt;/li>
&lt;li>unseen sequences and smoothing&lt;/li>
&lt;li>interpolation and backoff&lt;/li>
&lt;li>intrinsic and extrinsic evaluation&lt;/li>
&lt;li>perplexity&lt;/li>
&lt;/ul>
&lt;h2 id="learning-objectives">
 Learning Objectives
 
 &lt;a class="anchor" href="#learning-objectives">#&lt;/a>
 
&lt;/h2>
&lt;ul>
&lt;li>Explain what a language model represents.&lt;/li>
&lt;li>Calculate simple unigram and bigram probabilities.&lt;/li>
&lt;li>Explain why unseen N-grams create zero probabilities.&lt;/li>
&lt;li>Distinguish smoothing, interpolation and backoff.&lt;/li>
&lt;li>Interpret perplexity correctly.&lt;/li>
&lt;/ul>
&lt;h2 id="big-picture">
 Big Picture
 
 &lt;a class="anchor" href="#big-picture">#&lt;/a>
 
&lt;/h2>


&lt;pre class="mermaid">
flowchart TD
 A[&amp;#34;Training Corpus&amp;#34;] --&amp;gt; B[&amp;#34;Count N-grams&amp;#34;]
 B --&amp;gt; C[&amp;#34;Estimate Probabilities&amp;#34;]
 C --&amp;gt; D[&amp;#34;Handle Unseen Events&amp;#34;]
 D --&amp;gt; E[&amp;#34;Score Word Sequences&amp;#34;]
 E --&amp;gt; F[&amp;#34;Evaluate Model&amp;#34;]

 style A fill:#E1F5FE
 style B fill:#C8E6C9
 style C fill:#FFF9C4
 style D fill:#EDE7F6
 style E fill:#E1F5FE
 style F fill:#C8E6C9
&lt;/pre>

&lt;h2 id="1-what-is-a-language-model-">
 1. What Is a Language Model? ☆
 
 &lt;a class="anchor" href="#1-what-is-a-language-model-">#&lt;/a>
 
&lt;/h2>
&lt;p>A language model estimates how probable a sequence of words is.&lt;/p></description></item></channel></rss>