Model Pipeline - Content filtering
This pipeline filters text content to detect and block harmful or unwanted messages. It uses a model to classify text as safe or unsafe, helping keep conversations friendly and secure.
Jump into concepts and practice - no test required
This pipeline filters text content to detect and block harmful or unwanted messages. It uses a model to classify text as safe or unsafe, helping keep conversations friendly and secure.
Loss
0.7 |****
0.6 |***
0.5 |**
0.4 |*
0.3 |*
0.2 |
1 2 3 4 5 Epochs
| Epoch | Loss ↓ | Accuracy ↑ | Observation |
|---|---|---|---|
| 1 | 0.65 | 0.60 | Model starts learning, accuracy low |
| 2 | 0.48 | 0.75 | Loss decreases, accuracy improves |
| 3 | 0.35 | 0.85 | Model learns key patterns |
| 4 | 0.28 | 0.90 | Good convergence, stable accuracy |
| 5 | 0.25 | 0.92 | Final epoch, model ready |
in.bad_words = ['spam', 'scam'] text = 'This message contains spam and scam.' filtered = any(word in text for word in bad_words) print(filtered)
bad_words = ['bad', 'ugly']
text = 'This is a bad example.'
if bad_words in text:
print('Filtered')
else:
print('Clean')banned = ['bad', 'ugly'] and string msg = 'This is a bad and ugly day.'?