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']] 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",