Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -11,17 +11,17 @@ def predict(brakes, input_text):
|
|
| 11 |
|
| 12 |
# preprocess the text by removing filler words
|
| 13 |
# Define a list of filler words to remove
|
| 14 |
-
fillers = ["um", "uh", "hmm", "ha", "er", "ah"]
|
| 15 |
# Define a regular expression pattern that matches any filler word surrounded by whitespace or punctuation
|
| 16 |
-
pattern = r"(?<=\s|\b)(" + "|".join(fillers) + r")(?=\s|\b)"
|
| 17 |
# Use re.sub to replace the filler words with empty strings
|
| 18 |
-
clean_input_text = re.sub(pattern, "", input_text)
|
| 19 |
|
| 20 |
# Do the punctuation restauration
|
| 21 |
model = PunctuationModel()
|
| 22 |
-
output_text = model.restore_punctuation(
|
| 23 |
|
| 24 |
-
srt_file =
|
| 25 |
punctuated = output_text
|
| 26 |
|
| 27 |
# if any of the line brake methods are implemented,
|
|
|
|
| 11 |
|
| 12 |
# preprocess the text by removing filler words
|
| 13 |
# Define a list of filler words to remove
|
| 14 |
+
#fillers = ["um", "uh", "hmm", "ha", "er", "ah"]
|
| 15 |
# Define a regular expression pattern that matches any filler word surrounded by whitespace or punctuation
|
| 16 |
+
#pattern = r"(?<=\s|\b)(" + "|".join(fillers) + r")(?=\s|\b)"
|
| 17 |
# Use re.sub to replace the filler words with empty strings
|
| 18 |
+
#clean_input_text = re.sub(pattern, "", input_text)
|
| 19 |
|
| 20 |
# Do the punctuation restauration
|
| 21 |
model = PunctuationModel()
|
| 22 |
+
output_text = model.restore_punctuation(input_text)
|
| 23 |
|
| 24 |
+
srt_file = input_text
|
| 25 |
punctuated = output_text
|
| 26 |
|
| 27 |
# if any of the line brake methods are implemented,
|