neulab / explainaboard_web

MIT License
8 stars 2 forks source link

Use cases instead of API call to get systemOutputs #447

Closed noelchen90 closed 2 years ago

noelchen90 commented 2 years ago

Background

Previously in AnalysisTable, we called the API backendClient.systemOutputsGetById() to collect systemOutputs. And we used these to display the examples in our ExampleTable. However, the examples we need already exist in the cases argument which are passed in while creating the AnalysisTable component, so the use of API can actually be removed. On top of that, the examples we show in the table should be derived from the cases in each bucket instead of the systemOutputs.

Changes

In this PR, I added a function convertCasesToSystemOutput() in .../AnalysisTable/utils.tsx which converts the cases format to systemOutput format. By using this function, we can replace the need to call the API.

Next steps

It also seems that all variables using the struct SystemOutput used in AnalysisTable could be changed to AnalysisCase after this PR. Since there are quite a few functions using SystemOutput structs, I will make these changes in a different PR.

noelchen90 commented 2 years ago

Closing this PR because I just noticed it doesn't work for sequence labeling tasks.