File size: 417 Bytes
1e11eed
58ad313
 
1e11eed
7f5cbec
 
 
 
 
 
58ad313
1e11eed
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import fitz  # PyMuPDF
import json

def read_pdf(file):
    pdf_document = fitz.open(stream=file.read(), filetype="pdf")
    text = ""
    for page_num in range(pdf_document.page_count):
        page = pdf_document.load_page(page_num)
        text += page.get_text()
    return text

def get_table_data():
    with open("response.json", "r") as file:
        data = json.load(file)
    return data["question_format"]