Skip to content

Latest commit

 

History

History
57 lines (31 loc) · 1.72 KB

README.md

File metadata and controls

57 lines (31 loc) · 1.72 KB

HuggingText

HuggingText is a simple Python API for classifying and analysing sentiment in text. This microservice template depends on the PyPi package germansentiment at the backend to detect sentiment in German texts. The germansentimentitself is build on top of BERT architecture open sourced by Huggingface.

For more detailed read please visit germansentiment and BERT HuggingFace

Supported Language(s):

At the moment HuggingText support only German texts

Getting started

Please visit and download the Docker for your preferred operating system at Linux, MacOS, Windows

Project setup

HuggingText directory tree

The germansentiment model/inference code is stored at sentimentmodel.py and the web api code is under app.py.

In addition, the project has api test module test.py, Dockerfile which include commands to build and run the container and a requirements.txt file to setup the virtual environment.

Build and Run Docker Container

git clone https://github.com/Saran-nns/huggingtext.git

cd huggingtext

sh run.sh

In case you would like to build container manually,

docker build -f Dockerfile -t huggingtext:v0.1.0 .

and to run the container,

docker run -p 8000:5000 -v ~/huggingtext/:/root/huggingtext -ti huggingtext:v0.1.0 /bin/bash -c "cd /src && source activate huggingtext && python app.py" 

ENDPOINT

The Flask application has both GET and POST methods defined at /.

TODO:

To deploy the containerized app to GCP,

  • Cloud Build and Container Registry
  • Cloud Run