nguyenvulebinh commited on
Commit
5b512d5
1 Parent(s): 4020980

add chunk merging

Browse files
Files changed (2) hide show
  1. infer.py +1 -1
  2. utils.py +1 -1
infer.py CHANGED
@@ -232,7 +232,7 @@ def reformat_normed_term(list_pre_norm, spoken_norm_output, debug=False):
232
  for pre_norm in list_pre_norm:
233
  normed_words = []
234
  # words = pre_norm.split()
235
- for w in pre_norm[1:-1]:
236
  if w.startswith('<mask>'):
237
  term = w[7:].split('](')
238
  # print(w)
 
232
  for pre_norm in list_pre_norm:
233
  normed_words = []
234
  # words = pre_norm.split()
235
+ for w in pre_norm:
236
  if w.startswith('<mask>'):
237
  term = w[7:].split('](')
238
  # print(w)
utils.py CHANGED
@@ -167,7 +167,7 @@ def merge_two_chunk(chunk_1, chunk_2, overlap, debug=False):
167
  print('-----------------------')
168
  print(compete_2, '\n', remain_2)
169
  print('-----------------------')
170
- print(compromise)
171
 
172
  return remain_1 + compromise + remain_2
173
 
 
167
  print('-----------------------')
168
  print(compete_2, '\n', remain_2)
169
  print('-----------------------')
170
+ print(compromise, '\n\n')
171
 
172
  return remain_1 + compromise + remain_2
173