Hi David,
I am wondering if there is a way to train more tmx or bilingual files and add them to an already trained engine? How can this be achieved?
Thanks,
Mohamed
The current example refers explain how to add a single sentence pairs.
I would suggest to add more details and an example to clarify how to add an entire file in TMX format.
On 23 Mar 2017, at 10:20, Leon notifications@github.com wrote:
https://github.com/ModernMT/MMT/wiki/API-Add-to-Domain
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.
Hi @memoday,
Yes, you can execute the ./mmt import command to upload a TMX to your model under a certain domain. The command syntax is:
./mmt import -d
(where as usual engine name and api port have default values "default" and 8045 respectively)
However it is also possible to upload a TMX file through the REST APIs, too, e.g. using curl and sending the TMX with form encoding.
@nicolabertoldi
I think you are right, that wiki page can be expanded with a TMX upload example.
I'll take care of that :)
Thank you, AndRossi, can you please also provide the right syntax for doing this with the API?
Hi @letconex, sure. Here is the syntax:
curl -X PUT -H "Content-Type: multipart/form-data"
-F "content=@
-F "content_type=tmx"
http://localhost:8045/domains/
| python -mjson.tool
Please note that this command uploads the tmx to an already existing domain.
If you want to upload it on a new domain, first create the new domain with command:
curl -X POST http://localhost:8045/domains -d "name=
Then check which ID was assigned to the new domain, and finally use it in the curl -X PUT command above.
@nicolabertoldi
I have just updated the wiki page with an example of TMX file upload.
I think it is clearer now.