CoolFace
Apppublic

Metafazer/finrag-backend

sourceHugging Faceupdated 4mo agoView on Hugging Face
0likes
test_reranker_real.py17 linesDownload Raw Back to sandbox
1import sys2from finrag.vectorstore.chroma_store import ChromaStore3from finrag.retrieval.reranker import CrossEncoderReranker4 5query = "Summarize the key event or announcement described in this 8-K filing. What happened, what are the financial or operational implications, and what did management state about it?"6where = {"$and": [{"ticker": "TSLA"}, {"form_type": "8-K"}, {"filing_date": "2026-01-28"}]}7 8chroma = ChromaStore()9candidates = chroma.query(query, n_results=10, where=where)10 11reranker = CrossEncoderReranker()12res = reranker.rerank(query, candidates)13print("Candidates found:", len(candidates))14print("RERANK RESULT:", len(res))15for r in res:16    print(f"{r['reranker_score']:.6f} | {r['text'][:100]}")17