Views
No views yet
pip install -U sentence-transformers1from sentence_transformers import SentenceTransformer
2
3# Download from the 🤗 Hub
4model = SentenceTransformer("Omartificial-Intelligence-Space/GATE-AraBert-v0")
5# Run inference
6sentences = [
7 'الكلب البني مستلقي على جانبه على سجادة بيج، مع جسم أخضر في المقدمة.',
8 'لقد مات الكلب',
9 'شخص طويل القامة',
10]
11embeddings = model.encode(sentences)
12print(embeddings.shape)
13# [3, 768]
14
15# Get the similarity scores for the embeddings
16similarities = model.similarity(embeddings, embeddings)
17print(similarities.shape)
18# [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 |