File size: 1,308 Bytes
46fb916
 
 
9bcf001
 
46fb916
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
aad2e76
 
ce34226
aad2e76
46fb916
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
from fileCreator import GenerateSQDocument,GenerateParaphraseDocument,GenerateMCQSDocument
from main import predict_shortq,paraphrase,predict_mcq
import gradio as gr
import os



def QuizGenerator(data,Choice):
  text={
      "input_text":data
  }
  result={}
  path=""
  if(Choice=="MCQS"):
    result=predict_mcq(text)
    GenerateMCQSDocument(result)
    path="Document.docx"
  elif(Choice=="SQ"):
    result=predict_shortq(text)
    GenerateSQDocument(result)
    path="Document1.docx"
  elif(Choice=="PharaphraseQuestion"):
    result=paraphrase(text)
    GenerateParaphraseDocument(result)
    path="Document2.docx"
  return path

interface=gr.Interface(fn=QuizGenerator,
                       inputs=[gr.components.Textbox(label="Type The Data here.."),gr.components.Radio(['MCQS','SQ','PharaphraseQuestion'],type="value")],
                       outputs="file",
                      examples=[
                          ['Artificial intelligence is the science of making machines that can think like humans. It can do things that are considered "smart." AI technology can process large amounts of data in ways, unlike humans. The goal for AI is to be able to do things such as recognize patterns, make decisions, and judge like humans.','SQ'],
                      ])
interface.launch(debug=True)