Update app.py
Browse files
app.py
CHANGED
@@ -19,13 +19,15 @@ dataset2 = load_dataset('FDSRashid/hadith_info',data_files = 'Taraf_Info.csv', t
|
|
19 |
|
20 |
|
21 |
|
22 |
-
features = Features({'Rawi ID': Value('int32'), 'Famous Name': Value('string'), 'Narrator Rank': Value('string'), 'Number of Narrations': Value('string'), 'Official Name':Value('string'), 'Title Name':Value('string')} )
|
23 |
narrator_bios = load_dataset("FDSRashid/hadith_info", data_files = 'Teacher_Bios.csv', token = Secret_token,features=features )
|
24 |
narrator_bios = narrator_bios['train'].to_pandas()
|
25 |
narrator_bios.loc[49845, 'Narrator Rank'] = 'رسول الله'
|
26 |
narrator_bios.loc[49845, 'Number of Narrations'] = 0
|
27 |
narrator_bios['Number of Narrations'] = narrator_bios['Number of Narrations'].astype(int)
|
28 |
narrator_bios.loc[49845, 'Number of Narrations'] = 327512
|
|
|
|
|
29 |
|
30 |
|
31 |
|
@@ -79,7 +81,7 @@ def network_narrator(narrator_id, fst_year, lst_year, yaxis):
|
|
79 |
allowpaymentrequest="" frameborder="0" srcdoc='{html}'></iframe>"""
|
80 |
|
81 |
def narrator_retriever(name):
|
82 |
-
return narrator_bios[(narrator_bios['Official Name'].str.contains(name)) | (narrator_bios['Famous Name'].str.contains(name)) | (narrator_bios['Rawi ID'].astype(str) == name)][['Rawi ID', 'Title Name', 'Official Name', 'Famous Name', 'Number of Narrations', 'Narrator Rank' ]]
|
83 |
|
84 |
|
85 |
|
|
|
19 |
|
20 |
|
21 |
|
22 |
+
features = Features({'Rawi ID': Value('int32'), 'Famous Name': Value('string'), 'Narrator Rank': Value('string'), 'Number of Narrations': Value('string'), 'Official Name':Value('string'), 'Title Name':Value('string'), 'Generation': Value('string')} )
|
23 |
narrator_bios = load_dataset("FDSRashid/hadith_info", data_files = 'Teacher_Bios.csv', token = Secret_token,features=features )
|
24 |
narrator_bios = narrator_bios['train'].to_pandas()
|
25 |
narrator_bios.loc[49845, 'Narrator Rank'] = 'رسول الله'
|
26 |
narrator_bios.loc[49845, 'Number of Narrations'] = 0
|
27 |
narrator_bios['Number of Narrations'] = narrator_bios['Number of Narrations'].astype(int)
|
28 |
narrator_bios.loc[49845, 'Number of Narrations'] = 327512
|
29 |
+
narrator_bios['Generation'] = narrator_bios['Generation'].replace([None], [-1])
|
30 |
+
narrator_bios['Generation'] = narrator_bios['Generation'].astype(int)
|
31 |
|
32 |
|
33 |
|
|
|
81 |
allowpaymentrequest="" frameborder="0" srcdoc='{html}'></iframe>"""
|
82 |
|
83 |
def narrator_retriever(name):
|
84 |
+
return narrator_bios[(narrator_bios['Official Name'].str.contains(name)) | (narrator_bios['Famous Name'].str.contains(name)) | (narrator_bios['Rawi ID'].astype(str) == name)][['Rawi ID', 'Title Name', 'Official Name', 'Famous Name', 'Number of Narrations', 'Narrator Rank', 'Generation' ]]
|
85 |
|
86 |
|
87 |
|