tykiww commited on
Commit
8f62329
·
verified ·
1 Parent(s): 3d397a8

Update services/qa_service/qna.py

Browse files
Files changed (1) hide show
  1. services/qa_service/qna.py +9 -4
services/qa_service/qna.py CHANGED
@@ -20,11 +20,16 @@ class QAService:
20
  print("Exiting Q&A Service")
21
 
22
  def parse_results(self, result):
23
- level_1 = result['matches'][0]
24
- level_2 = level_1['metadata']['_node_content']
25
- parsed = json.loads(level_2)
26
 
27
- return parsed
 
 
 
 
 
 
 
 
28
 
29
  def retrieve_context(self):
30
  """Pass embedded question into pinecone"""
 
20
  print("Exiting Q&A Service")
21
 
22
  def parse_results(self, result):
 
 
 
23
 
24
+ parsed = []
25
+ for i in result:
26
+
27
+ level_1 = i['matches']
28
+ level_2 = level_1['metadata']['_node_content']
29
+ collect = json.loads(level_2)
30
+ parsed.append(collect)
31
+
32
+ return collect
33
 
34
  def retrieve_context(self):
35
  """Pass embedded question into pinecone"""