Find the sentiment score (between 0 and 1) of a word, sentence or a Document based on a trained model (using Flux) on IMDB word corpus with weights saved are used to calculate the sentiments.

sentiment(text)

# S3 method for document
sentiment(text)

# S3 method for documents
sentiment(text)

# S3 method for corpus
sentiment(text)

Arguments

text

An object of class document or corpus.

Examples

# NOT RUN {
init_textanalysis()

# build document
doc <- string_document(
  "An awesome, great, simply brillaint, function!"
)

sentiment(doc)
# }