Tree-mendous
Pardon the Expression
SSSSSSSSSSSSS
In the Bag (of Words)
Potpourri
100

A context free grammar has these two types of nodes.

What is terminal (strings) and non-terminal (UPPERCASE)?

100

The data type for regular expressions in python.

What is raw string (r'')?

100

This invocation at the top of a script tells the command prompt which executable should be used

What is a shebang?

100

This approach to modeling language ignores word order.

What is bag of words (BOW)?

100

This flag modifies the behavior of head to only print five lines instead of the default 10.

What is -5?

200

When parsing using CFGs, it is preferable to reformat the rules to follow this standard, because it allows us to use that parser.

What is Chomsky Normal Form and CKY parser?

200

The regex shorthand for whitespace characters like tab, space, and newline.

What is \s?

200

The only line inside the function called get_name that title cases any one-word name provided as the argument first_name.

What is

return first_name[0].upper() + first_name[1:]
200

The ratio of how often a word appears across a corpus altogether, and how many entries in the corpus it appears in.

What is TF-IDF?

200

Names for these objects are CamelCased in python

What are classes?

300

In a dependency parse, there would be an arrow from this word to that word in the phrase "the cat."

What is from "cat" to "the"?

300

This operator indicates zero or more of the previous expression.

What is the Kleene star (*)?

300

The difference between a function and a method.

What is whether or not the functionality is an attribute of a specific class?

300

These representations of words can encode many dimensions of meaning but look out: those dimensions may not actually be meaningful.

What are word embeddings?

300

All of the possible elements of a command in the command line.

What are the executable/command, flags, and arguments?

400

The reason why this grammar isn't Chomsky Normal Form:

S -> NP VP
S -> VP
S -> Aux NP VP
NP -> "dogs"
VP -> "walk"
Aux -> "do"

What is the non-terminal rules aren't binary branching?

400

The part of the string "abc123ABC?" that will be represented by \1 for the regex [a-z]\d(\d)[0-9]\w+

What is 2?

400

This code block iterates over the digits 10, 12, 14, 16, 18, 20 (without creating a variable to store them). The numbers divisible by 3 are printed to standard output.

What is

for number in range(10,21,2):
    if number % 3 == 0:
        print(number)
400

In a bigram model, this is the probability  p("am"|"I")  for the corpus

I am Sam
Sam I am
I like ham

What is 

p("am"|"I") = \frac{c("I am")}{c("I")} = \frac{2}{3}

400

The 3 special tokens we add during tokenization to accommodate sentence boundaries and unseen vocabulary.

What are BOS, EOS, and OOV (<s>, </s>, and <unk>)?

500

The reason this PFCG is invalid:

   S -> NP VP [0.5]
   S -> VP [0.3]
   S -> Aux NP VP [0.1]
NP -> "dogs" [1.0]
VP -> "walk" [1.0]
Aux -> "do" [0.9]

What is the probabilities for each LHS don't sum to 1?

500

A string accepted by (?<=M(?:r|(?:is)|s)s?\.?\s)[A-Z][a-z]+

What is "Henderson" from "Miss Henderson"?
500

A loop that iterates over the string values in the list variable named `animals` and prints every second string.

What is

for index in range(1,len(animals),2):
    print(animals[index])
500

The reason why raw probabilities are often not used in n-gram language models, being replaced by log probabilities.

What is underflow?

500

These are the class of objects raised by code when there's a problem.

What are exceptions?

M
e
n
u