pierluigic
commited on
Commit
•
a8a150f
1
Parent(s):
7375af9
Update README.md
Browse files
README.md
CHANGED
@@ -32,10 +32,11 @@ The training code is available here: [SBERT.net Training MS Marco](https://githu
|
|
32 |
from transformers import AutoTokenizer, AutoModelForSequenceClassification
|
33 |
import torch
|
34 |
|
35 |
-
model = AutoModelForSequenceClassification.from_pretrained('
|
36 |
-
tokenizer = AutoTokenizer.from_pretrained('
|
37 |
|
38 |
-
|
|
|
39 |
|
40 |
model.eval()
|
41 |
with torch.no_grad():
|
@@ -49,6 +50,6 @@ with torch.no_grad():
|
|
49 |
The usage becomes easier when you have [SentenceTransformers](https://www.sbert.net/) installed. Then, you can use the pre-trained models like this:
|
50 |
```python
|
51 |
from sentence_transformers import CrossEncoder
|
52 |
-
model = CrossEncoder('
|
53 |
-
labels = model.predict([('
|
54 |
```
|
|
|
32 |
from transformers import AutoTokenizer, AutoModelForSequenceClassification
|
33 |
import torch
|
34 |
|
35 |
+
model = AutoModelForSequenceClassification.from_pretrained('ChangeIsKey/change-type-classifier')
|
36 |
+
tokenizer = AutoTokenizer.from_pretrained('ChangeIsKey/change-type-classifier')
|
37 |
|
38 |
+
|
39 |
+
features = tokenizer([['to quickly take something in your hand(s) and hold it firmly', 'to understand something, especially something difficult'], ['To move at a leisurely and relaxed pace, typically by foot', 'To move or travel, irrespective of the mode of transportation']], padding=True, truncation=True, return_tensors="pt")
|
40 |
|
41 |
model.eval()
|
42 |
with torch.no_grad():
|
|
|
50 |
The usage becomes easier when you have [SentenceTransformers](https://www.sbert.net/) installed. Then, you can use the pre-trained models like this:
|
51 |
```python
|
52 |
from sentence_transformers import CrossEncoder
|
53 |
+
model = CrossEncoder('ChangeIsKey/change-type-classifier', max_length=512)
|
54 |
+
labels = model.predict([('to quickly take something in your hand(s) and hold it firmly', 'to understand something, especially something difficult'), ('To move at a leisurely and relaxed pace, typically by foot', 'To move or travel, irrespective of the mode of transportation')])
|
55 |
```
|