transformers safetensors t5 text2text-generation license:cc-by-sa-4.0 autotrain_compatible endpoints_compatible text-generation-inference region:us
---
license: cc-by-sa-4.0
---


# Model generates definitions of the word given context.


### How to use model: 
```
from transformers import pipeline
generator = pipeline("text2text-generation", model = 'clarin-knext/wnet-def-plt5large', use_auth_token=True)
generator("komik: Poszedłem dzisiaj na kabaret i był tam śmieszny komik.")
```
``` [{'generated_text': 'człowiek , który lubi żartować i rozśmieszać innych . '}] ```

```
model = T5ForConditionalGeneration.from_pretrained("clarin-knext/wnet-def-plt5large", use_auth_token=True)
tokenizer = T5TokenizerFast.from_pretrained("clarin-knext/wnet-def-plt5large", use_auth_token=True)

input_ids = tokenizer("samochód: po drodze jedzie samochód", return_tensors="pt").input_ids
outputs = model.generate(input_ids)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
```

