Add new CrossEncoder model
Browse files- README.md +32 -32
- config.json +36 -28
- onnx/model.onnx +3 -0
README.md
CHANGED
|
@@ -1,33 +1,33 @@
|
|
| 1 |
-
---
|
| 2 |
-
license: apache-2.0
|
| 3 |
-
datasets:
|
| 4 |
-
- sentence-transformers/stsb
|
| 5 |
-
language:
|
| 6 |
-
- en
|
| 7 |
-
base_model:
|
| 8 |
-
- distilbert/distilroberta-base
|
| 9 |
-
pipeline_tag: text-ranking
|
| 10 |
-
library_name: sentence-transformers
|
| 11 |
-
tags:
|
| 12 |
-
- transformers
|
| 13 |
-
---
|
| 14 |
-
# Cross-Encoder for Semantic Textual Similarity
|
| 15 |
-
This model was trained using [SentenceTransformers](https://sbert.net) [Cross-Encoder](https://www.sbert.net/examples/applications/cross-encoder/README.html) class.
|
| 16 |
-
|
| 17 |
-
## Training Data
|
| 18 |
-
This model was trained on the [STS benchmark dataset](http://ixa2.si.ehu.eus/stswiki/index.php/STSbenchmark). The model will predict a score between 0 and 1 how for the semantic similarity of two sentences.
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
## Usage and Performance
|
| 22 |
-
|
| 23 |
-
Pre-trained models can be used like this:
|
| 24 |
-
```python
|
| 25 |
-
from sentence_transformers import CrossEncoder
|
| 26 |
-
|
| 27 |
-
model = CrossEncoder('cross-encoder/stsb-distilroberta-base')
|
| 28 |
-
scores = model.predict([('Sentence 1', 'Sentence 2'), ('Sentence 3', 'Sentence 4')])
|
| 29 |
-
```
|
| 30 |
-
|
| 31 |
-
The model will predict scores for the pairs `('Sentence 1', 'Sentence 2')` and `('Sentence 3', 'Sentence 4')`.
|
| 32 |
-
|
| 33 |
You can use this model also without sentence_transformers and by just using Transformers ``AutoModel`` class
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
datasets:
|
| 4 |
+
- sentence-transformers/stsb
|
| 5 |
+
language:
|
| 6 |
+
- en
|
| 7 |
+
base_model:
|
| 8 |
+
- distilbert/distilroberta-base
|
| 9 |
+
pipeline_tag: text-ranking
|
| 10 |
+
library_name: sentence-transformers
|
| 11 |
+
tags:
|
| 12 |
+
- transformers
|
| 13 |
+
---
|
| 14 |
+
# Cross-Encoder for Semantic Textual Similarity
|
| 15 |
+
This model was trained using [SentenceTransformers](https://sbert.net) [Cross-Encoder](https://www.sbert.net/examples/applications/cross-encoder/README.html) class.
|
| 16 |
+
|
| 17 |
+
## Training Data
|
| 18 |
+
This model was trained on the [STS benchmark dataset](http://ixa2.si.ehu.eus/stswiki/index.php/STSbenchmark). The model will predict a score between 0 and 1 how for the semantic similarity of two sentences.
|
| 19 |
+
|
| 20 |
+
|
| 21 |
+
## Usage and Performance
|
| 22 |
+
|
| 23 |
+
Pre-trained models can be used like this:
|
| 24 |
+
```python
|
| 25 |
+
from sentence_transformers import CrossEncoder
|
| 26 |
+
|
| 27 |
+
model = CrossEncoder('cross-encoder/stsb-distilroberta-base')
|
| 28 |
+
scores = model.predict([('Sentence 1', 'Sentence 2'), ('Sentence 3', 'Sentence 4')])
|
| 29 |
+
```
|
| 30 |
+
|
| 31 |
+
The model will predict scores for the pairs `('Sentence 1', 'Sentence 2')` and `('Sentence 3', 'Sentence 4')`.
|
| 32 |
+
|
| 33 |
You can use this model also without sentence_transformers and by just using Transformers ``AutoModel`` class
|
config.json
CHANGED
|
@@ -1,28 +1,36 @@
|
|
| 1 |
-
{
|
| 2 |
-
"architectures": [
|
| 3 |
-
"RobertaForSequenceClassification"
|
| 4 |
-
],
|
| 5 |
-
"attention_probs_dropout_prob": 0.1,
|
| 6 |
-
"bos_token_id": 0,
|
| 7 |
-
"
|
| 8 |
-
"
|
| 9 |
-
"
|
| 10 |
-
"
|
| 11 |
-
"
|
| 12 |
-
"
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
"
|
| 17 |
-
"
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
"
|
| 22 |
-
"
|
| 23 |
-
"
|
| 24 |
-
"
|
| 25 |
-
"
|
| 26 |
-
"
|
| 27 |
-
"
|
| 28 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"architectures": [
|
| 3 |
+
"RobertaForSequenceClassification"
|
| 4 |
+
],
|
| 5 |
+
"attention_probs_dropout_prob": 0.1,
|
| 6 |
+
"bos_token_id": 0,
|
| 7 |
+
"classifier_dropout": null,
|
| 8 |
+
"eos_token_id": 2,
|
| 9 |
+
"gradient_checkpointing": false,
|
| 10 |
+
"hidden_act": "gelu",
|
| 11 |
+
"hidden_dropout_prob": 0.1,
|
| 12 |
+
"hidden_size": 768,
|
| 13 |
+
"id2label": {
|
| 14 |
+
"0": "LABEL_0"
|
| 15 |
+
},
|
| 16 |
+
"initializer_range": 0.02,
|
| 17 |
+
"intermediate_size": 3072,
|
| 18 |
+
"label2id": {
|
| 19 |
+
"LABEL_0": 0
|
| 20 |
+
},
|
| 21 |
+
"layer_norm_eps": 1e-05,
|
| 22 |
+
"max_position_embeddings": 514,
|
| 23 |
+
"model_type": "roberta",
|
| 24 |
+
"num_attention_heads": 12,
|
| 25 |
+
"num_hidden_layers": 6,
|
| 26 |
+
"pad_token_id": 1,
|
| 27 |
+
"position_embedding_type": "absolute",
|
| 28 |
+
"sentence_transformers": {
|
| 29 |
+
"activation_fn": "torch.nn.modules.activation.Sigmoid",
|
| 30 |
+
"version": "4.1.0.dev0"
|
| 31 |
+
},
|
| 32 |
+
"transformers_version": "4.52.0.dev0",
|
| 33 |
+
"type_vocab_size": 1,
|
| 34 |
+
"use_cache": true,
|
| 35 |
+
"vocab_size": 50265
|
| 36 |
+
}
|
onnx/model.onnx
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:10e20822d3d976a31398e1b54c9c1fb2302bdc6630fe0a54dd8376799a00ced2
|
| 3 |
+
size 328643805
|