我正在使用 wikipedia python 库 (https://pypi.org/project/wikipedia/),并且在大多数情况下,它似乎会自动更正我正在使用的术语或其他东西,因此它们经常是错误的。
例如,“frog”变为“food”,“crown”变为“cross”:
input: wikipedia.page("frog")
output: <WikipediaPage 'Food'>
input: wikipedia.summary("Frog")
output: 'Food is any substance consumed to provide nutritional support for an organism..."
input: wikipedia.page("crown")
output: <WikipediaPage 'Cross'>
当使用 wikipedia.search 时,它似乎提供了一个合适的列表,但我不知道如何在使用 .summary 等时利用它来获取正确的页面:
input: print(wikipedia.search("frog"))
output: ['Frog','FROG','The Princess and the Frog','Boiling frog','Frog legs','Frogger','The Scorpion and the Frog','Pepe the Frog','The Frog Prince','Common frog']