A Chrome extension to help users maintain focus during study sessions by monitoring webpage relevance to their current study topic using the all-MiniLM-L6-v2 model.
- Pomodoro-style timer for focused study sessions
- Webpage content analysis to determine relevance to study topic
- ML-based topic matching using all-MiniLM-L6-v2 model
- Real-time notifications when browsing irrelevant content
extension/: Chrome extension source codebackground.js: Background service workercontent.js: Content scriptpopup.html/js: Extension popup UImanifest.json: Extension manifest file
backend/: Flask backend with ML modelapp.py: Flask API serverrequirements.txt: Python dependencies
-
Navigate to the backend directory:
cd backend -
Create a Python virtual environment:
python -m venv venv -
Activate the virtual environment:
- Windows:
venv\Scripts\activate - macOS/Linux:
source venv/bin/activate
- Windows:
-
Install the required packages:
pip install -r requirements.txt -
Run the server:
python app.py
The backend server will run on http://localhost:5000.
- Open Chrome and navigate to
chrome://extensions/ - Enable "Developer mode" in the top right
- Click "Load unpacked" and select the
extensionfolder - The Focus Timer extension should now appear in your extensions list
- Click on the Focus Timer extension icon
- Enter your study topic, session duration, and number of sessions
- Click "Start Timer"
- The extension will monitor your browsing activity and provide feedback on whether the content you're viewing is relevant to your study topic
- The extension captures the content of your active browser tab
- The content is analyzed to extract relevant text (headings, paragraphs, etc.)
- The extracted text is sent to the backend for analysis with the all-MiniLM-L6-v2 model
- The model calculates the semantic similarity between your study topic and the webpage content
- The extension notifies you if the content is relevant or not