Por que palavras isoladas perdem significado
Como not bad é diferente de bad.
Por que palavras isoladas perdem significado é uma aula grátis de NLP Academy no CoddyKit. Esta é a aula 1 de 4. Você pode ler a aula completa abaixo gratuitamente — depois pratica ao vivo no navegador com um editor de código integrado e um tutor de IA 24/7. Faz parte do caminho de aprendizado de NLP Academy, e seu progresso é sincronizado entre a web e o app CoddyKit. O curso de NLP Academy inclui 4 aulas no total.
Partes desta aula ainda não foram traduzidas e aparecem em inglês.
Words Standing Alone
So far you have treated text as a bag of single words. But meaning often lives in how words sit next to each other, not in any word alone.
The Bag-of-Words Blind Spot
A bag-of-words model throws away order. To it, the two sentences below are identical, even though they mean opposite things. 😮
a = sorted("this is not good".split())
b = sorted("good is not this".split())
print(a == b) # TrueNot Bad vs Bad
Think about a review that says not bad. The word bad alone looks negative, but the pair flips it to mildly positive.
Negation Gets Lost
When you count words one by one, the word not floats free. The model never learns which word it was actually negating.
tokens = "not bad".split()
print(tokens) # ['not', 'bad'] counted apartPhrases Carry Meaning
Real language is full of phrases like new york or machine learning. Split them up and you lose the concept they name together.
Order Changes Everything
Compare dog bites man with man bites dog. Same three words, very different news. Order is signal, and single words discard it.
Enter the N-Gram
An n-gram is a short, contiguous run of n words. It is the simplest way to glue neighbors together and keep a little local context.
Unigrams You Already Know
A single word is just a unigram, an n-gram of size one. So bag-of-words was secretly an n-gram model all along.
text = "not bad at all"
unigrams = text.split()
print(unigrams)Pairs Rescue Context
Step up to size two and not bad becomes a single feature. Now the model can learn that this pair leans positive.
A Sliding Window
Picture a small window sliding along the text, one step at a time, grabbing every adjacent group of words it passes over.
Context, Not Grammar
N-grams do not understand grammar. They simply preserve which words appear together, and that small clue boosts many NLP tasks.
Quick Check
Why do plain single-word features struggle with a phrase like not bad?
Recap: Why Pairs Matter
Single words ignore order, so negation and phrases slip away. N-grams keep neighbors together and bring local context back. Next you will name them. ✨
Perguntas Frequentes
A aula “Por que palavras isoladas perdem significado” é grátis?
Sim — o texto completo de “Por que palavras isoladas perdem significado” é grátis para ler aqui na web. Para praticá-la interativamente (um editor de código integrado e um tutor de IA 24/7) e desbloquear o restante do curso de NLP Academy, atualize para CoddyKit PRO. O curso de NLP Academy inclui 4 aulas no total.
O que vou aprender em “Por que palavras isoladas perdem significado”?
Como not bad é diferente de bad. Você pratica NLP Academy com código prático que executa diretamente no navegador, e um tutor de IA 24/7 responde suas dúvidas enquanto trabalha na aula.
Preciso ter experiência prévia para começar NLP Academy?
Nenhuma experiência prévia é necessária. NLP Academy no CoddyKit é estruturado para alunos iniciantes até avançados, então você pode começar aqui ou desde o início e aprender no seu ritmo. Esta é a aula 1 de 4.
Quanto tempo leva a aula “Por que palavras isoladas perdem significado”?
A maioria das aulas CoddyKit leva cerca de 5–10 minutos. Cada uma é compacta e interativa, então você faz progresso constante e retoma exatamente de onde parou entre web e app.
Posso escrever e executar código nesta aula de NLP Academy?
Sim. Cada aula de NLP Academy inclui um editor de código integrado, então você escreve e executa código real direto no navegador e recebe feedback de IA instantaneamente — nenhuma configuração local necessária.
Todas as aulas deste curso
- Por que palavras isoladas perdem significado
- Bigrams e trigrams explicados
- Recursos de N-grams no scikit-learn
- Escolhendo o intervalo certo de N-grams