You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+25-1Lines changed: 25 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,6 +2,30 @@
2
2
3
3
Deploy a pre-trained BERT model for Sentiment Analysis as a REST API using FastAPI
4
4
5
+
## Demo
6
+
7
+
The model is trained to classify sentiment (negative, neutral, and positive) on a custom dataset from app reviews on Google Play. Here's a sample request to the API:
8
+
9
+
```bash
10
+
http POST http://127.0.0.1:8000/predict text="Good basic lists, i would like to create more lists, but the annual fee for unlimited lists is too out there"
11
+
```
12
+
13
+
The response you'll get looks something like this:
14
+
15
+
```js
16
+
{
17
+
"confidence":0.9999083280563354,
18
+
"probabilities": {
19
+
"negative":3.563107020454481e-05,
20
+
"neutral":0.9999083280563354,
21
+
"positive":5.596495248028077e-05
22
+
},
23
+
"sentiment":"neutral"
24
+
}
25
+
```
26
+
27
+
You can also [read the complete tutorial here](https://www.curiousily.com/posts/deploy-bert-for-sentiment-analysis-as-rest-api-using-pytorch-transformers-by-hugging-face-and-fastapi/)
0 commit comments