diff --git a/app/db.sqlite3 b/app/db.sqlite3 index 64d58851..c490718c 100644 Binary files a/app/db.sqlite3 and b/app/db.sqlite3 differ diff --git a/app/server/static/bundle/document_classification.js b/app/server/static/bundle/document_classification.js index 6add9b73..9320b0c8 100644 --- a/app/server/static/bundle/document_classification.js +++ b/app/server/static/bundle/document_classification.js @@ -185,7 +185,7 @@ eval("__webpack_require__.r(__webpack_exports__);\naxios.defaults.xsrfCookieName /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _http__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./http */ \"./static/js/http.js\");\n\n\nconst annotationMixin = {\n data() {\n return {\n pageNumber: 0,\n docs: [],\n annotations: [],\n labels: [],\n guideline: '',\n total: 0,\n remaining: 0,\n searchQuery: '',\n url: '',\n picked: 'all',\n };\n },\n\n methods: {\n async nextPage() {\n this.pageNumber += 1;\n if (this.pageNumber === this.docs.length) {\n if (this.next) {\n this.url = this.next;\n await this.search();\n this.pageNumber = 0;\n } else {\n this.pageNumber = this.docs.length - 1;\n }\n }\n },\n\n async prevPage() {\n this.pageNumber -= 1;\n if (this.pageNumber === -1) {\n if (this.prev) {\n this.url = this.prev;\n await this.search();\n this.pageNumber = this.docs.length - 1;\n } else {\n this.pageNumber = 0;\n }\n }\n },\n\n async search() {\n await _http__WEBPACK_IMPORTED_MODULE_0__[\"default\"].get(this.url).then((response) => {\n this.docs = response.data.results;\n this.next = response.data.next;\n this.prev = response.data.previous;\n });\n this.annotations = [];\n for (let i = 0; i < this.docs.length; i++) {\n const docId = this.docs[i].id;\n await _http__WEBPACK_IMPORTED_MODULE_0__[\"default\"].get(`docs/${docId}/annotations/`).then((response) => {\n this.annotations.push(response.data);\n });\n }\n },\n\n getState() {\n if (this.picked === 'all') {\n return '';\n }\n if (this.picked === 'active') {\n return 'true';\n }\n return 'false';\n },\n\n async submit() {\n const state = this.getState();\n this.url = `docs/?q=${this.searchQuery}&is_checked=${state}`;\n await this.search();\n this.pageNumber = 0;\n },\n\n removeLabel(annotation) {\n const docId = this.docs[this.pageNumber].id;\n _http__WEBPACK_IMPORTED_MODULE_0__[\"default\"].delete(`docs/${docId}/annotations/${annotation.id}`).then((response) => {\n const index = this.annotations[this.pageNumber].indexOf(annotation);\n this.annotations[this.pageNumber].splice(index, 1);\n });\n },\n },\n\n watch: {\n picked() {\n this.submit();\n },\n\n docs() {\n // fetch progress info.\n _http__WEBPACK_IMPORTED_MODULE_0__[\"default\"].get('progress').then((response) => {\n this.total = response.data.total;\n this.remaining = response.data.remaining;\n });\n },\n },\n\n created() {\n _http__WEBPACK_IMPORTED_MODULE_0__[\"default\"].get('labels').then((response) => {\n this.labels = response.data;\n });\n this.submit();\n },\n\n computed: {\n achievement() {\n const done = this.total - this.remaining;\n const percentage = Math.round(done / this.total * 100);\n return this.total > 0 ? percentage : 0;\n },\n\n id2label() {\n let id2label = {};\n for (let i = 0; i < this.labels.length; i++) {\n const label = this.labels[i];\n id2label[label.id] = label;\n }\n return id2label;\n },\n\n progressColor() {\n if (this.achievement < 30) {\n return 'is-danger';\n }\n if (this.achievement < 70) {\n return 'is-warning';\n }\n return 'is-primary';\n },\n },\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (annotationMixin);\n\n\n//# sourceURL=webpack:///./static/js/mixin.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _http__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./http */ \"./static/js/http.js\");\n\n\nconst annotationMixin = {\n data() {\n return {\n pageNumber: 0,\n docs: [],\n annotations: [],\n labels: [],\n guideline: '',\n total: 0,\n remaining: 0,\n searchQuery: '',\n url: '',\n picked: 'all',\n };\n },\n\n methods: {\n async nextPage() {\n this.pageNumber += 1;\n if (this.pageNumber === this.docs.length) {\n if (this.next) {\n this.url = this.next;\n await this.search();\n this.pageNumber = 0;\n } else {\n this.pageNumber = this.docs.length - 1;\n }\n }\n },\n\n async prevPage() {\n this.pageNumber -= 1;\n if (this.pageNumber === -1) {\n if (this.prev) {\n this.url = this.prev;\n await this.search();\n this.pageNumber = this.docs.length - 1;\n } else {\n this.pageNumber = 0;\n }\n }\n },\n\n async search() {\n await _http__WEBPACK_IMPORTED_MODULE_0__[\"default\"].get(this.url).then((response) => {\n this.docs = response.data.results;\n this.next = response.data.next;\n this.prev = response.data.previous;\n });\n this.annotations = [];\n for (let i = 0; i < this.docs.length; i++) {\n const docId = this.docs[i].id;\n await _http__WEBPACK_IMPORTED_MODULE_0__[\"default\"].get(`docs/${docId}/annotations/`).then((response) => {\n this.annotations.push(response.data);\n });\n }\n },\n\n getState() {\n if (this.picked === 'all') {\n return '';\n }\n if (this.picked === 'active') {\n return 'true';\n }\n return 'false';\n },\n\n async submit() {\n const state = this.getState();\n this.url = `docs/?q=${this.searchQuery}&is_checked=${state}`;\n await this.search();\n this.pageNumber = 0;\n },\n\n removeLabel(annotation) {\n const docId = this.docs[this.pageNumber].id;\n _http__WEBPACK_IMPORTED_MODULE_0__[\"default\"].delete(`docs/${docId}/annotations/${annotation.id}`).then((response) => {\n const index = this.annotations[this.pageNumber].indexOf(annotation);\n this.annotations[this.pageNumber].splice(index, 1);\n });\n },\n },\n\n watch: {\n picked() {\n this.submit();\n },\n\n annotations() {\n // fetch progress info.\n _http__WEBPACK_IMPORTED_MODULE_0__[\"default\"].get('progress').then((response) => {\n this.total = response.data.total;\n this.remaining = response.data.remaining;\n });\n },\n },\n\n created() {\n _http__WEBPACK_IMPORTED_MODULE_0__[\"default\"].get('labels').then((response) => {\n this.labels = response.data;\n });\n this.submit();\n },\n\n computed: {\n achievement() {\n const done = this.total - this.remaining;\n const percentage = Math.round(done / this.total * 100);\n return this.total > 0 ? percentage : 0;\n },\n\n id2label() {\n let id2label = {};\n for (let i = 0; i < this.labels.length; i++) {\n const label = this.labels[i];\n id2label[label.id] = label;\n }\n return id2label;\n },\n\n progressColor() {\n if (this.achievement < 30) {\n return 'is-danger';\n }\n if (this.achievement < 70) {\n return 'is-warning';\n }\n return 'is-primary';\n },\n },\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (annotationMixin);\n\n\n//# sourceURL=webpack:///./static/js/mixin.js?"); /***/ }) diff --git a/app/server/static/bundle/seq2seq.js b/app/server/static/bundle/seq2seq.js index 38cdc4f0..76962e37 100644 --- a/app/server/static/bundle/seq2seq.js +++ b/app/server/static/bundle/seq2seq.js @@ -173,7 +173,7 @@ eval("__webpack_require__.r(__webpack_exports__);\naxios.defaults.xsrfCookieName /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _http__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./http */ \"./static/js/http.js\");\n\n\nconst annotationMixin = {\n data() {\n return {\n pageNumber: 0,\n docs: [],\n annotations: [],\n labels: [],\n guideline: '',\n total: 0,\n remaining: 0,\n searchQuery: '',\n url: '',\n picked: 'all',\n };\n },\n\n methods: {\n async nextPage() {\n this.pageNumber += 1;\n if (this.pageNumber === this.docs.length) {\n if (this.next) {\n this.url = this.next;\n await this.search();\n this.pageNumber = 0;\n } else {\n this.pageNumber = this.docs.length - 1;\n }\n }\n },\n\n async prevPage() {\n this.pageNumber -= 1;\n if (this.pageNumber === -1) {\n if (this.prev) {\n this.url = this.prev;\n await this.search();\n this.pageNumber = this.docs.length - 1;\n } else {\n this.pageNumber = 0;\n }\n }\n },\n\n async search() {\n await _http__WEBPACK_IMPORTED_MODULE_0__[\"default\"].get(this.url).then((response) => {\n this.docs = response.data.results;\n this.next = response.data.next;\n this.prev = response.data.previous;\n });\n this.annotations = [];\n for (let i = 0; i < this.docs.length; i++) {\n const docId = this.docs[i].id;\n await _http__WEBPACK_IMPORTED_MODULE_0__[\"default\"].get(`docs/${docId}/annotations/`).then((response) => {\n this.annotations.push(response.data);\n });\n }\n },\n\n getState() {\n if (this.picked === 'all') {\n return '';\n }\n if (this.picked === 'active') {\n return 'true';\n }\n return 'false';\n },\n\n async submit() {\n const state = this.getState();\n this.url = `docs/?q=${this.searchQuery}&is_checked=${state}`;\n await this.search();\n this.pageNumber = 0;\n },\n\n removeLabel(annotation) {\n const docId = this.docs[this.pageNumber].id;\n _http__WEBPACK_IMPORTED_MODULE_0__[\"default\"].delete(`docs/${docId}/annotations/${annotation.id}`).then((response) => {\n const index = this.annotations[this.pageNumber].indexOf(annotation);\n this.annotations[this.pageNumber].splice(index, 1);\n });\n },\n },\n\n watch: {\n picked() {\n this.submit();\n },\n\n docs() {\n // fetch progress info.\n _http__WEBPACK_IMPORTED_MODULE_0__[\"default\"].get('progress').then((response) => {\n this.total = response.data.total;\n this.remaining = response.data.remaining;\n });\n },\n },\n\n created() {\n _http__WEBPACK_IMPORTED_MODULE_0__[\"default\"].get('labels').then((response) => {\n this.labels = response.data;\n });\n this.submit();\n },\n\n computed: {\n achievement() {\n const done = this.total - this.remaining;\n const percentage = Math.round(done / this.total * 100);\n return this.total > 0 ? percentage : 0;\n },\n\n id2label() {\n let id2label = {};\n for (let i = 0; i < this.labels.length; i++) {\n const label = this.labels[i];\n id2label[label.id] = label;\n }\n return id2label;\n },\n\n progressColor() {\n if (this.achievement < 30) {\n return 'is-danger';\n }\n if (this.achievement < 70) {\n return 'is-warning';\n }\n return 'is-primary';\n },\n },\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (annotationMixin);\n\n\n//# sourceURL=webpack:///./static/js/mixin.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _http__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./http */ \"./static/js/http.js\");\n\n\nconst annotationMixin = {\n data() {\n return {\n pageNumber: 0,\n docs: [],\n annotations: [],\n labels: [],\n guideline: '',\n total: 0,\n remaining: 0,\n searchQuery: '',\n url: '',\n picked: 'all',\n };\n },\n\n methods: {\n async nextPage() {\n this.pageNumber += 1;\n if (this.pageNumber === this.docs.length) {\n if (this.next) {\n this.url = this.next;\n await this.search();\n this.pageNumber = 0;\n } else {\n this.pageNumber = this.docs.length - 1;\n }\n }\n },\n\n async prevPage() {\n this.pageNumber -= 1;\n if (this.pageNumber === -1) {\n if (this.prev) {\n this.url = this.prev;\n await this.search();\n this.pageNumber = this.docs.length - 1;\n } else {\n this.pageNumber = 0;\n }\n }\n },\n\n async search() {\n await _http__WEBPACK_IMPORTED_MODULE_0__[\"default\"].get(this.url).then((response) => {\n this.docs = response.data.results;\n this.next = response.data.next;\n this.prev = response.data.previous;\n });\n this.annotations = [];\n for (let i = 0; i < this.docs.length; i++) {\n const docId = this.docs[i].id;\n await _http__WEBPACK_IMPORTED_MODULE_0__[\"default\"].get(`docs/${docId}/annotations/`).then((response) => {\n this.annotations.push(response.data);\n });\n }\n },\n\n getState() {\n if (this.picked === 'all') {\n return '';\n }\n if (this.picked === 'active') {\n return 'true';\n }\n return 'false';\n },\n\n async submit() {\n const state = this.getState();\n this.url = `docs/?q=${this.searchQuery}&is_checked=${state}`;\n await this.search();\n this.pageNumber = 0;\n },\n\n removeLabel(annotation) {\n const docId = this.docs[this.pageNumber].id;\n _http__WEBPACK_IMPORTED_MODULE_0__[\"default\"].delete(`docs/${docId}/annotations/${annotation.id}`).then((response) => {\n const index = this.annotations[this.pageNumber].indexOf(annotation);\n this.annotations[this.pageNumber].splice(index, 1);\n });\n },\n },\n\n watch: {\n picked() {\n this.submit();\n },\n\n annotations() {\n // fetch progress info.\n _http__WEBPACK_IMPORTED_MODULE_0__[\"default\"].get('progress').then((response) => {\n this.total = response.data.total;\n this.remaining = response.data.remaining;\n });\n },\n },\n\n created() {\n _http__WEBPACK_IMPORTED_MODULE_0__[\"default\"].get('labels').then((response) => {\n this.labels = response.data;\n });\n this.submit();\n },\n\n computed: {\n achievement() {\n const done = this.total - this.remaining;\n const percentage = Math.round(done / this.total * 100);\n return this.total > 0 ? percentage : 0;\n },\n\n id2label() {\n let id2label = {};\n for (let i = 0; i < this.labels.length; i++) {\n const label = this.labels[i];\n id2label[label.id] = label;\n }\n return id2label;\n },\n\n progressColor() {\n if (this.achievement < 30) {\n return 'is-danger';\n }\n if (this.achievement < 70) {\n return 'is-warning';\n }\n return 'is-primary';\n },\n },\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (annotationMixin);\n\n\n//# sourceURL=webpack:///./static/js/mixin.js?"); /***/ }), diff --git a/app/server/static/bundle/sequence_labeling.js b/app/server/static/bundle/sequence_labeling.js index 5d977842..fc234b93 100644 --- a/app/server/static/bundle/sequence_labeling.js +++ b/app/server/static/bundle/sequence_labeling.js @@ -173,7 +173,7 @@ eval("__webpack_require__.r(__webpack_exports__);\naxios.defaults.xsrfCookieName /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _http__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./http */ \"./static/js/http.js\");\n\n\nconst annotationMixin = {\n data() {\n return {\n pageNumber: 0,\n docs: [],\n annotations: [],\n labels: [],\n guideline: '',\n total: 0,\n remaining: 0,\n searchQuery: '',\n url: '',\n picked: 'all',\n };\n },\n\n methods: {\n async nextPage() {\n this.pageNumber += 1;\n if (this.pageNumber === this.docs.length) {\n if (this.next) {\n this.url = this.next;\n await this.search();\n this.pageNumber = 0;\n } else {\n this.pageNumber = this.docs.length - 1;\n }\n }\n },\n\n async prevPage() {\n this.pageNumber -= 1;\n if (this.pageNumber === -1) {\n if (this.prev) {\n this.url = this.prev;\n await this.search();\n this.pageNumber = this.docs.length - 1;\n } else {\n this.pageNumber = 0;\n }\n }\n },\n\n async search() {\n await _http__WEBPACK_IMPORTED_MODULE_0__[\"default\"].get(this.url).then((response) => {\n this.docs = response.data.results;\n this.next = response.data.next;\n this.prev = response.data.previous;\n });\n this.annotations = [];\n for (let i = 0; i < this.docs.length; i++) {\n const docId = this.docs[i].id;\n await _http__WEBPACK_IMPORTED_MODULE_0__[\"default\"].get(`docs/${docId}/annotations/`).then((response) => {\n this.annotations.push(response.data);\n });\n }\n },\n\n getState() {\n if (this.picked === 'all') {\n return '';\n }\n if (this.picked === 'active') {\n return 'true';\n }\n return 'false';\n },\n\n async submit() {\n const state = this.getState();\n this.url = `docs/?q=${this.searchQuery}&is_checked=${state}`;\n await this.search();\n this.pageNumber = 0;\n },\n\n removeLabel(annotation) {\n const docId = this.docs[this.pageNumber].id;\n _http__WEBPACK_IMPORTED_MODULE_0__[\"default\"].delete(`docs/${docId}/annotations/${annotation.id}`).then((response) => {\n const index = this.annotations[this.pageNumber].indexOf(annotation);\n this.annotations[this.pageNumber].splice(index, 1);\n });\n },\n },\n\n watch: {\n picked() {\n this.submit();\n },\n\n docs() {\n // fetch progress info.\n _http__WEBPACK_IMPORTED_MODULE_0__[\"default\"].get('progress').then((response) => {\n this.total = response.data.total;\n this.remaining = response.data.remaining;\n });\n },\n },\n\n created() {\n _http__WEBPACK_IMPORTED_MODULE_0__[\"default\"].get('labels').then((response) => {\n this.labels = response.data;\n });\n this.submit();\n },\n\n computed: {\n achievement() {\n const done = this.total - this.remaining;\n const percentage = Math.round(done / this.total * 100);\n return this.total > 0 ? percentage : 0;\n },\n\n id2label() {\n let id2label = {};\n for (let i = 0; i < this.labels.length; i++) {\n const label = this.labels[i];\n id2label[label.id] = label;\n }\n return id2label;\n },\n\n progressColor() {\n if (this.achievement < 30) {\n return 'is-danger';\n }\n if (this.achievement < 70) {\n return 'is-warning';\n }\n return 'is-primary';\n },\n },\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (annotationMixin);\n\n\n//# sourceURL=webpack:///./static/js/mixin.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _http__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./http */ \"./static/js/http.js\");\n\n\nconst annotationMixin = {\n data() {\n return {\n pageNumber: 0,\n docs: [],\n annotations: [],\n labels: [],\n guideline: '',\n total: 0,\n remaining: 0,\n searchQuery: '',\n url: '',\n picked: 'all',\n };\n },\n\n methods: {\n async nextPage() {\n this.pageNumber += 1;\n if (this.pageNumber === this.docs.length) {\n if (this.next) {\n this.url = this.next;\n await this.search();\n this.pageNumber = 0;\n } else {\n this.pageNumber = this.docs.length - 1;\n }\n }\n },\n\n async prevPage() {\n this.pageNumber -= 1;\n if (this.pageNumber === -1) {\n if (this.prev) {\n this.url = this.prev;\n await this.search();\n this.pageNumber = this.docs.length - 1;\n } else {\n this.pageNumber = 0;\n }\n }\n },\n\n async search() {\n await _http__WEBPACK_IMPORTED_MODULE_0__[\"default\"].get(this.url).then((response) => {\n this.docs = response.data.results;\n this.next = response.data.next;\n this.prev = response.data.previous;\n });\n this.annotations = [];\n for (let i = 0; i < this.docs.length; i++) {\n const docId = this.docs[i].id;\n await _http__WEBPACK_IMPORTED_MODULE_0__[\"default\"].get(`docs/${docId}/annotations/`).then((response) => {\n this.annotations.push(response.data);\n });\n }\n },\n\n getState() {\n if (this.picked === 'all') {\n return '';\n }\n if (this.picked === 'active') {\n return 'true';\n }\n return 'false';\n },\n\n async submit() {\n const state = this.getState();\n this.url = `docs/?q=${this.searchQuery}&is_checked=${state}`;\n await this.search();\n this.pageNumber = 0;\n },\n\n removeLabel(annotation) {\n const docId = this.docs[this.pageNumber].id;\n _http__WEBPACK_IMPORTED_MODULE_0__[\"default\"].delete(`docs/${docId}/annotations/${annotation.id}`).then((response) => {\n const index = this.annotations[this.pageNumber].indexOf(annotation);\n this.annotations[this.pageNumber].splice(index, 1);\n });\n },\n },\n\n watch: {\n picked() {\n this.submit();\n },\n\n annotations() {\n // fetch progress info.\n _http__WEBPACK_IMPORTED_MODULE_0__[\"default\"].get('progress').then((response) => {\n this.total = response.data.total;\n this.remaining = response.data.remaining;\n });\n },\n },\n\n created() {\n _http__WEBPACK_IMPORTED_MODULE_0__[\"default\"].get('labels').then((response) => {\n this.labels = response.data;\n });\n this.submit();\n },\n\n computed: {\n achievement() {\n const done = this.total - this.remaining;\n const percentage = Math.round(done / this.total * 100);\n return this.total > 0 ? percentage : 0;\n },\n\n id2label() {\n let id2label = {};\n for (let i = 0; i < this.labels.length; i++) {\n const label = this.labels[i];\n id2label[label.id] = label;\n }\n return id2label;\n },\n\n progressColor() {\n if (this.achievement < 30) {\n return 'is-danger';\n }\n if (this.achievement < 70) {\n return 'is-warning';\n }\n return 'is-primary';\n },\n },\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (annotationMixin);\n\n\n//# sourceURL=webpack:///./static/js/mixin.js?"); /***/ }), diff --git a/app/server/static/js/mixin.js b/app/server/static/js/mixin.js index 831f6d75..428a47e3 100644 --- a/app/server/static/js/mixin.js +++ b/app/server/static/js/mixin.js @@ -89,7 +89,7 @@ const annotationMixin = { this.submit(); }, - docs() { + annotations() { // fetch progress info. HTTP.get('progress').then((response) => { this.total = response.data.total;