diff options
author | polwex <polwex@sortug.com> | 2025-09-24 23:38:36 +0700 |
---|---|---|
committer | polwex <polwex@sortug.com> | 2025-09-24 23:38:36 +0700 |
commit | 734b89570040e97f0c7743c4c0bc28e30a3cd4ee (patch) | |
tree | 7142d9f37908138c38d0ade066e960c3a1c69f5d /rag/test.py | |
parent | 57aaafdb137fe49930711f6ed5ccc83b3a119cd2 (diff) |
Diffstat (limited to 'rag/test.py')
-rw-r--r-- | rag/test.py | 39 |
1 files changed, 23 insertions, 16 deletions
diff --git a/rag/test.py b/rag/test.py index b7a6d8e..864a3ba 100644 --- a/rag/test.py +++ b/rag/test.py @@ -47,29 +47,36 @@ def t(): # db = sqlite3.connect("./rag.db") queries = [ -"How was Shuihu zhuan received in early modern Japan?", -"Edo-period readers’ image of Song Jiang / Liangshan outlaws", -"Channels of transmission for Chinese vernacular fiction into Japan (kanbun kundoku, digests, translations)", -"Role of woodblock prints/illustrations in mediating Chinese fiction", -"Key Japanese scholars, writers, or publishers who popularized Chinese fiction", -"Kyokutei Bakin’s engagement with Chinese vernacular narrative", -"Santō Kyōden, gesaku, and Chinese models", -"Kanzen chōaku (encourage good, punish evil) and Water Margin in Japan", -"Moral ambivalence of outlaw heroes as discussed in the text", -"Censorship or moral debates around reading Chinese fiction", -"Translation strategies from vernacular Chinese to Japanese (furigana, kundoku, glossing)", -"Paratexts: prefaces, commentaries, reader guidance apparatus", -"Bibliographic details: editions, reprints, circulation networks", -"How does this book challenge older narratives about Sino-Japanese literary influence?", -"Methodology: sources, archives, limitations mentioned by the author", +# "How was Shuihu zhuan received in early modern Japan?", +# "Edo-period readers’ image of Song Jiang / Liangshan outlaws", +# "Channels of transmission for Chinese vernacular fiction into Japan (kanbun kundoku, digests, translations)", +# "Role of woodblock prints/illustrations in mediating Chinese fiction", +# "Key Japanese scholars, writers, or publishers who popularized Chinese fiction", +# "Kyokutei Bakin’s engagement with Chinese vernacular narrative", +# "Santō Kyōden, gesaku, and Chinese models", +# "Kanzen chōaku (encourage good, punish evil) and Water Margin in Japan", +# "Moral ambivalence of outlaw heroes as discussed in the text", +# "Censorship or moral debates around reading Chinese fiction", +# "Translation strategies from vernacular Chinese to Japanese (furigana, kundoku, glossing)", +# "Paratexts: prefaces, commentaries, reader guidance apparatus", +# "Bibliographic details: editions, reprints, circulation networks", +# "How does this book challenge older narratives about Sino-Japanese literary influence?", +# "Methodology: sources, archives, limitations mentioned by the author", +"sex" ] def t2(): db = get_db() # Hybrid + CE rerank query: + model = rag.ingest.get_embed_model() for query in queries: print("query", query) - results = rag.search.search_hybrid(db, query, k_vec=50, k_bm25=50, k_final=8) + print("-----------\n\n") + # results = rag.search.search_hybrid(db, "muh", query, k_vec=50, k_bm25=50, k_final=8) + # for rid, txt, score in results: + # sim = score + # print(f"[{rid:04d}] ce_score={sim:.3f}\n{txt[:300]}...\n") + results = rag.search.vec_search(db, model, "muh", query, k=50, min_sim=0.25, max_per_doc=5, use_mmr=False, mmr_lambda=0.7) for rid, txt, score in results: sim = score print(f"[{rid:04d}] ce_score={sim:.3f}\n{txt[:300]}...\n") |