How to add my own Machine Translation interface?
Thread poster: daibola
daibola
daibola
United Kingdom
Sep 4, 2019

Hello!

This question may have come up before, in that case, I would be happy to receive a pointer (URL) to the corresponding explanation; so far, I couldn't find anything, neither in the mail list archive nor in the OmegaT FAQ.

In OmegaT (4.3.0), a number of Machine Translation tools are already integrated, and one just has to add the API key to activate one.

How can I add my own, locally running MT?How can I add my own, locally running MT?

I would like to add something like

http://localhost/my_mt/translator.script?sl=%source_language%&tl=%target_language%&st=%source_text%

The reply of my MT is an UTF-8 JSON object containing the translated text. (Of course, I can change that.)

I hope that I do not have to create a groovy script for that (see https://github.com/yoursdearboy/omegat-browser)

Best regards,

Gunnar Lindenblatt
Collapse


 
Milan Condak
Milan Condak  Identity Verified
Local time: 10:36
English to Czech
Contact developers of OmegaT Sep 4, 2019

daibola wrote:

How can I add my own, locally running MT?



Dear Gunnar,

I have a similar problem. I want to intergrate old and working desktop MT czech "PC Translator" for MS Windows into OmegaT.

Your MT is in Linux?

Connect OmegaT development page:

https://sourceforge.net/projects/omegat/

https://sourceforge.net/projects/omegat/lists/omegat-development

Or ask in OmegaT users group:

http://groups.yahoo.com/group/OmegaT/

http://groups.yahoo.com/group/OmegaT/join

Milan


 
Samuel Murray
Samuel Murray  Identity Verified
Netherlands
Local time: 10:36
Member (2006)
English to Afrikaans
+ ...
@Milan Sep 5, 2019

Milan Condak wrote:
I have a similar problem. I want to intergrate old and working desktop MT czech "PC Translator" for MS Windows into OmegaT.


Does the "PC Translator" also work with a localhost URL and predictable output?


 
Samuel Murray
Samuel Murray  Identity Verified
Netherlands
Local time: 10:36
Member (2006)
English to Afrikaans
+ ...
@Gunnar, not the answer you were hoping for Sep 5, 2019

daibola wrote:
How can I add my own, locally running MT?


Here's a possible method (not tried by me) that may be a possible workaround. In OmegaT, in Options > Preferences > Editor, there is the option "Export the segment to text files". This exports the current source text to a text file[1], ostentatiously so that the user can run some functions on the source text using an external program. You could write a script that listens for when this file is updated, then grab that source text from it, translate it, optionally display it as a tooltip, and add the translation to the clipboard, so that you can insert it using Ctrl+V.

[1] C:\Users\YourName\AppData\Roaming\OmegaT\script\source.txt

[Thinking about your question reminded me that the feature could maybe do with a bit of an upgrade. Wouldn't it be great if OmegaT can also "listen" for the presence of a file containing updated target text, and then automatically insert it into the target field in OmegaT (or display it as fuzzy match number 0, or display it in the machine translation pane for easy insertion)? If such a feature existed, it would mean, however, that there needs to be an external script to translate the text, but at least it would make it easier to get the text into OmegaT.]


 
Milan Condak
Milan Condak  Identity Verified
Local time: 10:36
English to Czech
Demo version of PC Translator 2007 Sep 5, 2019

Samuel Murray wrote:

Does the "PC Translator" also work with a localhost URL and predictable output?


Dear Samuel,

In 1989 we do not know what URL is. I have some my articles in folder /archiv-cz/. I translated some articles for Interlingua Conference with Google Translate. I have to edit MT-ed text.

http://www.condak.cz/archiv-cz/demo/demo.html

You can download demo with EN-CS or DE-CS dictionary. There is also EMPTY dictionary, which work in full version (maybe in demo, too).

PC Translator with installed plugin for MS Word works with Wordfast Classic.

Thank you for your interest,

Milan




[Edited at 2019-09-05 09:13 GMT]


 
Samuel Murray
Samuel Murray  Identity Verified
Netherlands
Local time: 10:36
Member (2006)
English to Afrikaans
+ ...
@Gunnar Sep 5, 2019

daibola wrote:
How can I add my own, locally running MT?


I asked this question on the OmegaT developer list, and I was reminded that DGT-OmegaT may have some useful content about this:
http://185.13.37.79/?q=/node/5
http://185.13.37.79/?q=/node/28
(Remember, DGT-OmegaT is a fork of OmegaT that is very similar to OmegaT but which has some differences as well. As far as I know, the projects created by DGT-OmegaT and OmegaT are fully interchangeable.)

OmegaT also has another feature that may be useful here: if you create a TM and put it in the folder /tm/mt/, and if there is an exact match from that TM, OmegaT will mark the segment in purple to warn you about it. So, what you must do is extract all of the source text, run it all through the MT service, and align the source text and machine translation into a TMX file, and then use that.

I often perform extraction in OmegaT, using Kos' write_table.groovy script, which I modified to output one single table per project instead of separate tables for separate files. It creates an HTML file in the /script-output/ folder. Open it in MS Word (or in a browser). I suppose one could modify it to create a TMX file instead. Then you just have to figure out how to translate the TMX file in your MT system. There are a few TMX related scripts already, but none of them work for me ("unable to resolve class org.omegat.util.TMXReader").


Milan Condak
 
briacp
briacp
Local time: 10:36
English to French
Simple custom Machine Translator Sep 5, 2019

Hello,

I wrote a very simple and barebone OmegaT plugin for a custom MT. The plugin is available on GitHub omegat-plugin-fake-mt 1.0.0, along with a sample Node.js TM server.

Cheers,
Briac


Milan Condak
 
Milan Condak
Milan Condak  Identity Verified
Local time: 10:36
English to Czech
It looks promising Sep 6, 2019

briacp wrote:

Hello,

I wrote a very simple and barebone OmegaT plugin for a custom MT.



Hi Briac,

I downloaded your plugin, put it into subfolder /plugins/ and "Fake MT" is visibible. I think it could be a solution for Gunnar.

Another tip for web MT: https://www.translate2018.eu/#/text

= EU Council Presidency Translator.

Cheers,

Milan


 
Christian Werner-Meier
Christian Werner-Meier  Identity Verified
France
Local time: 10:36
English to German
+ ...
Okapi Tools Sep 6, 2019

I just wanted to point at the possibility to use the Okapi tool suite, and notably rainbow, to take any source file, convert ist to Xliff, which is segmented, generate a tab delimited file from this, have this translated with any tool, and to convert a translated tab delimited file into a tmx for OmegaT.

 
daibola
daibola
United Kingdom
TOPIC STARTER
Merci beaucoup ! Sep 7, 2019

briacp wrote:

I wrote a very simple and barebone OmegaT plugin for a custom MT. (...)


Thank you very, very much!
Merci beaucoup !
Vielen herzlichen Dank!
非常感谢!

That’s exactly what I was looking for. I installed your plug-in, added the URL in the settings dialogue, and now the translations of my local MT will appear in the MT subwindow, and a Ctrl-M will copy that result into the editor subwindow.

Marvellous!

Your plug-in will be used for The SOS Card Project http://www.sos-card.info/ . The local MT, I keep talking about, is a newly designed, (artificial) Neuronal Network based Chinese-German MT based on the corpus of the DeHanCi http://www.dehanci.com/ . After some testing and improvements, I hope it will be made publicly available as well.


 


There is no moderator assigned specifically to this forum.
To report site rules violations or get help, please contact site staff »


How to add my own Machine Translation interface?






Trados Business Manager Lite
Create customer quotes and invoices from within Trados Studio

Trados Business Manager Lite helps to simplify and speed up some of the daily tasks, such as invoicing and reporting, associated with running your freelance translation business.

More info »
CafeTran Espresso
You've never met a CAT tool this clever!

Translate faster & easier, using a sophisticated CAT tool built by a translator / developer. Accept jobs from clients who use Trados, MemoQ, Wordfast & major CAT tools. Download and start using CafeTran Espresso -- for free

Buy now! »