(self, context, question, titles)
| 54 | return self.post_process(response.text) |
| 55 | |
| 56 | def predict_nq(self, context, question, titles): |
| 57 | prompt = (f"Go through the following context and then extract the answer of the question from the context. " |
| 58 | f"The context is a list of Wikipedia documents, ordered by title: {titles}. " |
| 59 | f"Each Wikipedia document contains a title field and a text field. " |
| 60 | f"The context is: {context}. " |
| 61 | f"Find the useful documents from the context, then extract the answer to answer the question: {question}." |
| 62 | f"Answer the question directly. Your response should be very concise. ") |
| 63 | long_answer = self.predict(prompt) |
| 64 | short_answer = self.extract_answer(question, long_answer) |
| 65 | return long_answer, short_answer |
| 66 | |
| 67 | def predict_hotpotqa(self, context, question, titles): |
| 68 | prompt = (f"Go through the following context and then answer the question " |
nothing calls this directly
no test coverage detected