Update README.md
Browse files
README.md
CHANGED
@@ -13,11 +13,6 @@ license: apache-2.0
|
|
13 |
```python
|
14 |
from sentence_transformers import CrossEncoder
|
15 |
import numpy as np
|
16 |
-
|
17 |
-
# Function that applies sigmoid to a score
|
18 |
-
def sigmoid(x):
|
19 |
-
return 1 / (1 + np.exp(-x))
|
20 |
-
|
21 |
model = CrossEncoder('HeTree/HeCross')
|
22 |
|
23 |
# Scores (already after sigmoid)
|
@@ -31,6 +26,11 @@ You can use the model also directly with Transformers library (without SentenceT
|
|
31 |
```python
|
32 |
from transformers import AutoTokenizer, AutoModelForSequenceClassification
|
33 |
import torch
|
|
|
|
|
|
|
|
|
|
|
34 |
model = AutoModelForSequenceClassification.from_pretrained('HeTree/HeCross')
|
35 |
tokenizer = AutoTokenizer.from_pretrained('HeTree/HeCross')
|
36 |
features = tokenizer(['כמה אנשים חיים בברלין?', 'כמה אנשים חיים בברלין?'],
|
|
|
13 |
```python
|
14 |
from sentence_transformers import CrossEncoder
|
15 |
import numpy as np
|
|
|
|
|
|
|
|
|
|
|
16 |
model = CrossEncoder('HeTree/HeCross')
|
17 |
|
18 |
# Scores (already after sigmoid)
|
|
|
26 |
```python
|
27 |
from transformers import AutoTokenizer, AutoModelForSequenceClassification
|
28 |
import torch
|
29 |
+
|
30 |
+
# Function that applies sigmoid to a score
|
31 |
+
def sigmoid(x):
|
32 |
+
return 1 / (1 + np.exp(-x))
|
33 |
+
|
34 |
model = AutoModelForSequenceClassification.from_pretrained('HeTree/HeCross')
|
35 |
tokenizer = AutoTokenizer.from_pretrained('HeTree/HeCross')
|
36 |
features = tokenizer(['כמה אנשים חיים בברלין?', 'כמה אנשים חיים בברלין?'],
|