from transformers import pipeline | |
model="/data/scratch/svanhvit/byt5/byt5-base-gec-and-ged-iec-ckpt-550K-is_err-to-is_corr-max-len-512-bz-4-lr-1e-05/checkpoint-70000" | |
gec_pipeline = pipeline( | |
'text2text-generation', | |
model=model, | |
tokenizer="google/byt5-base" | |
) | |
while True: | |
sentence = input("Skrifaðu setningu til að flokka: " + "\n") | |
print(gec_pipeline("has_error " + sentence.strip(), max_length=512)[0]["generated_text"] + "\n") | |