CoolFace
Modelpublic

yseop/SMM4H2024_Task2b_ja

sourceHugging Faceafl-3.0updated 2y agoView on Hugging Face
0likes9downloads
Model Card

SMM4H-2024 Task 2 Japanese RE

Overview

This is a relation extraction model created by fine-tuning daisaku-s/medtxt_ner_roberta on SMM4H 2024 Task 2b corpus.

Tag set:

  • CAUSED
  • TREATMENT_FOR

Usage

python
from transformers import AutoModelForSequenceClassification, AutoTokenizer
import torch

text = "サンプルテキスト"
model_name = "yseop/SMM4H2024_Task2b_ja"
id2label = ['O', 'CAUSED', 'TREATMENT_FOR']

with torch.inference_mode():
    model = AutoModelForSequenceClassification.from_pretrained(model_name).eval()
    tokenizer = AutoTokenizer.from_pretrained(model_name)
    encoded_input = tokenizer(text, return_tensors='pt', max_length=512)
    output = re_model(**encoded_input).logits
    class_id = output.argmax().item()
    print(id2label[class_id])

Results

Relationtpfpfnprecisionrecallf1
CAUSED\DISORDER\DISORDER1163380.00610.02560.0099
CAUSED\DISORDER\FUNCTION07013000
CAUSED\DRUG\DISORDER91961050.04390.07890.0564
CAUSED\DRUG\FUNCTION25970.03280.22220.0571
TREATMENT_FOR\DISORDER\DISORDER0120000
TREATMENT_FOR\DISORDER\FUNCTION030000
TREATMENT_FOR\DRUG\DISORDER01591000
TREATMENT_FOR\DRUG\FUNCTION001000
all125182550.02260.04490.0301