Python Sentiment Analysis API + Docker + Docker Compose
Pre-Requisites | Description | How to contribute
Pull requests are welcome. If you'd like to support the work and buy me a ☕, I greatly appreciate it!
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.
To this project you yeed:
- Python 3.8.
- Docker and Docker Compose.
- MongoDB.
- Set the gitlab environment variables.
- Install python packages in requirements.txt.
- Run this script with docker-compose, Dockerfile or into your local machine with Python command.
- Profit.
Press CTRL + C to stop it in Docker Compose or Dockerfile.
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.
Some MongoDB Tools that we use in this project.
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 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.
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 |
Steps to build the Docker Image.
docker image build -t <IMAGE_NAME> -f <PATH_DOCKERFILE> <PATH_CONTEXT_DOCKERFILE>
docker image build -t <IMAGE_NAME> . (This context)
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.
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
- Make a Fork.
- Follow the project organization.
- Add the file to the appropriate level folder - If the folder does not exist, create according to the standard.
- Make the Commit.
- Open a Pull Request.
- Wait for your pull request to be accepted.. 🚀
Remember: There is no bad code, there are different views/versions of solving the same problem. 😊
You must send the project to your GitHub after the modifications
git add -f .
git commit -m "Added - Fixing somethings"
git push origin master
👤 Hey!! If you like this project or if you find some bugs feel free to contact me in my channels:
- Linktree: https://linktr.ee/lpmatos
To check the change history, please access the CHANGELOG.md file.
This repository is a study project, therefore, it will not always be maintained 👻.