Update README.md
Browse files
README.md
CHANGED
|
@@ -9,119 +9,18 @@ tags:
|
|
| 9 |
|
| 10 |
---
|
| 11 |
|
| 12 |
-
#
|
| 13 |
|
| 14 |
-
This is a [sentence-transformers](https://www.SBERT.net) model: It maps
|
| 15 |
|
| 16 |
<!--- Describe your model here -->
|
| 17 |
|
| 18 |
-
##
|
| 19 |
-
|
| 20 |
-
Using this model becomes easy when you have [sentence-transformers](https://www.SBERT.net) installed:
|
| 21 |
-
|
| 22 |
-
```
|
| 23 |
-
pip install -U sentence-transformers
|
| 24 |
-
```
|
| 25 |
-
|
| 26 |
-
Then you can use the model like this:
|
| 27 |
-
|
| 28 |
-
```python
|
| 29 |
-
from sentence_transformers import SentenceTransformer
|
| 30 |
-
sentences = ["This is an example sentence", "Each sentence is converted"]
|
| 31 |
-
|
| 32 |
-
model = SentenceTransformer('{MODEL_NAME}')
|
| 33 |
-
embeddings = model.encode(sentences)
|
| 34 |
-
print(embeddings)
|
| 35 |
-
```
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
## Usage (HuggingFace Transformers)
|
| 40 |
-
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.
|
| 41 |
-
|
| 42 |
-
```python
|
| 43 |
-
from transformers import AutoTokenizer, AutoModel
|
| 44 |
-
import torch
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
def cls_pooling(model_output, attention_mask):
|
| 48 |
-
return model_output[0][:,0]
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
# Sentences we want sentence embeddings for
|
| 52 |
-
sentences = ['This is an example sentence', 'Each sentence is converted']
|
| 53 |
-
|
| 54 |
-
# Load model from HuggingFace Hub
|
| 55 |
-
tokenizer = AutoTokenizer.from_pretrained('{MODEL_NAME}')
|
| 56 |
-
model = AutoModel.from_pretrained('{MODEL_NAME}')
|
| 57 |
-
|
| 58 |
-
# Tokenize sentences
|
| 59 |
-
encoded_input = tokenizer(sentences, padding=True, truncation=True, return_tensors='pt')
|
| 60 |
-
|
| 61 |
-
# Compute token embeddings
|
| 62 |
-
with torch.no_grad():
|
| 63 |
-
model_output = model(**encoded_input)
|
| 64 |
-
|
| 65 |
-
# Perform pooling. In this case, cls pooling.
|
| 66 |
-
sentence_embeddings = cls_pooling(model_output, encoded_input['attention_mask'])
|
| 67 |
-
|
| 68 |
-
print("Sentence embeddings:")
|
| 69 |
-
print(sentence_embeddings)
|
| 70 |
-
```
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
## Evaluation Results
|
| 75 |
-
|
| 76 |
-
<!--- Describe how your model was evaluated -->
|
| 77 |
-
|
| 78 |
-
For an automated evaluation of this model, see the *Sentence Embeddings Benchmark*: [https://seb.sbert.net](https://seb.sbert.net?model_name={MODEL_NAME})
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
## Training
|
| 82 |
-
The model was trained with the parameters:
|
| 83 |
-
|
| 84 |
-
**DataLoader**:
|
| 85 |
-
|
| 86 |
-
`torch.utils.data.dataloader.DataLoader` of length 55614 with parameters:
|
| 87 |
-
```
|
| 88 |
-
{'batch_size': 64, 'sampler': 'torch.utils.data.sampler.RandomSampler', 'batch_sampler': 'torch.utils.data.sampler.BatchSampler'}
|
| 89 |
-
```
|
| 90 |
-
|
| 91 |
-
**Loss**:
|
| 92 |
-
|
| 93 |
-
`sentence_transformers.losses.MultipleNegativesRankingLoss.MultipleNegativesRankingLoss` with parameters:
|
| 94 |
-
```
|
| 95 |
-
{'scale': 20.0, 'similarity_fct': 'dot_score'}
|
| 96 |
-
```
|
| 97 |
-
|
| 98 |
-
Parameters of the fit()-Method:
|
| 99 |
```
|
| 100 |
-
{
|
| 101 |
-
|
| 102 |
-
|
| 103 |
-
|
| 104 |
-
|
| 105 |
-
"optimizer_class": "<class 'torch.optim.adamw.AdamW'>",
|
| 106 |
-
"optimizer_params": {
|
| 107 |
-
"lr": 2e-05
|
| 108 |
-
},
|
| 109 |
-
"scheduler": "WarmupLinear",
|
| 110 |
-
"steps_per_epoch": null,
|
| 111 |
-
"warmup_steps": 1000,
|
| 112 |
-
"weight_decay": 0.01
|
| 113 |
}
|
| 114 |
-
```
|
| 115 |
-
|
| 116 |
-
|
| 117 |
-
## Full Model Architecture
|
| 118 |
-
```
|
| 119 |
-
SentenceTransformer(
|
| 120 |
-
(0): Transformer({'max_seq_length': 512, 'do_lower_case': False}) with Transformer model: DistilBertModel
|
| 121 |
-
(1): Pooling({'word_embedding_dimension': 768, 'pooling_mode_cls_token': True, 'pooling_mode_mean_tokens': False, 'pooling_mode_max_tokens': False, 'pooling_mode_mean_sqrt_len_tokens': False, 'pooling_mode_weightedmean_tokens': False, 'pooling_mode_lasttoken': False})
|
| 122 |
-
)
|
| 123 |
-
```
|
| 124 |
-
|
| 125 |
-
## Citing & Authors
|
| 126 |
-
|
| 127 |
-
<!--- Describe where people can find more information -->
|
|
|
|
| 9 |
|
| 10 |
---
|
| 11 |
|
| 12 |
+
# ANCE ProCIS
|
| 13 |
|
| 14 |
+
This is a [sentence-transformers](https://www.SBERT.net) model based on DistilBERT: It maps conversations and passages to dense embeddings for retrieval in the context of conversations. It's trained on the [ProCIS dataset](https://github.com/algoprog/ProCIS).
|
| 15 |
|
| 16 |
<!--- Describe your model here -->
|
| 17 |
|
| 18 |
+
## Citing & Authors
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19 |
```
|
| 20 |
+
@article{Anonymous_2024_ProCIS,
|
| 21 |
+
title = {ProCIS: A Benchmark for Proactive Retrieval in Conversations},
|
| 22 |
+
author = {},
|
| 23 |
+
journal = {Proceedings of the 47th International ACM SIGIR Conference on Research and Development in Information Retrieval},
|
| 24 |
+
year = {2024}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 25 |
}
|
| 26 |
+
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|