Sentiment Analysis Scanner
(Input and Output scanner)
Last updated
(Input and Output scanner)
Last updated
It scans and evaluates the overall sentiment of prompts from the NLTK (Natural Language Toolkit) library.
The Sentiment Analysis Scanner produces a sentiment score ranging from -1 to 1:
-1 represents a completely negative sentiment.
0 represents a neutral sentiment.
1 represents a completely positive sentiment.
By setting a predefined threshold, the scanner can be calibrated to flag any prompts falling below that threshold, indicating a potentially negative sentiment.
Sentiment Analysis Detection Policy for AI Chatbot
Create a new policy as same as shown in LLM Guardrails Policy, for Sentiment Analysis detection select scanner Sentiment Analysis(Sentiment: Negative).
Optionally, perform a test to ensure the policy is functioning as intended. Check that Sentiment Analysis is detected and blocked as specified.