Skip to content
Snippets Groups Projects
Commit c23b608a authored by Solene Tarride's avatar Solene Tarride
Browse files

Add the unknown character to the list of tokens

parent 87663643
No related branches found
No related tags found
No related merge requests found
This commit is part of merge request !287. Comments created here will be created in the context of that merge request.
......@@ -365,6 +365,7 @@ class ArkindexExtractor:
self.mapping.encode[token]
) if token in self.mapping.encode else self.language_tokens.append(token)
self.language_tokens.append(self.mapping.ctc.encoded)
self.language_tokens.append(self.unknown_token)
# Build LM corpus
train_corpus = [
......
......@@ -654,6 +654,7 @@ def test_extract(
"" if t.isspace() else t for t in sorted(list(expected_charset))
]
expected_language_tokens.append("")
expected_language_tokens.append("")
assert (output / "language_model" / "tokens.txt").read_text() == "\n".join(
expected_language_tokens
)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment