Skip to content

Commit 88d0acb

Browse files
committed
add n-grams simple example
1 parent d9302cf commit 88d0acb

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

images/fig_ngrams_example.png

266 KB
Loading

notebooks/24_NLP_4_ngrams_word_vectors.ipynb

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,12 @@
3838
"With 3-grams we could also get the pieces \"movie is good\", \"movie is bad\", \"actor was bad\", and \"actor was good\".\n",
3939
"Bigrams (or 2-grams) would not catch those differences. But they can also be very helpful in cases such as \"don't like\" vs \"do like\".\n",
4040
"\n",
41+
"```{figure} ../images/fig_ngrams_example.png\n",
42+
":name: fig_ngrams_example\n",
43+
"\n",
44+
"Two example sentences can be compared based on the words they contain (left table). But in many cases, meaningful distinctions get more pronounced when including n-grams (here: 2-grams added ot the right table).\n",
45+
"```\n",
46+
"\n",
4147
"Now we will see how we can make use of such n-grams."
4248
]
4349
},
@@ -2679,7 +2685,7 @@
26792685
"name": "python",
26802686
"nbconvert_exporter": "python",
26812687
"pygments_lexer": "ipython3",
2682-
"version": "3.9.18"
2688+
"version": "3.12.9"
26832689
}
26842690
},
26852691
"nbformat": 4,

0 commit comments

Comments
 (0)