Spaces:
Sleeping
Sleeping
MSEAJYTHTH
commited on
Commit
•
d742c01
1
Parent(s):
215903a
Update app.py
Browse files
app.py
CHANGED
@@ -36,7 +36,7 @@ db = FAISS.load_local("faiss_index", embeddings, allow_dangerous_deserialization
|
|
36 |
def find_best_page_content(question, keywords, db):
|
37 |
|
38 |
db = FAISS.load_local("faiss_index", embeddings, allow_dangerous_deserialization=True)
|
39 |
-
results = db.similarity_search(question, k=
|
40 |
keywords = ', '.join(keywords) #
|
41 |
|
42 |
max_similarity = 0 # 최대 유사도 초기화
|
@@ -45,7 +45,7 @@ def find_best_page_content(question, keywords, db):
|
|
45 |
metadata = "" # 초기화
|
46 |
similarity_score = "" # 초기화
|
47 |
|
48 |
-
for i in range(
|
49 |
page_content = results[i].page_content
|
50 |
metadata = results[i].metadata['source']
|
51 |
similarity_score = difflib.SequenceMatcher(None, keywords, metadata).ratio()
|
|
|
36 |
def find_best_page_content(question, keywords, db):
|
37 |
|
38 |
db = FAISS.load_local("faiss_index", embeddings, allow_dangerous_deserialization=True)
|
39 |
+
results = db.similarity_search(question, k=200, fetch_k=200)
|
40 |
keywords = ', '.join(keywords) #
|
41 |
|
42 |
max_similarity = 0 # 최대 유사도 초기화
|
|
|
45 |
metadata = "" # 초기화
|
46 |
similarity_score = "" # 초기화
|
47 |
|
48 |
+
for i in range(200) :
|
49 |
page_content = results[i].page_content
|
50 |
metadata = results[i].metadata['source']
|
51 |
similarity_score = difflib.SequenceMatcher(None, keywords, metadata).ratio()
|