Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inconsistency with web result #35

Open
haofanwang opened this issue Mar 17, 2021 · 7 comments
Open

Inconsistency with web result #35

haofanwang opened this issue Mar 17, 2021 · 7 comments

Comments

@haofanwang
Copy link

I found the result from ts.google() is different from the website (https://translate.google.com/), why this happen?

@UlionTse
Copy link
Owner

UlionTse commented Mar 17, 2021 via email

@haofanwang
Copy link
Author

@UlionTse Thanks for the reply. Below is the code I called the method

novel_sentenses = ['在一次做小白鼠的实验中'] 
for sent in novel_sentenses:
    print(ts.google(sent, if_use_cn_host=True))

The result is "In the experiment of a small mouse", but on the website, the translated result is "In an experiment with mice".

@ObedH26
Copy link

ObedH26 commented Mar 19, 2021

I have the same thing and im curious what is happening,i know translators car work weirdos i use a lot google trad.

My code generate all possibility of a word and translate all :
Here for the word fox in french :
Syntaxe of explanation :
Word-given:word-returned(google website translate of word-given).
Dont change mean the word given is same as what google trad site find about

Renard(FOX):
Radrne : radné (dont change)
Rderna : RDDE (dont change
EdrRan : MADRA (cédran)
Dnearr : dnarr (dont change)
Nderar : nda (dont change)
Enardr : celui qui racommode(le centre)
Edarnr : firener(adner )
Neadrr : norrr (dont change)

@UlionTse
Copy link
Owner

UlionTse commented Mar 21, 2021

@haofanwang Sorry for the late reply. It is confirmed that some of the request parameters (seemingly unnecessary) are missing, which results in inconsistency with the results returned by the webpage. At present, I tested it after adding parameters on the weekend, and the return has not changed, so it will take some time.

@haofanwang
Copy link
Author

Any update? @UlionTse

@UlionTse
Copy link
Owner

UlionTse commented Mar 30, 2021

@haofanwang Hi, friend
There is no update at present, because the root of the problem has not been found yet. I suggest you use ts.bing() or ts.sogou() instead of ts.google() first. If there is a new update, I will notify you as soon as possible.

@GokulNC
Copy link

GokulNC commented Apr 2, 2021

It seems Google does a lot of verification to ensure the translation request is from the browser by real human.
I guess it would be difficult to crack it to get the actual high quality translations.
Until then, this API would return only intermediate quality translations.

The request headers to batchexecute have things like this which might help them verify:

x-client-data: CIm2yQEIpLbJAQjBtskBCKmdygEIibnKAQj4x8oBCK2UywEIsZrLAQjknMsBCKmdywEY4JrLAQ==
Decoded:
message ClientVariations {
  // Active client experiment variation IDs.
  repeated int32 variation_id = [3300105, 3300132, 3300161, 3313321, 3316873, 3318776, 3328557, 3329329, 3329636, 3329705];
  // Active client experiment variation IDs that trigger server-side behavior.
  repeated int32 trigger_variation_id = [3329376];
}
x-goog-batchexecute-bgr: ["!0NOl057NAAY7smA8O7JCjEl6w44Y3sc7ACkAIwj8RodHJkY6L0wA2rSDjXofVKKwkRB1SNCmjxIJiT7bjJsBIh_dSwIAAALtUgAAABdoAQcKAPmrXXgFz97-Y2Q3gUxYqhk_Btybpi7hZ8_8FqlhD1-CXDlCVmaD1cmOddiv3SxvQLykXjAsQHWkTlnldF5tECSnOA1TjyjCFkzZ1ZGCTaxj6MYXWq4RX-nHRI499eE4MJSDjVZ6Co4R-_fpw_w7RYri5YX5jYD8WN5P6JjjxRd2YkCpRe0dY70xCYy_ixdaSrKf8BLeyasMU-wAcaapd1y1BOpDvvf8RppRZaraCrGpqZsfAWUYhdddcfBCi3nfuL9ItnHekMve2wn9HGx03PSklg_zwBrGnBxoGRjAcQNHANzX-AlVTZx4jMyZFfU4Sipuyw68XCJsKoGZAdJf28UdCoTsfGylKZmfuSB0E-nIj83vE-Xmlhn5nGYrhROX-o_td58o6F2anPc5dJHEiQ9M2ouu2G26CSbRWW-jwMrEZxw79wkHq-HxgSq84MgsoslBfP26kxhs1ozyPwXHbSmYwGnuNkArO7NWAZhB0IAB4_CTsdODSRmJGVKKyq9AunNwWjY-DwR-unI5QbUuRTOPDToZbVLnLgb1hM-uD58hkd_1fuhCGODI_gRKaiJFykVqiRqJr8cFz1PVyA4EyClhVE0AYVx3VpBWQhkzuMnG5-bw53W8PIjXtMpKjdOW8eABSxx1ua2cQUs8U9azhmGB2uowVehALA13djy_WUtN7yOniT0DaxumGyQQsIW3Ywjxx3zSBY5leHywLBsf3rfn8WXdDhXyiEzk_DmFuLtyDmo9KNeuJkKD9cIiaGWFs_AZjCLdtKD2BBs0giNm1KW7d4ZHBpD01YFdvXQo5udgW7fVXeuDb9wuYIp_uapnPcE3mhsXVPR5JGe1RnfXGGarR2MPmWPwwDpGcOoLu4GFQtnCZoaC_4bwTxxlL6NtA6ug5Oj_BlUpMdvlcZIU4Z5YZb3CXiLRYaKqFBIA2p73fndYpzMQfXK0PoNnYPUd",null,null,2100,146,null,null,0]

Not sure where these are coming from. Could have been from some handshakes while loading the translate.google.cn page itself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants