Skip to content
Snippets Groups Projects
Select Git revision
  • 7ffc1072953f43d6b35575fd4e145dc211901f21
  • 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

prediction.md

Blame
  • Mateusz Klimaszewski's avatar
    Mateusz Klimaszewski authored and Mateusz Klimaszewski committed
    5a796013
    History

    Prediction

    ConLLU file prediction:

    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 --silent

    Console

    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 "-" --nosilent

    Raw text

    Works for models where input was text-based only.

    Input: one sentence per line.

    Output: List of token jsons.

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

    Advanced

    There are 2 tokenizers: whitespace and spacy-based (en_core_web_sm model).

    Use either --predictor_name semantic-multitask-predictor or --predictor_name semantic-multitask-predictor-spacy.

    Python

    import combo.predict as predict
    
    model_path = "your_model.tar.gz"
    nlp = predict.SemanticMultitaskPredictor.from_pretrained(model_path)
    sentence = nlp("Sentence to parse.")