Common¶
Exceptions¶
-
class
forte.common.exception.
PackIndexError
[source]¶ Raise this error when there is a problem accessing the indexes pack data.
-
class
forte.common.exception.
IncompleteEntryError
[source]¶ Raise this error when the entry is not complete.
-
class
forte.common.exception.
EntryNotFoundError
[source]¶ Raise this error when the entry is not found in the data pack.
-
class
forte.common.exception.
ProcessorConfigError
[source]¶ Raise this error when the there is a problem with the processor configuration.
-
class
forte.common.exception.
PackDataException
[source]¶ Raise this error when the data in pack is wrong.
-
class
forte.common.exception.
ProcessFlowException
[source]¶ Raise this when errors happen in flow control
-
class
forte.common.exception.
ProcessExecutionException
[source]¶ Raise this when process execution fail
-
class
forte.common.exception.
ResourceError
[source]¶ Raise this error when there are problems accessing Resources of the processor.
-
class
forte.common.exception.
ExpectedRecordNotFound
[source]¶ Raise this error when expected type for input is not in input record
Configuration¶
-
forte.common.configuration.
Config
¶ alias of
asyml_utilities.hyperparams.HParams
Configurable¶
-
class
forte.common.configurable.
Configurable
[source]¶ Classes that implement the Configurable interface enables the classes to easily manage configurations. The extended classes should implement default_configs to provide additional default configurations. A make_configs functions is provided to create the configurations. There are the following behaviors:
default_configs: the default configs provide the configurations structure accepted by this class. This behavior is the same as
texar.torch.HParams
. If the current class extends another Configurable class, thedefault_configs
of the parent class will be inherited in an recursive way. If the same configuration key is defined for a parent and child class, the one from the child class will prevail.make_configs: this function accepts user configurations and create the configuration by merging the user config and the default configs. Check the docstring of make_configs for its behaviors.
-
classmethod
make_configs
(configs)[source]¶ Create the configuration by merging the provided config with the default_configs.
The following config conventions are expected:
The top level key can be a special @config_path.
@config_path should be point to a file system path, which will be a YAML file containing configurations.
Other key values in the configs will be considered as parameters.
Resources¶
-
class
forte.common.resources.
Resources
(**kwargs)[source]¶ The
Resources
object is a global registry used in the pipeline. Objects defined asResources
will be passed on to the processors in the pipeline for initialization.-
save
(keys=None, output_dir=None)[source]¶ Save the resources specified by
keys
in binary format.
-