LLM_Dataset / myapp.py
Yinxing's picture
Update myapp.py
5b50226 verified
import streamlit as st
from func import *
st.markdown('## 場所探し')
query = st.text_input('場所を入力してください。',value='東北大学 川内')
### サイドバー
# 場所のタイプ
type_dicts = {'レストラン':'restaurant', '銀行':'bank', 'カフェ':'cafe', '病院':'doctor'}
# タイプ選択
t = st.sidebar.selectbox('場所のタイプ', type_dicts.keys())
# 英語に変換
ct = type_dicts[t]
# 半径
radius = st.sidebar.slider('半径(m)', 100, 2000, 500, 100)
# 検索
if st.button('検索'):
lat, lon, place = get_place(query)
df = find_nearby_places(lat, lon, ct, radius)
st.map(df)
st.dataframe(df)