textplot_dependencyparser {textplot} | R Documentation |
Plot output of a dependency parser
Description
Plot output of a dependency parser. This plot takes one sentence and shows for the sentence, the words, the parts of speech tag and the dependency relationship between the words.
Usage
textplot_dependencyparser(x, ...)
## Default S3 method:
textplot_dependencyparser(
x,
title = "Dependency Parser",
subtitle = "tokenisation, parts of speech tagging & dependency relations",
vertex_color = "darkgreen",
edge_color = "red",
size = 3,
base_family = "",
layout = "linear",
...
)
Arguments
x |
a data.frame as returned by a call to |
... |
not used yet |
title |
character string with the title to use in the plot |
subtitle |
character string with the title to use in the plot |
vertex_color |
character with the color of the label of each node. Defaults to darkgreen. |
edge_color |
character with the color of the edges between the nodes. Defaults to red. |
size |
size of the labels in the plot. Defaults to 3. |
base_family |
character passed on to |
layout |
the type of layout, defaults to 'linear', passed on to |
Value
an object of class ggplot
See Also
Examples
library(udpipe)
library(ggraph)
library(ggplot2)
library(igraph)
x <- udpipe("The economy is weak but the outlook is bright", "english")
textplot_dependencyparser(x)
x <- udpipe("His speech about marshmallows in New York is utter bullshit", "english")
textplot_dependencyparser(x, size = 4)
x <- udpipe("UDPipe provides tokenization, tagging, lemmatization and
dependency parsing of raw text", "english")
textplot_dependencyparser(x, size = 4)
data("example_udpipe", package = "textplot")
textplot_dependencyparser(example_udpipe, size = 4)
[Package textplot version 0.2.2 Index]