Machine Transal...'s profileMachine Translation - th...PhotosBlog Tools Help

Blog


    January 30

    Another IM translator/ Outro tradutor de IM lancado

    Technorati Tags:

    CNET has an article this week on yet another IM Translator by SpeakLike which has a cool feature - it translate slang and IM shorthand. Here's the link to the article: http://www.webware.com/8301-1_109-9860381-2.html?tag=cnetfd.mt 

    They don't mention if it's a free service or not, but I guess it's worth checking...

    Looks like the field is heating up! Good to know that I'm not the only one that sees value in this type of thing...


    A CNET publicou um artigo essa semana a respeito de outro tradutor de IMs, desta vez de uma compania chamada SpeakLike. Nao tentei, mas parece ser legal - tem funcoes para traducao de girias e abreviacoes (otimo para aqueles que insistem em mandar frases do tipo 'kd vc?' para serem traduzidas).

    Nao sei se o servico e' gratuito, mas vale a pena checar.

    Legal ver que o interesse por esse tipo de aplicacao esta aumentando... a coisa vai ficar legal em pouco tempo.

    January 28

    Yet another bad Machine Translation story/ Outra historia infeliz envolvendo Traducao Automatica

    Today there was a big discussion in our group about a CNET article bashing Google Translate  - Google Translate bug mixes up Heath Ledger, Tom Cruise . In summary, the problem is that when you type "I will miss Heath Ledger," Google Translate would come back with "Voy a perder Tom Cruise.", just like the picture below:

    Our product does a better job:

    CNET bug

    That said, the group wasn't really concerned about getting a better translation than the competition - rather, the discussions were around the root cause of the problem - handling named entities.

    I'm no expert, and I'm not the type that fakes competence so I won't try to explain the inner guts of a translation engine, but it's fair to say that it's not trivial... If I had to describe my understanding of how it works from a 10,000 feet level I'd start by mentioning that the engine is trained using real translations, made by bilingual speakers. It's instructed to evaluate if a sentence passed for translation is similar to any other translated sentence it already knows. If it cannot find an adequate match, it starts breaking the sentence into chunks and repeating the process for each chunk. Once it completes this task it then tries to re-organize all translated fragments according to the grammar of the target language, respecting the positioning of nouns, verbs and adjectives. In other words - not easy.

    I can only wonder what pushed the engine to mix up the actors' names, however I can understand that it's totally possible to do so.

    And by the way: if anyone spends more than 5 minutes typing isolated sentences and sending them for translation using our product he/she will certainly find other problems... As a tester I hate to say it, but there's absolutely no value in these type of tests from a linguistic perspective.

    So, what's the conclusion? MT has ways to go... Hopefully we'll make significant advances soon based on community feedback - the more bilingual users providing valid sentences back to the engines, the better the overall quality of the translations. Let's see if we can take advantages of the so called Social Network concept advocated by the Web 2.0 prophets to get more, better training data.


    Hoje pela manha rolou uma discussao bem interessante aqui no grupo sobre um bug no Google Translate que saiu na CNET - - Google Translate bug mixes up Heath Ledger, Tom Cruise . Basicamente, o problema aparece quando voce entra "I will miss Heath Ledger," e pede para traduzir para Espanhol. Google Translate se confunde e devolve "Voy a perder Tom Cruise.". O nosso tradutor ganhou essa - traduziu direitinho... (as imagens estao acima no blog em Ingles).

    Ao inves de ficar esbravejando que a gente bateu o Google mais uma vez, o grupo discutiu na realidade o que fazer nesses casos em que a percepcao do usuario e' pessima, baseado em um resultado muito fora de contexto. Minha opiniao e' que infelizmente nao ha' muito o que fazer de imediato. Eu nao sou um expert no assunto, mas pelo que eu sei os algoritmos de traducao sao baseados em frases de treinamento, que sao submetidas e analisadas pelo kernel do sistema. Esta e' a fase de treinamento, que ocorre por detras dos panos. Depois, quando voce submete qualquer frase para ser traduzida usando nosso web site, o sistema vai tentar achar uma outra frase que ja' esteja cadastrada e que seja equivalente aquela que voce submeteu. Se nao achar nada, passa entao a quebrar a frase em fragmentos, e repete o processo ate achar traducoes para todos fragmentos ou ate' que cada fragmento seja uma unica palavra. Ai entao o sistem tenta remontar uma frase baseado na gramatica do idioma que voce escolheu: posiciona os substantivos, acerta os adjetivos e as concordancias verbais - em suma, nao e' mole nao...

    Nao da' pra' entender direito como o sistema deles confundiu um ator com outro, mas da' pra' sacar que e' possivel (bastaria achar uma frase "equivalente" com outro nome e dai propagar o erro). Se alguem tiver tempo e disposicao com certeza pode achar outros erros no nosso produto http://translator.live.com/ .

    Entao, o que fazer? Na minha opiniao o segredo e' conseguir mais frases de treinamento corretas. Quanto maior for o volume de dados conhecidos, melhor sera' a qualidade da traducao. Eu realmente espero que com o avanco das redes sociais (pelo menos segundo os profetas da Web 2.0) nos consigamos capturar feedback de usuarios bilingues e entao realimentar o sistema, criando uma bola de neve que de repente vai ganhar momentum suficiente para gerar melhores traducoes...

     

    January 18

    Editing the Spaces Translation Gadget/ Configurando o Gadget de traducao do Spaces

    I haven't paid much attention to the Spaces Gadget (http://gallery.live.com/liveItemDetail.aspx?li=6fc4a111-c80e-4dd0-9758-773e4b34ade7) I published a while ago, but know I think I should... Apparently, some people are having problems understanding how to configure it to translate their own blog. I'm not exactly an UI expert, but it should not be that hard but hey, who am I to disagree with the ratings and reviews!

    So here is how it works:

    Spaces gadget editing

    Hope this helps...


    Eu li uns reviews do meu Gadget de traducao para o Spaces e parece que algumas pessoas estao tendo dificuldade em configurar o treco para funcionar direito - Valeu Ricardo pela grande review :-) !!!

    O diagrama acima deve ajudar. Basicamente, tudo que voce tem que fazer e clicar no Edit e trocar o idioma do seu blog e o idioma destino ( se tiver mais de um). Por exemplo, se seu blog for em Ingles, voce pode escolher entre varios idiomas destino... Se for Protugues, so' podera' seleciuonar destino = Ingles. Ai' e' so' trocar o endereco (Url) para apontar para o seu proprio blog e pronto...

    January 14

    Connectivity issues/Problemas de conexao

    I'm having some connectivity issues with Messenger today - the bot is taking a really long time to respond. Looking at the logs, it seems the request are taking time to hit the bot - which would indicate some issues with my connection to the messenger server... Please be patient if it takes too long to respond.
     

    Parece que estou tendo problemas de conexao com o servidor do Messenger hoje - o bot esta' demorando uma eternidade para responder. Olhando os logs, parece que os invites estao demorando mesmo, o que indica problemas de comunicacao com o servidor. Por favor tenham paciencia...
    January 09

    Ramdom Topics: The complete demo code/Finalmente o codigo completo

    I finally took some time and recorded a short demo of the code in action. It's enough to see the launcher tracking an object (my foot in this case :-)) and firing at it. I could not capture much of the screen, but you can guess from the previous posts what is going on...

    Oh, and wrt the speech stuff: it couldn't be simpler, honestly... All it takes is an Interop reference to "Microsoft Speech Object Library" and this:

    using System;
    using System.Collections.Generic;
    using System.Text;
    using SpeechLib;

    namespace Speech
    {
        public class SpeechWrapper
        {
            public static void Say(string strTTS)
            {
                //Create a TTS voice and speak.
                try
                {
                    SpeechVoiceSpeakFlags SpFlags = SpeechVoiceSpeakFlags.SVSFlagsAsync;
                    SpVoice Voice = new SpVoice();
                    Voice.Speak(strTTS, SpFlags);
                }
                catch (Exception error)
                {
                    throw new ApplicationException ("Speak error", error);
                }

            }

        }
    }

    Told ya...

     

     

     

     
    Video: Usb Missile Launcher Demo Code in action


    Bom, tai o codigo demo - zipado mas con tudo que tem direito. O video nao esta' la' essas coisas, mas da' pra' ver o canhao mirando e atirando assim que eu coloco o meu pe' na frente da lente.

    O codigo do SpeechWrapper tambem esta' ai encima: e' simples demais mesmo - e' so' adicionar uma referencia COM apontando para "Microsoft Speech Object Library" e criar os objetos corretos. Alias, nao sei pq nao usam sintese de voz mais frequentemente aqui nos EUA - o engine de "Text to Speech" (TTS) funciona muito bem para american English.

    Divertam-se.

    January 04

    Using the Motion Detection Algorithm to track colors/Usando o algoritmo de detecao de movimento para identificar cores

    I know I said I was going to end this topic in one post, but I couldn't resist adding another one, so I guess I lied (get used to it - it's the Internet after all!).

    The December 2007 issue of the Servo Magazine (www.servomagazine.com) had an article about a underwater robotics competition that includes tracking orange pipes and following them as a guided path. The article briefly describes how a team implemented a tethered alternative in which the color pattern is recognized by the master computer - in their case a MacMini.

    Well, guess what? The very first version of the MD algorithm that I posted yesterday was actually written to track colors... All you have to do is change the comparison to something like:

    void IdentifyColor(Image Sample,double tolerance, Color reference)
    {
        Bitmap _area = (Bitmap) Sample;

        // 100% = 255
        double delta = ((tolerance*100)*255/100);
        Color localColor;
        for (int x=0; x<_area.Width;x++)
        {
            for(int y=0; y<_area.Height; y++)
            {
                localColor = _area.GetPixel(x, y);
                bool threshold_R = (localColor.R > (reference.R - delta)) && (localColor.R < (reference.R  + delta));
                bool threshold_A = (localColor.A > (reference.A - delta)) && (localColor.A < (reference.A  + delta));
                bool threshold_B = (localColor.B > (reference.B - delta)) && (localColor.B < (reference.B  + delta));
                bool threshold_G = (localColor.G > (reference.G - delta)) && (localColor.G < (reference.G  + delta));

                //if (!(threshold_R && threshold_A && threshold_B && threshold_G))
                if (!(threshold_R && threshold_B && threshold_G))
                {
                    _area.SetPixel(x, y,Color.White);
                }
                else
                {
                    _area.SetPixel(x, y,Color.Black);
                }
            }
        }
    }

    Same result as the new version: the pixels in the picture that contain the reference color are set to white, and everything else is black. You can then use the quadrants approach to lock the center of the target.

     


    Bom, eu sei que prometi fechar o topico em um post, mas eu tenho um bom motivo... A edicao de Dezembro da revista Servo (www.servomagazine.com) tem um artigo sobre uma competicao de robos submarinos que inclui seguir uma serie de tubos laranja. O time implementou um projeto baseado em um MacMini, ligado ao processador do robo via ethernet.

    Talvez tenha ficado claro para alguns, mas caso contrario segue aqui a revelacao: a primeira versao do algoritimo de detecao de movimento que eu publiquei no post anterior foi desenvolvido para detectar cores... A rotina tai acima - basicamente tudo que for diferente da cor referencia vira preto, e a cor referencia vira branco. O resto e' identico: quadrantes, centralizacao, etc, etc...

    Nao nao deu pra resistir...

    January 03

    Random Topics: Controlling the USB Missile Launcher in C# Part III - motion detection/ Controlando um lancador de misseis USB com C# Terceira Parte: detecao de movimento

    New year... I guess it's time to finish up this series of posts, and move on to another topic. Two more posts and I'm done, I promise...

    So now you have a missile launcher, a webcam attached to it with adhesive tape (very solid assembly, of course) and you can move the thing up and down while watching the image that comes from the web cam... Well, even though this might be enough for some I bet it's not exactly the most exciting thing to do for the rest of us. That said, let's add motion detection to the project, and make it a real security device, shall we?

    Before I bore you with the implementation details of yet another helper class, let's quickly review the algorithm I used in the project. In this context, "Motion detection" is defined as the pixel difference between two images taken from the same webcam - a delta between a reference image and the real time snapshot of the cam.  The code calculates the difference pixel by pixel using a tolerance factor that can be adjusted according to the environment - the more tolerant the setting, the less sensitive the code will be. If the pixels are considered "equal" the computer seems black. If not, I paint the pixel white.

    Motion Detection - Reference Image

    As you can see in the picture, when the reference image and the snapshot are identical no delta is computed and the result is all black.

    When any object moves in front of the cam the computer starts seeing a bunch of whites...

    Motion Detection - Hand

    So now it's time to decide what to do... Since the goal is to shoot and destroy the intruder we need to aim the launcher at the center of the newly acquired target. Precision is not actually a requirement here, so I simply divide the image in four quadrants, and then I pick the one with more whites - this is then the center of the target.

    Motion Detection - Target

    All I have to do now is to move the turret and fire... Here's the code for the helper class:

     

    The class itself exposes two methods:

    1. ComparePics: compares two images and sets a third bitmap with black and white pixels as appropriated
    2. DefineQuadrant: returns the quadrant to fire at

    The timer watchdog I use to tie it all together looks like the following:

    timerAuto.Enabled = false;
    auxImage = myCam.CaptureWebImage();
    picAuto.Image = refImage;
    double dblDelta = Convert.ToDouble(lblDelta.Text);

    MotionDetection.MDMain.ComparePics(refPic.Image, auxImage, dblDelta, picAuto.Image);

    int move = MotionDetection.MDMain.DefineQuadrant(picAuto.Image, dblDelta);

    if (move > -1)
    {
        Speech.SpeechWrapper.Say(String.Format("Target acquired, quadrant {0}", move));

        switch (move)
        {
            case 0:
                MultiStepCmd(CMD_LEFT, 14);
                MultiStepCmd(CMD_UP, 6);
                break;

            case 1:
                MultiStepCmd(CMD_LEFT, 14);
                MultiStepCmd(CMD_DOWN, 6);
                break;

            case 2:
                MultiStepCmd(CMD_RIGHT, 14);
                MultiStepCmd(CMD_UP, 6);
                break;

            case 3:
                MultiStepCmd(CMD_RIGHT, 14);
                MultiStepCmd(CMD_DOWN, 6);
                break;

        }

        picAuto.Refresh();
        Application.DoEvents();

        // fire!
        MultiStepCmd(CMD_FIRE, 3 * 5 * 10);

        System.Threading.Thread.Sleep(500);
        timerAuto.Enabled = false;
        Speech.SpeechWrapper.Say("Target eliminated");
        btnAuto.Text = "Auto Mode";
        Speech.SpeechWrapper.Say("Have a nice day...");
        //timerRef.Enabled = true;

    }
    else
    {
        refImage = myCam.CaptureWebImage();
        refPic.Image = refImage;

        timerAuto.Enabled = true;
    }

    I'll cover the SpeechWrapper and try to add a demo movie in the next post...

    Enjoy!


    Bom, agora que voce ja' tem o lancador de misseis, a camera e consegue manipular os dois sem problemas (sera'???) ta' na hora de colocar tudo junto e transformar o projetinho em um poderoso sistema de seguranca :-).

    O objetivo final e' disparar contra qualquer intuso que se aventurar a desafiar nosso poderoso canhao, certo? Dai', tudo depende de conseguir detectar com sucesso quando alguem/algo e' captado pela camera.

    Vamos assumir nesse projeto que "movimento" seja a diferenca entre uma imagem de referencia e um instantaneo tirado da web cam. Quando a diferencao e' zero, nenhum movimento e' detectado. A comparacao das imagens leva em consideracao um efeito de tolerancia que pode ser controlado pela aplicacao - quanto menos tolerante a aplicacao , maior a probabilidade de detectar ruidos e mudancas de luz como movimento.

    O codigo foi escrito de forma a calcular a diferenca entre duas imagens levando em consideracao a tolerancia. O resultado vai para uma terceira imagem - preto indica que os pixels sao equivalentes, branco indica o contrario. Nas imagens acima da' para perceber que o computador enxerga tudo preto ate' que eu movo minha mao na frente da camera.

    Bom, agora que temos uma imagem com pixels brancos, temos que centralizar o canhao e disparar. A precisao do canhao e' minima, portanto "centralizar" e' forcacao de barra... Mas para efeito de demo, funciona. Entao, so' nos resta decidir para onde mover o treco. Vamos dividir a imagem em quatro quadrantes. Para cada quadrante, vamos calcular a quantidade de pixels brancos. O quadrante com mais pixels passa a ser o centro do alvo - ai e' so' mover e atira...

    O codigo esta' ai' em cima - MDMain.cs e' o modulo que implementa a classe que supporta os metodos que eu descrevi.

    No ultimo post dessa serie eu vou cobrir a class de sintese de fala (TTS) - SpeechWrapper - e vou tentar adicionar um filme com uma demo rapidinha.

    E e' so'...