View source: R/sentiment_analysis.R
dutch_sentiment_analysis | R Documentation |
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.
dutch_sentiment_analysis(text, output = "numeric")
text |
A character vector. |
output |
'numeric' (standard) or 'label'. |
Adjusting the output
arg to 'label' yields textual output ('negative', 'neutral', 'positive')
Numeric or character, depending on output arg
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)
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.