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

Improve code

parent e1406589
No related branches found
No related tags found
1 merge request!287Support subword and word language models
......@@ -36,7 +36,7 @@ class LMTokenMapping(NamedTuple):
return {a.display: a.encoded for a in self}
def encode_token(self, token: str) -> str:
return self.encode[token] if token in self.encode else token
return self.encode.get(token, token)
class EntityType(NamedTuple):
......
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