Update README.md
Browse files
README.md
CHANGED
@@ -18,17 +18,17 @@ Output:
|
|
18 |
- Python
|
19 |
|
20 |
```python
|
21 |
-
|
22 |
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
|
27 |
-
|
28 |
-
|
29 |
|
30 |
-
|
31 |
|
32 |
-
|
33 |
```
|
34 |
|
|
|
18 |
- Python
|
19 |
|
20 |
```python
|
21 |
+
model_name = "ahmeshaf/ecb_tagger_seq2seq"
|
22 |
|
23 |
+
model = T5ForConditionalGeneration.from_pretrained(model_name)
|
24 |
+
tokenizer = T5Tokenizer.from_pretrained(model_name)
|
25 |
+
generation_config = GenerationConfig.from_pretrained(model_name)
|
26 |
|
27 |
+
tokenized_inputs = tokenizer(["triggers: I like this model and hate this sentence ."], return_tensors="pt")
|
28 |
+
outputs = model.generate(**tokenized_inputs, generation_config=generation_config)
|
29 |
|
30 |
+
print(outputs)
|
31 |
|
32 |
+
# ["like | hate"]
|
33 |
```
|
34 |
|