{"id":50869925,"url":"https://github.com/saad2134/logic-shield","last_synced_at":"2026-06-15T04:04:08.025Z","repository":{"id":362053390,"uuid":"1148849764","full_name":"saad2134/logic-shield","owner":"saad2134","description":"🛡️ An AI-powered debate training and communication risk analysis platform. LogicShield strengthens your arguments, detects logical fallacies, and evaluates reputational risk before you publish, pitch, or perform.","archived":false,"fork":false,"pushed_at":"2026-06-02T10:30:38.000Z","size":1546,"stargazers_count":1,"open_issues_count":6,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-02T12:21:46.150Z","etag":null,"topics":["adversarial-ai","argument-analysis","argument-mining","argumentation","bert","computational-argumentation","debate-ai","debate-platform","debate-simulation","fallacy-classification","llm","logical-fallacy-detection","logicshield","nlp","persuasion-analysis","reputation-check","reputation-risk-intelligence","semantic-embeddings","text-classification","transformers"],"latest_commit_sha":null,"homepage":"https://logic-shield.vercel.app","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/saad2134.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-02-03T12:46:30.000Z","updated_at":"2026-06-02T04:53:51.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/saad2134/logic-shield","commit_stats":null,"previous_names":["saad2134/logic-shield"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/saad2134/logic-shield","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saad2134%2Flogic-shield","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saad2134%2Flogic-shield/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saad2134%2Flogic-shield/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saad2134%2Flogic-shield/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/saad2134","download_url":"https://codeload.github.com/saad2134/logic-shield/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saad2134%2Flogic-shield/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34346874,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-15T02:00:07.085Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["adversarial-ai","argument-analysis","argument-mining","argumentation","bert","computational-argumentation","debate-ai","debate-platform","debate-simulation","fallacy-classification","llm","logical-fallacy-detection","logicshield","nlp","persuasion-analysis","reputation-check","reputation-risk-intelligence","semantic-embeddings","text-classification","transformers"],"created_at":"2026-06-15T04:04:05.699Z","updated_at":"2026-06-15T04:04:08.016Z","avatar_url":"https://github.com/saad2134.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cimg align=\"center\" width=\"1000\" height=\"190\" alt=\"LOL\" src=\"https://github.com/user-attachments/assets/68310070-80cf-4784-8d6f-c86fb67b67e2\" /\u003e\n\n\u003ch1 align=\"center\"\u003e 🛡️ AI-Argument Simulator With Risk Forecasting\u003c/h1\u003e\n\n\n\u003e \u003cp align=\"center\"\u003e🚀 \u003cstrong\u003eAn AI-powered debate training and communication risk analysis platform. \u003cb\u003eLogicShield\u003c/b\u003e strengthens your arguments, detects logical fallacies, and evaluates reputational risk before you publish, pitch, or perform.\u003c/strong\u003e\u003c/p\u003e\n\n\u003cdiv align=\"center\"\u003e\n\n\u003ca href=\"https://logic-shield.vercel.app/\" target=\"_blank\"\u003e\n  \u003cimg  style=\"width:350px;\" src=\"https://img.shields.io/badge/🚀_Access_the_Prototype_Here-Live-brightgreen?style=for-the-badge\u0026labelColor=fca503\" alt=\"Access the Prototype Here\"  /\u003e\n\u003c/a\u003e\n\n![Phase](https://img.shields.io/badge/🛠️%20Phase-Active%20Development-blue?style=for-the-badge)\n![Platform](https://img.shields.io/badge/🌐%20Platform-Web-28a745?style=for-the-badge)\n\n\u003c/div\u003e\n\n\n## ✨ Features\n\nLogicShield combines adversarial argument simulation with structured NLP analysis to help users improve both logic and long-term communication safety.\n\n* 🧠 **AI Debate Simulation** – Real-time adversarial opponent with selectable personas (logical, aggressive, skeptical, devil's advocate).\n* ⚡ **Real-Time Argument Coach** – Live coaching as you type with instant feedback on fallacies and suggestions.\n* ⚖️ **Logical Fallacy Detection** – Automatically identifies common fallacies using transformer-based ML models (ad hominem, strawman, false dilemma, slippery slope, bandwagon).\n* 📊 **Argument Strength Scoring** – Quantifies coherence, evidence support, sentiment, and logical structure with score penalties for issues.\n* 🛡️ **Reputation Risk Estimation** – Flags extreme phrasing, moral polarity, identity-sensitive language using toxicity and hate speech detection.\n* 📈 **Progress Analytics Dashboard** – Track improvement across debate sessions.\n* 🎯 **Smart Counter-Arguments** – AI-powered responses that analyze user arguments and provide relevant rebuttals.\n* 📱 **Demo Mode** – Try the platform without authentication with simulated AI responses.\n* 🔐 **Authentication** – Secure JWT-based authentication for personalized experience.\n\n## 🎯 Use Cases\n\n* 🎓 Students preparing for debates\n* ⚖️ Law aspirants \u0026 legal professionals\n* 🎤 Public speakers \u0026 podcasters\n* 🏢 Executives preparing presentations\n* 📢 Political commentators\n* 📧 Communications professionals (emails, proposals)\n* 👥 Debate club members\n* 💼 Anyone wanting to improve argumentation skills\n\n---\n\n## ⚙️ Platform Support\n\n\u003ctable border=\"1\" cellpadding=\"10\" cellspacing=\"0\"\u003e\n  \u003cthead\u003e\n    \u003ctr\u003e\n      \u003cth\u003ePlatform\u003c/th\u003e\n      \u003cth\u003eMinimum Requirements\u003c/th\u003e\n      \u003cth\u003eSupported?\u003c/th\u003e\n    \u003c/tr\u003e\n  \u003c/thead\u003e\n  \u003ctbody\u003e\n    \u003ctr\u003e\n      \u003ctd\u003eWeb Application (Fully Responsive)\u003c/td\u003e\n      \u003ctd\u003eModern Browser (Chrome, Brave, Edge, Firefox, etc)\u003c/td\u003e\n      \u003ctd\u003e✅\u003c/td\u003e\n    \u003c/tr\u003e\n  \u003c/tbody\u003e\n\u003c/table\u003e\n\n\n## 🛠️ Tech Stack\n\n### Frontend\n\n* Next.js 14\n* React 18\n* Tailwind CSS\n* TypeScript\n\n### Backend\n\n* **Framework**: FastAPI (Python)\n* **ORM**: SQLAlchemy 2.0\n* **Database**: SQLite (dev) / PostgreSQL (prod)\n* **Authentication**: JWT with python-jose\n\n#### Backend Configuration\n\nCopy `.env.template` to `.env` and configure:\n\n| Variable | Description | Default |\n|----------|-------------|---------|\n| `DATABASE_URL` | Database connection URL | `sqlite:///./logicshield.db` |\n| `USE_SQLITE` | Use SQLite (true/false) | `true` |\n| `SECRET_KEY` | Secret key for JWT | (auto-generated) |\n| `HF_TOKEN` | Hugging Face token | (optional) |\n| `PORT` | Server port | `8000` |\n| `DEBUG` | Debug mode | `true` |\n| `DEMO_MODE` | Demo mode (simulated AI) | `true` (for new clones) |\n\n#### Demo Mode\n\nThe backend has **Demo Mode** for quick testing. When enabled:\n- Uses simulated/smart-template responses\n- No ML model downloads needed (~4GB)\n- Works out of the box for new cloners\n\n```bash\n# For full ML models locally, set in .env:\nDEMO_MODE=false\n\n# And install full dependencies:\npip install -r requirements-local.txt\n```\n\n### NLP \u0026 ML\n\n* **Demo Mode (default)**: Smart templates + keyword detection - works without ML packages\n* **Full ML** (optional):\n  * **Deep Learning**: PyTorch 2.1+\n  * **Transformers**: Hugging Face Transformers\n    * `facebook/bart-large-mnli` - Fallacy detection\n    * `martin-ha/toxic-comment-model` - Toxicity detection\n    * `facebook/roberta-hate-speech-dynabench-r4-target` - Hate speech detection\n    * `distilbert-base-uncased-finetuned-sst-2-english` - Sentiment analysis\n  * **Embeddings**: Sentence-BERT (`sentence-transformers/all-MiniLM-L6-v2`)\n  * **ML**: scikit-learn\n* **LLM for Counter-Arguments**: Meta Llama 3.2 1B (`meta-llama/Llama-3.2-1B-Instruct`) via HuggingFace Inference Providers - Generates intelligent, persona-aware responses\n\n---\n\n## 🚀 Getting Started\n\n### 1️⃣ Clone the Repository\n\n```bash\ngit clone https://github.com/saad2134/logic-shield.git\ncd logic-shield\n```\n\n### 2️⃣ Backend Setup\n\n```bash\ncd backend\n\n# Create virtual environment (optional but recommended)\npython -m venv venv\nsource venv/bin/activate  # Linux/Mac\n# or: venv\\Scripts\\activate  # Windows\n\n# Install dependencies\npip install -r requirements.txt\n\n# Copy environment template and configure\ncp .env.template .env\n\n# Run the server (Demo Mode - works out of the box)\nuvicorn main:app --reload\n```\n\nThe API will be available at `http://localhost:8000`\n- API Docs: `http://localhost:8000/docs`\n- ReDoc: `http://localhost:8000/redoc`\n\n### (Optional) Enable Full ML Models\n\nBy default, the backend runs in Demo Mode with simulated responses. For full ML:\n\n```bash\n# Install full dependencies\npip install -r requirements-local.txt\n\n# Enable in .env:\nDEMO_MODE=false\n```\n\n### 3️⃣ Frontend Setup\n\n```bash\ncd web\nnpm install\nnpm run dev\n```\n\nOpen `http://localhost:3000`\n\n---\n\n## 📁 Folder Structure\n\n```\nlogic-shield/\n│\n├── web/                 # Next.js frontend\n├── backend/             # FastAPI backend\n│   ├── app/            # Application config\n│   ├── api/            # API routes \u0026 schemas\n│   ├── database/       # Database models \u0026 connection\n│   ├── services/       # NLP/ML services\n│   ├── main.py         # Application entry point\n│   ├── requirements.txt\n│   └── .env.template   # Environment variables template\n│\n└── docs/               # Documentation\n```\n\n---\n\n## 🏛️ Project Architecture\n\n```mermaid\ngraph TB\n    subgraph Client[\"Frontend (Web)\"]\n        UI[Next.js UI]\n    end\n\n    subgraph Backend[\"Backend (FastAPI)\"]\n        API[API Routes]\n        Auth[JWT Auth]\n        Config[Config]\n    end\n\n    subgraph Services[\"NLP/ML Services\"]\n        FD[Fallacy Detector]\n        AS[Argument Strength]\n        RR[Reputation Risk]\n        DS[Debate Simulator]\n    end\n\n    subgraph MLModels[\"ML Models\"]\n        BART[BART-Large-MNLI]\n        TOX[Toxicity Model]\n        HATE[Hate Speech Model]\n        SENT[Sentiment Model]\n        EMB[Sentence-BERT]\n    end\n\n    subgraph DB[\"Database\"]\n        SQLite[(SQLite)]\n        PG[(PostgreSQL)]\n    end\n\n    UI --\u003e|HTTP| API\n    API --\u003e Auth\n    API --\u003e Services\n    API --\u003e DB\n    \n    Services --\u003e MLModels\n    FD --\u003e BART\n    RR --\u003e TOX\n    RR --\u003e HATE\n    AS --\u003e SENT\n    AS --\u003e EMB\n    \n    Config -.-\u003e|Config| Services\n```\n\n*See `docs/BACKEND.md` for detailed architecture documentation.*\n\n---\n\n## 📱 Screenshots\n\n*Coming Soon*\n\n---\n\n## 📊 Project Stats\n\n\u003cdiv align=\"center\"\u003e\n\n![Repo Size](https://img.shields.io/github/repo-size/saad2134/logic-shield)\n![Last Commit](https://img.shields.io/github/last-commit/saad2134/logic-shield)\n![Open Issues](https://img.shields.io/github/issues/saad2134/logic-shield)\n![License](https://img.shields.io/github/license/saad2134/logic-shield)\n![Forks](https://img.shields.io/github/forks/saad2134/logic-shield?style=social)\n![Stars](https://img.shields.io/github/stars/saad2134/logic-shield?style=social)\n![Contributors](https://img.shields.io/github/contributors/saad2134/logic-shield)\n\n\u003c/div\u003e\n\n\n## ⭐ Star History\n\n\u003ca href=\"https://www.star-history.com/#saad2134/logic-shield\u0026Date\"\u003e\n \u003cpicture\u003e\n   \u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"https://api.star-history.com/svg?repos=saad2134/logic-shield\u0026type=Date\u0026theme=dark\" /\u003e\n   \u003csource media=\"(prefers-color-scheme: light)\" srcset=\"https://api.star-history.com/svg?repos=saad2134/logic-shield\u0026type=Date\" /\u003e\n   \u003cimg alt=\"Star History Chart\" src=\"https://api.star-history.com/svg?repos=saad2134/logic-shield\u0026type=Date\" /\u003e\n \u003c/picture\u003e\n\u003c/a\u003e\n\n\n---\n\n## 🔐 Disclaimer\n\nLogicShield provides probabilistic analysis based on NLP models.\nIt does not guarantee real-world outcomes or predict future controversy with certainty.\n\n\n## ✍️ Endnote\n\n\u003cp align=\"center\"\u003e⭐ Star this repository if you find it useful. Build stronger arguments. Communicate responsibly.\u003c/p\u003e\n\n---\n\n## 🏷 Tags\n\n`nlp` `natural-language-processing` `transformers` `bert` `llm` `large-language-models` `argument-mining` `computational-argumentation` `logical-fallacy-detection` `fallacy-classification` `debate-ai` `debate-training` `argument-analysis` `critical-thinking` `reasoning-ai` `semantic-embeddings` `sentence-bert` `text-classification` `ai-webapp` `fastapi` `nextjs` `react` `machine-learning` `deep-learning` `reputation-analysis` `communication-intelligence` `ai-simulation` `adversarial-ai` `persuasion-analysis` `explainable-ai` `data-driven-feedback` `education-tech` `edtech-ai` `logicshield`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsaad2134%2Flogic-shield","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsaad2134%2Flogic-shield","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsaad2134%2Flogic-shield/lists"}