Skip to content

ismetkizgin/sentiment-analysis-service

Repository files navigation

Nest Logo

SENTIMENT ANALYSIS SERVICE

Description

It is a service that makes good and bad prediction of messages that come to an application. Sentiment Analysis algorithm was used as machine learning algorithm and served with Python Flask. You can examine the graph of the data in the data set from the visual below. Those with a positivity value of 0 represent a negative message, and those with a 1 represent a positive message.

Instructions

Installation

$ cd model
$ pip3 install --no-cache-dir -r requirements.txt
$ python3 model.py
$ cd ../service
$ pip3 install --no-cache-dir -r requirements.txt

Running the app

# The following command must be executed within the `service` folder.
$ python3 app.py

Docker Compose

By creating the docker-compose.yml file, it is possible to deploy the project with docker commands below. You can visit the Docker Hub Repository to review the versions.

version: "3"
services:
  serve:
    container_name: sentiment-analysis-service
    image: ismetkizgin/sentiment-analysis-service:latest
    expose:
      - ${PORT}
    restart: always
    ports:
      - "${PORT}:${PORT}"
    env_file:
      - .env
$ docker-compose up -d

Environment Variables

Variable Name Description Required Default
ENVIRONMENT Specifies the environment name. NO -
CORS Website endpoints can be defined for Cors safety. NO *
PORT It is determined which port will be deploy. NO 3310
BODY_SIZE_LIMIT Specifies the maximum size of the data that will come from the body during the request.(Type: MB) NO 1
API_KEY It allows to add an api key control to the service for security during service use. NO -

Request Examples

REQUEST

// POST {{ENDPOINT}}/predict
{
    "text": "Uygulama kötü bir şekilde tasarlanmış ve gereksiz."
}

RESPONSE

{
    "predictState": true
}

License

Sentiment analysis service is GNU licensed.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published