pyabsa.tasks._Archive.ProteinRegression.prediction.protein_regressor

Module Contents

Classes

ProteinRegressor

Predictor

class pyabsa.tasks._Archive.ProteinRegression.prediction.protein_regressor.ProteinRegressor(checkpoint=None, **kwargs)[source]

Bases: pyabsa.framework.prediction_class.predictor_template.InferenceModel

task_code[source]
_log_write_args()[source]
batch_predict(target_file=None, print_result=True, save_result=False, ignore_error=True, **kwargs)[source]

Predict from a file of sentences. :param target_file: the file path of the sentences to be predicted. :param print_result: whether to print the result. :param save_result: whether to save the result. :param ignore_error: whether to ignore the error when predicting. :param kwargs: other parameters. :return: prediction result.

predict(text: str | list = None, print_result=True, ignore_error=True, **kwargs)[source]

Predict from a sentence or a list of sentences. :param text: the sentence or a list of sentence to be predicted. :param print_result: whether to print the result. :param ignore_error: whether to ignore the error when predicting. :param kwargs: other parameters. :return: prediction result.

_run_prediction(save_path=None, print_result=True)[source]

This method should be implemented in the subclass for running predictions using the trained model.

Parameters:

kwargs – additional keyword arguments

Returns:

predicted labels or other prediction outputs

clear_input_samples()[source]
class pyabsa.tasks._Archive.ProteinRegression.prediction.protein_regressor.Predictor(checkpoint=None, **kwargs)[source]

Bases: ProteinRegressor