Skip to content

Commit e55f431

Browse files
formatting
1 parent f0a3332 commit e55f431

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

ctc_forced_aligner/align.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@ def cli():
6161
default="edges",
6262
choices=["segment", "edges"],
6363
help="The frequency of the <star> token in the text."
64-
"Star token increases the accuracy of the alignment but also increases segment fragmentation."
65-
"segment adds <star> token after each segment."
64+
"Star token increases the accuracy of the alignment but also increases segment"
65+
"fragmentation. segment adds <star> token after each segment."
6666
"edges adds <star> token at the start and end of the text."
6767
"use --merge_threshold to merge segments that are closer than the threshold.",
6868
)
@@ -118,7 +118,8 @@ def cli():
118118
type=str,
119119
default=None,
120120
choices=["eager", "sdpa", "flash_attention_2", None],
121-
help="Attention implementation for the model. It will chose the fastest implementation by default.",
121+
help="Attention implementation for the model. "
122+
"It will chose the fastest implementation by default.",
122123
)
123124

124125
parser.add_argument(

ctc_forced_aligner/text_utils.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,12 @@ def text_normalize(
7373
normalized_text = re.sub(delete_patten, "", normalized_text)
7474

7575
# Remove words containing only digits
76-
# We check for 3 cases a)text starts with a number b) a number is present somewhere in the middle of the text c) the text ends with a number
77-
# For each case we use lookaround regex pattern to see if the digit pattern in preceded and followed by whitespaces, only then we replace the numbers with space
76+
# We check for 3 cases:
77+
# a)text starts with a number
78+
# b) a number is present somewhere in the middle of the text
79+
# c) the text ends with a number
80+
# For each case we use lookaround regex pattern to see if the digit pattern in preceded
81+
# and followed by whitespaces, only then we replace the numbers with space
7882
# The lookaround enables overlapping pattern matches to be replaced
7983

8084
if remove_numbers:

0 commit comments

Comments
 (0)