Skip to main content

Anuvaad

State of the art open-source translation models for Indic languages.

Installation

# CPU pytorch will be installed if torch is not installed
pip install --upgrade anuvaad

Usage

As a Python module

from anuvaad import Anuvaad
anu = Anuvaad("english-telugu")

# Single sentence translation
# beam_size is optional and defaults to 4
anu.anuvaad("YS Jagan is the chief minister of Andhra Pradesh.")
# "వైఎస్ జగన్ ఆంధ్రప్రదేశ్ ముఖ్యమంత్రి."

# Batch translation
anu.anuvaad(["YS Jagan is the chief minister of Andhra Pradesh.",
            "Nara Lokesh suffered a humiliating defeat in Mangalagiri."])
# ['వైఎస్ జగన్ ఆంధ్రప్రదేశ్ ముఖ్యమంత్రి.', 'మంగళగిరిలో నారా లోకేష్కు అవమానకరమైన ఓటమి ఎదురైంది.']

As a service

# Starting the api service
docker run -it -e BATCH_SIZE=1 -p 8080:8080 notaitech/anuvaad:english-telugu

# Running a prediction
curl -d '{"data": ["YS Jagan is the chief minister of Andhra Pradesh."]}' -H "Content-Type: application/json" -X POST http://localhost:8080/sync
Available Models Anuvaad BLEU Google BLEU
english-telugu 12.721173743764009 6.841437460383768
english-tamil 12.737036149214694 5.558450942590664
english-malayalam 17.785746646721996 19.569069412553812
english-kannada 7.888886041933815 3.2803251953567893
english-marathi 23.02755955392518 12.888112016722792
english-hindi 29.175892213216954 18.130893478614375
english-bengali
english-punjabi
english-gujarati

My thoughts on the evaluation/accuracy of the model(s):

  1. Unlike classification/ sequence labelling tasks, for open-domain translation or summarization systems it is very hard to quantify the accuracy through numbers.
  2. This is because, most accuracy measurements actually measure the overlap of character/word n-grams between the expected output and predicted output.
  3. These scores definitely help when evaluating/comparing multiple models on a particular dataset, but the number don't translate well for open-domain models.
  4. For example, Anuvaad translates the sentence An advance is placed with the Medical Superintendents of such hospitals who then provide assistance on a case to case basis. (taken from http://data.statmt.org/pmindia/v1/parallel corpus) to ऐसे अस्पतालों के चिकित्सा अधीक्षकों के साथ एडवांस रखा जाता है, जिसके बाद मामले के आधार पर सहायता प्रदान की जाती है। where as the expected translation of the sentence from the dataset is अग्रिम धन राशि इन अस्पतालों को चिकित्सा निरीक्षकों को दी जाएगी, जो हर मामले को देखते हुए सहायता प्रदान करेंगे।.
  5. In the above example, Although Anuvaad's translation is correct (in the sense that translation conveys the same thing as the original sentence), the BLEU score with n=3 will be 0.
  6. Similarly, a model trained on the pmindia dataset will have bad score on a different dataset which uses a different style of writing, even if the translation is semantically correct.
  7. Our aim in building Anuvaad is to build a general purpose, open-domain translation module that can flexibly translate text from various domains.
  8. https://docs.google.com/spreadsheets/d/1_TTtBEvVgemQfGbRBSZYkECMMt5r7L9-dt0FGVUbmOY/edit?usp=sharing is a sheet comparing translations from Anuvaad, ilmulti (https://github.com/jerinphilip/ilmulti) and Google Translate (=GOOGLETRANSLATE(text, "en", "language") function on google sheets) on 100 randomly selected English sentences from Tatoeba.

Metadata

Release files for anuvaad 1.0.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for anuvaad 1.0.6
File Size Uploaded Provenance Actions
anuvaad-1.0.6.tar.gz 6.6 kB Without provenance Details for anuvaad-1.0.6.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for anuvaad 1.0.6
File Interpreter ABI Platform Actions
anuvaad-1.0.6-py2.py3-none-any.whl Python 3, Python 2 none any Details for anuvaad-1.0.6-py2.py3-none-any.whl

Total release size: 24.3 kB

Release files / anuvaad-1.0.6.tar.gz

Download URL anuvaad-1.0.6.tar.gz
Size 6.6 kB
Tags Source
SHA-256 checksum
How to use checksums
6e647ba7aa29f0d501777c2951f1cb6746f3a182a935108f225f8f717b28676b
BLAKE2b-256 checksum
How to use checksums
3f1cc445f65fabec1f31e5d1b46cb7c562d5d2423eb6aadfaffaa5b78bc403d8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/50.3.1.post20201107 requests-toolbelt/0.9.1 tqdm/4.49.0 CPython/3.8.5

Release files / anuvaad-1.0.6-py2.py3-none-any.whl

Download URL anuvaad-1.0.6-py2.py3-none-any.whl
Size 17.6 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
56f4d6efd9ef890dba65fec0a547ac7195e957d74366f23daf140484b9c8438b
BLAKE2b-256 checksum
How to use checksums
c5b9ac235b904de10b2e10d2ae6d2a7de62b57e765e05cc84b6671d39c4d3111
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/50.3.1.post20201107 requests-toolbelt/0.9.1 tqdm/4.49.0 CPython/3.8.5

Security for anuvaad 1.0.6

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page