Update README.md
Browse files
README.md
CHANGED
@@ -68,7 +68,7 @@ example = tokenizer(example, return_tensors='pt', padding=False).to(device) # to
|
|
68 |
with torch.no_grad():
|
69 |
logits = model(**example).logits.cpu().detach() # get logits from model
|
70 |
|
71 |
-
probability = F.softmax(
|
72 |
prediction = probability.argmax(dim=-1) # 0 for no interaction, 1 for interaction
|
73 |
```
|
74 |
|
|
|
68 |
with torch.no_grad():
|
69 |
logits = model(**example).logits.cpu().detach() # get logits from model
|
70 |
|
71 |
+
probability = F.softmax(logits, dim=-1) # use softmax to get "confidence" in the prediction
|
72 |
prediction = probability.argmax(dim=-1) # 0 for no interaction, 1 for interaction
|
73 |
```
|
74 |
|