intelliDoc is an API service built around a NLP model which generates questions for a given image which contains text, an image of a text book or an article. Makes use of Flask for the backend and a landing page which was coded by me while using the NLP model from Questgen.ai with minor changes and debugging to get it to work. As a proof of concept of utilization of this API service we also made a desktop app built around this API by my friend Anand.
Note: This was meant as a college project
python setup.py
wget https://github.com/explosion/sense2vec/releases/download/v1.0.0/s2v_reddit_2015_md.tar.gz
tar -xvf s2v_reddit_2015_md.tar.gz
python main.py
image.png
import requests
files = {'file': open('image.png','rb')}
r = requests.post("http://localhost:5000/api/v3?type=img&full=true", files=files)
print(r.json)
{
"mc_qs":{
"questions":[
{
"answer":"ddos attacks",
"context":"Learn about DoS and DDoS attacks.",
"extra_options":[
],
"id":1,
"options":[
"Ddos"
],
"options_algorithm":"sense2vec",
"question_statement":"What are the DoS and DDoS attacks?",
"question_type":"MCQ"
}
],
"statement":"& | Toots and Methods\nUsed in Cybercrime\n\nLearning Objectives\n\nAfter reading this chapter",
"time_taken":19.39649772644043
},
"short_qs":{
"questions":[
{
"Answer":"ddos attacks",
"Question":"What are the DoS and DDoS attacks?",
"context":"Learn about DoS and DDoS attacks.",
"id":1
}
],
"statement":"& | Toots and Methods\nUsed in Cybercrime\n\nLearning Objectives\n\nAfter reading this chapter"
},
"text":{
"input_text":"& | Toots and Methods\nUsed in Cybercrime\n\nLearning Objectives\n\nAfter reading this chapter",
"max_questions":10
}
}```