File size: 846 Bytes
5281020 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
---
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))
```
|