Spaces:
Sleeping
Sleeping
Create vector_store.py
Browse files- vector_store.py +17 -0
vector_store.py
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import faiss
|
| 2 |
+
import numpy as np
|
| 3 |
+
|
| 4 |
+
# demo embeddings
|
| 5 |
+
INDEX = faiss.IndexFlatL2(384)
|
| 6 |
+
DOCS = []
|
| 7 |
+
|
| 8 |
+
def semantic_search(query: str):
|
| 9 |
+
# placeholder demo
|
| 10 |
+
return [
|
| 11 |
+
{
|
| 12 |
+
"document": "UAP Analysis Memo",
|
| 13 |
+
"agency": "DIA",
|
| 14 |
+
"year": 2010,
|
| 15 |
+
"excerpt": "Unidentified aerial phenomena..."
|
| 16 |
+
}
|
| 17 |
+
]
|