Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -21,11 +21,13 @@ def plot_scalar_on_scale(scalar_value, distance_type):
|
|
| 21 |
ax.axvline(x=scalar_value, color='white', lw=5)
|
| 22 |
|
| 23 |
# Add a dot at the scalar position
|
| 24 |
-
ax.plot(scalar_value, 0.5, 'o', color='white', markersize=
|
| 25 |
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
|
|
|
|
|
|
| 29 |
|
| 30 |
# Customize the axis
|
| 31 |
ax.set_xticks([]) # Remove x-axis ticks
|
|
@@ -155,5 +157,7 @@ iface = gr.Interface(fn=m.measure,
|
|
| 155 |
gr.Plot(),
|
| 156 |
gr.Plot(),
|
| 157 |
gr.Plot()],
|
| 158 |
-
|
|
|
|
|
|
|
| 159 |
iface.launch()
|
|
|
|
| 21 |
ax.axvline(x=scalar_value, color='white', lw=5)
|
| 22 |
|
| 23 |
# Add a dot at the scalar position
|
| 24 |
+
ax.plot(scalar_value, 0.5, 'o', color='white', markersize=26)
|
| 25 |
|
| 26 |
+
ax.text(scalar_value, 0.5, f'{scalar_value:.2f}', color='black', ha='center', va='center', fontsize=10, fontweight='bold')
|
| 27 |
+
|
| 28 |
+
# Add labels rotated 90 degrees on the sides
|
| 29 |
+
ax.text(-0.05, 0.5, 'Close', ha='center', va='center', fontsize=12, rotation=90)
|
| 30 |
+
ax.text(1.05, 0.5, 'Distant', ha='center', va='center', fontsize=12, rotation=90)
|
| 31 |
|
| 32 |
# Customize the axis
|
| 33 |
ax.set_xticks([]) # Remove x-axis ticks
|
|
|
|
| 157 |
gr.Plot(),
|
| 158 |
gr.Plot(),
|
| 159 |
gr.Plot()],
|
| 160 |
+
description="This demo allows you to view the distance between two languages from the ISO 639-3 list according to several distance measurement functions. "
|
| 161 |
+
"For more information, check out our paper: https://arxiv.org/abs/2406.06403 and our text-to-speech tool, in which we make use of "
|
| 162 |
+
"this technique: https://github.com/DigitalPhonetics/IMS-Toucan")
|
| 163 |
iface.launch()
|