Update app.py
Browse files
app.py
CHANGED
|
@@ -11,8 +11,11 @@ def adjust(x):
|
|
| 11 |
def sa2(s):
|
| 12 |
res= sa(s)
|
| 13 |
return [adjust(-1*r['score']) if r['label']=='negative' else adjust(r['score']) for r in res ]
|
|
|
|
| 14 |
|
| 15 |
-
|
|
|
|
|
|
|
| 16 |
import pandas as pd
|
| 17 |
|
| 18 |
import matplotlib.pyplot as plt
|
|
@@ -28,5 +31,6 @@ import gradio as gr
|
|
| 28 |
iface = gr.Interface(
|
| 29 |
fn=grfunc,
|
| 30 |
inputs=gr.inputs.Textbox(placeholder="put your sentences line by line", lines=5),
|
| 31 |
-
outputs="plot"
|
|
|
|
| 32 |
iface.launch()
|
|
|
|
| 11 |
def sa2(s):
|
| 12 |
res= sa(s)
|
| 13 |
return [adjust(-1*r['score']) if r['label']=='negative' else adjust(r['score']) for r in res ]
|
| 14 |
+
|
| 15 |
|
| 16 |
+
def get_examples():
|
| 17 |
+
return [e for e in open("examplesTR.csv").readlines()]
|
| 18 |
+
|
| 19 |
import pandas as pd
|
| 20 |
|
| 21 |
import matplotlib.pyplot as plt
|
|
|
|
| 31 |
iface = gr.Interface(
|
| 32 |
fn=grfunc,
|
| 33 |
inputs=gr.inputs.Textbox(placeholder="put your sentences line by line", lines=5),
|
| 34 |
+
outputs="plot",
|
| 35 |
+
examples=get_examples())
|
| 36 |
iface.launch()
|