Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -3,7 +3,13 @@ from modules.parse_pdf import process_pdf
|
|
3 |
from modules.classify import classify_text_multi # Importing BERT model classification
|
4 |
from modules.RandomForest import classify_text_rf,classify_text_rf_multi #Importing single and multi-label classification
|
5 |
from modules.SVM import classify_text_svm,classify_text_svm_multi #Importing single and multi-label classification
|
|
|
6 |
|
|
|
|
|
|
|
|
|
|
|
7 |
# Function to process and classify PDF using both BERT and Random Forest models
|
8 |
def process_and_classify_pdf(file):
|
9 |
# Step 1: Process the PDF to extract and clean the text
|
|
|
3 |
from modules.classify import classify_text_multi # Importing BERT model classification
|
4 |
from modules.RandomForest import classify_text_rf,classify_text_rf_multi #Importing single and multi-label classification
|
5 |
from modules.SVM import classify_text_svm,classify_text_svm_multi #Importing single and multi-label classification
|
6 |
+
import nltk
|
7 |
|
8 |
+
# Check if the stopwords resource is available; if not, download it
|
9 |
+
try:
|
10 |
+
nltk.data.find('corpora/stopwords')
|
11 |
+
except LookupError:
|
12 |
+
nltk.download('stopwords')
|
13 |
# Function to process and classify PDF using both BERT and Random Forest models
|
14 |
def process_and_classify_pdf(file):
|
15 |
# Step 1: Process the PDF to extract and clean the text
|