This function splits text from a data frame into individual sentences based on specified columns and handles abbreviations effectively.
nlp_split_sentences(
tif,
text_hierarchy = c("doc_id"),
abbreviations = textpress::abbreviations
)
A data frame containing text to be split into sentences.
A character vector specifying the columns to group by for sentence splitting, usually 'doc_id'.
A character vector of abbreviations to handle during sentence splitting, defaults to textpress::abbreviations.
A data.table with columns specified in 'by', 'sentence_id', and 'text'.
tif <- data.frame(doc_id = c('1'),
text = c("Hello world. This is an example. No, this is a party!"))
sentences <- nlp_split_paragraphs(tif)