Update app.py
Browse files
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 |
-
|
|
|
|
|
|
|
|
|
|
|
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",
|