bliako has asked for the wisdom of the Perl Monks concerning the following question:

I am experimenting enquiring https://translate.google.com with the same phrase when the browser is either launched via WWW::Mechanize::Chrome or not (i.e. as usual by "clicking on its icon").

I have observed that the greek phrase
"Πληθαίνουν και βαραίνουν τα ερωτήματα"
translates differently depending on how the browser was launched:

  1. via Mechanize and Chrome the translation is Are growing and heavy the questions -- which I consider dumb, compared to
  2. The questions are multiplying and burdening yielded in the same way but when the browser (chrome or firefox) was launched "normally".

The second translation is produced with Firefox and Chrome, with or without uBlock. The reference to uBlock is because I thought that that was the decisive factor before I realised it was the way the browser is launched (Hence my delirious rumblings at the CB some minutes ago ...).

If some Monks want to experiment:

use Log::Log4perl qw(:easy); use WWW::Mechanize::Chrome; Log::Log4perl->easy_init($ERROR); my $mech = WWW::Mechanize::Chrome->new( headless => 0, launch_arg => [] ); sleep(1000);

Any ideas what this mystery (to me) is all about?

bw, bliako

12h EDIT:

Here is one English phrase (from https://www.gutenberg.org/cache/epub/35461/pg35461.txt) translated from google-translate with two mechs: Perl-chrome and Python-firefox to two languages: Greek and German:

"They were a very vocal people. They enlivened their wanderings by feasts, at which there was much drunkenness and at which a special sort of man, the bards, would sing and recite."

  1. The Greek translation with google-mech-perl yields:
    "Ήταν ένας πολύ φωνητικός λαός. Ζήτησαν την περιπλανώμενη τους από τις γιορτές, στις οποίες υπήρχε πολύ μεθυστικότητα και στην οποία θα τραγουδούσαν και θα απαγγέλλουν ένα ειδικό είδος ανθρώπου, οι bards."
    Exactly the same translation with firefox-mech-python. But properly-launched Firefox yields
    "Ήταν πολύ φωνητικός λαός. Ζωντανεύουν τις περιπλανήσεις τους με γλέντια, στα οποία υπήρχε πολύ μέθη και στα οποία ένα ιδιαίτερο είδος ανθρώπου, οι βάρδοι, τραγουδούσε και απήγγειλε."
    Which is much more correct. Firstly, the word "bards" translates correctly to "βάρδοι" (this is left un-translated in both mech cases). Also the tense of the last two verbs is wrong in the mech cases and additionally the two verbs are in slightly different tense (difference between will recite and would recite. Also, the proper Firefox translates these two verbs correctly in singular form because it detects that the singers was the "special sort of man" (singular) and not "bards" (plural). Anyway, I am not expert on grammar/syntax of any language but the mech translations "sound" weird to my ears. The bottom line is that both mech cases yield "weird-sounding" translations, haphazard I would say, whereas the properly-launched firefox (and chrome) yield a much better-sounding translation.
  2. The same text to German:
    "Sie waren ein sehr lautstarker Volk. Sie belebten ihre Wanderungen durch Feste, bei denen es viel Trunkenheit gab und zu denen eine besondere Art von Mann, die Barden, singen und rezitieren würde."
    from both mech. Proper Firefox yields:
    "Sie waren ein sehr lautstarkes Volk. Sie belebten ihre Wanderungen durch Feste, bei denen viel getrunken wurde und bei denen eine besondere Art von Menschen, die Barden, sang und rezitierte."
    Zero German understanding from me, so I can not comment.

    It has already been asked 6 years ago to the VerbalOverflow website without any answer yet: https://stackoverflow.com/questions/43585256/why-is-google-translate-api-giving-me-different-results-on-certain-machines

Replies are listed 'Best First'.
Re: Google translate dumbs down when browser launched via Mechanize
by LanX (Saint) on Nov 24, 2023 at 02:43 UTC
    Can you reproduce this with other phrases, possibly from other languages?

    I speculate it's related to different (language?) settings in different browser profiles.

    Or Google is takes countermeasures for bypassing its API.

    But such guesses are best proven with a larger set of examples.

    Cheers Rolf
    (addicted to the Perl Programming Language :)
    see Wikisyntax for the Monastery

      Thanks. I will try with other phrases. But I rarely use chrome so my settings are probably vanilla. Also I do not save any profile to cloud, do not use any google account etc.

      I have added to my main post the results from translating an english text to Greek and German via mech-perl-chrome, mech-python-firefox (same results) and "properly-launched" firefox.

Re: Google translate dumbs down when browser launched via Mechanize
by LanX (Saint) on Nov 24, 2023 at 12:13 UTC
    The first German version has grammatical issues, similar to yours and seems too much one-to-one.

    My guess is that Google is detecting mech and deliberately returning worse results.

    You may wanna try to include some human pauses and mouse movements.

    There must also be an official API, right? ;)

    Cheers Rolf
    (addicted to the Perl Programming Language :)
    see Wikisyntax for the Monastery

      Probably OT but what are you planning to do with H.G. Wells?

      BTW, the original:

      “They were a very vocal people. They enlivened their wanderings by feasts, at which there was much drunkenness and at which a special sort of man, the bards, would sing and recite.”

      And the translation from DeepL 2.13:

      “Sie waren ein sehr gesprächiges Volk. Sie belebten ihre Wanderungen mit Festen, bei denen viel getrunken wurde und bei denen eine besondere Sorte von Menschen, die Barden, sangen und rezitierten.”

      That sounds natural to me.

      To Greek:

      ” Ήταν ένας πολύ ομιλητικός λαός. Ζωντάνευαν την περιπλάνησή τους με γιορτές, στις οποίες γινόταν μεγάλη μέθη και στις οποίες ένα ιδιαίτερο είδος ανθρώπων, οι βάρδοι, τραγουδούσαν και απήγγειλαν.”

      «The Crux of the Biscuit is the Apostrophe»

        what are you planning to do with H.G. Wells?

        Going back in time!

        οι βάρδοι, τραγουδούσαν και απήγγειλαν. (the "bards were singing and reciting poetry) This makes the mistake that the verbs must be in singular because they refer to ιδιαίτερο είδος ανθρώπων (a particular kind of men) which in greek, pedantically, would be that *it* sang and recited. But apart from this, DeepL's sounds more natural to me. Albeit, it does not have a certain language I am interested in.

        For those interested there is also this https://www.online-translator.com and this https://www.translator.eu/ which yield the same result, most likely frontends to the same backend

      There must also be an official API, right? ;)

      there is and yada yada yada :)