Skip to main content

The purpose of this module is user-friendly translation and transliteration of Classical Tibetan.

Project description

mlotsawa

Description

The purpose of this module is user-friendly translation and transliteration of Classical Tibetan.

Currently, separate classes are provided for translation and transliteration tasks. Both classes will accept either a list of strings, or a single string. The output of each will be of the same type as the input.

You can also run the translator and transliteration functions through a web-based user interface. The web interface will open automatically when you use the code below. You can use this to serve the app to others on your network, as well.

Under the hood, this module uses the T5 transformer architecture, custom fine-tuned on data from Lotsawa House.

The models and datasets used by this project can be found on Hugging Face where you can find more information on training, data collection, and how to use these models and datasets for your own projects.

This module is part of the larger MLotsawa project for machine translation of Literary Tibetan. The code for the entire project, including this module is available on GitHub here.

Installation

pip install --upgrade mlotsawa

Examples

For transliteration:

from mlotsawa.transliterator import Transliterator 

tibetan_text = '<your Tibetan text>'

transliterator = Transliterator()

phonetics = transliterator.transliterate(tibetan_text)

For translation:

from mlotsawa.translator import Translator 

tibetan_text = '<your Tibetan text>' # may be in Tibetan script or phoneticized

translator = Translator()

translation = translator.translate(tibetan_text)

To serve the Web based user-interface:

from mlotsawa.webui import WebUI

webui = WebUI()

webui.run()

The WebUI.run() method has several optional parameters. These parameters and their default values are shown below.

from mlotsawa.webui import WebUI

webui = WebUI()

webui.run(
    logging=False, # keep log of when translations are done through your host
    log_filepath='mlotsawa_logs.txt', # filepath and filename to be used for the log file (i.e. '/my_log_folder/my_logs.txt)
    port=5000, # which port to run the webui from
    autolaunch=True # automatically start the webapp in your default browser
)

License

Shield: CC BY-NC-SA 4.0

This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.

CC BY-NC-SA 4.0

Owner

@billingsmoore

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mlotsawa-0.4.3.tar.gz (9.6 kB view details)

Uploaded Source

Built Distribution

mlotsawa-0.4.3-py3-none-any.whl (10.2 kB view details)

Uploaded Python 3

File details

Details for the file mlotsawa-0.4.3.tar.gz.

File metadata

  • Download URL: mlotsawa-0.4.3.tar.gz
  • Upload date:
  • Size: 9.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.3

File hashes

Hashes for mlotsawa-0.4.3.tar.gz
Algorithm Hash digest
SHA256 ec84f81a71e04645f156fcbbaf17cd7224972206a566b3bf11c36e2d25d4f2fe
MD5 039b08f6ce0929db25031a175550e3cd
BLAKE2b-256 58c9b85f0e222a844e156c214933b81eeaf8871bb5c8c1d421faab8023100e11

See more details on using hashes here.

File details

Details for the file mlotsawa-0.4.3-py3-none-any.whl.

File metadata

  • Download URL: mlotsawa-0.4.3-py3-none-any.whl
  • Upload date:
  • Size: 10.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.3

File hashes

Hashes for mlotsawa-0.4.3-py3-none-any.whl
Algorithm Hash digest
SHA256 080ffc163076dc1d9b60e0056b66f62a7d0befadef9a5ae554450f7e5bfc0528
MD5 a3ed4ddcffc07901ad97b2dbe9afc06b
BLAKE2b-256 087ff22fdc445151248cdddc2ae5696e8373b7cc4479dc1adef76427dbe0f83d

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page