GPLinker关系抽取模型

模型介绍

使用方法

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
17
Inference Providers NEW
This model is not currently available via any of the supported Inference Providers.
The model cannot be deployed to the HF Inference API: The model has no pipeline_tag.