Given the sentence: "The cat sat on the mat." and its dependency parse, which of the following correctly represents the head of the word "sat"?
Think about which word is the main verb that connects the sentence.
In dependency parsing, the main verb of a sentence is usually the root and has no head. Here, "sat" is the root.
What is the output of the following code snippet that uses spaCy to parse the sentence "She enjoys reading books." and prints each token's text and its dependency label?
import spacy nlp = spacy.load('en_core_web_sm') doc = nlp('She enjoys reading books.') output = [(token.text, token.dep_) for token in doc] print(output)
Remember the subject usually has the label nsubj and the main verb is ROOT.
The subject "She" is labeled nsubj, "enjoys" is the root verb, "reading" is an open clausal complement xcomp, and "books" is the direct object dobj.
You want to build a dependency parser for a low-resource language with very limited annotated data. Which model approach is most suitable?
Think about leveraging existing knowledge from other languages.
Pre-trained multilingual models have learned general language patterns and can be fine-tuned effectively on small datasets, making them suitable for low-resource languages.
Which metric best measures how well a dependency parser predicts the correct head for each word in a sentence?
Focus on metrics that evaluate syntactic structure correctness.
Unlabeled Attachment Score (UAS) measures the percentage of words whose predicted head matches the gold standard, ignoring dependency labels.
You trained a dependency parser, but it often predicts the root word incorrectly, assigning root to punctuation marks. Which is the most likely cause?
Check the quality of your training annotations carefully.
If punctuation tokens are annotated as roots in training data, the model will learn to predict them as roots, causing errors.