Usage
API for assembling biomedial lexica.
- class Configuration(**data: Any)[source]
A configuration for construction of a lexicon.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class Input(*, processor: Literal['pyobo', 'bioontologies', 'ssslm', 'gilda'], source: str, ancestors: None | str | list[str] = None, kwargs: dict[str, Any] | None = None)[source]
An input towards lexicon assembly.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- Processor
A processor available as a literal mapping input
alias of
Literal[‘pyobo’, ‘bioontologies’, ‘ssslm’, ‘gilda’]
- assemble_grounder(configuration: Configuration, mappings: list[semra.Mapping] | None = None, *, extra_terms: list[LiteralMapping] | None = None, include_biosynonyms: bool = True) ssslm.Grounder[source]
Assemble terms from multiple resources and load into a grounder.
- assemble_terms(configuration: Configuration, mappings: list[semra.Mapping] | None = None, *, extra_terms: list[LiteralMapping] | None = None, include_biosynonyms: bool = True, raw_path: Path | None = None, processed_path: Path | None = None, gilda_path: Path | None = None, summary_path: Path | None = None) list[LiteralMapping][source]
Assemble terms from multiple resources.
- get_literal_mappings(prefix: str, *, ancestors: None | str | Sequence[str] = None, processor: Literal['pyobo', 'bioontologies', 'ssslm', 'gilda'], **kwargs: Any) list[LiteralMapping][source]
Iterate over all terms from a given prefix.