Zeeshan24 commited on
Commit
c03ee81
·
verified ·
1 Parent(s): c104865

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -10
app.py CHANGED
@@ -10,15 +10,6 @@ import io
10
  # Load pre-trained model for question-answering
11
  qa_pipeline = pipeline("question-answering", model="distilbert-base-uncased-distilled-squad")
12
 
13
- # Extract text from PDF (text-based and image-based)
14
- def extract_text_from_pdf(pdf_path):
15
- with open(pdf_path, 'rb') as file:
16
- reader = PyPDF2.PdfReader(file)
17
- text = ''
18
- for page in reader.pages:
19
- text += page.extract_text()
20
- return text
21
-
22
  def extract_text_from_image_pdf(pdf_path):
23
  images = convert_from_path(pdf_path)
24
  text = ''
@@ -58,7 +49,7 @@ def extract_questions_from_text(text):
58
  questions = list(set(questions)) # Remove duplicates
59
  questions = [q for q in questions if not any(keyword in q.lower() for keyword in ['name', 'roll no', 'school'])]
60
 
61
- return questions
62
 
63
  # Streamlit Interface
64
  st.title('Student Answer Grading System')
 
10
  # Load pre-trained model for question-answering
11
  qa_pipeline = pipeline("question-answering", model="distilbert-base-uncased-distilled-squad")
12
 
 
 
 
 
 
 
 
 
 
13
  def extract_text_from_image_pdf(pdf_path):
14
  images = convert_from_path(pdf_path)
15
  text = ''
 
49
  questions = list(set(questions)) # Remove duplicates
50
  questions = [q for q in questions if not any(keyword in q.lower() for keyword in ['name', 'roll no', 'school'])]
51
 
52
+ return
53
 
54
  # Streamlit Interface
55
  st.title('Student Answer Grading System')