dutch_sentiment_analysis: Dutch Sentiment Analysis

View source: R/sentiment_analysis.R

dutch_sentiment_analysisR Documentation

Dutch Sentiment Analysis

Description

The sentiment analysis is conducted by using a dutch sentiment dictionary that contains of +3000 classified words. Pattern matching with the classified words in the dictionary is performed by computing similarity indices and also takes negation into account ('niet leuk', 'geen charme'). The function scores textual input on a scale from -2 to 2, where negative/positive scores indicate negative/positive sentiment.

Usage

dutch_sentiment_analysis(text, output = "numeric")

Arguments

text

A character vector.

output

'numeric' (standard) or 'label'.

Details

Adjusting the output arg to 'label' yields textual output ('negative', 'neutral', 'positive')

Value

Numeric or character, depending on output arg

Examples

text <- c(
 "Ik vond de film matig",
 "De acteurs waren niet slecht",
 "Maar het script was allesbehalve goed",
 "Die kende geen spanning",
 "Zoals je van Tarantino verwacht was het plot fantastisch",
 "Gelukkig waren de bioscoopkaarten goedkoop"
)

# use function
tibble::tibble(
 lines = text,
 scores = dutch_sentiment_analysis(text)
)

Glender/DutchSentimentAnalysis documentation built on March 11, 2024, 2:36 p.m.