Omartificial-Intelligence-Space/Arabic-stsb
Viewer • Updated • 8.63k • 131 • 4
How to use Omartificial-Intelligence-Space/GATE-AraBert-v0 with sentence-transformers:
from sentence_transformers import SentenceTransformer
model = SentenceTransformer("Omartificial-Intelligence-Space/GATE-AraBert-v0")
sentences = [
"امرأة تكتب شيئاً",
"مراهق يتحدث إلى فتاة عبر كاميرا الإنترنت",
"امرأة تقطع البصل الأخضر.",
"مجموعة من كبار السن يتظاهرون حول طاولة الطعام."
]
embeddings = model.encode(sentences)
similarities = model.similarity(embeddings, embeddings)
print(similarities.shape)
# [4, 4]This is a General Arabic Text Embedding trained using SentenceTransformers in a multi-task setup. The system trains on the AllNLI and on the STS dataset.
First install the Sentence Transformers library:
pip install -U sentence-transformers
Then you can load this model and run inference.
from sentence_transformers import SentenceTransformer
# Download from the 🤗 Hub
model = SentenceTransformer("Omartificial-Intelligence-Space/GATE-AraBert-v0")
# Run inference
sentences = [
'الكلب البني مستلقي على جانبه على سجادة بيج، مع جسم أخضر في المقدمة.',
'لقد مات الكلب',
'شخص طويل القامة',
]
embeddings = model.encode(sentences)
print(embeddings.shape)
# [3, 768]
# Get the similarity scores for the embeddings
similarities = model.similarity(embeddings, embeddings)
print(similarities.shape)
# [3, 3]
sts-devEmbeddingSimilarityEvaluator| Metric | Value |
|---|---|
| pearson_cosine | 0.8384 |
| spearman_cosine | 0.8389 |
| pearson_manhattan | 0.8248 |
| spearman_manhattan | 0.8329 |
| pearson_euclidean | 0.825 |
| spearman_euclidean | 0.8337 |
| pearson_dot | 0.8072 |
| spearman_dot | 0.8098 |
| pearson_max | 0.8384 |
| spearman_max | 0.8389 |
sts-testEmbeddingSimilarityEvaluator| Metric | Value |
|---|---|
| pearson_cosine | 0.7908 |
| spearman_cosine | 0.7893 |
| pearson_manhattan | 0.7923 |
| spearman_manhattan | 0.7947 |
| pearson_euclidean | 0.7904 |
| spearman_euclidean | 0.7934 |
| pearson_dot | 0.7404 |
| spearman_dot | 0.7354 |
| pearson_max | 0.7923 |
| spearman_max | 0.7947 |
Base model
aubmindlab/bert-base-arabertv02