This project is a part of CLEF-CheckThat! Lab's Task2 (2025). Given a noisy, unstructured social media post, the task is to simplify it into a concise form. This system leverages advanced AI models to transform complex, informal claims into clear, normalized statements suitable for fact-checking and analysis.
Demo.mp4
- π Web Application: https://nikhil-kadapala.github.io/clef2025-checkthat-lab-task2/
- β‘ API Backend: Available via the web application interface
- π Python SDK: In development - will be released soon for programmatic access
- Interactive Chat Interface: Real-time claim normalization with streaming responses
- Batch Evaluation: Upload datasets for comprehensive evaluation with multiple models
- Model Support: GPT-4, Claude, Gemini, Llama, and Grok models
- Real-time Progress: WebSocket-based live evaluation tracking
- Self-Refine & Cross-Refine: Advanced refinement algorithms
- METEOR Scoring: Automatic evaluation with detailed metrics
- Modern UI: Responsive design with dark theme
- RESTful Endpoints: Clean API for claim normalization
- WebSocket Support: Real-time evaluation progress updates
- Multiple Models: Support for 8+ AI models
- Streaming Responses: Efficient real-time text generation
- CORS Configured: Ready for cross-origin requests
The system follows a sophisticated pipeline to normalize social media claims:
- Input Processing: Receives noisy, unstructured social media posts
- Model Selection: Chooses from multiple AI models (GPT-4, Claude, Gemini, etc.)
- Normalization: Applies selected prompting strategy:
- Zero-shot: Direct claim normalization
- Few-shot: Example-based learning
- Chain-of-Thought: Step-by-step reasoning
- Self-Refine: Iterative improvement process
- Cross-Refine: Multi-model collaborative refinement
- Evaluation: Automated METEOR scoring for quality assessment
- Output: Clean, normalized claims ready for fact-checking
- Frontend: React + TypeScript + Vite + Tailwind CSS
- Backend: FastAPI + WebSocket + Streaming
- AI Models: OpenAI GPT, Anthropic Claude, Google Gemini, Meta Llama, xAI Grok
- Evaluation: METEOR scoring (nltk) with pandas + numpy
- Deployment: GitHub Pages + Render
- Node.js (v18 or higher)
- Python (v3.8 or higher)
- API Keys for chosen models (OpenAI, Anthropic, Gemini, xAI)
Follow these steps to get the application running locally for development and testing.
The project includes automation scripts that handle the entire setup process:
# 1. Clone the repository
git clone <repository-url>
cd clef2025-checkthat-lab-task2
# 2. Set up environment variables (see below)
# 3. Run automated setup
./setup-project.sh
# 4. Start the application
./run-project.sh
π Note: You only need to run
./setup-project.sh
once for initial setup. After that, use./run-project.sh
to start the application.
Set these before running the setup script:
# Linux/macOS:
export OPENAI_API_KEY="your-openai-key"
export ANTHROPIC_API_KEY="your-anthropic-key"
export GEMINI_API_KEY="your-gemini-key"
export GROK_API_KEY="your-grok-key"
# Windows (PowerShell):
$env:OPENAI_API_KEY="your-openai-key"
$env:ANTHROPIC_API_KEY="your-anthropic-key"
$env:GEMINI_API_KEY="your-gemini-key"
$env:GROK_API_KEY="your-grok-key"
setup-project.sh
:
- β Detects your OS (Linux/macOS/Windows)
- β Terminates conflicting processes on port 5173
- β Installs Node.js dependencies for the frontend
- β Fixes npm vulnerabilities automatically
- β Creates Python virtual environment
- β
Installs Python dependencies with
uv
(faster) or falls back topip
- β Handles cross-platform compatibility
run-project.sh
:
- π Starts both frontend and backend simultaneously
- π― Frontend runs on
http://localhost:5173
- π― Backend runs on
http://localhost:8000
- π Graceful shutdown with
Ctrl+C
- π Shows process IDs for monitoring
If you prefer manual setup or encounter issues with the scripts:
Backend:
# Create and activate virtual environment
python -m venv .venv
source .venv/bin/activate # Linux/macOS
# .venv\Scripts\activate # Windows
# Install Python dependencies
pip install -r requirements.txt
Frontend:
cd src/app
npm install
Backend & Frontend:
# Start both servers
./run-project.sh
Alternatively, you can run them separately:
# Terminal 1: Backend
cd src/api && python main.py
# Terminal 2: Frontend
cd src/app && npm run dev
Open your browser and navigate to http://localhost:5173
to see the application.
Provider | Model | Free Tier | API Key Required |
---|---|---|---|
Together.ai | Llama 3.3 70B | β | β |
OpenAI | GPT-4o, GPT-4.1 | β | β |
Anthropic | Claude 3.7 Sonnet | β | β |
Gemini 2.5 Pro, Flash | β | β | |
xAI | Grok 3 | β | β |
- Zero-shot: Direct claim normalization
- Few-shot: Example-based learning
- Zero-shot-CoT: Chain-of-thought reasoning
- Few-shot-CoT: Examples with reasoning
- Self-Refine: Iterative improvement
- Cross-Refine: Multi-model refinement
Input: "The government is hiding something from us!"
Output: "Government transparency concerns have been raised by citizens regarding public information access."
METEOR Score: 0.847
# Start both frontend and backend
./run-project.sh
Visit http://localhost:5173
to access the interactive web interface.
cd src/api
python main.py
curl -X POST "http://localhost:8000/chat" \
-H "Content-Type: application/json" \
-d '{
"user_query": "The government is hiding something from us!",
"model": "meta-llama/Llama-3.3-70B-Instruct-Turbo-Free"
}'
# Default usage (Llama 3.3 70B, Zero-shot)
python src/claim_norm.py
# Custom configuration
python src/claim_norm.py -m OpenAI -p Zero-Shot-CoT -it 1
For production deployment, you can run the application in production mode:
# Set environment variables
export OPENAI_API_KEY="your-openai-key"
export ANTHROPIC_API_KEY="your-anthropic-key"
export GEMINI_API_KEY="your-gemini-key"
export GROK_API_KEY="your-grok-key"
# Build frontend for production
cd src/app
npm run build
# Start backend in production mode
cd ../api
python main.py
π Note: Docker support is not currently implemented. The application runs natively using Python and Node.js.
The frontend is automatically deployed to GitHub Pages:
- Build:
npm run deploy
- Commit and push changes
- GitHub Pages serves from
/docs
folder
The FastAPI backend is deployed to a cloud hosting service with standard configuration:
- Runtime: Python FastAPI application
- Environment: Production environment with API keys configured
- Features: CORS enabled, WebSocket support, streaming responses
- Frontend: React + TypeScript + Vite + Tailwind CSS
- Backend: FastAPI + WebSocket + Streaming
- Evaluation: METEOR scoring with pandas/numpy
- Models: Multiple AI providers with unified interface
- TypeScript for type safety
- ESLint + Prettier for code formatting
- Python type hints
- Error handling and logging
# Make scripts executable
chmod +x setup-project.sh run-project.sh
# Use Git Bash or WSL
bash setup-project.sh
bash run-project.sh
# Or install WSL if not available
wsl --install
The scripts automatically handle port conflicts, but if you encounter issues:
# Kill processes on port 5173 (frontend)
# Linux/macOS:
lsof -ti:5173 | xargs kill -9
# Windows:
netstat -ano | findstr :5173
taskkill /PID <PID> /F
# Kill processes on port 8000 (backend)
# Linux/macOS:
lsof -ti:8000 | xargs kill -9
# Windows:
netstat -ano | findstr :8000
taskkill /PID <PID> /F
- Ensure environment variables are set before running scripts
- Check for typos in environment variable names
- Verify API keys are valid and have sufficient quota
- Clear node_modules and reinstall dependencies
- Check Node.js version (requires v18+)
- Update npm to latest version:
npm install -g npm@latest
- Ensure virtual environment is activated
- Install missing dependencies:
pip install -r requirements.txt
- Check Python version (requires v3.8+)
clef2025-checkthat-lab-task2/
βββ src/
β βββ api/ # FastAPI backend (deployed to Render)
β β βββ main.py # Main API server with WebSocket support
β βββ app/ # Full-stack web application
β β βββ client/ # React frontend application
β β β βββ src/
β β β β βββ components/ # React components
β β β β βββ contexts/ # React contexts
β β β β βββ lib/ # Utility libraries
β β β β βββ pages/ # Page components
β β β βββ index.html # Main HTML template
β β βββ server/ # Development server (Express + Vite)
β β βββ shared/ # Shared types and utilities
β β β βββ types.ts # TypeScript type definitions
β β β βββ prompts.ts # Prompt templates
β β β βββ schema.ts # Database schema
β β βββ vite.config.ts # Vite configuration
β β βββ package.json # Frontend dependencies
β βββ utils/ # ML utilities and model interfaces
β β βββ evaluate.py # Evaluation logic with METEOR scoring
β β βββ self_refine.py # Self-refinement algorithms
β β βββ get_model_response.py # Model API orchestration
β β βββ prompts.py # Python prompt templates
β β βββ gpt.py # OpenAI GPT integration
β β βββ llama.py # Llama model integration
β β βββ claude.py # Anthropic Claude integration
β β βββ gemini.py # Google Gemini integration
β β βββ grok.py # xAI Grok integration
β βββ data/ # Dataset results and cache
β βββ claim_norm.py # CLI tool (legacy interface)
βββ data/ # Main datasets
β βββ dev.csv # Development dataset
β βββ test.csv # Test dataset
β βββ dev_data.jsonl # JSONL format development data
β βββ dev_data_fixed.jsonl # Corrected development data
βββ docs/ # Production build (GitHub Pages)
βββ requirements.txt # Python dependencies
βββ README.md # Project documentation
Contributions are welcome! Please:
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
This project is licensed under the MIT License. See the LICENSE file for more details.
If you use this project in your research, please cite:
@misc{nkadapala-clef2025-checkthat-task2,
title={Claim Extraction and Normalization for CLEF-CheckThat! Lab Task 2},
author={Nikhil Kadapala},
year={2025},
url={https://github.com/nikhil-kadapala/clef2025-checkthat-lab-task2}
}