Skip to content

Maria-Liakata-NLP-Group/annotations-interface

Repository files navigation

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).

Software

Screenshot 2024-07-18 at 11 44 22

Current capabilities

  • 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 Screenshot 2024-07-18 at 11 23 51 Screenshot 2024-07-18 at 11 24 30

Getting started

The current working branch is the develop branch.

  1. Clone the repo: git clone --branch develop [email protected]:Maria-Liakata-NLP-Group/annotations-interface.git
  2. cd annotations-interface
  3. Create a Python virtual environment: python -m venv .env, and activate it source .env/bin/activate
  4. Install the requirements: pip install -r requirements.txt
  5. 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
  1. Run flask db upgrade to create the database and apply all the migrations. This will generate a SQLite app.db file in the repo root directory.
  2. Run flask clear-db
  3. Run flask create-annotation-schema
  4. 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
  5. To try LongiText on a toy example, try uploading tests/data/psychotherapy_example_lorem.pickle to the interface via the "Upload Psychotherapy Dataset" button

Relational database

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 on LOAD XML.

About

New iteration of the Annotations Interface tool

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published