Add new CrossEncoder model
Browse files- README.md +32 -32
- config.json +37 -29
- 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 |
-
- FacebookAI/roberta-large
|
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-roberta-large')
|
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 |
+
- FacebookAI/roberta-large
|
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-roberta-large')
|
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,29 +1,37 @@
|
|
1 |
-
{
|
2 |
-
"_num_labels": 3,
|
3 |
-
"architectures": [
|
4 |
-
"RobertaForSequenceClassification"
|
5 |
-
],
|
6 |
-
"attention_probs_dropout_prob": 0.1,
|
7 |
-
"bos_token_id": 0,
|
8 |
-
"
|
9 |
-
"
|
10 |
-
"
|
11 |
-
"
|
12 |
-
"
|
13 |
-
"
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
"
|
18 |
-
"
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
"
|
23 |
-
"
|
24 |
-
"
|
25 |
-
"
|
26 |
-
"
|
27 |
-
"
|
28 |
-
"
|
29 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"_num_labels": 3,
|
3 |
+
"architectures": [
|
4 |
+
"RobertaForSequenceClassification"
|
5 |
+
],
|
6 |
+
"attention_probs_dropout_prob": 0.1,
|
7 |
+
"bos_token_id": 0,
|
8 |
+
"classifier_dropout": null,
|
9 |
+
"eos_token_id": 2,
|
10 |
+
"gradient_checkpointing": false,
|
11 |
+
"hidden_act": "gelu",
|
12 |
+
"hidden_dropout_prob": 0.1,
|
13 |
+
"hidden_size": 1024,
|
14 |
+
"id2label": {
|
15 |
+
"0": "LABEL_0"
|
16 |
+
},
|
17 |
+
"initializer_range": 0.02,
|
18 |
+
"intermediate_size": 4096,
|
19 |
+
"label2id": {
|
20 |
+
"LABEL_0": 0
|
21 |
+
},
|
22 |
+
"layer_norm_eps": 1e-05,
|
23 |
+
"max_position_embeddings": 514,
|
24 |
+
"model_type": "roberta",
|
25 |
+
"num_attention_heads": 16,
|
26 |
+
"num_hidden_layers": 24,
|
27 |
+
"pad_token_id": 1,
|
28 |
+
"position_embedding_type": "absolute",
|
29 |
+
"sentence_transformers": {
|
30 |
+
"activation_fn": "torch.nn.modules.activation.Sigmoid",
|
31 |
+
"version": "4.1.0.dev0"
|
32 |
+
},
|
33 |
+
"transformers_version": "4.52.0.dev0",
|
34 |
+
"type_vocab_size": 1,
|
35 |
+
"use_cache": true,
|
36 |
+
"vocab_size": 50265
|
37 |
+
}
|
onnx/model.onnx
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:b26274ff04219b5bcc8e09202205201d0e9bfb8905d02c5cb9d2e133f229d55c
|
3 |
+
size 1422070180
|