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

Use CutSet for whisper annotation workflow #834

Merged
merged 17 commits into from
Oct 5, 2022

Conversation

desh2608
Copy link
Collaborator

@desh2608 desh2608 commented Oct 3, 2022

This PR allows transcribing a CutSet with the whisper workflow. It is currently WIP since it relies on #832 and #822. But I have verified that it works.

@desh2608 desh2608 changed the title WIP: Use CutSet for whisper annotation workflow Use CutSet for whisper annotation workflow Oct 5, 2022
@desh2608
Copy link
Collaborator Author

desh2608 commented Oct 5, 2022

@pzelasko I have separated it into two helper functions. Let me know if it looks reasonable now.

id=f"{cut.id}-{segment['id']:06d}",
recording_id=cut.recording_id,
start=round(segment["start"], ndigits=8),
duration=round(segment["end"], ndigits=8),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think with this single change we can prevent timestamps going out of cut's duration; can you also include _postprocess_timestamps in the cut-based workflow?

Suggested change
duration=round(segment["end"], ndigits=8),
duration=max(cut.duration, round(segment["end"], ndigits=8)),

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done!

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BTW, why are we using "end" as the duration? Shouldn't it be "end-start"?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because in my own testing I discovered that their "end" is actually a "duration" 😂 but if you could triple-check that I got it right, maybe using some longer recording, that'd be great.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So I ran the model on one of the AMI headset recordings (~5000s) and it seems like the "end" actually shows the end of the segment, not the duration. Here is the JSON containing the results["segments"]: https://drive.google.com/file/d/169igkcDY2SmMs5k3hOhHip89T4MQDnKs/view?usp=sharing

@pzelasko pzelasko added this to the v1.9 milestone Oct 5, 2022
@pzelasko
Copy link
Collaborator

pzelasko commented Oct 5, 2022

Thanks, LGTM

@pzelasko pzelasko merged commit 41c44e8 into lhotse-speech:master Oct 5, 2022
@desh2608 desh2608 deleted the feature/whisper_cut branch November 2, 2023 19:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants