|
from transformers import pipeline |
|
import gradio as gr |
|
|
|
from helper import identify_locations |
|
|
|
title = "Countries/Cities Identification Demo" |
|
description = "This is a simple demo just for demonstration purposes for the Serco team, to validate the first results of the Natural Language module concerning the identification of countries and cities" |
|
|
|
examples = [ |
|
["I want an earthquake that is located in Rome, Italy in 01/01/23 with magnitude greater than 6.2"], |
|
["I want an earthquake that is located in Buenos Aires, Argentina in 01/01/23 with magnitude greater than 6.2"], |
|
["I want an earthquake that is located in United Arab Emirates in 01/01/23 with magnitude greater than 6.2"], |
|
["I want an earthquake that is located in Ishkashim, Tajikistan, in 01/01/23 with magnitude greater than 6.2"], |
|
["I want an earthquake that is located in Burkina Faso in 01/01/23 with magnitude greater than 6.2."], |
|
["I want an earthquake that is located in Dibba Al-Fujairah, United Arab Emirates in 01/01/23 with magnitude greater than 6.2"], |
|
] |
|
|
|
gr.Interface( |
|
fn=identify_locations, |
|
inputs="text", |
|
outputs="text", |
|
title=title, |
|
description=description, |
|
examples=examples, |
|
enable_queue=True, |
|
).launch() |