Task
Alignment Task
AlignmentTask
Domain
Domain
A domain is a combination of DomainComponents along with a weight for each component.
Note: We do not enforce that the weights be normalized.
Parameters:
-
components(List[DomainComponent]) –List of DomainComponents that constitute the domain.
-
weights(Optional[List[NonNegativeFloat]]) –Weights given to each constituent component (uniform if not specified).
Raises:
-
ValueError–If the list of components is empty.
-
ValueError–If the number of weights matches the number of components.
-
ValueError–If any of the provided weights are negative.
Attributes:
-
num_components(int) –int: The number of components associated with this Domain.
num_components
property
num_components: int
int: The number of components associated with this Domain.
Domain Component
DomainComponent
A domain component is an alias for a set of 'seed words' describing a specific body of knowledge.
Parameters:
-
name(str) –The name that describes the content of the domain component.
-
seed_words(List[str]) –The list of seed words that describe the domain component.
-
description(Optional[str]) –An optional description of the domain component.
Raises:
-
ValueError–If no seed words are provided.
Seed Words
seed_words
Functions:
-
get_seed_words–Get the aliased seed word vocabulary for the correspodning seed word alias.
get_seed_words
Get the aliased seed word vocabulary for the correspodning seed word alias.
Parameters:
-
seed_word_alias(str) –The seed word alias to get seed word vocabulary for.
Returns:
-
List(str) –The list of seed words associated with the seed_word_alias.
Raises:
-
ValueError–If the seed word alias has no known seed word vocabularies.
Source code in aif_gen/task/seed_words/__init__.py
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 | |