| | --- |
| | datasets: |
| | - guyyanko/hebrew-trc-special-markers |
| | language: |
| | - he |
| | --- |
| | |
| | ```python |
| | 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)) |
| | ``` |
| |
|
| |
|
| |
|