0Pricing
NLP Academy · Lezione

Perché le singole parole perdono significato

Come not bad differisce da bad

Perché le singole parole perdono significato è una lezione NLP Academy gratuita su CoddyKit. Questa è la lezione 1 di 4. Puoi leggere la lezione completa qui gratuitamente — poi esercitati direttamente nel browser con un editor di codice integrato e un tutor IA disponibile 24/7. Fa parte del percorso di apprendimento NLP Academy, e i tuoi progressi si sincronizzano tra il web e l'app CoddyKit. Il corso NLP Academy include 4 lezioni in totale.

Parti di questa lezione non sono ancora state tradotte e vengono mostrate in inglese.

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)  # True

Not 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 apart

Phrases 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. ✨

Domande Frequenti

La lezione «Perché le singole parole perdono significato» è gratuita?

Sì — il testo completo di «Perché le singole parole perdono significato» è gratuito qui sul web. Per esercitarvi in modo interattivo (un editor di codice integrato e un tutor IA 24/7) e sbloccare il resto del corso NLP Academy, passa a CoddyKit PRO. Il corso NLP Academy include 4 lezioni in totale.

Cosa imparerò in «Perché le singole parole perdono significato»?

Come not bad differisce da bad Eserciti NLP Academy con codice pratico che esegui direttamente nel browser, e un tutor IA 24/7 risponde alle tue domande mentre lavori sulla lezione.

Ho bisogno di esperienza per iniziare NLP Academy?

Non è richiesta alcuna esperienza precedente. NLP Academy su CoddyKit è strutturato per principianti e studenti avanzati, quindi puoi iniziare da qui o dall'inizio e procedere al tuo ritmo. Questa è la lezione 1 di 4.

Quanto tempo richiede la lezione «Perché le singole parole perdono significato»?

La maggior parte delle lezioni CoddyKit richiede circa 5–10 minuti. Ogni lezione è breve e interattiva, quindi fai progressi costanti e riprendi esattamente da dove hai lasciato su web e app.

Posso scrivere ed eseguire codice in questa lezione NLP Academy?

Sì. Ogni lezione NLP Academy include un editor di codice integrato, quindi scrivi ed esegui codice reale direttamente nel tuo browser e ricevi feedback istantaneo dall'IA — nessuna configurazione locale necessaria.

Tutte le lezioni di questo corso

  1. Perché le singole parole perdono significato
  2. Bigrams e trigrams spiegati
  3. Feature N-gram in scikit-learn
  4. Scegliere l'intervallo N-gram corretto
← Torna a NLP Academy