Instructions to use xusenlin/duie-gplinker with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use xusenlin/duie-gplinker with Transformers:
# Load model directly from transformers import AutoTokenizer, GPLinker tokenizer = AutoTokenizer.from_pretrained("xusenlin/duie-gplinker") model = GPLinker.from_pretrained("xusenlin/duie-gplinker") - Notebooks
- Google Colab
- Kaggle
GPLinker关系抽取模型
模型介绍
数据集:百度
DUIE2.0信息抽取
使用方法
pip install litie
from pprint import pprint
from litie.pipelines import RelationExtractionPipeline
pipeline = RelationExtractionPipeline("gplinker", model_name_or_path="xusenlin/duie-gplinker", model_type="bert")
text = "查尔斯·阿兰基斯(Charles Aránguiz),1989年4月17日出生于智利圣地亚哥,智利职业足球运动员,司职中场,效力于德国足球甲级联赛勒沃库森足球俱乐部。"
pprint(pipeline(text))
# 输出
[
{
"出生地": [
{
"subject": "查尔斯·阿兰基斯",
"object": "智利圣地亚哥"
}
],
"国籍": [
{
"subject": "查尔斯·阿兰基斯",
"object": "智利"
}
],
"出生日期": [
{
"subject": "查尔斯·阿兰基斯",
"object": "1989年4月17日"
}
]
}
]
模型训练和推理的详细代码见 litie
- Downloads last month
- 9
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support