• About Us
  • Disclaimer
  • Contact Us
  • Privacy Policy
Saturday, July 11, 2026
mGrowTech
No Result
View All Result
  • Technology And Software
    • Account Based Marketing
    • Channel Marketing
    • Marketing Automation
      • Al, Analytics and Automation
      • Ad Management
  • Digital Marketing
    • Social Media Management
    • Google Marketing
  • Direct Marketing
    • Brand Management
    • Marketing Attribution and Consulting
  • Mobile Marketing
  • Event Management
  • PR Solutions
  • Technology And Software
    • Account Based Marketing
    • Channel Marketing
    • Marketing Automation
      • Al, Analytics and Automation
      • Ad Management
  • Digital Marketing
    • Social Media Management
    • Google Marketing
  • Direct Marketing
    • Brand Management
    • Marketing Attribution and Consulting
  • Mobile Marketing
  • Event Management
  • PR Solutions
No Result
View All Result
mGrowTech
No Result
View All Result
Home Al, Analytics and Automation

Design a High-Precision Retrieve-and-Rerank Pipeline with ZeroEntropy Zerank-2 Reranker

Josh by Josh
May 27, 2026
in Al, Analytics and Automation
0
Design a High-Precision Retrieve-and-Rerank Pipeline with ZeroEntropy Zerank-2 Reranker


print("\n" + "="*70 + "\nPART 4: NDCG@10 evaluation\n" + "="*70)
eval_set = [
   {"query": "Where is most ATP produced in the cell?",
    "rels": {0: 2, 2: 3, 4: 2, 6: 1, 8: 3}},
   {"query": "How do plants capture light energy?",
    "rels": {1: 3, 9: 1}},
   {"query": "How are proteins made and packaged in a cell?",
    "rels": {5: 3, 7: 2}},
]
def dcg(rels):
   rels = np.asarray(rels, dtype=float)
   return np.sum((2**rels - 1) / np.log2(np.arange(2, rels.size + 2)))
def ndcg_at_k(ranked_doc_ids, rel_map, k=10):
   gains = [rel_map.get(d, 0) for d in ranked_doc_ids[:k]]
   ideal = sorted(rel_map.values(), reverse=True)[:k]
   idcg = dcg(ideal)
   return dcg(gains) / idcg if idcg > 0 else 0.0
base_scores, rr_scores = [], []
for ex in eval_set:
   q, rel_map = ex["query"], ex["rels"]
   q_emb = bi.encode(q, convert_to_tensor=True, normalize_embeddings=True)
   hits = util.semantic_search(q_emb, corpus_emb, top_k=len(corpus))[0]
   base_order = [h["corpus_id"] for h in hits]
   base_scores.append(ndcg_at_k(base_order, rel_map))
   rr = reranker.rank(q, [corpus[i] for i in base_order], convert_to_tensor=True)
   rr_order = [base_order[r["corpus_id"]] for r in rr]
   rr_scores.append(ndcg_at_k(rr_order, rel_map))
print(f"{'Query':45s} {'bi-encoder':>12s} {'+ zerank-2':>12s}")
for ex, b, r in zip(eval_set, base_scores, rr_scores):
   print(f"{ex['query'][:43]:45s} {b:12.4f} {r:12.4f}")
print("-"*72)
print(f"{'AVERAGE NDCG@10':45s} {np.mean(base_scores):12.4f} {np.mean(rr_scores):12.4f}")
print(f"\nReranking lift: {np.mean(rr_scores)-np.mean(base_scores):+.4f} NDCG@10")



Source_link

READ ALSO

Ant Group’s Robbyant Unveils LingBot-VA 2.0: A Causal Video-Action Model Built Natively for Physical AI

Kyutai Releases MuScriptor: An Open-Weight Decoder-Only Transformer for Multi-Instrument Music Transcription to MIDI

Related Posts

Ant Group’s Robbyant Unveils LingBot-VA 2.0: A Causal Video-Action Model Built Natively for Physical AI
Al, Analytics and Automation

Ant Group’s Robbyant Unveils LingBot-VA 2.0: A Causal Video-Action Model Built Natively for Physical AI

July 11, 2026
Kyutai Releases MuScriptor: An Open-Weight Decoder-Only Transformer for Multi-Instrument Music Transcription to MIDI
Al, Analytics and Automation

Kyutai Releases MuScriptor: An Open-Weight Decoder-Only Transformer for Multi-Instrument Music Transcription to MIDI

July 11, 2026
Agentic Workflow vs. Autonomous Agent: What’s the Difference?
Al, Analytics and Automation

Agentic Workflow vs. Autonomous Agent: What’s the Difference?

July 11, 2026
Google Research Introduces SensorFM: A Wearable Health Foundation Model Pretrained on One Trillion Minutes of Sensor Data
Al, Analytics and Automation

Google Research Introduces SensorFM: A Wearable Health Foundation Model Pretrained on One Trillion Minutes of Sensor Data

July 10, 2026
The AI Agent Tech Stack Explained
Al, Analytics and Automation

The AI Agent Tech Stack Explained

July 10, 2026
Tiny robot boats build floating structures | MIT News
Al, Analytics and Automation

Tiny robot boats build floating structures | MIT News

July 9, 2026
Next Post
Does AI really make workers more productive?

Does AI really make workers more productive?

POPULAR NEWS

Trump ends trade talks with Canada over a digital services tax

Trump ends trade talks with Canada over a digital services tax

June 28, 2025
15 Trending Songs on TikTok in 2025 (+ How to Use Them)

15 Trending Songs on TikTok in 2025 (+ How to Use Them)

June 18, 2025
Communication Effectiveness Skills For Business Leaders

Communication Effectiveness Skills For Business Leaders

June 10, 2025
App Development Cost in Singapore: Pricing Breakdown & Insights

App Development Cost in Singapore: Pricing Breakdown & Insights

June 22, 2025
Comparing the Top 7 Large Language Models LLMs/Systems for Coding in 2025

Comparing the Top 7 Large Language Models LLMs/Systems for Coding in 2025

November 4, 2025

EDITOR'S PICK

AI Strategies to Engage Divided Audiences

AI Strategies to Engage Divided Audiences

January 9, 2026
Why Real Estate Investment and Construction Management Need to Work Together

Why Real Estate Investment and Construction Management Need to Work Together

April 22, 2026
How Will ChatGPT Affect SEO? It’s Not What You Think

How Will ChatGPT Affect SEO? It’s Not What You Think

December 26, 2025
Craft Food Roblox Blueberry Lemon Tree Recipe

Craft Food Roblox Blueberry Lemon Tree Recipe

January 24, 2026

About

We bring you the best Premium WordPress Themes that perfect for news, magazine, personal blog, etc. Check our landing page for details.

Follow us

Categories

  • Account Based Marketing
  • Ad Management
  • Al, Analytics and Automation
  • Brand Management
  • Channel Marketing
  • Digital Marketing
  • Direct Marketing
  • Event Management
  • Google Marketing
  • Marketing Attribution and Consulting
  • Marketing Automation
  • Mobile Marketing
  • PR Solutions
  • Social Media Management
  • Technology And Software
  • Uncategorized

Recent Posts

  • GeoGuessr Daily Challenge Answer Today for July 11, 2026
  • Smart glasses without a camera? Even Realities bets productivity beats recording everyone
  • Ant Group’s Robbyant Unveils LingBot-VA 2.0: A Causal Video-Action Model Built Natively for Physical AI
  • 7 Best Accounting Firms I Recommend (2026)
  • About Us
  • Disclaimer
  • Contact Us
  • Privacy Policy
No Result
View All Result
  • Technology And Software
    • Account Based Marketing
    • Channel Marketing
    • Marketing Automation
      • Al, Analytics and Automation
      • Ad Management
  • Digital Marketing
    • Social Media Management
    • Google Marketing
  • Direct Marketing
    • Brand Management
    • Marketing Attribution and Consulting
  • Mobile Marketing
  • Event Management
  • PR Solutions