Push model to huggingface
Browse files- 1_Pooling/config.json +1 -1
- README.md +18 -47
- config.json +4 -4
- config_sentence_transformers.json +3 -3
- model.safetensors +2 -2
- modules.json +0 -6
- sentence_bert_config.json +1 -1
- tokenizer.json +2 -4
- tokenizer_config.json +1 -3
1_Pooling/config.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
{
|
| 2 |
-
"word_embedding_dimension":
|
| 3 |
"pooling_mode_cls_token": false,
|
| 4 |
"pooling_mode_mean_tokens": true,
|
| 5 |
"pooling_mode_max_tokens": false,
|
|
|
|
| 1 |
{
|
| 2 |
+
"word_embedding_dimension": 768,
|
| 3 |
"pooling_mode_cls_token": false,
|
| 4 |
"pooling_mode_mean_tokens": true,
|
| 5 |
"pooling_mode_max_tokens": false,
|
README.md
CHANGED
|
@@ -1,25 +1,16 @@
|
|
| 1 |
---
|
| 2 |
-
|
| 3 |
-
license: mit
|
| 4 |
-
library_name: sentence-transformers
|
| 5 |
tags:
|
| 6 |
- sentence-transformers
|
|
|
|
| 7 |
- sentence-similarity
|
| 8 |
-
-
|
| 9 |
-
- dialog-flow
|
| 10 |
-
datasets:
|
| 11 |
-
- Salesforce/dialogstudio
|
| 12 |
-
pipeline_tag: sentence-similarity
|
| 13 |
-
base_model:
|
| 14 |
-
- google-bert/bert-base-uncased
|
| 15 |
-
---
|
| 16 |
|
|
|
|
| 17 |
|
| 18 |
-
#
|
| 19 |
-
|
| 20 |
-
This is the original **D2F$_{single}$** model introduced in the paper ["Dialog2Flow: Pre-training Soft-Contrastive Action-Driven Sentence Embeddings for Automatic Dialog Flow Extraction"](https://publications.idiap.ch/attachments/papers/2024/Burdisso_EMNLP2024_2024.pdf) published in the EMNLP 2024 main conference.
|
| 21 |
|
| 22 |
-
|
| 23 |
|
| 24 |
<!--- Describe your model here -->
|
| 25 |
|
|
@@ -35,7 +26,7 @@ Then you can use the model like this:
|
|
| 35 |
|
| 36 |
```python
|
| 37 |
from sentence_transformers import SentenceTransformer
|
| 38 |
-
sentences = ["
|
| 39 |
|
| 40 |
model = SentenceTransformer('sergioburdisso/dialog2flow-single-bert-base')
|
| 41 |
embeddings = model.encode(sentences)
|
|
@@ -60,7 +51,7 @@ def mean_pooling(model_output, attention_mask):
|
|
| 60 |
|
| 61 |
|
| 62 |
# Sentences we want sentence embeddings for
|
| 63 |
-
sentences = ['
|
| 64 |
|
| 65 |
# Load model from HuggingFace Hub
|
| 66 |
tokenizer = AutoTokenizer.from_pretrained('sergioburdisso/dialog2flow-single-bert-base')
|
|
@@ -80,23 +71,21 @@ print("Sentence embeddings:")
|
|
| 80 |
print(sentence_embeddings)
|
| 81 |
```
|
| 82 |
|
| 83 |
-
## Training
|
| 84 |
-
The model was trained with the parameters:
|
| 85 |
|
| 86 |
-
**DataLoader**:
|
| 87 |
|
| 88 |
-
|
| 89 |
-
```
|
| 90 |
-
{'batch_size': 64, 'sampler': 'torch.utils.data.sampler.RandomSampler', 'batch_sampler': 'torch.utils.data.sampler.BatchSampler'}
|
| 91 |
-
```
|
| 92 |
|
| 93 |
-
|
| 94 |
|
| 95 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 96 |
|
| 97 |
**DataLoader**:
|
| 98 |
|
| 99 |
-
`torch.utils.data.dataloader.DataLoader` of length
|
| 100 |
```
|
| 101 |
{'batch_size': 64, 'sampler': 'torch.utils.data.sampler.RandomSampler', 'batch_sampler': 'torch.utils.data.sampler.BatchSampler'}
|
| 102 |
```
|
|
@@ -109,7 +98,7 @@ Parameters of the fit()-Method:
|
|
| 109 |
```
|
| 110 |
{
|
| 111 |
"epochs": 15,
|
| 112 |
-
"evaluation_steps":
|
| 113 |
"evaluator": [
|
| 114 |
"spretrainer.evaluation.FewShotClassificationEvaluator.FewShotClassificationEvaluator"
|
| 115 |
],
|
|
@@ -135,22 +124,4 @@ SentenceTransformer(
|
|
| 135 |
|
| 136 |
## Citing & Authors
|
| 137 |
|
| 138 |
-
|
| 139 |
-
```bibtex
|
| 140 |
-
@inproceedings{burdisso-etal-2024-dialog2flow,
|
| 141 |
-
title = "Dialog2Flow: Pre-training Soft-Contrastive Action-Driven Sentence Embeddings for Automatic Dialog Flow Extraction",
|
| 142 |
-
author = "Burdisso, Sergio and
|
| 143 |
-
Madikeri, Srikanth and
|
| 144 |
-
Motlicek, Petr",
|
| 145 |
-
booktitle = "Proceedings of the 2024 Conference on Empirical Methods in Natural Language Processing",
|
| 146 |
-
month = nov,
|
| 147 |
-
year = "2024",
|
| 148 |
-
address = "Miami",
|
| 149 |
-
publisher = "Association for Computational Linguistics",
|
| 150 |
-
}
|
| 151 |
-
```
|
| 152 |
-
|
| 153 |
-
## License
|
| 154 |
-
|
| 155 |
-
Copyright (c) 2024 [Idiap Research Institute](https://www.idiap.ch/).
|
| 156 |
-
MIT License.
|
|
|
|
| 1 |
---
|
| 2 |
+
pipeline_tag: sentence-similarity
|
|
|
|
|
|
|
| 3 |
tags:
|
| 4 |
- sentence-transformers
|
| 5 |
+
- feature-extraction
|
| 6 |
- sentence-similarity
|
| 7 |
+
- transformers
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
|
| 9 |
+
---
|
| 10 |
|
| 11 |
+
# sergioburdisso/dialog2flow-single-bert-base
|
|
|
|
|
|
|
| 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 |
|
|
|
|
| 26 |
|
| 27 |
```python
|
| 28 |
from sentence_transformers import SentenceTransformer
|
| 29 |
+
sentences = ["This is an example sentence", "Each sentence is converted"]
|
| 30 |
|
| 31 |
model = SentenceTransformer('sergioburdisso/dialog2flow-single-bert-base')
|
| 32 |
embeddings = model.encode(sentences)
|
|
|
|
| 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('sergioburdisso/dialog2flow-single-bert-base')
|
|
|
|
| 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=sergioburdisso/dialog2flow-single-bert-base)
|
| 81 |
+
|
| 82 |
+
|
| 83 |
+
## Training
|
| 84 |
+
The model was trained with the parameters:
|
| 85 |
|
| 86 |
**DataLoader**:
|
| 87 |
|
| 88 |
+
`torch.utils.data.dataloader.DataLoader` of length 24615 with parameters:
|
| 89 |
```
|
| 90 |
{'batch_size': 64, 'sampler': 'torch.utils.data.sampler.RandomSampler', 'batch_sampler': 'torch.utils.data.sampler.BatchSampler'}
|
| 91 |
```
|
|
|
|
| 98 |
```
|
| 99 |
{
|
| 100 |
"epochs": 15,
|
| 101 |
+
"evaluation_steps": 246,
|
| 102 |
"evaluator": [
|
| 103 |
"spretrainer.evaluation.FewShotClassificationEvaluator.FewShotClassificationEvaluator"
|
| 104 |
],
|
|
|
|
| 124 |
|
| 125 |
## Citing & Authors
|
| 126 |
|
| 127 |
+
<!--- Describe where people can find more information -->
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
config.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
{
|
| 2 |
-
"_name_or_path": "
|
| 3 |
"architectures": [
|
| 4 |
"BertModel"
|
| 5 |
],
|
|
@@ -8,14 +8,14 @@
|
|
| 8 |
"gradient_checkpointing": false,
|
| 9 |
"hidden_act": "gelu",
|
| 10 |
"hidden_dropout_prob": 0.1,
|
| 11 |
-
"hidden_size":
|
| 12 |
"initializer_range": 0.02,
|
| 13 |
-
"intermediate_size":
|
| 14 |
"layer_norm_eps": 1e-12,
|
| 15 |
"max_position_embeddings": 512,
|
| 16 |
"model_type": "bert",
|
| 17 |
"num_attention_heads": 12,
|
| 18 |
-
"num_hidden_layers":
|
| 19 |
"pad_token_id": 0,
|
| 20 |
"position_embedding_type": "absolute",
|
| 21 |
"torch_dtype": "float32",
|
|
|
|
| 1 |
{
|
| 2 |
+
"_name_or_path": "/idiap/temp/sburdisso/repos/jsalt/keya-dialog/outputs/tod_all/bert-base-uncased/soft-labels/label_multi-qa-mpnet-base-dot-v1_t0.35/msl64_pm-mean/ch-on_t0.05/lr3e-06_bs64_e15/best_model_metric_0",
|
| 3 |
"architectures": [
|
| 4 |
"BertModel"
|
| 5 |
],
|
|
|
|
| 8 |
"gradient_checkpointing": false,
|
| 9 |
"hidden_act": "gelu",
|
| 10 |
"hidden_dropout_prob": 0.1,
|
| 11 |
+
"hidden_size": 768,
|
| 12 |
"initializer_range": 0.02,
|
| 13 |
+
"intermediate_size": 3072,
|
| 14 |
"layer_norm_eps": 1e-12,
|
| 15 |
"max_position_embeddings": 512,
|
| 16 |
"model_type": "bert",
|
| 17 |
"num_attention_heads": 12,
|
| 18 |
+
"num_hidden_layers": 12,
|
| 19 |
"pad_token_id": 0,
|
| 20 |
"position_embedding_type": "absolute",
|
| 21 |
"torch_dtype": "float32",
|
config_sentence_transformers.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
{
|
| 2 |
"__version__": {
|
| 3 |
-
"sentence_transformers": "2.
|
| 4 |
-
"transformers": "4.
|
| 5 |
-
"pytorch": "
|
| 6 |
}
|
| 7 |
}
|
|
|
|
| 1 |
{
|
| 2 |
"__version__": {
|
| 3 |
+
"sentence_transformers": "2.2.2",
|
| 4 |
+
"transformers": "4.30.2",
|
| 5 |
+
"pytorch": "2.0.1"
|
| 6 |
}
|
| 7 |
}
|
model.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:9b52bd99938d67ad3acab3856640ea0341897c9bad7921f7a0a1b073bb3080dc
|
| 3 |
+
size 437951328
|
modules.json
CHANGED
|
@@ -10,11 +10,5 @@
|
|
| 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 |
]
|
|
|
|
| 10 |
"name": "1",
|
| 11 |
"path": "1_Pooling",
|
| 12 |
"type": "sentence_transformers.models.Pooling"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 13 |
}
|
| 14 |
]
|
sentence_bert_config.json
CHANGED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
{
|
| 2 |
-
"max_seq_length":
|
| 3 |
"do_lower_case": false
|
| 4 |
}
|
|
|
|
| 1 |
{
|
| 2 |
+
"max_seq_length": 64,
|
| 3 |
"do_lower_case": false
|
| 4 |
}
|
tokenizer.json
CHANGED
|
@@ -2,14 +2,12 @@
|
|
| 2 |
"version": "1.0",
|
| 3 |
"truncation": {
|
| 4 |
"direction": "Right",
|
| 5 |
-
"max_length":
|
| 6 |
"strategy": "LongestFirst",
|
| 7 |
"stride": 0
|
| 8 |
},
|
| 9 |
"padding": {
|
| 10 |
-
"strategy":
|
| 11 |
-
"Fixed": 128
|
| 12 |
-
},
|
| 13 |
"direction": "Right",
|
| 14 |
"pad_to_multiple_of": null,
|
| 15 |
"pad_id": 0,
|
|
|
|
| 2 |
"version": "1.0",
|
| 3 |
"truncation": {
|
| 4 |
"direction": "Right",
|
| 5 |
+
"max_length": 64,
|
| 6 |
"strategy": "LongestFirst",
|
| 7 |
"stride": 0
|
| 8 |
},
|
| 9 |
"padding": {
|
| 10 |
+
"strategy": "BatchLongest",
|
|
|
|
|
|
|
| 11 |
"direction": "Right",
|
| 12 |
"pad_to_multiple_of": null,
|
| 13 |
"pad_id": 0,
|
tokenizer_config.json
CHANGED
|
@@ -43,12 +43,10 @@
|
|
| 43 |
},
|
| 44 |
"clean_up_tokenization_spaces": true,
|
| 45 |
"cls_token": "[CLS]",
|
| 46 |
-
"do_basic_tokenize": true,
|
| 47 |
"do_lower_case": true,
|
| 48 |
"mask_token": "[MASK]",
|
| 49 |
-
"max_length":
|
| 50 |
"model_max_length": 512,
|
| 51 |
-
"never_split": null,
|
| 52 |
"pad_to_multiple_of": null,
|
| 53 |
"pad_token": "[PAD]",
|
| 54 |
"pad_token_type_id": 0,
|
|
|
|
| 43 |
},
|
| 44 |
"clean_up_tokenization_spaces": true,
|
| 45 |
"cls_token": "[CLS]",
|
|
|
|
| 46 |
"do_lower_case": true,
|
| 47 |
"mask_token": "[MASK]",
|
| 48 |
+
"max_length": 64,
|
| 49 |
"model_max_length": 512,
|
|
|
|
| 50 |
"pad_to_multiple_of": null,
|
| 51 |
"pad_token": "[PAD]",
|
| 52 |
"pad_token_type_id": 0,
|