Fix error when model does not select any cells (#1703)

This commit is contained in:
bogdankostic 2021-11-08 15:31:57 +01:00 committed by GitHub
parent 892ce4a760
commit 5654ad1243
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -195,6 +195,9 @@ class TableReader(BaseReader):
# No aggregation needed as only one cell selected as answer_cells
if len(answer_cells) == 1:
return answer_cells[0]
# Return empty string if model did not select any cell as answer
if len(answer_cells) == 0:
return ""
# Parse answer cells in order to aggregate numerical values
parsed_answer_cells = [parser.parse(cell) for cell in answer_cells]