The Express Entry AI Chatbot is a Python-based application designed to provide information about Canada's Express Entry immigration draws. It uses web scraping to collect data from the official website, processes the data, and integrates an AI-powered chatbot to answer user queries in real-time. The chatbot can be accessed via a graphical user interface (GUI) built with Tkinter.
-
Web Scraping:
- Scrapes the latest Express Entry draw data from the official website using Selenium for dynamic content.
- Handles errors and ensures data consistency through fallback mechanisms.
-
Data Processing:
- Cleans and transforms scraped data into a structured format.
- Stores data in a JSON file for efficient querying.
-
AI Chatbot:
- Answers user queries using custom logic and a Hugging Face question-answering model.
- Handles queries about:
- Most recent draws.
- Maximum and minimum CRS scores.
- Draws for specific categories.
-
Graphical User Interface (GUI):
- Provides an intuitive interface for interacting with the chatbot.
- Displays user and chatbot messages in a conversational style.
- Python 3.8 or higher
- Google Chrome browser
- ChromeDriver (compatible with your Chrome version)
-
Clone the repository:
git clone https://github.com/your-username/Express-Entry-AI-Chatbot.git cd Express-Entry-AI-Chatbot -
Create a virtual environment:
python -m venv .venv
-
Activate the virtual environment:
- On Windows:
.venv\Scripts\activate
- On macOS/Linux:
source .venv/bin/activate
- On Windows:
-
Install dependencies:
pip install -r requirements.txt
-
Download ChromeDriver:
- Download ChromeDriver from here.
- Place the
chromedriverexecutable in your system's PATH or in the project directory.
-
Start the chatbot GUI:
python gui.py
-
The GUI will open, and the chatbot will be ready to answer your queries.
- "What is the most recent draw?"
- "What is the maximum CRS score in the last draw?"
- "What is the minimum CRS score for the Federal Skilled Worker category?"
Express-Entry-AI-Chatbot/
├── gui.py # GUI implementation using Tkinter
├── chatbot.py # Chatbot logic and AI model integration
├── web_scraper.py # Web scraping logic using Selenium and BeautifulSoup
├── express_entry_draws.json # JSON file to store scraped data
├── requirements.txt # Python dependencies
└── README.md # Project documentation
- The web_scraper.py script uses Selenium to scrape the latest Express Entry draw data from the official website.
- Data is cleaned, transformed, and saved to express_entry_draws.json.
- The chatbot loads the JSON file and prepares the data for querying.
- Data is indexed and structured for efficient lookups.
- The chatbot uses custom logic for specific queries (e.g., max/min CRS scores).
- For general queries, it uses a Hugging Face question-answering model (
bert-large-uncased-whole-word-masking-finetuned-squad).
- The gui.py script creates a Tkinter-based GUI for user interaction.
- Users can type queries, and the chatbot responds in real-time.
-
Web Scraping:
- Fallback to column-based extraction if headers are missing.
- Logs warnings for invalid or missing data.
-
Data Loading:
- Attempts to scrape new data if the JSON file is missing or invalid.
-
Chatbot:
- Provides clear error messages for unsupported queries or technical issues.
selenium: For web scraping dynamic content.beautifulsoup4: For parsing HTML content.transformers: For integrating the Hugging Face question-answering model.tkinter: For building the GUI.
Install all dependencies using:
pip install -r requirements.txt