Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
I am using "sentimentr" library to get the sentiment score of my dataset. The script works perfectly in R Studio. But throw an error when adding as an R script in Power BI.
There is one post about using sentimentr library. https://community.powerbi.com/t5/Desktop/Error-in-running-an-R-script-using-sentimentr-library-in-Po... but back then the library was not supported by powerBI. According to most recent documentation sentimentr library is supported in powerBI now. I am trying to figure out a way of working the script for the last couple of days. This is really very important to me right now.
# 'dataset' holds the input data for this script library(sentimentr) dataframe_tweets <- data.frame ( Tweet_Text = c(dataset$Text), stringsAsFactors = FALSE ) base_text <- c(dataframe_tweets$Tweet_Text) senti_text <- sentimentr::get_sentences(base_text) Sentiment = sentiment(senti_text, by = NULL) dataset_with_Sentiment_score <- data.frame ( Tweet_TEXT = c(dataframe_tweets$Tweet_Text), Senti_Score = round(Sentiment$ave_sentiment , 2 ), stringsAsFactors = FALSE )
But couldn't find a way till now. I would really appreciate if any kind-hearted people do take a look at my script and suggest to me what I might be doing wrong in my script.
Thanks in advance.
@Anonymous ,
I can reproduce your issue but am not available to solve it. But I guess this issue should be related with the data format of
c(dataset$Text)
If you still can't solve it, I would suggest you create a support ticket here.
Regards,
Jimmy Tao
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
105 | |
105 | |
88 | |
73 | |
66 |
User | Count |
---|---|
124 | |
113 | |
98 | |
80 | |
72 |