TodayTools

Natural language processing flashcards

Teach computers to read, sort and understand human language.

Donate
Beginner friendly, starts from zero
Section
How to study
0
Natural language processingStart from zero · 1 of 11

What is natural language processing, in one plain sentence?

Teaching computers to work with the languages people speak and write, so they can read, sort, translate, answer and write text.

Computers meeting human words.
Show again
11 left
Got it

Tap to turn over. Swipe right if you know it, left to see it again.

All topics

What you will learn

  1. Start from zero

    • What NLP is3 cards
    • The key words6 cards
    • Many languages and next steps2 cards
  2. Core basics

    • Text and Unicode3 cards
    • Words and tokens3 cards
    • Classic models4 cards
    • Measuring results2 cards
    • Finding structure3 cards
    • Meaning as numbers3 cards
  3. Next steps

    • Subword tokens3 cards
    • Transformers3 cards
    • Fine-tuning4 cards
    • No-training options2 cards
    • Search and grouping2 cards
    • Generation tasks2 cards
    • Real-world text2 cards
  4. Go deeper

    • Inside transformers5 cards
    • Decoding2 cards
    • Choosing the right tool3 cards
    • Domain and language2 cards
    • Robustness2 cards
    • Privacy2 cards
    • Embeddings in depth2 cards

Final test and certificate

10 questions drawn fresh from the whole topic, about 15 minutes. Sign in, score 80% or more and get a free certificate with your name and a public check link anyone can open, such as an employer or a teacher. Not signed in? Try a practice test from the cards.

Take the final test

Natural language processing at a glance

Natural language processing (NLP) is how computers read, sort, translate and write human language, from a spam filter to a chat assistant.

Like a very fast new clerk in a busy post office: first he learns to split letters into words, then to sort them by topic, spot names and addresses, and finally to write short replies.

Words you will meet

Token
One piece of text the computer works with: a word or part of a word
Tokenization
Cutting text into those pieces
Corpus
A big collection of text used to teach or test a program
Classification
Putting a text into a group, like spam or not spam
Sentiment
Whether a text sounds happy, unhappy or neutral
Named entity
A real name in text: a person, place, company, date or amount
Embedding
A list of numbers that stands for the meaning of a word or sentence
Language model
A program that has learned to guess the next word, and so can write

The steps

  1. 1. Start from zero (11 cards): What NLP is, why language is hard, and the words you need before Core basics.
  2. 2. Core basics (18 cards): Unicode, tokens, classic classifiers, metrics, entities, regex and embeddings.
  3. 3. Next steps (18 cards): Subword tokens, transformers, fine-tuning, zero-shot, search, generation and real-world text.
  4. 4. Go deeper (18 cards): Attention maths, decoding, model choice, domains, robustness, privacy and embeddings in depth.
All 11 cards in Start from zero
What is natural language processing, in one plain sentence?
Teaching computers to work with the languages people speak and write, so they can read, sort, translate, answer and write text.
Where do you meet NLP every day?
Autocorrect and next-word hints, spam filters, voice assistants, phone translation, search boxes that understand typos, and chat assistants that write replies.
Why is language hard for a computer?
Words have many meanings ("bank" of a river or for money), people use slang, sarcasm and typos, and there are thousands of languages and scripts. Meaning depends on context.
What are tokens and tokenization?
Tokenization cuts text into pieces called tokens, such as words, parts of words or punctuation. "Don't worry!" might become "Do", "n't", "worry", "!". Everything later works on tokens.
What is a corpus?
A big collection of text used to teach or test a program, such as a million product reviews, all of a newspaper's articles, or every support email from last year.
What are classification and sentiment?
Classification puts a text into a group, like "billing question" or "delivery problem". Sentiment is a common kind: is the text happy, unhappy or neutral?
What is a named entity?
A real name in text: a person, place, company, date, amount. In "Ravi paid 500 rupees in Madurai on Monday", the entities are Ravi, 500 rupees, Madurai and Monday.
What is an embedding?
A list of numbers that stands for the meaning of a word or sentence. Texts with similar meaning get similar numbers, so the computer can tell "cheap" is close to "low price".
What is a language model?
A program trained on huge amounts of text to guess the next word. Guessing well, word after word, lets it complete sentences, answer questions and write. Chat assistants are large language models.
Why does NLP in Tamil, Hindi or Arabic need extra care?
Scripts, word endings and spelling differ a lot from English, and there is less training text for many languages. People also mix languages in one message, like Tamil written in English letters.
What do you need before Core basics, and what will you be able to do?
Basic Python and a first idea of machine learning. By the end you will clean text, build classifiers, find names in text and choose between small models and large AI models.
Natural language processing cheatsheet

spaCy

  • spacy.load("en_core_web_sm") Load an English pipeline
  • doc = nlp(text) Run the pipeline
  • tok.lemma_ Dictionary form
  • tok.pos_ Part of speech
  • doc.ents Named entities
  • doc.sents Sentences
  • nlp.pipe(texts, batch_size=64) Fast batch processing

scikit-learn text

  • TfidfVectorizer(ngram_range=(1, 2)) Words and word pairs
  • min_df=2 Drop words seen once
  • LogisticRegression(max_iter=1000) Strong linear baseline
  • classification_report(y, p) Per-class precision, recall, F1
  • f1_score(y, p, average="macro") Rare classes count equally

Hugging Face Transformers

  • AutoTokenizer.from_pretrained(name) Matching tokenizer
  • AutoModelForSequenceClassification Text classification head
  • AutoModelForTokenClassification Entity tagging head
  • pipeline("sentiment-analysis", model=...) Ready-made task
  • truncation=True, max_length=512 Cut long inputs explicitly

Unicode and cleaning

  • unicodedata.normalize("NFC", s) One form for accented text
  • len(s) Counts code points, not visible letters
  • s.encode("utf-8") Bytes for storage
  • s.casefold() Stronger lowercasing for matching
  • re.findall(pattern, s) Fixed-shape patterns

Metrics

  • precision Flagged ones that were right
  • recall Real ones that were caught
  • macro F1 Average over classes equally
  • entity-level F1 Span and type must match
  • Cohen's kappa Label agreement beyond chance
  • perplexity Lower is less surprised
Donate