Update README.md
Browse files
README.md
CHANGED
@@ -2,4 +2,36 @@
|
|
2 |
license: apache-2.0
|
3 |
---
|
4 |
|
5 |
-
A seq2seq event triggers tagger trained on the dataset: maven ere
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
license: apache-2.0
|
3 |
---
|
4 |
|
5 |
+
A seq2seq event triggers tagger trained on the dataset: maven ere
|
6 |
+
|
7 |
+
## Usage
|
8 |
+
|
9 |
+
Input:
|
10 |
+
```shell
|
11 |
+
triggers: I like this model and hate this sentence
|
12 |
+
```
|
13 |
+
|
14 |
+
Output:
|
15 |
+
```shell
|
16 |
+
like | hate
|
17 |
+
```
|
18 |
+
|
19 |
+
- Python
|
20 |
+
|
21 |
+
```python
|
22 |
+
from transformers import GenerationConfig, T5ForConditionalGeneration, T5Tokenizer
|
23 |
+
|
24 |
+
model_name = "ahmeshaf/maven_ere_trigger_seq2seq"
|
25 |
+
|
26 |
+
model = T5ForConditionalGeneration.from_pretrained(model_name)
|
27 |
+
tokenizer = T5Tokenizer.from_pretrained(model_name)
|
28 |
+
generation_config = GenerationConfig.from_pretrained(model_name)
|
29 |
+
|
30 |
+
tokenized_inputs = tokenizer(["triggers: I like this model and hate this sentence ."], return_tensors="pt")
|
31 |
+
outputs = model.generate(**tokenized_inputs, generation_config=generation_config)
|
32 |
+
|
33 |
+
print(outputs)
|
34 |
+
|
35 |
+
# ["like | hate"]
|
36 |
+
```
|
37 |
+
|