Skip to content

Comments

Inclusion config#243

Draft
Evan8456 wants to merge 5 commits intomainfrom
inclusion_config
Draft

Inclusion config#243
Evan8456 wants to merge 5 commits intomainfrom
inclusion_config

Conversation

@Evan8456
Copy link
Contributor

  • Removed sensitive_audio_tasks.json and replace it with audio_tasks_to_include.json to allow more control as to what tasks we wish to include during de-identification,

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @Evan8456, 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 refactors the audio task configuration within the de-identification process. By shifting from an exclusion-based model to an inclusion-based model, the changes provide enhanced control and clarity over which specific audio tasks are selected for de-identification, improving the overall flexibility of the system.

Highlights

  • Configuration File Renaming: The configuration file sensitive_audio_tasks.json has been renamed to audio_tasks_to_include.json to better reflect its purpose of specifying tasks for inclusion rather than exclusion during de-identification.
  • Inclusion Logic Implementation: A new static method _grab_filepaths_list_to_include was added to filter file paths based on an explicit inclusion list, replacing the previous exclusion-based approach for audio tasks.
  • De-identification Process Update: The de-identification functions (_deidentify_audio_files and _deidentify_feature_files) were updated to utilize the new inclusion list and logic, providing more granular control over which audio tasks are processed.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • src/b2aiprep/commands.py
    • Updated references to the audio task configuration file from sensitive_audio_tasks.json to audio_tasks_to_include.json.
  • src/b2aiprep/prepare/dataset.py
    • Renamed the load_sensitive_audio_tasks method to load_audio_tasks_to_include and updated its internal file path.
    • Introduced a new static method _grab_filepaths_list_to_include for filtering file paths based on an inclusion list.
    • Modified the deidentify method to call the new load_audio_tasks_to_include method.
    • Updated _deidentify_audio_files and _deidentify_feature_files to use the new inclusion logic and parameters for audio tasks.
  • tests/conftest.py
    • Adjusted the default setup for configuration files to use audio_tasks_to_include.json instead of sensitive_audio_tasks.json.
Activity
  • The pull request description states that sensitive_audio_tasks.json was removed and replaced with audio_tasks_to_include.json to allow more control over tasks included during de-identification.
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
Contributor

@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 refactors the de-identification process to use an inclusion-based configuration (audio_tasks_to_include.json) instead of an exclusion-based one (sensitive_audio_tasks.json). This is a good change for clarity and control.

My review focuses on ensuring this change is applied consistently across the codebase. I've found a few areas where old naming conventions and comments persist, which could cause confusion. I've also identified a bug in the new _grab_filepaths_list_to_include function that could lead to incorrect behavior and suggested a more efficient and correct implementation.

Overall, the changes are in the right direction. Addressing the feedback will improve the consistency and correctness of the implementation.

Comment on lines 1903 to 1912
n = len(paths)
inclusion = set(inclusion_list)
if len(inclusion) == 0:
return paths

new_paths = []
for file in paths:
for incl in inclusion_list:
if normalize_task_label(incl) in normalize_task_label(file.stem):
new_paths.append(file)
Copy link
Contributor

Choose a reason for hiding this comment

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

high

This implementation has a couple of issues:

  1. It can add duplicate file paths to new_paths if a file stem matches multiple inclusion criteria.
  2. It iterates over inclusion_list instead of the inclusion set that was created, which is less efficient if the list contains duplicates.
  3. The normalization of inclusion strings and file stems is done repeatedly inside the loops, which is inefficient.

I suggest refactoring this part to be more efficient and to prevent adding duplicate paths.

Suggested change
n = len(paths)
inclusion = set(inclusion_list)
if len(inclusion) == 0:
return paths
new_paths = []
for file in paths:
for incl in inclusion_list:
if normalize_task_label(incl) in normalize_task_label(file.stem):
new_paths.append(file)
n = len(paths)
inclusion_set = {normalize_task_label(i) for i in inclusion_list}
if not inclusion_set:
return paths
new_paths = []
for file in paths:
normalized_stem = normalize_task_label(file.stem)
if any(incl in normalized_stem for incl in inclusion_set):
new_paths.append(file)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

added an early break should achieve the same result.

Copy link
Contributor

Choose a reason for hiding this comment

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

you don't do the efficient things it mentions but u do solve the possible error

@Evan8456 Evan8456 requested a review from wilke0818 February 19, 2026 14:22
Copy link
Contributor

@wilke0818 wilke0818 left a comment

Choose a reason for hiding this comment

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

looks mostly good. check gemini comments. some of them make sense, though I would tweak it's phrasing of error messages maybe. Overall I think I am still worried about how this logic incorporates with other logic in the code (namely selecting features to keep)

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