ajl2718 commited on
Commit
99d5451
·
1 Parent(s): 7316a14

JSON output for geocode results

Browse files
Files changed (1) hide show
  1. app.py +6 -3
app.py CHANGED
@@ -2,14 +2,17 @@ import gradio as gr
2
  from whereabouts.utils import download
3
  from whereabouts.Matcher import Matcher
4
 
5
- # download the address database for all of Australia
6
  download('au_all_sm', 'saunteringcat/whereabouts-db')
 
 
 
7
 
8
  # create a matcher object
9
  matcher = Matcher('au_all_sm')
10
 
11
- def greet(address):
12
  return matcher.geocode(address)
13
 
14
- demo = gr.Interface(fn=greet, inputs="text", outputs="text")
15
  demo.launch()
 
2
  from whereabouts.utils import download
3
  from whereabouts.Matcher import Matcher
4
 
5
+ # download the various address databases
6
  download('au_all_sm', 'saunteringcat/whereabouts-db')
7
+ download('au_all_lg', 'saunteringcat/whereabouts-db')
8
+ download('au_vic_lg', 'saunteringcat/whereabouts-db')
9
+ download('au_nsw_lg', 'saunteringcat/whereabouts-db')
10
 
11
  # create a matcher object
12
  matcher = Matcher('au_all_sm')
13
 
14
+ def geocode(address):
15
  return matcher.geocode(address)
16
 
17
+ demo = gr.Interface(fn=geocode, inputs="text", outputs="json")
18
  demo.launch()