-
-
Notifications
You must be signed in to change notification settings - Fork 959
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
OpenAI GPT-4 MT #9009
Comments
I'd be interested in exploring this too, @AsmoKoskinen I already created a little Python script to help me check out the possibilities. Maybe an AddOn would work, with a simple UI. Where you can specify for each component or project what role / persona / target audience you would want GPT to assume and which terminology to respect. (Inject terms from the Glossary component!) Maybe we can build a team and spec out the desired features,the UI and work on the implementation. |
@ilocit Well, I am no developer at all, just using (quite heavy) Weblate (private docker site). Weblate 4.16 added support for IBM Watson Language Translator. Just like to see GPT-4 for Weblate, too. |
This issue seems to be a good fit for newbie contributors. You are welcome to contribute to Weblate! Don't hesitate to ask any questions you would have while implementing this. You can learn about how to get started in our contributors documentation. |
Adding support for another MT is simple, see how it was done for IBM Watson: #8594 |
Thanks for pointing to the IBM Watson implementation as reference, @nijel . If there is anybody interested in making this happen, I'd be happy to participate. |
More options can be added later, the form can be customized, and the MT can be installed per project, so that each project can have different settings. |
You are right, of course. I will see what I can do. |
Well, after reading about IBM Watson MT, reading about OpenAI API and chatting with GPT-3.5/4 I managed figure out something that works on Weblate 4.16.4 (Mac OS). URL: https://api.openai.com/v1/completions URL: https://api.openai.com/v1/models/text-davinci-003 Hopefully someone will pick this up and do it the right way. I touched models.py, test.py and openai.py. models.py [...] tests.py [...] openai.py as a attachment. |
Here is a working try with model "gpt-4", openai.py as a attachment. |
(I try PR for this issue.) Well, too much for me. I'll leave it here. |
I encountered this error (machinery failed: not supported language pair: en - fi). This seems to fix it:
Now it works again. But I can't do a proper PR the right way. However, here are the four files that I have changed. |
More complex persona will be needed to make this work reliably. Otherwise, it ends up including remarks about some strings not fully translatable between languages, transliteration and other content. So far, I ended up with:
|
The real advantage of GPT over other nMT engines is the customization via e.g. personas and instructions. Like this perhaps (this is how CustomMT has built it!): Definitely (1) and (2), the option to inject a project glossary would be super cool, of course! (3) The caption for this section, to make it clear what happens here, could be called Prompt Engineering... |
Is this something that is still being worked on? We're hoping to introduce this to our flow for rapid deployments, with human validation following it |
For that (rapid deployments), you don't necessarily need GPT, no? You can use any suitable nMT and human validation. |
It's true that we could technically get by with nMT, however we think that with being able to supply context to GPT on small strings (a common case in our game) we'd end up with a higher quality initial set of translations |
As a quick and dirty solution, you can try what has been posted in #9009 (comment). For full integration, I'd like to have this included in the 5.0 release in August, but the feature has not yet been fixed on the roadmap. |
And that is precisely the challenge and why the above-mentioned "quick and dirty" integration won't bring you much benefit. In a game you might want to include the character to add specific tone and slang of that particular character of the game. Lots of options. ;-) |
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
May I ask if there has been any progress on this issue? |
AFAIK, nobody is working on this issue. I'm still stuck in the API waitlist… |
Locally in our organisations fork, we have integrated the 3.5-Turbo API call though the results are relatively poor initially as we haven't spent enough time toying with the setup 'System' string given to the AI. Thankfully the model is the only difference in the API usage, so work could begin while we also sit stuck on the waitlist. In our current usage, we are using the "Explanation" field of the source string as a Context input but I expect we'll be iterating on this for a long time before we get satisfactory results. |
Based on the work here #9009 (comment) I have fixed and adapted the integration for my needs:
(Installation hint for noobs like me: Copy |
What would be interesting is to use embedding to integrate the glossary and/or other similar translations |
OpenAI recently released GTP4-Turbo and the Python library was updated to v1.3.5 with some breaking changes to the API, so I updated the openai.py file for Weblate: |
@tipa Can you please share changes you've done to |
- supports model selection - supports persona customization - prepared for glossary integration TODO: - add documentation - add tests Fixes WeblateOrg#9009
WIP integration is here: #10479 |
- supports model selection - supports persona customization - prepared for glossary integration TODO: - add documentation - add tests Fixes WeblateOrg#9009
- supports model selection - supports persona customization - prepared for glossary integration TODO: - add documentation - add tests Fixes WeblateOrg#9009
- supports model selection - supports persona customization - prepared for glossary integration TODO: - add tests Fixes WeblateOrg#9009
- supports model selection - supports persona customization - prepared for glossary integration TODO: - add tests Fixes WeblateOrg#9009
@nijel I will add my |
- supports model selection - supports persona customization - prepared for glossary integration Fixes WeblateOrg#9009
- supports model selection - supports persona customization - prepared for glossary integration Fixes #9009
Thank you for your report; the issue you have reported has just been fixed.
|
Describe the problem
Many automatic machine translation services are available on Weblate.
Describe the solution you'd like
How about to open a machine translation service for OpenAI GPT-4?
https://openai.com/waitlist/gpt-4-api
Describe alternatives you've considered
No response
Screenshots
No response
Additional context
I have this API in use for GPT-4. GPT-4 translates very well, I use it to translate from English to Finnish.
The text was updated successfully, but these errors were encountered: