PsychiatryNLPKit.analysis.modal_auxiliary_verb_ratio
- PsychiatryNLPKit.analysis.modal_auxiliary_verb_ratio(pos_tags, sections=None, lang='en', averaging_method='macro')[source]
Modal auxiliary verb-to-total-word ratio per section.
- Notes:
Theoretical basis - Modal auxiliary usage reflects epistemic certainty and hedging in speech. Altered modal use may indicate changes in reasoning patterns.
English modals are tagged
MD. French modals are taggedVERBby Stanza (AUXcovers the tense auxiliaries être/avoir), so French matches require the lemmas inFR_MODAL_LEMMAS; lexical uses such as the noun “le pouvoir” are excluded, but the non-modal use ofsavoiris not separable without verb-form features.- Args:
pos_tags: Dict mapping section names to lists of POS-tagged sentences. sections: Sections to process.
Noneprocesses all sections inpos_tags.
lang: Language code (“en” or “fr”). averaging_method:
"macro"averages per-sentence ratios;"micro"computes total modals / total words across the section.
- Returns:
Dict mapping section names to a dict with keys
"modal_auxiliary_verb_ratio"and"modal_auxiliary_verb_count". Empty sections receivefloat("nan")for both.