WeblateOrg / weblate

Web based localization tool with tight version control integration.
https://weblate.org/
GNU General Public License v3.0
4.58k stars 1.02k forks source link

GPT MT divergent suggestions #10522

Closed yarons closed 10 months ago

yarons commented 10 months ago

Describe the issue

I just reviewed some GPT generated suggestions and it looks like GPT has no understanding in the projects' glossary as its using different terms than used before.

I already tried

Steps to reproduce the behavior

Generate a GPT based suggestion for an already mostly translated component. If you used some special terminology it won't be used for the suggestions.

Expected behavior

Suggest strings which are more aligned in terms of terminology to the rest of the project.

Screenshots

No response

Exception traceback

No response

How do you run Weblate?

weblate.org service

Weblate versions

No response

Weblate deploy checks

No response

Additional context

I'm thinking about some way of feeding some translations back to the query as a reference point while possibly also adding the description of the app for allowing it to better adjust the terminology based on other related translations or just general approach.

nijel commented 10 months ago

Weblate will be feeding glossaries to GPT since https://github.com/WeblateOrg/weblate/pull/10516, it is just not yet deployed on Hosted Weblate. You can already configure persona and style in the engine configuration:

image

For your case, use something like this for persona: You are translating an application for ...

github-actions[bot] commented 10 months ago

This issue has been marked as a question by a Weblate team member. Why? Because it belongs more to the professional Weblate Care or community Discussions than here. We strive to answer these reasonably fast here, too, but purchasing the support subscription is more responsible and faster for your business. And it makes Weblate stronger as well. Thanks!

In case your question is already answered, making a donation is the right way to say thank you!

yarons commented 10 months ago

This is awesome, so can I create a persona from all my previous translations or do I need to manually type in the rules I follow?

nijel commented 10 months ago

Yes, that should work, but constructing a prompt for GPT is not always straightforward.

You can try it on the ChatGPT web as well, this is how Weblate builds the prompt:

https://github.com/WeblateOrg/weblate/blob/9ddf49f1d614770051042c79dd4940d2226a277e/weblate/machinery/openai.py#L20-L34

yarons commented 10 months ago

I'm not sure if we can add examples as it's too complicated but sometimes it yields the best results. Thanks.

github-actions[bot] commented 10 months ago

This issue has been automatically marked as stale because there wasn’t any recent activity.

It will be closed soon if no further action occurs.

Thank you for your contributions!