Skip to main content

Installation

To begin using GLiNKER, you can install it directly from GitHub or from the source.

Install via Pip

pip install git+https://github.com/Knowledgator/GLinker.git

Install from Source

To install the GLiNKER library from source, follow these steps:

  1. Clone the Repository:

    First, clone the GLiNKER repository from GitHub:

    git clone https://github.com/Knowledgator/GLinker.git
  2. Navigate to the Project Directory:

    Change to the directory containing the cloned repository:

    cd GLinker
  3. Install Dependencies:

    tip

    It's a good practice to create and activate a virtual environment before installing dependencies:

    python -m venv venv
    source venv/bin/activate # On Windows use: venv\Scripts\activate
  4. Install the GLiNKER Package:

    Install the GLiNKER package:

    pip install -e .

    With optional dependencies for development and demo:

    pip install -e ".[dev,demo]"
  5. Verify Installation:

    You can verify the installation by importing the library in a Python script:

    import glinker
    print("GLiNKER installed successfully")

Optional Dependencies

GLiNKER supports multiple database backends and NER engines. Install the appropriate packages based on your needs.

spaCy NER Backend

To use spaCy as the NER backend in the L1 layer:

pip install spacy
python -m spacy download en_core_web_sm
tip

For biomedical use cases, install the en_core_sci_sm model from scispaCy:

pip install scispacy
pip install https://s3-us-west-2.amazonaws.com/ai2-s2-scispacy/releases/v0.5.4/en_core_sci_sm-0.5.4.tar.gz

Redis Support

pip install redis

Elasticsearch Support

pip install elasticsearch

PostgreSQL Support

pip install psycopg2-binary
note

The default in-memory dictionary database backend requires no additional dependencies. It is suitable for demos and small-scale use. For production deployments, Redis or Elasticsearch are recommended.

Docker Database Setup

For a quick start with all database backends:

cd scripts/database
docker-compose up -d