Create README.md
Browse files
README.md
ADDED
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
license: cc-by-sa-4.0
|
3 |
+
---
|
4 |
+
|
5 |
+
|
6 |
+
# Model generates definitions of the word given context.
|
7 |
+
|
8 |
+
|
9 |
+
### How to use model:
|
10 |
+
```
|
11 |
+
from transformers import pipeline
|
12 |
+
generator = pipeline("text2text-generation", model = 'clarin-knext/wnet-def-plt5large', use_auth_token=True)
|
13 |
+
generator("komik: Poszedłem dzisiaj na kabaret i był tam śmieszny komik.")
|
14 |
+
```
|
15 |
+
``` [{'generated_text': 'człowiek , który lubi żartować i rozśmieszać innych . '}] ```
|
16 |
+
|
17 |
+
```
|
18 |
+
model = T5ForConditionalGeneration.from_pretrained("clarin-knext/wnet-def-plt5large", use_auth_token=True)
|
19 |
+
tokenizer = T5TokenizerFast.from_pretrained("clarin-knext/wnet-def-plt5large", use_auth_token=True)
|
20 |
+
|
21 |
+
input_ids = tokenizer("samochód: po drodze jedzie samochód", return_tensors="pt").input_ids
|
22 |
+
outputs = model.generate(input_ids)
|
23 |
+
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
|
24 |
+
```
|
25 |
+
|