Reza2kn/negara-g2p-clean-v7.1

🤗 Hugging Face 来源otherapache-2.08M 参数32 MBsafetensors✓ 1 个校验和今天更新
一条命令提交

在你的模型文件夹旁边运行它。它会制作种子、将文件与 Hugging Face 比对,然后提交。你只需开始做种,并粘贴你账户中的密钥。它只读取你的文件,绝不修改。如果愿意,可以先阅读脚本。

curl -fsSL https://pirateface.co/package.sh | bash -s -- --repo Reza2kn/negara-g2p-clean-v7.1 ./model-folder
需要做种者 →

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

License

This model is licensed under the Apache License, Version 2.0. See LICENSE.