TartuNLP / translation-api

A REST API for neural machine translation
https://translate.ut.ee
MIT License
9 stars 2 forks source link

V2.2.0 #1

Closed AlexDjSun closed 1 month ago

AlexDjSun commented 1 year ago

Frontend is sending all data as strings, so POST /v2/correction accepts three keys - request which contains the original translation request data; response - the original translation text; correction - the user-corrected translation. A path to the file where all user-corrections are stored should be defined in config/confg.yaml in the parameter corrections_data_storage_path.

Example of saved data:

date: 27/02/2023 15:21:40

request: {"text":"Maailma","tgt":"eng","src":"est"}

originalTranslation: the World

correctedTranslation: of the World
---

date: 27/02/2023 15:25:40

request: {"text":"Aitäh!","tgt":"eng","src":"est"}

originalTranslation: Thank you!

correctedTranslation: Thanks!
---
liisaratsep commented 1 year ago

Let's release it as a beta version for now, keep this pull request open and iron out some details before merging. Some comments:

Question: Is the frontend really limited to sending previous request data as strings? If this is really the case, then we should have it be either a string or json as the json would be used in some other integrations in the future, but it would make a lot more sense not to use strings at all if we can and use types Request and Response in their schemas instead of str.

liisaratsep commented 1 month ago

This functionality has been moved to a separate component and will not be merged