rag-vietnamese / main.py
thaidinhz1's picture
Week 4: reranking + citation - bge-reranker-v2-m3, inline citations
c696a51
Raw History Blame Contribute Delete
585 Bytes
from src.rag import answer
if __name__ == "__main__":
print("=== RAG CLI ===")
print("Gõ 'quit' để thoát\n")
while True:
question = input("Câu hỏi: ").strip()
if question.lower() in ("quit", "exit", "q"):
break
if not question:
continue
result = answer(question)
print(f"\nTrả lời: {result['answer']}")
print("\nNguồn:")
for s in result["sources"]:
print(f" - {s['source']} (trang {s['page']}, rrf: {s['rrf_score']}, rerank: {s['rerank_score']})")
print()