File size: 1,397 Bytes
0493ed8
 
 
3f018ec
 
 
 
0493ed8
 
3f018ec
 
 
 
 
 
 
0493ed8
 
 
 
 
 
 
 
 
 
3f018ec
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
from transformers import pipeline
import gradio as gr

from helper import magnitude_binding

title = "Magnitudes Identification Demo"
description = "This is a simple demo just for demonstration purposes, so that Serco team might have the chance to validate the first results of the Natural Language module concerning the identification of magnitude numbers \n\n NOTE: DO NOT ENTER DATES FOR THIS TESTING"

examples = [
    ["I want all earthquakes that are located in Ishkoshim, Tajikistan with a magnitude greater than 6"],
    ["I want all earthquakes that are located in Ishkoshim, Tajikistan with a magnitude greater than 6.5"],
    ["I want all earthquakes that are located in Ishkoshim, Tajikistan with a magnitude greater than six"],
    ["I want all earthquakes that are located in Ishkoshim, Tajikistan with a magnitude greater than six point five"],
    ["I want all earthquakes that are located in Ishkoshim, Tajikistan with a magnitude greater than 6 point five"],
    ["I want all earthquakes that are located in Ishkoshim, Tajikistan with a magnitude greater than six point 5"],
    ["I want all earthquakes that are located in Ishkoshim, Tajikistan with a magnitude greater than 6 point 5"],
]

gr.Interface(
    fn=magnitude_binding, 
    inputs="text", 
    outputs="text",
    title=title,
    description=description,
    examples=examples,
    enable_queue=True,
    ).launch()