
Tokenise, Tag and Dependency Parsing Annotation of raw text
udpipe_annotate(object, x, doc_id = paste("doc", seq_along(x), sep = ""),
tokenizer = "tokenizer", tagger = c("default", "none"),
parser = c("default", "none"), ...)
an object of class udpipe_model
as returned by udpipe_load_model
a character vector in UTF-8 encoding where each element of the character vector contains text which you like to tokenize, tag and perform dependency parsing.
an identifier of a document with the same length as x
. This should be a character vector.
doc_id[i]
corresponds to x[i]
.
a character string of length 1, which is either 'tokenizer' (default udpipe tokenisation)
or a character string with more complex tokenisation options
as specified in http://ufal.mff.cuni.cz/udpipe/users-manual in which case tokenizer
should be a character string where the options
are put after each other using the semicolon as separation.
a character string of length 1, which is either 'default' (default udpipe POS tagging and lemmatisation)
or 'none' (no POS tagging and lemmatisation needed) or a character string with more complex tagging options
as specified in http://ufal.mff.cuni.cz/udpipe/users-manual in which case tagger
should be a character string where the options
are put after each other using the semicolon as separation.
a character string of length 1, which is either 'default' (default udpipe dependency parsing) or
'none' (no dependency parsing needed) or a character string with more complex parsing options
as specified in http://ufal.mff.cuni.cz/udpipe/users-manual in which case parser
should be a character string where the options
are put after each other using the semicolon as separation.
currently not used
a list with 3 elements
x: The x
character vector with text.
conllu: A character vector of length 1 containing the annotated result of the annotation flow in CONLL-U format. This format is explained at http://universaldependencies.org/format.html
error: A vector with the same length of x
containing possible errors when annotating x
https://ufal.mff.cuni.cz/udpipe, https://lindat.mff.cuni.cz/repository/xmlui/handle/11234/1-2364, http://universaldependencies.org/format.html
# NOT RUN {
x <- udpipe_download_model(language = "dutch-lassysmall")
ud_dutch <- udpipe_load_model(x$file_model)
## Tokenise, Tag and Dependency Parsing Annotation. Output is in CONLL-U format.
txt <- c("Dus. Godvermehoeren met pus in alle puisten,
zei die schele van Van Bukburg en hij had nog gelijk ook.
Er was toen dat liedje van tietenkonttieten kont tieten kontkontkont,
maar dat hoefden we geenseens niet te zingen.
Je kunt zeggen wat je wil van al die gesluierde poezenpas maar d'r kwam wel
een vleeswarenwinkel onder te voorschijn van heb je me daar nou.
En zo gaat het maar door.",
"Wat die ransaap van een academici nou weer in z'n botte pan heb gehaald mag
Joost in m'n schoen gooien, maar feit staat boven water dat het een gore
vieze vuile ransaap is.")
x <- udpipe_annotate(ud_dutch, x = txt)
cat(x$conllu)
as.data.frame(x)
## Only tokenisation
x <- udpipe_annotate(ud_dutch, x = txt, tagger = "none", parser = "none")
as.data.frame(x)
## Only tokenisation and POS tagging + lemmatisation, no dependency parsing
x <- udpipe_annotate(ud_dutch, x = txt, tagger = "default", parser = "none")
as.data.frame(x)
## Only tokenisation and dependency parsing, no POS tagging nor lemmatisation
x <- udpipe_annotate(ud_dutch, x = txt, tagger = "none", parser = "default")
as.data.frame(x)
## Provide doc_id for joining and identification purpose
x <- udpipe_annotate(ud_dutch, x = txt, doc_id = c("id1", "feedbackabc"),
tagger = "none", parser = "none")
as.data.frame(x)
## cleanup for CRAN only - you probably want to keep your model if you have downloaded it
file.remove("dutch-lassysmall-ud-2.0-170801.udpipe")
# }
Run the code above in your browser using DataLab