PitKoro commited on
Commit
a8760f4
1 Parent(s): a574306

Update README.md

Browse files

пример 1

```python
from transformers import AutoTokenizer, AutoModelForSequenceClassification
import torch

sigmoid_fn = torch.nn.Sigmoid()
model = AutoModelForSequenceClassification.from_pretrained("/home/jovyan/pakorolev/ranker/deep_pavlov_mrr_0_8413")
tokenizer = AutoTokenizer.from_pretrained("/home/jovyan/pakorolev/ranker/deep_pavlov_mrr_0_8413")

text = [['привет', 'привет'],['привет', 'пока']]
tokenized = tokenizer(text, return_tensors='pt')

logits = model(**tokenized).logits
output = sigmoid_fn(logits.flatten())

print(output)
```


Пример 2:

```python
from sentence_transformers.cross_encoder import CrossEncoder

model = CrossEncoder("PitKoro/cross-encoder-ru-msmarco-passage")
text = [['привет', 'привет'],['привет', 'пока']]

output = model.predict(text)

print(output)
```

Files changed (1) hide show
  1. README.md +6 -1
README.md CHANGED
@@ -1,3 +1,8 @@
1
  ---
2
  license: apache-2.0
3
- ---
 
 
 
 
 
 
1
  ---
2
  license: apache-2.0
3
+ datasets:
4
+ - unicamp-dl/mmarco
5
+ language:
6
+ - ru
7
+ library_name: sentence-transformers
8
+ ---