neuralset.events.transforms.text.AddContextToWords

pydantic model neuralset.events.transforms.text.AddContextToWords[source][source]

Add a context field to the events dataframe, for each word event, by concatenating the sentence fields.

Warning

Unstable API — the context representation (per-word concatenated strings) will be replaced with compact indices in a future release.

Parameters:
  • sentence_only (bool) – only use current sentence as context

  • max_context_len (None or int) – if not None, caps the context len to a given number of words (counted through whitespaces)

  • split_field (str) – field on which to reset contexts. If empty, context is only reset for new timelines.

Fields:
field sentence_only: bool = True[source]
field max_context_len: int | None = None[source]
field split_field: str = 'split'[source]
requirements: tp.ClassVar[tuple[str, ...]] = ()[source]