File size: 916 Bytes
46fb916
 
 
9bcf001
 
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
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
  }
  Choice="MCQS"
  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")
interface.launch(debug=True)