Update README.md
Browse files
README.md
CHANGED
@@ -26,12 +26,19 @@ model-index:
|
|
26 |
name: MRR@10
|
27 |
verified: false
|
28 |
widget:
|
29 |
-
-
|
30 |
-
|
31 |
-
- "
|
32 |
-
|
33 |
-
|
34 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
35 |
---
|
36 |
|
37 |
## Installation
|
@@ -77,19 +84,16 @@ scores = model.predict(tokenized_pairs)
|
|
77 |
|
78 |
```python
|
79 |
from transformers import AutoTokenizer, AutoModelForSequenceClassification
|
80 |
-
import torch
|
81 |
|
82 |
model = AutoModelForSequenceClassification.from_pretrained('itdainb/vietnamese-cross-encoder')
|
83 |
tokenizer = AutoTokenizer.from_pretrained('itdainb/vietnamese-cross-encoder')
|
84 |
|
85 |
-
activation_fct = torch.nn.Identity()
|
86 |
-
|
87 |
features = tokenizer(tokenized_pairs, padding=True, truncation="longest_first", return_tensors="pt", max_length=256)
|
88 |
|
89 |
model.eval()
|
90 |
with torch.no_grad():
|
91 |
model_predictions = model(**features, return_dict=True)
|
92 |
-
logits =
|
93 |
|
94 |
scores = [score[0] for score in logits]
|
95 |
print(scores)
|
|
|
26 |
name: MRR@10
|
27 |
verified: false
|
28 |
widget:
|
29 |
+
- text: "UIT là gì ?. Trường Đại_học Công_nghệ Thông_tin có tên tiếng Anh là University of Information_Technology ( viết tắt là UIT ) là thành_viên của Đại_học Quốc_Gia TP. HCM."
|
30 |
+
output:
|
31 |
+
- label: "Top 1"
|
32 |
+
score: 4.0033
|
33 |
+
- text: "UIT là gì ?. Trường Đại_học Kinh_tế – Luật ( tiếng Anh : University of Economics and Law – UEL ) là trường đại_học đào_tạo và nghiên_cứu khối ngành kinh_tế , kinh_doanh và luật hàng_đầu Việt_Nam ."
|
34 |
+
output:
|
35 |
+
- label: "Top 3"
|
36 |
+
score: -1.1160
|
37 |
+
- text: "UIT là gì ?. Quĩ_uỷ_thác đầu_tư ( tiếng Anh : Unit Investment_Trusts ; viết tắt : UIT ) là một công_ty đầu_tư mua hoặc nắm giữ một danh_mục đầu_tư cố_định"
|
38 |
+
output:
|
39 |
+
- label: "Top 2"
|
40 |
+
score: 2.5138
|
41 |
+
pipeline_tag: text-classification
|
42 |
---
|
43 |
|
44 |
## Installation
|
|
|
84 |
|
85 |
```python
|
86 |
from transformers import AutoTokenizer, AutoModelForSequenceClassification
|
|
|
87 |
|
88 |
model = AutoModelForSequenceClassification.from_pretrained('itdainb/vietnamese-cross-encoder')
|
89 |
tokenizer = AutoTokenizer.from_pretrained('itdainb/vietnamese-cross-encoder')
|
90 |
|
|
|
|
|
91 |
features = tokenizer(tokenized_pairs, padding=True, truncation="longest_first", return_tensors="pt", max_length=256)
|
92 |
|
93 |
model.eval()
|
94 |
with torch.no_grad():
|
95 |
model_predictions = model(**features, return_dict=True)
|
96 |
+
logits = model_predictions.logits
|
97 |
|
98 |
scores = [score[0] for score in logits]
|
99 |
print(scores)
|