aliabd HF staff commited on
Commit
056649e
1 Parent(s): 2f1adb0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -2
app.py CHANGED
@@ -10,15 +10,22 @@ def predict(inp_1, inp_2):
10
  return {"nubia_score": features["nubia_score"]}, labels
11
 
12
  title = "NUBIA"
13
- description = "NeUral Based Interchangeability Assessor. A SoTA evaluation metric for text generation."
 
 
 
14
  inputs = [gradio.inputs.Textbox(label="First Text"), gradio.inputs.Textbox(label="Second Text")]
15
  outputs = [gradio.outputs.Label(label="Interchangeability Score"), gradio.outputs.JSON(label="All Features")]
 
 
 
 
16
  examples = [
17
  ["This car is expensive! I can't buy it.", "That automobile costs a fortune! Purchasing it? Impossible!"],
18
  ["This car is expensive! I can't buy it.", "That automobile costs a good amount. Purchasing it? Totally feasible!"],
19
  ["The dinner was delicious.", "The dinner did not taste good."]
20
  ]
21
  iface = gradio.Interface(fn=predict, inputs=inputs, outputs=outputs, capture_session=True, examples=examples,
22
- title=title, description=description, allow_flagging=False)
23
 
24
  iface.launch()
 
10
  return {"nubia_score": features["nubia_score"]}, labels
11
 
12
  title = "NUBIA"
13
+ description = """## A **N**e**u**ral **B**ased **I**nterchangeability **A**ssessor.
14
+ This is a demo of NUBIA: a SoTA evaluation metric for text generation. Simply input your texts (or click one of the examples to load them) and the model will compute score for how interchangeable they are.
15
+ Check out the [paper](https://arxiv.org/abs/2004.14667), [blog post](https://wl-research.github.io/blog/), [FAQ](https://github.com/wl-research/nubia/blob/master/FAQ.md) and [demo colab notebook](https://colab.research.google.com/drive/1_K8pOB8fRRnkBPwlcmvUNHgCr4ur8rFg).
16
+ """
17
  inputs = [gradio.inputs.Textbox(label="First Text"), gradio.inputs.Textbox(label="Second Text")]
18
  outputs = [gradio.outputs.Label(label="Interchangeability Score"), gradio.outputs.JSON(label="All Features")]
19
+ css =""".gradio-bg[theme=huggingface] .gradio-interface .output-label .confidence {
20
+ color: white !important;
21
+ }
22
+ """
23
  examples = [
24
  ["This car is expensive! I can't buy it.", "That automobile costs a fortune! Purchasing it? Impossible!"],
25
  ["This car is expensive! I can't buy it.", "That automobile costs a good amount. Purchasing it? Totally feasible!"],
26
  ["The dinner was delicious.", "The dinner did not taste good."]
27
  ]
28
  iface = gradio.Interface(fn=predict, inputs=inputs, outputs=outputs, capture_session=True, examples=examples,
29
+ title=title, description=description, allow_flagging=False, css=css)
30
 
31
  iface.launch()