sreejang commited on
Commit
5d18a03
Β·
verified Β·
1 Parent(s): 4416649

Upload 9 files

Browse files
fine_tuned_movie_model/1_Pooling/config.json ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "word_embedding_dimension": 384,
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
+ }
fine_tuned_movie_model/README.md ADDED
@@ -0,0 +1,340 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ tags:
3
+ - sentence-transformers
4
+ - sentence-similarity
5
+ - feature-extraction
6
+ - dense
7
+ - generated_from_trainer
8
+ - dataset_size:1999
9
+ - loss:CosineSimilarityLoss
10
+ base_model: sentence-transformers/all-MiniLM-L6-v2
11
+ widget:
12
+ - source_sentence: it's a technically superb film , shining with all the usual spielberg
13
+ flair , expertly utilizing the talents of his top-notch creative team .
14
+ sentences:
15
+ - shamelessly resorting to pee-related sight gags that might even cause tom green
16
+ a grimace ; still , myer's energy and the silliness of it all eventually prevail
17
+ - likely to expertly drum up repressed teenage memories in any viewer .
18
+ - wilco fans will have a great time , and the movie should win the band a few new
19
+ converts , too .
20
+ - source_sentence: it ultimately stands forth as an important chronicle of the abuses
21
+ of one of latin america's most oppressive regimes .
22
+ sentences:
23
+ - the movie has a soft , percolating magic , a deadpan suspense .
24
+ - a real winner -- smart , funny , subtle , and resonant .
25
+ - you will emerge with a clearer view of how the gears of justice grind on and the
26
+ death report comes to share airtime alongside the farm report .
27
+ - source_sentence: holm . . . embodies the character with an effortlessly regal charisma
28
+ .
29
+ sentences:
30
+ - if you're looking for something new and hoping for something entertaining , you're
31
+ in luck .
32
+ - a bold and subversive film that cuts across the grain of what is popular and powerful
33
+ in this high-tech age , speaking its truths with spellbinding imagery and the
34
+ entrancing music of philip glass .
35
+ - it is amusing , and that's all it needs to be .
36
+ - source_sentence: like the original , this version is raised a few notches above
37
+ kiddie fantasy pablum by allen's astringent wit .
38
+ sentences:
39
+ - it's absolutely spooky how lillard channels the shagster right down to the original
40
+ casey kasem-furnished voice .
41
+ - the additional storyline is interesting and entertaining , but it doesn't have
42
+ the same magical quality as the beginning of the story . i like the new footage
43
+ and still love the old stuff .
44
+ - despite its hawaiian setting , the science-fiction trimmings and some moments
45
+ of rowdy slapstick , the basic plot of " lilo " could have been pulled from a
46
+ tear-stained vintage shirley temple script .
47
+ - source_sentence: this is the best american movie about troubled teens since 1998's
48
+ whatever .
49
+ sentences:
50
+ - disney has always been hit-or-miss when bringing beloved kids' books to the screen
51
+ . . . tuck everlasting is a little of both .
52
+ - made to be jaglomized is the cannes film festival , the annual riviera spree of
53
+ flesh , buzz , blab and money . the charming result is festival in cannes .
54
+ - the minor figures surrounding [bobby] . . . form a gritty urban mosaic .
55
+ pipeline_tag: sentence-similarity
56
+ library_name: sentence-transformers
57
+ ---
58
+
59
+ # SentenceTransformer based on sentence-transformers/all-MiniLM-L6-v2
60
+
61
+ This is a [sentence-transformers](https://www.SBERT.net) model finetuned from [sentence-transformers/all-MiniLM-L6-v2](https://huggingface.co/sentence-transformers/all-MiniLM-L6-v2). It maps sentences & paragraphs to a 384-dimensional dense vector space and can be used for semantic textual similarity, semantic search, paraphrase mining, text classification, clustering, and more.
62
+
63
+ ## Model Details
64
+
65
+ ### Model Description
66
+ - **Model Type:** Sentence Transformer
67
+ - **Base model:** [sentence-transformers/all-MiniLM-L6-v2](https://huggingface.co/sentence-transformers/all-MiniLM-L6-v2) <!-- at revision c9745ed1d9f207416be6d2e6f8de32d1f16199bf -->
68
+ - **Maximum Sequence Length:** 256 tokens
69
+ - **Output Dimensionality:** 384 dimensions
70
+ - **Similarity Function:** Cosine Similarity
71
+ <!-- - **Training Dataset:** Unknown -->
72
+ <!-- - **Language:** Unknown -->
73
+ <!-- - **License:** Unknown -->
74
+
75
+ ### Model Sources
76
+
77
+ - **Documentation:** [Sentence Transformers Documentation](https://sbert.net)
78
+ - **Repository:** [Sentence Transformers on GitHub](https://github.com/huggingface/sentence-transformers)
79
+ - **Hugging Face:** [Sentence Transformers on Hugging Face](https://huggingface.co/models?library=sentence-transformers)
80
+
81
+ ### Full Model Architecture
82
+
83
+ ```
84
+ SentenceTransformer(
85
+ (0): Transformer({'max_seq_length': 256, 'do_lower_case': False, 'architecture': 'BertModel'})
86
+ (1): Pooling({'word_embedding_dimension': 384, '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})
87
+ (2): Normalize()
88
+ )
89
+ ```
90
+
91
+ ## Usage
92
+
93
+ ### Direct Usage (Sentence Transformers)
94
+
95
+ First install the Sentence Transformers library:
96
+
97
+ ```bash
98
+ pip install -U sentence-transformers
99
+ ```
100
+
101
+ Then you can load this model and run inference.
102
+ ```python
103
+ from sentence_transformers import SentenceTransformer
104
+
105
+ # Download from the πŸ€— Hub
106
+ model = SentenceTransformer("sentence_transformers_model_id")
107
+ # Run inference
108
+ sentences = [
109
+ "this is the best american movie about troubled teens since 1998's whatever .",
110
+ "disney has always been hit-or-miss when bringing beloved kids' books to the screen . . . tuck everlasting is a little of both .",
111
+ 'the minor figures surrounding [bobby] . . . form a gritty urban mosaic .',
112
+ ]
113
+ embeddings = model.encode(sentences)
114
+ print(embeddings.shape)
115
+ # [3, 384]
116
+
117
+ # Get the similarity scores for the embeddings
118
+ similarities = model.similarity(embeddings, embeddings)
119
+ print(similarities)
120
+ # tensor([[1.0000, 0.9875, 0.9862],
121
+ # [0.9875, 1.0000, 0.9912],
122
+ # [0.9862, 0.9912, 1.0000]])
123
+ ```
124
+
125
+ <!--
126
+ ### Direct Usage (Transformers)
127
+
128
+ <details><summary>Click to see the direct usage in Transformers</summary>
129
+
130
+ </details>
131
+ -->
132
+
133
+ <!--
134
+ ### Downstream Usage (Sentence Transformers)
135
+
136
+ You can finetune this model on your own dataset.
137
+
138
+ <details><summary>Click to expand</summary>
139
+
140
+ </details>
141
+ -->
142
+
143
+ <!--
144
+ ### Out-of-Scope Use
145
+
146
+ *List how the model may foreseeably be misused and address what users ought not to do with the model.*
147
+ -->
148
+
149
+ <!--
150
+ ## Bias, Risks and Limitations
151
+
152
+ *What are the known or foreseeable issues stemming from this model? You could also flag here known failure cases or weaknesses of the model.*
153
+ -->
154
+
155
+ <!--
156
+ ### Recommendations
157
+
158
+ *What are recommendations with respect to the foreseeable issues? For example, filtering explicit content.*
159
+ -->
160
+
161
+ ## Training Details
162
+
163
+ ### Training Dataset
164
+
165
+ #### Unnamed Dataset
166
+
167
+ * Size: 1,999 training samples
168
+ * Columns: <code>sentence_0</code>, <code>sentence_1</code>, and <code>label</code>
169
+ * Approximate statistics based on the first 1000 samples:
170
+ | | sentence_0 | sentence_1 | label |
171
+ |:--------|:----------------------------------------------------------------------------------|:----------------------------------------------------------------------------------|:--------------------------------------------------------------|
172
+ | type | string | string | float |
173
+ | details | <ul><li>min: 5 tokens</li><li>mean: 27.54 tokens</li><li>max: 70 tokens</li></ul> | <ul><li>min: 5 tokens</li><li>mean: 27.14 tokens</li><li>max: 64 tokens</li></ul> | <ul><li>min: 1.0</li><li>mean: 1.0</li><li>max: 1.0</li></ul> |
174
+ * Samples:
175
+ | sentence_0 | sentence_1 | label |
176
+ |:-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:--------------------------------------------------------------------------------------------------------------------------------|:-----------------|
177
+ | <code>dazzling in its complexity , disturbing for its extraordinary themes , the piano teacher is a film that defies categorisation . it haunts , horrifies , startles and fascinates ; it is impossible to look away . ah yes , and then there's the music . . .</code> | <code>it has charm to spare , and unlike many romantic comedies , it does not alienate either gender in the audience .</code> | <code>1.0</code> |
178
+ | <code>it's a charming and often affecting journey .</code> | <code>psychologically savvy .</code> | <code>1.0</code> |
179
+ | <code>there's no reason to miss interview with the assassin</code> | <code>happily stays close to the ground in a spare and simple manner and doesn't pummel us with phony imagery or music .</code> | <code>1.0</code> |
180
+ * Loss: [<code>CosineSimilarityLoss</code>](https://sbert.net/docs/package_reference/sentence_transformer/losses.html#cosinesimilarityloss) with these parameters:
181
+ ```json
182
+ {
183
+ "loss_fct": "torch.nn.modules.loss.MSELoss"
184
+ }
185
+ ```
186
+
187
+ ### Training Hyperparameters
188
+ #### Non-Default Hyperparameters
189
+
190
+ - `per_device_train_batch_size`: 16
191
+ - `per_device_eval_batch_size`: 16
192
+ - `num_train_epochs`: 1
193
+ - `multi_dataset_batch_sampler`: round_robin
194
+
195
+ #### All Hyperparameters
196
+ <details><summary>Click to expand</summary>
197
+
198
+ - `do_predict`: False
199
+ - `eval_strategy`: no
200
+ - `prediction_loss_only`: True
201
+ - `per_device_train_batch_size`: 16
202
+ - `per_device_eval_batch_size`: 16
203
+ - `gradient_accumulation_steps`: 1
204
+ - `eval_accumulation_steps`: None
205
+ - `torch_empty_cache_steps`: None
206
+ - `learning_rate`: 5e-05
207
+ - `weight_decay`: 0.0
208
+ - `adam_beta1`: 0.9
209
+ - `adam_beta2`: 0.999
210
+ - `adam_epsilon`: 1e-08
211
+ - `max_grad_norm`: 1
212
+ - `num_train_epochs`: 1
213
+ - `max_steps`: -1
214
+ - `lr_scheduler_type`: linear
215
+ - `lr_scheduler_kwargs`: None
216
+ - `warmup_ratio`: None
217
+ - `warmup_steps`: 0
218
+ - `log_level`: passive
219
+ - `log_level_replica`: warning
220
+ - `log_on_each_node`: True
221
+ - `logging_nan_inf_filter`: True
222
+ - `enable_jit_checkpoint`: False
223
+ - `save_on_each_node`: False
224
+ - `save_only_model`: False
225
+ - `restore_callback_states_from_checkpoint`: False
226
+ - `use_cpu`: False
227
+ - `seed`: 42
228
+ - `data_seed`: None
229
+ - `bf16`: False
230
+ - `fp16`: False
231
+ - `bf16_full_eval`: False
232
+ - `fp16_full_eval`: False
233
+ - `tf32`: None
234
+ - `local_rank`: -1
235
+ - `ddp_backend`: None
236
+ - `debug`: []
237
+ - `dataloader_drop_last`: False
238
+ - `dataloader_num_workers`: 0
239
+ - `dataloader_prefetch_factor`: None
240
+ - `disable_tqdm`: False
241
+ - `remove_unused_columns`: True
242
+ - `label_names`: None
243
+ - `load_best_model_at_end`: False
244
+ - `ignore_data_skip`: False
245
+ - `fsdp`: []
246
+ - `fsdp_config`: {'min_num_params': 0, 'xla': False, 'xla_fsdp_v2': False, 'xla_fsdp_grad_ckpt': False}
247
+ - `accelerator_config`: {'split_batches': False, 'dispatch_batches': None, 'even_batches': True, 'use_seedable_sampler': True, 'non_blocking': False, 'gradient_accumulation_kwargs': None}
248
+ - `parallelism_config`: None
249
+ - `deepspeed`: None
250
+ - `label_smoothing_factor`: 0.0
251
+ - `optim`: adamw_torch_fused
252
+ - `optim_args`: None
253
+ - `group_by_length`: False
254
+ - `length_column_name`: length
255
+ - `project`: huggingface
256
+ - `trackio_space_id`: trackio
257
+ - `ddp_find_unused_parameters`: None
258
+ - `ddp_bucket_cap_mb`: None
259
+ - `ddp_broadcast_buffers`: False
260
+ - `dataloader_pin_memory`: True
261
+ - `dataloader_persistent_workers`: False
262
+ - `skip_memory_metrics`: True
263
+ - `push_to_hub`: False
264
+ - `resume_from_checkpoint`: None
265
+ - `hub_model_id`: None
266
+ - `hub_strategy`: every_save
267
+ - `hub_private_repo`: None
268
+ - `hub_always_push`: False
269
+ - `hub_revision`: None
270
+ - `gradient_checkpointing`: False
271
+ - `gradient_checkpointing_kwargs`: None
272
+ - `include_for_metrics`: []
273
+ - `eval_do_concat_batches`: True
274
+ - `auto_find_batch_size`: False
275
+ - `full_determinism`: False
276
+ - `ddp_timeout`: 1800
277
+ - `torch_compile`: False
278
+ - `torch_compile_backend`: None
279
+ - `torch_compile_mode`: None
280
+ - `include_num_input_tokens_seen`: no
281
+ - `neftune_noise_alpha`: None
282
+ - `optim_target_modules`: None
283
+ - `batch_eval_metrics`: False
284
+ - `eval_on_start`: False
285
+ - `use_liger_kernel`: False
286
+ - `liger_kernel_config`: None
287
+ - `eval_use_gather_object`: False
288
+ - `average_tokens_across_devices`: True
289
+ - `use_cache`: False
290
+ - `prompts`: None
291
+ - `batch_sampler`: batch_sampler
292
+ - `multi_dataset_batch_sampler`: round_robin
293
+ - `router_mapping`: {}
294
+ - `learning_rate_mapping`: {}
295
+
296
+ </details>
297
+
298
+ ### Framework Versions
299
+ - Python: 3.12.12
300
+ - Sentence Transformers: 5.2.2
301
+ - Transformers: 5.0.0
302
+ - PyTorch: 2.9.0+cu126
303
+ - Accelerate: 1.12.0
304
+ - Datasets: 4.0.0
305
+ - Tokenizers: 0.22.2
306
+
307
+ ## Citation
308
+
309
+ ### BibTeX
310
+
311
+ #### Sentence Transformers
312
+ ```bibtex
313
+ @inproceedings{reimers-2019-sentence-bert,
314
+ title = "Sentence-BERT: Sentence Embeddings using Siamese BERT-Networks",
315
+ author = "Reimers, Nils and Gurevych, Iryna",
316
+ booktitle = "Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing",
317
+ month = "11",
318
+ year = "2019",
319
+ publisher = "Association for Computational Linguistics",
320
+ url = "https://arxiv.org/abs/1908.10084",
321
+ }
322
+ ```
323
+
324
+ <!--
325
+ ## Glossary
326
+
327
+ *Clearly define terms in order to be accessible across audiences.*
328
+ -->
329
+
330
+ <!--
331
+ ## Model Card Authors
332
+
333
+ *Lists the people who create the model card, providing recognition and accountability for the detailed work that goes into its construction.*
334
+ -->
335
+
336
+ <!--
337
+ ## Model Card Contact
338
+
339
+ *Provides a way for people who have updates to the Model Card, suggestions, or questions, to contact the Model Card authors.*
340
+ -->
fine_tuned_movie_model/config.json ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "add_cross_attention": false,
3
+ "architectures": [
4
+ "BertModel"
5
+ ],
6
+ "attention_probs_dropout_prob": 0.1,
7
+ "bos_token_id": null,
8
+ "classifier_dropout": null,
9
+ "dtype": "float32",
10
+ "eos_token_id": null,
11
+ "gradient_checkpointing": false,
12
+ "hidden_act": "gelu",
13
+ "hidden_dropout_prob": 0.1,
14
+ "hidden_size": 384,
15
+ "initializer_range": 0.02,
16
+ "intermediate_size": 1536,
17
+ "is_decoder": false,
18
+ "layer_norm_eps": 1e-12,
19
+ "max_position_embeddings": 512,
20
+ "model_type": "bert",
21
+ "num_attention_heads": 12,
22
+ "num_hidden_layers": 6,
23
+ "pad_token_id": 0,
24
+ "position_embedding_type": "absolute",
25
+ "tie_word_embeddings": true,
26
+ "transformers_version": "5.0.0",
27
+ "type_vocab_size": 2,
28
+ "use_cache": true,
29
+ "vocab_size": 30522
30
+ }
fine_tuned_movie_model/config_sentence_transformers.json ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "__version__": {
3
+ "sentence_transformers": "5.2.2",
4
+ "transformers": "5.0.0",
5
+ "pytorch": "2.9.0+cu126"
6
+ },
7
+ "model_type": "SentenceTransformer",
8
+ "prompts": {
9
+ "query": "",
10
+ "document": ""
11
+ },
12
+ "default_prompt_name": null,
13
+ "similarity_fn_name": "cosine"
14
+ }
fine_tuned_movie_model/model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4187d0094369d8ba5b0dd74e209b1b5c21350f728122945f97a6fdf9b624d4af
3
+ size 90864176
fine_tuned_movie_model/modules.json ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ {
15
+ "idx": 2,
16
+ "name": "2",
17
+ "path": "2_Normalize",
18
+ "type": "sentence_transformers.models.Normalize"
19
+ }
20
+ ]
fine_tuned_movie_model/sentence_bert_config.json ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ {
2
+ "max_seq_length": 256,
3
+ "do_lower_case": false
4
+ }
fine_tuned_movie_model/tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
fine_tuned_movie_model/tokenizer_config.json ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "backend": "tokenizers",
3
+ "cls_token": "[CLS]",
4
+ "do_basic_tokenize": true,
5
+ "do_lower_case": true,
6
+ "is_local": false,
7
+ "mask_token": "[MASK]",
8
+ "model_max_length": 256,
9
+ "never_split": null,
10
+ "pad_token": "[PAD]",
11
+ "sep_token": "[SEP]",
12
+ "strip_accents": null,
13
+ "tokenize_chinese_chars": true,
14
+ "tokenizer_class": "BertTokenizer",
15
+ "unk_token": "[UNK]"
16
+ }