Skip to content
This repository has been archived by the owner on Jun 24, 2021. It is now read-only.
/ DeepTranslit Public archive

Efficient and easy to use transliteration for Indian languages

License

Notifications You must be signed in to change notification settings

notAI-tech/DeepTranslit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DeepTranslit: Towards better transliteration for Indic languages.

telugu, kannada, tamil, malayalam, marathi, hindi are the current supported languages.

Usage

Via docker

# Start the container in background
docker run -d -p 8080:8080 notaitech/deeptranslit:hindi
# Query from python
import requests
requests.post('http://localhost:8080/sync', json={"data": ['mera naam amitab.']}).json()

As python module

pip install --upgrade deeptranslit
from deeptranslit import DeepTranslit

# hindi
transliterator = DeepTranslit('hindi')
# Single sentence prediction
transliterator.transliterate('mera naam amitab.')
# [{'pred': 'मेरा नाम अमिताब.', 'prob': 0.25336900797483103}]

# Multiple sentence prediction
transliterator.transliterate(['mera naam amitab.', 'amitab-aur-abhishek'])
#[[{'pred': 'मेरा नाम अमिताब.', 'prob': 0.25336900797483103}],
# [{'pred': 'अमिताब-और-अभिषेक', 'prob': 0.1027598988040056}]]

Notes:

  • Tokens (characters) not present in input space (english alphabet) are copied over to output.
    • eg: (amitab. -> अमिताब., amitab-aur-abhishek -> अमिताब-और-अभिषेक)
  • Predictions are cached at word level. i.e: computationally, transliterate('amitab amitab') is equivalent to transliterate('amitab') or transliterate('amitab amitab amitab')