Update README.md
Browse files
README.md
CHANGED
@@ -11,19 +11,19 @@ rebel-base-chinese-cndbpedia is a generation-based relation extraction model
|
|
11 |
·easy to use,just like normal generation task.
|
12 |
|
13 |
·input is sentence,and output is linearlize triples,such as input:姚明是一名NBA篮球运动员 output:[subj]姚明[obj]NBA[rel]公司[obj]篮球运动员[rel]职业(more details can read on REBEL paper)
|
14 |
-
|
15 |
-
#using model:
|
16 |
|
17 |
|
|
|
|
|
18 |
from transformers import BertTokenizer, BartForConditionalGeneration
|
19 |
|
20 |
model_name = 'fnlp/bart-base-chinese'
|
21 |
-
|
22 |
tokenizer_kwargs = {
|
23 |
"use_fast": True,
|
24 |
"additional_special_tokens": ['<rel>', '<obj>', '<subj>'],
|
25 |
}
|
26 |
-
|
27 |
tokenizer = BertTokenizer.from_pretrained(model_name, **tokenizer_kwargs)
|
28 |
|
29 |
|
|
|
11 |
·easy to use,just like normal generation task.
|
12 |
|
13 |
·input is sentence,and output is linearlize triples,such as input:姚明是一名NBA篮球运动员 output:[subj]姚明[obj]NBA[rel]公司[obj]篮球运动员[rel]职业(more details can read on REBEL paper)
|
|
|
|
|
14 |
|
15 |
|
16 |
+
using model:
|
17 |
+
|
18 |
from transformers import BertTokenizer, BartForConditionalGeneration
|
19 |
|
20 |
model_name = 'fnlp/bart-base-chinese'
|
21 |
+
|
22 |
tokenizer_kwargs = {
|
23 |
"use_fast": True,
|
24 |
"additional_special_tokens": ['<rel>', '<obj>', '<subj>'],
|
25 |
}
|
26 |
+
|
27 |
tokenizer = BertTokenizer.from_pretrained(model_name, **tokenizer_kwargs)
|
28 |
|
29 |
|