FDSRashid commited on
Commit
5c2a2d9
·
verified ·
1 Parent(s): 48e5b0f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -2
app.py CHANGED
@@ -71,8 +71,11 @@ def network_narrator(narrator_id):
71
  return edge_full
72
 
73
  def narrator_retriever(name):
74
- full_names = name.replace(', ', '|').replace(',', '|')
75
- return narrator_bios[(narrator_bios['Official Name'].apply(lambda x: araby.strip_diacritics(x)).str.contains(araby.strip_diacritics(name), regex=True)) | (narrator_bios['Famous Name'].apply(lambda x: araby.strip_diacritics(x)).str.contains(araby.strip_diacritics(name), regex=True)) | (narrator_bios['Rawi ID'].astype(str).isin(full_names.split('|')))]
 
 
 
76
 
77
 
78
  with gr.Blocks() as demo:
 
71
  return edge_full
72
 
73
  def narrator_retriever(name):
74
+ if 'ALL' in name:
75
+ return narrator_bios
76
+ else:
77
+ full_names = name.replace(', ', '|').replace(',', '|')
78
+ return narrator_bios[(narrator_bios['Official Name'].apply(lambda x: araby.strip_diacritics(x)).str.contains(araby.strip_diacritics(name), regex=True)) | (narrator_bios['Famous Name'].apply(lambda x: araby.strip_diacritics(x)).str.contains(araby.strip_diacritics(name), regex=True)) | (narrator_bios['Rawi ID'].astype(str).isin(full_names.split('|')))]
79
 
80
 
81
  with gr.Blocks() as demo: