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