Spaces:
Runtime error
Runtime error
makcrx
commited on
Commit
·
d6a31a5
1
Parent(s):
2c96123
fix faiss index
Browse files- embed_qa.py +6 -3
- faiss_qa_2023-08-20/index.faiss +1 -1
- faiss_qa_2023-08-20/index.pkl +2 -2
embed_qa.py
CHANGED
@@ -20,12 +20,15 @@ def load_questions(sqlite_filename):
|
|
20 |
).fetchall()
|
21 |
|
22 |
for res in results:
|
23 |
-
|
24 |
-
|
|
|
|
|
|
|
25 |
|
26 |
questions = json.loads(res['questions'])
|
27 |
for q in questions:
|
28 |
-
q['query'] = " ".join(
|
29 |
q['articleId'] = res['articleId']
|
30 |
all_questions += questions
|
31 |
|
|
|
20 |
).fetchall()
|
21 |
|
22 |
for res in results:
|
23 |
+
section = res['section'].lower()
|
24 |
+
title = res['title'].lower()
|
25 |
+
if section == 'служебная информация':
|
26 |
+
section = ''
|
27 |
+
title = ''
|
28 |
|
29 |
questions = json.loads(res['questions'])
|
30 |
for q in questions:
|
31 |
+
q['query'] = " ".join(section.split() + title.split() + q['question'].split()).translate(remove_punctuation).lower()
|
32 |
q['articleId'] = res['articleId']
|
33 |
all_questions += questions
|
34 |
|
faiss_qa_2023-08-20/index.faiss
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
size 583725
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:0e63ee86014ca44c22b28833e4923d921ef09c7396745bb36b01a432fb2ebdb3
|
3 |
size 583725
|
faiss_qa_2023-08-20/index.pkl
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:bd22ea5dc8ecc7fff3c8cce4689c58ccab89eb1fb30d92ef7780f41d3e87d4fd
|
3 |
+
size 266932
|