>> You're not going to want to miss this episode of the AI Show.
We're going to learn all about
the Translator API and cognitive services.
It's pretty amazing.
Make sure you tune in.
[MUSIC]
Hello and welcome to this episode of the AI Show,
where we're going to talk about
Translator API and cognitive services.
I got a special guest, my friend.
Hello. Tell us who you are and what you do.
>> Hey, Seth. Hello, nice talking with you.
My name is Chris Wendt
and I'm the Group Program Manager
for Microsoft Translation Service.
>> All right. So let's dive in.
What is the translation service?
Why is it important?
How to use it. Let's get into it.
>> All right. I'd love to talk about it.
The translation service translates.
It translates between natural language
and it translates speech,
and it translates text.
Text is really a pretty simple thing.
You give it a piece of text,
it returns to you the translation of that piece of text.
Speech is a little more complicated
and I want to introduce you to both today.
We are, of course, motivated
by breaking down the language barrier between people.
We want people to communicate,
people to talk to each other.
In fact, not just people talking to each other,
it's also machines interpreting
what people are writing
in order for processing it or just to render it
for another human or for some AI that you want to run on it.
Say, for instance, to extract information
out of a translated document.
So breaking down language barriers is what we do,
that's in our DNA.
What's important for you to know is
that automating translation is really cheap.
It's about in fact 1,000 cheaper than human translations.
So you can do a lot more with it.
It is infinitely faster.
It is however, not as good.
You don't get as good a translation out of it.
There's a difference between languages.
So the most translated languages of the world generally,
I say the 20 most translated languages
of the world that includes French, German, Italian,
and Spanish, Chinese, Japanese,
Portuguese, and a bunch more.
They translate really well.
As you move out of those most translated languages,
there's just less training material available.
So the vocabulary coverage and the fluency
just goes down a little bit
for the languages that are not in the top 10.
So here I have calculated what it costs.
To translate a million words,
you pay about $250,000 to have
that translated in human translation quality with the machine.
That's our most expensive service.
That's the customized machine translation and functionality
that costs you $280 to translate the same amount.
>> That's for the most expensive one too?
>> That's the most expensive.
The cheapest one would cost you $70.
>> Holy cow.
>> Yeah. That is quite a difference.
So you get a much cheaper price.
You get infinitely faster.
But you pay for it in quality.
But how bad really is the quality?
So a quick history.
Machine translation is old.
It was invented in the 1950s,
and it has made steady advances since then.
So every 5 to 10 years you have
a major algorithmic improvement.
The latest one was really the neural networks,
and specifically the transformer models
inside the neural networks have
brought us the latest noticeable increase in quality.
Between these 5 to 10 years,
we can improve the automatic translation quality by
adding new or better filtered training material
and you can do the same.
You can adjust or improve the translation quality
for your terminology and domain
by using a feature that we have,
it's called Custom Translator that allows you
to upload previously translated documents.
You don't need that many of them,
about 10,000 sentences is the minimum,
20,000 will create a noticeable difference.
Anything above that is,
helpful as its goodness.
Then you build a system that knows
your terminology and style much better than our generic system.
>> This is really cool because most people don't know this.
Maybe you know this, but I basically
did research in machine translation.
That's what I went to school for.
I studied the IBM models 1 through 5.
I went to school right before
neural networks became popular again,
hence, it's really cool to see this history.
It's really cool to see a semi-supervised approach too
where you give it some information
and it gets a little bit better from there.
>> Yes, exactly.
So the goal is to reach human parity.
Be as good as a human.
In 2018, we said we have reached it in
the Chinese to English news domain,
by just comparing it to human translator and then have
a judge go judge it sentence by sentence.
So in that newest domain it worked okay because
fairly clean language that is published in news.
Where you translate more difficult stuff
like what we are talking out,
it's not perfectly clean or when you have chat messages also,
it's not perfectly clean as it's not necessarily
grammatically correct with the right casing and punctuation.
It falls off, the human still does better.
So I want to talk now a little bit about
how you actually use it in your application.
So translation of text is a very simple process.
So it has one function that's called Translate.
Sorry, that's not one function.
Still the most important function above everything else.
It's a stateless REST API.
You give it a piece of text, in adjacent package,
you get back that same text in
the other language in adjacent package. That's pretty much it.
The input formats are plain text or HTML.
You can translate between 1 and 70 languages, any to any.
You don't have to specify the source language.
You can just let the system guess what the source language was.
But you need to specify one or more target languages.
You can translate to multiple languages
at once in the same request.
Then you get just different rows in your JSON array.
>> So you don't have to tell it the input language,
you just tell it the output languages.
>> Yeah, you have the option to tell it.
If you are sure what it is,
then you can specify it.
So there are no detection mistake.
The text detection works quite safely.
It's unlikely to make
mistakes except for very closely related languages.
So for instance, between Russia and Ukraine
and it may pick one or the other.
Because they have very similar character sequences in them.
Yes, and that's how it works or Danish and Swedish,
they are also somewhat confusable.
But generally, it works very safely
even for short push word strengths.
The next function here on this list is the Languages function.
It's just an enumeration tells you
which languages you can translate between.
It also gives you the friendly name of the language so you can
render it in your UI
to have the user choose in whatever language we translate.
We also give you the language name
so that you can allow a user to choose from it.
Plus all the other things you can do with a particular language.
So not all languages, for instance,
have a transliteration, which is the next function here.
So Transliteration is to change the script of a piece of text,
say between a native script and the romanized script.
For instance, if you have Arabic or Chinese,
there's a Latin script version of it
that makes it readable for people who
don't read the characters of the language,
but still want to understand it or learn it also.
So it's really good for language learning scenarios.
Detection just tells you what the language was of a piece of text,
just in case you want to base
your further processing on it
without invoking the translation function.
Then BreakSentences tells you
the boundaries of sentences in your text.
This is important when you want to translate
a long stretch of text,
say, a longer document,
longer than the request size limit,
which is 5,000 characters.
So then you need to find the last sentence break
because you cannot translate partial sentences.
You can translate them, but it'll produce a bad translation.
>> Got it.
>> So you always need to keep sentences intact,
and the break sentence method helps you with it.
That's already it, Seth.
There's not much more to it.
Very simple API, very simple functionality.
I want to mention, as I talked a lot about
the translating longer documents or longer strings,
we have some sample code on
our GitHub repo that helps you do that.
We're also working on a document translation API
where you can submit a whole document intact
and you don't have to break it by hand.
I think that'll be useful.
>> This is impressive because you say that's it.
It's just basically a function to translate a language.
Like I said, I'd worked on noisy channel models from
the IBM series of things in
the '90s that I was doing research with in the late 2000s.
So this is just not just a function,
this is pure AI magic.
Do you have some code you can show us?
>> Yes. I want to move on to speech,
which is actually a little more
magical than the translation of text.
It's more magical because it really combines
two very interesting services,
the speech recognition and the translation.
There's a lot of
shared technology below the surface because they do similar thing.
They take in a stream of, let's say,
audio or a stream of
text and then give you a return to use some markup,
either the translation or the text of the recognition.
They are both not 100 percent reliable.
They both make mistakes.
So if you combine these two,
you have a chance to multiply the mistakes.
Pretty much the world, it took us a while to be
brave enough to put these two together.
But now both technologies,
the speech recognition and the translation have
reached a level where you can really do that, combine those two.
So I have listed here the steps of what's necessary in order
to embark on the translating speech.
For this, we offer a nice client side SDK.
For a translation of text,
you don't really need that. It's so simple.
But for speech is processed using
a streaming protocol and that's fairly hard to manage by hand.
So we give you an SDK that's
available for all the major operating system and
all the major programming languages
so it's meant to fit your need.
So let me just go to the example here.
This is the simplest example that you can come up with.
This is the whole thing.
Let me zoom in a little bit so that you can see it in pieces.
You see here at the top,
you just include the speech SDK,
then you state what your source and your target language is.
Speech also allows you to do language detection.
It can detect only between a small set of languages.
Detection of the speech language
is much harder than the detection of a text language.
So in this example here,
we specify it because either I speak only two languages,
so it's not really that hard.
I can say I can speak either English or German and that's it,
and here I chose to translate it to German.
Then you simply wait for the recognizer to give you a result,
and then you do something with it.
If there's success, in this case,
this API just prints out the recognition and the translation.
What this doesn't show is that you
get the partial results while I'm talking.
So you can do real-time actions before the end of the utterance.
Then I have an example here,
if I may show that.
That's okay, that's great that I can show that.
That is on GitHub in the Azure speech
SDK repo that shows how it all works nicely together.
So it's a fairly ugly UI as it's supposed to be for a demo app.
I choose here which language I'm speaking,
so I'm speaking English here.
I want to translate it to Chinese and to German.
Just the same thing here.
You can translate to multiple languages at once.
As part of the API,
you get for free,
the audio of one of these languages.
So I can choose that here as well.
We wanted to do that way to enable, say,
real-time conversations between people.
So that I can speak something and then my app
can make myself be heard in the other language.
This way you can build a bidirectional conversation.
Let me show you how that works.
"Hello, how are you doing today?"
If you listen carefully,
you heard the Chinese is coming out of my system speaker here.
So let's do it again.
Now, I'm saying something that's a little longer so that you
can see the partial results as I'm speaking.
You can see the results of my recognition as I am speaking.
[FOREIGN]
So you not only get the final after I'm done,
but you also get the interim
in all the languages that are involved here,
which is the original and two
translations and one of them as all of them.
>> That's really cool. I also heard
the Chinese through your system audio. That was really cool.
>> Yeah, good.
So let me go to the next one here.
You asked what are the other cool things that are coming up.
So imagine it's not just the two of us talking to each other
but there is a whole group of people and they
all want to listen to each other,
however, they don't share the same language.
So on our journey to break down the language barriers,
we are building a system
that really represents a conversation in the Cloud,
and each audio channel feeds into that conversation in the Cloud,
and the Cloud distributes the transcript
and translation to everybody who is participating.
That's really the idea behind it.
It's also consumable via the speech SDK.
It's currently in private preview
and we'd like to invite you to participate in it
and try it out and let us know
what you would like to see in this functionality.
>> This is all pretty amazing stuff.
Where can people go to find out more?
>> People can visit us on the web at Microsoft.com/translator.
You see our GitHub repo as well here under Microsoft Translator.
You can submit questions on Stack Overflow,
we monitor that. Or you can tweet us.
>> Well, my friend, this has all been pretty amazing.
Thank you so much for spending some time with us.
For those who are watching, thank you so much for coming.
You were learning all about what's new
in Cognitive Services Translator API.
We got a whirlwind tour of some of
the amazing things you can build today.
We'll see you next time. Take care, my friends.
[MUSIC]