Spaces:
Runtime error
Runtime error
Commit
·
447f5a8
1
Parent(s):
cd50064
Update acogsphere.py
Browse files- acogsphere.py +9 -11
acogsphere.py
CHANGED
|
@@ -1,15 +1,13 @@
|
|
| 1 |
-
#from transformers import pipeline
|
| 2 |
-
|
| 3 |
-
#classifier = pipeline("sentiment-analysis") #, model="stevhliu/my_awesome_model")
|
| 4 |
-
from gradio_client import Client
|
| 5 |
-
|
| 6 |
-
client = Client("https://cognitivescience-sentimentanalysis.hf.space/--replicas/bbtjl/")
|
| 7 |
|
|
|
|
| 8 |
#print(result)
|
| 9 |
def acf(text1):
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
|
|
|
|
|
|
|
|
|
| 15 |
return acfresult
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
|
| 2 |
+
import requests
|
| 3 |
#print(result)
|
| 4 |
def acf(text1):
|
| 5 |
+
|
| 6 |
+
response = requests.post("https://anbohan-sentiment-analysis.hf.space/run/predict", json={
|
| 7 |
+
"data": [
|
| 8 |
+
text1,
|
| 9 |
+
]
|
| 10 |
+
}).json()
|
| 11 |
+
|
| 12 |
+
acfresult = response["data"]
|
| 13 |
return acfresult
|