How rasa bot searching in a website for user query?

hey how a rasa chatbot search in a website for user query and sends response back to user in chat widget


example
user website like :www.abced.com
user: hi
bot: hi
user: what is machine learning?
bot:??
how the bot open the website and search for the user query ?
please help me…

Hi @Ajay-007, this isn’t something that Rasa Open Source can do natively. It’s something you would have to define with the help of custom actions

Can you explain in detailed with example @akelad how the bot open the mentioned website and to search for user query and how to send back the result

Hi @Ajay-007 as I said, this isn’t something specific to Rasa Open Source as a framework. You can use packages like beautifulsoup to do this, a small example of that can be found here: rasa-demo/community_events.py at master · RasaHQ/rasa-demo · GitHub

Hi @akelad the link you have given is not working. I want to retrieve some information from another website. Can you give me some demo link on how to proceed? I have used beautiful soup and retrieved the data but i dont know how to show the results in rasa bot. Thanks in advance

The file has moved here

Thanks @akelad

Hello Sube, I’m wondering what you ended up using, I’m kinda trying to do the same thing.

So I’m a little late to the party here but basically I made a custom out_of_scope intent to search an answer on the web (I’m using Google in this example but Bing, DuckDuckGo and Ask are already implemented).


-> search the web

What would you like to search?

-> When did Albert Einstein died?

Searching Google for when did albert einstein died?

18. april 1955

-> Who was Albert Einstein's mother?

Looking up who was albert einstein's mother using Google.

Pauline einstein

-> How far is the moon?

Google: how far is the moon?

238,855 miles

-> How tall is Joe Biden?

Ok Google; how tall is joe biden?

5 feet, 11.65 inches

-> Is Britney Spears in jail?

Google, is britney spears in jail?

Britney spears is not in jail

-> Where is Switzerland?

Using Google to find where is switzerland?

West-central europe

-> How tall is mount everest?

Google, how tall is mount everest?

8,848 metres

->

I’m using hanapin to search the web, trafilatura to extract the content of the website and deepset/roberta-base-squad2 to find the exact answer inside the content of the first result’s page.

It’s not perfect (specially on it’s own) but it’s remarkable what it can answer already.

You can find the source code in my repo for NLU data under Web Search.

Hope this can help anyone ^^.

2 Likes