• bitcoinBitcoin(BTC)$60,502.000.58%
  • ethereumEthereum(ETH)$1,694.430.56%
  • tetherTether(USDT)$1.000.01%
  • binancecoinBNB(BNB)$554.040.37%
  • usd-coinUSDC(USDC)$1.000.01%
  • rippleXRP(XRP)$0.951.04%
  • solanaSolana(SOL)$71.100.92%
  • Figure HelocFigure Heloc(FIGR_HELOC)$1.062.14%
  • tronTRON(TRX)$0.3039220.41%
  • HyperliquidHyperliquid(HYPE)$62.361.53%
  • zcashZcash(ZEC)$701.38-7.29%
  • dogecoinDogecoin(DOGE)$0.0565061.19%
  • moneroMonero(XMR)$458.07-11.84%
  • leo-tokenLEO Token(LEO)$9.080.68%
  • whitebitWhiteBIT Coin(WBT)$61.104.67%
  • chainlinkChainlink(LINK)$9.323.11%
  • USDSUSDS(USDS)$1.000.02%
  • cardanoCardano(ADA)$0.1493472.63%
  • Ethena USDeEthena USDe(USDE)$1.00-0.04%
  • stellarStellar(XLM)$0.127283-0.32%
  • daiDai(DAI)$1.000.03%
  • bitcoin-cashBitcoin Cash(BCH)$209.953.25%
  • nearNEAR Protocol(NEAR)$3.060.72%
  • litecoinLitecoin(LTC)$44.063.94%
  • CantonCanton(CC)$0.075999-1.61%
  • avalanche-2Avalanche(AVAX)$6.610.14%
  • tether-goldTether Gold(XAUT)$3,563.64-0.46%
  • USD1USD1(USD1)$1.00-0.03%
  • uniswapUniswap(UNI)$4.67-1.20%
  • Ripple USDRipple USD(RLUSD)$1.000.01%
  • the-open-networkGram (prev. Toncoin)(GRAM)$0.970.71%
  • suiSui(SUI)$0.670.83%
  • Global DollarGlobal Dollar(USDG)$1.000.00%
  • hedera-hashgraphHedera(HBAR)$0.0543664.51%
  • paypal-usdPayPal USD(PYUSD)$1.000.02%
  • Ondo US Dollar YieldOndo US Dollar Yield(USDY)$1.15-0.10%
  • BittensorBittensor(TAO)$184.051.43%
  • quant-networkQuant(QNT)$148.302.81%
  • shiba-inuShiba Inu(SHIB)$0.0000041.66%
  • Spiko Amundi Overnight Swap Fund (EUR)Spiko Amundi Overnight Swap Fund (EUR)(EURSAFO)$1.12-0.06%
  • Circle USYCCircle USYC(USYC)$1.150.00%
  • crypto-com-chainCronos(CRO)$0.039836-0.58%
  • MemeCoreMemeCore(M)$0.831.99%
  • RainRain(RAIN)$0.002500-8.73%
  • okbOKB(OKB)$82.520.89%
  • Falcon USDFalcon USD(USDF)$1.000.07%
  • United StablesUnited Stables(U)$1.000.01%
  • pax-goldPAX Gold(PAXG)$3,562.20-0.50%
  • BlackRock USD Institutional Digital Liquidity FundBlackRock USD Institutional Digital Liquidity Fund(BUIDL)$1.000.00%
  • BitwayBitway(BTW)$1.0011.04%
TradePoint.io
  • Main
  • AI & Technology
  • Stock Charts
  • Market & News
  • Business
  • Finance Tips
  • Trade Tube
  • Blog
  • Shop
No Result
View All Result
TradePoint.io
No Result
View All Result

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

May 26, 2026
in AI & Technology
Reading Time: 1 min read
A A
Design a High-Precision Retrieve-and-Rerank Pipeline with ZeroEntropy Zerank-2 Reranker
ShareShareShareShareShare
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")

Credit: Source link

YOU MAY ALSO LIKE

Backloggd Urges Users To Change Their Passwords After A Breach

1Password Says It Was Hacked But Users’ Vaults Are Safe

ShareTweetSendSharePin

Related Posts

Backloggd Urges Users To Change Their Passwords After A Breach
AI & Technology

Backloggd Urges Users To Change Their Passwords After A Breach

November 26, 2026
1Password Says It Was Hacked But Users’ Vaults Are Safe
AI & Technology

1Password Says It Was Hacked But Users’ Vaults Are Safe

November 26, 2026
Canada Invests 0 Million More to Expand AI Compute Access Fund – Unite.AI
AI & Technology

Canada Invests $700 Million More to Expand AI Compute Access Fund – Unite.AI

November 26, 2026
Workers At GTA 6 Studio Rockstar Games Vote Overwhelmingly Against Union Recognition
AI & Technology

Workers At GTA 6 Studio Rockstar Games Vote Overwhelmingly Against Union Recognition

November 26, 2026
Next Post
Banpu Public Company Limited 2026 Q1 – Results – Earnings Call Presentation (OTCMKTS:BNPJY) 2026-05-26

Banpu Public Company Limited 2026 Q1 - Results - Earnings Call Presentation (OTCMKTS:BNPJY) 2026-05-26

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Search

No Result
View All Result
My Sister’s Breakup Cost Me 0,000

My Sister’s Breakup Cost Me $200,000

November 26, 2026
SNAP recipients push back on junk-food ban with lawsuit claiming health benefits for diabetes, autism

SNAP recipients push back on junk-food ban with lawsuit claiming health benefits for diabetes, autism

November 20, 2026
Carl Icahn’s wealth drops to 30-year-low as corporate raider gets battered by losing bets

Carl Icahn’s wealth drops to 30-year-low as corporate raider gets battered by losing bets

November 25, 2026

About

Learn more

Our Services

Legal

Privacy Policy

Terms of Use

Bloggers

Learn more

Article Links

Contact

Advertise

Ask us anything

©2020- TradePoint.io - All rights reserved!

Tradepoint.io, being just a publishing and technology platform, is not a registered broker-dealer or investment adviser. So we do not provide investment advice. Rather, brokerage services are provided to clients of Tradepoint.io by independent SEC-registered broker-dealers and members of FINRA/SIPC. Every form of investing carries some risk and past performance is not a guarantee of future results. “Tradepoint.io“, “Instant Investing” and “My Trading Tools” are registered trademarks of Apperbuild, LLC.

This website is operated by Apperbuild, LLC. We have no link to any brokerage firm and we do not provide investment advice. Every information and resource we provide is solely for the education of our readers. © 2020 Apperbuild, LLC. All rights reserved.

No Result
View All Result
  • Main
  • AI & Technology
  • Stock Charts
  • Market & News
  • Business
  • Finance Tips
  • Trade Tube
  • Blog
  • Shop

© 2023 - TradePoint.io - All Rights Reserved!