-
Notifications
You must be signed in to change notification settings - Fork 0
About
π 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.
LogicShield combines adversarial argument simulation with structured NLP analysis to help users improve both logic and long-term communication safety.
- π§ AI Debate Simulation β Real-time adversarial opponent with selectable personas (logical, aggressive, skeptical).
- βοΈ Logical Fallacy Detection β Automatically identifies common fallacies using transformer-based ML models (ad hominem, strawman, false dilemma, slippery slope).
- π Argument Strength Scoring β Quantifies coherence, evidence support, sentiment, and logical structure.
- π‘οΈ Reputation Risk Estimation β Flags extreme phrasing, moral polarity, identity-sensitive language using toxicity and hate speech detection.
- π Progress Analytics Dashboard β Track improvement across debate sessions.
- π Rewrite Suggestions β AI-powered refinement for stronger, clearer, safer arguments.
- π Students preparing for debates
- βοΈ Law aspirants & legal professionals
- π€ Public speakers & podcasters
- π’ Executives preparing presentations
- π’ Political commentators
| Platform | Minimum Requirements | Supported? |
|---|---|---|
| Web Application (Fully Responsive) | Modern Browser (Chrome, Brave, Edge, Firefox, etc) | β |
- Next.js 14
- React 18
- Tailwind CSS
- TypeScript
- Framework: FastAPI (Python)
- ORM: SQLAlchemy 2.0
- Database: SQLite (dev) / PostgreSQL (prod)
- Authentication: JWT with python-jose
Copy .env.template to .env and configure:
| Variable | Description | Default |
|---|---|---|
DATABASE_URL |
Database connection URL | sqlite:///./logicshield.db |
USE_SQLITE |
Use SQLite (true/false) | true |
SECRET_KEY |
Secret key for JWT | (auto-generated) |
HF_TOKEN |
Hugging Face token | (optional) |
PORT |
Server port | 8000 |
DEBUG |
Debug mode | true |
- Deep Learning: PyTorch 2.1+
-
Transformers: Hugging Face Transformers
-
facebook/bart-large-mnli- Fallacy detection -
martin-ha/toxic-comment-model- Toxicity detection -
facebook/roberta-hate-speech-dynabench-r4-target- Hate speech detection -
distilbert-base-uncased-finetuned-sst-2-english- Sentiment analysis
-
-
Embeddings: Sentence-BERT (
sentence-transformers/all-MiniLM-L6-v2) - ML: scikit-learn
git clone https://github.com/saad2134/logic-shield.git
cd logic-shieldcd backend
# Create virtual environment (optional but recommended)
python -m venv venv
source venv/bin/activate # Linux/Mac
# or: venv\Scripts\activate # Windows
# Install dependencies
pip install -r requirements.txt
# Copy environment template and configure
cp .env.template .env
# Run the server
uvicorn main:app --reloadThe API will be available at http://localhost:8000
- API Docs:
http://localhost:8000/docs - ReDoc:
http://localhost:8000/redoc
cd web
npm install
npm run devOpen http://localhost:3000
logic-shield/
β
βββ web/ # Next.js frontend
βββ backend/ # FastAPI backend
β βββ app/ # Application config
β βββ api/ # API routes & schemas
β βββ database/ # Database models & connection
β βββ services/ # NLP/ML services
β βββ main.py # Application entry point
β βββ requirements.txt
β βββ .env.template # Environment variables template
β
βββ docs/ # Documentation
graph TB
subgraph Client["Frontend (Web)"]
UI[Next.js UI]
end
subgraph Backend["Backend (FastAPI)"]
API[API Routes]
Auth[JWT Auth]
Config[Config]
end
subgraph Services["NLP/ML Services"]
FD[Fallacy Detector]
AS[Argument Strength]
RR[Reputation Risk]
DS[Debate Simulator]
end
subgraph MLModels["ML Models"]
BART[BART-Large-MNLI]
TOX[Toxicity Model]
HATE[Hate Speech Model]
SENT[Sentiment Model]
EMB[Sentence-BERT]
end
subgraph DB["Database"]
SQLite[(SQLite)]
PG[(PostgreSQL)]
end
UI -->|HTTP| API
API --> Auth
API --> Services
API --> DB
Services --> MLModels
FD --> BART
RR --> TOX
RR --> HATE
AS --> SENT
AS --> EMB
Config -.->|Config| Services
See docs/BACKEND.md for detailed architecture documentation.
Coming Soon
LogicShield provides probabilistic analysis based on NLP models. It does not guarantee real-world outcomes or predict future controversy with certainty.
β Star this repository if you find it useful. Build stronger arguments. Communicate responsibly.
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