pymlex/ipa-transcriptor-300M
0365
IPA Transcriptor 300M
Fine-tuned `google/byt5-small` for English word to IPA transcription.
Task format:
ipa: analytical -> ˌænəˈlɪtɪkəlTraining data: English phonetic and syllable count dictionary, 125,925 word–IPA pairs after cleaning.
GitHub: pymlex/ipa-transcriptor-300M
Benchmark
Fine-tuned on NVIDIA L4, run colab_l4_bf16, beam search num_beams=4.
Dataset length distributions
Training loss
Inference
from transformers import AutoModelForSeq2SeqLM, AutoTokenizer
import torch
model_id = "pymlex/ipa-transcriptor-300M"
source_prefix = "ipa: "
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForSeq2SeqLM.from_pretrained(model_id)
model.eval()
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
model.to(device)
def transcribe(word: str, num_beams: int = 4) -> str:
source = f"{source_prefix}{word.strip().lower()}"
encoded = tokenizer(source, return_tensors="pt", truncation=True, max_length=36).to(device)
output_ids = model.generate(**encoded, max_new_tokens=56, num_beams=num_beams, early_stopping=True)
return tokenizer.decode(output_ids[0], skip_special_tokens=True)
print(transcribe("analytical"))