Update app.py
Browse files
app.py
CHANGED
@@ -35,7 +35,7 @@ matn_info = dataset['train'].to_pandas()
|
|
35 |
isnad_info = load_dataset('FDSRashid/hadith_info',token = Secret_token, data_files = 'isnad_info.csv', split = 'train').to_pandas()
|
36 |
isnad_info['Hadiths Cleaned'] = isnad_info['Hadiths'].apply(lambda x: [re.findall(pattern, string)[0].split("_") for string in x[1:-1].split(',')])
|
37 |
|
38 |
-
tarafs = matn_info['taraf_ID'].unique()
|
39 |
|
40 |
cmap = plt.colormaps['cool']
|
41 |
def value_to_hex(value):
|
@@ -84,7 +84,7 @@ def visualize_isnad(taraf_num, yaxis):
|
|
84 |
|
85 |
with gr.Blocks() as demo:
|
86 |
Yaxis = gr.Dropdown(choices = ['Tarafs', 'Hadiths', 'Isnads', 'Books'], value = 'Tarafs', label = 'Variable to Display', info = 'Choose the variable to visualize.')
|
87 |
-
taraf_number = gr.Slider(1,
|
88 |
btn = gr.Button('Submit')
|
89 |
btn.click(fn = visualize_isnad, inputs = [taraf_number, Yaxis], outputs = gr.HTML())
|
90 |
demo.launch()
|
|
|
35 |
isnad_info = load_dataset('FDSRashid/hadith_info',token = Secret_token, data_files = 'isnad_info.csv', split = 'train').to_pandas()
|
36 |
isnad_info['Hadiths Cleaned'] = isnad_info['Hadiths'].apply(lambda x: [re.findall(pattern, string)[0].split("_") for string in x[1:-1].split(',')])
|
37 |
|
38 |
+
tarafs = np.max(matn_info['taraf_ID'].unique())
|
39 |
|
40 |
cmap = plt.colormaps['cool']
|
41 |
def value_to_hex(value):
|
|
|
84 |
|
85 |
with gr.Blocks() as demo:
|
86 |
Yaxis = gr.Dropdown(choices = ['Tarafs', 'Hadiths', 'Isnads', 'Books'], value = 'Tarafs', label = 'Variable to Display', info = 'Choose the variable to visualize.')
|
87 |
+
taraf_number = gr.Slider(1,tarafs , value=10000, label="Taraf", info="Choose the Taraf to Input", step = 1)
|
88 |
btn = gr.Button('Submit')
|
89 |
btn.click(fn = visualize_isnad, inputs = [taraf_number, Yaxis], outputs = gr.HTML())
|
90 |
demo.launch()
|