Fengshenbang-LM
Fengshenbang-LM copied to clipboard
is there any example for relation extraction (ubert)?
import argparse
from fengshen import UbertPiplines
total_parser = argparse.ArgumentParser("TASK NAME")
total_parser = UbertPiplines.piplines_args(total_parser)
args = total_parser.parse_args()
args.pretrained_model_path = 'IDEA-CCNL/Erlangshen-Ubert-110M-Chinese' #预训练模型路径
test_data=[
{
"task_type": "抽取任务",
"subtask_type": "关系抽取",
"text": "姚明妻子叶莉罕见现身!39岁气质出众端庄,姚明却发福严重",
"choices": [
{"entity_type": "夫妻关系"}
],
"id": 0}
]
model = UbertPiplines(args)
result = model.predict(test_data)
for line in result:
print(line)
hi!@bifeng ubert is developed for 2022AIWIN, and there is no relation extraction task in this competition. Therefore, we currently do not provide the decoding code for relation extraction. We are developing an upgraded version of ubert, which is specially developed for relation extraction tasks and will be open sourced in the near future
Hi @suolyer !
Is relation extraction open sourced now?