Repository: Marker-Inc-Korea/AutoRAG
Issue: [Hotfix] Fix retrieval and retrieval token metrics to use unaswerable
Root cause: Validation Gap

                             │ /usr/local/lib/python3.10/dist-packages/autorag/nodes/passagecompressor/run.py:52 in                     │               
                             │ run_passage_compressor_node                                                                              │               
                             │                                                                                                          │               
                             │    49 │   # make retrieval contents gt                                                                   │               
                             │    50 │   qa_data = pd.read_parquet(os.path.join(data_dir, "qa.parquet"))                                │               
                             │    51 │   corpus_data = pd.read_parquet(os.path.join(data_dir, "corpus.parquet"))                        │               
                             │ ❱  52 │   retrieval_contents_gt = make_contents_gt(qa_data, corpus_data)                                 │               
                             │    53 │                                                                                                  │               
                             │    54 │   # run metrics before filtering                                                                 │               
                             │    55 │   if strategies.get('metrics') is None:                                                          │               
                             │                                                                                                          │               
                             │ /usr/local/lib/python3.10/dist-packages/autorag/nodes/passagecompressor/run.py:123 in make_contents_gt   │               
                             │                                                                                                          │               
                             │   120 │   validate_qa_dataset(qa_data)                                                                   │               
                             │   121 │   validate_corpus_dataset(corpus_data)                                                           │               
                             │   122 │   retrieval_gt_ids = qa_data['retrieval_gt'].apply(lambda x:                                     │               
                             │       list(itertools.chain.from_iterable(x))).tolist()                                                   │               
                             │ ❱ 123 │   return fetch_contents(corpus_data, retrieval_gt_ids)                                           │               
                             │   124                                                                                                    │               
                             │                                                                                                          │               
                             │ /usr/local/lib/python3.10/dist-packages/autorag/utils/util.py:21 in fetch_contents                       │               
                             │                                                                                                          │               
                             │    18 def fetch_contents(corpus_data: pd.DataFrame, ids: List[List[str]],                                │               
                             │    19 │   │   │   │      column_name: str = 'contents') -> List[List[Any]]:                              │               
                             │    20 │   flat_ids = itertools.chain.from_iterable(ids)                                                  │               
                             │ ❱  21 │   contents = list(map(lambda x: corpus_data.loc[lambda row: row['doc_id'] ==                     │               
                             │       x][column_name].values[0], flat_ids))                                                              │               
                             │    22 │                                                                                                  │               
                             │    23 │   result = []                                                                                    │               
                             │    24 │   idx = 0                                                                                        │               
                             │                                                                                                          │               
                             │ /usr/local/lib/python3.10/dist-packages/autorag/utils/util.py:21 in <lambda>                             │               
                             │                                                                                                          │               
                             │    18 def fetch_contents(corpus_data: pd.DataFrame, ids: List[List[str]],                                │               
                             │    19 │   │   │   │      column_name: str = 'contents') -> List[List[Any]]:                              │               
                             │    20 │   flat_ids = itertools.chain.from_iterable(ids)                                                  │               
                             │ ❱  21 │   contents = list(map(lambda x: corpus_data.loc[lambda row: row['doc_id'] ==                     │               
                             │       x][column_name].values[0], flat_ids))                                                              │               
                             │    22 │                                                                                                  │               
                             │    23 │   result = []                                                                                    │               
                             │    24 │   idx = 0                                                                                        │               
                             ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────╯               
                             IndexError: index 0 is out of bounds for axis 0 with size 0  

Looks like there is no id in corpus? 
Ummm... w..why? Something changes qa.parquet?

No.. I didn't touch qa.parquet...?