Skip to content

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
[email protected] committed Jul 12, 2022
1 parent 669d495 commit 2a8c67d
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions src/baseline/predictor.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,13 +107,7 @@ def output2text(output):
continue
elif '$REPLACE' in pred_token:
pred_text += pred_token.split('_')[-1]
elif '$INSERT' in pred_token:
elif '$APPEND' in pred_token:
pred_text += src_token+pred_token.split('_')[-1]

return pred_text


if __name__ == '__main__':
p = PredictorCtc('model/ctc_2022Y04M27D03H/epoch11,step1,testf1_100_0%,devf1_100_0%')
r = p.predict('今天的天气真错!', return_topk=3)
print(r)
return pred_text

0 comments on commit 2a8c67d

Please sign in to comment.