Look at the morphological features from the udpipe
annotation. These are put in the feats column of the annotation. And you can put these as extra columns in the dataset by using cbind_morphological
.
All the features are defined at https://universaldependencies.org/u/feat/index.html
You'll see below that prescribed from the sentence 'I prescribed this medication' is past tense as well as the word taken and had from 'he had already taken'.
library(udpipe)
x <- data.frame(doc_id = 1:4,
text = c("I will prescribe this medication",
"I prescribed this medication",
"He had already taken the stuff",
"he may take the stuff later"),
stringsAsFactors = FALSE)
anno <- udpipe(x, "english")
anno <- cbind_morphological(anno)
anno[, c("doc_id", "token", "lemma", "feats", "morph_verbform", "morph_tense")]
doc_id token lemma feats morph_verbform morph_tense
1 I I Case=Nom|Number=Sing|Person=1|PronType=Prs <NA> <NA>
1 will will VerbForm=Fin Fin <NA>
1 prescribe prescribe VerbForm=Inf Inf <NA>
1 this this Number=Sing|PronType=Dem <NA> <NA>
1 medication medication Number=Sing <NA> <NA>
2 I I Case=Nom|Number=Sing|Person=1|PronType=Prs <NA> <NA>
2 prescribed prescribe Mood=Ind|Tense=Past|VerbForm=Fin Fin Past
2 this this Number=Sing|PronType=Dem <NA> <NA>
2 medication medication Number=Sing <NA> <NA>
3 He he Case=Nom|Gender=Masc|Number=Sing|Person=3|PronType=Prs <NA> <NA>
3 had have Mood=Ind|Tense=Past|VerbForm=Fin Fin Past
3 already already <NA> <NA> <NA>
3 taken take Tense=Past|VerbForm=Part Part Past
3 the the Definite=Def|PronType=Art <NA> <NA>
3 stuff stuff Number=Sing <NA> <NA>
4 he he Case=Nom|Gender=Masc|Number=Sing|Person=3|PronType=Prs <NA> <NA>
4 may may VerbForm=Fin Fin <NA>
4 take take VerbForm=Inf Inf <NA>
4 the the Definite=Def|PronType=Art <NA> <NA>
4 stuff stuff Number=Sing <NA> <NA>
4 later later <NA> <NA> <NA>