Files
solidstate-tools/mcp/SearchPaperByEmbedding/demo.py
koko c0b2ec5983 sofvBV_mcp重构v2
Embedding copy
2025-10-22 23:59:23 +08:00

23 lines
627 B
Python

from search import PaperSearcher
# Use local model (free)
searcher = PaperSearcher('iclr2026_papers.json', model_type='local')
# Or use OpenAI (better quality)
# searcher = PaperSearcher('iclr2026_papers.json', model_type='openai')
searcher.compute_embeddings()
examples = [
{
"title": "Improving Developer Emotion Classification via LLM-Based Augmentation",
"abstract": "Detecting developer emotion in the informative data stream of technical commit messages..."
},
]
results = searcher.search(examples=examples, top_k=100)
searcher.display(results, n=10)
searcher.save(results, 'results.json')