Detection and Forecasting of Mental Health Phase Transitions from Text Data


  • Luka Kovač University of Ljubljana
  • Tine Kolenik Paracelsus Medical University


Detecting and forecasting mental health phase transitions is crucial for effective psychotherapeutic intervention and treatment. Complex dynamics and chaos theory have emerged as useful frameworks for understanding mental health processes. They provide insights into the presence of chaotic patterns, characterized by unpredictability and sensitive dependence on initial conditions, as well as phase transitions. Phase transition (PT) is a phenomenon in psychotherapy that represents a point of change in time series data and can psychologically manifest as e.g. a change in the level of depression [1]. This study aims to develop natural language processing (NLP) and machine learning methods to use diary entries for detection and forecast of PTs.

The used dataset, consisting of inpatient daily diary entries, was collected during the psychotherapeutic process of inpatient stays. Firstly, NLP methods will be used to preprocess the text data and from the diary texts extract features such as sentiment analysis (determining sentiment or emotion in text), topic modelling (uncovering hidden themes or topics in text), and different linguistic patterns (recurring structures and arrangements of words in text). Secondly, Pattern Transition Detection Algorithm (PTDA) [2] will be used together with machine learning methods to identify phase transitions in time-series data, consisting of features extracted with NLP methods. PTDA leverages complex dynamics principles to analyze various dynamic aspects of the data and detect significant changes or shifts in patterns. By assessing the dynamical characteristics, such as mean change and periodicity, PTDA provides insights into the occurrence of phase transitions. Lastly, a forecasting model will be developed to not just detect but also forecast at what time in the future a PT is likely to occur.

The performance of the detection and forecasting model will be evaluated using ground truth data of PTs Our hypothesis is that the results will demonstrate that it is possible to detect and forecast phase PTs in mental health using text data.

In conclusion, this study aims to demonstrate the potential of NLP methods in detecting and forecasting mental health PTs from diary entries. By combining complex dynamics with NLP methods, researchers and clinicians can gain a more comprehensive understanding of mental health processes and develop more effective interventions and treatments.


 [1] G. K. Schiepek et al., “Psychotherapy is chaotic—(not only) in a computational world,” Frontiers in Psychology, vol. 8, 2017. doi:10.3389/fpsyg.2017.00379

[2] K. Viol et al., “Detecting pattern transitions in Psychological Time Series – a validation study on the Pattern Transition Detection Algorithm (PTDA),” PLOS ONE, vol. 17, no. 3, 2022. doi:10.1371/journal.pone.0265335