Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
johnml1135 committed May 10, 2024
1 parent 71aecc5 commit 664c14f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion machine/translation/thot/thot_smt_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def __init__(
target_detokenizer: Detokenizer[str, str] = WHITESPACE_DETOKENIZER,
lowercase_source: bool = False,
lowercase_target: bool = False,
truecaser: Optional[Truecaser] = field(default_factory=UnigramTruecaser),
truecaser: Optional[Truecaser] = None,
) -> None:
if isinstance(config, ThotSmtParameters):
self._config_filename = None
Expand All @@ -84,7 +84,10 @@ def __init__(
self.target_detokenizer = target_detokenizer
self.lowercase_source = lowercase_source
self.lowercase_target = lowercase_target

self.truecaser = truecaser
if self.truecaser is None:
self.truecaser = UnigramTruecaser()

self._word_alignment_model_type = word_alignment_model_type
self._direct_word_alignment_model = create_thot_word_alignment_model(self._word_alignment_model_type)
Expand Down

0 comments on commit 664c14f

Please sign in to comment.