OpenAI ChatGPT Subtitles Translation
I’m sure you have heard, and most probably also used, OpenAI Chat-GPT by now. And in case you don’t know what it is, why don’t you ask it yourself. Yes, it can answer this and many other questions with tremendous detail and creativity. Here is its response, when I asked this chatbot “What is Chat-GPT?”:
Chat-GPT (Generative Pre-trained Transformer) is a type of natural language processing (NLP) model developed by OpenAI, based on the GPT architecture. It is a large language model trained on a vast amount of data to generate human-like responses to natural language inputs. Chat-GPT can perform a variety of NLP tasks such as language translation, text summarization, question-answering, and conversational agent…
And while all its language-processing capabilities are amazing (sometimes unbelievable), here we are mostly interested in its “translation” function and how we can use it to translate subtitles. As many of you know, I have been developing Online Subtitle Translator for a few years now, and it supports various machine translation engines and APIs like Google, Azure, DeepL, etc. All of these are machine translations, which while doing a great job – if you keep in mind these are not being done by humans – machine translation is still far away from being perfect. But the gap is shrinking quite fast, and Large Language Models based AI models are probably the future way to handle machine translations. Chat-GPT by OpenAI is one of these LLM models and is the main host of today’s blog host.
Being a user of various translation APIs, I have been keeping an eye on GPT translation capabilities for a few months now and I must say I’m super impressed with some initial results. The GPT translation is coming on par and sometimes exceeding when compared with some long-term translation veterans like Google or DeepL (as discussed here and here) – which are specifically designed to do only a single task i.e. language translation. What’s even more interesting is these models were never targeted to perform content translation, rather this comes as a side-effect of their powerful natural language processing capabilities – more like human brains do these translations?
I have been playing with the language translation capabilities of Chat GPT for subtitles, and I found that it often generates far superior translations than Google and Azure translators for English <-> Urdu translation pair. I can’t personally say how it competes with DeepL because currently DeepL doesn’t my native language for translation, so I will let my readers answer this for myself.
The integration of the Chat-GTP in Online Subtitle Translator is not that different to other paid translators like Microsoft Azure or Google as shown below:
After you select the Translator and Target Language for your subtitles, the user interface shows the following parameters:
From Language: This one is optional, as in most cases GPT can detect the correct source language from given content. However, providing the correct language may improve the overall translation quality.
OpenAI Model: The choice of the OpenAI language model affects the overall translation quality and cost. You can read more about it here. For now, only a single model is supported, but support for other language models will be added soon.
Translation Type: The Free mode is for demo or evaluation and is limited to 30 lines only. This one is a good choice if you want to just get an idea of the overall translation quality and experience of this new translator before paying for it.
As you may notice, the OpenAI translator is substantially cheaper (sometimes 5-10 times) when compared to other paid translators. But then it’s also painfully slow. More on this is below.
Why it is so slow?
So you tried Chat-GPT and liked the translation quality, but I’m sure you will notice that it’s extremely slow. Like even for a 20-30 lines translation, it sometimes takes 30-40 seconds. And it takes ages for some reasonably large subtitle files for videos and movies. The reason it’s so slow is mainly due to the following two factors:
- The first and most important one is the overall infrastructure overload. OpenAI Chat-GPT users went from thousands to millions in a very short period. They are working hard, but it may take some time to adjust their infrastructure to handle all this demand.
- The second is how these LLM models work on paragraph completion tasks (in our case translation) in general. These algorithms mostly work on given content word-by-word (or token-by-token to be exact). Making it hard to parallelize the completion of tasks.
But the good thing is that research and work are being done on both hardware and algorithm parts, and I’m sure things will improve substantially in the near future.
What’s Next?
Integrating the first LLM-based translator for subtitle translation was an interesting and challenging task. Unlike, other translation APIs, here instead of passing the correct source and target language parameters, I had to build a translation task prompt/command to achieve the correct translation. I also have to split and join the subtitle lines to minimise tokens and keep context between lines for improved quality. There is probably still room for improvement here, so will keep reviewing and improving these parts.
Another interesting point of discussion is whether should I expose various AI model tuning parameters to users or not. Like, should I expose model turning parameters (e.g. to control creativity vs predictability) to the translation user interface? Open to suggestions here.
Also, there are a few more interesting LLM models than OpenAI Chat-GPT (from Google and Facebook to name a few). Probably time to explore a few of those too? If you have any suggestions or requests, please feel free to let me know as well.
Tags: AI, Chat-GPT, ChatGPT, GPT, subtitles translator
This entry was posted
on Tuesday, April 18th, 2023 at 12:26 pm and is filed under Uncategorized.
You can follow any responses to this entry through the RSS 2.0 feed.
You can leave a response, or trackback from your own site.
Bro Pls Adjustment chat GPT payment Method or Add Rupay Card Option ( Indian Card )
Thanks for the suggestion. Unfortunately, integrating a new payment method is not simple enough and requires many law and regulation considerations. That said there is enough demand for this card, so hopefully Stripe will support it soon, but until then I guess Debit/Credit cards are your only options. Sorry for not being of much help here.
Regards, Akbar
Any chance we can use our own chatgpt subscription? Also it would be nice if we can have access to software so it can batch translate ton of subtitles while it keeps the folder structure correct.
Thanks for the suggestion. There is a plan for using your own GPT keys, but it’s currently limited by Website hosting plan as it would require significantly more powerful server to handle all those batch request.
BTW, there are also some tools which offers exactly what you want i.e. batch translation using ChatGPT using your own keys, but require some setup on your end. You can explore these and see if any of those works for you?
Regards,
Akbar
Sorry for late reply, didn’t get a notification. I did search on github most of them either outdated or unfinished. This one looks perfect since it support .ass format. Do you have anything that you know can do what I’m looking for?
I haven’t used any of these tools myself, but doing a quick search on Google, I think “GPT-Subtrans” and “chatgpt-subtitle-translator” looks promising. But I would suggest that you try and evaluate these on your own.
If these doesn’t support .ASS format, you can always convert .SRT to .ASS format. Again, there are many online tools and I’m sure you can also find some offline tools to do that easily.
Hope that helps.
Regards, Akbar
Dear Sir,
I am unable to pay with a credit card and cannot create a new account. and Unable to log in with a Google account as well.
I need assistance, thank you.
PayPal rejects some credit card payments for yet un-known reason. I think it has to do with their policy on which type of cards can be used for a business in particular region. If you have PayPal account, I would suggest first loading balance to your PayPal account and then using that pre-loaded balance for any translations.
Otherwise, you can try the Crypto payments – if you have any crypto currency. More details here:
https://blog.syedgakbar.com/why-sign-in-and-topup-balance/
Regards, Akbar
Great work man. Spent hours trying to figure out the proper inputs for chatGPT. Thanks!
Hi Akbar, I tried to add money to my account on your website in many ways but nothing worked. It seems that paypal rejects everything when its opened by your site. Can you please help me? I’m even happy to bypass the system and send the money directly to you and you can charge my account manually. Or whatever. Thanks is advance! Regards, Attila
Sorry for the trouble in loading balance via PayPal. Few other users have reported difficulties using PayPal with card payments. I’m not really sure what’s going on there, but this is nothing under my control i.e. PayPal server is rejecting these payments even before it reach my website.
I plan to have soon an alternate payment gateway in place, which will hopefully help few uses like you to top-up balance on my website.
Regards, Akbar
Hello Akbar,
thanks for adding ChatGTP, the quality of translations is really good, compared to the other engines.
What is a bit disturbing to me, is that sometimes multiple “time slots” are merged together, leaving some “time slots” empty.
As a result the user has only halt the time to read the translated text, and after this there is an e.g. 7 second time slot where no translation is displayed.
I understand, that is is difficult to split the translated paragraph back into multiple timeslots. Maybe it is possible to place the same percentage of words of an translated paragraph into the timeslots, as they contain in the original language?
Hi Martin,
Thanks for trying GPT translator and sharing your feedback.
I can totally understand your point that how annoying that line merge-up could be. I have been tweaking prompts and various API parameters to get the better results, but since there is some inherit randomness in the GPT translation model, you can’t always force its translation to keep the markers or tags (used to detect start of new subtitle line).
You idea to split the lines back based on proportion of the input content length is good one and something I have already tried in past. But in my experiments, it most of the time leads to even more confusing results. First it’s hard to detect if the line being merged by ChatGPT is before or after the actual time-slot, so it’s quite easy to mix it up wrongly without understanding lines context. Plus, if you merely split based on the content size, you may show some words which doesn’t make sense at that particular time-slot in the subtitle, making the overall translated subtitles more pain to watch.
I think the best solution at the moment is that person translating the subtitle performs a proofread after translation and then split the lines manually. I know it’s not idea, and I plan to make this more seamless process in future, and will also keep thinking of ideas to improve this further. But happy to take any further input and suggestions from community too.
Regards,
Akbar
Hi is it posible to add with ChatGPT Serbian, Croatian and Bosnian.
Thanks, I have added these languages to the list of supported languages.
Regards, Akbar
Try to translate an episode with ChatGPT. Stop translating after 26%, 15%. Never translated the whole episode.
Sorry for the trouble Ronald! I think this issue is now resolved. Please do let me know if still run into this or any other issues.
Regards, Akbar