fresco package
Subpackages
- fresco.data_loaders package
- Submodules
- fresco.data_loaders.data_utils module
AddNoiseDataHandlerDataHandler.data_sourceDataHandler.model_argsDataHandler.convert_y()DataHandler.get_vocab()DataHandler.inference_loader()DataHandler.load_folds()DataHandler.load_from_saved()DataHandler.load_weights()DataHandler.make_grouped_cases()DataHandler.make_torch_dataloaders()DataHandler.seed_worker()
GroupedCasesLabelDictPathReportsword2int()
- Module contents
- fresco.models package
- fresco.training package
- Submodules
- fresco.training.training module
ModelTrainerModelTrainer.savepathModelTrainer.epochsModelTrainer.patience_stopModelTrainer.tasksModelTrainer.n_taskModelTrainer.modelModelTrainer.dwModelTrainer.deviceModelTrainer.best_lossModelTrainer.patience_ctrModelTrainer.lossModelTrainer.y_predsModelTrainer.y_truesModelTrainer.multilabelModelTrainer.abstainModelTrainer.mixed_precisionModelTrainer.optModelTrainer.reductionModelTrainer.loss_funsModelTrainer.class_weightsModelTrainer.compute_clc_loss()ModelTrainer.compute_clc_val_loss()ModelTrainer.compute_loss()ModelTrainer.compute_scores()ModelTrainer.compute_val_loss()ModelTrainer.fit_model()ModelTrainer.get_ys()ModelTrainer.output_scores()ModelTrainer.print_stats()ModelTrainer.profile_fit_model()ModelTrainer.score()ModelTrainer.stop_metrics()ModelTrainer.train_metrics()
trace_handler()
- Module contents
- fresco.validate package
Submodules
fresco.data_setup module
fresco.run_clc module
Top-level clc model building script using independent modules.
- fresco.run_clc.create_doc_embeddings(model, model_type, data_loader, device)[source]
Generate document embeddings from trained model.
- fresco.run_clc.create_model(params, dw, device)[source]
Define a model based on model_args.
- Parameters:
params (dict) – Dictionary of model_args file.
dw (DataHandler) – DataHandler class object.
device (torch.device) – Torch device, either ‘cpu’ or ‘cuda’.
- Returns:
A model.
- fresco.run_clc.load_model_dict(model_path, data_path='')[source]
Load pretrained model from disk.
- Parameters:
model_path (str) – Path to the saved model from command line args.
valid_params (ValidateParams) – ValidateParams class object with model_args dict.
data_path (str or None) – Path to data from the trained model, or None.
We check if the supplied path is valid and if the packages match needed to run the pretrained model.
fresco.run_ie module
Top-level information extraction model building script using independent modules.
- fresco.run_ie.create_model(params, dw, device)[source]
Define a model based on model_args.
- Parameters:
params (dict) – Dictionary of model_args file.
dw (DataHandler) – DataHandler class object.
device (torch.device) – Torch device, either ‘cpu’ or ‘cuda’.
- Returns:
A model.
- fresco.run_ie.load_model(model_path, device, dw, valid_params)[source]
Load a pretrained model from disk.
- Parameters:
model_path (str) – Path to the saved model obtained from command line args.
device (torch.device) – Torch device, either ‘cuda’ or ‘cpu’, set in the calling function.
dw (DataHandler) – DataHandler class instance for wrangling data and checking metadata.
valid_params (ValidateParams) – ValidateParams class instance with model_args dict.
- Post-condition:
The saved model is loaded and set to eval() mode.
- Returns:
None