Hello MMT team,
It seems that there is a change in the REST API.
So, in the old SMT, I used to use this and it worked perfectly fine:
http://192.168.1.166:8045/translate?q=world&context=computer%22%20
Now, if I use the same URL with the new neural version, I get the following error:
{
status: 400,
error: {
type: "ParameterParsingException",
message: "Missing parameter source"
}
}
If I add the source parameter 'source=en", I get the same error but for target this time.
{
status: 400,
error: {
type: "ParameterParsingException",
message: "Missing parameter target"
}
}
Is there a reason for this change? I am asking because I was using Okapi framework with the SMT version of MMT and it was working just fine, now it no longer works due to this change. Here is the error I am getting from Okapi.
`ERROR: Error querying the server.
Error: response code 400
Bad Request
Error count: 1, Warning count: 0
Process duration: 0h 0m 0s 158ms
=== End process`
Please let me know what you think. For your information, I reported this to Okapi team.
Thanks,
Mohamed
Hello @mzeidhassan,
In recent release 2.0 we have changed our API due to the introduction of multilingual engines.
Since now an engine can handle more than one language pair, it is necessary to specify the language direction you want to use in your translation.
Apparently the connector developed by Okapi to interact with MMT has not been updated yet, and this raises the problem you have encountered.
Thank you for reporting this to the Okapi team: that was actually the best thing to do, so they'll update their connector as soon as possible.
Thanks for reporting this to us too, this is good to know!
Best,
Andrea
Hi @mzeidhassan !
I think we can make somehow the API back-compatible: if the engine has only one language direction, it would be possible to omit the source&target languages.
We're working on it, I'll let you know as soon as it will be ready!
This would be great, @davidecaroselli ! Yes, please let me know when it's done so I can update my instance. Thanks a million!
@AndRossi Thanks for the info about multilingual engines. I was not aware of this. I will read the wiki page.
Hello again @mzeidhassan,
We have restored the API back-compatibility: you can find the update in our master branch.
Please let us know everything works well now :)
Thanks for your support!
Andrea
Hi @mzeidhassan
we have just release MMT v2.0.2 with the API backward compatibility. Please try it and let us know if everything worked as expected!
I'm closing this issue for now but, as always, if you have any other question or problem please don't hesitate to re-open it!
Cheers,
Davide
It works just fine now! Thanks @davidecaroselli !