From d811b434277b0947235ce82e624ec5195b51e3a6 Mon Sep 17 00:00:00 2001 From: GeorgiosEfstathiadis Date: Wed, 14 Aug 2024 14:54:26 -0400 Subject: [PATCH 1/2] remove words which don't have timepoints from ASR --- openwillis/measures/text/util/characteristics_util.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/openwillis/measures/text/util/characteristics_util.py b/openwillis/measures/text/util/characteristics_util.py index d87285f..716e957 100644 --- a/openwillis/measures/text/util/characteristics_util.py +++ b/openwillis/measures/text/util/characteristics_util.py @@ -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']) @@ -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']] From b98cbd6c8b047d169570081489a9266a34fbe124 Mon Sep 17 00:00:00 2001 From: GeorgiosEfstathiadis Date: Wed, 14 Aug 2024 14:57:07 -0400 Subject: [PATCH 2/2] update version --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 8e2f957..c42c86f 100644 --- a/setup.py +++ b/setup.py @@ -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",