Negara G2P v7.1

Negara v7.1 is the Persian grapheme-to-phoneme frontend used by Gouya. It keeps the complete Negara v7 checkpoint and adds a deliberately small, exact-match repair overlay learned from 470 human-reviewed Gooya-5 votes, with Gemini 3.6 Flash used only as a conservative agreement signal.

The checkpoint at the repository root is directly loadable with AutoModelForSeq2SeqLM.from_pretrained(). The v7.1 behavior is produced by applying overlay.json to aligned (Persian surface word, raw v7 phone word) pairs. If alignment or an exact pair is absent, the original v7 output is preserved.

Quick start

pip install 'transformers==4.57.6' torch
git clone https://huggingface.co/Reza2kn/negara-g2p-clean-v7.1
cd negara-g2p-clean-v7.1
python run_negara_v71.py --text 'سلام الاغ عزیز حالت چطوره؟ خوب و خوش و سلامتی؟ احوالت چطوره؟'

Expected v7_1 output:

salAm olAqe aziz hAlet Cetoreh xub o xoS o salAmati ahvAlet Cetoreh

You can also load the underlying v7 checkpoint normally:

from transformers import AutoModelForSeq2SeqLM, AutoTokenizer

repo = "Reza2kn/negara-g2p-clean-v7.1"
tokenizer = AutoTokenizer.from_pretrained(repo)
model = AutoModelForSeq2SeqLM.from_pretrained(repo)

What changed

  • 29 learned exact-match lexical rules came from human votes only where frozen Gemini 3.6 Flash phones exactly matched the human phones.
  • 6 canonical exact-match rules cover explicitly reviewed pronunciations.
  • No broad spelling rewrite or guessed fallback is used; unmatched words retain v7 output.
  • The user-approved سلامتی -> salAmati pronunciation is preserved.

Evaluation

The bundled evaluation_report.json records a five-fold, record-disjoint out-of-fold check. Each learned rule excludes labels from its held-out record.

Metric v7 baseline v7.1 overlay
Exact phone choices 190 / 291 195 / 291
Exact corrections 0 / 101 7 / 101
False changes to human-kept phones 0 / 190 2 / 190

This is a precision-oriented lexical repair release, not a fully retrained G2P model. Its gains are intentionally narrow, and exact rules will not generalize to every inflection or unseen word.

Files

  • model.safetensors and tokenizer/config files: unchanged Negara v7 checkpoint
  • overlay.json: v7.1 exact-match repair layer and provenance
  • run_negara_v71.py: reference inference implementation
  • evaluation_report.json: frozen out-of-fold evaluation receipt
Downloads last month
-
Safetensors
Model size
8.07M params
Tensor type
F32
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for Reza2kn/negara-g2p-clean-v7.1

Finetuned
(1)
this model