extractEntityInfo: extractEntityInfo

Description Usage Arguments Details Value Author(s) See Also Examples

Description

For a single entity this grabs the information

Usage

1
extractEntityInfo(entity, tokens, tagNames)

Arguments

entity

A single entity as found by MITIE

tokens

The tokens from text as found by MITIE

tagNames

The possible tags from this MITIE model

Details

For a single entity this grabs the information

Value

A one-row tbl holding the Entity, Type, Start and Stop point at the tokens

Author(s)

Jared P. Lander

See Also

extractEntity

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
## Not run: 
ner_model_path <- "tests/data/ner_model.dat"
ner <- NamedEntityExtractor$new(ner_model_path)
tag_names <- ner$get_possible_ner_tags()
theText <- "A network of new super PACs said Wednesday that it had raised $31 million to support Senator Ted Cruz's presidential campaign, a sum that could upend expectations in the race for the Republican nomination and rewrite the political rule book for outside spending"
tokens <- mitie_tokenize(theText)
entities <- ner$extract_entities(tokens)
extractEntityInfo(entities[[1]], tokens, tag_names)
extractEntityInfo(entities[[2]], tokens, tag_names)

## End(Not run)

jaredlander/TextInfo documentation built on May 18, 2019, 3:46 p.m.