pierluigic commited on
Commit
a8a150f
1 Parent(s): 7375af9

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +6 -5
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('model_name')
36
- tokenizer = AutoTokenizer.from_pretrained('model_name')
37
 
38
- 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")
 
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('model_name', max_length=512)
53
- labels = model.predict([('Query', 'Paragraph1'), ('Query', 'Paragraph2') , ('Query', 'Paragraph3')])
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
  ```