amrrs / sentiment-turkish-tidytext

Code to use tidytext for Custom Sentiment Analysis using your own lexicon / dictonary
MIT License
5 stars 1 forks source link

Error "sent" #2

Open baris-karakoc opened 3 years ago

baris-karakoc commented 3 years ago

hello again, thank you for everything.

sent %>%
  mutate(linenumber = row_number()) %>% #line number for later sentence grouping 
  unnest_tokens(word, column.1) %>% #tokenization - sentence to words
  inner_join(lexicon2) %>% # inner join with our lexicon to get the polarity score
  group_by(linenumber) %>% #group by for sentence polarity
  summarise(sentiment = sum(value)) %>% # final sentence polarity from words
  left_join(
  sent %>%
    mutate(linenumber = row_number()) #get the actual text next to the sentiment value
) %>% write.csv("sentiment_output.csv",row.names = FALSE)

and when I run error : Error in mutate(., linenumber = row_number()) : 'sent' nesnesi bulunamadı (eng: object "sent" not found.)

amrrs commented 3 years ago

did you read sent before?

What's your input text's dataframe, in my code it was like this

sent <- read.csv('text.csv')
baris-karakoc commented 3 years ago

yes I did it and it worked. thanks!

but I have a new problem :( my dataset is .csv and have many turkish character. when I import this its working. But lexicon is txt and turkish characters problem when I import lexicon.

amrrs commented 3 years ago

Does it show any error or the characters aren't read properly?

baris-karakoc commented 3 years ago

characters aren't read properly. but I fix it. (txt file convert to csv file and fix). I have a problem now.

When I export as a .csv file I want to see the scores in another column. How can I do it?

when I export: image