Ban Topics
Block entire topics in LLM outputs. Control model focus and enforce safety policies.
Model
Description
evaluator.add_test(
test_names=["ban_topics_guardrail"],
data={
"prompt": """Craft a poem that captures the breathtaking beauty and serenity of this underwater world.
Describe the gentle swaying of the coral, the playful dance of the fish, and the mesmerising underwater soundscape.
Use vivid imagery and metaphors to evoke a sense of awe and wonder for this natural treasure.""",
},
arguments={"topics": ["airplanes"], "threshold": 0.5, "model": "MoritzLaurer/deberta-v3-large-zeroshot-v1.1-all-33"},
).run()
evaluator.print_results()
Result = No banned topics found in the prompt.Last updated
Was this helpful?

