diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000..6c76527 Binary files /dev/null and b/.DS_Store differ diff --git a/app.py b/app.py index 0445c00..689d0bd 100644 --- a/app.py +++ b/app.py @@ -54,7 +54,7 @@ def webpage(): # redirect with url query param so that user can navigate back later next_rec = service.get_next_unlabelled() if next_rec: - return redirect("/?url=%s" % (urllib.quote(next_rec['url']))) + return redirect("/?url=%s" % (urllib.parse.quote(next_rec['url']))) else: featured_content = "No Unlabelled Record Found." else: @@ -84,7 +84,7 @@ def update(): next_rec = service.get_next_unlabelled() target = "/" if next_rec: - target += "?url=%s" % (urllib.quote(next_rec['url'])) + target += "?url=%s" % (urllib.parse.quote(next_rec['url'])) return redirect(location=target) else: return abort(400, "Failed... No records updated") @@ -104,7 +104,7 @@ def get_next(url=None): next_rec = service.get_record(url) url = next_rec['url'] template_name = '%s.html' % service.settings['type'] - data_url = url if url.startswith('http') else "/proxy?url=%s" % urllib.quote(next_rec['url']) + data_url = url if url.startswith('http') else "/proxy?url=%s" % urllib.parse.quote(next_rec['url']) data = { 'data_url' : data_url, 'url': url, @@ -215,4 +215,5 @@ def __del__(self): host = '0.0.0.0' service = DbService(args['work_dir'], args['input']) print("Starting on %s %s/" % (host, args['port'])) + app.debug = True app.run(host=host, port=args['port']) diff --git a/rawdata/test.txt b/rawdata/test.txt new file mode 100644 index 0000000..339e02d --- /dev/null +++ b/rawdata/test.txt @@ -0,0 +1 @@ +test for labelling \ No newline at end of file diff --git a/templates/text-labeling.html b/templates/text-labeling.html new file mode 100644 index 0000000..90798ce --- /dev/null +++ b/templates/text-labeling.html @@ -0,0 +1,45 @@ + diff --git a/workdir/.DS_Store b/workdir/.DS_Store new file mode 100644 index 0000000..e077950 Binary files /dev/null and b/workdir/.DS_Store differ diff --git a/workdir/db.sqlite b/workdir/db.sqlite new file mode 100644 index 0000000..77fc725 Binary files /dev/null and b/workdir/db.sqlite differ diff --git a/workdir/input.txt b/workdir/input.txt new file mode 100644 index 0000000..0b3aeba --- /dev/null +++ b/workdir/input.txt @@ -0,0 +1 @@ +/Users/billyzhaoyh/Desktop/AIforGood/supervising-ui/rawdata/test.txt \ No newline at end of file diff --git a/workdir/settings.json b/workdir/settings.json index 33b4bb4..0a0365d 100644 --- a/workdir/settings.json +++ b/workdir/settings.json @@ -1,11 +1,9 @@ { - "type": "image-labeling", + "type": "text-labeling", "task": { "labels":[ "class1", - "class2", - "class3", - "class4" + "class2" ] } }