pyabsa.tasks.CodeDefectDetection.prediction.code_defect_detector
Module Contents
Classes
- class pyabsa.tasks.CodeDefectDetection.prediction.code_defect_detector.CodeDefectDetector(checkpoint=None, cal_perplexity=False, **kwargs)[source]
Bases:
pyabsa.framework.prediction_class.predictor_template.InferenceModel
- 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.prediction.code_defect_detector.Predictor(checkpoint=None, cal_perplexity=False, **kwargs)[source]
Bases:
CodeDefectDetector