Upload folder using huggingface_hub
Browse files- 1_Pooling/config.json +10 -0
- README.md +141 -0
- classifier.pkl +3 -0
- config.json +25 -0
- config_sentence_transformers.json +10 -0
- merges.txt +0 -0
- model.safetensors +3 -0
- modules.json +14 -0
- sentence_bert_config.json +4 -0
- special_tokens_map.json +8 -0
- tokenizer.json +0 -0
- tokenizer_config.json +58 -0
- training_metadata.json +25 -0
- vocab.json +0 -0
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,141 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
tags:
|
| 3 |
+
- sentence-transformers
|
| 4 |
+
- sentence-similarity
|
| 5 |
+
- feature-extraction
|
| 6 |
+
base_model: allegro/herbert-base-cased
|
| 7 |
+
pipeline_tag: sentence-similarity
|
| 8 |
+
library_name: sentence-transformers
|
| 9 |
+
---
|
| 10 |
+
|
| 11 |
+
# SentenceTransformer based on allegro/herbert-base-cased
|
| 12 |
+
|
| 13 |
+
This is a [sentence-transformers](https://www.SBERT.net) model finetuned from [allegro/herbert-base-cased](https://huggingface.co/allegro/herbert-base-cased). 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.
|
| 14 |
+
|
| 15 |
+
## Model Details
|
| 16 |
+
|
| 17 |
+
### Model Description
|
| 18 |
+
- **Model Type:** Sentence Transformer
|
| 19 |
+
- **Base model:** [allegro/herbert-base-cased](https://huggingface.co/allegro/herbert-base-cased) <!-- at revision 50e33e0567be0c0b313832314c586e3df0dc2297 -->
|
| 20 |
+
- **Maximum Sequence Length:** 512 tokens
|
| 21 |
+
- **Output Dimensionality:** 768 dimensions
|
| 22 |
+
- **Similarity Function:** Cosine Similarity
|
| 23 |
+
<!-- - **Training Dataset:** Unknown -->
|
| 24 |
+
<!-- - **Language:** Unknown -->
|
| 25 |
+
<!-- - **License:** Unknown -->
|
| 26 |
+
|
| 27 |
+
### Model Sources
|
| 28 |
+
|
| 29 |
+
- **Documentation:** [Sentence Transformers Documentation](https://sbert.net)
|
| 30 |
+
- **Repository:** [Sentence Transformers on GitHub](https://github.com/UKPLab/sentence-transformers)
|
| 31 |
+
- **Hugging Face:** [Sentence Transformers on Hugging Face](https://huggingface.co/models?library=sentence-transformers)
|
| 32 |
+
|
| 33 |
+
### Full Model Architecture
|
| 34 |
+
|
| 35 |
+
```
|
| 36 |
+
SentenceTransformer(
|
| 37 |
+
(0): Transformer({'max_seq_length': 512, 'do_lower_case': False}) with Transformer model: BertModel
|
| 38 |
+
(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})
|
| 39 |
+
)
|
| 40 |
+
```
|
| 41 |
+
|
| 42 |
+
## Usage
|
| 43 |
+
|
| 44 |
+
### Direct Usage (Sentence Transformers)
|
| 45 |
+
|
| 46 |
+
First install the Sentence Transformers library:
|
| 47 |
+
|
| 48 |
+
```bash
|
| 49 |
+
pip install -U sentence-transformers
|
| 50 |
+
```
|
| 51 |
+
|
| 52 |
+
Then you can load this model and run inference.
|
| 53 |
+
```python
|
| 54 |
+
from sentence_transformers import SentenceTransformer
|
| 55 |
+
|
| 56 |
+
# Download from the 🤗 Hub
|
| 57 |
+
model = SentenceTransformer("sentence_transformers_model_id")
|
| 58 |
+
# Run inference
|
| 59 |
+
sentences = [
|
| 60 |
+
'The weather is lovely today.',
|
| 61 |
+
"It's so sunny outside!",
|
| 62 |
+
'He drove to the stadium.',
|
| 63 |
+
]
|
| 64 |
+
embeddings = model.encode(sentences)
|
| 65 |
+
print(embeddings.shape)
|
| 66 |
+
# [3, 768]
|
| 67 |
+
|
| 68 |
+
# Get the similarity scores for the embeddings
|
| 69 |
+
similarities = model.similarity(embeddings, embeddings)
|
| 70 |
+
print(similarities.shape)
|
| 71 |
+
# [3, 3]
|
| 72 |
+
```
|
| 73 |
+
|
| 74 |
+
<!--
|
| 75 |
+
### Direct Usage (Transformers)
|
| 76 |
+
|
| 77 |
+
<details><summary>Click to see the direct usage in Transformers</summary>
|
| 78 |
+
|
| 79 |
+
</details>
|
| 80 |
+
-->
|
| 81 |
+
|
| 82 |
+
<!--
|
| 83 |
+
### Downstream Usage (Sentence Transformers)
|
| 84 |
+
|
| 85 |
+
You can finetune this model on your own dataset.
|
| 86 |
+
|
| 87 |
+
<details><summary>Click to expand</summary>
|
| 88 |
+
|
| 89 |
+
</details>
|
| 90 |
+
-->
|
| 91 |
+
|
| 92 |
+
<!--
|
| 93 |
+
### Out-of-Scope Use
|
| 94 |
+
|
| 95 |
+
*List how the model may foreseeably be misused and address what users ought not to do with the model.*
|
| 96 |
+
-->
|
| 97 |
+
|
| 98 |
+
<!--
|
| 99 |
+
## Bias, Risks and Limitations
|
| 100 |
+
|
| 101 |
+
*What are the known or foreseeable issues stemming from this model? You could also flag here known failure cases or weaknesses of the model.*
|
| 102 |
+
-->
|
| 103 |
+
|
| 104 |
+
<!--
|
| 105 |
+
### Recommendations
|
| 106 |
+
|
| 107 |
+
*What are recommendations with respect to the foreseeable issues? For example, filtering explicit content.*
|
| 108 |
+
-->
|
| 109 |
+
|
| 110 |
+
## Training Details
|
| 111 |
+
|
| 112 |
+
### Framework Versions
|
| 113 |
+
- Python: 3.11.7
|
| 114 |
+
- Sentence Transformers: 4.1.0
|
| 115 |
+
- Transformers: 4.53.0
|
| 116 |
+
- PyTorch: 2.6.0+cu118
|
| 117 |
+
- Accelerate: 1.8.1
|
| 118 |
+
- Datasets: 2.21.0
|
| 119 |
+
- Tokenizers: 0.21.2
|
| 120 |
+
|
| 121 |
+
## Citation
|
| 122 |
+
|
| 123 |
+
### BibTeX
|
| 124 |
+
|
| 125 |
+
<!--
|
| 126 |
+
## Glossary
|
| 127 |
+
|
| 128 |
+
*Clearly define terms in order to be accessible across audiences.*
|
| 129 |
+
-->
|
| 130 |
+
|
| 131 |
+
<!--
|
| 132 |
+
## Model Card Authors
|
| 133 |
+
|
| 134 |
+
*Lists the people who create the model card, providing recognition and accountability for the detailed work that goes into its construction.*
|
| 135 |
+
-->
|
| 136 |
+
|
| 137 |
+
<!--
|
| 138 |
+
## Model Card Contact
|
| 139 |
+
|
| 140 |
+
*Provides a way for people who have updates to the Model Card, suggestions, or questions, to contact the Model Card authors.*
|
| 141 |
+
-->
|
classifier.pkl
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:f6c94045b73d6eaf30991e60d288718b224c7db21aac798dc061296aed7a0e94
|
| 3 |
+
size 6833
|
config.json
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"architectures": [
|
| 3 |
+
"BertModel"
|
| 4 |
+
],
|
| 5 |
+
"attention_probs_dropout_prob": 0.1,
|
| 6 |
+
"classifier_dropout": null,
|
| 7 |
+
"hidden_act": "gelu",
|
| 8 |
+
"hidden_dropout_prob": 0.1,
|
| 9 |
+
"hidden_size": 768,
|
| 10 |
+
"initializer_range": 0.02,
|
| 11 |
+
"intermediate_size": 3072,
|
| 12 |
+
"layer_norm_eps": 1e-12,
|
| 13 |
+
"max_position_embeddings": 514,
|
| 14 |
+
"model_type": "bert",
|
| 15 |
+
"num_attention_heads": 12,
|
| 16 |
+
"num_hidden_layers": 12,
|
| 17 |
+
"pad_token_id": 1,
|
| 18 |
+
"position_embedding_type": "absolute",
|
| 19 |
+
"tokenizer_class": "HerbertTokenizerFast",
|
| 20 |
+
"torch_dtype": "float32",
|
| 21 |
+
"transformers_version": "4.53.0",
|
| 22 |
+
"type_vocab_size": 2,
|
| 23 |
+
"use_cache": true,
|
| 24 |
+
"vocab_size": 50000
|
| 25 |
+
}
|
config_sentence_transformers.json
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"__version__": {
|
| 3 |
+
"sentence_transformers": "4.1.0",
|
| 4 |
+
"transformers": "4.53.0",
|
| 5 |
+
"pytorch": "2.6.0+cu118"
|
| 6 |
+
},
|
| 7 |
+
"prompts": {},
|
| 8 |
+
"default_prompt_name": null,
|
| 9 |
+
"similarity_fn_name": "cosine"
|
| 10 |
+
}
|
merges.txt
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:248576c5f5cc1c89270f340597613c77c6211b35f56dc5f87d9044d74157f221
|
| 3 |
+
size 497793896
|
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": 512,
|
| 3 |
+
"do_lower_case": false
|
| 4 |
+
}
|
special_tokens_map.json
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"bos_token": "<s>",
|
| 3 |
+
"cls_token": "<s>",
|
| 4 |
+
"mask_token": "<mask>",
|
| 5 |
+
"pad_token": "<pad>",
|
| 6 |
+
"sep_token": "</s>",
|
| 7 |
+
"unk_token": "<unk>"
|
| 8 |
+
}
|
tokenizer.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
tokenizer_config.json
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 |
+
"4": {
|
| 36 |
+
"content": "<mask>",
|
| 37 |
+
"lstrip": false,
|
| 38 |
+
"normalized": false,
|
| 39 |
+
"rstrip": false,
|
| 40 |
+
"single_word": false,
|
| 41 |
+
"special": true
|
| 42 |
+
}
|
| 43 |
+
},
|
| 44 |
+
"additional_special_tokens": [],
|
| 45 |
+
"bos_token": "<s>",
|
| 46 |
+
"clean_up_tokenization_spaces": false,
|
| 47 |
+
"cls_token": "<s>",
|
| 48 |
+
"do_lowercase_and_remove_accent": false,
|
| 49 |
+
"extra_special_tokens": {},
|
| 50 |
+
"id2lang": null,
|
| 51 |
+
"lang2id": null,
|
| 52 |
+
"mask_token": "<mask>",
|
| 53 |
+
"model_max_length": 512,
|
| 54 |
+
"pad_token": "<pad>",
|
| 55 |
+
"sep_token": "</s>",
|
| 56 |
+
"tokenizer_class": "HerbertTokenizer",
|
| 57 |
+
"unk_token": "<unk>"
|
| 58 |
+
}
|
training_metadata.json
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"model_type": "allegro",
|
| 3 |
+
"model_name": "allegro/herbert-base-cased",
|
| 4 |
+
"dataset_size": 25437,
|
| 5 |
+
"train_size": 15261,
|
| 6 |
+
"val_size": 5088,
|
| 7 |
+
"test_size": 5088,
|
| 8 |
+
"embedding_dimension": 768,
|
| 9 |
+
"normalized": false,
|
| 10 |
+
"classifier_params": {
|
| 11 |
+
"max_iter": 2000,
|
| 12 |
+
"class_weight": "balanced"
|
| 13 |
+
},
|
| 14 |
+
"results": {
|
| 15 |
+
"train_accuracy": 1.0,
|
| 16 |
+
"val_accuracy": 1.0,
|
| 17 |
+
"test_accuracy": 1.0
|
| 18 |
+
},
|
| 19 |
+
"training_times": {
|
| 20 |
+
"embedding_time_seconds": 7.772341728210449,
|
| 21 |
+
"classifier_time_seconds": 0.16267704963684082,
|
| 22 |
+
"total_time_seconds": 7.93501877784729
|
| 23 |
+
},
|
| 24 |
+
"timestamp": "2025-06-28 06:50:21"
|
| 25 |
+
}
|
vocab.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|