So let's dive right into it.
LibreTranslate is a software that's a bit like Google Translate,
but open-source. It is AGPL3 license,
so it's a strongly open-source.
In fact, we're going to keep it that way forever,
and let's you do natural language translation.
It runs on your computer.
This is one of the goals of the project.
There are several other projects in
the open-source realm that have aimed to
provide natural language translation,
except sometimes that they require
a very large servers or a lot of memory,
and our goal is to have this running on
something as low as a Raspberry Pi.
So that is very important to the project.
The program has lots of clients and integrations.
We'll cover some of those in the upcoming slides.
Like many projects, it's available on GitHub,
so you can go and check it out.
But we're going to give you today a brief overview of
how to get started and start using it today.
Let's talk briefly about why we decided to create it,
and there was a need for the project to exist.
We could not find a project that had
all the variables that LibreTranslate can offer.
These are a simple and open-res API that you can
use to programmatically do translations,
so help automate part of
the translation work that we need for the work.
It offers pre-trained and openly licensed language models.
There are other projects that do machine translation,
but again, sometimes they do not make
the AI models for the translation openly available,
and we have that.
Finally, it runs again on commodity hardware,
so it does now require server-scale power
to make the software work,
and finally, it is very easy to get started as you will see.
So talking about getting started,
there are primarily two ways that you can
get LibreTranslate to work on your computer.
The first one is if you have Python,
you can simply run a pip install command,
LibreTranslate, and afterwards you run the program, and that's it.
If you have Docker, which many developers like to use,
we also have an option for that.
We pre-build images for LibreTranslate that you can use,
and we have a convenient script that will run it for you and take
care of a few details that let you have things like
persistent volumes for downloading language models and some technical stuff.
But to get started, all you need to do is go on GitHub,
get a copy of our source code, and press Run.
We also have scripts for Windows and Mac OS and Linux,
so we try to support all major platforms.
We're hoping to get other platforms in there as well,
so things like FreeBSD and others are on the to-do list.
So we'll get there.
So let's actually try to run it,
and I'm always a little scared of doing live demos,
but bear with me, we're going to try it.
What could go wrong?
So here is a console.
I'm going to quickly activate
a Python environment where I have LibreTranslate already installed,
and I'm going to try to run it.
On Mac OS, I have to specify
a different port than the default of 5,000.
I'm going to try to run it.
Okay, it seems to be working.
So I'm going to jump back right into Chrome,
and if I refresh the page,
you will be presented with a friendly user interface that you can use
to test the system and even use it.
It allows programmatic access to the software via an API,
but you can also use it as
an alternative to Google Translate if you want to.
So we're going to try to say something.
Okay, so obviously English to English is not going to be helpful.
How about French?
Okay. So we translated Hello World,
Bonjour Le Monde, and it worked.
But that's not too impressive, right?
I'm like, okay, Hello World.
Let's try to look at something a little more realistic.
Before looking at something more realistic,
you can also, of course, use it from an API.
In this case, I can invoke a Cura command and
ask Libre Translate to perform a translation.
I wanted to automatically detect the language,
where the translation is coming from,
and finally, I want to translate
into the target language.
I get a JSON response.
Everything in the API is JSON-based.
So that will be familiar with many developers.
But let's look at a more realistic example.
In this case, we have a longer piece of text,
and it also contains HTML.
The software is capable of translating
the parts that need translation while
leaving the HTML part intact.
So things like hyperlinks do not get mistakenly translated,
which would be really bad.
This code that we saw here roughly gets
represented as this piece of HTML in a browser,
and the translation is pretty good.
Kind of. This word should have been filidae.
It decided to keep the translation in French.
We will improve that with time.
But otherwise, the context and
the meaning of the sentence is pretty darn good.
We will look at accuracy in the upcoming slides.
So as an overview of the list of features,
it can do text translation,
it can do markup translation that includes HTML,
XML, and other formats that use a markup.
It can do several formats for file translation.
So you can upload things like
open office, LibreOffice,
Word documents, and PowerPoint slides,
and able to translate those as well.
It can perform a language detection.
So you give it a piece of text,
and it will give you
an estimate of which language the program thinks it is.
It also has a built-in system for doing rate limiting.
If you're planning to host this on a public server,
you will find out that it's a very useful feature,
because people really like free resources,
and it's difficult to give everything for free without
some limits. So if your translation instance up in
the Cloud gets really popular,
having some limit by saying,
do a maximum of 60 translation per minute,
will come really handy and it's all built in into the software.
You can further issue API keys to give to people that can change those limits.
So you can set up the system in a way where you
allow anonymous users to translate up to 20 translations per minute,
and you can allow a subset of people that you've issued
API keys to have however many they want.
You decide those limits.
It also has a localized UI.
We're using WebLater to do that,
which is awesome, and it has been
currently translated into four languages,
and we're looking to verify and add more.
One cool neat feature is that
a Libre translator has a ability to translate itself roughly,
so we have done that of course,
but we haven't displayed all the languages that it has tried to translate itself.
We are waiting for a native speaker to review
the actual translation and correct it.
But if you run in debug mode,
you will see all the work that it has done, which is neat.
So it translates itself or at least it helps.
It finally has the ability to monitor itself.
So it can generate the usage metrics,
so you can monitor the usage of the server using Prometheus and Grafana.
These are tools to do monitoring that are very popular.
Inside the software, there is really just a few packages,
so it's very lightweight.
Most of the translation work is done by
another package called Argos Translate.
This is really the core engine that
performs the hard work in the translation,
which is an awesome project,
and we collaborate with them on Libre Translate.
Inside Argo Translate,
there is also other software which is built on the shoulder of giants.
C-Translate, which is an inference engine that
does neural translation using transformers models,
which is a state-of-the-art.
It's the same type of architecture that chatGPT3 uses.
There is a sentence piece,
which is a piece of code from Google that does
the word tokenization and the stanza which comes out of Stanford,
which does a sentence analysis.
Argos Translate uses all these three to perform the translation work.
Now, that's not all it does.
Argos Translate also takes care of
the very important Argos package manager index.
This is where all the language models are handled,
installed, and distributed.
So the first time that you run Libre Translate,
Argos Translate will take care of
querying the Argos package manager index,
and will download the languages that you need.
This allows us to also create instances where,
say, you only need to translate between French and English.
You do not need to download the entire 26 gigabytes of models.
You can simply say,
I just need those two models,
and the program will download simply those two models.
We also have a small module that does
the file translation which connects again to Argos Translate.
That's the Argos Translate files package,
and then some common Python packages that allow us to put
the web interface and coordinate the application as a whole.
So it's really an ecosystem that's built with other open source software,
and together it creates this complete translation solution.
Talking about language models,
we have 58 of them that gives you
translation support for about 30 languages.
It does automatic pivot via English.
We are currently looking to transition to using multi-language models.
But for the moment when you translate,
say, from Italian to French,
the program will automatically do the pivoting via English.
So I will translate Italian to English and English to French.
If there is a language missing,
there is a very cool repository
under the Argos OpenTech organization,
which builds Argos Translate called Argos Train.
That is a repository that has
very good instructions on how you can train your own models.
So if a language is missing, go check it out.
It has very clear instructions,
and you could contribute a language that is
missing and you want to see integrated into the software.
Speaking of the models,
when a model is downloaded,
it has a Argos model extension,
and these are simply zip files.
It's a zip file and it's inside,
has a little bit of metadata.
It has a folder that contains the CTranslate model.
It has the sentence piece model and finally the stanza model.
So it has the information for all the three packages that we
discussed earlier to perform the translation.
It's very interesting to check it out.
Let's talk a little bit of accuracy, right?
Like the question like, okay,
it's a translation sorry, but how good is it really?
For that, there is a metric that can be used to
assess roughly the accuracy of the translation.
It's called a Blue Score acronym
for bilingual evaluation under study.
It measures the similarity of text to a reference corpus.
It has values that go from 0 to 1,
or if you express it as a percentage from 0 to 100.
The best translators in the world,
human translators do not get a score of 100 ever.
So anything that is above
a 40 is considered understandable to good.
Something that is above 50 tends to be very high quality.
Sorry, up to 50 is high quality and above 60 is very high.
We had a community contributor
actually go and a few weeks ago,
he ran the evaluation on our different models,
and we found that 83 percent of
the models currently in
Libre Translate are scoring above 40 percent.
So 83 of them are good.
Now, to make it into perspective,
when people ask me directly how good is Libre Translate,
I like to tell them that it's roughly as good as
Google Translate was four years ago.
So I want to make the expectations clear at this stage in
the project that it is not as good as some of
the proprietary alternatives.
But we are improving and we will continue to improve.
The way to improve it lies into mostly getting better training data.
So as we find more and more sources of
open data that can be used for translation,
we include those into the training of
the models and that results into better models.
This is also an interesting point to note,
is that because the project is open source and we have a way to train models,
you can also train models that are specific to a certain domain.
For example, in the context of software translation,
you could imagine the case where instead of training the data on
a general corpus like Wikipedia or the EU Parliament translation documents,
you could train a model that is specific to software.
For example, you could take a set of existing translations from
existing software that has licensed
the translation work under an open permissible license and train
a model onto those existing translations.
Because we have the knowledge,
a lot of software has commonalities in terms.
When you have a file menu,
it's always called file and then edit.
So those menus are specific to a context.
By training models that are specific to a context,
you could get, for example,
software translation model that is more accurate in the context of software,
rather than say poetry.
So it's a very interesting thing to think about.
One more thing about accuracy,
we do have the occasional rare quirk.
This is something that we are aware of and we are working to fix it.
We like to call it the salad issue.
We joke, I will demonstrate this slide because it always sparks a little bit of a giggle.
It's a little bit rare, but it happens.
So in Spanish, the word for salad is ensalada.
Now, let's try to translate the word for salads plural.
So I'm going to type ensaladas.
So in French, that's saladas.
Is that correct? Any French people in the room?
Fantastic.
Now let's try the singular form.
I'm going to remove the S and it crunches for a little bit.
In a second, it really likes salad.
Salad, salad, salad, salad, salad.
This is a quirk. We are aware of it.
It's very rare, but we've found a few reports here and there and we're working to fix it.
Just something to be aware of.
Yes, it really likes salad.
Me too. Let's talk a little bit about integrations.
You can find the client libraries for about 11 programming languages that includes the most common ones like Java, Python,
whatever your favorite language is, it's probably in the list of bindings.
And if it's not there, adding new bindings for LibreTranslate is fairly easy.
So we welcome contributions, of course.
As far as software, LibreTranslate has found adoption in several existing open-source software that you may recognize.
Mastodon recently added support for translating topics using LibreTranslate.
Weblate has the ability to use LibreTranslate to suggest and help translators perform translations as an alternative to using proprietary software.
The forum software discourse has a plugin that lets you make your forum software accessible from different locales
and lets you translate the posts on the fly.
LibreOffice, I found, has an extension. I didn't know this until a week ago when I was looking who has integrated stuff with LibreTranslate.
But somebody wrote an extension to LibreOffice where you can translate documents on the fly using LibreTranslate.
There is an add-on for the multimedia software code.
There is an add-on also for Firefox.
And there's probably a lot of other things that I haven't found myself.
But a lot of people seem to be finding the API useful and they're doing integration work, which is fantastic.
And there's finally client applications that you can use LibreTranslate with without using the web UI.
And we found we have clients for Android, iOS and desktop.
And there's more being built by the week.
As far as comparison to proprietary alternatives, you can see that there is a clear monetary advantage,
aside from the philosophical reason for why you might want to use open-source software, of course.
But it could also be a really sustainable way to perform translations in that people often ask me,
why should I use LibreTranslate? I can use Google Translate for free.
I just go on translate.google.com and it doesn't charge me anything. So why should I care?
Google Translate is free so long as you're using it by hand.
If you want to do any automation work and you have to tap into their API, you're going to pay dearly.
And you can see here a list of the prices and I can assure you that one million characters seem like a lot,
that's six zeros, but they actually run pretty fast and so could the bill on your credit card.
So if you have a lot of text to translate, LibreTranslate could really help in that regard.
As far as funding goes, the project is on the path to become fully self-funded.
And we really care about this because we want the project to continue living on.
We, of course, accept sponsorships and donations, but honestly,
we would rather prefer that you get something back if you decide to contribute financially to the project.
This is why if you are in the position where you say, I have some finances to spare and help support the project,
you also get something back and we do that in the form of offering you an API key to use a host distance at LibreTranslate.com.
So you are free to run the infrastructure on your own server, on your Raspberry Pi, on any machine that you'd like.
If you don't want to handle that, you can just get an API key and you can support the project at the same time.
So it's really a good way to contribute back.
And we found that that model has been helping us grow and sustain the project.
So we hope to continue growing as much next year.
Again, to get involved, I'll give you a few quick numbers.
We've had about 70 people contribute to the code base over the last few years.
The project is still very young, but it has really received a lot of attention, so we're very excited about that.
You can help with code. If you're a Python programmer, if you know HTML, CSS, any of the technologies that we use, you're welcome to contribute.
We are open to everybody and all ideas.
You can also help us translate.
If you understand English and you don't see your language in the list of languages that we currently support for your user interface, you are welcome to contribute.
It's on a web late, you can simply translate and it will get included into the project every 24 hours.
So that is really amazing.
You can also help us train more language models.
If your language is not available or a language that you care about is not available, you can yourself create a new model for a language and add that into the list.
So that is also another way that people can help.
You can report bugs, of course. If you don't report salad, we are aware of it.
Or just come say hi.
We have a community forum that is quickly growing and we love to hear what you're building with it, what you're using, or if you have any questions.
So we're very, very open and we're excited to hear what you will do with it.
That said, this was the last slide.
I think we have some time left over, right?
So I will.
So thank you very much.
I will open the floor for questions and discussion.
So yes.
Hi, my best friend cannot miss the Vice President of the Austrian Society for Artificial Intelligence sitting with Foster to find volunteers to do exactly what you're doing.
Thank you. We're glad to be able to help.
You're welcome.
How do we find, well, I just named the thing Open Language Model Training Army.
How do we find more volunteers?
Unemployed people, maybe have the government fund people running training models, maybe suggest that to all politicians, everybody to their member of parliament.
How many people do we have here?
Should be all of Europe at least, maybe South America.
I think if we multiply this, it can go viral.
Thank you very much.
This is awesome work.
Thank you.
I appreciate it.
Yes, but you speak of our language that have the same link, the same structure of the language.
We have French, English, Spanish, Portuguese, maybe Russian and Ukrainian.
I do not have the same structure, but the language not far away from here.
That's the difference.
German also.
Correct.
And so taking this in account, it's not easy for a translator, for them to translate it.
It is not.
There's also maybe a problem with Chinese or Japanese.
Correct.
There was a problem, there was a thing I went to say, it's a dictionary in line or in the program to have the good word because it's not translated every time the good word.
And so I thought also the most efficient people's language is Esperanto, not English.
Oh, that is very interesting.
Yes.
Okay.
Yeah, that's a great insight.
Yeah, thank you for sharing that.
And you're completely right, some languages don't share the same semantical structure and Dutch, for example, currently doesn't score super high.
It's actually one of the bottom 17% of the language models in the blue score.
Dutch scored around 38%.
So it's almost good, but we've had some Dutch speaking people come to us and say, you know, it's like equal use improvement.
So Dutch, yes, it is a language that needs improvement.
And I talked to the maintainer of Argus translate about the languages that need improvement.
And he pretty much suggested that better training data will help greatly.
So it is mainly a problem, not of the architecture of the AI.
It's a matter that we don't have sufficient quality, high quality data between, say, English and Dutch to get above 38% currently.
But again, nobody has really focused on Dutch as a language.
If anybody has an interest in improving Dutch, we can do better.
Surprisingly, fantastic.
But as far as, for example, languages like German, LibreTranslate currently does very well with German.
It's above 50, if I remember correctly.
Is it because German is the similar language to Dutch?
It is.
That is because I believe, and I think PJ, that's the name of the maintainer of Argus translate,
because the German model has had a larger amount of training data, and so it tends to perform better.
Yes?
Yeah, just a quick question around the translation process, I suppose, touched on the structure.
But how does it work with different dialects?
So if you write in dialects, will you write in slang?
That's a very good question.
Dialects would probably, and that's my guess, because I've never inquired this myself,
but I believe that a dialect to perform good as a target or source language for translation
would also need its fair amount of training data.
And that is the problem with dialects.
I actually speak a local Italian dialect, that is my first language,
and I wanted to make a model for my dialect.
And I started looking online for references of data that I could use to create a model for my dialect,
because it would be cool.
And it was really challenging.
Not being an official language, it really lacks the status of official languages,
and finding training data is extremely difficult.
But it could be possible, right?
If you gather enough people that can create a ground truth data set of examples in the dialect
with sufficient samples, you could get good results, I believe.
So it's a matter, again, of training data.
Yes?
How much does it cost to get a model to a good level?
In terms of computing power or in terms of computing power?
So if I remember correctly what PJ told me about the cost of training the models,
it costs maybe a few, between $12 and $30.
You can rent instances on several cloud providers.
You do need a GPU to train these models,
and it might take a few days for it to crunch and get sufficient number of iterations to train the model.
But it's absolutely affordable.
Anybody can do it, and if you are willing to wait and you just have a gaming laptop sitting at home,
if you're OK waiting 20 days for it to finish, it will train the model for you.
So I guess it could be free to you if you're willing to wait a sufficient amount of time,
and if you have a gaming laptop lying around.
Yes?
So you mentioned the need for a data availability for doing the model, right?
Well, do you need the data to be available under a certain license?
What's your problem?
The world's full of things, right?
Yes.
What's the requirement you have?
You want it to be public domain?
It has to be licensed under a permissive license, so creative comments that also includes commercial use.
And we give references and we give attribution to all the sources that we use.
If you go into the Argos Package Manager repository, where all the models are hosted,
we do give the appropriate licensing credits to all those.
But yes, we cannot go on, say, the Internet and start scraping results,
because everything, you just have to assume that everything is covered by copyright
until they tell you that you can use it freely.
So it's only trained on openly available and freely licensed sources.
Do you need it to be translated as well or just a single language?
It has to be translated.
So very briefly, the format of the input that goes into the training is a file that has,
say, the English sentences and a separate file that has the translation on the same line.
So it's very basic.
And somebody could do the work by hand, right?
You start from the English translation and you start doing the translation.
So it will take a lot of work, but it's doable, especially in a crowd-formed...
Are we out of time?
Okay.
I'll be around if you have other questions.
Our time is up, unfortunately.
They're kicking me out.
But the next speaker will deliver something awesome as well next talk.
Thank you again.