Harmonising Unstructured Text Data with NLP in Psychology (Harmony project)

· Thomas Wood
Harmonising Unstructured Text Data with NLP in Psychology  (Harmony project)

We have been developing a tool using Natural Language Processing which is designed to help researchers in the social sciences to harmonise datasets from different contexts. This is part of a wider project called Harmony which is part of an entry we are making to the Wellcome Mental Health Data Prize, together with the Centre for Longitudinal Studies at UCL, Ulster University and Universidade Federal de Santa Maria in Brazil.

The Research Question

The Harmony project is focused on a research question:

How does social connection impact anxiety and depression in young people in different countries?

We have focused on two very different contexts: UK and Brazil. We have explored numerical measures of social connectedness which can be measured in surveys and questionnaires.

Young Expert Involvement

The Harmony researchers ran a set of sessions with young people in both countries in order to gather some qualitative data on individual experiences.

In Brazil, our psychologist interviewed 6 people between 13 and 18 who were in treatment for anxiety and depression, and asked them about their concept of social connection and its relation with anxiety and depression.

Fast Data Science - London

Need a business solution?

NLP, ML and data science leader since 2016 - get in touch for an NLP consulting session.

Some differences emerged from these initiatives. For example, British young people mentioned bullying as being a major factor, while Brazilian participants mentioned not feeling judged.

Comparing UK and Brazil data

Datasets are available for the UK and Brazil which we were able to work with:

These datasets contain variables and data points which may be presented in a different way. If we want to conduct a meta-analysis (compare the connection between social connection, anxiety and depression in both countries), we would need to first identify what variables are available in both datasets, what variables they have in common, and how we can compare the information in those variables.

For example, if one study has measured anxiety using the GAD-7 and another has used Beck’s Anxiety Inventory, there would typically be a manual harmonisation process of identifying questionnaire items which are equivalent to one another.

The solution

We had the idea of representing each questionnaire item as a vector on the surface of a multi-dimensional sphere. Items which are semantically similar would be close together and have a cosine similarity close to 1, whereas items which are completely different tend to have a similarity close to 0.

We have used the deep learning model GPT-2 to convert texts in different languages into their vector representations. We have wrapped this in a web front-end to make a web-based tool called Harmony. You can try it online at https://harmonydata.ac.uk/app.

Partnerships

We have also developed Harmony in partnership with DATAMIND and the Catalogue of Mental Health Measures, which are widely used resources in psychology research, and taken on board their feedback on how to improve the tool.

You can read about Harmony and how it works on the Harmony blog.

References

  1. Radford, Alec, et al. “Language models are unsupervised multitask learners.” OpenAI blog 1.8 (2019): 9.

  2. Salum, Giovanni Abrahão. “High Risk Cohort Study for Psychiatric Disorders in Childhood.”

  3. Smith, Kate, and Heather Joshi. “The millennium cohort study.” POPULATION TRENDS-LONDON- (2002): 30-34.

Unlock Your Future in NLP!

Dive into the world of Natural Language Processing! Explore cutting-edge NLP roles that match your skills and passions.

Explore NLP Jobs

Fast Data Science at Hamlyn Symposium on Medical Robotics on 27 June 2025
Ai in healthcareEvents

Fast Data Science at Hamlyn Symposium on Medical Robotics on 27 June 2025

Fast Data Science appeared at the Hamlyn Symposium event on “Healing Through Collaboration: Open-Source Software in Surgical, Biomedical and AI Technologies” Thomas Wood of Fast Data Science appeared in a panel at the Hamlyn Symposium workshop titled “Healing Through Collaboration: Open-Source Software in Surgical, Biomedical and AI Technologies”. This was at the Hamlyn Symposium on Medical Robotics on 27th June 2025 at the Royal Geographical Society in London.

Fast Data Science at The 4th Annual Conference on the Intersection of Corporate Law and Technology on 23 June 2025
Legal aiEvents

Fast Data Science at The 4th Annual Conference on the Intersection of Corporate Law and Technology on 23 June 2025

We presented the Insolvency Bot at the 4th Annual Conference on the Intersection of Corporate Law and Technology at Nottingham Trent University Dr Eugenio Vaccari of Royal Holloway University and Thomas Wood of Fast Data Science presented “A Generative AI-Based Legal Advice Tool for Small Businesses in Distress” at the 4th Annual Conference on the Intersection of Corporate Law and Technology at Nottingham Trent University

Generative AI consulting
Generative aiData science consulting

Generative AI consulting

What is generative AI consulting? We have been taking on data science engagements for a number of years. Our main focus has always been textual data, so we have an arsenal of traditional natural language processing techniques to tackle any problem a client could throw at us.

What we can do for you

Transform Unstructured Data into Actionable Insights

Contact us