PsychiatryNLPKit.analysis.filler_words_count

PsychiatryNLPKit.analysis.filler_words_count(pos_tags, sections=None, lang='en', averaging_method='macro')[source]

Count the number and ratio of disfluencies in the text data.

Notes:

Theoretical basis - Disfluencies in spoken language are related to symptom severity in psychosis, with self-repairs correlating with PANSS negative scores (Vail et al., 2018) and speech disfluency associated with PANSS P2 conceptual disorganization (Liebenthal et al., 2022). This function counts filled pauses (e.g., “uh”, “um”) as a specific type of disfluency marker.

Args:
pos_tags: Dict mapping section names to lists of POS-tagged sentences

(from TextData.pos_tags). Each sentence is a list of (word, lemma, tag) tuples; disfluency matching uses the lemma.

sections: Sections to process. None processes all sections in

pos_tags.

lang: The language of the text. Must be one of “en” or “fr”. averaging_method: "macro" averages per-sentence disfluency ratios;

"micro" computes total disfluencies / total words across the section.

Returns:

Dict mapping section names to a metric dict with keys "filler_words_count" and "filler_words_ratio".

References:

Vail, A. K., Liebson, E., Baker, J. T., & Morency, L.-P. (2018). Toward objective, multifaceted characterization of psychotic disorders: Lexical, structural, and disfluency markers of spoken language. In Proceedings of the 20th ACM International Conference on Multimodal Interaction (pp. 170–178). Association for Computing Machinery. https://doi.org/10.1145/3242969.3243020 Liebenthal, E., Ennis, M., Rahimi-Eichi, H., Lin, E., Chung, Y., & Baker, J. T. (2022). Linguistic and non-linguistic markers of disorganization in psychotic illness. Schizophrenia Research, 259, 111–120. https://doi.org/10.1016/j.schres.2022.12.003