CoolFace
Modelpublic

pymlex/ipa-transcriptor-300M

sourceHugging Facegpl-3.0updated 16d agoView on Hugging Face
0likes365downloads
Model Card

IPA Transcriptor 300M

Fine-tuned `google/byt5-small` for English word to IPA transcription.

Task format:

text
ipa: analytical  ->  ˌænəˈlɪtɪkəl

Training 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.

MetricValidationTest
n_samples62966297
loss0.15150.1478
perplexity1.16361.1592
token_accuracy0.78490.7858
exact_match0.59820.6111
char_accuracy0.89480.8969
cer0.10660.1045
bleu59.8261.11

Dataset length distributions

[image]

[image]

Training loss

[image]

[image]

Inference

python
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"))