Downloads · 30 days
11
14% of all-time downloads
kambale/pearl-23m-translate
pearl-23m-translate is a translation model from kambale. Use it when you need text moved from one language to another. The card lists the license as apache-2.0.
This is the Pearl Model (23M-translate-v2), a Transformer-based neural machine translation (NMT) model trained from scratch. It is designed to translate text from English to Luganda and contains approximately 23,363,2…
Downloads · 30 days
11
14% of all-time downloads
All-time downloads
80
Public
Repo size
94.6 MB
Likes
1
Public
Click a slice to open those files.
.bin94.6 MB · 98%
From the Hugging Face model README
This is the Pearl Model (23M-translate-v2), a Transformer-based neural machine translation (NMT) model trained from scratch. It is designed to translate text from English to Luganda and contains approximately 23,363,200 parameters. This version features an increased maximum sequence length of 512, deeper encoder/decoder (6 layers each), wider feed-forward networks (PF_DIM 1024), an increased tokenizer vocabulary size (16000), and the Transformer's original learning rate schedule.
The Pearl Model is an encoder-decoder Transformer architecture implemented entirely in PyTorch.
Detailed hyperparameters, architectural specifics, and tokenizer configurations can be found in the accompanying config.json file.
This model is intended for:
Out-of-scope:
The model was trained exclusively on the kambale/luganda-english-parallel-corpus dataset available on the Hugging Face Hub.
english_tokenizer_v2.jsonluganda_tokenizer_v2.jsonExample Validation Set Translations (from training run):
(Note: BLEU scores are calculated using SacreBLEU on detokenized text with force=True.)

This model is provided with its PyTorch state dictionary, tokenizer files, and configuration. Manual loading is required.
Seq2SeqTransformer, Encoder, Decoder, etc.) from the training script.from tokenizers import Tokenizer
import json
import torch
# from your_model_script import Seq2SeqTransformer, Encoder, Decoder, PositionalEncoding, ... (ensure these are defined)
# Load config
with open("config.json", 'r') as f:
config = json.load(f)
# Load tokenizers
src_tokenizer = Tokenizer.from_file(config["src_tokenizer_file"])
trg_tokenizer = Tokenizer.from_file(config["trg_tokenizer_file"])
# Model parameters from config
params = config["model_parameters"]
special_tokens = config["special_token_ids"]
DEVICE = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
enc = Encoder(params["input_dim_vocab_size_src"], params["hidden_dim"], params["encoder_layers"],
params["encoder_heads"], params["encoder_pf_dim"], params["encoder_dropout"],
DEVICE, params["max_seq_length"])
dec = Decoder(params["output_dim_vocab_size_trg"], params["hidden_dim"], params["decoder_layers"],
params["decoder_heads"], params["decoder_pf_dim"], params["decoder_dropout"],
DEVICE, params["max_seq_length"])
model = Seq2SeqTransformer(enc, dec, special_tokens["pad_token_id"], special_tokens["pad_token_id"], DEVICE)
model.load_state_dict(torch.load(config["pytorch_model_path"], map_location=DEVICE))
model.to(DEVICE)
model.eval()
translate_sentence function similar to the one in the training notebook.(Content similar to original, adjusted for new context if necessary)
kambale/luganda-english-parallel-corpus will be reflected.This model is provided "as-is" without warranty of any kind, express or implied. It was trained as part of an educational demonstration and may have limitations in accuracy, fluency, and robustness. Users should validate its suitability for their specific applications.