đ Hebrew Cross-Encoder Model
This Hebrew Cross-Encoder Model is designed for zero-shot classification tasks, offering efficient and accurate text classification capabilities.
đ Quick Start
You can quickly start using this model through the following steps.
⨠Features
- Zero-Shot Classification: It can perform classification tasks without the need for specific training data for each class.
- Multi-Library Support: It can be used with both the
SentenceTransformers
library and the Transformers
library.
đĻ Installation
No specific installation steps are provided in the original document.
đģ Usage Examples
Basic Usage
from sentence_transformers import CrossEncoder
model = CrossEncoder('HeTree/HeCross')
scores = model.predict([('××× ×× ×Š×× ×××× ××ר×××?', '×ר××× ××× × 3,520,031 ×Ē×׊××× ×¨×Š×××× ×׊×× ×Š× 891.82 ×§×"ר.'),
('××× ×× ×Š×× ×××× ××ר×××?', '××ĸ×ר × ×× ××רק ×פ×רץ××Ē ×××××Ē ××××××× ×××ר×פ××××× ××××× ××Ē.')])
print(scores)
Advanced Usage
You can use the model also directly with Transformers library (without SentenceTransformers library):
from transformers import AutoTokenizer, AutoModelForSequenceClassification
import torch
import numpy as np
def sigmoid(x):
return 1 / (1 + np.exp(-x))
model = AutoModelForSequenceClassification.from_pretrained('HeTree/HeCross')
tokenizer = AutoTokenizer.from_pretrained('HeTree/HeCross')
features = tokenizer(['××× ×× ×Š×× ×××× ××ר×××?', '××× ×× ×Š×× ×××× ××ר×××?'],
['×ר××× ××× × 3,520,031 ×Ē×׊××× ×¨×Š×××× ×׊×× ×Š× 891.82 ×§×"ר.', '××ĸ×ר × ×× ××רק ×פ×רץ××Ē ×××××Ē ××××××× ×××ר×פ××××× ××××× ××Ē.'],
padding=True, truncation=True, return_tensors="pt")
model.eval()
with torch.no_grad():
scores = sigmoid(model(**features).logits)
print(scores)
Zero-Shot Classification Usage
This model can also be used for zero-shot-classification:
from transformers import pipeline
classifier = pipeline("zero-shot-classification", model='HeTree/HeCross')
sent = "×׊×××ĸ ׊×ĸ×ר ׊×ר××Ē× ××Ē ×רץ×Ē ×××פ×× ×Š×× ."
candidate_labels = ["× ××× ×׊××××Ē", "××Ēר", "×××× ×׊×××", "×××Š× ××׊××× ×× ×§"]
res = classifier(sent, candidate_labels)
print(res)
đ Documentation
No detailed documentation is provided in the original document.
đ§ Technical Details
No technical details are provided in the original document.
đ License
This project is licensed under the apache-2.0
license.
Citing
If you use HeCross in your research, please cite Mevaker: Conclusion Extraction and Allocation Resources for the Hebrew Language.
@article{shalumov2024mevaker,
title={Mevaker: Conclusion Extraction and Allocation Resources for the Hebrew Language},
author={Vitaly Shalumov and Harel Haskey and Yuval Solaz},
year={2024},
eprint={2403.09719},
archivePrefix={arXiv},
primaryClass={cs.CL}
}
Property |
Details |
Model Type |
Hebrew Cross-Encoder Model |
Training Data |
HeTree/MevakerConcTree |
Pipeline Tag |
zero-shot-classification |
License |
apache-2.0 |