Rahkakavee Baskaran
commited on
Commit
•
b5f00de
1
Parent(s):
cd998e1
delete model
Browse files- .gitattributes +0 -35
- 1_Pooling/config.json +0 -7
- README.md +0 -126
- config.json +0 -25
- config_sentence_transformers.json +0 -7
- modules.json +0 -14
- pytorch_model.bin +0 -3
- sentence_bert_config.json +0 -4
- sentencepiece.bpe.model +0 -3
- special_tokens_map.json +0 -7
- tokenizer.json +0 -3
- tokenizer_config.json +0 -14
- vocab.txt +0 -0
.gitattributes
DELETED
@@ -1,35 +0,0 @@
|
|
1 |
-
*.7z filter=lfs diff=lfs merge=lfs -text
|
2 |
-
*.arrow filter=lfs diff=lfs merge=lfs -text
|
3 |
-
*.bin filter=lfs diff=lfs merge=lfs -text
|
4 |
-
*.bz2 filter=lfs diff=lfs merge=lfs -text
|
5 |
-
*.ckpt filter=lfs diff=lfs merge=lfs -text
|
6 |
-
*.ftz filter=lfs diff=lfs merge=lfs -text
|
7 |
-
*.gz filter=lfs diff=lfs merge=lfs -text
|
8 |
-
*.h5 filter=lfs diff=lfs merge=lfs -text
|
9 |
-
*.joblib filter=lfs diff=lfs merge=lfs -text
|
10 |
-
*.lfs.* filter=lfs diff=lfs merge=lfs -text
|
11 |
-
*.mlmodel filter=lfs diff=lfs merge=lfs -text
|
12 |
-
*.model filter=lfs diff=lfs merge=lfs -text
|
13 |
-
*.msgpack filter=lfs diff=lfs merge=lfs -text
|
14 |
-
*.npy filter=lfs diff=lfs merge=lfs -text
|
15 |
-
*.npz filter=lfs diff=lfs merge=lfs -text
|
16 |
-
*.onnx filter=lfs diff=lfs merge=lfs -text
|
17 |
-
*.ot filter=lfs diff=lfs merge=lfs -text
|
18 |
-
*.parquet filter=lfs diff=lfs merge=lfs -text
|
19 |
-
*.pb filter=lfs diff=lfs merge=lfs -text
|
20 |
-
*.pickle filter=lfs diff=lfs merge=lfs -text
|
21 |
-
*.pkl filter=lfs diff=lfs merge=lfs -text
|
22 |
-
*.pt filter=lfs diff=lfs merge=lfs -text
|
23 |
-
*.pth filter=lfs diff=lfs merge=lfs -text
|
24 |
-
*.rar filter=lfs diff=lfs merge=lfs -text
|
25 |
-
*.safetensors filter=lfs diff=lfs merge=lfs -text
|
26 |
-
saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
27 |
-
*.tar.* filter=lfs diff=lfs merge=lfs -text
|
28 |
-
*.tflite filter=lfs diff=lfs merge=lfs -text
|
29 |
-
*.tgz filter=lfs diff=lfs merge=lfs -text
|
30 |
-
*.wasm filter=lfs diff=lfs merge=lfs -text
|
31 |
-
*.xz filter=lfs diff=lfs merge=lfs -text
|
32 |
-
*.zip filter=lfs diff=lfs merge=lfs -text
|
33 |
-
*.zst filter=lfs diff=lfs merge=lfs -text
|
34 |
-
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
35 |
-
tokenizer.json filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1_Pooling/config.json
DELETED
@@ -1,7 +0,0 @@
|
|
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 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
README.md
DELETED
@@ -1,126 +0,0 @@
|
|
1 |
-
---
|
2 |
-
pipeline_tag: sentence-similarity
|
3 |
-
tags:
|
4 |
-
- sentence-transformers
|
5 |
-
- feature-extraction
|
6 |
-
- sentence-similarity
|
7 |
-
- transformers
|
8 |
-
|
9 |
-
---
|
10 |
-
|
11 |
-
# {MODEL_NAME}
|
12 |
-
|
13 |
-
This is a [sentence-transformers](https://www.SBERT.net) model: It maps sentences & paragraphs to a 768 dimensional dense vector space and can be used for tasks like clustering or semantic search.
|
14 |
-
|
15 |
-
<!--- Describe your model here -->
|
16 |
-
|
17 |
-
## Usage (Sentence-Transformers)
|
18 |
-
|
19 |
-
Using this model becomes easy when you have [sentence-transformers](https://www.SBERT.net) installed:
|
20 |
-
|
21 |
-
```
|
22 |
-
pip install -U sentence-transformers
|
23 |
-
```
|
24 |
-
|
25 |
-
Then you can use the model like this:
|
26 |
-
|
27 |
-
```python
|
28 |
-
from sentence_transformers import SentenceTransformer
|
29 |
-
sentences = ["This is an example sentence", "Each sentence is converted"]
|
30 |
-
|
31 |
-
model = SentenceTransformer('{MODEL_NAME}')
|
32 |
-
embeddings = model.encode(sentences)
|
33 |
-
print(embeddings)
|
34 |
-
```
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
## Usage (HuggingFace Transformers)
|
39 |
-
Without [sentence-transformers](https://www.SBERT.net), you can use the model like this: First, you pass your input through the transformer model, then you have to apply the right pooling-operation on-top of the contextualized word embeddings.
|
40 |
-
|
41 |
-
```python
|
42 |
-
from transformers import AutoTokenizer, AutoModel
|
43 |
-
import torch
|
44 |
-
|
45 |
-
|
46 |
-
#Mean Pooling - Take attention mask into account for correct averaging
|
47 |
-
def mean_pooling(model_output, attention_mask):
|
48 |
-
token_embeddings = model_output[0] #First element of model_output contains all token embeddings
|
49 |
-
input_mask_expanded = attention_mask.unsqueeze(-1).expand(token_embeddings.size()).float()
|
50 |
-
return torch.sum(token_embeddings * input_mask_expanded, 1) / torch.clamp(input_mask_expanded.sum(1), min=1e-9)
|
51 |
-
|
52 |
-
|
53 |
-
# Sentences we want sentence embeddings for
|
54 |
-
sentences = ['This is an example sentence', 'Each sentence is converted']
|
55 |
-
|
56 |
-
# Load model from HuggingFace Hub
|
57 |
-
tokenizer = AutoTokenizer.from_pretrained('{MODEL_NAME}')
|
58 |
-
model = AutoModel.from_pretrained('{MODEL_NAME}')
|
59 |
-
|
60 |
-
# Tokenize sentences
|
61 |
-
encoded_input = tokenizer(sentences, padding=True, truncation=True, return_tensors='pt')
|
62 |
-
|
63 |
-
# Compute token embeddings
|
64 |
-
with torch.no_grad():
|
65 |
-
model_output = model(**encoded_input)
|
66 |
-
|
67 |
-
# Perform pooling. In this case, mean pooling.
|
68 |
-
sentence_embeddings = mean_pooling(model_output, encoded_input['attention_mask'])
|
69 |
-
|
70 |
-
print("Sentence embeddings:")
|
71 |
-
print(sentence_embeddings)
|
72 |
-
```
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
## Evaluation Results
|
77 |
-
|
78 |
-
<!--- Describe how your model was evaluated -->
|
79 |
-
|
80 |
-
For an automated evaluation of this model, see the *Sentence Embeddings Benchmark*: [https://seb.sbert.net](https://seb.sbert.net?model_name={MODEL_NAME})
|
81 |
-
|
82 |
-
|
83 |
-
## Training
|
84 |
-
The model was trained with the parameters:
|
85 |
-
|
86 |
-
**DataLoader**:
|
87 |
-
|
88 |
-
`torch.utils.data.dataloader.DataLoader` of length 190 with parameters:
|
89 |
-
```
|
90 |
-
{'batch_size': 16, 'sampler': 'torch.utils.data.sampler.RandomSampler', 'batch_sampler': 'torch.utils.data.sampler.BatchSampler'}
|
91 |
-
```
|
92 |
-
|
93 |
-
**Loss**:
|
94 |
-
|
95 |
-
`sentence_transformers.losses.CosineSimilarityLoss.CosineSimilarityLoss`
|
96 |
-
|
97 |
-
Parameters of the fit()-Method:
|
98 |
-
```
|
99 |
-
{
|
100 |
-
"epochs": 3,
|
101 |
-
"evaluation_steps": 0,
|
102 |
-
"evaluator": "NoneType",
|
103 |
-
"max_grad_norm": 1,
|
104 |
-
"optimizer_class": "<class 'torch.optim.adamw.AdamW'>",
|
105 |
-
"optimizer_params": {
|
106 |
-
"lr": 2e-05
|
107 |
-
},
|
108 |
-
"scheduler": "WarmupLinear",
|
109 |
-
"steps_per_epoch": null,
|
110 |
-
"warmup_steps": 100,
|
111 |
-
"weight_decay": 0.01
|
112 |
-
}
|
113 |
-
```
|
114 |
-
|
115 |
-
|
116 |
-
## Full Model Architecture
|
117 |
-
```
|
118 |
-
SentenceTransformer(
|
119 |
-
(0): Transformer({'max_seq_length': 512, 'do_lower_case': False}) with Transformer model: BertModel
|
120 |
-
(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})
|
121 |
-
)
|
122 |
-
```
|
123 |
-
|
124 |
-
## Citing & Authors
|
125 |
-
|
126 |
-
<!--- Describe where people can find more information -->
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
config.json
DELETED
@@ -1,25 +0,0 @@
|
|
1 |
-
{
|
2 |
-
"_name_or_path": "/Users/rahkakaveebaskaran/.cache/torch/sentence_transformers/bert-base-german-cased",
|
3 |
-
"architectures": [
|
4 |
-
"BertModel"
|
5 |
-
],
|
6 |
-
"attention_probs_dropout_prob": 0.1,
|
7 |
-
"classifier_dropout": null,
|
8 |
-
"hidden_act": "gelu",
|
9 |
-
"hidden_dropout_prob": 0.1,
|
10 |
-
"hidden_size": 768,
|
11 |
-
"initializer_range": 0.02,
|
12 |
-
"intermediate_size": 3072,
|
13 |
-
"layer_norm_eps": 1e-12,
|
14 |
-
"max_position_embeddings": 512,
|
15 |
-
"model_type": "bert",
|
16 |
-
"num_attention_heads": 12,
|
17 |
-
"num_hidden_layers": 12,
|
18 |
-
"pad_token_id": 0,
|
19 |
-
"position_embedding_type": "absolute",
|
20 |
-
"torch_dtype": "float32",
|
21 |
-
"transformers_version": "4.25.1",
|
22 |
-
"type_vocab_size": 2,
|
23 |
-
"use_cache": true,
|
24 |
-
"vocab_size": 30000
|
25 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
config_sentence_transformers.json
DELETED
@@ -1,7 +0,0 @@
|
|
1 |
-
{
|
2 |
-
"__version__": {
|
3 |
-
"sentence_transformers": "2.2.2",
|
4 |
-
"transformers": "4.25.1",
|
5 |
-
"pytorch": "1.13.1"
|
6 |
-
}
|
7 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
modules.json
DELETED
@@ -1,14 +0,0 @@
|
|
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 |
-
]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
pytorch_model.bin
DELETED
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:a770dca55b32474ad3d9a25a060ff82d1cc784593dd0592a017f299626890fa6
|
3 |
-
size 436393773
|
|
|
|
|
|
|
|
sentence_bert_config.json
DELETED
@@ -1,4 +0,0 @@
|
|
1 |
-
{
|
2 |
-
"max_seq_length": 512,
|
3 |
-
"do_lower_case": false
|
4 |
-
}
|
|
|
|
|
|
|
|
|
|
sentencepiece.bpe.model
DELETED
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:cfc8146abe2a0488e9e2a0c56de7952f7c11ab059eca145a0a727afce0db2865
|
3 |
-
size 5069051
|
|
|
|
|
|
|
|
special_tokens_map.json
DELETED
@@ -1,7 +0,0 @@
|
|
1 |
-
{
|
2 |
-
"cls_token": "[CLS]",
|
3 |
-
"mask_token": "[MASK]",
|
4 |
-
"pad_token": "[PAD]",
|
5 |
-
"sep_token": "[SEP]",
|
6 |
-
"unk_token": "[UNK]"
|
7 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
tokenizer.json
DELETED
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:3a99314ea39f5086f16c7b9507b211499ac4f3e0f0a51309312535937187a2da
|
3 |
-
size 726526
|
|
|
|
|
|
|
|
tokenizer_config.json
DELETED
@@ -1,14 +0,0 @@
|
|
1 |
-
{
|
2 |
-
"cls_token": "[CLS]",
|
3 |
-
"do_lower_case": false,
|
4 |
-
"mask_token": "[MASK]",
|
5 |
-
"model_max_length": 1000000000000000019884624838656,
|
6 |
-
"name_or_path": "/Users/rahkakaveebaskaran/.cache/torch/sentence_transformers/bert-base-german-cased",
|
7 |
-
"pad_token": "[PAD]",
|
8 |
-
"sep_token": "[SEP]",
|
9 |
-
"special_tokens_map_file": null,
|
10 |
-
"strip_accents": null,
|
11 |
-
"tokenize_chinese_chars": true,
|
12 |
-
"tokenizer_class": "BertTokenizer",
|
13 |
-
"unk_token": "[UNK]"
|
14 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vocab.txt
DELETED
The diff for this file is too large to render.
See raw diff
|
|