Git Product home page Git Product logo

Comments (11)

ZhymabekRoman avatar ZhymabekRoman commented on May 27, 2024

That's strange, have you tried the same in the mobile application Yandex Translate? translatepy uses Android backend API.

from translate.

benjieperez avatar benjieperez commented on May 27, 2024

Yeah, I try the Yandex Translate using translatepy directly and it outputs the 'Und so sicher werden wir das Land erreichen, das alle Filipinos verdienen. Gott segne die Philippinen, Gott segne unsere Arbeit. Marschieren, marschieren salamat po sa inyong lahat!'. Different to the Yandex Translate on Browser.

It only occurs if the string is multilingual.

from translate.

benjieperez avatar benjieperez commented on May 27, 2024

I used a different user agent in yandex.py and it actually give me the right translation.

image
image

from translate.

benjieperez avatar benjieperez commented on May 27, 2024

Maybe a user agent randomizer will fix on this?

from translate.

ZhymabekRoman avatar ZhymabekRoman commented on May 27, 2024

Maybe a user agent randomizer will fix on this?

Hmmm, I think yes, we can fix it.

@Animenosekai, Can we rewrite the current user agent generation algorithm with a random user agent data information combination (OS, browser, version and etc.) instead of just getting a random user agent string in useragents?

from translate.

benjieperez avatar benjieperez commented on May 27, 2024

I have this simple user agent randomizer.

f'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.{random.randint(0, 9999)} Safari/537.{random.randint(0, 99)}'

Let me know if this would help, Thanks!

from translate.

Animenosekai avatar Animenosekai commented on May 27, 2024

woooow why didn't I get this notification sooner...

@Animenosekai, Can we rewrite the current user agent generation algorithm with a random user agent data information combination (OS, browser, version and etc.) instead of just getting a random user agent string in useragents?

Yup, this seems totally doable !

I don't have much time now, but whenever I get the time to 🍡

from translate.

ZhymabekRoman avatar ZhymabekRoman commented on May 27, 2024

So I did some research and came up with some interesting results. Original text: And as surely as that, we will achieve the country all Filipinos deserve. God bless the Philippines, God bless our work. Maraming, maraming salamat po sa inyong lahat! is in Tagalog. Translatepy recognises it as English. And the web version of Yandex Translate also detects it as English in the first lookup. In a second lookup Yandex web partially performs text language detection, in our case it's sending salamat po sa inyong lahat! to detect language, and it's returned as Tagalog. User-agent there is no common sense.

from translate.

Animenosekai avatar Animenosekai commented on May 27, 2024

So I did some research and came up with some interesting results. Original text: And as surely as that, we will achieve the country all Filipinos deserve. God bless the Philippines, God bless our work. Maraming, maraming salamat po sa inyong lahat! is in Tagalog. Translatepy recognises it as English. And the web version of Yandex Translate also detects it as English in the first lookup. In a second lookup Yandex web partially performs text language detection, in our case it's sending salamat po sa inyong lahat! to detect language, and it's returned as Tagalog. User-agent there is no common sense.

So they have a 2-pass system for language detection where they check the language a second time ??

from translate.

ZhymabekRoman avatar ZhymabekRoman commented on May 27, 2024

So they have a 2-pass system for language detection where they check the language a second time ??

Yes, I just checked the Android application, it also correctly detects the language of the text as Tagalog.

from translate.

ZhymabekRoman avatar ZhymabekRoman commented on May 27, 2024

Today, Yandex incorrectly detects the language of text. So translatepy has nothing to do with it:
image

from translate.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.