Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bugfix/fix-newline-webvtt-sentence-segmentation #193

Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 8 additions & 0 deletions cdp_backend/sr_models/webvtt_sr_model.py
Expand Up @@ -164,7 +164,15 @@ def _get_sentences(
# List of text, representing a sentence
lines: List[str] = []
start_time: Optional[float] = None

for caption in speaker_turn_captions:

# Clean text of line breaks
caption.text = caption.text.replace("\n", " ")

# Remove any double spaces as result of line break removal
caption.text = caption.text.replace(" ", " ")

if start_time is None:
start_time = caption.start_in_seconds
lines.append(caption.text)
Expand Down