Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -51,11 +51,11 @@ def default_table():
|
|
51 |
"Title": ["", "", "", "", ""]
|
52 |
})
|
53 |
|
54 |
-
def
|
55 |
|
56 |
df = speaker_names.itertuples(index=False)
|
57 |
for default, name, title in df:
|
58 |
-
if title
|
59 |
title = " ("+title+")"
|
60 |
|
61 |
text = text.replace(default, f"{name}{title}")
|
@@ -118,7 +118,7 @@ def main(conf):
|
|
118 |
)
|
119 |
|
120 |
fix_button.click(
|
121 |
-
fn=
|
122 |
inputs=[speaker_names, transcription_output],
|
123 |
outputs=[label_file_link]
|
124 |
)
|
|
|
51 |
"Title": ["", "", "", "", ""]
|
52 |
})
|
53 |
|
54 |
+
def substitute_names(speaker_names, text):
|
55 |
|
56 |
df = speaker_names.itertuples(index=False)
|
57 |
for default, name, title in df:
|
58 |
+
if title != "":
|
59 |
title = " ("+title+")"
|
60 |
|
61 |
text = text.replace(default, f"{name}{title}")
|
|
|
118 |
)
|
119 |
|
120 |
fix_button.click(
|
121 |
+
fn=substitute_names,
|
122 |
inputs=[speaker_names, transcription_output],
|
123 |
outputs=[label_file_link]
|
124 |
)
|