GodsDevProject commited on
Commit
22a9c04
·
verified ·
1 Parent(s): 3619231

Delete cluster.py

Browse files
Files changed (1) hide show
  1. cluster.py +0 -12
cluster.py DELETED
@@ -1,12 +0,0 @@
1
- from typing import List, Dict
2
- from core.faiss_vector import FaissIndex
3
-
4
- def cluster_results(results: List[dict], k: int = 5) -> Dict[str, List[dict]]:
5
- texts = [r.get("snippet","") for r in results if r.get("snippet")]
6
- index = FaissIndex()
7
- index.add(texts)
8
- clusters = {}
9
- for r in results:
10
- key = r.get("source","Unknown")
11
- clusters.setdefault(key, []).append(r)
12
- return clusters