Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How can I set ASR language? #15

Open
hforghani opened this issue Dec 6, 2024 · 1 comment
Open

How can I set ASR language? #15

hforghani opened this issue Dec 6, 2024 · 1 comment

Comments

@hforghani
Copy link

hforghani commented Dec 6, 2024

I used the script transcribe.py in the repository to transcribe many voice files in Persian languages. Some of them transcribe correctly in Persian but some of them returns kind of translation to English (although incorrect). For example:

Reference: او هماوردطلبي با انگليس را دوست داشت چون اشرافيت او اين نوع هماوردطلبي را مناسب ميدانست.
Hypothesis: He liked to speak English, because he liked to speak English fluently.

Reference: آدرس وب سايت اختصاصي جشنواره فيلم تروپفست عبارتست از: www.tropfest.com
Hypothesis: The website for the film festival is www dot tropfest dot com.

Reference: بازديد از اين مجموعه ارزشمند همه روزه بجز يكشنبه و پنجشنبه از ساعت 9 صبح تا 3 بعدازظهر براي عموم آزاد است.
Hypothesis: بازدید از ین مجموعه ی عرضشمند همه روزه به جز یک شنبه و پنج شنبه از ساعت 9 صبح تا 3 بعد زهر برای عموم آزاد است

How can I force it to set Persian token?

@guynich
Copy link

guynich commented Dec 22, 2024

If you are using pipeline() try setting a forced language by doing this.

forced_language = (
    "<|en|>"  # Use your appropriate language code, e.g., <|en|>, <|es|>.
)
generate_kwargs = {"language": forced_language}

Then pass generate_kwargs=generate_kwargs into your call to pipeline().

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants