Skip to content

Commit

Permalink
bugfix language detection for UPPERCASE text
Browse files Browse the repository at this point in the history
  • Loading branch information
nreimers committed Jan 27, 2021
1 parent d3a25aa commit 8b0d2eb
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion easynmt/EasyNMT.py
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ def language_detection(self, text: str) -> str:
http_get('https://dl.fbaipublicfiles.com/fasttext/supervised-models/lid.176.ftz', model_path)
self._fasttext_lang_id = fasttext.load_model(model_path)

return self._fasttext_lang_id.predict(text.replace("\r\n", " ").replace("\n", " ").strip())[0][0].split('__')[-1]
return self._fasttext_lang_id.predict(text.lower().replace("\r\n", " ").replace("\n", " ").strip())[0][0].split('__')[-1]

def sentence_splitting(self, text: str, lang: str = None):
if lang == 'th':
Expand Down
2 changes: 1 addition & 1 deletion easynmt/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = "1.0.0"
__version__ = "1.0.1"
__DOWNLOAD_SERVER__ = 'http://easynmt.net/models'


Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setup(
name="EasyNMT",
version="1.0.0",
version="1.0.1",
author="Nils Reimers",
author_email="[email protected]",
description="Easy to use state-of-the-art Neural Machine Translation",
Expand Down

0 comments on commit 8b0d2eb

Please sign in to comment.