Skip to content

Commit

Permalink
Merge pull request #141 from GeorgeEfstathiadis/speech_chars_whisperx…
Browse files Browse the repository at this point in the history
…_bug

Speech Characteristics with WhisperX Bug
  • Loading branch information
vjbytes102 authored Aug 15, 2024
2 parents 0be4c4f + b98cbd6 commit 42adc3e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions openwillis/measures/text/util/characteristics_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,13 +287,13 @@ def create_turns_whisper(item_data, measures):

for item in item_data:
if item['speaker'] == current_speaker:
idxs = [word[measures["old_index"]] for word in item['words']]
idxs = [word[measures["old_index"]] for word in item['words'] if 'start' in word]
# Continue aggregating text and ids for the current speaker
aggregated_text += " " + item['text']
aggregated_ids.extend(idxs)

word_ids.extend(idxs)
word_texts.extend([word['word'] for word in item['words']])
word_texts.extend([word['word'] for word in item['words'] if 'start' in word])

phrase_ids.append((idxs[0], idxs[-1]))
phrase_texts.append(item['text'])
Expand All @@ -314,10 +314,10 @@ def create_turns_whisper(item_data, measures):
# Reset aggregation for the new speaker
current_speaker = item['speaker']
aggregated_text = item['text']
aggregated_ids = [word[measures["old_index"]] for word in item['words']]
aggregated_ids = [word[measures["old_index"]] for word in item['words'] if 'start' in word]

word_ids = [word[measures["old_index"]] for word in item['words']]
word_texts = [word['word'] for word in item['words']]
word_ids = [word[measures["old_index"]] for word in item['words'] if 'start' in word]
word_texts = [word['word'] for word in item['words'] if 'start' in word]

phrase_ids = [(word_ids[0], word_ids[-1])]
phrase_texts = [item['text']]
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
install_requires = fp.read()

setuptools.setup(name='openwillis',
version='2.2.0',
version='2.2.1',
description='digital health measurement',
long_description=long_description,
long_description_content_type="text/markdown",
Expand Down

0 comments on commit 42adc3e

Please sign in to comment.