Rename classifiers/ package to models/

Aligns module naming with the upcoming classification_neural lab,
which will use the same models/ package convention.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Chris Proctor
2026-06-08 10:57:25 -04:00
parent 4a3e35a989
commit 61eb5a150c
7 changed files with 9 additions and 9 deletions

41
models/cleaning.py Normal file
View File

@@ -0,0 +1,41 @@
import re
import numpy as np
STOPWORDS = {
"a", "an", "the", "is", "it", "in", "on", "at", "to", "for",
"of", "and", "or", "but", "not", "with", "as", "by", "from",
"this", "that", "was", "are", "be", "been", "have", "has",
"had", "do", "did", "will", "would", "could", "should",
"i", "me", "my", "you", "your", "he", "she", "we", "they",
"his", "her", "our", "their", "its", "what", "which",
}
class LowercaseTransformer:
def fit(self, X, y=None):
return self
def transform(self, X):
return np.array([msg.lower() for msg in X])
class StopwordRemover:
def fit(self, X, y=None):
return self
def transform(self, X):
return np.array([self._remove(msg) for msg in X])
def _remove(self, message):
words = message.split()
return " ".join(w for w in words if w.lower() not in STOPWORDS)
class PunctuationRemover:
def fit(self, X, y=None):
return self
def transform(self, X):
return np.array([re.sub(r"[^\w\s]", " ", msg) for msg in X])