https://github.com/alan-turing-institute/annotatechange
A simple flask application to collect annotations for the Turing Change Point Dataset, a benchmark dataset for change point detection algorithms
Science Score: 10.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
○codemeta.json file
-
○.zenodo.json file
-
○DOI references
-
✓Academic publication links
Links to: arxiv.org -
○Academic email domains
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (16.1%) to scientific vocabulary
Keywords
Repository
A simple flask application to collect annotations for the Turing Change Point Dataset, a benchmark dataset for change point detection algorithms
Basic Info
- Host: GitHub
- Owner: alan-turing-institute
- License: mit
- Language: Python
- Default Branch: master
- Homepage: https://arxiv.org/abs/2003.06222
- Size: 1.17 MB
Statistics
- Stars: 20
- Watchers: 4
- Forks: 12
- Open Issues: 0
- Releases: 0
Topics
Metadata Files
README.md
AnnotateChange
Welcome to the repository of the "AnnotateChange" application. This application was created to collect annotations of time series data in order to construct the Turing Change Point Dataset (TCPD). The TCPD is a dataset of real-world time series used to evaluate change point detection algorithms. For the change point detection benchmark that was created using this dataset, see the Turing Change Point Detection Benchmark repository.
Any work that uses this repository should cite our paper: Van den Burg & Williams - An Evaluation of Change Point Detection Algorithms (2020). You can use the following BibTeX entry:
bib
@article{vandenburg2020evaluation,
title={An Evaluation of Change Point Detection Algorithms},
author={{Van den Burg}, G. J. J. and Williams, C. K. I.},
journal={arXiv preprint arXiv:2003.06222},
year={2020}
}
Here's a screenshot of what the application looks like during the annotation process:
Some of the features of AnnotateChange include:
Admin panel to add/remove datasets, add/remove annotation tasks, add/remove users, and inspect incoming annotations.
Basic user management: authentication, email confirmation, forgotten password, automatic log out after inactivity, etc. Users are only allowed to register using an email address from an approved domain.
Task assignment of time series to user is done on the fly, ensuring no user ever annotates the same dataset twice, and prioritising datasets that are close to a desired number of annotations.
Interactive graph of a time series that supports pan and zoom, support for multidimensional time series.
Mandatory "demo" to onboard the user to change point annotation.
Backup of annotations to the admin via email.
Time series datasets are verified upon upload acccording to a strict schema.
Getting Started
Below are instructions for setting up the application for local development and for running the application with Docker.
Basic
AnnotateChange can be launched quickly for local development as follows:
Clone the repo
$ git clone https://github.com/alan-turing-institute/AnnotateChange $ cd AnnotateChangeSet up a virtual environment and install dependencies (requires Python 3.7+)
$ sudo apt-get install -y python3-venv # assuming Ubuntu $ pip install wheel $ python3 -m venv ./venv $ source ./venv/bin/activate $ pip install -r requirements.txtCreate local development environment file
$ cp .env.example .env.development $ sed -i 's/DB_TYPE=mysql/DB_TYPE=sqlite3/g' .env.developmentWithDB_TYPE=sqlite3, we don't have to deal with MySQL locally.Initialize the database (this will be a local
app.dbfile).$ ./flask.sh db upgradeCreate the admin user account
$ ./flask.sh admin add --auto-confirm-emailThe--auto-confirm-emailflag automatically marks the email address of the admin user as confirmed. This is mostly useful in development environments when you don't have a mail address set up yet.Run the application
$ ./flask.sh runThis should tell you where its running, probablylocalhost:5000. You should be able to log in with the admin account you've just created.As admin, upload ALL demo datasets (included in demo_data) through: Admin Panel -> Add dataset. You should then be able to follow the introduction to the app (available from the landing page).
After completing the instruction, you then will be able to access the user interface ("Home") to annotate your own time series.
Docker
To use AnnotateChange locally using Docker, follow the steps below. For a full-fledged installation on a server, see the deployment instructions.
Install docker and docker-compose.
Clone this repository and switch to it:
$ git clone https://github.com/alan-turing-institute/AnnotateChange $ cd AnnotateChangeBuild the docker image:
$ docker build -t gjjvdburg/annotatechange .Create the directory for persistent MySQL database storage:
$ mkdir -p persist/{instance,mysql} $ sudo chown :1024 persist/instance $ chmod 775 persist/instance $ chmod g+s persist/instanceCopy the environment variables file:
$ cp .env.example .envSome environment variables can be adjusted if needed. For example, when moving to production, you'll need to change theFLASK_ENVvariable accordingly. Please also make sure to set a properSECRET_KEYandAC_MYSQL_PASSWORD(= MYSQL_PASSWORD). You'll also need to configure a mail account so the application can send out emails for registration etc. This is what the variables prefixed withMAIL_are for. TheADMIN_EMAILis likely your own email, it is used when the app encounters an error and to send backups of the annotation records. You can limit the email domains users can use with theUSER_EMAIL_DOMAINSvariable. See the config.py file for more info on the configuration options.Create a local docker network for communiation between the AnnotateChange app and the MySQL server:
$ docker network create webLaunch the services with docker-compose
$ docker-compose upYou may need to wait 2 minutes here before the database is initialized. If all goes well, you should be able to point your browser tolocalhost:7831and see the landing page of the application. Stop the service before continuing to the next step (by pressingCtrl+C).Once you have the app running, you'll want to create an admin account so you can upload datasets, manage tasks and users, and download annotation results. This can be done using the following command:
$ docker-compose run --entrypoint 'flask admin add --auto-confirm-email' annotatechangeAs admin, upload ALL demo datasets (included in demo_data) through: Admin Panel -> Add dataset. You should then be able to follow the introduction to the app (available from the landing page).
After completing the instruction, you then will be able to access the user interface ("Home") to annotate your own time series.
Notes
This codebase is provided "as is". If you find any problems, please raise an issue on GitHub.
The code is licensed under the MIT License.
This code was written by Gertjan van den Burg with helpful comments provided by Chris Williams.
Some implementation details
Below are some thoughts that may help make sense of the codebase.
AnnotateChange is a web application build on the Flask framework. See this excellent tutorial for an introduction to Flask. The flask.sh shell script loads the appropriate environment variables and runs the application.
The application handles user management and is centered around the idea of a "task" which links a particular user to a particular time series to annotate.
An admin role is available, and the admin user can manually assign and delete tasks as well as add/delete users, datasets, etc. The admin user is created using the cli (see the Getting Started documentation above).
All datasets must adhere to a specific dataset schema (see utils/dataset_schema.json). See the files in [demo_data] for examples, as well as those in TCPD.
Annotations are stored in the database using 0-based indexing. Tasks are assigned on the fly when a user requests a time series to annotate (see utils/tasks.py).
Users can only begin annotating when they have successfully passed the introduction.
Configuration of the app is done through environment variables, see the .env.example file for an example.
Docker is used for deployment (see the deployment documentation in docs), and Traefik is used for SSL, etc.
The time series graph is plotted using d3.js.
Owner
- Name: The Alan Turing Institute
- Login: alan-turing-institute
- Kind: organization
- Email: info@turing.ac.uk
- Website: https://turing.ac.uk
- Repositories: 477
- Profile: https://github.com/alan-turing-institute
The UK's national institute for data science and artificial intelligence.
GitHub Events
Total
- Issues event: 1
- Watch event: 1
Last Year
- Issues event: 1
- Watch event: 1
Issues and Pull Requests
Last synced: over 1 year ago
All Time
- Total issues: 0
- Total pull requests: 3
- Average time to close issues: N/A
- Average time to close pull requests: about 1 hour
- Total issue authors: 0
- Total pull request authors: 3
- Average comments per issue: 0
- Average comments per pull request: 0.67
- Merged pull requests: 3
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 0
- Pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Issue authors: 0
- Pull request authors: 0
- Average comments per issue: 0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- mhauru (1)
Pull Request Authors
- SunnyBingoMe (1)
- INASIC (1)
- GjjvdBurg (1)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 2
- Total downloads: unknown
-
Total dependent packages: 0
(may contain duplicates) -
Total dependent repositories: 0
(may contain duplicates) - Total versions: 30
proxy.golang.org: github.com/alan-turing-institute/AnnotateChange
- Documentation: https://pkg.go.dev/github.com/alan-turing-institute/AnnotateChange#section-documentation
- License: mit
-
Latest release: v0.4.5
published about 6 years ago
Rankings
proxy.golang.org: github.com/alan-turing-institute/annotatechange
- Documentation: https://pkg.go.dev/github.com/alan-turing-institute/annotatechange#section-documentation
- License: mit
-
Latest release: v0.4.5
published about 6 years ago
Rankings
Dependencies
- cryptography >=2.6
- email_validator >=1.0
- flask >=1.0
- flask-bootstrap >=3.3.0.1
- flask-login >=0.4.1
- flask-mail >=0.9.1
- flask-migrate >=2.4
- flask-sqlalchemy >=2.3
- flask-wtf >=0.14.2
- gunicorn >=19.9
- jsonschema >=3.0
- markdown >=3.1
- pyjwt >=1.7
- pymysql >=0.9.3