This project demonstrates how to perform real-time sentiment analysis on Twitter data using AWS cloud services. By utilizing AWS services such as Lambda, Kinesis, S3, DynamoDB, and Comprehend, the system continuously captures, processes, and analyzes tweets, categorizing them based on sentiment (positive, negative, neutral).
The architecture for real-time Twitter sentiment analysis includes the following steps:
- Tweet Streaming: Twitter API streams real-time tweets based on specified keywords.
- AWS Kinesis: Tweets are ingested into AWS Kinesis Data Stream for real-time processing.
- AWS Lambda: A Lambda function processes the incoming stream of tweets and sends them to AWS Comprehend for sentiment analysis.
- AWS Comprehend: Performs sentiment analysis on the text and classifies it into categories: Positive, Negative, Neutral, or Mixed.
- AWS DynamoDB: Results from sentiment analysis are stored in a DynamoDB table for real-time querying and analytics.
- AWS S3: Tweets and their sentiment classifications are stored in S3 for long-term storage and batch analysis.
- Amazon Kinesis: For real-time ingestion of Twitter data streams.
- AWS Lambda: Serverless compute to process incoming tweets and trigger the sentiment analysis.
- Amazon Comprehend: AWS-managed NLP service for sentiment analysis.
- Amazon DynamoDB: NoSQL database to store and query sentiment results.
- Amazon S3: Storage service for persisting raw tweets and analyzed data.
- AWS IAM: For access control and service permissions.
You can customize the following aspects of the project:
- Sentiment Categories: Modify how sentiment is classified in the Lambda function.
- Keyword Filters: Change the keywords or hashtags being tracked by modifying the Twitter stream query.
- Data Storage: Change the way data is stored or retrieved by configuring DynamoDB or S3.
Contributions are welcome! Please feel free to submit a pull request or open an issue if you have any suggestions or improvements.
This project is licensed under the MIT License - see the LICENSE file for details.