tomaarsen HF staff commited on
Commit
75b56ed
·
verified ·
1 Parent(s): 841d331

L-\d -> L\d

Browse files
Files changed (1) hide show
  1. README.md +12 -11
README.md CHANGED
@@ -14,8 +14,8 @@ The model can be used for Information Retrieval: Given a query, encode the query
14
  from transformers import AutoTokenizer, AutoModelForSequenceClassification
15
  import torch
16
 
17
- model = AutoModelForSequenceClassification.from_pretrained('model_name')
18
- tokenizer = AutoTokenizer.from_pretrained('model_name')
19
 
20
  features = tokenizer(['How many people live in Berlin?', 'How many people live in Berlin?'], ['Berlin has 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")
21
 
@@ -31,7 +31,8 @@ with torch.no_grad():
31
  The usage becomes easier when you have [SentenceTransformers](https://www.sbert.net/) installed. Then, you can use the pre-trained models like this:
32
  ```python
33
  from sentence_transformers import CrossEncoder
34
- model = CrossEncoder('model_name', max_length=512)
 
35
  scores = model.predict([('Query', 'Paragraph1'), ('Query', 'Paragraph2') , ('Query', 'Paragraph3')])
36
  ```
37
 
@@ -43,15 +44,15 @@ In the following table, we provide various pre-trained Cross-Encoders together w
43
  | Model-Name | NDCG@10 (TREC DL 19) | MRR@10 (MS Marco Dev) | Docs / Sec |
44
  | ------------- |:-------------| -----| --- |
45
  | **Version 2 models** | | |
46
- | cross-encoder/ms-marco-TinyBERT-L-2-v2 | 69.84 | 32.56 | 9000
47
- | cross-encoder/ms-marco-MiniLM-L-2-v2 | 71.01 | 34.85 | 4100
48
- | cross-encoder/ms-marco-MiniLM-L-4-v2 | 73.04 | 37.70 | 2500
49
- | cross-encoder/ms-marco-MiniLM-L-6-v2 | 74.30 | 39.01 | 1800
50
- | cross-encoder/ms-marco-MiniLM-L-12-v2 | 74.31 | 39.02 | 960
51
  | **Version 1 models** | | |
52
- | cross-encoder/ms-marco-TinyBERT-L-2 | 67.43 | 30.15 | 9000
53
- | cross-encoder/ms-marco-TinyBERT-L-4 | 68.09 | 34.50 | 2900
54
- | cross-encoder/ms-marco-TinyBERT-L-6 | 69.57 | 36.13 | 680
55
  | cross-encoder/ms-marco-electra-base | 71.99 | 36.41 | 340
56
  | **Other models** | | |
57
  | nboost/pt-tinybert-msmarco | 63.63 | 28.80 | 2900
 
14
  from transformers import AutoTokenizer, AutoModelForSequenceClassification
15
  import torch
16
 
17
+ model = AutoModelForSequenceClassification.from_pretrained('cross-encoder/ms-marco-TinyBERT-L2-v2')
18
+ tokenizer = AutoTokenizer.from_pretrained('cross-encoder/ms-marco-TinyBERT-L2-v2')
19
 
20
  features = tokenizer(['How many people live in Berlin?', 'How many people live in Berlin?'], ['Berlin has 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")
21
 
 
31
  The usage becomes easier when you have [SentenceTransformers](https://www.sbert.net/) installed. Then, you can use the pre-trained models like this:
32
  ```python
33
  from sentence_transformers import CrossEncoder
34
+
35
+ model = CrossEncoder('cross-encoder/ms-marco-TinyBERT-L2-v2', max_length=512)
36
  scores = model.predict([('Query', 'Paragraph1'), ('Query', 'Paragraph2') , ('Query', 'Paragraph3')])
37
  ```
38
 
 
44
  | Model-Name | NDCG@10 (TREC DL 19) | MRR@10 (MS Marco Dev) | Docs / Sec |
45
  | ------------- |:-------------| -----| --- |
46
  | **Version 2 models** | | |
47
+ | cross-encoder/ms-marco-TinyBERT-L2-v2 | 69.84 | 32.56 | 9000
48
+ | cross-encoder/ms-marco-MiniLM-L2-v2 | 71.01 | 34.85 | 4100
49
+ | cross-encoder/ms-marco-MiniLM-L4-v2 | 73.04 | 37.70 | 2500
50
+ | cross-encoder/ms-marco-MiniLM-L6-v2 | 74.30 | 39.01 | 1800
51
+ | cross-encoder/ms-marco-MiniLM-L12-v2 | 74.31 | 39.02 | 960
52
  | **Version 1 models** | | |
53
+ | cross-encoder/ms-marco-TinyBERT-L2 | 67.43 | 30.15 | 9000
54
+ | cross-encoder/ms-marco-TinyBERT-L4 | 68.09 | 34.50 | 2900
55
+ | cross-encoder/ms-marco-TinyBERT-L6 | 69.57 | 36.13 | 680
56
  | cross-encoder/ms-marco-electra-base | 71.99 | 36.41 | 340
57
  | **Other models** | | |
58
  | nboost/pt-tinybert-msmarco | 63.63 | 28.80 | 2900