BaşlayınÜcretsiz Başlayın

Getting Sentiment Lexicons

So far you have used a single lexicon. Now we will transition to using three, each measuring sentiment in different ways.

The tidytext package contains a function called get_sentiments which along with the [textdata] package allows you to download & interact well researched lexicons. Here is a small section of the loughran lexicon.

Word Sentiment
abandoned negative
abandoning negative
abandonment negative
abandonments negative
abandons negative

This lexicon contains 4150 terms with corresponding information. We will be exploring other lexicons but the structure & method to get them is similar.

Let's use tidytext with textdata to explore other lexicons' word labels!

Bu egzersiz

Sentiment Analysis in R

kursunun bir parçasıdır
Kursu Görüntüle

Uygulamalı interaktif egzersiz

Bu örnek kodu tamamlayarak bu egzersizi bitirin.

# Subset to AFINN
afinn_lex <- get_sentiments("___")

# Count AFINN scores
afinn_lex %>% 
  ___(value)
Kodu Düzenle ve Çalıştır