Git Product home page Git Product logo

Comments (6)

zhiyu-01 avatar zhiyu-01 commented on June 12, 2024 1

I just tried it, it looks good.

from camel.

HalberdOfPineapple avatar HalberdOfPineapple commented on June 12, 2024

@lightaime @zhiyu-01 Could you have a check on this?

from camel.

zhiyu-01 avatar zhiyu-01 commented on June 12, 2024

@lightaime @zhiyu-01 Could you have a check on this?

It may be caused by its default arguments: redirect=True, which redirect "KAUST" to "KAIST" and "KAIST" to "GIST". When I set
redirect=False, it deals "KAIST" correctly, but search "KAUST" returns an error:
An error occurred:
"KAUST" resulted in a redirect. Set the redirect property to True to allow automatic redirects.
I will remove the function "search_wiki_by_api" and try to fix it.

from camel.

HalberdOfPineapple avatar HalberdOfPineapple commented on June 12, 2024

@lightaime @zhiyu-01 Could you have a check on this?

It may be caused by its default arguments: redirect=True, which redirect "KAUST" to "KAIST" and "KAIST" to "GIST". When I set redirect=False, it deals "KAIST" correctly, but search "KAUST" returns an error: An error occurred: "KAUST" resulted in a redirect. Set the redirect property to True to allow automatic redirects. I will remove the function "search_wiki_by_api" and try to fix it.

Thanks for your reply. I just found the reason should lie in auto_suggest as said in https://stackoverflow.com/questions/66630711/the-wikipedia-api-seems-to-almost-always-get-the-word-in-question-wrong. I have modified a version and will push to a new branch soon.

from camel.

zhiyu-01 avatar zhiyu-01 commented on June 12, 2024

@lightaime @zhiyu-01 Could you have a check on this?

It may be caused by its default arguments: redirect=True, which redirect "KAUST" to "KAIST" and "KAIST" to "GIST". When I set redirect=False, it deals "KAIST" correctly, but search "KAUST" returns an error: An error occurred: "KAUST" resulted in a redirect. Set the redirect property to True to allow automatic redirects. I will remove the function "search_wiki_by_api" and try to fix it.

Thanks for your reply. The reason should lie in auto_suggest as said in https://stackoverflow.com/questions/66630711/the-wikipedia-api-seems-to-almost-always-get-the-word-in-question-wrong. I have modified a version and will push to a new branch soon.
This is my new code:
result = wikipedia.search(entity)
print(result)
result = wikipedia.summary(result[0], sentences=5, redirect=False, auto_suggest=False)
The result is:
['King Abdullah University of Science and Technology', 'Shaheen (supercomputer)', 'Thuwal', 'Saudi Arabia', 'Nadhmi Al-Nasr', 'Marc G. Genton', 'Jürgen Schmidhuber', 'Lubna Olayan', 'Amin H. Nasser', 'Koch snowflake']

King Abdullah University of Science and Technology (KAUST; Arabic: جامعة الملك عبد الله للعلوم و التقنية jāmiʿat al-malik ʿabd al-Lāh li-l-ʿulūm wa-t-teqniyya) is a public research university located in Thuwal, Saudi Arabia. Founded in 2009, the university provides research and graduate training programs in English as the official language of instruction.
KAUST is the first mixed-gender university campus in Saudi Arabia. In 2013, the university was among the 500 fastest growing research and citation records in the world. In the 2016 Nature Index Rising Stars, the university ranked 19th in the world of the fastest rising universities for high quality research output.

Maybe you want take consider of the wikipedia.search() function, it will give a list contains what wikipedia can get.

from camel.

HalberdOfPineapple avatar HalberdOfPineapple commented on June 12, 2024

Maybe you want take consider of the wikipedia.search() function, it will give a list contains what wikipedia can get.

True I have considered this. But it is a bit of tedious to iterate through the list. Actually the redirect can be kept True to solve the ambiguity redirection. The original problem lies in auto_suggest can directly change the search word (such as KAUST -> KAIST)

from camel.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.