fresco package
Subpackages
- fresco.data_loaders package
- Submodules
- fresco.data_loaders.data_utils module
AddNoise
DataHandler
DataHandler.data_source
DataHandler.model_args
DataHandler.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()
GroupedCases
LabelDict
PathReports
word2int()
- Module contents
- fresco.models package
- fresco.training package
- Submodules
- fresco.training.training module
ModelTrainer
ModelTrainer.savepath
ModelTrainer.epochs
ModelTrainer.patience_stop
ModelTrainer.tasks
ModelTrainer.n_task
ModelTrainer.model
ModelTrainer.dw
ModelTrainer.device
ModelTrainer.best_loss
ModelTrainer.patience_ctr
ModelTrainer.loss
ModelTrainer.y_preds
ModelTrainer.y_trues
ModelTrainer.multilabel
ModelTrainer.abstain
ModelTrainer.mixed_precision
ModelTrainer.opt
ModelTrainer.reduction
ModelTrainer.loss_funs
ModelTrainer.class_weights
ModelTrainer.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