Spaces:
Sleeping
Sleeping
app.py
CHANGED
|
@@ -34,7 +34,7 @@ model_cache = {}
|
|
| 34 |
# Clean text: remove special characters and stop words
|
| 35 |
def clean_text(input_text):
|
| 36 |
cleaned = re.sub(r"[^A-Za-z0-9\s]", " ", input_text)
|
| 37 |
-
cleaned = re.sub(r"\b[A-Za-z]{2,}[0-9]{3,}\b", "",
|
| 38 |
|
| 39 |
words = cleaned.split()
|
| 40 |
words = [word for word in words if word.lower() not in stop_words]
|
|
|
|
| 34 |
# Clean text: remove special characters and stop words
|
| 35 |
def clean_text(input_text):
|
| 36 |
cleaned = re.sub(r"[^A-Za-z0-9\s]", " ", input_text)
|
| 37 |
+
cleaned = re.sub(r"\b[A-Za-z]{2,}[0-9]{3,}\b", "", cleaned) # SKU/product code pattern (letters followed by numbers)
|
| 38 |
|
| 39 |
words = cleaned.split()
|
| 40 |
words = [word for word in words if word.lower() not in stop_words]
|