Text Ranking
sentence-transformers
Safetensors
Transformers
multilingual
t5gemma2
text2text-generation
reranker
encoder-decoder
FBNL
Retrieval
RAG
cosyy commited on
Commit
e95c2ba
·
verified ·
1 Parent(s): 1763a45

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +12 -0
README.md CHANGED
@@ -132,6 +132,18 @@ custom_rankings = model.rank(query, documents, prompt=instruction)
132
 
133
  # Use Identity to return yes_logit - no_logit instead of P(yes).
134
  margins = model.predict(pairs, activation_fn=torch.nn.Identity())
 
 
 
 
 
 
 
 
 
 
 
 
135
  ```
136
 
137
  Inputs must be ordered as `(query, document)`. By default, queries are
 
132
 
133
  # Use Identity to return yes_logit - no_logit instead of P(yes).
134
  margins = model.predict(pairs, activation_fn=torch.nn.Identity())
135
+
136
+ print(f"scores: {scores}")
137
+ print(f"rankings: {rankings}")
138
+ print(f"custom_scores: {custom_scores}")
139
+ print(f"custom_rankings: {custom_rankings}")
140
+ print(f"margins: {margins}")
141
+
142
+ # scores: [9.9982053e-01 4.7850945e-06]
143
+ # rankings: [{'corpus_id': 0, 'score': 0.99982053, 'text': 'The capital of China is Beijing.'}, {'corpus_id': 1, 'score': 4.7850945e-06, 'text': 'Gravity attracts bodies toward one another.'}]
144
+ # custom_scores: [9.9956948e-01 1.4883849e-04]
145
+ # custom_rankings: [{'corpus_id': 0, 'score': 0.9995695}, {'corpus_id': 1, 'score': 0.00014883849}]
146
+ # margins: [ 8.625 -12.25 ]
147
  ```
148
 
149
  Inputs must be ordered as `(query, document)`. By default, queries are