We've got a dataset from Kaggle and based on the customer review text we've build a model to predict sentiment (positive, negative) about the product.
This project requires Python >= 3.5 and the following Python libraries installed:
pip install -r requirements.txt
- You have to install and run docker
download.zip and extract Reviews.csv for the project directory.
We've got the texts reviews (Text column) and used TF-IDF transformation to extract features and the Score columns as the target. You can see the code to build the model in this Jupyter Notebook.
We developed a RESTFUL API using Flask to expose this model.
```
Request
Content-Type = "application/json"
{"text_review": "your review about the project here"}
Response
{"sentiment": "Positive"}
{"sentiment": "Negative"}
```
1 - Run all steps in Jupyet Notebook to generate the model
2 - $python3 build_docker.py
3 - docker run -p 805:805 vanhackthon
4 - After you can use curl to post some review and get the response.
```
curl -X POST http://localhost:805 -H 'Content-Type: application/json' -d '{"text_review": "Your review here"}'
```