dialogy.types.entity.amount_of_money package

Module contents

Module provides access to entity types that can be parsed to currencies and their value.

Import classes:
  • CurrencyEntity

class CurrencyEntity(body, dim=None, parsers=NOTHING, score=None, alternative_index=None, alternative_indices=None, latent=False, values=NOTHING, value=None, *, range, type='value', unit, entity_type='amount-of-money')[source]

Bases: dialogy.types.entity.base_entity.BaseEntity

Numerical Entity Type

Use this type for handling all entities that can be parsed to obtain: - numbers - date - time - datetime

Attributes:
  • dim dimension of the entity from duckling parser

  • type is the type of the entity which can have values in [“value”, “interval”]

entity_type: str
classmethod from_duckling(d, alternative_index, **kwargs)[source]
Return type

CurrencyEntity

get_value()[source]

Getter for CurrencyEntity.

We are yet to decide the pros and cons of the output. It seems retaining {“value”: float, “unit”: }

Parameters

reference (Any, optional) – [description], defaults to None

Returns

[description]

Return type

Any

unit: str