Skip to content

Commit 5a2739f

Browse files
committed
Updated documentation
1 parent d6125b1 commit 5a2739f

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

README.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,9 @@ To train the models, run the following command:
6969
python3 spam_detector_ai/trainer.py
7070
```
7171

72+
:warning: **Warning**: A module not found error may occur :warning:
73+
If this happens, use an IDE to run the `trainer.py`file until a fix is implemented.
74+
7275
This will train all the models and save them as `.joblib` files in the models directory. For now, there is 3 models:
7376

7477
- `naive_bayes.pkl`
@@ -171,6 +174,10 @@ If you have trained the models on new data, you can test them by running the fol
171174
python test_and_tuning/test.py
172175
```
173176

177+
:warning: **Warning**: A module not found error may occur :warning:
178+
If this happens, use an IDE to run the `test.py`file until a fix is implemented.
179+
180+
174181
### Making Predictions
175182

176183
To use the spam detector in your Django project:
@@ -180,7 +187,7 @@ To use the spam detector in your Django project:
180187
3. Use the `is_spam` method to check if a message is spam.
181188

182189
```python
183-
from spam_detector_ai.prediction import VotingSpamDetector
190+
from spam_detector_ai.prediction.predict import VotingSpamDetector
184191

185192
# Create the spam detector
186193
spam_detector = VotingSpamDetector()
@@ -236,7 +243,8 @@ def check_website_contact_form(request):
236243
# Call the spam detection API
237244
response = requests.post(
238245
"https://spam-detection-api.adamspierredavid.com/v1/check-spam/",
239-
json={'message': message_with_subject} # Use json parameter instead of data
246+
json={'text': message_with_subject} # Use json parameter instead of data
247+
# You can also do `json={'message': message_with_subject}
240248
)
241249

242250
is_spam = False

0 commit comments

Comments
 (0)