Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add django command for extracting annotations #387

Merged
merged 47 commits into from
Oct 2, 2023
Merged

Add django command for extracting annotations #387

merged 47 commits into from
Oct 2, 2023

Commits on May 5, 2023

  1. Test that removing or rejecting an annotator from a project should cl…

    …ear their "pending" annotations
    ianroberts committed May 5, 2023
    Configuration menu
    Copy the full SHA
    8aaf1c4 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    43bca74 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    aa949ee View commit details
    Browse the repository at this point in the history
  4. Merge pull request #362 from GateNLP/annotator-removal-bug

    Clear pending annotations when rejecting a user from a project
    twinkarma authored May 5, 2023
    Configuration menu
    Copy the full SHA
    3409e27 View commit details
    Browse the repository at this point in the history

Commits on May 11, 2023

  1. correct DOI

    davidwilby committed May 11, 2023
    Configuration menu
    Copy the full SHA
    97c387f View commit details
    Browse the repository at this point in the history
  2. manage version in readme citation section as well

    davidwilby committed May 11, 2023
    Configuration menu
    Copy the full SHA
    1ab0cf2 View commit details
    Browse the repository at this point in the history
  3. use safer regex pattern

    davidwilby committed May 11, 2023
    Configuration menu
    Copy the full SHA
    664f8da View commit details
    Browse the repository at this point in the history
  4. Merge pull request #364 from GateNLP/correct_doi

    Correct DOI
    davidwilby authored May 11, 2023
    Configuration menu
    Copy the full SHA
    a444750 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    0d2e116 View commit details
    Browse the repository at this point in the history

Commits on May 12, 2023

  1. Added fadein transition

    twinkarma committed May 12, 2023
    Configuration menu
    Copy the full SHA
    59d3617 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    0db010c View commit details
    Browse the repository at this point in the history
  3. Stop throwing error on initialise rpc call, added tests to check that…

    … page loads on bad status and blank response
    twinkarma committed May 12, 2023
    Configuration menu
    Copy the full SHA
    5ac4304 View commit details
    Browse the repository at this point in the history

Commits on May 16, 2023

  1. Merge pull request #367 from GateNLP/annotation-view-transition

    Add transition effect when document changes
    twinkarma authored May 16, 2023
    Configuration menu
    Copy the full SHA
    9502dcf View commit details
    Browse the repository at this point in the history
  2. Acquire a row lock on the user before checking for an annotation task…

    …, since otherwise concurrent calls can cause a race condition and assign two different documents to the same user at the same time, causing errors later.
    
    Fixes #374
    ianroberts committed May 16, 2023
    Configuration menu
    Copy the full SHA
    89d0cd5 View commit details
    Browse the repository at this point in the history
  3. Initial attempt at implementing #164 (conditional annotation)

    Added an "if" option to all annotation widgets, whose value is an expression that has access to the document data _and_ the current state of annotationOutput.  Widgets are only rendered if their if expression evaluates to a truthy value.  The conditionals are re-evaluated every time the annotation data changes, so widgets can appear or disappear depending on the current state.
    ianroberts committed May 16, 2023
    Configuration menu
    Copy the full SHA
    1c109f3 View commit details
    Browse the repository at this point in the history
  4. Only validate components that are visible (i.e. exclude those with an…

    … "if" expression that is currently falsy)
    ianroberts committed May 16, 2023
    Configuration menu
    Copy the full SHA
    a0d3133 View commit details
    Browse the repository at this point in the history
  5. Filter annotationOutput to include only visible widgets (those withou…

    …t an "if", plus those with an "if" that tests true).
    ianroberts committed May 16, 2023
    Configuration menu
    Copy the full SHA
    10df61d View commit details
    Browse the repository at this point in the history
  6. Explicitly install esbuild so it properly handles the different platf…

    …orm-specific optional dependencies (otherwise tests can only run on x64 linux, not on my ARM Mac)
    ianroberts committed May 16, 2023
    Configuration menu
    Copy the full SHA
    7416d37 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    112e0f4 View commit details
    Browse the repository at this point in the history
  8. New approach - rather than allowing functions by default and then try…

    …ing to play whack-a-mole with the ones we want to forbid as "dangerous", instead forbid _all_ function calls by default and add special syntax for the cases that we do want to allow.
    
    Allowing things like Object.assign is a big hole as it allows "if" expressions to pollute the global Array.prototype, etc., allowing arbitrary method calls lets the expression call mutating methods like someArray.push(), ...  Determining which functions are "safe" and which aren't is asking for trouble.  Given the point of these expressions is to determine whether or not to display other widgets, they shouldn't really need to use functions much at all.  The main classes of expressions we need to support are:
    
    - simple single-value binary operator comparisons - annotation.something === 'value', annotation.confidence < 4, etc.
    - universal and existential quantifiers over arrays of checkbox values
      - any(cb in annotation.someCheckbox, cb === 'other')
      - all(cb in annotation.someCheckbox, cb > 3)
    - or over values from the document
      - any(v in document.validChoices, annotation.choice === v)
    
    In addition regular expression matching of some kind is useful for conditions over free-text strings, and in JS this normally requires a function call (/regex/.test(str)) - we borrow syntax from Perl to convert this into a binary operation instead of a call (str =~ /regex/).
    
    With this new syntax in place we can forbid _all_ other function and method calls.  This, along with also forbidding access to the __ob__ property (that Vue adds to all observable objects, and that has a chain of properties leading to the global "window"), should give the expressions sufficient power to be useful but not permit them to modify the document/annotation or read anything outside of the context data itself.
    ianroberts committed May 16, 2023
    Configuration menu
    Copy the full SHA
    a0fbf2a View commit details
    Browse the repository at this point in the history
  9. A couple of enhancements that occurred to me as I was writing documen…

    …tation
    
    - "thing in X", "all(item in X, pred)" and "any(item in X, pred)" are now safe when given a null or undefined X, treating it the same as an empty array rather than throwing an error ("anything in X" is always false, "all(i in X, p)" is true, "any(i in X, p)" is false)
    - "any" and "all" can now range over object properties as well as array elements
      - "any(p in someObject, p.key == 'example' || p.value > 4)" will evaluate the predicate for each key/value pair in Object.entries(someObject), each time setting p to an object with key & value properties
    ianroberts committed May 16, 2023
    Configuration menu
    Copy the full SHA
    3af5c5b View commit details
    Browse the repository at this point in the history
  10. First cut of documentation for conditional widgets, more examples needed

    Note I had to add the jse-eval dependencies to docs/package.json explicitly, as the docs toolchain sees frontend/src but not transitive dependencies of the frontend module
    ianroberts committed May 16, 2023
    Configuration menu
    Copy the full SHA
    ae9079e View commit details
    Browse the repository at this point in the history
  11. Allow AnnotationRendererPreview in the docs to have a list of documen…

    …ts rather than just a single document, and cycle through the list each time the preview form is submitted or rejected
    ianroberts committed May 16, 2023
    Configuration menu
    Copy the full SHA
    c2402f8 View commit details
    Browse the repository at this point in the history
  12. Add option to have AnnotationRenderer display below the form any erro…

    …rs that occur when parsing or evaluating the "if" expressions. This debug facility is only turned on for the preview mode on the project configuration page, not for anywhere where the form is presented to annotators
    ianroberts committed May 16, 2023
    Configuration menu
    Copy the full SHA
    b937fba View commit details
    Browse the repository at this point in the history
  13. Added an example of a conditional widget that uses document as well a…

    …s annotation data, and added discussion of error handling and how to deal with unset annotation values
    ianroberts committed May 16, 2023
    Configuration menu
    Copy the full SHA
    4a4b113 View commit details
    Browse the repository at this point in the history

Commits on May 17, 2023

  1. Merge pull request #365 from GateNLP/version_args

    enable version.py update to take version number as argument
    davidwilby authored May 17, 2023
    Configuration menu
    Copy the full SHA
    9b95730 View commit details
    Browse the repository at this point in the history
  2. correct error in navbar property setting

    davidwilby committed May 17, 2023
    Configuration menu
    Copy the full SHA
    4679cc3 View commit details
    Browse the repository at this point in the history

Commits on May 22, 2023

  1. Merge pull request #375 from GateNLP/issue-374

    User-level DB lock in get_annotator_task to avoid race condition
    twinkarma authored May 22, 2023
    Configuration menu
    Copy the full SHA
    c78be97 View commit details
    Browse the repository at this point in the history
  2. Merge pull request #350 from GateNLP/conditional-widgets

    Implement conditional widgets
    twinkarma authored May 22, 2023
    Configuration menu
    Copy the full SHA
    1e5d360 View commit details
    Browse the repository at this point in the history

Commits on May 25, 2023

  1. Merge pull request #368 from GateNLP/fronend-error-page

    Better frontend error page when backend is down
    twinkarma authored May 25, 2023
    Configuration menu
    Copy the full SHA
    5ee58ce View commit details
    Browse the repository at this point in the history
  2. Merge pull request #376 from GateNLP/navbar_warning

    correct error in navbar property setting
    twinkarma authored May 25, 2023
    Configuration menu
    Copy the full SHA
    7cf3717 View commit details
    Browse the repository at this point in the history

Commits on Jul 28, 2023

  1. Configuration menu
    Copy the full SHA
    d450543 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    672a84d View commit details
    Browse the repository at this point in the history

Commits on Jul 30, 2023

  1. Configuration menu
    Copy the full SHA
    a219a83 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    6b1e6ea View commit details
    Browse the repository at this point in the history
  3. Merge pull request #382 from GateNLP/compose-backups

    Upgrade postgres-backup-local to version 14
    ianroberts authored Jul 30, 2023
    Configuration menu
    Copy the full SHA
    c9c9683 View commit details
    Browse the repository at this point in the history
  4. If get-teamware.sh is run in an existing installation directory that …

    …already has a docker-compose.yml and an .env file then it will detect the existing settings and offer to perform an upgrade rather than a fresh installation.
    ianroberts committed Jul 30, 2023
    Configuration menu
    Copy the full SHA
    b1cbc4f View commit details
    Browse the repository at this point in the history
  5. We need generate-docker-env *not* to load the existing .env itself wh…

    …en it is run as part of a get-teamware upgrade, since that would overwrite the variables we have just been carefully gathering from the user
    ianroberts committed Jul 30, 2023
    Configuration menu
    Copy the full SHA
    74c44c6 View commit details
    Browse the repository at this point in the history

Commits on Aug 4, 2023

  1. Better fingerprint for an existing install

    The combination of .env and docker-compose.yml could be any compose-based application, if we look for the teamware-specific shell scripts as well then we can be more confident that this is genuinely a previous installation of Teamware that we are upgrading.
    ianroberts committed Aug 4, 2023
    Configuration menu
    Copy the full SHA
    e06b246 View commit details
    Browse the repository at this point in the history
  2. Merge pull request #383 from GateNLP/upgrade-script

    Support upgrades as well as fresh installs for get-teamware.sh script
    ianroberts authored Aug 4, 2023
    Configuration menu
    Copy the full SHA
    44098c8 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    8cad199 View commit details
    Browse the repository at this point in the history
  4. In test_annotations_per_doc_not_enforced_for_training_or_test, instea…

    …d of adding one annotator and having them do all the training, test and annotation docs, then adding the next annotator, etc. we now add all the annotators, then have them all do the training, then all do the test, then all do the annotations documents.
    
    This is because it is possible for just five of the six annotators to between them triple-annotate the entire corpus (each annotator is allowed up to 12 documents, and 60 annotations in total would fill the corpus), causing an error when the test attempts to add a sixth annotator to the already-completed project.  Adding all the annotators up front before anyone starts working is a more realistic test.
    ianroberts committed Aug 4, 2023
    Configuration menu
    Copy the full SHA
    636b1ec View commit details
    Browse the repository at this point in the history
  5. Added debug logging that builds a table showing exactly which annotat…

    …or was given which documents during the TestAnnotationTaskManagerTrainTestMode test cases
    ianroberts committed Aug 4, 2023
    Configuration menu
    Copy the full SHA
    262acbd View commit details
    Browse the repository at this point in the history
  6. Attempt to spread documents more evenly across annotators

    Rather than picking the next document for each annotator completely at random, we now prefer documents that have fewer existing annotations.  This is achieved by first sorting the list of documents by the number of COMPLETED+PENDING annotations and then randomizing only within each group, i.e. we first try (in random order) those documents with no existing annotations, then if none of those are suitable we try (again in random order) those documents with one annotation, then two, etc. until we either find a valid document to assign or run out of documents to try.  The effect of this should be that at any given time the full set of documents should be "evenly" annotated, or as close as possible if the number of completed annotation does not divide evenly into num_docs*annotations_per_doc
    
    Fixes #372
    ianroberts committed Aug 4, 2023
    Configuration menu
    Copy the full SHA
    04118ad View commit details
    Browse the repository at this point in the history
  7. Merge pull request #384 from GateNLP/spread-docs-evenly

    Attempt to spread documents more evenly across annotators
    ianroberts authored Aug 4, 2023
    Configuration menu
    Copy the full SHA
    a9c28d8 View commit details
    Browse the repository at this point in the history

Commits on Oct 2, 2023

  1. Configuration menu
    Copy the full SHA
    baa6882 View commit details
    Browse the repository at this point in the history
  2. Merge pull request #386 from GateNLP/manual-data-download

    Add django command for extracting annotations
    twinkarma authored Oct 2, 2023
    Configuration menu
    Copy the full SHA
    9692df0 View commit details
    Browse the repository at this point in the history