Base

class sylloge.base.BinaryCacheableEADataset(*, cache_path: Union[str, Path], use_cache: bool = True, parquet_load_options: Optional[Mapping] = None, parquet_store_options: Optional[Mapping] = None, backend: Literal['pandas'], use_cluster_helper: Literal[False], **init_kwargs)[source]
class sylloge.base.BinaryCacheableEADataset(*, cache_path: Union[str, Path], use_cache: bool = True, parquet_load_options: Optional[Mapping] = None, parquet_store_options: Optional[Mapping] = None, backend: Literal['dask'], use_cluster_helper: Literal[False], **init_kwargs)
class sylloge.base.BinaryCacheableEADataset(*, cache_path: Union[str, Path], use_cache: bool = True, parquet_load_options: Optional[Mapping] = None, parquet_store_options: Optional[Mapping] = None, backend: Literal['pandas'], use_cluster_helper: Literal[True], **init_kwargs)
class sylloge.base.BinaryCacheableEADataset(*, cache_path: Union[str, Path], use_cache: bool = True, parquet_load_options: Optional[Mapping] = None, parquet_store_options: Optional[Mapping] = None, backend: Literal['dask'], use_cluster_helper: Literal[True], **init_kwargs)

Bases: CacheableEADataset[DataFrameType, LinkType], BinaryEADataset[DataFrameType, LinkType]

Binary version of CacheableEADataset.

property canonical_name: str

A canonical name for this dataset instance.

This includes all the necessary information to distinguish this specific dataset as string. This can be used e.g. to create folders with this dataset name to store results.

Returns:

concise string representation for this dataset instance

create_cache_path(pystow_module, inner_cache_path, cache_path=None)

Use either pystow module or cache_path to create cache path.

Parameters:
  • pystow_module (Module) – module where data is stored

  • inner_cache_path (str) – path relative to pystow/cache path

  • cache_path (Union[str, Path, None]) – alternative to pystow module

Return type:

Path

Returns:

cache path as pathlib.Path

abstract initial_read(backend)

Read data for initialising EADataset.

Return type:

Dict[str, Any]

classmethod read_parquet(path, backend='pandas', use_cluster_helper=True, **kwargs)

Read dataset from parquet files in given path.

This function expects the left/right attribute/relation triples and entity links as well as a dataset_names.txt

Optionally folds are read from a folds directory, with numbered fold subdirectories containing train/test/val links.

Parameters:
  • path (Union[str, Path]) – Directory with files

  • backend (Literal['pandas', 'dask']) – Whether to use pandas or dask for reading

  • kwargs – passed on to the respective read function

  • use_cluster_helper (bool) – if True uses ClusterHelper to load links

Return type:

ParquetEADataset

Returns:

EADataset read from parquet

See also

to_parquet()

statistics()

Provide statistics of datasets.

Return type:

Tuple[List[DatasetStatistics], int]

Returns:

statistics of left dataset, statistics of right dataset and number of gold standard matches

to_parquet(path, **kwargs)

Write dataset to path as several parquet files.

Parameters:
  • path (Union[str, Path]) – directory where dataset will be stored. Will be created if necessary.

  • kwargs – will be handed through to to_parquet functions

See also

read_parquet()

class sylloge.base.BinaryEADataset(rel_triples, attr_triples, ent_links, dataset_names, folds=None)[source]

Bases: MultiSourceEADataset[DataFrameType, LinkType]

Binary class to get left and right triples easier.

property canonical_name: str

A canonical name for this dataset instance.

This includes all the necessary information to distinguish this specific dataset as string. This can be used e.g. to create folders with this dataset name to store results.

Returns:

concise string representation for this dataset instance

statistics()

Provide statistics of datasets.

Return type:

Tuple[List[DatasetStatistics], int]

Returns:

statistics of left dataset, statistics of right dataset and number of gold standard matches

class sylloge.base.BinaryParquetEADataset(*, rel_triples: Sequence[DataFrameType], attr_triples: Sequence[DataFrameType], ent_links: LinkType, dataset_names: Tuple[str, ...], ds_prefix_tuples: Optional[Tuple[str, ...]] = None, folds: Optional[Sequence[TrainTestValSplit]] = None, backend: Literal['pandas'] = 'pandas')[source]
class sylloge.base.BinaryParquetEADataset(*, rel_triples: Sequence[DataFrameType], attr_triples: Sequence[DataFrameType], ent_links: LinkType, dataset_names: Tuple[str, ...], ds_prefix_tuples: Optional[Tuple[str, ...]] = None, folds: Optional[Sequence[TrainTestValSplit]] = None, backend: Literal['dask'] = 'dask')

Bases: ParquetEADataset[DataFrameType, LinkType], BinaryEADataset[DataFrameType, LinkType]

Binary version of ParquetEADataset.

property canonical_name: str

A canonical name for this dataset instance.

This includes all the necessary information to distinguish this specific dataset as string. This can be used e.g. to create folders with this dataset name to store results.

Returns:

concise string representation for this dataset instance

classmethod read_parquet(path, backend='pandas', use_cluster_helper=True, **kwargs)

Read dataset from parquet files in given path.

This function expects the left/right attribute/relation triples and entity links as well as a dataset_names.txt

Optionally folds are read from a folds directory, with numbered fold subdirectories containing train/test/val links.

Parameters:
  • path (Union[str, Path]) – Directory with files

  • backend (Literal['pandas', 'dask']) – Whether to use pandas or dask for reading

  • kwargs – passed on to the respective read function

  • use_cluster_helper (bool) – if True uses ClusterHelper to load links

Return type:

ParquetEADataset

Returns:

EADataset read from parquet

See also

to_parquet()

statistics()

Provide statistics of datasets.

Return type:

Tuple[List[DatasetStatistics], int]

Returns:

statistics of left dataset, statistics of right dataset and number of gold standard matches

to_parquet(path, **kwargs)

Write dataset to path as several parquet files.

Parameters:
  • path (Union[str, Path]) – directory where dataset will be stored. Will be created if necessary.

  • kwargs – will be handed through to to_parquet functions

See also

read_parquet()

class sylloge.base.BinaryZipEADataset(*, cache_path: Path, zip_path: str, inner_path: PurePosixPath, dataset_names: Tuple[str, ...], ds_prefix_tuples: Optional[Tuple[str, ...]] = None, file_names_rel_triples: Sequence[str] = ('rel_triples_1', 'rel_triples_2'), file_names_attr_triples: Sequence[str] = ('attr_triples_1', 'attr_triples_2'), file_name_ent_links: str = 'ent_links', backend: Literal['pandas'], use_cluster_helper: Literal[False], use_cache: bool = True)[source]
class sylloge.base.BinaryZipEADataset(*, cache_path: Path, zip_path: str, inner_path: PurePosixPath, dataset_names: Tuple[str, ...], ds_prefix_tuples: Optional[Tuple[str, ...]] = None, file_names_rel_triples: Sequence[str] = ('rel_triples_1', 'rel_triples_2'), file_names_attr_triples: Sequence[str] = ('attr_triples_1', 'attr_triples_2'), file_name_ent_links: str = 'ent_links', backend: Literal['dask'], use_cluster_helper: Literal[False], use_cache: bool = True)
class sylloge.base.BinaryZipEADataset(*, cache_path: Path, zip_path: str, inner_path: PurePosixPath, dataset_names: Tuple[str, ...], ds_prefix_tuples: Optional[Tuple[str, ...]] = None, file_names_rel_triples: Sequence[str] = ('rel_triples_1', 'rel_triples_2'), file_names_attr_triples: Sequence[str] = ('attr_triples_1', 'attr_triples_2'), file_name_ent_links: str = 'ent_links', backend: Literal['pandas'], use_cluster_helper: Literal[True], use_cache: bool = True)
class sylloge.base.BinaryZipEADataset(*, cache_path: Path, zip_path: str, inner_path: PurePosixPath, dataset_names: Tuple[str, ...], ds_prefix_tuples: Optional[Tuple[str, ...]] = None, file_names_rel_triples: Sequence[str] = ('rel_triples_1', 'rel_triples_2'), file_names_attr_triples: Sequence[str] = ('attr_triples_1', 'attr_triples_2'), file_name_ent_links: str = 'ent_links', backend: Literal['dask'], use_cluster_helper: Literal[True], use_cache: bool = True)

Bases: ZipEADataset[DataFrameType, LinkType], BinaryEADataset[DataFrameType, LinkType]

Binary version of ZipEADataset.

property canonical_name: str

A canonical name for this dataset instance.

This includes all the necessary information to distinguish this specific dataset as string. This can be used e.g. to create folders with this dataset name to store results.

Returns:

concise string representation for this dataset instance

create_cache_path(pystow_module, inner_cache_path, cache_path=None)

Use either pystow module or cache_path to create cache path.

Parameters:
  • pystow_module (Module) – module where data is stored

  • inner_cache_path (str) – path relative to pystow/cache path

  • cache_path (Union[str, Path, None]) – alternative to pystow module

Return type:

Path

Returns:

cache path as pathlib.Path

initial_read(backend)

Read data for initialising EADataset.

Return type:

Dict[str, Any]

classmethod read_parquet(path, backend='pandas', use_cluster_helper=True, **kwargs)

Read dataset from parquet files in given path.

This function expects the left/right attribute/relation triples and entity links as well as a dataset_names.txt

Optionally folds are read from a folds directory, with numbered fold subdirectories containing train/test/val links.

Parameters:
  • path (Union[str, Path]) – Directory with files

  • backend (Literal['pandas', 'dask']) – Whether to use pandas or dask for reading

  • kwargs – passed on to the respective read function

  • use_cluster_helper (bool) – if True uses ClusterHelper to load links

Return type:

ParquetEADataset

Returns:

EADataset read from parquet

See also

to_parquet()

statistics()

Provide statistics of datasets.

Return type:

Tuple[List[DatasetStatistics], int]

Returns:

statistics of left dataset, statistics of right dataset and number of gold standard matches

to_parquet(path, **kwargs)

Write dataset to path as several parquet files.

Parameters:
  • path (Union[str, Path]) – directory where dataset will be stored. Will be created if necessary.

  • kwargs – will be handed through to to_parquet functions

See also

read_parquet()

class sylloge.base.BinaryZipEADatasetWithPreSplitFolds(*, cache_path: Path, zip_path: str, inner_path: PurePosixPath, dataset_names: Tuple[str, ...], ds_prefix_tuples: Optional[Tuple[str, ...]] = None, file_names_rel_triples: Sequence[str] = ('rel_triples_1', 'rel_triples_2'), file_names_attr_triples: Sequence[str] = ('attr_triples_1', 'attr_triples_2'), file_name_ent_links: str = 'ent_links', backend: Literal['pandas'], use_cluster_helper: Literal[False], directory_name_folds: str = '721_5fold', directory_names_individual_folds: Sequence[str] = ('1', '2', '3', '4', '5'), file_name_test_links: str = 'test_links', file_name_train_links: str = 'train_links', file_name_valid_links: str = 'valid_links', use_cache: bool = True)[source]
class sylloge.base.BinaryZipEADatasetWithPreSplitFolds(*, cache_path: Path, zip_path: str, inner_path: PurePosixPath, dataset_names: Tuple[str, ...], ds_prefix_tuples: Optional[Tuple[str, ...]] = None, file_names_rel_triples: Sequence[str] = ('rel_triples_1', 'rel_triples_2'), file_names_attr_triples: Sequence[str] = ('attr_triples_1', 'attr_triples_2'), file_name_ent_links: str = 'ent_links', backend: Literal['dask'], use_cluster_helper: Literal[False], directory_name_folds: str = '721_5fold', directory_names_individual_folds: Sequence[str] = ('1', '2', '3', '4', '5'), file_name_test_links: str = 'test_links', file_name_train_links: str = 'train_links', file_name_valid_links: str = 'valid_links', use_cache: bool = True)
class sylloge.base.BinaryZipEADatasetWithPreSplitFolds(*, cache_path: Path, zip_path: str, inner_path: PurePosixPath, dataset_names: Tuple[str, ...], ds_prefix_tuples: Optional[Tuple[str, ...]] = None, file_names_rel_triples: Sequence[str] = ('rel_triples_1', 'rel_triples_2'), file_names_attr_triples: Sequence[str] = ('attr_triples_1', 'attr_triples_2'), file_name_ent_links: str = 'ent_links', backend: Literal['pandas'], use_cluster_helper: Literal[True], directory_name_folds: str = '721_5fold', directory_names_individual_folds: Sequence[str] = ('1', '2', '3', '4', '5'), file_name_test_links: str = 'test_links', file_name_train_links: str = 'train_links', file_name_valid_links: str = 'valid_links', use_cache: bool = True)
class sylloge.base.BinaryZipEADatasetWithPreSplitFolds(*, cache_path: Path, zip_path: str, inner_path: PurePosixPath, dataset_names: Tuple[str, ...], ds_prefix_tuples: Optional[Tuple[str, ...]] = None, file_names_rel_triples: Sequence[str] = ('rel_triples_1', 'rel_triples_2'), file_names_attr_triples: Sequence[str] = ('attr_triples_1', 'attr_triples_2'), file_name_ent_links: str = 'ent_links', backend: Literal['dask'], use_cluster_helper: Literal[True], directory_name_folds: str = '721_5fold', directory_names_individual_folds: Sequence[str] = ('1', '2', '3', '4', '5'), file_name_test_links: str = 'test_links', file_name_train_links: str = 'train_links', file_name_valid_links: str = 'valid_links', use_cache: bool = True)

Bases: ZipEADatasetWithPreSplitFolds[DataFrameType, LinkType], BinaryEADataset[DataFrameType, LinkType]

Binary version of ZipEADataset.

property canonical_name: str

A canonical name for this dataset instance.

This includes all the necessary information to distinguish this specific dataset as string. This can be used e.g. to create folders with this dataset name to store results.

Returns:

concise string representation for this dataset instance

create_cache_path(pystow_module, inner_cache_path, cache_path=None)

Use either pystow module or cache_path to create cache path.

Parameters:
  • pystow_module (Module) – module where data is stored

  • inner_cache_path (str) – path relative to pystow/cache path

  • cache_path (Union[str, Path, None]) – alternative to pystow module

Return type:

Path

Returns:

cache path as pathlib.Path

initial_read(backend)

Read data for initialising EADataset.

Return type:

Dict[str, Any]

classmethod read_parquet(path, backend='pandas', use_cluster_helper=True, **kwargs)

Read dataset from parquet files in given path.

This function expects the left/right attribute/relation triples and entity links as well as a dataset_names.txt

Optionally folds are read from a folds directory, with numbered fold subdirectories containing train/test/val links.

Parameters:
  • path (Union[str, Path]) – Directory with files

  • backend (Literal['pandas', 'dask']) – Whether to use pandas or dask for reading

  • kwargs – passed on to the respective read function

  • use_cluster_helper (bool) – if True uses ClusterHelper to load links

Return type:

ParquetEADataset

Returns:

EADataset read from parquet

See also

to_parquet()

statistics()

Provide statistics of datasets.

Return type:

Tuple[List[DatasetStatistics], int]

Returns:

statistics of left dataset, statistics of right dataset and number of gold standard matches

to_parquet(path, **kwargs)

Write dataset to path as several parquet files.

Parameters:
  • path (Union[str, Path]) – directory where dataset will be stored. Will be created if necessary.

  • kwargs – will be handed through to to_parquet functions

See also

read_parquet()

class sylloge.base.CacheableEADataset(*, cache_path: Union[str, Path], use_cache: bool = True, parquet_load_options: Optional[Mapping] = None, parquet_store_options: Optional[Mapping] = None, backend: Literal['pandas'], use_cluster_helper: Literal[False], **init_kwargs)[source]
class sylloge.base.CacheableEADataset(*, cache_path: Union[str, Path], use_cache: bool = True, parquet_load_options: Optional[Mapping] = None, parquet_store_options: Optional[Mapping] = None, backend: Literal['dask'], use_cluster_helper: Literal[False], **init_kwargs)
class sylloge.base.CacheableEADataset(*, cache_path: Union[str, Path], use_cache: bool = True, parquet_load_options: Optional[Mapping] = None, parquet_store_options: Optional[Mapping] = None, backend: Literal['pandas'], use_cluster_helper: Literal[True], **init_kwargs)
class sylloge.base.CacheableEADataset(*, cache_path: Union[str, Path], use_cache: bool = True, parquet_load_options: Optional[Mapping] = None, parquet_store_options: Optional[Mapping] = None, backend: Literal['dask'], use_cluster_helper: Literal[True], **init_kwargs)

Bases: ParquetEADataset[DataFrameType, LinkType]

property canonical_name: str

A canonical name for this dataset instance.

This includes all the necessary information to distinguish this specific dataset as string. This can be used e.g. to create folders with this dataset name to store results.

Returns:

concise string representation for this dataset instance

create_cache_path(pystow_module, inner_cache_path, cache_path=None)[source]

Use either pystow module or cache_path to create cache path.

Parameters:
  • pystow_module (Module) – module where data is stored

  • inner_cache_path (str) – path relative to pystow/cache path

  • cache_path (Union[str, Path, None]) – alternative to pystow module

Return type:

Path

Returns:

cache path as pathlib.Path

abstract initial_read(backend)[source]

Read data for initialising EADataset.

Return type:

Dict[str, Any]

classmethod read_parquet(path, backend='pandas', use_cluster_helper=True, **kwargs)

Read dataset from parquet files in given path.

This function expects the left/right attribute/relation triples and entity links as well as a dataset_names.txt

Optionally folds are read from a folds directory, with numbered fold subdirectories containing train/test/val links.

Parameters:
  • path (Union[str, Path]) – Directory with files

  • backend (Literal['pandas', 'dask']) – Whether to use pandas or dask for reading

  • kwargs – passed on to the respective read function

  • use_cluster_helper (bool) – if True uses ClusterHelper to load links

Return type:

ParquetEADataset

Returns:

EADataset read from parquet

See also

to_parquet()

statistics()

Provide statistics of datasets.

Return type:

Tuple[List[DatasetStatistics], int]

Returns:

statistics of left dataset, statistics of right dataset and number of gold standard matches

to_parquet(path, **kwargs)

Write dataset to path as several parquet files.

Parameters:
  • path (Union[str, Path]) – directory where dataset will be stored. Will be created if necessary.

  • kwargs – will be handed through to to_parquet functions

See also

read_parquet()

class sylloge.base.DatasetStatistics(rel_triples, attr_triples, entities, relations, properties, literals)[source]

Bases: object

class sylloge.base.MultiSourceEADataset(rel_triples, attr_triples, ent_links, dataset_names, folds=None)[source]

Bases: Generic[DataFrameType, LinkType]

Dataset class holding information of the alignment class.

property canonical_name: str

A canonical name for this dataset instance.

This includes all the necessary information to distinguish this specific dataset as string. This can be used e.g. to create folders with this dataset name to store results.

Returns:

concise string representation for this dataset instance

statistics()[source]

Provide statistics of datasets.

Return type:

Tuple[List[DatasetStatistics], int]

Returns:

statistics of left dataset, statistics of right dataset and number of gold standard matches

class sylloge.base.ParquetEADataset(*, rel_triples: Sequence[DataFrameType], attr_triples: Sequence[DataFrameType], ent_links: LinkType, dataset_names: Tuple[str, ...], ds_prefix_tuples: Optional[Tuple[str, ...]] = None, folds: Optional[Sequence[TrainTestValSplit]] = None, backend: Literal['pandas'] = 'pandas')[source]
class sylloge.base.ParquetEADataset(*, rel_triples: Sequence[DataFrameType], attr_triples: Sequence[DataFrameType], ent_links: LinkType, dataset_names: Tuple[str, ...], ds_prefix_tuples: Optional[Tuple[str, ...]] = None, folds: Optional[Sequence[TrainTestValSplit]] = None, backend: Literal['dask'] = 'dask')

Bases: MultiSourceEADataset[DataFrameType, LinkType]

Dataset class holding information of the alignment task.

property canonical_name: str

A canonical name for this dataset instance.

This includes all the necessary information to distinguish this specific dataset as string. This can be used e.g. to create folders with this dataset name to store results.

Returns:

concise string representation for this dataset instance

classmethod read_parquet(path, backend='pandas', use_cluster_helper=True, **kwargs)[source]

Read dataset from parquet files in given path.

This function expects the left/right attribute/relation triples and entity links as well as a dataset_names.txt

Optionally folds are read from a folds directory, with numbered fold subdirectories containing train/test/val links.

Parameters:
  • path (Union[str, Path]) – Directory with files

  • backend (Literal['pandas', 'dask']) – Whether to use pandas or dask for reading

  • kwargs – passed on to the respective read function

  • use_cluster_helper (bool) – if True uses ClusterHelper to load links

Return type:

ParquetEADataset

Returns:

EADataset read from parquet

See also

to_parquet()

statistics()

Provide statistics of datasets.

Return type:

Tuple[List[DatasetStatistics], int]

Returns:

statistics of left dataset, statistics of right dataset and number of gold standard matches

to_parquet(path, **kwargs)[source]

Write dataset to path as several parquet files.

Parameters:
  • path (Union[str, Path]) – directory where dataset will be stored. Will be created if necessary.

  • kwargs – will be handed through to to_parquet functions

See also

read_parquet()

class sylloge.base.TrainTestValSplit(train, test, val)[source]

Bases: Generic[LinkType]

Dataclass holding split of gold standard entity links.

test: TypeVar(LinkType, DataFrame, DataFrame, PrefixedClusterHelper)

entity links for testing

train: TypeVar(LinkType, DataFrame, DataFrame, PrefixedClusterHelper)

entity links for training

val: TypeVar(LinkType, DataFrame, DataFrame, PrefixedClusterHelper)

entity links for validation

class sylloge.base.ZipEADataset(*, cache_path: Path, zip_path: str, inner_path: PurePosixPath, dataset_names: Tuple[str, ...], ds_prefix_tuples: Optional[Tuple[str, ...]] = None, file_names_rel_triples: Sequence[str] = ('rel_triples_1', 'rel_triples_2'), file_names_attr_triples: Sequence[str] = ('attr_triples_1', 'attr_triples_2'), file_name_ent_links: str = 'ent_links', backend: Literal['pandas'], use_cluster_helper: Literal[False], use_cache: bool = True)[source]
class sylloge.base.ZipEADataset(*, cache_path: Path, zip_path: str, inner_path: PurePosixPath, dataset_names: Tuple[str, ...], ds_prefix_tuples: Optional[Tuple[str, ...]] = None, file_names_rel_triples: Sequence[str] = ('rel_triples_1', 'rel_triples_2'), file_names_attr_triples: Sequence[str] = ('attr_triples_1', 'attr_triples_2'), file_name_ent_links: str = 'ent_links', backend: Literal['dask'], use_cluster_helper: Literal[False], use_cache: bool = True)
class sylloge.base.ZipEADataset(*, cache_path: Path, zip_path: str, inner_path: PurePosixPath, dataset_names: Tuple[str, ...], ds_prefix_tuples: Optional[Tuple[str, ...]] = None, file_names_rel_triples: Sequence[str] = ('rel_triples_1', 'rel_triples_2'), file_names_attr_triples: Sequence[str] = ('attr_triples_1', 'attr_triples_2'), file_name_ent_links: str = 'ent_links', backend: Literal['pandas'], use_cluster_helper: Literal[True], use_cache: bool = True)
class sylloge.base.ZipEADataset(*, cache_path: Path, zip_path: str, inner_path: PurePosixPath, dataset_names: Tuple[str, ...], ds_prefix_tuples: Optional[Tuple[str, ...]] = None, file_names_rel_triples: Sequence[str] = ('rel_triples_1', 'rel_triples_2'), file_names_attr_triples: Sequence[str] = ('attr_triples_1', 'attr_triples_2'), file_name_ent_links: str = 'ent_links', backend: Literal['dask'], use_cluster_helper: Literal[True], use_cache: bool = True)

Bases: CacheableEADataset[DataFrameType, LinkType]

Dataset created from zip file which is downloaded.

property canonical_name: str

A canonical name for this dataset instance.

This includes all the necessary information to distinguish this specific dataset as string. This can be used e.g. to create folders with this dataset name to store results.

Returns:

concise string representation for this dataset instance

create_cache_path(pystow_module, inner_cache_path, cache_path=None)

Use either pystow module or cache_path to create cache path.

Parameters:
  • pystow_module (Module) – module where data is stored

  • inner_cache_path (str) – path relative to pystow/cache path

  • cache_path (Union[str, Path, None]) – alternative to pystow module

Return type:

Path

Returns:

cache path as pathlib.Path

initial_read(backend)[source]

Read data for initialising EADataset.

Return type:

Dict[str, Any]

classmethod read_parquet(path, backend='pandas', use_cluster_helper=True, **kwargs)

Read dataset from parquet files in given path.

This function expects the left/right attribute/relation triples and entity links as well as a dataset_names.txt

Optionally folds are read from a folds directory, with numbered fold subdirectories containing train/test/val links.

Parameters:
  • path (Union[str, Path]) – Directory with files

  • backend (Literal['pandas', 'dask']) – Whether to use pandas or dask for reading

  • kwargs – passed on to the respective read function

  • use_cluster_helper (bool) – if True uses ClusterHelper to load links

Return type:

ParquetEADataset

Returns:

EADataset read from parquet

See also

to_parquet()

statistics()

Provide statistics of datasets.

Return type:

Tuple[List[DatasetStatistics], int]

Returns:

statistics of left dataset, statistics of right dataset and number of gold standard matches

to_parquet(path, **kwargs)

Write dataset to path as several parquet files.

Parameters:
  • path (Union[str, Path]) – directory where dataset will be stored. Will be created if necessary.

  • kwargs – will be handed through to to_parquet functions

See also

read_parquet()

class sylloge.base.ZipEADatasetWithPreSplitFolds(*, cache_path: Path, zip_path: str, inner_path: PurePosixPath, dataset_names: Tuple[str, ...], ds_prefix_tuples: Optional[Tuple[str, ...]] = None, file_names_rel_triples: Sequence[str] = ('rel_triples_1', 'rel_triples_2'), file_names_attr_triples: Sequence[str] = ('attr_triples_1', 'attr_triples_2'), file_name_ent_links: str = 'ent_links', backend: Literal['pandas'], use_cluster_helper: Literal[False], directory_name_folds: str = '721_5fold', directory_names_individual_folds: Sequence[str] = ('1', '2', '3', '4', '5'), file_name_test_links: str = 'test_links', file_name_train_links: str = 'train_links', file_name_valid_links: str = 'valid_links', use_cache: bool = True)[source]
class sylloge.base.ZipEADatasetWithPreSplitFolds(*, cache_path: Path, zip_path: str, inner_path: PurePosixPath, dataset_names: Tuple[str, ...], ds_prefix_tuples: Optional[Tuple[str, ...]] = None, file_names_rel_triples: Sequence[str] = ('rel_triples_1', 'rel_triples_2'), file_names_attr_triples: Sequence[str] = ('attr_triples_1', 'attr_triples_2'), file_name_ent_links: str = 'ent_links', backend: Literal['dask'], use_cluster_helper: Literal[False], directory_name_folds: str = '721_5fold', directory_names_individual_folds: Sequence[str] = ('1', '2', '3', '4', '5'), file_name_test_links: str = 'test_links', file_name_train_links: str = 'train_links', file_name_valid_links: str = 'valid_links', use_cache: bool = True)
class sylloge.base.ZipEADatasetWithPreSplitFolds(*, cache_path: Path, zip_path: str, inner_path: PurePosixPath, dataset_names: Tuple[str, ...], ds_prefix_tuples: Optional[Tuple[str, ...]] = None, file_names_rel_triples: Sequence[str] = ('rel_triples_1', 'rel_triples_2'), file_names_attr_triples: Sequence[str] = ('attr_triples_1', 'attr_triples_2'), file_name_ent_links: str = 'ent_links', backend: Literal['pandas'], use_cluster_helper: Literal[True], directory_name_folds: str = '721_5fold', directory_names_individual_folds: Sequence[str] = ('1', '2', '3', '4', '5'), file_name_test_links: str = 'test_links', file_name_train_links: str = 'train_links', file_name_valid_links: str = 'valid_links', use_cache: bool = True)
class sylloge.base.ZipEADatasetWithPreSplitFolds(*, cache_path: Path, zip_path: str, inner_path: PurePosixPath, dataset_names: Tuple[str, ...], ds_prefix_tuples: Optional[Tuple[str, ...]] = None, file_names_rel_triples: Sequence[str] = ('rel_triples_1', 'rel_triples_2'), file_names_attr_triples: Sequence[str] = ('attr_triples_1', 'attr_triples_2'), file_name_ent_links: str = 'ent_links', backend: Literal['dask'], use_cluster_helper: Literal[True], directory_name_folds: str = '721_5fold', directory_names_individual_folds: Sequence[str] = ('1', '2', '3', '4', '5'), file_name_test_links: str = 'test_links', file_name_train_links: str = 'train_links', file_name_valid_links: str = 'valid_links', use_cache: bool = True)

Bases: ZipEADataset[DataFrameType, LinkType]

Dataset with pre-split folds created from zip file which is downloaded.

property canonical_name: str

A canonical name for this dataset instance.

This includes all the necessary information to distinguish this specific dataset as string. This can be used e.g. to create folders with this dataset name to store results.

Returns:

concise string representation for this dataset instance

create_cache_path(pystow_module, inner_cache_path, cache_path=None)

Use either pystow module or cache_path to create cache path.

Parameters:
  • pystow_module (Module) – module where data is stored

  • inner_cache_path (str) – path relative to pystow/cache path

  • cache_path (Union[str, Path, None]) – alternative to pystow module

Return type:

Path

Returns:

cache path as pathlib.Path

initial_read(backend)[source]

Read data for initialising EADataset.

Return type:

Dict[str, Any]

classmethod read_parquet(path, backend='pandas', use_cluster_helper=True, **kwargs)

Read dataset from parquet files in given path.

This function expects the left/right attribute/relation triples and entity links as well as a dataset_names.txt

Optionally folds are read from a folds directory, with numbered fold subdirectories containing train/test/val links.

Parameters:
  • path (Union[str, Path]) – Directory with files

  • backend (Literal['pandas', 'dask']) – Whether to use pandas or dask for reading

  • kwargs – passed on to the respective read function

  • use_cluster_helper (bool) – if True uses ClusterHelper to load links

Return type:

ParquetEADataset

Returns:

EADataset read from parquet

See also

to_parquet()

statistics()

Provide statistics of datasets.

Return type:

Tuple[List[DatasetStatistics], int]

Returns:

statistics of left dataset, statistics of right dataset and number of gold standard matches

to_parquet(path, **kwargs)

Write dataset to path as several parquet files.

Parameters:
  • path (Union[str, Path]) – directory where dataset will be stored. Will be created if necessary.

  • kwargs – will be handed through to to_parquet functions

See also

read_parquet()