display_ent: Visualize entities in text parsed with spacyr.

Description Usage Arguments Details Value Examples

View source: R/display_ent.R

Description

Visualize entities in text parsed with spacyr.

Usage

1
display_ent(x, deco_ent = "bgYellow", deco_lab = "bgBlue")

Arguments

x

A spacyr_parsed object

deco_ent

A crayon style for entity name, given as a character string

deco_lab

A crayon style for entity label, given as a character string

Details

x must include the "whitespace_" attribute. Therefore, spacy_parse should be run with the additional_attributes argument: spacy_parse(x, ..., additional_attributes = "whitespace_"). This function is designed to be called for its side effect, which outputs a styled character vector to the terminal.

Value

A character string with styled tokens

Examples

1
2
3
4
5
6
## Not run: 
txt <- "Larry Page is the co-founder of Google, located in Mountain View, CA."
parsed <- spacyr::spacy_parse(txt, additional_attributes = "whitespace_")
display_ent(parsed)

## End(Not run)

weihuangwong/displacyr documentation built on May 6, 2019, 12:04 a.m.