Update app.py
Browse files
app.py
CHANGED
@@ -13,12 +13,18 @@ import pickle
|
|
13 |
model = SentenceTransformer('sentence-transformers/all-MiniLM-L6-v2')
|
14 |
index = faiss.read_index('IPC_index.faiss')
|
15 |
index2 = faiss.read_index('CrpC_index.faiss')
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
22 |
# Step 3: Retrieval with Citations using PDF filename
|
23 |
def retrieve_info_with_citation(query, top_k=5):
|
24 |
query_embedding = model.encode([query])
|
|
|
13 |
model = SentenceTransformer('sentence-transformers/all-MiniLM-L6-v2')
|
14 |
index = faiss.read_index('IPC_index.faiss')
|
15 |
index2 = faiss.read_index('CrpC_index.faiss')
|
16 |
+
with open('IPC_N.pkl', 'rb') as f:
|
17 |
+
flattened_data = pickle.load(f)
|
18 |
+
with open('IPC_F.pkl', 'rb') as f:
|
19 |
+
pdf_filenames = pickle.load(f)
|
20 |
+
with open('IPC_C.pkl', 'rb') as f:
|
21 |
+
chunk_indices = pickle.load(f)
|
22 |
+
with open('CrPC_N.pkl', 'rb') as f:
|
23 |
+
flattened_data2 = pickle.load(f)
|
24 |
+
with open('CrPC_F.pkl', 'rb') as f:
|
25 |
+
pdf_filenames2 = pickle.load(f)
|
26 |
+
with open('CrPC_C.pkl', 'rb') as f:
|
27 |
+
chunk_indices2 = pickle.load(f)
|
28 |
# Step 3: Retrieval with Citations using PDF filename
|
29 |
def retrieve_info_with_citation(query, top_k=5):
|
30 |
query_embedding = model.encode([query])
|