Litterae.eu
Humanities & IT


Neural networks for machine translation

In 2011, I applied for a scholarship at the Department of Computational Linguistics of an important and generous university in Northern Europe with a PhD project focused on the elaboration of an almost unsupervised model of machine language learning, for which I had hypothesised two practical cases of use: the first, more profitable and therefore attractive to the university, in tourism; the second, more speculative, in the study of ancient languages.
Although they liked the project on a theoretical level, it was judged a little too futuristic on a practical one; I was not awarded with the scholarship and I put my idea back in the drawer waiting for better times.

In the meantime, studies and applications of artificial intelligence have made enormous strides, and many more will follow in the coming years. Many tools, such as libraries and machine learning models, are available to anyone who is willing and has the time to experiment with them; just think of the TensorFlow library released by Google as open source and easily installable on any operating system. But many others are available. A few examples are given on this very site.
Well, among these new tools that contribute to making access to AI more democratic, one recently appeared let me reopen that drawer to revive the second purpose of use mentioned above. I am talking of Marian NMT, an artificial neural network for machine language learning and translation; it is not the only one of its kind, but unlike other NMT's it is a standalone box which does not require you to get mad for days or weeks to have it installed and running on your computer.

Of course, your computer would have to have the highest hardware requirements to handle the amount of work generated by an object like Marian, but if, like in my case, the hardware is what it is, better to arm yourself with a lot of patience... and optimism. According to the developers, in order to generate a linguistic model for translations from a corpus of a few thousand sentences, Marian makes a Schwarzenegger size PC sweat for at least 24 hours non-stop, while it cooks a Lilliputian PC like mine for about ten days... provided it doesn't melt it down or set fire to it in the meantime.
While waiting for a more vitaminised computer, I therefore had to immediately shelve the idea of feeding the neural network with the corpus of about 40,000 Latin-Italian sentences I had prepared on purpose during the previous days.
Thinking of drastically reducing Marian's processing time, I repaired to a skimpy ten or so Etruscan epigraphs of a few words each with their Italian translations; well aware that with so little data one cannot expect any acceptable results. But I was interested in seeing, in a reasonable time, if the neural network would produce something interesting.
After 22 hours of training, or to put it more earthly, processing, a first egg finally materialised in Marian's folder: an Etruscan-Italian language and translation model as large as 680 megabytes... starting from a less than 600 bytes corpus. Just to say the enormity of calculations a neural network processes.

As I said, I did not expect any possible decent translation with no more than 50 words per language to be used for training; I simply wanted to see if a neural network would stoop to work even for an ordinary person who is not living and working in a gigafactory.
Yes, Marian did: after the training, when asked to translate two very short texts not present in the given corpus, first from Etruscan into Italian and then vice versa, it generated two equally short translations. Definitely inaccurate, as already mentioned, but in both cases new texts, not existing in the given corpus, and not even word-to-word correspondences as it was with the poor early 1990's translation software. Confirming that, having the right hardware at own disposal and thus being able to train on corpora of adequate consistency, there is no longer any justification for continuing to exclude ancient languages from machine translation tools such as Google Translate or Deepl.


Site designed by litterae.eu. © 2004-2025. All rights reserved.
Info GDPR EU 2016/679: no cookies used, no personal data collected.