1. Home
  2. Explore
  3. Computer Science
  4. Natural Language Processing with spaCy

Study methods

Flashcards
Quiz
Fill in the blanks
Written test
Lesson
Notes
Podcast
Content

Natural Language Processing with spaCy

  • 23Unfamiliar
  • 0Learning
  • 0Familiar
  • 0Mastered
Topic: Natural Language Processing Basics
  • spaceFlip card
  • KI knew it
  • DI didn't know it
  • ←Previous card
  • →Next card

What is Natural Language Processing (NLP)?

Tap to flipClick to flipspace

The process by which a computer system understands, parses, and extracts human language, often from raw text.

Or swipe the card

23 cards

  1. What is Natural Language Processing (NLP)?

    The process by which a computer system understands, parses, and extracts human language, often from raw text.

  2. List five common NLP tasks.

    Named entity recognition, part-of-speech tagging, syntactic parsing, text categorization, coreference resolution, machine translation.

  3. What is Natural Language Understanding (NLU)?

    A field adjacent to NLP that trains computer systems for tasks like relation extraction, semantic parsing, question answering, summarization, sentiment analysis, and paraphrasing.

  4. Define information extraction in NLP.

    The process of extracting structured data (metadata) from unstructured raw text by finding relevant information.

  5. Give an example of information extraction from financial documents.

    Extracting company names, stocks, indexes, and stock exchanges from news articles (e.g., from Reuters, NYT, Wall Street Journal).

  6. What is text categorization (text classification)?

    Assigning a label to a piece of text based on its content, such as spam detection (spam or not spam).

  7. Provide a real-world example of text categorization.

    Spam detection in emails, where a machine learning model assigns a spam label to emails that match patterns of previously seen spam.

  8. How do lawyers use NLP for document analysis?

    They use NLP for classification and information extraction to find relevant keywords or classified documents, reducing millions of documents to a handful that need to be read verbatim.

  9. What is spaCy?

    A Python framework for NLP (as of 2021, primarily Python-based) that provides tools for processing text, including off-the-shelf models and custom training.

  10. List two other NLP frameworks available in Python besides spaCy.

    NLTK (Natural Language Toolkit) and Stanza.

  11. What are four reasons Dr. Mattingly chose spaCy over other NLP frameworks?

    1. Off-the-shelf models benchmark well (fast, accurate with metrics like precision/recall). 2) Leverages transformer models (e.g., BERT). 3) Provides a framework for custom training relatively easily. 4) Scales well to process hundreds of thousands of documents efficiently.
  12. Who created spaCy and what was its main design purpose?

    Created by Explosion AI; designed to work at scale, processing large quantities of documents efficiently, effectively, and accurately.

  13. How do you install spaCy via pip?

    Run pip install spacy in the terminal or in a Jupyter notebook with an exclamation mark (!pip install spacy).

  14. How do you download an English spaCy model (small) using the terminal?

    Run python -m spacy download en_core_web_sm.

  15. How do you create a spaCy NLP object for the small English model?

    Use nlp = spacy.load('en_core_web_sm') after importing spaCy.

  16. What are the three parts of the spaCy video course described by Dr. Mattingly?

    Part 1: Using off-the-shelf spaCy features. Part 2: Rules-based components (entity ruler, matcher, regex patterns, custom components). Part 3: Applying lessons to information extraction from financial documents (stocks, markets, indexes, stock exchanges).

  17. What is the recommended learning method for the spaCy course?

    First pass: watch the entire video to get an umbrella sense. Second pass: replicate each step by coding along. Third pass: try to do it independently without looking at the textbook or video.

  18. What are containers in spaCy?

    Objects that contain a large quantity of data about a text. Examples: Doc, Span, Token, Lexeme, Language, SpanGroup.

  19. Explain the hierarchical relationship among Doc, Token, and Span in spaCy.

    The Doc object sits at the top, containing all metadata about a text. Iterating over a Doc yields individual Tokens (words/punctuation). Spans are sequences of one or more Tokens (e.g., a proper name like 'Martin Luther King').

  20. What is a Token in spaCy?

    An individual word or punctuation mark in the text that has syntactic or semantic value.

  21. What is a Span in spaCy?

    A sequence of one or more Tokens that form a self-contained unit, such as a named entity or a multi-word phrase.

  22. How do you create a Doc object from text in spaCy?

    Pass the text to the NLP object: doc = nlp('Your text here.')

  23. How can you access sentences within a Doc object?

    Use doc.sents to iterate over sentences, each of which is a Span object.

Card 1 of 23
Card 1 of 23

Ask anything

We've read this whole study set, so questions about it get the best answers.

FlashcardsQuizFill in the blanksWritten testLessonNotesPodcastContent