Update text insights and error_analysis_manager to handle pd.DataFrame predictions and prediction with type of string #2179
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR updates rai_text_insights and error_analysis_manager.
For rai_text_insights, for predict_output and predict_proba_output, since we only support numpy array, this PR adds a check to handle pandas.DataFrame, and convert pd.DataFrame to numpy array.
For error_analysis_manager, in the case where the prediction value is a string, we should output the predictions directly, no need to map it from self.classes.
Description
Here is an example AML pipeline running based on responsibleai-text package with the changes in this PR: https://ml.azure.com/experiments/id/26da27c2-760c-4ae7-af6f-fb35b708e952/runs/teal_owl_t5k6t3v2gv?wsid=/subscriptions/3d6da6ed-6af5-4a74-87c6-da367514f8e0/resourceGroups/ResponsibleAIE2E/providers/Microsoft.MachineLearningServices/workspaces/ResponsibleAIE2ETest&flight=RAIAutomlIntegration&tid=72f988bf-86f1-41af-91ab-2d7cd011db47#
Link to dashboard: https://ml.azure.com/model/analysis/distilbert-base-uncased/be98b4b8-550a-40fc-8410-fc57258184c2?wsid=/subscriptions/3d6da6ed-6af5-4a74-87c6-da367514f8e0/resourceGroups/ResponsibleAIE2E/providers/Microsoft.MachineLearningServices/workspaces/ResponsibleAIE2ETest&flight=RAIAutomlIntegration&tid=72f988bf-86f1-41af-91ab-2d7cd011db47
Checklist