Skip to content

Commit

Permalink
Fixed word2vec vectorizer for SVM model
Browse files Browse the repository at this point in the history
  • Loading branch information
advaithsrao committed Nov 8, 2023
1 parent b6b06c2 commit 3e28e6e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions detector/modeler.py
Original file line number Diff line number Diff line change
Expand Up @@ -339,8 +339,8 @@ def train(
label = label.tolist()

# Vectorize the input texts
X = self.vectorizer.fit_transform(body)
y = np.array(label)
X = [self.vectorizer.fit_transform(doc) for doc in body]
y = label

# Train the SVM model
self.model.fit(X, y)
Expand All @@ -361,7 +361,7 @@ def predict(
body = body.tolist()

# Vectorize the input texts
X = self.vectorizer.transform(body)
X = [self.vectorizer.fit_transform(doc) for doc in body]

# Make predictions using the trained SVM model
predictions = self.model.predict(X)
Expand Down

0 comments on commit 3e28e6e

Please sign in to comment.