| """ | |
| Quick test of the full retrieve -> rerank pipeline. | |
| Usage: python test_retrieval.py | |
| """ | |
| from retrieval.retriever import retrieve | |
| QUERIES = [ | |
| "What are the eligibility criteria for PGP AI and Data Science?", | |
| "What is the placement record of Jio Institute?", | |
| "Tell me about the ECIS programme.", | |
| ] | |
| for query in QUERIES: | |
| print(f"\n{'='*60}") | |
| print(f"Query: {query}") | |
| print("="*60) | |
| results = retrieve(query) | |
| for i, chunk in enumerate(results, 1): | |
| print(f"\n[{i}] Source: {chunk['source']} | Score: {chunk['score']:.4f} | Rank: {chunk['rank']}") | |
| preview = chunk['chunk_text'][:300].strip().encode('ascii', errors='replace').decode('ascii') | |
| print(f" {preview}...") | |