FDSRashid commited on
Commit
be9688d
·
1 Parent(s): bd960a6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -33,7 +33,7 @@ def splitIsnad(dataframe):
33
 
34
 
35
  def network_visualizer(city, year, num_nodes):
36
- edge_15 = splitIsnad(subsetEdges(city, year)).sample(num_nodes)
37
  net = Network()
38
  for _, row in edge_15.iterrows():
39
  source = row['Teacher']
@@ -61,7 +61,7 @@ def network_visualizer(city, year, num_nodes):
61
  with gr.Blocks() as demo:
62
  Places = gr.Dropdown(choices = cities, value = 'المدينه', label = 'Location')
63
  Last_Year = gr.Slider(min_year, max_year, value = 9, label = 'End', info = 'Choose the year to display Narrators')
64
- num_narrators = gr.Slider(0, 400, value = 200, label = 'Narrators', info = 'Choose the number of Narrators to display')
65
 
66
  btn = gr.Button('Submit')
67
  btn.click(fn = network_visualizer, inputs = [Places, Last_Year, num_narrators], outputs = gr.HTML())
 
33
 
34
 
35
  def network_visualizer(city, year, num_nodes):
36
+ edge_15 = splitIsnad(subsetEdges(city, year))[['Teacher', 'Student', 'Hadiths']].groupby(['Teacher', 'Student']).sum().reset_index().sample(num_nodes)
37
  net = Network()
38
  for _, row in edge_15.iterrows():
39
  source = row['Teacher']
 
61
  with gr.Blocks() as demo:
62
  Places = gr.Dropdown(choices = cities, value = 'المدينه', label = 'Location')
63
  Last_Year = gr.Slider(min_year, max_year, value = 9, label = 'End', info = 'Choose the year to display Narrators')
64
+ num_narrators = gr.Slider(0, 700, value = 400, label = 'Narrators', info = 'Choose the number of Narrators to display')
65
 
66
  btn = gr.Button('Submit')
67
  btn.click(fn = network_visualizer, inputs = [Places, Last_Year, num_narrators], outputs = gr.HTML())