LexiSwap AI is a Chrome Extension that performs context-aware lexical simplification for scientific and academic text. It uses a FastAPI backend powered by Groq (Llama 3) to provide accurate simplifications.
- Context-Aware Simplification: Analyzes surrounding text to maintain semantic meaning.
- Double-Click Magic:
- Double-click any word to instantly swap it for a simpler synonym.
- Double-click a simplified word to revert it to the original.
- Selection Tooltip: Select any text to see options:
- Swap : Simplify the selected text.
- Meaning : Get a concise definition.
- Simplicity Levels: Choose between Basic, Intermediate, and Advanced via the popup.
- Local Caching: Minimizes API calls for repeated words.
- Non-Intrusive UI: Shadow DOM tooltip appears near the cursor.
graph LR
User[User] -->|Double Click / Select| Ext[Chrome Extension]
Ext -->|POST /simplify| API[FastAPI Backend]
API -->|Prompt| LLM[Groq Llama 3]
LLM -->|Simplified Text / Definition| API
API -->|JSON Response| Ext
Ext -->|Update UI| User
The backend runs locally on port 8000.
- Navigate to
fastapi-backend:cd fastapi-backend - Install dependencies:
pip install -r requirements.txt
- Ensure your
.envfile has the correct Groq API key (already configured). - Start the server:
uvicorn main:app --reload
- Open Chrome and go to
chrome://extensions. - Enable Developer mode (top right).
- Click Load unpacked.
- Select the
d:\Word_swap\chrome-extensiondirectory.
- No Highlight? Ensure the backend is running and you have refreshed the page after installing the extension.
- API Error? Check the terminal for error logs.
