Spaces:
Runtime error
Runtime error
Commit
·
985c25d
1
Parent(s):
f620641
Update app.py
Browse files
app.py
CHANGED
@@ -1,4 +1,6 @@
|
|
1 |
import gradio as gr
|
|
|
|
|
2 |
import pickle
|
3 |
import pandas as pd
|
4 |
|
@@ -21,12 +23,22 @@ def test_input(words):
|
|
21 |
else:
|
22 |
word_dict[w] = "out-of-distribution"
|
23 |
return word_dict
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
24 |
|
25 |
description = "Did you know that, logically speaking, a small cat is not a small animal, and that a fake smile is not a smile. \n Learn more testing our BERT model is tuned to perform phrase-level adjective-noun entailment, via the [PLANE](https://aclanthology.org/2022.coling-1.359/) dataset. \n The current model achieves an accuracy of 90% on out-of-distribution evaluation"
|
26 |
title = "BERT on a PLANE"
|
27 |
examples = [["A red car is a vehicle"], ["A fake smile is a smile"], ["A small cat is a small animal"]]
|
28 |
|
29 |
-
interface_model = gr.Interface.load(
|
|
|
30 |
description=description,
|
31 |
examples=examples,
|
32 |
title=title,
|
@@ -36,5 +48,6 @@ interface_model = gr.Interface.load("huggingface/lorenzoscottb/bert-base-cased-P
|
|
36 |
|
37 |
|
38 |
Series(
|
39 |
-
|
|
|
40 |
).launch()
|
|
|
1 |
import gradio as gr
|
2 |
+
from gradio.mix import Series
|
3 |
+
|
4 |
import pickle
|
5 |
import pandas as pd
|
6 |
|
|
|
23 |
else:
|
24 |
word_dict[w] = "out-of-distribution"
|
25 |
return word_dict
|
26 |
+
|
27 |
+
|
28 |
+
interface_words = gr.Interface.load(
|
29 |
+
fn=test_input,
|
30 |
+
inputs=gr.Textbox(value=[car, red, vehicle]),
|
31 |
+
outputs="label",
|
32 |
+
interpretation="default"
|
33 |
+
)
|
34 |
+
|
35 |
|
36 |
description = "Did you know that, logically speaking, a small cat is not a small animal, and that a fake smile is not a smile. \n Learn more testing our BERT model is tuned to perform phrase-level adjective-noun entailment, via the [PLANE](https://aclanthology.org/2022.coling-1.359/) dataset. \n The current model achieves an accuracy of 90% on out-of-distribution evaluation"
|
37 |
title = "BERT on a PLANE"
|
38 |
examples = [["A red car is a vehicle"], ["A fake smile is a smile"], ["A small cat is a small animal"]]
|
39 |
|
40 |
+
interface_model = gr.Interface.load(
|
41 |
+
"huggingface/lorenzoscottb/bert-base-cased-PLANE-ood-2",
|
42 |
description=description,
|
43 |
examples=examples,
|
44 |
title=title,
|
|
|
48 |
|
49 |
|
50 |
Series(
|
51 |
+
interface_words,
|
52 |
+
interface_model,
|
53 |
).launch()
|