Skip to content
Snippets Groups Projects

Prediction

COMBO as a Python library

The pre-trained models can be automatically downloaded with the from_pretrained method. Select a model name from the lists: UD-trained COMBO models and pass it as an argument of from_pretrained.

from combo.predict import COMBO

nlp = COMBO.from_pretrained("polish-herbert-base-ud213")
sentence = nlp("Sentence to parse.")

You can also load your own COMBO model:

from combo.predict import COMBO

model_path = "your_model.tar.gz"
nlp = COMBO.from_pretrained(model_path)
sentence = nlp("Sentence to parse.")

COMBO allows to enter presegmented sentences (or texts):

from combo.predict import COMBO

model_path = "your_model.tar.gz"
nlp = COMBO.from_pretrained(model_path)
tokenized_sentence = ["Sentence", "to", "parse", "."]
sentence = nlp([tokenized_sentence])

By default, COMBO uses the LAMBO tokenizer.

COMBO as a command-line interface

Input and output are both in *.conllu format.

combo --mode predict --model_path your_model_tar_gz --input_file your_conllu_file --output_file your_output_file

Raw text prediction

Works for models where input was text-based only.

Input: one sentence per line.

Output: CONLL-u file.

combo --mode predict --model_path your_model_tar_gz --input_file your_text_file --output_file your_output_file --noconllu_format

Console prediction

Works for models where input was text-based only.

Interactive testing in console (load model and just type sentence in console).

combo --mode predict --model_path your_model_tar_gz --input_file "-"