Closed segfal closed 2 years ago
Also clean up the code.. redundant newlines, comments etc
@kaustav202 Just did the change, I restored the code from main.py and cleaned up sentimental_analysis.py
I just did a few fixes, i called sentiment from sentiment_analysis.py and added sentiment.graph() to the bottom
The main is computing meta metrics on the bulk so we are interested in only count/volume here not sentiments. The two plots are computing 1. total counts of keywords over an interval and 2. average counts of keyword in a particular interval , additionally we are printing the proportion of tweets containing each keyword in lines 33 and 36.
That was about the main files' working. I hope it is clear to you @segfal
@segfal are you working on it or shall I add a commit myself?
@kaustav202 Ill work on it right now, just to confirm. I will remove the changes from main.py and leave it back to what it originally was?
@kaustav202 Ill work on it right now, just to confirm. I will remove the changes from main.py and leave it back to what it originally was?
Yes that's right..
@kaustav202 Ill work on it right now, just to confirm. I will remove the changes from main.py and leave it back to what it originally was?
Yes that's right..
So i just put main.py back to its original form, the only thing i added was instansiate the sentiment inside main, and for the check word function, it will be called from the class instead of creating a whole new function.
great work and congratulations @segfal
A similar PR may already be submitted! Please search among the Pull request before creating one.
Thanks for submitting a pull request! Please provide enough information so that others can review your pull request:
For more information, see the
CONTRIBUTING
guide.The Sentimental Analysis part has been simplified. It would fix the few errors that were popping up.
Second is the graph showing nothing, i basically turned the interval down to 10 seconds instead of 5T which i think is 5 minutes, and the graphs started to pop up.
Third, I turned the sentimental analysis part into a class so we don't have to do alot of repetition, everything would be more seamless and the code would look cleaner
Finally, I added argv into the graph method, so you dont have to just input one hashtag, you can input multiple hashtags and get data from multiple hashtags.
What is the current behavior? (You can also link to an open issue here)
It spits out a graph on main.py and provides the scores as well.
What is the new behavior (if this is a feature change)?
Theres a function that takes multiple hashtags instead of just one and in the graph function , I reccomend for the interval you put it as graph(interval=time,hashtags) so the function will know that you added the interval
Does this PR introduce a breaking change? (What changes might users need to make in their application due to this PR?) Basically I just deleted code that was redundant , there doesn't need to be any changes. no extra libraries or stuff like that, but if you want some nice graphs i recommend the plotly library as their graphs are more interactive.
Other information:
https://i.imgur.com/XQavA8e.png
Explain the motivation for making this change. What existing problem does the pull request solve?
Test plan (required)
Demonstrate the code is solid. Example: The exact commands you ran and their output, screenshots / videos if the pull request changes UI.
Code formatting
Closing issues
Fixes issue #15