Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -16,14 +16,21 @@ def sar_alert(MESSAGE, API_KEY):
|
|
| 16 |
#
|
| 17 |
pprint.pprint(output_data)
|
| 18 |
df_response = pd.json_normalize(output_data)
|
| 19 |
-
df_response = df_response['output.SAR_requested', 'output.explanation']
|
| 20 |
return df_response, str(output_data)
|
| 21 |
|
| 22 |
iface = gr.Interface(
|
| 23 |
fn=sar_alert,
|
| 24 |
-
inputs=[
|
| 25 |
-
|
| 26 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 27 |
)
|
| 28 |
|
| 29 |
iface.launch()
|
|
|
|
| 16 |
#
|
| 17 |
pprint.pprint(output_data)
|
| 18 |
df_response = pd.json_normalize(output_data)
|
| 19 |
+
df_response = df_response[['output.SAR_requested', 'output.explanation']]
|
| 20 |
return df_response, str(output_data)
|
| 21 |
|
| 22 |
iface = gr.Interface(
|
| 23 |
fn=sar_alert,
|
| 24 |
+
inputs=[
|
| 25 |
+
"text",
|
| 26 |
+
"text"],
|
| 27 |
+
outputs=[
|
| 28 |
+
gr.outputs.Dataframe(headers=['SAR_Requested', 'Explanation'], type='pandas'),
|
| 29 |
+
"text"],
|
| 30 |
+
examples=[
|
| 31 |
+
["Customer is asking about his data, and he is concerned about GDPR because he heard about it in the news", "Private Key"],
|
| 32 |
+
["Hey Kate, save $50 when you spend $150 or more. Today only! Click here to see our new products (link)", "Private Key"]],
|
| 33 |
+
description = "Subject Access Request from Text: Identification Algorithm"
|
| 34 |
)
|
| 35 |
|
| 36 |
iface.launch()
|