itdainb commited on
Commit
b8bc2fc
·
verified ·
1 Parent(s): f5476e4

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +14 -10
README.md CHANGED
@@ -26,12 +26,19 @@ model-index:
26
  name: MRR@10
27
  verified: false
28
  widget:
29
- - source_sentence: "UIT là gì ?"
30
- sentences:
31
- - "UIT là Trường Đại_học Công_nghệ Thông_tin ( ĐH CNTT ) , Đại_học Quốc_gia Thành_phố Hồ_Chí_Minh ( ĐHQG - HCM )"
32
- - "Mô_hình rerank — còn được gọi là cross - encoder — là một loại mô_hình mà , khi được cung_cấp một cặp truy vấn và tài_liệu , sẽ đưa ra một điểm tương_đồng ."
33
- - "Việt_Nam , quốc_hiệu Cộng_hòa xã_hội chủ_nghĩa Việt_Nam ,một quốc_gia xã_hội chủ_nghĩa nằm cực Đông của bán_đảo Đông_Dương thuộc khu_vực Đông_Nam_Á"
34
- pipeline_tag: sentence-similarity
 
 
 
 
 
 
 
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 = activation_fct(model_predictions.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 ?. Trường Đại_học Kinh_tế Luật ( tiếng Anh : University of Economics and Law – UEL ) trường đại_học đào_tạo nghiên_cứu khối ngành kinh_tế , kinh_doanh 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)