pyabsa.tasks._Archive.ProteinRegression

Subpackages

Package Contents

Classes

ProteinRTrainer

Trainer class for training PyABSA models

ProteinRConfigManager

Simple object for storing attributes.

BERTProteinRModelList

Built-in mutable sequence.

GloVeProteinRModelList

Built-in mutable sequence.

ProteinRDatasetList

Protein Sequence-based Regression Dataset Lists

ProteinRegressionDatasetList

Protein Sequence-based Regression Dataset Lists

ProteinRegressor

Predictor

class pyabsa.tasks._Archive.ProteinRegression.ProteinRTrainer(config: pyabsa.tasks._Archive.ProteinRegression.configuration.proteinr_configuration.ProteinRConfigManager = None, dataset=None, from_checkpoint: str = None, checkpoint_save_mode: int = ModelSaveOption.SAVE_MODEL_STATE_DICT, auto_device: bool | str = DeviceTypeOption.AUTO, path_to_save=None, load_aug=False)[source]

Bases: pyabsa.framework.trainer_class.trainer_template.Trainer

Trainer class for training PyABSA models

class pyabsa.tasks._Archive.ProteinRegression.ProteinRConfigManager(args, **kwargs)[source]

Bases: pyabsa.framework.configuration_class.configuration_template.ConfigManager

Simple object for storing attributes.

Implements equality by attribute names and values, and provides a simple string representation.

static set_proteinr_config(configType: str, newitem: dict)[source]
static set_proteinr_config_template(newitem)[source]
static set_proteinr_config_base(newitem)[source]
static set_proteinr_config_english(newitem)[source]
static set_proteinr_config_chinese(newitem)[source]
static set_proteinr_config_multilingual(newitem)[source]
static set_proteinr_config_glove(newitem)[source]
static get_proteinr_config_template()[source]
static get_proteinr_config_base()[source]
static get_proteinr_config_english()[source]
static get_proteinr_config_chinese()[source]
static get_proteinr_config_multilingual()[source]
static get_proteinr_config_glove()[source]
class pyabsa.tasks._Archive.ProteinRegression.BERTProteinRModelList[source]

Bases: list

Built-in mutable sequence.

If no argument is given, the constructor creates a new empty list. The argument must be an iterable if specified.

BERT_MLP
class pyabsa.tasks._Archive.ProteinRegression.GloVeProteinRModelList[source]

Bases: list

Built-in mutable sequence.

If no argument is given, the constructor creates a new empty list. The argument must be an iterable if specified.

CNN
LSTM
Transformer
MHSA
class pyabsa.tasks._Archive.ProteinRegression.ProteinRDatasetList[source]

Bases: list

Protein Sequence-based Regression Dataset Lists

class pyabsa.tasks._Archive.ProteinRegression.ProteinRegressionDatasetList[source]

Bases: list

Protein Sequence-based Regression Dataset Lists

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

Bases: pyabsa.framework.prediction_class.predictor_template.InferenceModel

task_code
_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.Predictor(checkpoint=None, **kwargs)[source]

Bases: ProteinRegressor