Skip to content
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

Mandatory source and target parameters in the REST API throw errors #298

Closed
mzeidhassan opened this issue Nov 13, 2017 · 6 comments
Closed
Assignees

Comments

@mzeidhassan
Copy link

mzeidhassan commented Nov 13, 2017

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

@AndRossi
Copy link
Contributor

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

@davidecaroselli
Copy link
Member

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!

@mzeidhassan
Copy link
Author

mzeidhassan commented Nov 13, 2017

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.

@AndRossi
Copy link
Contributor

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

@davidecaroselli
Copy link
Member

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

@mzeidhassan
Copy link
Author

It works just fine now! Thanks @davidecaroselli !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants