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

Study methods

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

Natural Language Processing

  • 95Unfamiliar
  • 0Learning
  • 0Familiar
  • 0Mastered
Topic: NLP Foundations
  • 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 field of getting computers to work with and understand human natural language.

Or swipe the card

95 cards

  1. What is natural language processing (NLP)?

    The field of getting computers to work with and understand human natural language.

  2. What is automatic summarization?

    Generating a shorter representation of a longer text.

  3. What is information extraction?

    Automatically pulling relevant facts or details from text.

  4. What is machine translation?

    Translating text automatically from one language into another.

  5. What is question answering in NLP?

    Understanding a question or text input and generating an appropriate textual response.

  6. What is text classification?

    Assigning a label or category to a piece of text.

  7. What is syntax?

    The structure of language and the rules governing how words combine.

  8. What is semantics?

    The meaning of words and sentences.

  9. Why is natural language ambiguous?

    A single sentence can have multiple valid structures or interpretations.

  10. What does “Colorless green ideas sleep furiously” demonstrate?

    A sentence can be syntactically well-formed but semantically meaningless.

  11. What is a formal grammar?

    A system of rules for generating sentences in a language.

  12. What is a context-free grammar (CFG)?

    A formal grammar in which symbols can be rewritten according to rules that do not depend on surrounding context.

  13. What is a terminal symbol in a CFG?

    A final word or symbol that is not rewritten further.

  14. What is a nonterminal symbol in a CFG?

    A symbol that can be rewritten into terminal or other nonterminal symbols.

  15. What do CFG rewriting rules specify?

    They specify which symbols a nonterminal can be replaced by.

  16. What is a noun phrase according to the example CFG?

    A noun phrase can be a noun or a determiner followed by a noun: NP→N∣DNNP \rightarrow N \mid DNNP→N∣DN.

  17. What is a verb phrase according to the example CFG?

    A verb phrase can be a verb or a verb followed by a noun phrase: VP→V∣VNPVP \rightarrow V \mid VNPVP→V∣VNP.

  18. How is a sentence defined in the example CFG?

    As a noun phrase followed by a verb phrase: S→NPVPS \rightarrow NPVPS→NPVP.

  19. What do DDD, NNN, and VVV represent in a CFG?

    DDD represents a determiner, NNN a noun, and VVV a verb.

  20. What additional phrase types can be included in a more complex CFG?

    Adjective phrases (APAPAP) and prepositional phrases (PPPPPP).

  21. What can a CFG parser produce for an ambiguous sentence?

    Multiple syntax trees representing different valid interpretations.

  22. What is NLTK?

    The Natural Language Toolkit, a Python library containing tools for processing natural language.

  23. What is an n-gram?

    A contiguous sequence of nnn items from text, such as characters or words.

  24. What is a bigram?

    An n-gram containing two consecutive items.

  25. What is a trigram?

    An n-gram containing three consecutive items.

  26. Why can n-grams help a computer understand language structure?

    Their frequencies reveal which sequences of words commonly occur together.

  27. What is tokenization?

    Splitting a sequence of characters into smaller pieces called tokens.

  28. How can common n-grams be identified in a corpus?

    Extract the n-grams and count their frequencies.

  29. What is a Markov chain in language modeling?

    A model that predicts the next value based on preceding values.

  30. How can a Markov model generate new text?

    It repeatedly predicts a likely next word based on statistical patterns learned from a text corpus.

  31. What is a limitation of simple Markov text generation?

    The generated text may follow statistical patterns without having meaningful or coherent content.

  32. What is text classification?

    The task of placing text into a category or assigning it a label.

  33. What is sentiment analysis?

    Classifying text according to its emotional or evaluative polarity, such as positive or negative.

  34. What is the bag-of-words model?

    A representation of text as an unordered collection of its words.

  35. What information does the bag-of-words model discard?

    The sequence and ordering of words.

  36. What is a Naive Bayes classifier?

    A text-classification model that uses Bayes’ rule and assumes the words are conditionally independent given the class.

  37. What is Bayes’ rule?

    Bayes’ rule relates conditional probabilities: P(B∣A)=P(A∣B)P(B)P(A)P(B\mid A)=\frac{P(A\mid B)P(B)}{P(A)}P(B∣A)=P(A)P(A∣B)P(B)​.

  38. How is a positive-review probability expressed using Bayes’ rule?

    P(positive∣words)=P(words∣positive)P(positive)P(words)P(positive\mid words)=\frac{P(words\mid positive)P(positive)}{P(words)}P(positive∣words)=P(words)P(words∣positive)P(positive)​.

  39. Why can the denominator be omitted when comparing Naive Bayes classes?

    The probability of the observed words is the same for every candidate class.

  40. What is the naive independence assumption?

    The model assumes that words are independent of one another once the sentiment class is known.

  41. How is the prior probability of a class estimated?

    By dividing the number of training examples in that class by the total number of training examples.

  42. How is a conditional word probability estimated in Naive Bayes?

    By dividing the number of reviews in a class containing the word by the total number of reviews in that class.

  43. How does Naive Bayes calculate a class score for multiple words?

    It multiplies the class prior by the conditional probability of each observed word given that class.

  44. What is the zero-frequency problem in Naive Bayes?

    If a word never appears in a class during training, its conditional probability is zero, making the entire class score zero.

  45. What is additive smoothing?

    Adding a value α\alphaα to counts or probabilities to prevent zero values.

  46. What is Laplace smoothing?

    A form of additive smoothing that adds 111 to each count.

  47. What does a trained Naive Bayes sentiment classifier learn?

    It learns which words tend to occur in positive versus negative examples.

  48. What is a one-hot representation?

    A vector representing a word with one 111 and all other entries equal to 000.

  49. What is a major scalability problem with one-hot vectors?

    Their length grows with the vocabulary size, producing very long vectors for large vocabularies.

  50. Why do one-hot vectors poorly represent semantic similarity?

    Words with similar meanings still receive entirely different, equally distant vectors.

  51. What is a distributed representation?

    A representation in which a word’s meaning is distributed across multiple numerical values.

  52. Why must words be converted into numerical vectors for neural networks?

    Neural networks take numerical values, such as vectors, as inputs and outputs.

  53. What does the statement “You shall know a word by the company it keeps” mean?

    A word’s meaning can be inferred from the words that commonly appear around it.

  54. How can context reveal word similarity?

    Words that fit into similar surrounding contexts are treated as having similar meanings.

  55. What is the word2vec model?

    A model that learns vector representations of words from the contexts in which they appear.

  56. What determines the similarity of word2vec vectors?

    The similarity of the words’ usage contexts in the training data.

  57. How can distances between word vectors be interpreted?

    A smaller distance indicates more similar meanings, while a larger distance indicates less similarity.

  58. What kinds of words can word2vec place near “book”?

    Words such as “books,” “essay,” “memoir,” “novella,” and “anthology.”

  59. How can word2vec represent relationships between words?

    Vector differences can encode relationships that transfer to other words.

  60. Why are word vectors useful for neural networks?

    They provide numerical representations that neural networks can use to learn language patterns and make predictions.

  61. What is a sequence-to-sequence task?

    A task that converts one variable-length sequence into another sequence.

  62. Why is translating a sentence harder than translating one word with a neural network?

    A sentence has variable length, whereas a basic neural network expects fixed-size inputs and outputs.

  63. What is a recurrent neural network (RNN)?

    A neural network that processes a sequence repeatedly while passing a hidden state from one step to the next.

  64. What is an encoder-decoder architecture?

    An architecture in which an encoder converts an input sequence into a hidden representation and a decoder generates the output sequence from it.

  65. What does the encoder do in an encoder-decoder RNN?

    It processes each input token and updates a hidden state until it produces a final representation of the input.

  66. What does the decoder do in an encoder-decoder RNN?

    It uses the encoded hidden state and previously generated tokens to produce the output sequence one token at a time.

  67. Why are special start or end tokens used?

    They signal when decoding begins or when the output sequence is complete.

  68. What is the fixed-context bottleneck in a basic encoder-decoder RNN?

    The entire input sequence must be compressed into one final hidden state.

  69. What is attention in sequence modeling?

    A mechanism that determines which input representations are most important when generating a particular output token.

  70. What are attention scores?

    Values indicating how relevant each input representation is to generating the current output token.

  71. How is an attention context vector formed?

    By taking a weighted combination of the input hidden-state vectors using their attention scores.

  72. How can attention scores be calculated?

    They can be computed using a similarity measure such as a dot product or learned by a neural network.

  73. Why can attention improve machine translation?

    It lets each generated word focus on the most relevant source-language words.

  74. What is a major computational limitation of RNNs?

    Their sequential dependence makes them difficult to parallelize.

  75. What is the Transformer architecture?

    A neural architecture for language processing that relies heavily on attention and can process sequence elements in parallel.

  76. What is the main parallelization advantage of a Transformer encoder?

    It can process all input words through the same network at the same time.

  77. What information is lost when Transformer words are processed independently?

    The original ordering of the words.

  78. What is positional encoding?

    A vector representing a word’s position in a sequence.

  79. What information does the combination of a word vector and positional encoding contain?

    It contains both the identity or meaning of the word and its position in the sentence.

  80. What is self-attention in a Transformer encoder?

    A mechanism allowing each input word to attend to other input words when determining its representation.

  81. Why is self-attention useful?

    It allows a word’s encoded representation to incorporate relevant information from other words in the input.

  82. What is multi-headed attention?

    Using multiple attention mechanisms simultaneously so the model can focus on different aspects of the input.

  83. Why are Transformer layers repeated?

    Repeated attention and feed-forward layers allow the model to learn deeper patterns and richer representations.

  84. What does a Transformer encoder produce?

    An encoded representation for each input word.

  85. What does Transformer decoder self-attention do?

    It allows an output position to attend to relevant previously generated output words.

  86. What additional attention mechanism does a Transformer decoder use?

    It attends to the encoder’s representations of the input words.

  87. How does a Transformer generate an output sequence?

    The decoder uses prior output tokens, their positions, self-attention, and attention to encoded input representations to predict the next token.

  88. Why are Transformers effective for large language models?

    Their attention-based design is more amenable to parallel training on large datasets than recurrent architectures.

  89. What are some possible Transformer configurations?

    A Transformer may use only an encoder, only a decoder, or a combination of both.

  90. What is a search problem in artificial intelligence?

    A problem in which an AI searches through possibilities to find a solution or decision.

  91. How does AI use knowledge representation?

    It represents known information and uses it to derive or generate new knowledge.

  92. Why does AI use probability?

    To represent uncertainty when facts or outcomes are not known with certainty.

  93. What is an optimization problem in AI?

    A problem involving the maximization or minimization of a function.

  94. What is machine learning?

    Learning patterns from data in order to perform a task or make predictions.

  95. What is a neural network?

    A sequence or network of computational units whose weights are trained to map inputs to outputs.

Card 1 of 95
Card 1 of 95

Ask anything

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

FlashcardsQuizFill in the blanksWritten testLessonNotesPodcastContent