Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -11,7 +11,7 @@ def plot_scalar_on_scale(scalar_value, distance_type):
|
|
| 11 |
scalar_value = np.clip(scalar_value, 0.0, 1.0)
|
| 12 |
|
| 13 |
# Create a figure and axis
|
| 14 |
-
fig, ax = plt.subplots(figsize=(
|
| 15 |
|
| 16 |
# Create a horizontal gradient (from close to distant)
|
| 17 |
gradient = np.linspace(0, 1, 256).reshape(1, -1)
|
|
@@ -21,13 +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 |
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=
|
| 31 |
|
| 32 |
# Customize the axis
|
| 33 |
ax.set_xticks([]) # Remove x-axis ticks
|
|
@@ -153,11 +153,11 @@ iface = gr.Interface(fn=m.measure,
|
|
| 153 |
type="value",
|
| 154 |
value='German (deu)',
|
| 155 |
label="Select the second Language (type on your keyboard to find it quickly)")],
|
| 156 |
-
outputs=[gr.Plot(),
|
| 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()
|
|
|
|
| 11 |
scalar_value = np.clip(scalar_value, 0.0, 1.0)
|
| 12 |
|
| 13 |
# Create a figure and axis
|
| 14 |
+
fig, ax = plt.subplots(figsize=(12, 4))
|
| 15 |
|
| 16 |
# Create a horizontal gradient (from close to distant)
|
| 17 |
gradient = np.linspace(0, 1, 256).reshape(1, -1)
|
|
|
|
| 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=32)
|
| 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=270)
|
| 31 |
|
| 32 |
# Customize the axis
|
| 33 |
ax.set_xticks([]) # Remove x-axis ticks
|
|
|
|
| 153 |
type="value",
|
| 154 |
value='German (deu)',
|
| 155 |
label="Select the second Language (type on your keyboard to find it quickly)")],
|
| 156 |
+
outputs=[gr.Plot(label=""),
|
| 157 |
+
gr.Plot(label=""),
|
| 158 |
+
gr.Plot(label=""),
|
| 159 |
+
gr.Plot(label="")],
|
| 160 |
+
description="<br><br> 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 <br><br>")
|
| 163 |
iface.launch()
|