Integrate Octopus with python code

(1) Install Octopus

pip install git+https://github.com/UBC-NLP/octopus.git --q

Initial octopus object

Import related packges

import logging
import os
from octopus import octopus

Inital the logger and set cache_dir

logging.basicConfig(
    format="%(asctime)s | %(levelname)s | %(name)s | %(message)s",
    datefmt="%Y-%m-%d %H:%M:%S",
    level=os.environ.get("LOGLEVEL", "INFO").upper(),
)
logger = logging.getLogger("octopus")
cache_dir="./mycaoctopus_cacheche"

Create octopus object

oct_obj = octopus.octopus(logger, cache_dir)