CognitiveScience commited on
Commit
447f5a8
1 Parent(s): cd50064

Update acogsphere.py

Browse files
Files changed (1) hide show
  1. 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
- acfresult = client.predict(
11
- text1, # str in 'input_text' Textbox component
12
- api_name="/predict"
13
- )
14
- #acfresult=classifier(text1)
 
 
 
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