Skip to content

✔️ Twitter Sentimental Analysis Covid-19 (using Textblob - Naive bayes) + Python Backend Flask + Docker + Docker Compose + MongoDB

License

Notifications You must be signed in to change notification settings

lpsm-dev/twitter-sentimental-analysis-covid

Repository files navigation

sentiment-analysis

Welcome to Sentiment Analysis Repository

Python Sentiment Analysis API + Docker + Docker Compose

Open Source GitHub Contributors GitHub Language Count GitHub Top Language GitHub Stars GitHub Last Commit Repository Size Repository Issues MIT License

Menu

Pre-Requisites   |    Description   |    How to contribute

By me a coffe

Pull requests are welcome. If you'd like to support the work and buy me a ☕, I greatly appreciate it!

Buy Me A Coffee

Getting Started

If you want use this repository you need to make a git clone:

git clone --depth 1 https://github.com/lpmatos/sentiment-analysis.git -b master

This will give access on your local machine.

Pre-Requisites

To this project you yeed:

  • Python 3.8.
  • Docker and Docker Compose.
  • MongoDB.

Built with

How to use it?

  1. Set the gitlab environment variables.
  2. Install python packages in requirements.txt.
  3. Run this script with docker-compose, Dockerfile or into your local machine with Python command.
  4. Profit.

Press CTRL + C to stop it in Docker Compose or Dockerfile.

Description

This is a project whose focus is to address the analysis of feelings in a basic way. An api was created to perform the search for tweets and as a result returns a list with the classification: positive, neutral, negative.

Mongo Schema

Alt text

Services

Alt text

Routes

Alt text

Architecture

Alt text

Results

Alt text

Documentation

Project Documentation

MongoDB Tools

Some MongoDB Tools that we use in this project.

Mongoku

MongoDB client for the web. Query your data directly from your browser. You can host it locally, or anywhere else, for you and your team.

It scales with your data (at Hugging Face we use it on a 1TB+ cluster) and is blazing fast for all operations, including sort/skip/limit. Built on TypeScript/Node.js/Angular.

AdminMongo

AdminMongo is a cross platform user interface (GUI) to handle all your MongoDB connections/databases needs. AdminMongo is fully responsive and should work on a range of devices.

AdminMongo connection information (including username/password) is stored unencrypted in a config file, it is not recommended to run this application on a production or public facing server without proper security considerations.

Environment variables

Name Description
TWITTER_CONSUMER_KEY Twitter Consumer Key
TWITTER_CONSUMER_SECRET Twitter Consumer Secret
TWITTER_ACCESS_TOKEN Twitter Access Token
TWITTER_ACCESS_TOKEN_SECRET Twitter Access Token Secret
LOG_PATH Just the Log Path
LOG_FILE Just the Log File
LOG_LEVEL Just the Log Level
LOGGER_NAME Just the Logger name

🐋 Development with Docker

Steps to build the Docker Image.

Build

docker image build -t <IMAGE_NAME> -f <PATH_DOCKERFILE> <PATH_CONTEXT_DOCKERFILE>
docker image build -t <IMAGE_NAME> . (This context)

Run

Steps to run the Docker Container.

  • Linux running:
docker container run -d -p <LOCAL_PORT:CONTAINER_PORT> <IMAGE_NAME> <COMMAND>
docker container run -it --rm --name <CONTAINER_NAME> -p <LOCAL_PORT:CONTAINER_PORT> <IMAGE_NAME> <COMMAND>
  • Windows running:
winpty docker.exe container run -it --rm <IMAGE_NAME> <COMMAND>

For more information, access the Docker documentation or this.

🐋 Development with Docker Compose

Build and run a docker-compose.

docker-compose up --build

Down all services deployed by docker-compose.

docker-compose down

Down all services and delete all images.

docker-compose down --rmi all

How to contribute

  1. Make a Fork.
  2. Follow the project organization.
  3. Add the file to the appropriate level folder - If the folder does not exist, create according to the standard.
  4. Make the Commit.
  5. Open a Pull Request.
  6. Wait for your pull request to be accepted.. 🚀

Remember: There is no bad code, there are different views/versions of solving the same problem. 😊

Add to git and push

You must send the project to your GitHub after the modifications

git add -f .
git commit -m "Added - Fixing somethings"
git push origin master

➤ Author

👤 Hey!! If you like this project or if you find some bugs feel free to contact me in my channels:

➤ Versioning

To check the change history, please access the CHANGELOG.md file.

➤ Project status

This repository is a study project, therefore, it will not always be maintained 👻.

➤ Donations

BTC Address Litecoin Address

➤ Show your support

Give me a ⭐️ if this project helped you!

gif-header

Made with 💜 by me 👋 inspired on readme-md-generator