Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -16,9 +16,8 @@ nltk.download('wordnet', quiet=True)
|
|
| 16 |
nltk.download('punkt', quiet=True)
|
| 17 |
nltk.download('punkt_tab', quiet=True)
|
| 18 |
|
| 19 |
-
|
| 20 |
lemmatizer = WordNetLemmatizer()
|
| 21 |
-
# Preprocessing
|
| 22 |
def preprocess_text(text):
|
| 23 |
if not isinstance(text, str):
|
| 24 |
return ""
|
|
@@ -34,8 +33,6 @@ def preprocess_text(text):
|
|
| 34 |
|
| 35 |
|
| 36 |
|
| 37 |
-
|
| 38 |
-
|
| 39 |
# ====================== CLASSIFICATION FUNCTION ======================
|
| 40 |
classifier_model = "Ginidu2003/Distilbert-Base-News-classifier"
|
| 41 |
@torch.no_grad()
|
|
|
|
| 16 |
nltk.download('punkt', quiet=True)
|
| 17 |
nltk.download('punkt_tab', quiet=True)
|
| 18 |
|
|
|
|
| 19 |
lemmatizer = WordNetLemmatizer()
|
| 20 |
+
# ============= Preprocessing==============================
|
| 21 |
def preprocess_text(text):
|
| 22 |
if not isinstance(text, str):
|
| 23 |
return ""
|
|
|
|
| 33 |
|
| 34 |
|
| 35 |
|
|
|
|
|
|
|
| 36 |
# ====================== CLASSIFICATION FUNCTION ======================
|
| 37 |
classifier_model = "Ginidu2003/Distilbert-Base-News-classifier"
|
| 38 |
@torch.no_grad()
|