IronTranslator is a simple tool to translate words or paragraphs with lengths less than 5000 words. IronTranslator may help you to do multiple tasks in nlp machine learning projects (in ordre to use GloVe or FastText).
Compatible with Python 3.6+.
1 - Installation
You can install it from PyPI.
$ pip install IronTranslator
2 - How to use IronTranslator ?
First you have to download the latest version of ChromeDriver. Save the download file in the directory of your choice.
On Windows
>>> YourChromeDriverPath = r"C:\Users\chromedriver"
On Mac
>>> YourChromeDriverPath = "/Users/chromedriver"
Single sentence translation
>>> from IronTranslator import Translator
>>> translator = Translator(ChromeDriverPath = YourChromeDriverPath)
>>> translator.translate(texts=["bonjour"], dest='ko')
100%|██████████████████████████████████████████████████| 1/1 [00:05<00:00, 0.70/it]
['안녕하세요']
Multiple sentence translation
>>> from IronTranslator import Translator
>>> translator = Translator(ChromeDriverPath = YourChromeDriverPath)
>>> translator.translate(texts=["I Love Python.","The gravity on the moon's surface is 1.622 m / s2","What is the speed of light in a vacuum?"], dest='de')
100%|██████████████████████████████████████████████████| 3/3 [00:05<00:00, 3.59s/it]
['Ich liebe Python.','Die Schwerkraft auf der Oberfläche des Mondes beträgt 1,622 m / s2',
'Was ist die Lichtgeschwindigkeit im Vakuum?']
We can specify the source language
>>> from IronTranslator import Translator
>>> translator = Translator(ChromeDriverPath = YourChromeDriverPath)
>>> translator.translate(texts=["I Love Real Madrid.","The gravity on the moon's surface is 1.622 m / s2",
"What is the speed of light in a vacuum?"], dest='es',src='en')
100%|██████████████████████████████████████████████████| 3/3 [00:05<00:00, 1.69s/it]
['Amo al Real Madrid.','La gravedad en la superficie de la luna es de 1.622 m / s2.','¿Cuál es la velocidad de la luz en un vacío?']
Available Languages :
>>> {'afrikaans': 'af',
'albanian': 'sq',
'amharic': 'am',
'arabic': 'ar',
'armenian': 'hy',
'azerbaijani': 'az',
'basque': 'eu',
'belarusian': 'be',
'bengali': 'bn',
'bosnian': 'bs',
'bulgarian': 'bg',
'catalan': 'ca',
'cebuano': 'ceb',
'chichewa': 'ny',
'chinese (simplified)': 'zh-cn',
'chinese (traditional)': 'zh-tw',
'corsican': 'co',
'croatian': 'hr',
'czech': 'cs',
'danish': 'da',
'dutch': 'nl',
'english': 'en',
'esperanto': 'eo',
'estonian': 'et',
'filipino': 'tl',
'finnish': 'fi',
'french': 'fr',
'frisian': 'fy',
'galician': 'gl',
'georgian': 'ka',
'german': 'de',
'greek': 'el',
'gujarati': 'gu',
'haitian creole': 'ht',
'hausa': 'ha',
'hawaiian': 'haw',
'hebrew': 'he',
'hindi': 'hi',
'hmong': 'hmn',
'hungarian': 'hu',
'icelandic': 'is',
'igbo': 'ig',
'indonesian': 'id',
'irish': 'ga',
'italian': 'it',
'japanese': 'ja',
'javanese': 'jw',
'kannada': 'kn',
'kazakh': 'kk',
'khmer': 'km',
'korean': 'ko',
'kurdish (kurmanji)': 'ku',
'kyrgyz': 'ky',
'lao': 'lo',
'latin': 'la',
'latvian': 'lv',
'lithuanian': 'lt',
'luxembourgish': 'lb',
'macedonian': 'mk',
'malagasy': 'mg',
'malay': 'ms',
'malayalam': 'ml',
'maltese': 'mt',
'maori': 'mi',
'marathi': 'mr',
'mongolian': 'mn',
'myanmar (burmese)': 'my',
'nepali': 'ne',
'norwegian': 'no',
'odia': 'or',
'pashto': 'ps',
'persian': 'fa',
'polish': 'pl',
'portuguese': 'pt',
'punjabi': 'pa',
'romanian': 'ro',
'russian': 'ru',
'samoan': 'sm',
'scots gaelic': 'gd',
'serbian': 'sr',
'sesotho': 'st',
'shona': 'sn',
'sindhi': 'sd',
'sinhala': 'si',
'slovak': 'sk',
'slovenian': 'sl',
'somali': 'so',
'spanish': 'es',
'sundanese': 'su',
'swahili': 'sw',
'swedish': 'sv',
'tajik': 'tg',
'tamil': 'ta',
'telugu': 'te',
'thai': 'th',
'turkish': 'tr',
'ukrainian': 'uk',
'urdu': 'ur',
'uyghur': 'ug',
'uzbek': 'uz',
'vietnamese': 'vi',
'welsh': 'cy',
'xhosa': 'xh',
'yiddish': 'yi',
'yoruba': 'yo',
'zulu': 'zu'}
Release files for IronTranslator 1.0.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| IronTranslator-1.0.5.tar.gz | 6.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| IronTranslator-1.0.5-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 13.9 kB
Release files / IronTranslator-1.0.5.tar.gz
| Download URL | IronTranslator-1.0.5.tar.gz |
|---|---|
| Size | 6.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e1a54789e499200165529731eba2d21cdca2b515f2764e8546aa0228d5785be4
|
|
BLAKE2b-256 checksum How to use checksums |
bded8807cce465a3f103253e8d4ce9bc38bbf8e2685f0841b98d89e5bb7a12ab
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.1 importlib_metadata/3.10.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.2
|
Release files / IronTranslator-1.0.5-py3-none-any.whl
| Download URL | IronTranslator-1.0.5-py3-none-any.whl |
|---|---|
| Size | 7.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
92ae3084ce647cd60ae3f8bbb3681dae2323bf7256eb0d7e19231f946b5f8df2
|
|
BLAKE2b-256 checksum How to use checksums |
0ec2d2d95ee2e6fb649d2e103641bddfff2efa912f506604e13fa6fa057fa9ab
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.1 importlib_metadata/3.10.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.2
|