Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1272,14 +1272,19 @@ def apply_adaptive_speed(translated_json_raw, source_language, target_language,
|
|
1272 |
"""
|
1273 |
translated_json = copy.deepcopy(translated_json_raw)
|
1274 |
|
1275 |
-
# Prior average speech speeds by (category, target language)
|
1276 |
priors = {
|
1277 |
("drama", "en"): 5.0,
|
1278 |
("drama", "zh"): 4.5,
|
|
|
|
|
1279 |
("tutorial", "en"): 5.2,
|
1280 |
("tutorial", "zh"): 4.8,
|
|
|
|
|
1281 |
("shortplay", "en"): 5.1,
|
1282 |
("shortplay", "zh"): 4.7,
|
|
|
|
|
1283 |
}
|
1284 |
|
1285 |
# Adjustment ratio based on language pair (source → target)
|
@@ -1288,6 +1293,9 @@ def apply_adaptive_speed(translated_json_raw, source_language, target_language,
|
|
1288 |
("en", "zh"): 1.15,
|
1289 |
("zh", "jp"): 1.05,
|
1290 |
("en", "ja"): 0.9,
|
|
|
|
|
|
|
1291 |
}
|
1292 |
|
1293 |
# Optional style modulation factor
|
|
|
1272 |
"""
|
1273 |
translated_json = copy.deepcopy(translated_json_raw)
|
1274 |
|
|
|
1275 |
priors = {
|
1276 |
("drama", "en"): 5.0,
|
1277 |
("drama", "zh"): 4.5,
|
1278 |
+
("drama", "fr"): 4.2,
|
1279 |
+
("drama", "es"): 4.3,
|
1280 |
("tutorial", "en"): 5.2,
|
1281 |
("tutorial", "zh"): 4.8,
|
1282 |
+
("tutorial", "fr"): 4.5,
|
1283 |
+
("tutorial", "es"): 4.5,
|
1284 |
("shortplay", "en"): 5.1,
|
1285 |
("shortplay", "zh"): 4.7,
|
1286 |
+
("shortplay", "fr"): 4.3,
|
1287 |
+
("shortplay", "es"): 4.4,
|
1288 |
}
|
1289 |
|
1290 |
# Adjustment ratio based on language pair (source → target)
|
|
|
1293 |
("en", "zh"): 1.15,
|
1294 |
("zh", "jp"): 1.05,
|
1295 |
("en", "ja"): 0.9,
|
1296 |
+
("en", "fr"): 0.85,
|
1297 |
+
("en", "es"): 0.88,
|
1298 |
+
("en", "de"): 0.9
|
1299 |
}
|
1300 |
|
1301 |
# Optional style modulation factor
|