# Content Guard Content Guard is a CLI tool and Python library for detecting harmful or inappropriate text generated by AI models. It uses pre-trained NLP models to classify content into categories like hate speech, toxicity, or explicit material, helping developers filter problematic outputs effectively. ## Features - Detects harmful or inappropriate text using pre-trained NLP models. - Classifies content into categories such as hate speech, toxicity, or explicit material. - Outputs flagged content as JSON. ## Installation Install the required dependencies: ```bash pip install transformers pytest ``` ## Usage ### CLI To use Content Guard as a CLI tool: ```bash python content_guard.py --input --output ``` - `--input` or `-i`: Path to the input text file. - `--output` or `-o`: Path to save the flagged content as JSON. If not provided, the flagged content will be printed to the console. ### Python Library You can also use Content Guard as a Python library: ```python from content_guard import classify_text from transformers import pipeline classifier = pipeline('text-classification', model='unitary/toxic-bert') text = "This is a toxic comment." flagged = classify_text(text, classifier) print(flagged) ``` ## Testing To run the tests: ```bash pytest test_content_guard.py ``` ## License MIT License