Model Pipeline - Output filtering and safety checks
This pipeline shows how an AI agent filters and checks its outputs to keep responses safe and appropriate before sharing them.
Jump into concepts and practice - no test required
This pipeline shows how an AI agent filters and checks its outputs to keep responses safe and appropriate before sharing them.
Loss
0.5 |****
0.4 |****
0.3 |***
0.2 |**
0.1 |*
+---------
1 2 3 4 5 Epochs| Epoch | Loss ↓ | Accuracy ↑ | Observation |
|---|---|---|---|
| 1 | 0.45 | 0.70 | Initial training with basic filtering rules, moderate accuracy |
| 2 | 0.35 | 0.80 | Improved filtering model reduces false negatives |
| 3 | 0.28 | 0.87 | Safety checks integrated, accuracy and safety improved |
| 4 | 0.22 | 0.91 | Fine-tuning reduces false positives, better user experience |
| 5 | 0.18 | 0.94 | Model converges with high safety and filtering accuracy |
output = "Hello user!" banned_words = ["bad", "ugly"] filtered = any(word in output for word in banned_words) print(filtered)What will be the printed output?
output = "Safe text"
banned_words = ["bad", "ugly"]
for word in banned_words:
if output.index(word):
print("Banned word found")
break
What is the error and how to fix it?