-
Notifications
You must be signed in to change notification settings - Fork 176
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
automatically detect language of text being processed #99
Comments
Yeah, that would be a nice idea although you pointed out correctly that language switching is going to be challenging. We could try to train a model that would detect the language of each input token but I am not sure how well it would work in practice. A bit related: there is a different "API" in the Gradio demo where you can specify the language inside the text string with html-like tags. Have you seen it? |
I have another idea then...What about changing the default to "auto" so a user doesn't have to (but can) specify a language? For example, within
Could we set the default as We'd still leave in place the functionality of a user being able to specify the language, however, auto-detect would be the default. For example, this would enable users to choose auto-detect for sentences that are only one language and |
Yeah, that sounds nice. I’d like to move away from the |
Sounds good. It would require modifying the source code somewhat and I might be able to take that on, but I haven't had the time to analyze the code base further. If you're willing, can you explain briefly how the language parameter operates? I see the language script, but can you explain perhaps, for example...
I only ask because this is a hobby of mine and I'm not a programmer by trade...and if I had a summary of the flow of the program it'd save me a lot of time. For example, my basic understand so far is that (using
As an amateur this took me hours to understand, so any help would be much appreciated since I'd like to contribute more efficiently! |
@jpc Just to give you an idea, I didn't know what the word "python" even meant until approximately 9 months ago. ;-) |
Instead of having to pass the language identifiers (e.g. de or pl) perhaps autodetect language in a multilingual text string. Possible libraries like
langdetect
might be used:Example:
The challenge would be to implement the language detection in a single text string since
langdetect
is geared towards detecting the "predominant" language in a single string of text...But assuming we could parse it intelligently (or there's another better library), it would remove the need to pass the language identifiers to the methods in the WhisperSpeech library...The text was updated successfully, but these errors were encountered: