The Altair Community is migrating to a new platform to provide a better experience for you. In preparation for the migration, the Altair Community is on read-only mode from October 28 - November 6, 2024. Technical support via cases will continue to work as is. For any urgent requests from Students/Faculty members, please submit the form linked here
how sentiment analysis by python or R
student_compute
Member Posts: 73 Contributor II
Hello
I want to make some tweets by Python or R sentiment Analyze .
I did preprocessing in my rapidminer program.
But I do not know how to use R or python to sentiment Analyze in the program?
Someone knows How? Or is there an example?
Any help is helpful to me.
Thanks in advance
Tagged:
0
Answers
I like to use the Vader sentiment part of the NLTK toolkit. It works pretty well with social data (sentiment analysis will always remain a bit of a challenge) and gives a bit more than the usual possitive / negative indications
Attached sample uses this framework, the example chops the response by sentence and gives the 'vibe' per sentence. I typically use this method to ensure also mixed data get's covered well. But of course you could also use it on the full data.
What I provided was like this ;
What it returns is as follows :
The more negative or possitive the compound value (range -1 to +1), the more likely it will be that the sentiment of a given sentence is equally negative or possitive
Hi @student_compute,
In addition to the solution of @kayman, I propose a Python script using the "textblob" library.
From your text attribute, this script delivers a polarity between -1 and +1 where :
-1 (negative) < polarity < +1 (positive).
To execute this script, you have to set the name of your text attribute (with quotes) in the Set Macros operator :
The process :
Regards,
Lionel
Hi, thank you very much
How to get on points, in a new column. Insert a positive word and a negative word in front of each sentence?
Thanks a lot
Hi @student_compute,
I think you can use Generate Attributes and Set Data operators and eventually if needed Reorder Attributes operator.
Regards,
Lionel
Hello
Thank you so much
I used
But I do not know how to show the polarity of sentences based on scores
look
Could this be the case?
Thanks
Hi @student_compute,
You can, indeed, create a new attribute "Pol" defined by (for example) :
- if -1 < polarity < -0,1, then Pol = "negative"
- if -0,1 <= polarity <= 0,1, then Pol = "neutral"
- if 0,1 < polarity < 1, then Pol = "positive"
Note : You can, of, course, choose and set other thresholds than -0,1 / 0,1.
Here the associated process :
Regards,
Lionel
Thank you so much
How to download rapidminer version 9?
Thanks
Hi @student_compute,
The link to download RapidMiner 9.0 Beta :
http://static.rapidminer.com/rnd/html/rapidminer-9.0-preview.html
Regards,
Lionel
Hello
Thank you so much
Is there a perpelexity parameter in the new version for LDA? Or more facilities?
Hellokeyman
I've used your code. But he did not know the package NLTK
How do I download this package and introduce RapidMiner
I use Anacanda. I installed the textblob package but I can not package it
May I help how to do to install?
Thank you
Hi @student_compute,
Yes, there is Perplexity as one of performance measure in the last version of LDA.
Regards,
Lionel
lionelderkrikor dear
Thank you
------------------
Hellokeyman
I've used your code. But he did not know the package NLTK
How do I download this package and introduce RapidMiner
I use Anacanda. I installed the textblob package but I can not package it
May I help how to do to install?
Thank you
Hello
How to install nltk package and use it? The program has an error that this package does not exist !! Thankful
And
I downloaded and run RapidMiner 9. But I do not know how to find Perplexity mesure for assessing LDA? Does anyone know?
Thank
Hi @student_compute,
"How to install nltk package and use it?"
Lauch the windows "invite de commande" (type "cmd" in the search bar of Windows 10) and type de following command : pip install nltk
"But I do not know how to find Perplexity mesure for assessing LDA"
Connect the per output port of LDA operator to the res port
Regards,
Lionel
Hello
Thank you
Thank you
.
.
.
Excuse me about perpelexity in the LDA may I send a sample shot screenshot?
Thankful
Hi,
Here the screenshots relativ to LDA :
Regards,
Lionel
Hello
Thank you so much
Just might say
What other things do they use?
I mean avgs ???
Hello Sorry, I raised the topic again I tried a lot. Do nltk I installed it. But there is an error in the run. Which I myself could not solve. Can anyone help me? And about The amounts of AVGs reported on the LDA output can be explained to me. What is their use? Thanks for all your help
Hi @student_compute,
Can you share your process in order we can reproduce your bug ?
Try to add in the Python script after the others nltk.download('xxxxxx') :
and execute the process one time.
Regards,
Lionel