Twitter-Sentiment-Analysis icon indicating copy to clipboard operation
Twitter-Sentiment-Analysis copied to clipboard

OPTIMIZED CODE AND CREDENTIALS PROTECTED

Open Aalian2241 opened this issue 2 years ago • 0 comments

I have optimized the code by doing the following:

  1. Protected the Credentials by using env imports
  2. Used a 'with' statement when opening the file, to avoid the need to close it explicitly.
  3. Used list comprehensions to perform the sentiment analysis on the tweets.
  4. Used f-strings for string formatting, as they are more efficient.
  5. Used a Counter object from the collections module to count the number of tweets with each sentiment, instead of multiple if statements.

I'd really appreciate it if you accept my pull request even though its an years old repo. Thanks

Aalian2241 avatar Feb 28 '23 09:02 Aalian2241