Update README.md
Browse files
README.md
CHANGED
|
@@ -59,7 +59,7 @@ for p in preds:
|
|
| 59 |
|
| 60 |
### 2. Use as an Encoder (CLS Embeddings)
|
| 61 |
|
| 62 |
-
```
|
| 63 |
import torch
|
| 64 |
from transformers import AutoTokenizer, AutoModel
|
| 65 |
|
|
@@ -91,7 +91,7 @@ print(embedding.shape) # torch.Size([768])
|
|
| 91 |
|
| 92 |
### 3. Compute Similarity Between Two Articles
|
| 93 |
|
| 94 |
-
```
|
| 95 |
import torch.nn.functional as F
|
| 96 |
|
| 97 |
e1 = encode("Article text one...")
|
|
|
|
| 59 |
|
| 60 |
### 2. Use as an Encoder (CLS Embeddings)
|
| 61 |
|
| 62 |
+
```python
|
| 63 |
import torch
|
| 64 |
from transformers import AutoTokenizer, AutoModel
|
| 65 |
|
|
|
|
| 91 |
|
| 92 |
### 3. Compute Similarity Between Two Articles
|
| 93 |
|
| 94 |
+
```python
|
| 95 |
import torch.nn.functional as F
|
| 96 |
|
| 97 |
e1 = encode("Article text one...")
|