File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,8 @@ Spam-Detector-AI is a Python package for detecting and filtering spam messages u
12
12
package integrates with Django or any other project that uses python and offers three different classifiers: Naive
13
13
Bayes, Random Forest, and Support Vector Machine (SVM).
14
14
15
+ :warning : ** Warning** : No significant breaking changes were added to the version 2.x.x in terms of usage. :warning :
16
+
15
17
## Table of Contents
16
18
17
19
- [ Installation] ( #installation )
@@ -217,7 +219,7 @@ The API is built with Django, and the following is an example of how I use it in
217
219
218
220
![ Screenshot] ( ./screenshots/spam-detection-api-example.png )
219
221
220
- The code:
222
+ The code:
221
223
222
224
``` python
223
225
import requests
@@ -236,15 +238,15 @@ def check_website_contact_form(request):
236
238
" https://spam-detection-api.adamspierredavid.com/v1/check-spam/" ,
237
239
json = {' message' : message_with_subject} # Use json parameter instead of data
238
240
)
239
-
241
+
240
242
is_spam = False
241
-
243
+
242
244
# Check if the API request was successful
243
245
if response.status_code == 200 :
244
246
# Parse the JSON response
245
247
json_response = response.json()
246
248
is_spam = json_response.get(' is_spam' )
247
-
249
+
248
250
if is_spam:
249
251
# Do something
250
252
pass
You can’t perform that action at this time.
0 commit comments