From 0b06794fde09bedfb75ee85504148cf3a4707e21 Mon Sep 17 00:00:00 2001
From: shixian.shi <shixian.shi@alibaba-inc.com>
Date: 星期一, 13 三月 2023 20:14:41 +0800
Subject: [PATCH] bug fix
---
funasr/utils/timestamp_tools.py | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/funasr/utils/timestamp_tools.py b/funasr/utils/timestamp_tools.py
index 73f0c7a..2bccd50 100644
--- a/funasr/utils/timestamp_tools.py
+++ b/funasr/utils/timestamp_tools.py
@@ -134,9 +134,9 @@
uttid_intersection = self._intersection(uttid_list1, uttid_list2)
res = self.as_cal(uttid_intersection, ts_dict1, ts_dict2)
logging.warning("Average shift of {} and {}: {}.".format(file1, file2, str(res)[:8]))
- logging.warning("Following timestamp pair differs most: {}, detail:{}".format(self.max_shift_uttid))
+ logging.warning("Following timestamp pair differs most: {}, detail:{}".format(self.max_shift, self.max_shift_uttid))
- def _intersection(list1, list2):
+ def _intersection(self, list1, list2):
set1 = set(list1)
set2 = set(list2)
if set1 == set2:
@@ -170,8 +170,9 @@
return uttid_list, ts_dict
def _shift(self, filtered_timestamp_list1, filtered_timestamp_list2):
+ shift_time = 0
for fts1, fts2 in zip(filtered_timestamp_list1, filtered_timestamp_list2):
- shift_time = abs(fts1[0] - fts2[0]) + abs(fts1[1] - fts2[1])
+ shift_time += abs(fts1[0] - fts2[0]) + abs(fts1[1] - fts2[1])
num_tokens = len(filtered_timestamp_list1)
return shift_time, num_tokens
--
Gitblit v1.9.1