From 1e74aca1947266d9e26712037f73dec4fc913c8e Mon Sep 17 00:00:00 2001 From: Hironsan Date: Fri, 18 Oct 2019 15:41:32 +0900 Subject: [PATCH] Add sentiment analysis demo --- .../containers/TextClassification.vue | 1 - .../demo/named-entity-recognition/index.vue | 2 +- .../pages/demo/sentiment-analysis/index.vue | 95 +++++++++++++++++++ 3 files changed, 96 insertions(+), 2 deletions(-) create mode 100644 frontend/pages/demo/sentiment-analysis/index.vue diff --git a/frontend/components/containers/TextClassification.vue b/frontend/components/containers/TextClassification.vue index 3b876bb4..8159220a 100644 --- a/frontend/components/containers/TextClassification.vue +++ b/frontend/components/containers/TextClassification.vue @@ -59,7 +59,6 @@ export default { this.updateAnnotation(payload) }, addLabel(labelId) { - alert(labelId) const payload = { label: labelId, projectId: this.$route.params.id diff --git a/frontend/pages/demo/named-entity-recognition/index.vue b/frontend/pages/demo/named-entity-recognition/index.vue index 4b28c56f..bc80f5dc 100644 --- a/frontend/pages/demo/named-entity-recognition/index.vue +++ b/frontend/pages/demo/named-entity-recognition/index.vue @@ -138,7 +138,7 @@ export default { }, addEntity(startOffset, endOffset, labelId) { const payload = { - id: this.currentDoc.annotations.reduce((x, y) => { return x.id > y.id ? x : y }).id + 1, + id: Math.floor(Math.random() * Math.floor(Number.MAX_SAFE_INTEGER)), start_offset: startOffset, end_offset: endOffset, label: labelId diff --git a/frontend/pages/demo/sentiment-analysis/index.vue b/frontend/pages/demo/sentiment-analysis/index.vue new file mode 100644 index 00000000..8cac9c08 --- /dev/null +++ b/frontend/pages/demo/sentiment-analysis/index.vue @@ -0,0 +1,95 @@ + + +