Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -17,6 +17,8 @@ import numpy as np
|
|
17 |
# Needed for HF GPU access
|
18 |
import spaces
|
19 |
|
|
|
|
|
20 |
nltk.download('punkt')
|
21 |
|
22 |
# Import PyPDFLoader for PDF processing
|
@@ -398,7 +400,7 @@ def extract_text_with_py_pdf_loader(pdf_file_path, start_page=None, end_page=Non
|
|
398 |
sentences = sent_tokenize(cleaned_text)
|
399 |
for sentence in sentences:
|
400 |
sentence = sentence.strip()
|
401 |
-
if sentence:
|
402 |
sentence_data.append({
|
403 |
"Document": doc_name,
|
404 |
"Page": page_num,
|
@@ -432,7 +434,7 @@ def df_to_csv_bytes(df):
|
|
432 |
raise RuntimeError(f"Error during CSV conversion: {e}")
|
433 |
|
434 |
def launch_interface():
|
435 |
-
with gr.Blocks(title="SDG Document Analysis App") as demo:
|
436 |
|
437 |
# Title as a visible heading at the top of the page with an icon
|
438 |
gr.Markdown(
|
|
|
17 |
# Needed for HF GPU access
|
18 |
import spaces
|
19 |
|
20 |
+
from styles import custom_css # Importing custom CSS
|
21 |
+
|
22 |
nltk.download('punkt')
|
23 |
|
24 |
# Import PyPDFLoader for PDF processing
|
|
|
400 |
sentences = sent_tokenize(cleaned_text)
|
401 |
for sentence in sentences:
|
402 |
sentence = sentence.strip()
|
403 |
+
if sentence and len(sentence) > 70:
|
404 |
sentence_data.append({
|
405 |
"Document": doc_name,
|
406 |
"Page": page_num,
|
|
|
434 |
raise RuntimeError(f"Error during CSV conversion: {e}")
|
435 |
|
436 |
def launch_interface():
|
437 |
+
with gr.Blocks(title="SDG Document Analysis App", css=custom_css) as demo:
|
438 |
|
439 |
# Title as a visible heading at the top of the page with an icon
|
440 |
gr.Markdown(
|