Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -11,6 +11,8 @@ dataset2 = load_dataset('FDSRashid/hadith_info',data_files = 'masteredgecityrati
|
|
11 |
edge_info = dataset.to_pandas()
|
12 |
taraf_info = dataset2.to_pandas()
|
13 |
cities = taraf_info['City'].unique().tolist()
|
|
|
|
|
14 |
|
15 |
def subset_city_year( city , year ):
|
16 |
edges = taraf_info[(taraf_info['Year'] == year) & (taraf_info['City'].isin(city))]
|
@@ -26,10 +28,10 @@ def get_narrators( city , year ):
|
|
26 |
except Exception as e:
|
27 |
return str(e)
|
28 |
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
|
|
|
11 |
edge_info = dataset.to_pandas()
|
12 |
taraf_info = dataset2.to_pandas()
|
13 |
cities = taraf_info['City'].unique().tolist()
|
14 |
+
min_year = int(taraf_info['Year'].min())
|
15 |
+
max_year = int(taraf_info['Year'].max())
|
16 |
|
17 |
def subset_city_year( city , year ):
|
18 |
edges = taraf_info[(taraf_info['Year'] == year) & (taraf_info['City'].isin(city))]
|
|
|
28 |
except Exception as e:
|
29 |
return str(e)
|
30 |
|
31 |
+
with gr.Blocks() as demo:
|
32 |
+
Places = gr.Dropdown(choices = cities, value = ['المدينه', 'بغداد', 'كوفة', 'بصرة'], multiselect=True, label = 'Location')
|
33 |
+
Last_Year = gr.Slider(min_year, max_year, value = 400, label = 'End', info = 'Choose the year to display Narrators')
|
34 |
+
btn = gr.Button('Submit')
|
35 |
+
btn.click(fn = get_narrators, inputs = [Places, Last_Year], outputs = gr.DataFrame())
|
36 |
+
demo.launch()
|
37 |
|