lorenzoscottb commited on
Commit
c9f624f
·
1 Parent(s): 0e52996

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -13
app.py CHANGED
@@ -2,6 +2,7 @@ import gradio as gr
2
  import pickle
3
  import pandas as pd
4
 
 
5
  data = pickle.load(open("OOV_Train_2.pkl", "rb"))
6
  data = pd.DataFrame(
7
  data,
@@ -40,27 +41,26 @@ Use the next page to check if your test-items (i.e. adjective, noun and hypernym
40
 
41
  examples = [["A red car is a vehicle"], ["A fake smile is a smile"], ["A small cat is a small animal"]]
42
 
43
-
44
- interface_words = gr.Interface(
45
- fn=test_input,
46
- inputs=gr.Textbox(label="Input:word_1,word2,...,word_n"),
47
- outputs=gr.outputs.Label(label="In training-distribution?"),
48
- examples=examples_w,
49
  )
50
 
51
 
52
-
53
- description_e = """
54
  You can use this page to test if a set of words was included in the training data used to tune the model. As in the samples below, use as input a series of words separated solely by a comma (e.g. *red,car,vehicle*).
55
  """
56
 
57
  examples_w = [["red,car,vehicle"], ["fake,smile"], ["small,cat,animal"]]
58
 
59
- interface_model = gr.Interface.load(
60
- "huggingface/lorenzoscottb/bert-base-cased-PLANE-ood-2",
61
- description=description,
62
- examples=examples,
63
- title=title,
 
64
  )
65
 
66
  gr.TabbedInterface(
 
2
  import pickle
3
  import pandas as pd
4
 
5
+
6
  data = pickle.load(open("OOV_Train_2.pkl", "rb"))
7
  data = pd.DataFrame(
8
  data,
 
41
 
42
  examples = [["A red car is a vehicle"], ["A fake smile is a smile"], ["A small cat is a small animal"]]
43
 
44
+ interface_model = gr.Interface.load(
45
+ "huggingface/lorenzoscottb/bert-base-cased-PLANE-ood-2",
46
+ description=description,
47
+ examples=examples,
48
+ title=title,
 
49
  )
50
 
51
 
52
+ description_w = """
 
53
  You can use this page to test if a set of words was included in the training data used to tune the model. As in the samples below, use as input a series of words separated solely by a comma (e.g. *red,car,vehicle*).
54
  """
55
 
56
  examples_w = [["red,car,vehicle"], ["fake,smile"], ["small,cat,animal"]]
57
 
58
+ interface_words = gr.Interface(
59
+ fn=test_input,
60
+ inputs=gr.Textbox(label="Input:word_1,word2,...,word_n"),
61
+ outputs=gr.outputs.Label(label="In training-distribution?"),
62
+ description=description_w,
63
+ examples=examples_w,
64
  )
65
 
66
  gr.TabbedInterface(