Skip to content

Added filter by wordcount function#290

Closed
Veronika271 wants to merge 5 commits into
mainfrom
289-task-filtering-audio-samples-by-whether-or-not-the-number-of-words-falls-within-a-certain-range
Closed

Added filter by wordcount function#290
Veronika271 wants to merge 5 commits into
mainfrom
289-task-filtering-audio-samples-by-whether-or-not-the-number-of-words-falls-within-a-certain-range

Conversation

@Veronika271

Copy link
Copy Markdown
Collaborator

Description

Wrote a method that counts the number of words in a speech sample and then returns True if the number of words falls within a specified range, and False otherwise.

Related Issue(s)

#289

Motivation and Context

Sometimes people talk very little, especially when they are struggling with certain mood disorders. I'm worried that if we don't get a sufficiently long voice sample, it will be hard to draw any conclusions due to small sample size.

How Has This Been Tested?

I tested it locally on a toy example and showed it to Dr. Catania!

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🚀 First Pull Request 🎉

Welcome to Senselab, and thank you for submitting your first pull request! We’re thrilled to have your contribution. Our team will review it as soon as possible. Stay engaged, and let’s make behavioral data analysis even more powerful together!

@Veronika271
Veronika271 requested a review from ibevers March 24, 2025 20:00
@ibevers

ibevers commented Mar 24, 2025

Copy link
Copy Markdown
Collaborator

@Veronika271 can you add a unit test for this?

@ibevers

ibevers commented Mar 24, 2025

Copy link
Copy Markdown
Collaborator

I tested it locally on a toy example and showed it to Dr. Catania!

Nice!:) @Veronika271 feel free to call him Fabio--he prefers that as far as I know:)

@ibevers ibevers left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Overall, this looks like a great first addition! There's a few little things to do, but I like it overall🙂🌱

Comment thread src/senselab/audio/tasks/filter_by_word_count.py Outdated
Comment thread src/senselab/audio/tasks/filter_by_word_count.py Outdated
Comment thread src/senselab/audio/tasks/filter_by_word_count.py Outdated
@ibevers

ibevers commented Mar 24, 2025

Copy link
Copy Markdown
Collaborator

@Veronika271

resampled_mono_audio_sample: Audio, resampled_mono_audio_sample_x2: Audio, speechbrain_model: SpeechBrainModel

In your unit test, you can pass an audio sample like this--we have it configured this way for convenience

@ibevers

ibevers commented Mar 24, 2025

Copy link
Copy Markdown
Collaborator

@Veronika271 see all the audio samples you can use here:
src/tests/audio/conftest.py

@ibevers ibevers left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks for adding unit tests:)

Comment thread src/senselab/audio/tasks/filter_by_word_count.py
@ibevers

ibevers commented Jun 10, 2025

Copy link
Copy Markdown
Collaborator

@Veronika271 I think this functionality would fit better within the quality_control module now that it exists. Would you mind doing these steps?

  • Change base to 276-feature-implement-bioacoustic-quality-control-framework
  • Create a metric function that counts the number of words here: src/senselab/audio/tasks/bioacoustic_qc/metrics.py
  • Create a check function that determines whether the number of words are in a range here: src/senselab/audio/tasks/bioacoustic_qc/checks.py

@ibevers ibevers self-assigned this Aug 11, 2025
…or-not-the-number-of-words-falls-within-a-certain-range
@fabiocat93
fabiocat93 marked this pull request as draft August 29, 2025 12:52
@satra

satra commented Apr 25, 2026

Copy link
Copy Markdown
Collaborator

Closing — stale. Tracked by issue #289 under meta issue #474 (Audio Data Model).

@satra satra closed this Apr 25, 2026
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.

Task: Filtering audio samples by whether or not the number of words falls within a certain range

3 participants