|
--- |
|
license: apache-2.0 |
|
--- |
|
A seq2seq event triggers and entities tagger trained on the dataset: `ahmeshaf/ecb_plus_ed` |
|
|
|
## Usage |
|
|
|
Input: |
|
```shell |
|
triggers: I like this model and hate this sentence |
|
``` |
|
|
|
Output: |
|
```shell |
|
like | hate |
|
``` |
|
|
|
- Python |
|
|
|
```python |
|
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"] |
|
``` |
|
|