Skip to content

Option to add timestamps to the .txt file output.#355

Open
cbsfletch wants to merge 2 commits intoMahmoudAshraf97:mainfrom
cbsfletch:txt_file_timestamps
Open

Option to add timestamps to the .txt file output.#355
cbsfletch wants to merge 2 commits intoMahmoudAshraf97:mainfrom
cbsfletch:txt_file_timestamps

Conversation

@cbsfletch
Copy link
Contributor

In the command line to diarize.py or diarize-parallel, simply include --with-txt-timestamps
Default is false

In the command line to diarize.py or diarize-parallel, simply include --with-txt-timestamps
Default is false
In the command line to diarize.py or diarize-parallel, simply include --with-txt-timestamps
Default is false
@gemini-code-assist
Copy link

Summary of Changes

Hello @cbsfletch, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request enhances the diarization scripts by adding an optional feature to include timestamps in the plain text output files. This allows users to generate transcripts with temporal markers for each speaker's turn, improving the utility and readability of the output for applications requiring precise timing information.

Highlights

  • New Command-Line Option: Introduced a new command-line argument, --with-txt-timestamps, for both diarize.py and diarize_parallel.py. This boolean flag, defaulting to false, allows users to control whether timestamps are included in the generated .txt output files.
  • Timestamp Inclusion in Output: When --with-txt-timestamps is enabled, the .txt output will now include the start time of each speaker's segment, formatted and placed before the speaker's name and their transcribed text. This provides more detailed temporal context for the transcription.
  • Function Signature Update: The get_speaker_aware_transcript function in helpers.py has been updated to accept a new txt_timestamps parameter. This parameter dictates the logic for including or excluding timestamps in the transcript output.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a new command-line option, --with-txt-timestamps, to add timestamps to the .txt output files in both diarize.py and diarize-parallel.py. The implementation in helpers.py correctly adds a timestamp whenever the speaker changes. The overall logic is sound. My feedback is focused on improving the clarity of the help text for the new argument to ensure users understand exactly when timestamps are added.

"--with-txt-timestamps",
action="store_true",
dest="txt_timestamps",
help="Include timestamps in the txt file output. This argument is optional, and by default timestamps are not included in the txt output.",

Choose a reason for hiding this comment

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

medium

The help text is a bit verbose and could be more precise. The current implementation adds timestamps only when the speaker changes. The current description might imply that every sentence gets a timestamp. Updating the help text to reflect this behavior will improve clarity for users.

Suggested change
help="Include timestamps in the txt file output. This argument is optional, and by default timestamps are not included in the txt output.",
help="Include timestamps in the txt file output at speaker changes.",

"--with-txt-timestamps",
action="store_true",
dest="txt_timestamps",
help="Include timestamps in the txt file output. This argument is optional, and by default timestamps are not included in the txt output.",

Choose a reason for hiding this comment

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

medium

The help text is a bit verbose and could be more precise. The current implementation adds timestamps only when the speaker changes. The current description might imply that every sentence gets a timestamp. Updating the help text to reflect this behavior will improve clarity for users.

Suggested change
help="Include timestamps in the txt file output. This argument is optional, and by default timestamps are not included in the txt output.",
help="Include timestamps in the txt file output at speaker changes.",

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.

2 participants