NLP & RNN Flashcards

1
Q

What does NLP stand for?

A

Natural Language Processing

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What are LLMs?

A

Large Language Models

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

List three tools included in NLP.

A
  • N-grams
  • TF-IDF
  • Bag of Words
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is the main goal of NLP?

A

Make machines understand and interpret human language (spoken or written)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What are the two major tasks of NLP?

A
  • Natural Language Understanding (NLU)
  • Natural Language Generation (NLG)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Define Natural Language Understanding (NLU).

A

Get meaning from language

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Define Natural Language Generation (NLG).

A

Produce human-like text

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is lexical ambiguity?

A

Word meaning ambiguity, e.g., ‘bank’ (money vs river)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is semantic ambiguity?

A

Sentence meaning ambiguity, e.g., ‘I saw him with a telescope’

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is anaphoric ambiguity?

A

Referring to something earlier, e.g., ‘He told his dog to sit, and it did’

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

List three applications of NLU.

A
  • Search
  • Word prediction
  • Text classification (e.g., spam detection)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is the first step in the NLP pipeline?

A

Sentence Segmentation

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Fill in the blank: The process of breaking sentences into words is called _______.

A

Tokenization

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is the difference between stemming and lemmatization?

A
  • Stemming: Chops suffixes crudely
  • Lemmatization: Uses dictionary rules
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Provide an example of stemming.

A

‘drove’ → ‘drov’

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Provide an example of lemmatization.

A

‘drove’ → ‘drive’

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

What are stop words?

A

Common words with little meaning on their own (e.g., ‘the’, ‘is’, ‘and’)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

Why are stop words removed in text analysis?

A

Helps reduce noise in text analysis

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

What does POS tagging stand for?

A

Part of Speech tagging

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

List four types of labels assigned in POS tagging.

A
  • Noun
  • Verb
  • Adjective
  • Adverb
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

What does Bag of Words (BoW) do?

A

Converts text into a vector of word counts, ignoring word order

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

What is a limitation of the Bag of Words model?

A

Loses grammar & order info

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

What is the purpose of Information Retrieval Models?

A

Rank documents based on similarity to a search query

24
Q

What are the components of the TF-IDF formula?

A
  • TF = How often word shows up in a doc
  • IDF = How rare word is in whole corpus
  • TF-IDF = TF × IDF
25
What does TF-IDF emphasize?
Unique, meaningful words
26
What does an N-gram predict?
Next word using previous N-1 words
27
What is a Bigram?
2 words
28
What is a Trigram?
3 words
29
What is a limitation of N-grams?
High memory usage with large N
30
True or False: N-grams can handle unseen sequences.
False
31
What do LLMs use to solve limitations of N-grams?
Neural networks
32
What is the Bag of Words model?
Counts word occurrences, but ignores order
33
What does TF-IDF measure?
Measures word importance across documents
34
What is an N-Gram model?
Predicts the next word based on the previous N−1 words
35
What is a Bigram?
A two-word sequence
36
What is a limitation of the Bag of Words model?
Ignores long-term relationships (word order & meaning fade fast)
37
How many total reviews were in the IMDB dataset?
50,000 total reviews
38
What is the distribution of positive and negative reviews in the IMDB dataset?
50% positive, 50% negative
39
What type of classification is used with the IMDB dataset?
Binary classification (0 = negative, 1 = positive)
40
What is the first step in building the IMDB classifier with a Fully Connected Network?
Data Preprocessing
41
What transformation is applied to word indices in data preprocessing?
Convert to 10,000-length one-hot vectors
42
What is the structure of the Fully Connected Network (FCN) used for IMDB classification?
Sequential model with three layers: Dense(16, activation='relu'), Dense(16, activation='relu'), Dense(1, activation='sigmoid')
43
What is the optimizer used in compiling the FCN model?
Adam
44
What is the loss function used in the FCN model?
Binary crossentropy
45
What is a major issue with Fully Connected Networks in text classification?
They ignore word order
46
What do Recurrent Neural Networks (RNNs) retain across time steps?
Memory
47
What is the key idea behind RNNs?
Input at time t → output + passes info (h_t) to next step
48
What does the hidden state (h) in RNNs do?
Carries context forward
49
What is Backpropagation Through Time (BTT) in RNNs?
Learning via forward pass through time, loss computed at final step, backward pass through each time step
50
What is used to ensure all sequences are the same length in RNNs?
Padding sequences
51
What are word embeddings?
Dense vectors that encode meaning instead of one-hot vectors
52
What does Word2Vec learn?
Word relationships
53
What are the two models of Word2Vec?
* CBOW: Predict center word from context * Skip-Gram: Predict context from center word
54
What is the first layer in the IMDB + RNN model?
Embedding layer
55
What does the LSTM stand for?
Long Short-Term Memory Networks
56
What problem do LSTMs solve in RNNs?
Vanishing gradients
57
What are the three gates in LSTMs and their roles?
* Input Gate: Allow new info in * Forget Gate: Discard old info * Output Gate: Output current state