I made an AI that can study for me.

So, there are loads of time when I have a big amount of text and I now it has the data that I need but way too lazy to read through it to…

I made an AI that can study for me.

So, there are loads of time when I have a big amount of text and I now it has the data that I need but way too lazy to read through it to find the thing I need. So, one day I thought what if I made an AI that can study the content for me and answer the questions I directly ask it and here we are.

So, after some research I decided to use the the roBERTa model for the job. It is a a pre trained model made using MLM( Masked Language Modeling ) on the english language. Which basically means that it is and AI that can find keywords in a large amount of text and then recognise it based on the question that is given.

Lets get started with the code.

First lets make a requirements.txt file:

Now for the colab notebook download PyTorch:

Now install transformers:

Now start loading the model by importing roberta model dependencies:

Make a Q/A Pipeline:

Make contextual text corpus data:

Make a question set:

Now run the question set on the AI:

Print the answer:

And with that the code is done.

So, I made this into an app so that you guys can use it. Here is the code for it.

Here is the app:

Do try it.

Lets see some outputs:

Dyam I didn't know that

So, as you can see the results are coming very accurate. Go try it yourself!!

If you liked this article a follow on medium helps me alot.

For The Code Go Here:

For my day to day AIML updates follow me on twitter:

Thanks for reading 😁, See you guys next week 👋🏼.