Hugging Face
Models
Datasets
Spaces
Posts
Docs
Enterprise
Pricing
Log In
Sign Up
Spaces:
ananthujay
/
sentiment
like
0
Runtime error
App
Files
Files
Community
Fetching metadata from the HF Docker repository...
ananthujay
commited on
Oct 28, 2023
Commit
214013d
·
1 Parent(s):
d321650
Create app.py
Browse files
Files changed (1)
hide
show
app.py
+10
-0
app.py
ADDED
Viewed
@@ -0,0 +1,10 @@
1
+
from transformers import pipeline
2
+
3
+
4
+
nlp = pipeline("sentiment-analysis")
5
+
6
+
def scoring(text):
7
+
results = nlp(text)
8
+
for result in results:
9
+
score = result['score']
10
+
return score