src/transformers/models/tapex/tokenization_tapex.py/TapexTokenizer/truncate_table_cells
class TapexTokenizer:    def truncate_table_cells(self, table_content: Dict, question: str, answer: List):
        # TODO (Qian): is it possible to revert the original cell if it is in the final answer?
        cell_mapping = {}
        for row in table_content["rows"]:
            for i, cell in enumerate(row):
                truncate_cell = self.truncate_cell(cell)
                if truncate_cell is not None:
                    cell_mapping[cell] = truncate_cell
                    row[i] = truncate_cell

        # modify the answer list
        if answer is not None:
            for i, case in enumerate(answer):
                if case in cell_mapping.keys():
                    answer[i] = cell_mapping[case]