Skip to content

Repository files navigation

Express-Entry-AI-Chatbot

Express Entry AI Chatbot

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.


Features

  1. 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.
  2. Data Processing:

    • Cleans and transforms scraped data into a structured format.
    • Stores data in a JSON file for efficient querying.
  3. 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.
  4. Graphical User Interface (GUI):

    • Provides an intuitive interface for interacting with the chatbot.
    • Displays user and chatbot messages in a conversational style.

Installation

Prerequisites

  • Python 3.8 or higher
  • Google Chrome browser
  • ChromeDriver (compatible with your Chrome version)

Steps

  1. Clone the repository:

    git clone https://github.com/your-username/Express-Entry-AI-Chatbot.git
    cd Express-Entry-AI-Chatbot
  2. Create a virtual environment:

    python -m venv .venv
  3. Activate the virtual environment:

    • On Windows:
      .venv\Scripts\activate
    • On macOS/Linux:
      source .venv/bin/activate
  4. Install dependencies:

    pip install -r requirements.txt
  5. Download ChromeDriver:

    • Download ChromeDriver from here.
    • Place the chromedriver executable in your system's PATH or in the project directory.

Usage

Running the Chatbot

  1. Start the chatbot GUI:

    python gui.py
  2. The GUI will open, and the chatbot will be ready to answer your queries.

Example 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?"

Project Structure

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

How It Works

1. Data Collection

  • 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.

2. Data Processing

  • The chatbot loads the JSON file and prepares the data for querying.
  • Data is indexed and structured for efficient lookups.

3. AI Chatbot

  • 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).

4. GUI

  • The gui.py script creates a Tkinter-based GUI for user interaction.
  • Users can type queries, and the chatbot responds in real-time.

Error Handling

  1. Web Scraping:

    • Fallback to column-based extraction if headers are missing.
    • Logs warnings for invalid or missing data.
  2. Data Loading:

    • Attempts to scrape new data if the JSON file is missing or invalid.
  3. Chatbot:

    • Provides clear error messages for unsupported queries or technical issues.

Dependencies

  • 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

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages