infer_from_text: infer from text with target

View source: R/infer_from_text.R

infer_from_textR Documentation

infer from text with target

Description

infer from text with target

Usage

infer_from_text(left = NULL, target = NULL, right = NULL)

Arguments

left

The text from the beginning of the sentence to the mention of the target (will be empty if the sentence starts with the mention of the target). Make sure to include a space if there is one between the left phrase and the target mention, e.g., "I like Peter." -> left="I like ", target="Peter", right=".".""

target

The mention of the target.

right

The text from the end of the target to the end of the sentence. Make sure to include a space if there is one between the target and the next word of the sentence.

Value

the sentiment

Examples

sentiment <- infer_from_text("I like ", "Peter", " but I don't like Robert.")
print(sentiment[0])

fhamborg/sentiment4news documentation built on April 12, 2022, 12:36 p.m.