pairEntities: pairEntities

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

Description

Given a list of entities find all combinations.

Usage

1
pairEntities(data, entity = "Entity")

Arguments

data

A tbl created by extractSentenceInfo

entity

The name of the column holding entity

Details

Given a list of entities find all combinations. This expects the data to be of the form |Entity|Type|Start|Stop| as created by extractSenetenceInfo.

Value

A two-column tbl like a pair list between the entities found together

Author(s)

Jared P. Lander

See Also

extractSentenceInfo

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
## Not run: 
ner_model_path <- "mitie/MITIE-models/english/ner_model.dat"
ner <- NamedEntityExtractor$new(ner_model_path)
textFiles <- file.path('data', 'NYTimes', dir('data/NYTimes/'))
thisText <- readLines(textFiles[1])
sentences <- sent_detect(thisText)
# run on just one sentence
oneSent <- extractSentenceInfo(sentences[1], nerModel=ner)
pairEntities(oneSent)

## End(Not run)

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