(self, question)
| 22 | self.db.insert(insertable_docs, train=True) |
| 23 | |
| 24 | def query(self, question): |
| 25 | # Searching of required query in neural database |
| 26 | search_results = self.db.search( |
| 27 | query=question, |
| 28 | top_k=2, |
| 29 | on_error=lambda error_msg: print(f"Error! {error_msg}"), |
| 30 | ) |
| 31 | |
| 32 | output = "" |
| 33 | for result in search_results: |
| 34 | output += result.text + "\n\n" |
| 35 | |
| 36 | return output |
no test coverage detected