-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Gold Standard Videos For Checking Reliability (#3)
* Edit and improve the text. * Add a label_state_admin column in the database for admin researchers. * Add score columns in the database. * Separate researcher labels and citizen labels for comparing the reliability. * Edit the video examples on the index page. * Fix a bug related to changing the video to the bad data state. * Add gold standards to video batches requested by citizens (not researchers). * Add and compute a score based on gold standards. * Add a new command to view the history of the migration in the db.sh file. * Add GET methods for getting pos and neg labels by researchers. * Display user score on the account dialog. * Add https support. * Use different Google Analytics Tracker Ids for production and staging. * Refactor code and move common functions to the Util.js file. * Split the index and label page to avoid deleting video tags (iPhone safari only allows 16 video tags at once). * Improve the shell script for adding videos on the background. * Improve the logic of video autoplay testing. * Remove the layout of three videos in a row.
- Loading branch information
Showing
17 changed files
with
769 additions
and
388 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
sudo screen -X quit | ||
sudo screen -x "add_videos" | ||
sudo rm screenlog.0 | ||
|
||
# For python in conda env | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,4 +13,7 @@ then | |
elif [ "$1" = "downgrade" ] | ||
then | ||
flask db downgrade | ||
elif [ "$1" = "history" ] | ||
then | ||
flask db history | ||
fi |
38 changes: 38 additions & 0 deletions
38
back-end/www/migrations/versions/066148ade5a6_add_a_new_label_state_column_for_admin_.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
"""add a new label state column for admin reseacher | ||
Revision ID: 066148ade5a6 | ||
Revises: 2731d42ed66e | ||
Create Date: 2019-02-13 13:46:11.867397 | ||
""" | ||
from alembic import op | ||
import sqlalchemy as sa | ||
|
||
|
||
# revision identifiers, used by Alembic. | ||
revision = '066148ade5a6' | ||
down_revision = '2731d42ed66e' | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade(): | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.drop_index(op.f('ix_video_label_state'), table_name='video') | ||
op.alter_column('video', 'label_state', existing_nullable=False, new_column_name='label_state_admin', existing_type=sa.Integer()) | ||
op.add_column('video', sa.Column('label_state', sa.Integer(), nullable=False)) | ||
op.create_index(op.f('ix_video_label_state'), 'video', ['label_state'], unique=False) | ||
op.create_index(op.f('ix_video_label_state_admin'), 'video', ['label_state_admin'], unique=False) | ||
label_state_column = sa.sql.table('video', sa.sql.column('label_state')) | ||
op.execute(label_state_column.update().values(**{'label_state': -1})) | ||
# ### end Alembic commands ### | ||
|
||
|
||
def downgrade(): | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.drop_index(op.f('ix_video_label_state_admin'), table_name='video') | ||
op.drop_index(op.f('ix_video_label_state'), table_name='video') | ||
op.drop_column('video', 'label_state') | ||
op.alter_column('video', 'label_state_admin', existing_nullable=False, new_column_name='label_state', existing_type=sa.Integer()) | ||
op.create_index(op.f('ix_video_label_state'), 'video', ['label_state'], unique=False) | ||
# ### end Alembic commands ### |
40 changes: 40 additions & 0 deletions
40
back-end/www/migrations/versions/3df480339533_add_score_of_user_labeling.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
"""add score of user labeling | ||
Revision ID: 3df480339533 | ||
Revises: 066148ade5a6 | ||
Create Date: 2019-02-15 12:01:09.656353 | ||
""" | ||
from alembic import op | ||
import sqlalchemy as sa | ||
|
||
|
||
# revision identifiers, used by Alembic. | ||
revision = '3df480339533' | ||
down_revision = '066148ade5a6' | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade(): | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.add_column('batch', sa.Column('num_gold_standard', sa.Integer(), nullable=False)) | ||
op.add_column('batch', sa.Column('num_unlabeled', sa.Integer(), nullable=False)) | ||
op.add_column('batch', sa.Column('score', sa.Integer(), nullable=True)) | ||
op.add_column('user', sa.Column('score', sa.Integer(), nullable=False)) | ||
score_column = sa.sql.table('user', sa.sql.column('score')) | ||
op.execute(score_column.update().values(**{'score': 0})) | ||
num_unlabeled_column = sa.sql.table('batch', sa.sql.column('num_unlabeled')) | ||
op.execute(num_unlabeled_column.update().values(**{'num_unlabeled': 16})) | ||
num_gold_standard_column = sa.sql.table('batch', sa.sql.column('num_gold_standard')) | ||
op.execute(num_gold_standard_column.update().values(**{'num_gold_standard': 0})) | ||
# ### end Alembic commands ### | ||
|
||
|
||
def downgrade(): | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.drop_column('user', 'score') | ||
op.drop_column('batch', 'score') | ||
op.drop_column('batch', 'num_unlabeled') | ||
op.drop_column('batch', 'num_gold_standard') | ||
# ### end Alembic commands ### |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.