Spaces:
Runtime error
Runtime error
makcrx
commited on
Commit
·
52cccaa
1
Parent(s):
53db284
test
Browse files
app.py
CHANGED
@@ -7,10 +7,11 @@ embeddings = SentenceTransformerEmbeddings(model_name="multi-qa-MiniLM-L6-cos-v1
|
|
7 |
db = FAISS.load_local('faiss_qa2', embeddings)
|
8 |
|
9 |
def main(query):
|
10 |
-
result_docs = db.similarity_search_with_score(query, k=
|
11 |
sentences = [doc[0].page_content for doc in result_docs]
|
12 |
-
|
13 |
-
|
|
|
14 |
score, index = reranking.search(query, sentences)
|
15 |
return result_docs[index][0].metadata['answer'], score, result_docs[index][0].page_content
|
16 |
|
|
|
7 |
db = FAISS.load_local('faiss_qa2', embeddings)
|
8 |
|
9 |
def main(query):
|
10 |
+
result_docs = db.similarity_search_with_score(query, k=100)
|
11 |
sentences = [doc[0].page_content for doc in result_docs]
|
12 |
+
# print('----------------------------------------------------------------')
|
13 |
+
# for doc in result_docs:
|
14 |
+
# print(doc[0].metadata['articleId'], ' | ', doc[0].page_content, ' | ', doc[0].metadata['answer'])
|
15 |
score, index = reranking.search(query, sentences)
|
16 |
return result_docs[index][0].metadata['answer'], score, result_docs[index][0].page_content
|
17 |
|