[alpha] Improvements to ModelWrapper and better QA/Classification implementation #8
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.
Major Changes
evalem.models.QuestionAnsweringHFPipelineWrapper
andevalem.models.TextClassificationHFPipelineWrapper
are now the main wrappers for QA and Text Classification tasks respectively.hf_params
dict
is also provided as a parameter that will be used for initializing the HF pipelineevalem.evaluators.TextClassificationEvaluator
has been added with basics metrics for text classification (F1 score, precision, recall, confusion matrix)evalem.models._base.ModelWrapper
now utilizes 2 distinct processing parameters (one for pre-preocessing and one for post-processing) which should beCallable
(lambda function, external modules that can be called, etc.)inputs_preprocessor
is used for working on input dataset and change inputs to the models.ModelWrapper._preprocess_inputs
method is used that can also be overridden by any downstream sub-classpredictions_postprocessor
is used on model's predictions to do post processing on predictions.ModelWrapper._postprocess_predictions
method is used that can also be overridden by any downstream sub-classMinor Changes
evalem.models.DefaultQAModelWrapper
has been deprecated. User will getDeprecationWarning
error when trying to initialize the objectevalem.metrics.BertScore
now usesbert-base-uncased
as the default model instead ofroberta-large
.evalem.misc.datasets.get_imdb
function is added to load IMDB dataset out-of-box.Usage
QA Task
Defaults
Using the custom model and post-processing functionality
Text Classification
defaults
customized