nreimers commited on
Commit
315f711
1 Parent(s): e4cc72e
CEBinaryAccuracyEvaluator_qnli-dev_results.csv ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ epoch,steps,Accuracy
2
+ 0,-1,0.8941973274757459
3
+ 1,-1,0.9064616511074501
4
+ 2,-1,0.909573494416987
5
+ 3,-1,0.9055464030752334
6
+ 4,-1,0.9082921471718836
README.md ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Cross-Encoder for Quora Duplicate Questions Detection
2
+ This model was trained using [SentenceTransformers](https://sbert.net) [Cross-Encoder](https://www.sbert.net/examples/applications/cross-encoder/README.html) class.
3
+
4
+ ## Training Data
5
+ Given a question and paragraph, can the question be answered by the paragraph? The models have been trained on the [GLUE QNLI](https://arxiv.org/abs/1804.07461) dataset, which transformed the [SQuAD dataset](https://rajpurkar.github.io/SQuAD-explorer/) into an NLI task.
6
+
7
+ ## Performance
8
+ For performance results of this model, see [SBERT.net Pre-trained Cross-Encoder][https://www.sbert.net/docs/pretrained_cross-encoders.html].
9
+
10
+ ## Usage
11
+
12
+ Pre-trained models can be used like this:
13
+ ```python
14
+ from sentence_transformers import CrossEncoder
15
+ model = CrossEncoder('model_name')
16
+ scores = model.predict([('Query1', 'Paragraph1'), ('Query2', 'Paragraph2')])
17
+
18
+ #e.g.
19
+ scores = model.predict([('How many people live in Berlin?', 'Berlin had a population of 3,520,031 registered inhabitants in an area of 891.82 square kilometers.'), ('What is the size of New York?', 'New York City is famous for the Metropolitan Museum of Art.')])
20
+ ```
21
+
22
+ ## Usage with Transformers AutoModel
23
+ You can use the model also directly with Transformers library (without SentenceTransformers library):
24
+ ```python
25
+ from transformers import AutoTokenizer, AutoModelForSequenceClassification
26
+ import torch
27
+
28
+ model = AutoModelForSequenceClassification.from_pretrained('model_name')
29
+ tokenizer = AutoTokenizer.from_pretrained('model_name')
30
+
31
+ features = tokenizer(['How many people live in Berlin?', 'What is the size of New York?'], ['Berlin had a population of 3,520,031 registered inhabitants in an area of 891.82 square kilometers.', 'New York City is famous for the Metropolitan Museum of Art.'], padding=True, truncation=True, return_tensors="pt")
32
+
33
+ model.eval()
34
+ with torch.no_grad():
35
+ scores = torch.nn.functional.sigmoid(model(**features).logits)
36
+ print(scores)
37
+ ```
config.json ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_name_or_path": "distilroberta-base",
3
+ "architectures": [
4
+ "RobertaForSequenceClassification"
5
+ ],
6
+ "attention_probs_dropout_prob": 0.1,
7
+ "bos_token_id": 0,
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
+ "type_vocab_size": 1,
29
+ "vocab_size": 50265
30
+ }
merges.txt ADDED
The diff for this file is too large to render. See raw diff
pytorch_model.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2f87f2db9fdf8b9c534ad88e73295d9771f622ad68acb0cd34f48e04e3cce140
3
+ size 328525929
special_tokens_map.json ADDED
@@ -0,0 +1 @@
 
1
+ {"bos_token": "<s>", "eos_token": "</s>", "unk_token": "<unk>", "sep_token": "</s>", "pad_token": "<pad>", "cls_token": "<s>", "mask_token": {"content": "<mask>", "single_word": false, "lstrip": true, "rstrip": false, "normalized": false}}
tokenizer_config.json ADDED
@@ -0,0 +1 @@
 
1
+ {"unk_token": "<unk>", "bos_token": "<s>", "eos_token": "</s>", "add_prefix_space": false, "errors": "replace", "sep_token": "</s>", "cls_token": "<s>", "pad_token": "<pad>", "mask_token": "<mask>", "model_max_length": 512, "name_or_path": "distilroberta-base"}
vocab.json ADDED
The diff for this file is too large to render. See raw diff