Skip to content

Installation

SamoraHunter edited this page Sep 12, 2025 · 1 revision

Installation and Setup Guide

This guide provides detailed instructions for installing and configuring pat2vec.

Requirements

Core Services:

  • CogStack: An operational instance for data retrieval.
  • Elasticsearch: The backend for CogStack.
  • MedCAT: For medical concept annotation.

Local Setup:

  • Python: Version 3.10 or higher.
  • Virtual Environment: Requires the python3-venv package (or equivalent for your OS).

Installation on Unix/Linux (Recommended)

The install_pat2vec.sh script automates the full setup.

Prerequisites

  • A MedCAT model pack (.zip file).
  • Your CogStack/Elasticsearch credentials.

Steps

  1. Clone the repository:

    git clone https://github.com/SamoraHunter/pat2vec.git
    cd pat2vec
  2. Run the installation script:

    chmod +x install_pat2vec.sh
    ./install_pat2vec.sh

    The script supports several options:

    • --proxy: Use if you are behind a corporate proxy.
    • --dev: Installs development dependencies (e.g., pytest).
    • --force: Performs a clean installation, removing any existing environment.
  3. Activate the environment:

    source ../pat2vec_env/bin/activate

Installation on Windows

  1. Clone the repository:

    git clone https://github.com/SamoraHunter/pat2vec.git
  2. Run the installation script: This script sets up the Python virtual environment.

    cd pat2vec
    install.bat
  3. Activate the environment:

    pat2vec_env\Scripts\activate

Post-Installation Configuration

After running the installation script, you must configure your environment.

1. Elasticsearch Credentials

Your credentials should be placed in a file named credentials.py in the parent directory of your pat2vec clone. The install_pat2vec.sh script automatically copies a template for you.

IMPORTANT: This file contains sensitive information and should never be committed to version control.

The structure should look like this:

Clone this wiki locally