Spaces:
Sleeping
Sleeping
metadata
title: AI Red Flag Analyzer
sdk: docker
emoji: 🚩
colorFrom: red
colorTo: blue
pinned: false
app_port: 8501
🚩AI Red Flag Analyzer
Red Flag Analyzer is a Streamlit application that scans uploaded text and Word documents for risky or unfair contract terms. It uses an AI-powered document risk analysis agent to identify red flags, classify their severity, and explain why they may be problematic.
Preview
Preview:https://huggingface.co/spaces/Renerfia/Red_Flag_Analyzer
Features
- Upload
.txtor.docxdocuments. Now added.pdfoption. - Extracts document text and previews content
- Uses AI to detect red flags such as:
- unfair clauses
- hidden fees
- high-risk commitments
- ambiguous terms
- legal risk factors
- Displays severity-coded findings with reasoning
- Includes a user disclaimer reminding that this is not legal advice
Project Structure
app.py- Streamlit user interface and document upload workflowmain.py- AI red flag analyzer logic usingpydantic-aipyproject.toml/requirements.txt- Python dependency definitions
Requirements
- Python 3.13+
streamlitpydanticpydantic-aipython-docxpython-dotenv
Setup
- Create a virtual environment and activate it.
- Install dependencies:
pip install -r requirements.txt
- Create a
.envfile with your AI provider credentials. Example:
GROQ_API_KEY=your_groq_api_key_here
Keep API keys private and do not commit
.envto version control.
Run the app
streamlit run app.py
Then open the local Streamlit URL in your browser, upload a document, and click Analyze for Red Flags.
Notes
- This tool is intended for awareness and document review support only.
- It is not a substitute for professional legal advice.
- The AI agent is configured in
main.pywith the modelgroq:llama-3.3-70b-versatile.
License
This project is released under the terms of the MIT License.
