Generating Sentences with n-grams using Python

  Рет қаралды 14,435

Douglas Starnes

Douglas Starnes

Күн бұрын

This is a little experiment demonstrating how n-grams work. It's not production worthy but it does prove that sentences generated using n-grams are more logical than those which don't use them. And it shows an interesting way to use Python dictionaries and lists.

Пікірлер: 12
@black-sci
@black-sci 6 ай бұрын
Your way of explaining is just so clear. Nice work.
@black-sci
@black-sci 6 ай бұрын
I'm trying to make sentence autocomplete project instead of generating sentences. but it works similarly.
@black-sci
@black-sci 6 ай бұрын
Can you next do the generator using neural networks.
@black-sci
@black-sci 6 ай бұрын
I see you're taking len(sentence) -1 .After this step If we add dot in n_gram after last word of sentence and whenever sentence generator encounters a dot it should stop.
@arifahammed8243
@arifahammed8243 Жыл бұрын
Hi Starnes, I am trying to extract senteces using some predefnied bigrams. Can you please help me?
@busterdafydd3096
@busterdafydd3096 Жыл бұрын
7:41 I see your not bothering with a state to make your choice's more unique.
@busterdafydd3096
@busterdafydd3096 Жыл бұрын
6:31 alright this really isn't a lookup table, your getting much closer to a tree structure. and data structures were possible should be compressed as possible. So your list should remove duplicates but either it should become a dictionary with a count factor or sort the list with the selection algorithm favouring items at one end of the list over the other.... In fact a tree structure can have more depth, if for example you keep the upper limit words, in that all words that appear less than twice for example get removed, so you are linking words the connect to each other much more strongly.
@joshuva.bernard
@joshuva.bernard Жыл бұрын
Hi, can you share the extentions you use in your vscode
@DouglasStarnes
@DouglasStarnes Жыл бұрын
I'm using the Python extension. If you search for Python in the Extensions sidebar it's the first one, from Microsoft. It will install several other extensions but that will get you all the functionality in the video. Thanks for the comment!
@SOUFTVOFFICIEL
@SOUFTVOFFICIEL Жыл бұрын
@@DouglasStarnes Hi, thank you for the Video... i have a question, how can we use N-gram (bi-gram e.i) to help users in searching process when he write his query
@zephyrindiffo2702
@zephyrindiffo2702 Жыл бұрын
i love!!!
@thechoosen4240
@thechoosen4240 11 ай бұрын
Good job bro, JESUS IS COMING BACK VERY SOON;WATCH AND PREPARE
Modern Graphical User Interfaces in Python
11:12
NeuralNine
Рет қаралды 1,5 МЛН
So Cute 🥰
00:17
dednahype
Рет қаралды 58 МЛН
What are Generative AI models?
8:47
IBM Technology
Рет қаралды 996 М.
No, Einstein Didn’t Solve the Biggest Problem in Physics
8:04
Sabine Hossenfelder
Рет қаралды 295 М.
NLTK Tutorial 09: Sentiment Analysis | N-Gram | NLTK | Python
21:24
Calculating Text Similarity in Python with NLP
17:55
NeuralNine
Рет қаралды 53 М.
N-Gram Smoothing Techniques
14:19
Natalie Parde
Рет қаралды 14 М.
N-gram Language Modeling | Theory, Math, Code
16:53
ycopie
Рет қаралды 17 М.
Memphis Python User Group September 2024 Demo Part 1 of N
18:54
Douglas Starnes
Рет қаралды 13