extractSentenceInfo: extractSentenceInfo

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

Description

Given a sentence and a ner model get info on the all the entities found in the sentence

Usage

1
2
extractSentenceInfo(sentence, nerModel, requiredTerms = NULL,
  ignore.case = TRUE)

Arguments

sentence

A sentence of text

nerModel

A ner model supplied by MITIE

requiredTerms

A vector of terms that must be extracted if they exist

ignore.case

Logical indicating if requiredTerms is not case sensitive

Details

Given a sentence and a ner model get info on the all the entities found in the sentence

Value

A tbl with one row per entity found in the sentence

Author(s)

Jared P. Lander

See Also

extractEntity

Examples

1
2
3
4
5
6
7
8
## Not run: 
ner_model_path <- "tests/data/ner_model.dat"
ner <- NamedEntityExtractor$new(ner_model_path)
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"
extractSentenceInfo(theText, nerModel=ner)
extractSentenceInfo(theText, nerModel=ner, requiredTerms=c('network'))

## End(Not run)

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