pyabsa.tasks.CodeDefectDetection
Subpackages
pyabsa.tasks.CodeDefectDetection.configuration
pyabsa.tasks.CodeDefectDetection.dataset_utils
pyabsa.tasks.CodeDefectDetection.instructor
pyabsa.tasks.CodeDefectDetection.models
pyabsa.tasks.CodeDefectDetection.prediction
pyabsa.tasks.CodeDefectDetection.trainer
Package Contents
Classes
Trainer class for training PyABSA models |
|
Simple object for storing attributes. |
|
Built-in mutable sequence. |
|
Built-in mutable sequence. |
|
Text Classification or Sentiment analysis datasets |
|
- class pyabsa.tasks.CodeDefectDetection.CDDTrainer(config: pyabsa.tasks.CodeDefectDetection.configuration.cdd_configuration.CDDConfigManager = 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.CodeDefectDetection.CDDConfigManager(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.
- class pyabsa.tasks.CodeDefectDetection.BERTCDDModelList[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
- BERT
- class pyabsa.tasks.CodeDefectDetection.GloVeCDDModelList[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.
- LSTM
- class pyabsa.tasks.CodeDefectDetection.CDDDatasetList[source]
Bases:
list
Text Classification or Sentiment analysis datasets
- Promise
- GHPR
- Devign
- class pyabsa.tasks.CodeDefectDetection.CodeDefectDetector(checkpoint=None, cal_perplexity=False, **kwargs)[source]
Bases:
pyabsa.framework.prediction_class.predictor_template.InferenceModel
- task_code
- batch_infer(target_file=None, print_result=True, save_result=False, ignore_error=True, **kwargs)[source]
Perform batch inference on a given target file.
Args: - target_file: A file containing text inputs to perform inference on - print_result: Whether to print the result of each prediction - save_result: Whether to save the result of each prediction - ignore_error: Whether to ignore errors encountered during inference - **kwargs: Additional keyword arguments to be passed to batch_predict method
Returns: - A list of prediction results
- infer(text: str | list = None, print_result=True, ignore_error=True, **kwargs)[source]
Perform inference on a given text input.
Args: - text: The text inputs to perform inference on - print_result: Whether to print the result of each prediction - ignore_error: Whether to ignore errors encountered during inference - **kwargs: Additional keyword arguments to be passed to predict method
Returns: - A list of prediction results
- batch_predict(target_file=None, print_result=True, save_result=False, ignore_error=True, **kwargs)[source]
Predict from a file of labelences. param: target_file: the file path of the labelences 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.
- predict(text: str | list = None, print_result=True, ignore_error=True, **kwargs)[source]
Predict from a labelence or a list of labelences. param: text: the labelence or a list of labelence 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.
- class pyabsa.tasks.CodeDefectDetection.Predictor(checkpoint=None, cal_perplexity=False, **kwargs)[source]
Bases:
CodeDefectDetector