infineac.process_text.extract_keyword_sentences_preceding_mod#
- infineac.process_text.extract_keyword_sentences_preceding_mod(text: str, keywords: list[str], nlp_model, 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()andextract_keyword_sentences_window()as well as all functions that use one of them. Is called byinfineac.process_event.excluded_sentences_by_mod_words()Parameter#
- textstr
The text to extract the sentences from.
- keywordslist[str], default: []
List of keywords to be searched for in the text and to extract the sentences.
- nlp_modelspacy.lang
NLP model.
- 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]