Skip to content
Snippets Groups Projects
Select Git revision
  • cfe6990a1218ff0d0b3f9751efb91ff26ef4e2cd
  • main default protected
  • ud_training_script
  • fix_seed
  • merged-with-ner
  • multiword_fix_transformer
  • transformer_encoder
  • combo3
  • save_deprel_matrix_to_npz
  • master protected
  • combo-lambo
  • lambo-sent-attributes
  • adding_lambo
  • develop
  • update_allenlp2
  • develop_tmp
  • tokens_truncation
  • LR_test
  • eud_iwpt
  • iob
  • eud_iwpt_shared_task_bert_finetuning
  • 3.3.1
  • list
  • 3.2.1
  • 3.0.3
  • 3.0.1
  • 3.0.0
  • v1.0.6
  • v1.0.5
  • v1.0.4
  • v1.0.3
  • v1.0.2
  • v1.0.1
  • v1.0.0
34 results

combo

  • Clone with SSH
  • Clone with HTTPS
  • user avatar
    Maja Jablonska authored
    cfe6990a
    History

    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>