Spaces:
Sleeping
Sleeping
Update app.py
Browse filesremoved store_document call in extract_text_from_pdf
app.py
CHANGED
@@ -34,7 +34,6 @@ def store_document_data(PDF_FILE, METADATA_FILE, INDEX_FILE):
|
|
34 |
|
35 |
if PDF_FILE:
|
36 |
# Extract text from the PDF
|
37 |
-
print(PDF_FILE)
|
38 |
text = extract_text_from_pdf(PDF_FILE)
|
39 |
if not text:
|
40 |
return "Could not extract any text from the PDF."
|
@@ -106,7 +105,6 @@ def extract_text_from_pdf(pdf_file):
|
|
106 |
try:
|
107 |
with pdfplumber.open(pdf_file) as pdf:
|
108 |
text = " ".join(clean_text(text) for page in pdf.pages if (text := page.extract_text()))
|
109 |
-
store_document(text)
|
110 |
return text
|
111 |
except Exception as e:
|
112 |
print(f"Error extracting text: {e}{pdf_file}")
|
|
|
34 |
|
35 |
if PDF_FILE:
|
36 |
# Extract text from the PDF
|
|
|
37 |
text = extract_text_from_pdf(PDF_FILE)
|
38 |
if not text:
|
39 |
return "Could not extract any text from the PDF."
|
|
|
105 |
try:
|
106 |
with pdfplumber.open(pdf_file) as pdf:
|
107 |
text = " ".join(clean_text(text) for page in pdf.pages if (text := page.extract_text()))
|
|
|
108 |
return text
|
109 |
except Exception as e:
|
110 |
print(f"Error extracting text: {e}{pdf_file}")
|