hjianganthony commited on
Commit
43602f3
·
1 Parent(s): df5a71a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -9
app.py CHANGED
@@ -7,11 +7,11 @@ from src.utils import *
7
  ##### Start #####
8
 
9
  examples = [
10
- ["Simply Spiked Lemonade 12 pack at Walmart"],
11
- ["Back to the Roots Garden Soil, 1 cubic foot, at Lowe's Home Improvement"],
12
- ["Costco Member subscription"],
13
- ["Apple watch coupon at Best Buy"],
14
- ["A giraffe at Lincoln Park Zoo"]
15
  ]
16
 
17
  def main(sentence: str, score_type: str, threshold_cosine: float, threshold_jaccard: float = 0.1):
@@ -32,10 +32,10 @@ def process_output(output):
32
  demo = gr.Interface(
33
  fn=main,
34
  inputs=[
35
- gr.Textbox(lines=1, placeholder="Type here...", value= "Simply Spiked Lemonade 12 pack at Walmart"),
36
- gr.Dropdown(choices=["cosine", "jaccard"], label="Score Type", value="jaccard"),
37
- gr.Slider(minimum=0, maximum=1, step=0.1, label="Threshold for Cosine Similarity", value=0.1),
38
- gr.Slider(minimum=0, maximum=1, step=0.1, label="Threshold for Jaccard Similarity", value=0.1)
39
  ],
40
  outputs=[gr.Textbox(placeholder="Message..."), gr.Dataframe()],
41
  examples=examples,
 
7
  ##### Start #####
8
 
9
  examples = [
10
+ ["Simply Spiked Lemonade 12 pack at Walmart", "jaccard", 0.1, 0.1],
11
+ ["Back to the Roots Garden Soil, 1 cubic foot, at Lowe's Home Improvement", "jaccard", 0.1, 0.1],
12
+ ["Costco Member subscription", "jaccard", 0.1, 0.1],
13
+ ["Apple watch coupon at Best Buy", "jaccard", 0.1, 0.1],
14
+ ["A giraffe at Lincoln Park Zoo", "jaccard", 0.1, 0.1]
15
  ]
16
 
17
  def main(sentence: str, score_type: str, threshold_cosine: float, threshold_jaccard: float = 0.1):
 
32
  demo = gr.Interface(
33
  fn=main,
34
  inputs=[
35
+ gr.Textbox(lines=1, placeholder="Type here..."),
36
+ gr.Dropdown(choices=["cosine", "jaccard"], label="Score Type"),
37
+ gr.Slider(minimum=0, maximum=1, step=0.1, label="Threshold for Cosine Similarity"),
38
+ gr.Slider(minimum=0, maximum=1, step=0.1, label="Threshold for Jaccard Similarity")
39
  ],
40
  outputs=[gr.Textbox(placeholder="Message..."), gr.Dataframe()],
41
  examples=examples,