Learto commited on
Commit
437ec78
·
1 Parent(s): e56a711

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -1
app.py CHANGED
@@ -6,7 +6,12 @@ headers = {"Authorization": "Bearer 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"}
6
 
7
  def query(payload):
8
  response = requests.post(API_URL, headers=headers, json=payload)
9
- return response.json()[label].value
 
 
 
 
 
10
 
11
  output = query({
12
  "inputs": "I like you. I love you",
 
6
 
7
  def query(payload):
8
  response = requests.post(API_URL, headers=headers, json=payload)
9
+
10
+ # retrieving data from JSON Data
11
+ json_data = response.json()
12
+ sentiment_label = json_data['label']
13
+
14
+ return sentiment_label
15
 
16
  output = query({
17
  "inputs": "I like you. I love you",