yagcioglutoprak / Twitter-Comment-Analyzer-GPT-4

A Script analyzes public opinion on a selected tweet using GPT-3 to summarize main ideas expressed in comments. Provides efficient insights on sentiment and topic for social media monitoring."

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Twitter Comment Analyzer

Are you tired of reading through endless comments on Twitter to find out what people are saying? Look no further! Our Twitter Comment Analyzer uses cutting-edge AI technology to analyze comments on a specific tweet and generate a comprehensive summary.

twitter_analyzer.mp4

Here's how it works:

  1. First, enter the tweet ID of the tweet you want to analyze.
  2. Our script then uses Selenium and BeautifulSoup to extract all the comments on the tweet.
  3. The comments are then preprocessed to remove any URLs, punctuations, and converted to lowercase.
  4. The preprocessed comments are then fed into OpenAI's language model, where it generates a text that explains the general idea of all the comments.
  5. And voila! You now have a summarized version of all the comments on the tweet.

*Note: If the main tweet has an image, our script also uses image recognition to generate a text representation of the image. The text representation is then included in the prompt to OpenAI, providing additional context for the summary.

Prerequisites

  • Install the required packages by running pip install tweepy re time openai bs4 selenium webdriver_manager dotenv
  • Create a .env file in the root directory and add the following keys:
    • TWITTER_KEY_V2
    • OPENAI_KEY

Running the script

  1. Open the terminal/command prompt
  2. Navigate to the directory containing the script
  3. Run python3 filename.py
  4. Enter the tweet ID when prompted.

Conclusion

With the Twitter Comment Analyzer, you'll never miss out on what people are saying on Twitter again! Try it out today and see for yourself.

About

A Script analyzes public opinion on a selected tweet using GPT-3 to summarize main ideas expressed in comments. Provides efficient insights on sentiment and topic for social media monitoring."


Languages

Language:Python 100.0%