我有一个人工智能助理项目,我想它在互联网上搜索。我想使用Google Quick Answer Box或DuckDuckGo即时回答API for Python。我看到了其他问题,但它们对我帮助不大。以下是我想要实现的一个示例:
问题:什么是长颈鹿
谷歌的答案是:
Duckgo的回答是:
如你所见,答案从
'The giraffe is an African artiodactyl mammal...'
如何使用Python获取此文本?(让我举个例子,“什么是长颈鹿”。我想用这个方法几乎所有的东西,比如“告诉我美国总统”等等。)
Tags:
您可以使用注释中建议的duckduckgo API,方法如下:
下面是一个使用python的示例:
输出:
相关问题 更多 >
编程相关推荐