LongiText: An annotations interface to for capturing pantheoretical concepts from clinical psychology
New iteration of the Annotations Interface tool. This repo builds upon the Moments of Change annotations interface. It generalises to different types of text datasets: clinical psychology sessions and social media threads (work in progress).
![Screenshot 2024-07-18 at 11 44 22](https://private-user-images.githubusercontent.com/57944311/349925385-f4a8e41b-6200-4c07-a525-d357d2e7983a.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkyMDUwMzMsIm5iZiI6MTczOTIwNDczMywicGF0aCI6Ii81Nzk0NDMxMS8zNDk5MjUzODUtZjRhOGU0MWItNjIwMC00YzA3LWE1MjUtZDM1N2QyZTc5ODNhLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTAlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjEwVDE2MjUzM1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWY3NjU5ZGJlMmU0MmI2ZDM5ZmM0NGExMGYwNWFlZDUxMzc3N2QyMzNiZTNiYTRhODU4YzhiMjBjMWQ2YzFlNmQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.pGtTHcPNlfQysFg6Vt-grW8U9LBoA0ks1jtJn4WeRQ0)
- User registration and login
- Supports standard and admin users
- Dataset upload and storage in SQL database
- Detailed annotations of dialog between patient and therapist
- Custom segmentation/pagination of speech turns
- Separate annotation forms for Patient/Therapist/Dyad
- Annotations apply at the segment level, but can target specific speech turns (e.g. Moments of Change)
![Screenshot 2024-07-18 at 11 49 48](https://private-user-images.githubusercontent.com/57944311/349927104-36753d68-706a-4aaf-a174-5c8ae11479b0.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkyMDUwMzMsIm5iZiI6MTczOTIwNDczMywicGF0aCI6Ii81Nzk0NDMxMS8zNDk5MjcxMDQtMzY3NTNkNjgtNzA2YS00YWFmLWExNzQtNWM4YWUxMTQ3OWIwLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTAlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjEwVDE2MjUzM1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTc5NWFmYzU0Y2RiNDA0Y2RiZjg2YzY1YTc0OTU0MTdlOGY4ODk4M2ZlNTM4ZDA0NzA3NDU0NmUzZDg3NmY4ZTAmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.R-Vn-N9xsSORJmp9r-jSmRKvMeNy_J24iNcGcR9D3pE)
![Screenshot 2024-07-18 at 11 23 51](https://private-user-images.githubusercontent.com/57944311/349927296-05ec5fe8-0071-48bb-ab07-d7e25fd207bc.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkyMDUwMzMsIm5iZiI6MTczOTIwNDczMywicGF0aCI6Ii81Nzk0NDMxMS8zNDk5MjcyOTYtMDVlYzVmZTgtMDA3MS00OGJiLWFiMDctZDdlMjVmZDIwN2JjLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTAlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjEwVDE2MjUzM1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTRiZTkyNGQ4ZDZhMTIwNGNmODMzNjQxN2Y3NzEyOWRhODk2Yjc4YWVjZTM0ZjVjY2E4ODUzN2YyODJmNWU2YTImWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.zlZFHO9Cxt29cDFHvpB1YxHuMgrSdYYy6z5MYHQ5gkc)
![Screenshot 2024-07-18 at 11 24 30](https://private-user-images.githubusercontent.com/57944311/349927940-b91af42a-47d6-4908-a579-1c82302070de.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkyMDUwMzMsIm5iZiI6MTczOTIwNDczMywicGF0aCI6Ii81Nzk0NDMxMS8zNDk5Mjc5NDAtYjkxYWY0MmEtNDdkNi00OTA4LWE1NzktMWM4MjMwMjA3MGRlLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTAlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjEwVDE2MjUzM1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWMwYzM1ODc3NGJiMTc1YTg2ZWZhYzk4ZjA5MzFhNTE2ZmZhODBlYjc2NmY1ODdjNmEyOGI5ZDAzN2RlYzE4ZmMmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.Dvzw8aecPSt476nGKW8z-gA7g7e9Sk0PRUtK17Raz5c)
The current working branch is the develop
branch.
- Clone the repo:
git clone --branch develop [email protected]:Maria-Liakata-NLP-Group/annotations-interface.git
cd annotations-interface
- Create a Python virtual environment:
python -m venv .env
, and activate itsource .env/bin/activate
- Install the requirements:
pip install -r requirements.txt
- Create a
.flaskenv
file in the repo root directory containing the following:
FLASK_APP=annotations_interface.py
SECRET_KEY="you-will-never-guess" # replace this with a randomized password
APP_ADMIN="['[email protected]']" # replace this with the admin's email address
- Run
flask db upgrade
to create the database and apply all the migrations. This will generate a SQLiteapp.db
file in the repo root directory. - Run
flask clear-db
- Run
flask create-annotation-schema
- To run the Flask in a development server, run
flask run
. You should then be able to access the app on http://127.0.0.1:5000 - To try LongiText on a toy example, try uploading
tests/data/psychotherapy_example_lorem.pickle
to the interface via the "Upload Psychotherapy Dataset" button
To see the SQL database schema, visit the WWW SQL Designer tool.
- If you have saved the schema in the browser, go to Save/Load > LOAD FROM BROWSER. Enter
long-nlp-annotations-interface
when prompted for the keyword. - If you are checking the schema for the first time, copy the contents of
sql-schema.xml
, go to Save/Load, paste the XML data under Input/Output and click onLOAD XML
.