46 Downloads Updated 1 year ago
ollama run harishkumar56278/TextContentModerator:7b
Updated 1 year ago
1 year ago
092c2367326a · 4.1GB ·
This repository contains a Cybersecurity Content Moderation AI model designed for text-based content analysis. The model detects and classifies harmful or inappropriate text using Ollama.
wizardlm2The model classifies text into the following categories:
If no harmful content is detected, the text is classified as Safe.
FROM wizardlm2
# Set model parameters
PARAMETER temperature 0.2
PARAMETER num_ctx 4096
PARAMETER top_p 0.8
PARAMETER repeat_penalty 1.2
#Adapter
create an custom datas in gpt format
{
"conversations": [
{
"role": "system",
"content": "You are a content moderation assistant. Detect and classify harmful messages."
},
{
"role": "user",
"content": "Moderate and classify this message:\n\n\"' Waaaaittt niggah holllll'up ✋ these niggahs come to town start wife'n my old sluts 𐐤𐐤𐐤𐐪𐐪 .\""
},
{
"role": "assistant",
"content": "⚠️ Offensive Language"
}
]
}
The model is configured to strictly analyze and classify text. It does not engage in discussions, explanations, or opinions.
{
"error": "Invalid format. Provide content in quotes: \"Your text here\"."
}
{
"classification": {
"hate_speech": {
"confidence_score": 0.85,
"justification": "Detected racial slurs targeting a community - 'nigga'"
},
"threats": {
"confidence_score": 0.92,
"justification": "Direct threat of violence detected - explaining why it was flagged."
}
},
"max_confidence_category": "threats",
"final_verdict": "Harmful Content",
"safe_content": false
}
{
"classification": {},
"max_confidence_category": null,
"final_verdict": "Not Harmful Content",
"safe_content": true
}
To load the model into Ollama, ensure you have ollama installed and run:
ollama create text_moderation -f <path_to_model_file>
To use the model for moderation:
ollama run text_moderation "Your text here"
< Harish Kumar S , Email: harishkumar56278@gmail.com, Site: harish-nika.github.io >