PsychiatryNLPKit.analysis.determiner_ratio
- PsychiatryNLPKit.analysis.determiner_ratio(pos_tags, sections=None, lang='en', averaging_method='macro')[source]
Determiner-to-total-word ratio per section.
- Notes:
Theoretical basis - Determiner use is correlated with negative thought disorder (Bilgrami et al., 2022).
- 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 determiners / total words across the section.
- Returns:
Dict mapping section names to a dict with keys
"determiner_ratio"and"determiner_count". Empty sections receivefloat("nan")for both.- References:
Bilgrami, Z. R., Sarac, C., Srivastava, A., Herrera, S. N., Azis, M., Haas, S. S., Shaik, R. B., Parvaz, M. A., Mittal, V. A., Cecchi, G., & Corcoran, C. M. (2022). Construct validity for computational linguistic metrics in individuals at clinical risk for psychosis: Associations with clinical ratings. Schizophrenia Research, 245, 90–96. https://doi.org/10.1016/j.schres.2022.01.019