abdulmunimjemal commited on
Commit
da86678
·
verified ·
1 Parent(s): e4507d0

Add new SentenceTransformer model

Browse files
.gitattributes CHANGED
@@ -33,3 +33,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
36
+ tokenizer.json filter=lfs diff=lfs merge=lfs -text
1_Pooling/config.json ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "word_embedding_dimension": 768,
3
+ "pooling_mode_cls_token": false,
4
+ "pooling_mode_mean_tokens": true,
5
+ "pooling_mode_max_tokens": false,
6
+ "pooling_mode_mean_sqrt_len_tokens": false,
7
+ "pooling_mode_weightedmean_tokens": false,
8
+ "pooling_mode_lasttoken": false,
9
+ "include_prompt": true
10
+ }
README.md ADDED
@@ -0,0 +1,174 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ tags:
3
+ - sentence-transformers
4
+ - sentence-similarity
5
+ - feature-extraction
6
+ pipeline_tag: sentence-similarity
7
+ library_name: sentence-transformers
8
+ metrics:
9
+ - cosine_accuracy
10
+ model-index:
11
+ - name: SentenceTransformer
12
+ results:
13
+ - task:
14
+ type: triplet
15
+ name: Triplet
16
+ dataset:
17
+ name: TestTripletEvaluator
18
+ type: TestTripletEvaluator
19
+ metrics:
20
+ - type: cosine_accuracy
21
+ value: 0.875
22
+ name: Cosine Accuracy
23
+ ---
24
+
25
+ # SentenceTransformer
26
+
27
+ This is a [sentence-transformers](https://www.SBERT.net) model trained. It maps sentences & paragraphs to a 768-dimensional dense vector space and can be used for semantic textual similarity, semantic search, paraphrase mining, text classification, clustering, and more.
28
+
29
+ ## Model Details
30
+
31
+ ### Model Description
32
+ - **Model Type:** Sentence Transformer
33
+ <!-- - **Base model:** [Unknown](https://huggingface.co/unknown) -->
34
+ - **Maximum Sequence Length:** 128 tokens
35
+ - **Output Dimensionality:** 768 dimensions
36
+ - **Similarity Function:** Cosine Similarity
37
+ <!-- - **Training Dataset:** Unknown -->
38
+ <!-- - **Language:** Unknown -->
39
+ <!-- - **License:** Unknown -->
40
+
41
+ ### Model Sources
42
+
43
+ - **Documentation:** [Sentence Transformers Documentation](https://sbert.net)
44
+ - **Repository:** [Sentence Transformers on GitHub](https://github.com/UKPLab/sentence-transformers)
45
+ - **Hugging Face:** [Sentence Transformers on Hugging Face](https://huggingface.co/models?library=sentence-transformers)
46
+
47
+ ### Full Model Architecture
48
+
49
+ ```
50
+ SentenceTransformer(
51
+ (0): Transformer({'max_seq_length': 128, 'do_lower_case': False}) with Transformer model: XLMRobertaModel
52
+ (1): Pooling({'word_embedding_dimension': 768, 'pooling_mode_cls_token': False, 'pooling_mode_mean_tokens': True, 'pooling_mode_max_tokens': False, 'pooling_mode_mean_sqrt_len_tokens': False, 'pooling_mode_weightedmean_tokens': False, 'pooling_mode_lasttoken': False, 'include_prompt': True})
53
+ )
54
+ ```
55
+
56
+ ## Usage
57
+
58
+ ### Direct Usage (Sentence Transformers)
59
+
60
+ First install the Sentence Transformers library:
61
+
62
+ ```bash
63
+ pip install -U sentence-transformers
64
+ ```
65
+
66
+ Then you can load this model and run inference.
67
+ ```python
68
+ from sentence_transformers import SentenceTransformer
69
+
70
+ # Download from the 🤗 Hub
71
+ model = SentenceTransformer("abdulmunimjemal/xlm-r-retrieval-am-v5")
72
+ # Run inference
73
+ sentences = [
74
+ 'The weather is lovely today.',
75
+ "It's so sunny outside!",
76
+ 'He drove to the stadium.',
77
+ ]
78
+ embeddings = model.encode(sentences)
79
+ print(embeddings.shape)
80
+ # [3, 768]
81
+
82
+ # Get the similarity scores for the embeddings
83
+ similarities = model.similarity(embeddings, embeddings)
84
+ print(similarities.shape)
85
+ # [3, 3]
86
+ ```
87
+
88
+ <!--
89
+ ### Direct Usage (Transformers)
90
+
91
+ <details><summary>Click to see the direct usage in Transformers</summary>
92
+
93
+ </details>
94
+ -->
95
+
96
+ <!--
97
+ ### Downstream Usage (Sentence Transformers)
98
+
99
+ You can finetune this model on your own dataset.
100
+
101
+ <details><summary>Click to expand</summary>
102
+
103
+ </details>
104
+ -->
105
+
106
+ <!--
107
+ ### Out-of-Scope Use
108
+
109
+ *List how the model may foreseeably be misused and address what users ought not to do with the model.*
110
+ -->
111
+
112
+ ## Evaluation
113
+
114
+ ### Metrics
115
+
116
+ #### Triplet
117
+
118
+ * Dataset: `TestTripletEvaluator`
119
+ * Evaluated with [<code>TripletEvaluator</code>](https://sbert.net/docs/package_reference/sentence_transformer/evaluation.html#sentence_transformers.evaluation.TripletEvaluator)
120
+
121
+ | Metric | Value |
122
+ |:--------------------|:----------|
123
+ | **cosine_accuracy** | **0.875** |
124
+
125
+ <!--
126
+ ## Bias, Risks and Limitations
127
+
128
+ *What are the known or foreseeable issues stemming from this model? You could also flag here known failure cases or weaknesses of the model.*
129
+ -->
130
+
131
+ <!--
132
+ ### Recommendations
133
+
134
+ *What are recommendations with respect to the foreseeable issues? For example, filtering explicit content.*
135
+ -->
136
+
137
+ ## Training Details
138
+
139
+ ### Training Logs
140
+ | Epoch | Step | TestTripletEvaluator_cosine_accuracy |
141
+ |:-----:|:----:|:------------------------------------:|
142
+ | 0 | 0 | 0.875 |
143
+
144
+
145
+ ### Framework Versions
146
+ - Python: 3.11.11
147
+ - Sentence Transformers: 3.3.1
148
+ - Transformers: 4.47.1
149
+ - PyTorch: 2.5.1+cu124
150
+ - Accelerate: 1.2.1
151
+ - Datasets: 3.2.0
152
+ - Tokenizers: 0.21.0
153
+
154
+ ## Citation
155
+
156
+ ### BibTeX
157
+
158
+ <!--
159
+ ## Glossary
160
+
161
+ *Clearly define terms in order to be accessible across audiences.*
162
+ -->
163
+
164
+ <!--
165
+ ## Model Card Authors
166
+
167
+ *Lists the people who create the model card, providing recognition and accountability for the detailed work that goes into its construction.*
168
+ -->
169
+
170
+ <!--
171
+ ## Model Card Contact
172
+
173
+ *Provides a way for people who have updates to the Model Card, suggestions, or questions, to contact the Model Card authors.*
174
+ -->
config.json ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_name_or_path": "/content/amharic-retrieval-ft/checkpoint-1188",
3
+ "architectures": [
4
+ "XLMRobertaModel"
5
+ ],
6
+ "attention_probs_dropout_prob": 0.1,
7
+ "bos_token_id": 0,
8
+ "classifier_dropout": null,
9
+ "eos_token_id": 2,
10
+ "gradient_checkpointing": false,
11
+ "hidden_act": "gelu",
12
+ "hidden_dropout_prob": 0.1,
13
+ "hidden_size": 768,
14
+ "initializer_range": 0.02,
15
+ "intermediate_size": 3072,
16
+ "layer_norm_eps": 1e-05,
17
+ "max_position_embeddings": 514,
18
+ "model_type": "xlm-roberta",
19
+ "num_attention_heads": 12,
20
+ "num_hidden_layers": 12,
21
+ "output_past": true,
22
+ "pad_token_id": 1,
23
+ "position_embedding_type": "absolute",
24
+ "torch_dtype": "float32",
25
+ "transformers_version": "4.47.1",
26
+ "type_vocab_size": 1,
27
+ "use_cache": true,
28
+ "vocab_size": 250002
29
+ }
config_sentence_transformers.json ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "__version__": {
3
+ "sentence_transformers": "3.3.1",
4
+ "transformers": "4.47.1",
5
+ "pytorch": "2.5.1+cu124"
6
+ },
7
+ "prompts": {},
8
+ "default_prompt_name": null,
9
+ "similarity_fn_name": "cosine"
10
+ }
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:fa5e6ce73c4c96277d125685708f1032bacce026df561bab2afdac14c04ede02
3
+ size 1112197096
modules.json ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [
2
+ {
3
+ "idx": 0,
4
+ "name": "0",
5
+ "path": "",
6
+ "type": "sentence_transformers.models.Transformer"
7
+ },
8
+ {
9
+ "idx": 1,
10
+ "name": "1",
11
+ "path": "1_Pooling",
12
+ "type": "sentence_transformers.models.Pooling"
13
+ }
14
+ ]
sentence_bert_config.json ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ {
2
+ "max_seq_length": 128,
3
+ "do_lower_case": false
4
+ }
sentencepiece.bpe.model ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:cfc8146abe2a0488e9e2a0c56de7952f7c11ab059eca145a0a727afce0db2865
3
+ size 5069051
special_tokens_map.json ADDED
@@ -0,0 +1,51 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "bos_token": {
3
+ "content": "<s>",
4
+ "lstrip": false,
5
+ "normalized": false,
6
+ "rstrip": false,
7
+ "single_word": false
8
+ },
9
+ "cls_token": {
10
+ "content": "<s>",
11
+ "lstrip": false,
12
+ "normalized": false,
13
+ "rstrip": false,
14
+ "single_word": false
15
+ },
16
+ "eos_token": {
17
+ "content": "</s>",
18
+ "lstrip": false,
19
+ "normalized": false,
20
+ "rstrip": false,
21
+ "single_word": false
22
+ },
23
+ "mask_token": {
24
+ "content": "<mask>",
25
+ "lstrip": false,
26
+ "normalized": false,
27
+ "rstrip": false,
28
+ "single_word": false
29
+ },
30
+ "pad_token": {
31
+ "content": "<pad>",
32
+ "lstrip": false,
33
+ "normalized": false,
34
+ "rstrip": false,
35
+ "single_word": false
36
+ },
37
+ "sep_token": {
38
+ "content": "</s>",
39
+ "lstrip": false,
40
+ "normalized": false,
41
+ "rstrip": false,
42
+ "single_word": false
43
+ },
44
+ "unk_token": {
45
+ "content": "<unk>",
46
+ "lstrip": false,
47
+ "normalized": false,
48
+ "rstrip": false,
49
+ "single_word": false
50
+ }
51
+ }
tokenizer.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6c2ccb33b55c4d157419a2105d6e033f7514c2baa6306471c56b86ab02787613
3
+ size 17083053
tokenizer_config.json ADDED
@@ -0,0 +1,64 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "added_tokens_decoder": {
3
+ "0": {
4
+ "content": "<s>",
5
+ "lstrip": false,
6
+ "normalized": false,
7
+ "rstrip": false,
8
+ "single_word": false,
9
+ "special": true
10
+ },
11
+ "1": {
12
+ "content": "<pad>",
13
+ "lstrip": false,
14
+ "normalized": false,
15
+ "rstrip": false,
16
+ "single_word": false,
17
+ "special": true
18
+ },
19
+ "2": {
20
+ "content": "</s>",
21
+ "lstrip": false,
22
+ "normalized": false,
23
+ "rstrip": false,
24
+ "single_word": false,
25
+ "special": true
26
+ },
27
+ "3": {
28
+ "content": "<unk>",
29
+ "lstrip": false,
30
+ "normalized": false,
31
+ "rstrip": false,
32
+ "single_word": false,
33
+ "special": true
34
+ },
35
+ "250001": {
36
+ "content": "<mask>",
37
+ "lstrip": false,
38
+ "normalized": false,
39
+ "rstrip": false,
40
+ "single_word": false,
41
+ "special": true
42
+ }
43
+ },
44
+ "bos_token": "<s>",
45
+ "clean_up_tokenization_spaces": false,
46
+ "cls_token": "<s>",
47
+ "eos_token": "</s>",
48
+ "extra_special_tokens": {},
49
+ "full_tokenizer_file": null,
50
+ "mask_token": "<mask>",
51
+ "max_length": 128,
52
+ "model_max_length": 128,
53
+ "pad_to_multiple_of": null,
54
+ "pad_token": "<pad>",
55
+ "pad_token_type_id": 0,
56
+ "padding_side": "right",
57
+ "sep_token": "</s>",
58
+ "sp_model_kwargs": {},
59
+ "stride": 0,
60
+ "tokenizer_class": "XLMRobertaTokenizer",
61
+ "truncation_side": "right",
62
+ "truncation_strategy": "longest_first",
63
+ "unk_token": "<unk>"
64
+ }