entity_config

lexnlp.extract.en.dict_entities.entity_config(entity_id: int, name: str, priority: int = 0, aliases: typing.List[typing.Union[str, typing.Tuple]] = (), name_is_alias: bool = True) → typing.Tuple[int, str, int, typing.List[typing.Tuple]]

Create entity configuration for a possible entity with its id, name and aliases to search. :param entity_id: Unique identifier of the entity. :param name: Human-readable name to displaying in UI. Searches are made not for name but for the possible aliases - each one having its assigned language. And name may or may not be added to the list of search aliases. :param priority: Optional int priority value for the entity. Can be used for sorting. Entities with higher prio should be selected first. :param aliases: List of aliases to search for. Each alias can be either string or (alias, language, is_abbreviation, alias_id) tuple. For string - a tuple with default values is created. entity_alias() function can be used to create the alias tuple ensuring its components type safety in IDE. :param name_is_alias: If True - then add entity name to the list of aliases with undefined language. :return: A tuple representing the entity in format (entity_id, name, [(alias, lang, is_abbrev, alias_id), …])