Skip to content

Latest commit

 

History

5 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Setup

Create a virtual environment:

python -m venv venv

Activate the virtual environment:

  • On Windows:
    .\venv\Scripts\activate
  • On Unix or macOS:
    source venv/bin/activate

Install dependencies using requirements.txt

pip install -r requirements.txt

Download NLTK data in Python

python
>>> import nltk
>>> nltk.download('punkt')
>>> nltk.download('averaged_perceptron_tagger')
>>> exit()

Run the application

python sentiment.py

This should output a link.

Test the API using Postman

  • Method: POST
  • URL: <link>/analyse
  • Body (raw JSON):
    {"text":"I love dogs"}
    {"text":"I like this API"}
    {"text":"I somewhat dislike this API"}
    {"text":"Not bad, could be better."}

Run the tests

python -m unittest test_app.py

About

Sentiment Flask API

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages