Spaces:
Running
Running
maybe a fix
Browse files
app.py
CHANGED
@@ -40,18 +40,18 @@ def predict (Sentence, Word, LLM, Norm, Layer):
|
|
40 |
pred_list = pred.detach().numpy().tolist()
|
41 |
|
42 |
df = pd.DataFrame({'feature':labels, 'value':pred_list})
|
43 |
-
df = df.sort_values('value', ascending=False)
|
44 |
df = df[df['value'] > 0]
|
45 |
-
|
46 |
-
|
47 |
-
|
|
|
48 |
|
49 |
demo = gr.Interface(
|
50 |
fn=predict,
|
51 |
inputs=[
|
52 |
"text",
|
53 |
"text",
|
54 |
-
gr.Radio(["BERT", "ALBERT"]),
|
55 |
gr.Radio(["Binder", "McRae", "Buchanan"]),
|
56 |
gr.Slider(0,12, step=1)
|
57 |
],
|
|
|
40 |
pred_list = pred.detach().numpy().tolist()
|
41 |
|
42 |
df = pd.DataFrame({'feature':labels, 'value':pred_list})
|
|
|
43 |
df = df[df['value'] > 0]
|
44 |
+
df_sorted = df.sort_values(by='value', ascending=False)
|
45 |
+
|
46 |
+
output = [df_sorted['feature'][i]+'\t\t\t\t\t\t\t'+str(df_sorted['value'][i]) for i in range(df_sorted.shape[0])]
|
47 |
+
print("All Positive Predicted Values:\n"+"\n".join(output))
|
48 |
|
49 |
demo = gr.Interface(
|
50 |
fn=predict,
|
51 |
inputs=[
|
52 |
"text",
|
53 |
"text",
|
54 |
+
gr.Radio(["BERT", "ALBERT", "roBERTa"]),
|
55 |
gr.Radio(["Binder", "McRae", "Buchanan"]),
|
56 |
gr.Slider(0,12, step=1)
|
57 |
],
|