Skip to content
This repository has been archived by the owner on Apr 13, 2020. It is now read-only.

Commit

Permalink
using beam size
Browse files Browse the repository at this point in the history
  • Loading branch information
Bedapudi Praneeth authored and Bedapudi Praneeth committed Feb 1, 2019
1 parent e88d8a5 commit ad1fcc6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions deepcorrect/deepcorrect.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ def __init__(self, params_path, checkpoint_path):
DeepCorrect.deepcorrect_model = build_model(params_path)
DeepCorrect.deepcorrect_model[0].load_weights(checkpoint_path)

def correct(self, sentence):
def correct(self, sentence, beam_size = 1):
if not DeepCorrect.deepcorrect_model:
print('Please load the model first')

sentence = sentence.strip()
sentence = infer(sentence, DeepCorrect.deepcorrect_model[0], DeepCorrect.deepcorrect_model[1])
sentence = infer(sentence, DeepCorrect.deepcorrect_model[0], DeepCorrect.deepcorrect_model[1], beam_size = beam_size)

return sentence

0 comments on commit ad1fcc6

Please sign in to comment.