makcrx commited on
Commit
d6a31a5
·
1 Parent(s): 2c96123

fix faiss index

Browse files
embed_qa.py CHANGED
@@ -20,12 +20,15 @@ def load_questions(sqlite_filename):
20
  ).fetchall()
21
 
22
  for res in results:
23
- if res['section'].lower() == 'служебные ответы':
24
- res['section'] = ''
 
 
 
25
 
26
  questions = json.loads(res['questions'])
27
  for q in questions:
28
- q['query'] = " ".join(res['section'].split() + res['title'].split() + q['question'].split()).translate(remove_punctuation).lower()
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:8a8a5e3d0342187d57b9a80c431b59019c99e2ce85fdc32666a0578b958efd3b
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:d1da6f468c5ba954ba92921fa207550ba693c009ae1b6ec132d3a911e52d4f5f
3
- size 267292
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:bd22ea5dc8ecc7fff3c8cce4689c58ccab89eb1fb30d92ef7780f41d3e87d4fd
3
+ size 266932