如何检查社区是否使用Python中的googletrans模块检查翻译?
我正在尝试使用如何检查社区是否使用Python中的googletrans模块检查翻译?,python,Python,我正在尝试使用googletransPython模块翻译一些单词。它翻译的话,但我需要检查,如果谷歌翻译社区检查翻译。我怎么做? 我尝试过使用这段代码,但置信度属性值始终为1.0,尽管第一个短语由社区检查,第二个短语则不是: from googletrans import Translator translator = Translator() # initialize the Translator # translate two phrases from English to Ukrai
googletrans
Python模块翻译一些单词。它翻译的话,但我需要检查,如果谷歌翻译社区检查翻译。我怎么做?我尝试过使用这段代码,但置信度属性值始终为1.0,尽管第一个短语由社区检查,第二个短语则不是:
from googletrans import Translator
translator = Translator() # initialize the Translator
# translate two phrases from English to Ukrainian
translation1 = translator.translate("to be", "uk")
translation2 = translator.translate("I'm fond of programming", "uk")
# print the result and if it is already checked by community
print(translation1.text, translation1.extra_data["confidence"])
print(translation2.text, translation2.extra_data["confidence"])
# It prints:
# бути 1.0
# Я захоплююся програмуванням 1.0
我不是100%确定,但在表示社区检查状态的额外数据中,“translation”数组中似乎有一个标志
from googletrans import Translator
translator = Translator() # initialize the Translator
# translate two phrases from English to Ukrainian
translation1 = translator.translate("to be", "uk")
translation2 = translator.translate("I'm fond of programming", "uk")
# print the result and if it is already checked by community
print(translation1.text, translation1.extra_data["translation"][0][4])
print(translation2.text, translation2.extra_data["translation"][0][4])
# Output
# бути 1
# Я захоплююся програмуванням 0
我不是100%确定,但在表示社区已检查状态的额外数据中,“translation”数组中似乎有一个标志
from googletrans import Translator
translator = Translator() # initialize the Translator
# translate two phrases from English to Ukrainian
translation1 = translator.translate("to be", "uk")
translation2 = translator.translate("I'm fond of programming", "uk")
# print the result and if it is already checked by community
print(translation1.text, translation1.extra_data["translation"][0][4])
print(translation2.text, translation2.extra_data["translation"][0][4])
# Output
# бути 1
# Я захоплююся програмуванням 0