File size: 1,125 Bytes
8a9c8ec
 
 
 
 
 
 
 
 
81873b3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
---
title: Sentiment Analysis
emoji: 
colorFrom: yellow
colorTo: indigo
sdk: docker
pinned: false
---

## Overview

Sentiment Analysis tool utilizing [Roberta-Base pretrained model](https://huggingface.co/cardiffnlp/twitter-roberta-base-sentiment-latest) called using endpoints made with FastAPI. Containerized into a Docker Image.

## Endpoints

**/** - The main page of the app. Users enter text here to be sent for sntiment analysis.\
**/analyze** - This endpoint is responsible for sendng text to the model and displaying the results.

## Documentation and Testing

FastAPI provides documentation endpoint at **/docs** where you can test API endpoints and send data.

## Docker Build

You can run a local container of the app using docker

1. Clone the repository into your machine.
2. Run `docker build Dockerfile` inside root directory of the space to build a docker image file.
3. Start a container from the image using `docker run -p <preferred-port>:7860 <image-name or image-sha>`. This will map virtual port 7860 to a port of your choosing, allowing you to access the endpoints at localhost:`<`preferred-port`>`