Skip to content

Commit

Permalink
round to 2
Browse files Browse the repository at this point in the history
  • Loading branch information
chainyo committed Jun 7, 2023
1 parent 35d8d0e commit 6e2a59a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions wordcab_transcribe/services/align_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -419,9 +419,9 @@ def align(
start, end, score = None, None, None
if cdx in segment["clean_cdx"]:
char_seg = char_segments[segment["clean_cdx"].index(cdx)]
start = round(char_seg.start * ratio + t1, 3)
end = round(char_seg.end * ratio + t1, 3)
score = round(char_seg.score, 3)
start = round(char_seg.start * ratio + t1, 2)
end = round(char_seg.end * ratio + t1, 2)
score = round(char_seg.score, 2)

char_segments_arr.append(
{
Expand Down Expand Up @@ -468,7 +468,7 @@ def align(
word_chars = word_chars[word_chars["char"] != " "]
word_start = word_chars["start"].min()
word_end = word_chars["end"].max()
word_score = round(word_chars["score"].mean(), 3)
word_score = round(word_chars["score"].mean(), 2)

# -1 indicates unalignable
word_segment = {"word": word_text}
Expand Down

0 comments on commit 6e2a59a

Please sign in to comment.