dicee.static_funcs
Functions
Add inverse triples into dask dataframe |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load weights and initialize pytorch module from namespace arguments |
|
Construct Ensemble Of weights and initialize pytorch module from namespace arguments |
|
|
|
Detect most efficient data type for a given triples |
|
Store Pytorch model into disk |
|
|
|
Add randomly constructed triples |
|
|
|
|
|
|
|
Save it as CSV if memory allows. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# @TODO: CD: Renamed this function |
|
|
|
|
|
|
Create |
|
Module Contents
- dicee.static_funcs.create_recipriocal_triples(x)
Add inverse triples into dask dataframe :param x: :return:
- dicee.static_funcs.get_er_vocab(data, file_path: str = None)
- dicee.static_funcs.get_re_vocab(data, file_path: str = None)
- dicee.static_funcs.get_ee_vocab(data, file_path: str = None)
- dicee.static_funcs.timeit(func)
- dicee.static_funcs.save_pickle(*, data: object = None, file_path=str)
- dicee.static_funcs.load_pickle(file_path=str)
- dicee.static_funcs.load_term_mapping(file_path=str)
- dicee.static_funcs.select_model(args: dict, is_continual_training: bool = None, storage_path: str = None)
- dicee.static_funcs.load_model(path_of_experiment_folder: str, model_name='model.pt', verbose=0) Tuple[object, Tuple[dict, dict]]
Load weights and initialize pytorch module from namespace arguments
- dicee.static_funcs.load_model_ensemble(path_of_experiment_folder: str) Tuple[dicee.models.base_model.BaseKGE, Tuple[pandas.DataFrame, pandas.DataFrame]]
Construct Ensemble Of weights and initialize pytorch module from namespace arguments
Detect models under given path
Accumulate parameters of detected models
Normalize parameters
Insert (3) into model.
- dicee.static_funcs.save_numpy_ndarray(*, data: numpy.ndarray, file_path: str)
- dicee.static_funcs.numpy_data_type_changer(train_set: numpy.ndarray, num: int) numpy.ndarray
Detect most efficient data type for a given triples :param train_set: :param num: :return:
- dicee.static_funcs.save_checkpoint_model(model, path: str) None
Store Pytorch model into disk
- dicee.static_funcs.store(trained_model, model_name: str = 'model', full_storage_path: str = None, save_embeddings_as_csv=False) None
- dicee.static_funcs.add_noisy_triples(train_set: pandas.DataFrame, add_noise_rate: float) pandas.DataFrame
Add randomly constructed triples :param train_set: :param add_noise_rate: :return:
- dicee.static_funcs.read_or_load_kg(args, cls)
- dicee.static_funcs.intialize_model(args: dict, verbose=0) Tuple[object, str]
- dicee.static_funcs.load_json(p: str) dict
- dicee.static_funcs.save_embeddings(embeddings: numpy.ndarray, indexes, path: str) None
Save it as CSV if memory allows. :param embeddings: :param indexes: :param path: :return:
- dicee.static_funcs.random_prediction(pre_trained_kge)
- dicee.static_funcs.deploy_triple_prediction(pre_trained_kge, str_subject, str_predicate, str_object)
- dicee.static_funcs.deploy_tail_entity_prediction(pre_trained_kge, str_subject, str_predicate, top_k)
- dicee.static_funcs.deploy_head_entity_prediction(pre_trained_kge, str_object, str_predicate, top_k)
- dicee.static_funcs.deploy_relation_prediction(pre_trained_kge, str_subject, str_object, top_k)
- dicee.static_funcs.vocab_to_parquet(vocab_to_idx, name, path_for_serialization, print_into)
- dicee.static_funcs.create_experiment_folder(folder_name='Experiments')
- dicee.static_funcs.continual_training_setup_executor(executor) None
- dicee.static_funcs.exponential_function(x: numpy.ndarray, lam: float, ascending_order=True) torch.FloatTensor
- dicee.static_funcs.load_numpy(path) numpy.ndarray
- dicee.static_funcs.evaluate(entity_to_idx, scores, easy_answers, hard_answers)
# @TODO: CD: Renamed this function Evaluate multi hop query answering on different query types
- dicee.static_funcs.download_file(url, destination_folder='.')
- dicee.static_funcs.download_files_from_url(base_url: str, destination_folder='.') None
- Parameters:
base_url (e.g. “https://files.dice-research.org/projects/DiceEmbeddings/KINSHIP-Keci-dim128-epoch256-KvsAll”)
destination_folder (e.g. "KINSHIP-Keci-dim128-epoch256-KvsAll")
- dicee.static_funcs.download_pretrained_model(url: str) str
- dicee.static_funcs.write_csv_from_model_parallel(path: str)
Create
- dicee.static_funcs.from_pretrained_model_write_embeddings_into_csv(path: str) None