Spaces:
Sleeping
A newer version of the Streamlit SDK is available: 1.56.0
title: Free AI Detector (Public Models)
emoji: π€
colorFrom: blue
colorTo: purple
sdk: streamlit
sdk_version: 1.36.0
app_file: app.py
pinned: false
Free AI Detector (Public Models) π€
Analyze text to determine the likelihood of it being AI-generated or human-written using publicly available models.
This Streamlit application provides a user-friendly interface to detect AI-generated content using a combination of classification-based and perplexity-based models from the Hugging Face Transformers library.
β¨ Features
- Enhanced Classification-Based Detection: Utilizes advanced, fine-tuned models like
SuperAnnotate/ai-detectorwhich are trained on diverse AI-generated content from various LLMs (GPT, LLaMA, Anthropic, Mistral) and adversarial attacks for potentially higher accuracy. - Perplexity Analysis: Employs causal language models (e.g., GPT-2) to calculate the perplexity of the input text, offering an additional insight into its predictability (lower perplexity often indicates AI generation).
- Multiple Model Choices: Select from various public models for both classification and perplexity analysis in the sidebar.
- Clear & Intuitive UI: Built with Streamlit for a simple, interactive web interface, featuring a modern design with custom fonts, rounded corners, and a consistent color scheme.
- Real-time Results: Get instant feedback on your text analysis with visual progress bars.
π How to Use
- Paste your text: Enter the text you want to analyze into the provided text area.
- Select Models (Optional): Choose your preferred classification and perplexity models from the sidebar. The "SuperAnnotate AI Detector" is recommended for its enhanced accuracy.
- Click "Detect AI": The application will process your text and display the results, including AI/Human probabilities and a perplexity score.
π‘ How It Works
This tool leverages the power of Hugging Face Transformers to implement two primary AI content detection methods:
Classification-based Models: These models are specifically trained on datasets containing both human-written and AI-generated text. They learn to identify subtle patterns and stylistic differences, outputting a probability score indicating the likelihood of the text being AI or human. The
SuperAnnotate/ai-detectormodel, for instance, is trained on a diverse range of AI-generated content, making it potentially more effective against newer LLMs.- Interpretation: A higher AI probability suggests the text aligns more with patterns found in AI-generated content.
Perplexity-based Analysis: Perplexity measures how "surprised" a language model is by a given sequence of words.
- Lower perplexity means the model finds the text highly predictable. AI models tend to generate highly probable word sequences, leading to lower perplexity.
- Higher perplexity indicates more unexpected or diverse word choices, which is characteristic of human writing.
- Note: Perplexity is a relative metric; there isn't a universal "AI threshold." It's best used as a supporting indicator.
β οΈ Important Considerations
- No Detector is 100% Accurate: AI detection is an evolving field, and models are constantly improving. This tool provides indicators, not definitive proof.
- Short Texts: Very short inputs are generally harder for models to analyze reliably.
- Newer AI Models: Text generated by very recent and advanced AI models may be more challenging for existing detectors to identify.
- Model Variability: Different models may produce varying results. It's best to use them as a probabilistic assessment.
βοΈ Installation (for Local Development)
To run this application locally, follow these steps:
- Clone the repository:
git clone [https://github.com/your-username/your-repo-name.git](https://github.com/your-username/your-repo-name.git) # Replace with your actual repo URL cd your-repo-name - Create a virtual environment (recommended):
python -m venv venv # On Windows: .\venv\Scripts\activate # On macOS/Linux: source venv/bin/activate - Install dependencies:
(Refer topip install -r requirements.txtrequirements.txtfor specific versions, especially fortorchif you need CUDA support.) - Run the Streamlit app:
streamlit run app.py
π€ Contributing
Contributions are welcome! If you have suggestions for improvements, new features, or bug fixes, please feel free to:
- Fork the repository.
- Create a new branch (
git checkout -b feature/your-feature-name). - Make your changes.
- Commit your changes (
git commit -m 'Add new feature'). - Push to the branch (
git push origin feature/your-feature-name). - Open a Pull Request.
License
This project is open-source and available under the MIT License. (Assuming MIT, replace if different)