In the case of GoogleTrans (Library github) in this post, it seems to be a wrapper around the Google Translator web translator.

I’m starting to wonder if I’ve had a confirmation bias. It’s free to use without requiring a login, has no usage limitations, and is ad-free.

Google Translate is a free translation service by Google that enables quick and easy translation of text between languages.

It utilizes Neural Machine Translation (NMT) to deliver natural and accurate results. The service is accessible via the web, mobile apps, and API.

Translator

Of course, for tasks requiring better sentence context or natural conversational tone, Google’s Cloud APIs offer higher quality.

However, since it’s charged based on sentence length, I only use it when quality improvement is essential.

For example, I use it when reading children’s books or drafting official documents.

Google Translator Code

from googletrans import Translator

def google_trans(str, target):
    translator = Translator()
    translation = translator.translate(str, dest=target)
    return translation.text

def google_trans_detect(str):
    translator = Translator()
    return translator.translate(str).src

if __name__ == "__main__":
    lang = google_trans_detect("この文章は日本語") #jo
    print(lang)
    lang = google_trans_detect("English") #en
    print(lang)
    lang = google_trans_detect("한글") #ko
    print(lang)
    lang = google_trans_detect("谢谢") #zh-CN
    print(lang)
    lang = google_trans("谢谢. 我学汉文", "en")
    print(lang)

Output

ja
en
ko
zh-CN
Thank you. I learn Chinese

I have a very positive opinion of Google as a company.

While I haven’t worked there as an employee, my perspective as a service user is highly favorable. I first used GCP for cloud services and Google’s Cloud API services, which left me with a more positive impression of them compared to other tech companies.

Recently, however, I’ve been using AWS for my company’s business needs, and it’s made me wonder: “Is GCP more developer-friendly, which is why I feel more comfortable with it?”

At the same time, I sometimes think AWS might be better suited for my business.

This realization makes me think I should also explore Azure or Alibaba Cloud. Perhaps I’ve had a confirmation bias all along.

By Mark

-_-

Leave a Reply

Your email address will not be published. Required fields are marked *