File size: 793 Bytes
11aeb0d 827356d 6157d8f |
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 27 28 29 30 31 32 33 34 35 36 37 |
---
license: apache-2.0
---
A seq2seq event triggers tagger trained on the dataset: maven ere
## Usage
Input:
```shell
triggers: I like this model and hate this sentence
```
Output:
```shell
like | hate
```
- Python
```python
from transformers import GenerationConfig, T5ForConditionalGeneration, T5Tokenizer
model_name = "ahmeshaf/maven_ere_trigger_seq2seq"
model = T5ForConditionalGeneration.from_pretrained(model_name)
tokenizer = T5Tokenizer.from_pretrained(model_name)
generation_config = GenerationConfig.from_pretrained(model_name)
tokenized_inputs = tokenizer(["triggers: I like this model and hate this sentence ."], return_tensors="pt")
outputs = model.generate(**tokenized_inputs, generation_config=generation_config)
print(outputs)
# ["like | hate"]
```
|