udpipe_accuracy | R Documentation |
Get precision, recall and F1 measures on finding words / sentences / upos / xpos / features annotation as well as UAS and LAS dependency scores on holdout data in conllu format.
udpipe_accuracy( object, file_conllu, tokenizer = c("default", "none"), tagger = c("default", "none"), parser = c("default", "none") )
object |
an object of class |
file_conllu |
the full path to a file on disk containing holdout data in conllu format |
tokenizer |
a character string of length 1, which is either 'default' or 'none' |
tagger |
a character string of length 1, which is either 'default' or 'none' |
parser |
a character string of length 1, which is either 'default' or 'none' |
a list with 3 elements
accuracy: A character vector with accuracy metrics.
error: A character string with possible errors when calculating the accuracy metrics
https://ufal.mff.cuni.cz/udpipe, https://universaldependencies.org/format.html
udpipe_load_model
model <- udpipe_download_model(language = "dutch-lassysmall") if(!model$download_failed){ ud_dutch <- udpipe_load_model(model$file_model) file_conllu <- system.file(package = "udpipe", "dummydata", "traindata.conllu") metrics <- udpipe_accuracy(ud_dutch, file_conllu) metrics$accuracy metrics <- udpipe_accuracy(ud_dutch, file_conllu, tokenizer = "none", tagger = "default", parser = "default") metrics$accuracy metrics <- udpipe_accuracy(ud_dutch, file_conllu, tokenizer = "none", tagger = "none", parser = "default") metrics$accuracy metrics <- udpipe_accuracy(ud_dutch, file_conllu, tokenizer = "default", tagger = "none", parser = "none") metrics$accuracy } ## cleanup for CRAN only - you probably want to keep your model if you have downloaded it if(file.exists(model$file_model)) file.remove(model$file_model)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.