Skip to content
Snippets Groups Projects
user avatar
Maja Jablonska authored
0319c75c

Installation

Currently, COMBO is available as a git repository. In the cloned repository directory:

(Recommended) Create a Conda environment

conda create -n combo python=3.9.16

Make sure to install at least python 3.9.16.

Not all of the requirements are available on conda, so pip is also required.

conda install pip

Install requirements

Install the requirements using the setup.py file.

pip install -e .

Use COMBO as a python package

import combo

Pretrained model usage:

from combo.predict import COMBO
c = COMBO.from_pretrained("model")
prediction = c("To jest przykładowe zdanie.")

print("{:15} {:15} {:10} {:10} {:10}".format('TOKEN', 'LEMMA', 'UPOS', 'HEAD', 'DEPREL'))
for token in prediction.tokens:
    print("{:15} {:15} {:10} {:10} {:10}".format(token.text, token.lemma, token.upostag, token.head, token.deprel))

Example output:

TOKEN           LEMMA           UPOS       HEAD       DEPREL
To              to              AUX                 4 cop       
jest            być             AUX                 4 cop       
przykładowe     przykładowy     ADJ                 4 amod      
zdanie          zdanie          NOUN                0 root      
.               .               PUNCT               4 punct  

Use COMBO CLI

The minimal training example (make sure to download some conllu training and validation files)

python combo/main.py --mode train --training_data_path <training conllu> --validation_data_path <validation conllu>