infineac.process_text.extract_keyword_sentences_preceding_mod_nlp#

infineac.process_text.extract_keyword_sentences_preceding_mod_nlp(doc: str, keywords: list[str], modifier_words: list[str] = ['disregarding', 'except', 'excluding', 'ignoring', 'leaving out', 'not including', 'omitting']) str | list[str][source]#

Extracts sentences with specific keywords and a modifier_word preceding it. Used to obtain the sentences, that are filtered out by keyword_search_exclude_threshold() and extract_keyword_sentences_window() as well as all functions that use one of them. Is called by infineac.process_event.excluded_sentences_by_mod_words()

Parameter#

docstr

The spaCy document to be processed.

keywordslist[str], default: []

List of keywords to be searched for in the text and to extract the sentences.

modifier_wordslist[str], default: MODIFIER_WORDS

List of modifier_words which must precede the keyword.

returns:

The extracted sentences as a list of passages.

rtype:

str | list[str]