infineac.process_event.filter_events#
- infineac.process_event.filter_events(events: list[dict], year: int = 2019, keywords: list[str] | dict[str, int] = [], modifier_words: list[str] = ['disregarding', 'except', 'excluding', 'ignoring', 'leaving out', 'not including', 'omitting']) list[dict][source]#
Filters events based on a given year and keywords.
- Parameters:
events (list[dict]) – Lists of dicts containing the events.
year (int, default: constants.BASE_YEAR) – All events before the given year are filtered out.
keywords (list[str] | dict[str, int], default: []) – Dictionary or list of keywords. If keywords is a dictionary, the key is the keyword and the value is the minimum number of occurrences of the keyword in the text.
modifier_words (list[str], default: MODIFIER_WORDS) – List of modifier_words, which must not precede the keyword
- Returns:
Filtered events.
- Return type:
list[dict]