PsychiatryNLPKit.analysis.sentence_length
- PsychiatryNLPKit.analysis.sentence_length(pos_tags, sections=None)[source]
Average sentence length (in tokens) per section.
- Notes:
Theoretical basis - Sentence length is associated with negative thought disorder features of TLC poverty of content and poverty of speech (Bilgrami et al., 2022).
- Args:
- pos_tags: Dict mapping section names to lists of POS-tagged sentences.
Each sentence is a list of
(word, lemma, tag)tuples.- sections: Sections to process.
Noneprocesses all sections in pos_tags.
- Returns:
Dict mapping section names to a dict with key
"sentence_length". Empty sections receivefloat("nan").- 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