Sentiment dictionary lexicon for different languages

Hello, I would like to make the following code work for Spanish and Portuguese :

Get a French sentiment dictionary lexicon with positive/negative terms, negators, amplifiers and deamplifiers

load(file("https://github.com/sborms/sentometrics/raw/master/data-raw/FEEL_fr.rda"))
load(file("https://github.com/sborms/sentometrics/raw/master/data-raw/valence-raw/valShifters.rda"))
polarity_terms <- rename(FEEL_fr, term = x, polarity = y)
polarity_negators <- subset(valShifters$valence_fr, t == 1)$x
polarity_amplifiers <- subset(valShifters$valence_fr, t == 2)$x
polarity_deamplifiers <- subset(valShifters$valence_fr, t == 3)$x

I struggle finding equivalents for these languages and don't really understand how I am supposed to recode polarity_terms, polarity_negators, polarity_amplifiers, polarity_deamplifiers

Thank you in advance if anyone can help!!

Hi, I didn't understand the issue exactly. Can you provide more details?

if you want to have the same variables for Spanish language, you can create the vector of factors using:
polarity_negators = as.factor( c("no son", "no pueden", "no podrían" ) )

And the datatable using:
polarity_deamplifiers = data.table::data.table(term= c("no son", "no pueden", "no podrían" ), polarity = c(-1,-1,-1))

Hi, unfortunately I don't understand Spanish, my first search for negation words and amplifiers didn't lead to anything. Maybe someone who understands Spanish will find something useful on Spanish repositories.
For instance, a way to do this is to create them from scratch. If you understand Spanish you can create them manually. Otherwise you can save the English or French versions to a file and then translate them (not a good solution for important projects, but can be useful for a first version and to not stay blocked at this stage).

1 Like

Thank you very for your time and your help!!

1 Like

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.

Hi ! Thank you for your response !

The example given is for French and I would like to adapt it to Spanish. I am following the code of this page : http://www.bnosac.be/index.php/blog/85-you-did-a-sentiment-analysis-with-tidytext-but-you-forgot-to-do-dependency-parsing-to-answer-why-is-something-positive-negative

It is my first time using R so I don't understand much. I am struggling in finding the lexicons I should use in order to follow the same code as the example and have polarity_terms, polarity_negators, polarity_amplifiers, polarity_deamplifiers properly coded to move on to the next step.

I only found sentiment dictionaries for Spanish (only positive or negative terms) without the other factors. Do you have any idea how I should more from here ?

thank you in advance !