TroglodyteDerivations
commited on
Commit
•
3eb37e3
1
Parent(s):
793f163
Updated line 112 with: ax.annotate("+ Inf", (trellis.size(0) - trellis.size(1) / 2.4 , trellis.size(1) / 3)) | Updated lines 260-261 with: updated_clean_UPPERCASE_transcript | Added Abby_and_Prince.jpg
Browse files
app.py
CHANGED
@@ -108,8 +108,8 @@ def n_inf_to_p_inf():
|
|
108 |
fig, ax = plt.subplots()
|
109 |
img = ax.imshow(trellis.T, origin="lower")
|
110 |
ax.annotate("- Inf", (trellis.size(1) / 5, trellis.size(1) / 1.5))
|
111 |
-
# Shift the "+ Inf" annotation to the
|
112 |
-
ax.annotate("+ Inf", (trellis.size(0) - trellis.size(1) /
|
113 |
fig.colorbar(img, ax=ax, shrink=0.25, location="bottom")
|
114 |
fig.tight_layout()
|
115 |
return fig
|
@@ -200,7 +200,7 @@ def merge_repeats(path):
|
|
200 |
score = sum(path[k].score for k in range(i1, i2)) / (i2 - i1)
|
201 |
segments.append(
|
202 |
Segment(
|
203 |
-
|
204 |
path[i1].time_index,
|
205 |
path[i2 - 1].time_index + 1,
|
206 |
score,
|
@@ -257,8 +257,8 @@ def plot_trellis_with_segments(trellis, segments, transcript):
|
|
257 |
return fig
|
258 |
|
259 |
|
260 |
-
plot_trellis_with_segments(trellis, segments,
|
261 |
-
st.pyplot(plot_trellis_with_segments(trellis, segments,
|
262 |
|
263 |
# Part L: Merge words | Segments
|
264 |
# Merge words
|
|
|
108 |
fig, ax = plt.subplots()
|
109 |
img = ax.imshow(trellis.T, origin="lower")
|
110 |
ax.annotate("- Inf", (trellis.size(1) / 5, trellis.size(1) / 1.5))
|
111 |
+
# Shift the "+ Inf" annotation to the right by increasing the denominator
|
112 |
+
ax.annotate("+ Inf", (trellis.size(0) - trellis.size(1) / 2.4 , trellis.size(1) / 3))
|
113 |
fig.colorbar(img, ax=ax, shrink=0.25, location="bottom")
|
114 |
fig.tight_layout()
|
115 |
return fig
|
|
|
200 |
score = sum(path[k].score for k in range(i1, i2)) / (i2 - i1)
|
201 |
segments.append(
|
202 |
Segment(
|
203 |
+
updated_clean_UPPERCASE_transcript[path[i1].token_index],
|
204 |
path[i1].time_index,
|
205 |
path[i2 - 1].time_index + 1,
|
206 |
score,
|
|
|
257 |
return fig
|
258 |
|
259 |
|
260 |
+
plot_trellis_with_segments(trellis, segments, updated_clean_UPPERCASE_transcript)
|
261 |
+
st.pyplot(plot_trellis_with_segments(trellis, segments, updated_clean_UPPERCASE_transcript))
|
262 |
|
263 |
# Part L: Merge words | Segments
|
264 |
# Merge words
|