split-3-hebrew-trc-alephbert-base-EMP

作者 guyyanko · 下载 4 · 点赞 0 · 更新 2023-11-02

from transformers import TextClassificationPipeline
from transformers import pipeline, AutoTokenizer, AutoModelForSequenceClassification


class TemporalRelationClassificationPipeline(TextClassificationPipeline):
    def check_model_type(self, supported_models):
        pass

pretrained_checkpoint = "guyyanko/split-3-hebrew-trc-alephbert-base-EMP"

model = AutoModelForSequenceClassification.from_pretrained(pretrained_checkpoint, trust_remote_code=True)
tokenizer = AutoTokenizer.from_pretrained(pretrained_checkpoint, trust_remote_code=True)
classifier = pipeline(task='text-classification', model=model, tokenizer=tokenizer)

txt = "מחר [א1] אתאמן [/א1] אם [א2] אסיים [/א2] את כל המשימות שלי"
print(classifier(txt))

txt = "אחרי [א1] שאסיים [/א1] את כל המשימות שלי [א2] אלך [/א2] להתאמן בחדר הכושר"
print(classifier(txt))

模型信息

该模型卡暂无预览图和文字说明。以下信息来自 Hugging Face。

作者 guyyanko
类型—
基础模型—
标签—
下载4
点赞0
更新时间2023-11-02
Hugging Face https://huggingface.co/guyyanko/split-3-hebrew-trc-alephbert-base-EMP