neuralset.events.transforms.text.AddSentenceToWords¶
- class neuralset.events.transforms.text.AddSentenceToWords(*, infra: Backend | None = None, max_unmatched_ratio: float = 0.0, override_sentences: bool = False)[source][source]¶
Adds sentence-level information to word events based on Text rows.
This transform processes a DataFrame containing word-level (Word) and text-level (Text) events. For each sentence found in the Text rows, it:
Creates a new Sentence row for each sentence.
Assigns sentence and sentence_char annotations to Word rows to indicate which sentence each word belongs to, and which character the word starts at in the sentence.