Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/postgresql/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何检查社区是否使用Python中的googletrans模块检查翻译?_Python - Fatal编程技术网

如何检查社区是否使用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