Enums
DatasetType
- class src.enums.datasets.DatasetType(value)[source]
Bases:
str,EnumThis enum is used to specify what type of dataset to use,
- DYNAMIC: str = 'dynamic_general'
- MULTI_SECOND_LEVEL_ALL_BASED: str = 'm2_general'
- MULTI_TOP_LEVEL_ALL_BASED: str = 'm1_general'
- MULTI_TOP_LEVEL_ARTICLE_BASED: str = 'm1_article'
- MULTI_TOP_LEVEL_ARTICLE_SPLIT: str = 'm1_article_split'
- MULTI_TOP_LEVEL_DESCRIPTION_BASED: str = 'm1_description'
- MULTI_TOP_LEVEL_MOTIVATION_BASED: str = 'm1_motivation'
- MULTI_TOP_LEVEL_SHORT_TITLE_BASED: str = 'm1_shorttitle'
- SINGLE_BASIC: str = ''
- SINGLE_TOP_LEVEL_ALL_BASED: str = 's1_general'
- SUMMARY_STATISTIC_DATASET: str = 'summary_stat_dataset'
- UNPROCESSED: str = 'mirror'
- classmethod _list()[source]
internal classmethod that allows us to retrieve all possible datasets :return:
- static get_from_prefix(model_type: str)[source]
this function allows us to retrieve only the models compliant with the prefix filter
- Parameters:
model_type – the string prefix to filter the models with
- Returns:
a list with models that comply with the filter
DecisionQuery
- class src.enums.decision.DecisionQuery(value)[source]
Bases:
str,EnumThis enum is used to identify what type of query to run
- ALL = 'all'
- ANNOTATED = 'annotated'
- static match(config: DataModelConfig, value: DecisionQuery)[source]
this function allows us to verify the provided input and return the correct query
- Parameters:
config – the global configuration object
value – the enum value that is used.
- Returns:
format-able query in string format
Graph
- class src.enums.graph.GraphType(value)[source]
Bases:
str,EnumThis enum contains the predefined graph suffixes that can be used to save to a certain sparql graph
- MODEL_ANNOTATION = 'model_annotation'
- MODEL_INFORMATION = 'model_information'
- TESTING = 'testing_annotation'
- USER_ANNOTATION = 'user_annotation'
ModelType
- class src.enums.models.ModelType(value)[source]
Bases:
str,EnumThis enum is used to identify what model type/flavour you are running.
- DYNAMIC_TOPIC_MODEL: str = 'topic_model_dynamic'
- EMBEDDING_CHILD_LABELS: str = '_embedding_child_labels'
- EMBEDDING_CHUNKED: str = 'embedding_chunked'
- EMBEDDING_GROUND_UP: str = '_embedding_ground_up'
- EMBEDDING_GROUND_UP_GREEDY: str = '_embedding_ground_up_greedy'
- EMBEDDING_REGULAR: str = 'embedding_regular'
- EMBEDDING_SENTENCE: str = 'embedding_sentence'
- HIERARCHIC_TOPIC_MODEL: str = 'topic_model_hierarchic'
- HUGGINGFACE_MODEL: str = 'huggingface_model'
- HYBRID_BASE_MODEL: str = 'hybrid_base_model'
- HYBRID_SELECTIVE_MODEL: str = 'hybrid_selective_model'
- REGULAR_TOPIC_MODEL: str = 'topic_model_regular'
- ZEROSHOT_CHILD_LABELS: str = '_zeroshot_child_labels'
- ZEROSHOT_CHUNKED: str = 'zeroshot_chunked'
- ZEROSHOT_REGULAR: str = 'zeroshot_regular'
- ZEROSHOT_SENTENCE: str = 'zeroshot_sentence'
- classmethod _list()[source]
internal classmethod that allows us to retrieve all possible datasets :return:
EndpointType
- class src.enums.request.AuthType(value)[source]
Bases:
str,EnumThis enum specifies what authentication type to use on the sparql endpoint
- BASIC = 'basic'
- DIGEST = 'digest'
- NONE = 'none'
- class src.enums.request.EndpointType(value)[source]
Bases:
str,EnumThis enum is used to specify what type of query you want to execute
- DECISION = 'decision'
- TAXONOMY = 'taxonomy'
- static match(config: Config, value: EndpointType)[source]
this function allows us to verify the provided input and return the correct query
- Parameters:
config – the global configuration object
value – the enum value that is used.
- Returns:
the chosen endpoint url
SetfitClassifierHeads
- class src.enums.setfit.SetfitClassifierHeads(value)[source]
Bases:
str,EnumThis enum is used to identify what type of setfit head you want to use
- DIFFERENTIABLE_MULTI_OUTPUT: str = 'differentiable_multi-output'
- DIFFERENTIABLE_ONE_VS_REST: str = 'differentiable_one-vs-rest'
- SKLEARN_CLASSIFIER_CHAIN: str = 'sklearn_classifier-chain'
- SKLEARN_MULTI_OUTPUT: str = 'sklearn_multi-output'
- SKLEARN_ONE_VS_REST: str = 'sklearn_one-vs-rest'
- static get_prefixed_heads(prefix: str) list[str][source]
This function filters the setfit heads on values and returns the resulting heads
- Parameters:
prefix – string to check if in head value
- Returns:
filtered output as list
- static match(config: Config, value: SetfitClassifierHeads)[source]
this function allows us to verify the provided input and return the correct query
- Parameters:
config – the global configuration object
value – the enum value that is used.
- Returns:
format-able query in string format
TrainingFlavours
- class src.enums.supervised_flavours.TrainingFlavours(value)[source]
Bases:
str,EnumThis enum is used to identify what type of training flavour you want to use.
- BERT: str = 'bert'
- DISTIL_BERT: str = 'distil_bert'
- SETFIT: str = 'setfit'
- static get_default_model_for_type(config: Config, model_flavour: TrainingFlavours) str[source]
this function checks what the chosen flavour is and returns the defaulted value from the config for the model_id
- Parameters:
config – the global configuration object
model_flavour – the enum value that is used.
- Returns:
format-able query in string format