|
@@ -217,18 +217,14 @@ def process_segment(item, audios=None):
|
|
|
values.append(str(match['confidence']))
|
|
|
|
|
|
except KeyError as ex:
|
|
|
- the_key = str(ex)
|
|
|
- if the_key == 'confidence':
|
|
|
- if should_index_empty:
|
|
|
- results.append({
|
|
|
- 'confidence': 0,
|
|
|
- 'timestamp': ts,
|
|
|
- 'offset': match['offset']
|
|
|
- })
|
|
|
- else:
|
|
|
- log.warning('Invalid confidence')
|
|
|
+ if should_index_empty:
|
|
|
+ results.append({
|
|
|
+ 'confidence': 0,
|
|
|
+ 'timestamp': ts,
|
|
|
+ 'offset': match['offset']
|
|
|
+ })
|
|
|
else:
|
|
|
- log.warning(the_key)
|
|
|
+ log.warning('Invalid confidence')
|
|
|
|
|
|
ts += match['length'] / 1000
|
|
|
|