Updated API code
Browse files
README.md
CHANGED
@@ -74,13 +74,11 @@ data = {"inputs": prompt, "parameters": {"top_k": 3}}
|
|
74 |
|
75 |
response = requests.request("POST", api_url, headers=headers, json=data)
|
76 |
|
77 |
-
#
|
78 |
-
|
79 |
-
# so we replace them in the output
|
80 |
-
scores = {repdict[x['label']]: x['score'] for x in response.json()}
|
81 |
print(scores)
|
82 |
|
83 |
-
#
|
84 |
```
|
85 |
|
86 |
## References
|
|
|
74 |
|
75 |
response = requests.request("POST", api_url, headers=headers, json=data)
|
76 |
|
77 |
+
# Print the labels and scores (arranged in order of likelihood)
|
78 |
+
scores = {x['label']: x['score'] for x in response.json()}
|
|
|
|
|
79 |
print(scores)
|
80 |
|
81 |
+
# {'Aff': 0.999998927116394, 'Pow': 0.999890923500061, 'Ach': 5.351924119167961e-05}
|
82 |
```
|
83 |
|
84 |
## References
|