def _format_dataset(
        self, dataset: EmbeddingQAFinetuneDataset, corpus: Dict[str, str]
    ):
        """
        Convert the dataset into NUDGE format.

        Args:
            dataset (EmbeddingQAFinetuneDataset): Dataset to convert.

        """
        try:
            import numpy as np
        except ImportError:
            raise ImportError(NUMPY_IMPORT_ERROR_MSG)

        q_embs = []
        q_ans_indx = []
        corpus_keys = list(corpus.keys())

        for query_id, query in dataset.queries.items():
            query_embedding = self.embed_model.get_query_embedding(query)
            q_embs.append(query_embedding)

            relevant_docs = dataset.relevant_docs[query_id]
            relevant_doc_indices = [corpus_keys.index(doc) for doc in relevant_docs]
            q_ans_indx.append(relevant_doc_indices)

        return {"q_embs": np.array(q_embs), "q_ans_indx": q_ans_indx}

        Convert the dataset into NUDGE format.

        Args:
            dataset (EmbeddingQAFinetuneDataset): Dataset to convert.

        
llama-index-experimental/llama_index/experimental/nudge/base.py