From b48fe62283f492f41990f4331be8b544f3505c6d Mon Sep 17 00:00:00 2001 From: Hironsan Date: Thu, 16 Aug 2018 13:45:16 +0900 Subject: [PATCH] Update demo data --- app/db.sqlite3 | Bin 393216 -> 393216 bytes app/server/static/bundle/demo_named_entity.js | 2 +- .../static/bundle/demo_text_classification.js | 2 +- app/server/static/bundle/demo_translation.js | 2 +- .../static/js/demo/demo_named_entity.js | 130 +++++++++++++++--- .../js/demo/demo_text_classification.js | 16 +-- app/server/static/js/demo/demo_translation.js | 18 ++- .../templates/annotation/annotation_base.html | 2 +- .../annotation/document_classification.html | 2 +- app/server/templates/base.html | 2 +- .../demo/demo_text_classification.html | 2 +- 11 files changed, 140 insertions(+), 38 deletions(-) diff --git a/app/db.sqlite3 b/app/db.sqlite3 index 526b44a3a614b953e85bea7c0911ce3891fc631a..3052730f17eea75edcdb99c33861d55442b25691 100644 GIT binary patch delta 2323 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\\\n {{ text.slice(r.start_offset, r.end_offset) }}\\\n ',\n props: {\n labels: Array, // [{id: Integer, color: String, text: String}]\n text: String,\n entityPositions: Array, // [{'startOffset': 10, 'endOffset': 15, 'label_id': 1}]\n },\n data() {\n return {\n startOffset: 0,\n endOffset: 0,\n };\n },\n\n methods: {\n setSelectedRange(e) {\n let start;\n let end;\n if (window.getSelection) {\n const range = window.getSelection().getRangeAt(0);\n const preSelectionRange = range.cloneRange();\n preSelectionRange.selectNodeContents(this.$el);\n preSelectionRange.setEnd(range.startContainer, range.startOffset);\n start = preSelectionRange.toString().length;\n end = start + range.toString().length;\n } else if (document.selection && document.selection.type !== 'Control') {\n const selectedTextRange = document.selection.createRange();\n const preSelectionTextRange = document.body.createTextRange();\n preSelectionTextRange.moveToElementText(this.$el);\n preSelectionTextRange.setEndPoint('EndToStart', selectedTextRange);\n start = preSelectionTextRange.text.length;\n end = start + selectedTextRange.text.length;\n }\n this.startOffset = start;\n this.endOffset = end;\n console.log(start, end);\n },\n\n validRange() {\n if (this.startOffset === this.endOffset) {\n return false;\n }\n if (this.startOffset > this.text.length || this.endOffset > this.text.length) {\n return false;\n }\n if (this.startOffset < 0 || this.endOffset < 0) {\n return false;\n }\n return true;\n },\n\n resetRange() {\n this.startOffset = 0;\n this.endOffset = 0;\n },\n\n addLabel(labelId) {\n if (this.validRange()) {\n const label = {\n start_offset: this.startOffset,\n end_offset: this.endOffset,\n label: labelId,\n };\n this.$emit('add-label', label);\n }\n },\n\n removeLabel(index) {\n this.$emit('remove-label', index);\n },\n\n makeLabel(startOffset, endOffset) {\n const label = {\n id: 0,\n label: -1,\n start_offset: startOffset,\n end_offset: endOffset,\n };\n return label;\n },\n },\n\n watch: {\n entityPositions() {\n this.resetRange();\n },\n },\n\n computed: {\n sortedEntityPositions() {\n this.entityPositions = this.entityPositions.sort((a, b) => a.start_offset - b.start_offset);\n return this.entityPositions;\n },\n\n chunks() {\n const res = [];\n let left = 0;\n for (let i = 0; i < this.sortedEntityPositions.length; i++) {\n const e = this.sortedEntityPositions[i];\n const l = this.makeLabel(left, e.start_offset);\n res.push(l);\n res.push(e);\n left = e.end_offset;\n }\n const l = this.makeLabel(left, this.text.length);\n res.push(l);\n\n return res;\n },\n\n id2label() {\n let id2label = {};\n // default value;\n id2label[-1] = {\n text_color: '',\n background_color: '',\n };\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});\n\nconst vm = new vue__WEBPACK_IMPORTED_MODULE_0__[\"default\"]({\n el: '#mail-app',\n delimiters: ['[[', ']]'],\n mixins: [_demo_mixin__WEBPACK_IMPORTED_MODULE_1__[\"default\"]],\n data: {\n docs: [{\n id: 1,\n text: 'This is a document for named entity recognition.',\n },\n {\n id: 10,\n text: 'This is a sentence.',\n },\n {\n id: 11,\n text: 'This is a sentence.',\n },\n {\n id: 12,\n text: 'This is a sentence.',\n },\n {\n id: 13,\n text: 'This is a sentence.',\n },\n {\n id: 13,\n text: 'This is a sentence.',\n },\n ],\n labels: [\n {\n id: 1,\n text: 'Negative',\n shortcut: 'n',\n background_color: '#ff0033',\n text_color: '#ffffff',\n },\n {\n id: 2,\n text: 'Positive',\n shortcut: 'p',\n background_color: '#209cee',\n text_color: '#ffffff',\n },\n ],\n annotations: [\n [\n {\n id: 1,\n prob: 0.0,\n label: 1,\n start_offset: 5,\n end_offset: 10,\n },\n ],\n [],\n [],\n [],\n [],\n [],\n ],\n },\n\n methods: {\n annotate(labelId) {\n this.$refs.annotator.addLabel(labelId);\n },\n\n addLabel(annotation) {\n this.annotations[this.pageNumber].push(annotation);\n },\n },\n});\n\n\n//# sourceURL=webpack:///./static/js/demo/demo_named_entity.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ \"./node_modules/vue/dist/vue.esm.js\");\n/* harmony import */ var _demo_mixin__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./demo_mixin */ \"./static/js/demo/demo_mixin.js\");\n\n\n\nvue__WEBPACK_IMPORTED_MODULE_0__[\"default\"].use(__webpack_require__(/*! vue-shortkey */ \"./node_modules/vue-shortkey/dist/index.js\"), {\n prevent: ['input', 'textarea'],\n});\n\nvue__WEBPACK_IMPORTED_MODULE_0__[\"default\"].component('annotator', {\n template: '
\\\n {{ text.slice(r.start_offset, r.end_offset) }}\\\n
',\n props: {\n labels: Array, // [{id: Integer, color: String, text: String}]\n text: String,\n entityPositions: Array, // [{'startOffset': 10, 'endOffset': 15, 'label_id': 1}]\n },\n data() {\n return {\n startOffset: 0,\n endOffset: 0,\n };\n },\n\n methods: {\n setSelectedRange(e) {\n let start;\n let end;\n if (window.getSelection) {\n const range = window.getSelection().getRangeAt(0);\n const preSelectionRange = range.cloneRange();\n preSelectionRange.selectNodeContents(this.$el);\n preSelectionRange.setEnd(range.startContainer, range.startOffset);\n start = preSelectionRange.toString().length;\n end = start + range.toString().length;\n } else if (document.selection && document.selection.type !== 'Control') {\n const selectedTextRange = document.selection.createRange();\n const preSelectionTextRange = document.body.createTextRange();\n preSelectionTextRange.moveToElementText(this.$el);\n preSelectionTextRange.setEndPoint('EndToStart', selectedTextRange);\n start = preSelectionTextRange.text.length;\n end = start + selectedTextRange.text.length;\n }\n this.startOffset = start;\n this.endOffset = end;\n console.log(start, end);\n },\n\n validRange() {\n if (this.startOffset === this.endOffset) {\n return false;\n }\n if (this.startOffset > this.text.length || this.endOffset > this.text.length) {\n return false;\n }\n if (this.startOffset < 0 || this.endOffset < 0) {\n return false;\n }\n return true;\n },\n\n resetRange() {\n this.startOffset = 0;\n this.endOffset = 0;\n },\n\n addLabel(labelId) {\n if (this.validRange()) {\n const label = {\n start_offset: this.startOffset,\n end_offset: this.endOffset,\n label: labelId,\n };\n this.$emit('add-label', label);\n }\n },\n\n removeLabel(index) {\n this.$emit('remove-label', index);\n },\n\n makeLabel(startOffset, endOffset) {\n const label = {\n id: 0,\n label: -1,\n start_offset: startOffset,\n end_offset: endOffset,\n };\n return label;\n },\n },\n\n watch: {\n entityPositions() {\n this.resetRange();\n },\n },\n\n computed: {\n sortedEntityPositions() {\n this.entityPositions = this.entityPositions.sort((a, b) => a.start_offset - b.start_offset);\n return this.entityPositions;\n },\n\n chunks() {\n const res = [];\n let left = 0;\n for (let i = 0; i < this.sortedEntityPositions.length; i++) {\n const e = this.sortedEntityPositions[i];\n const l = this.makeLabel(left, e.start_offset);\n res.push(l);\n res.push(e);\n left = e.end_offset;\n }\n const l = this.makeLabel(left, this.text.length);\n res.push(l);\n\n return res;\n },\n\n id2label() {\n let id2label = {};\n // default value;\n id2label[-1] = {\n text_color: '',\n background_color: '',\n };\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});\n\nconst vm = new vue__WEBPACK_IMPORTED_MODULE_0__[\"default\"]({\n el: '#mail-app',\n delimiters: ['[[', ']]'],\n mixins: [_demo_mixin__WEBPACK_IMPORTED_MODULE_1__[\"default\"]],\n data: {\n docs: [{\n id: 1,\n text: 'Barack Hussein Obama II (born August 4, 1961) is an American attorney and politician who served as the 44th President of the United States from January 20, 2009, to January 20, 2017. A member of the Democratic Party, he was the first African American to serve as president. He was previously a United States Senator from Illinois and a member of the Illinois State Senate.',\n },\n {\n id: 10,\n text: 'The White House is the official residence and workplace of the President of the United States. It is located at 1600 Pennsylvania Avenue NW in Washington, D.C. and has been the residence of every U.S. President since John Adams in 1800. The term is often used as a metonym for the president and his advisers.',\n },\n {\n id: 11,\n text: \"The Democratic Party is one of the two major contemporary political parties in the United States, along with the Republican Party. Tracing its heritage back to Thomas Jefferson and James Madison's Democratic-Republican Party, the modern-day Democratic Party was founded around 1828 by supporters of Andrew Jackson, making it the world's oldest active political party.\",\n },\n {\n id: 12,\n text: \"Stanford University (officially Leland Stanford Junior University, colloquially the Farm) is a private research university in Stanford, California. Stanford is known for its academic strength, wealth, proximity to Silicon Valley, and ranking as one of the world's top universities.\",\n },\n {\n id: 13,\n text: 'Donald John Trump (born June 14, 1946) is the 45th and current President of the United States. Before entering politics, he was a businessman and television personality.',\n },\n {\n id: 14,\n text: \"Silicon Valley (abbreviated as SV) is a region in the southern San Francisco Bay Area of Northern California, referring to the Santa Clara Valley, which serves as the global center for high technology, venture capital, innovation, and social media. San Jose is the Valley's largest city, the 3rd-largest in California, and the 10th-largest in the United States. Other major SV cities include Palo Alto, Santa Clara, Mountain View, and Sunnyvale. The San Jose Metropolitan Area has the third highest GDP per capita in the world (after Zurich, Switzerland and Oslo, Norway), according to the Brookings Institution.\",\n },\n ],\n labels: [\n {\n id: 1,\n text: 'Person',\n shortcut: 'p',\n background_color: '#209cee',\n text_color: '#ffffff',\n },\n {\n id: 2,\n text: 'Loc',\n shortcut: 'l',\n background_color: '#ffcc00',\n text_color: '#333333',\n },\n {\n id: 3,\n text: 'Org',\n shortcut: 'o',\n background_color: '#333333',\n text_color: '#ffffff',\n },\n {\n id: 4,\n text: 'Event',\n shortcut: 'e',\n background_color: '#33cc99',\n text_color: '#ffffff',\n },\n {\n id: 5,\n text: 'Date',\n shortcut: 'd',\n background_color: '#ff3333',\n text_color: '#ffffff',\n },\n {\n id: 6,\n text: 'Other',\n shortcut: 'z',\n background_color: '#9933ff',\n text_color: '#ffffff',\n },\n ],\n annotations: [\n [\n {\n id: 16,\n prob: 0.0,\n label: 1,\n start_offset: 0,\n end_offset: 23,\n },\n {\n id: 19,\n prob: 0.0,\n label: 2,\n start_offset: 121,\n end_offset: 138,\n },\n {\n id: 27,\n prob: 0.0,\n label: 2,\n start_offset: 321,\n end_offset: 329,\n },\n {\n id: 22,\n prob: 0.0,\n label: 3,\n start_offset: 199,\n end_offset: 215,\n },\n {\n id: 28,\n prob: 0.0,\n label: 3,\n start_offset: 350,\n end_offset: 371,\n },\n {\n id: 17,\n prob: 0.0,\n label: 5,\n start_offset: 30,\n end_offset: 44,\n },\n {\n id: 20,\n prob: 0.0,\n label: 5,\n start_offset: 144,\n end_offset: 160,\n },\n {\n id: 21,\n prob: 0.0,\n label: 5,\n start_offset: 165,\n end_offset: 181,\n },\n {\n id: 18,\n prob: 0.0,\n label: 6,\n start_offset: 52,\n end_offset: 60,\n },\n {\n id: 24,\n prob: 0.0,\n label: 6,\n start_offset: 234,\n end_offset: 250,\n },\n {\n id: 26,\n prob: 0.0,\n label: 6,\n start_offset: 294,\n end_offset: 315,\n },\n ],\n [],\n [],\n [],\n [],\n [],\n ],\n },\n\n methods: {\n annotate(labelId) {\n this.$refs.annotator.addLabel(labelId);\n },\n\n addLabel(annotation) {\n this.annotations[this.pageNumber].push(annotation);\n },\n },\n});\n\n\n//# sourceURL=webpack:///./static/js/demo/demo_named_entity.js?"); /***/ }) diff --git a/app/server/static/bundle/demo_text_classification.js b/app/server/static/bundle/demo_text_classification.js index 444314ec..e2c704f9 100644 --- a/app/server/static/bundle/demo_text_classification.js +++ b/app/server/static/bundle/demo_text_classification.js @@ -173,7 +173,7 @@ eval("__webpack_require__.r(__webpack_exports__);\nconst annotationMixin = {\n /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ \"./node_modules/vue/dist/vue.esm.js\");\n/* harmony import */ var _demo_mixin__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./demo_mixin */ \"./static/js/demo/demo_mixin.js\");\n\n\n\nvue__WEBPACK_IMPORTED_MODULE_0__[\"default\"].use(__webpack_require__(/*! vue-shortkey */ \"./node_modules/vue-shortkey/dist/index.js\"), {\n prevent: ['input', 'textarea'],\n});\n\n\nconst vm = new vue__WEBPACK_IMPORTED_MODULE_0__[\"default\"]({\n el: '#mail-app',\n delimiters: ['[[', ']]'],\n mixins: [_demo_mixin__WEBPACK_IMPORTED_MODULE_1__[\"default\"]],\n data: {\n docs: [{\n id: 1,\n text: 'This is a document for named entity recognition.',\n },\n {\n id: 10,\n text: 'This is a sentence.',\n },\n {\n id: 11,\n text: 'This is a sentence.',\n },\n {\n id: 12,\n text: 'This is a sentence.',\n },\n {\n id: 13,\n text: 'This is a sentence.',\n },\n {\n id: 13,\n text: 'This is a sentence.',\n },\n ],\n labels: [\n {\n id: 1,\n text: 'Negative',\n shortcut: 'n',\n background_color: '#ff0033',\n text_color: '#ffffff',\n },\n {\n id: 2,\n text: 'Positive',\n shortcut: 'p',\n background_color: '#209cee',\n text_color: '#ffffff',\n },\n ],\n annotations: [\n [\n {\n id: 1,\n label: 1,\n },\n ],\n [],\n [],\n [],\n [],\n [],\n ],\n },\n\n methods: {\n isIn(label) {\n for (let i = 0; i < this.annotations[this.pageNumber].length; i++) {\n const a = this.annotations[this.pageNumber][i];\n if (a.label === label.id) {\n return a;\n }\n }\n return false;\n },\n\n addLabel(label) {\n const a = this.isIn(label);\n if (a) {\n this.removeLabel(a);\n } else {\n const annotation = {\n id: this.annotationId++,\n label: label.id,\n };\n this.annotations[this.pageNumber].push(annotation);\n console.log(this.annotations);\n }\n },\n },\n});\n\n\n//# sourceURL=webpack:///./static/js/demo/demo_text_classification.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ \"./node_modules/vue/dist/vue.esm.js\");\n/* harmony import */ var _demo_mixin__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./demo_mixin */ \"./static/js/demo/demo_mixin.js\");\n\n\n\nvue__WEBPACK_IMPORTED_MODULE_0__[\"default\"].use(__webpack_require__(/*! vue-shortkey */ \"./node_modules/vue-shortkey/dist/index.js\"), {\n prevent: ['input', 'textarea'],\n});\n\n\nconst vm = new vue__WEBPACK_IMPORTED_MODULE_0__[\"default\"]({\n el: '#mail-app',\n delimiters: ['[[', ']]'],\n mixins: [_demo_mixin__WEBPACK_IMPORTED_MODULE_1__[\"default\"]],\n data: {\n docs: [{\n id: 1,\n text: 'Fair drama/love story movie that focuses on the lives of blue collar people finding new life thru new love.The acting here is good but the film fails in cinematography,screenplay,directing and editing.The story/script is only average at best.This film will be enjoyed by Fonda and De Niro fans and by people who love middle age love stories where in the coartship is on a more wiser and cautious level.It would also be interesting for people who are interested on the subject matter regarding illiteracy.......',\n },\n {\n id: 10,\n text: \"If you like adult comedy cartoons, like South Park, then this is nearly a similar format about the small adventures of three teenage girls at Bromwell High. Keisha, Natella and Latrina have given exploding sweets and behaved like bitches, I think Keisha is a good leader. There are also small stories going on with the teachers of the school. There's the idiotic principal, Mr. Bip, the nervous Maths teacher and many others. The cast is also fantastic, Lenny Henry's Gina Yashere, EastEnders Chrissie Watts, Tracy-Ann Oberman, Smack The Pony's Doon Mackichan, Dead Ringers' Mark Perry and Blunder's Nina Conti. I didn't know this came from Canada, but it is very good. Very good!\",\n },\n {\n id: 11,\n text: \"I came in in the middle of this film so I had no idea about any credits or even its title till I looked it up here, where I see that it has received a mixed reception by your commentators. I'm on the positive side regarding this film but one thing really caught my attention as I watched: the beautiful and sensitive score written in a Coplandesque Americana style. My surprise was great when I discovered the score to have been written by none other than John Williams himself. True he has written sensitive and poignant scores such as Schindler's List but one usually associates his name with such bombasticities as Star Wars. But in my opinion what Williams has written for this movie surpasses anything I've ever heard of his for tenderness, sensitivity and beauty, fully in keeping with the tender and lovely plot of the movie. And another recent score of his, for Catch Me if You Can, shows still more wit and sophistication. As to Stanley and Iris, I like education movies like How Green was my Valley and Konrack, that one with John Voigt and his young African American charges in South Carolina, and Danny deVito's Renaissance Man, etc. They tell a necessary story of intellectual and spiritual awakening, a story which can't be told often enough. This one is an excellent addition to that genre.\",\n },\n {\n id: 12,\n text: \"Story of a man who has unnatural feelings for a pig. Starts out with a opening scene that is a terrific example of absurd comedy. A formal orchestra audience is turned into an insane, violent mob by the crazy chantings of it's singers. Unfortunately it stays absurd the WHOLE time with no general narrative eventually making it just too off putting. Even those from the era should be turned off. The cryptic dialogue would make Shakespeare seem easy to a third grader. On a technical level it's better than you might think with some good cinematography by future great Vilmos Zsigmond. Future stars Sally Kirkland and Frederic Forrest can be seen briefly.\",\n },\n {\n id: 13,\n text: \"Robert DeNiro plays the most unbelievably intelligent illiterate of all time. This movie is so wasteful of talent, it is truly disgusting. The script is unbelievable. The dialog is unbelievable. Jane Fonda's character is a caricature of herself, and not a funny one. The movie moves at a snail's pace, is photographed in an ill-advised manner, and is insufferably preachy. It also plugs in every cliche in the book. Swoozie Kurtz is excellent in a supporting role, but so what?

Equally annoying is this new IMDB rule of requiring ten lines for every review. When a movie is this worthless, it doesn't require ten lines of text to let other readers know that it is a waste of time and tape. Avoid this movie.\",\n },\n {\n id: 14,\n text: 'From the beginning of the movie, it gives the feeling the director is trying to portray something, what I mean to say that instead of the story dictating the style in which the movie should be made, he has gone in the opposite way, he had a type of move that he wanted to make, and wrote a story to suite it. And he has failed in it very badly. I guess he was trying to make a stylish movie. Any way I think this movie is a total waste of time and effort. In the credit of the director, he knows the media that he is working with, what I am trying to say is I have seen worst movies than this. Here at least the director knows to maintain the continuity in the movie. And the actors also have given a decent performance.',\n },\n ],\n labels: [\n {\n id: 1,\n text: 'Negative',\n shortcut: 'n',\n background_color: '#ff0033',\n text_color: '#ffffff',\n },\n {\n id: 2,\n text: 'Positive',\n shortcut: 'p',\n background_color: '#209cee',\n text_color: '#ffffff',\n },\n ],\n annotations: [\n [\n {\n id: 1,\n label: 2,\n },\n ],\n [],\n [],\n [],\n [],\n [],\n ],\n },\n\n methods: {\n isIn(label) {\n for (let i = 0; i < this.annotations[this.pageNumber].length; i++) {\n const a = this.annotations[this.pageNumber][i];\n if (a.label === label.id) {\n return a;\n }\n }\n return false;\n },\n\n addLabel(label) {\n const a = this.isIn(label);\n if (a) {\n this.removeLabel(a);\n } else {\n const annotation = {\n id: this.annotationId++,\n label: label.id,\n };\n this.annotations[this.pageNumber].push(annotation);\n console.log(this.annotations);\n }\n },\n },\n});\n\n\n//# sourceURL=webpack:///./static/js/demo/demo_text_classification.js?"); /***/ }) diff --git a/app/server/static/bundle/demo_translation.js b/app/server/static/bundle/demo_translation.js index 08bdb9b7..d07d6404 100644 --- a/app/server/static/bundle/demo_translation.js +++ b/app/server/static/bundle/demo_translation.js @@ -173,7 +173,7 @@ eval("__webpack_require__.r(__webpack_exports__);\nconst annotationMixin = {\n /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ \"./node_modules/vue/dist/vue.esm.js\");\n/* harmony import */ var _demo_mixin__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./demo_mixin */ \"./static/js/demo/demo_mixin.js\");\n\n\n\nvue__WEBPACK_IMPORTED_MODULE_0__[\"default\"].use(__webpack_require__(/*! vue-shortkey */ \"./node_modules/vue-shortkey/dist/index.js\"));\n\n\nconst vm = new vue__WEBPACK_IMPORTED_MODULE_0__[\"default\"]({\n el: '#mail-app',\n delimiters: ['[[', ']]'],\n data: {\n newTodo: '',\n editedTodo: null,\n docs: [{\n id: 1,\n text: 'This is a document for named entity recognition.',\n },\n {\n id: 10,\n text: 'This is a sentence.',\n },\n {\n id: 11,\n text: 'This is a sentence.',\n },\n {\n id: 12,\n text: 'This is a sentence.',\n },\n {\n id: 13,\n text: 'This is a sentence.',\n },\n {\n id: 13,\n text: 'This is a sentence.',\n },\n ],\n annotations: [\n [\n {\n id: 1,\n text: 'hotdog',\n },\n ],\n [],\n [],\n [],\n [],\n [],\n ],\n },\n mixins: [_demo_mixin__WEBPACK_IMPORTED_MODULE_1__[\"default\"]],\n directives: {\n 'todo-focus': function(el, binding) {\n if (binding.value) {\n el.focus();\n }\n },\n },\n\n methods: {\n addTodo() {\n const value = this.newTodo && this.newTodo.trim();\n if (!value) {\n return;\n }\n\n const payload = {\n text: value,\n id: this.annotationId++,\n };\n this.annotations[this.pageNumber].push(payload);\n\n this.newTodo = '';\n },\n\n removeTodo(todo) {\n const index = this.annotations[this.pageNumber].indexOf(todo);\n this.annotations[this.pageNumber].splice(index, 1);\n },\n\n editTodo(todo) {\n this.beforeEditCache = todo.text;\n this.editedTodo = todo;\n },\n\n doneEdit(todo) {\n if (!this.editedTodo) {\n return;\n }\n this.editedTodo = null;\n todo.text = todo.text.trim();\n if (!todo.text) {\n this.removeTodo(todo);\n }\n },\n\n cancelEdit(todo) {\n this.editedTodo = null;\n todo.text = this.beforeEditCache;\n },\n },\n});\n\n\n//# sourceURL=webpack:///./static/js/demo/demo_translation.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ \"./node_modules/vue/dist/vue.esm.js\");\n/* harmony import */ var _demo_mixin__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./demo_mixin */ \"./static/js/demo/demo_mixin.js\");\n\n\n\nvue__WEBPACK_IMPORTED_MODULE_0__[\"default\"].use(__webpack_require__(/*! vue-shortkey */ \"./node_modules/vue-shortkey/dist/index.js\"));\n\n\nconst vm = new vue__WEBPACK_IMPORTED_MODULE_0__[\"default\"]({\n el: '#mail-app',\n delimiters: ['[[', ']]'],\n data: {\n newTodo: '',\n editedTodo: null,\n docs: [{\n id: 1,\n text: 'If it had not been for his help, I would have failed.',\n },\n {\n id: 10,\n text: 'According to this magazine, my favorite actress will marry a jazz musician next spring.',\n },\n {\n id: 11,\n text: \"It's not always possible to eat well when you are traveling in this part of the world.\",\n },\n {\n id: 12,\n text: \"It's still early. We should all just chill for a bit.\",\n },\n {\n id: 13,\n text: \"She got a master's degree three years ago.\",\n },\n {\n id: 13,\n text: 'We adopted an alternative method.',\n },\n ],\n annotations: [\n [\n {\n id: 1,\n text: \"S'il ne m'avait pas aidé, j'aurais échoué.\",\n },\n {\n id: 2,\n text: \"S'il ne m'avait pas aidée, j'aurais échoué.\",\n },\n ],\n [],\n [],\n [],\n [],\n [],\n ],\n },\n mixins: [_demo_mixin__WEBPACK_IMPORTED_MODULE_1__[\"default\"]],\n directives: {\n 'todo-focus': function(el, binding) {\n if (binding.value) {\n el.focus();\n }\n },\n },\n\n methods: {\n addTodo() {\n const value = this.newTodo && this.newTodo.trim();\n if (!value) {\n return;\n }\n\n const payload = {\n text: value,\n id: this.annotationId++,\n };\n this.annotations[this.pageNumber].push(payload);\n\n this.newTodo = '';\n },\n\n removeTodo(todo) {\n const index = this.annotations[this.pageNumber].indexOf(todo);\n this.annotations[this.pageNumber].splice(index, 1);\n },\n\n editTodo(todo) {\n this.beforeEditCache = todo.text;\n this.editedTodo = todo;\n },\n\n doneEdit(todo) {\n if (!this.editedTodo) {\n return;\n }\n this.editedTodo = null;\n todo.text = todo.text.trim();\n if (!todo.text) {\n this.removeTodo(todo);\n }\n },\n\n cancelEdit(todo) {\n this.editedTodo = null;\n todo.text = this.beforeEditCache;\n },\n },\n});\n\n\n//# sourceURL=webpack:///./static/js/demo/demo_translation.js?"); /***/ }) diff --git a/app/server/static/js/demo/demo_named_entity.js b/app/server/static/js/demo/demo_named_entity.js index 182ca5dc..81513f2d 100644 --- a/app/server/static/js/demo/demo_named_entity.js +++ b/app/server/static/js/demo/demo_named_entity.js @@ -145,53 +145,151 @@ const vm = new Vue({ data: { docs: [{ id: 1, - text: 'This is a document for named entity recognition.', + text: 'Barack Hussein Obama II (born August 4, 1961) is an American attorney and politician who served as the 44th President of the United States from January 20, 2009, to January 20, 2017. A member of the Democratic Party, he was the first African American to serve as president. He was previously a United States Senator from Illinois and a member of the Illinois State Senate.', }, { id: 10, - text: 'This is a sentence.', + text: 'The White House is the official residence and workplace of the President of the United States. It is located at 1600 Pennsylvania Avenue NW in Washington, D.C. and has been the residence of every U.S. President since John Adams in 1800. The term is often used as a metonym for the president and his advisers.', }, { id: 11, - text: 'This is a sentence.', + text: "The Democratic Party is one of the two major contemporary political parties in the United States, along with the Republican Party. Tracing its heritage back to Thomas Jefferson and James Madison's Democratic-Republican Party, the modern-day Democratic Party was founded around 1828 by supporters of Andrew Jackson, making it the world's oldest active political party.", }, { id: 12, - text: 'This is a sentence.', + text: "Stanford University (officially Leland Stanford Junior University, colloquially the Farm) is a private research university in Stanford, California. Stanford is known for its academic strength, wealth, proximity to Silicon Valley, and ranking as one of the world's top universities.", }, { id: 13, - text: 'This is a sentence.', + text: 'Donald John Trump (born June 14, 1946) is the 45th and current President of the United States. Before entering politics, he was a businessman and television personality.', }, { - id: 13, - text: 'This is a sentence.', + id: 14, + text: "Silicon Valley (abbreviated as SV) is a region in the southern San Francisco Bay Area of Northern California, referring to the Santa Clara Valley, which serves as the global center for high technology, venture capital, innovation, and social media. San Jose is the Valley's largest city, the 3rd-largest in California, and the 10th-largest in the United States. Other major SV cities include Palo Alto, Santa Clara, Mountain View, and Sunnyvale. The San Jose Metropolitan Area has the third highest GDP per capita in the world (after Zurich, Switzerland and Oslo, Norway), according to the Brookings Institution.", }, ], labels: [ { id: 1, - text: 'Negative', - shortcut: 'n', - background_color: '#ff0033', + text: 'Person', + shortcut: 'p', + background_color: '#209cee', text_color: '#ffffff', }, { id: 2, - text: 'Positive', - shortcut: 'p', - background_color: '#209cee', + text: 'Loc', + shortcut: 'l', + background_color: '#ffcc00', + text_color: '#333333', + }, + { + id: 3, + text: 'Org', + shortcut: 'o', + background_color: '#333333', + text_color: '#ffffff', + }, + { + id: 4, + text: 'Event', + shortcut: 'e', + background_color: '#33cc99', + text_color: '#ffffff', + }, + { + id: 5, + text: 'Date', + shortcut: 'd', + background_color: '#ff3333', + text_color: '#ffffff', + }, + { + id: 6, + text: 'Other', + shortcut: 'z', + background_color: '#9933ff', text_color: '#ffffff', }, ], annotations: [ [ { - id: 1, + id: 16, prob: 0.0, label: 1, - start_offset: 5, - end_offset: 10, + start_offset: 0, + end_offset: 23, + }, + { + id: 19, + prob: 0.0, + label: 2, + start_offset: 121, + end_offset: 138, + }, + { + id: 27, + prob: 0.0, + label: 2, + start_offset: 321, + end_offset: 329, + }, + { + id: 22, + prob: 0.0, + label: 3, + start_offset: 199, + end_offset: 215, + }, + { + id: 28, + prob: 0.0, + label: 3, + start_offset: 350, + end_offset: 371, + }, + { + id: 17, + prob: 0.0, + label: 5, + start_offset: 30, + end_offset: 44, + }, + { + id: 20, + prob: 0.0, + label: 5, + start_offset: 144, + end_offset: 160, + }, + { + id: 21, + prob: 0.0, + label: 5, + start_offset: 165, + end_offset: 181, + }, + { + id: 18, + prob: 0.0, + label: 6, + start_offset: 52, + end_offset: 60, + }, + { + id: 24, + prob: 0.0, + label: 6, + start_offset: 234, + end_offset: 250, + }, + { + id: 26, + prob: 0.0, + label: 6, + start_offset: 294, + end_offset: 315, }, ], [], diff --git a/app/server/static/js/demo/demo_text_classification.js b/app/server/static/js/demo/demo_text_classification.js index 5a640dd3..3b6c93b6 100644 --- a/app/server/static/js/demo/demo_text_classification.js +++ b/app/server/static/js/demo/demo_text_classification.js @@ -13,27 +13,27 @@ const vm = new Vue({ data: { docs: [{ id: 1, - text: 'This is a document for named entity recognition.', + text: 'Fair drama/love story movie that focuses on the lives of blue collar people finding new life thru new love.The acting here is good but the film fails in cinematography,screenplay,directing and editing.The story/script is only average at best.This film will be enjoyed by Fonda and De Niro fans and by people who love middle age love stories where in the coartship is on a more wiser and cautious level.It would also be interesting for people who are interested on the subject matter regarding illiteracy.......', }, { id: 10, - text: 'This is a sentence.', + text: "If you like adult comedy cartoons, like South Park, then this is nearly a similar format about the small adventures of three teenage girls at Bromwell High. Keisha, Natella and Latrina have given exploding sweets and behaved like bitches, I think Keisha is a good leader. There are also small stories going on with the teachers of the school. There's the idiotic principal, Mr. Bip, the nervous Maths teacher and many others. The cast is also fantastic, Lenny Henry's Gina Yashere, EastEnders Chrissie Watts, Tracy-Ann Oberman, Smack The Pony's Doon Mackichan, Dead Ringers' Mark Perry and Blunder's Nina Conti. I didn't know this came from Canada, but it is very good. Very good!", }, { id: 11, - text: 'This is a sentence.', + text: "I came in in the middle of this film so I had no idea about any credits or even its title till I looked it up here, where I see that it has received a mixed reception by your commentators. I'm on the positive side regarding this film but one thing really caught my attention as I watched: the beautiful and sensitive score written in a Coplandesque Americana style. My surprise was great when I discovered the score to have been written by none other than John Williams himself. True he has written sensitive and poignant scores such as Schindler's List but one usually associates his name with such bombasticities as Star Wars. But in my opinion what Williams has written for this movie surpasses anything I've ever heard of his for tenderness, sensitivity and beauty, fully in keeping with the tender and lovely plot of the movie. And another recent score of his, for Catch Me if You Can, shows still more wit and sophistication. As to Stanley and Iris, I like education movies like How Green was my Valley and Konrack, that one with John Voigt and his young African American charges in South Carolina, and Danny deVito's Renaissance Man, etc. They tell a necessary story of intellectual and spiritual awakening, a story which can't be told often enough. This one is an excellent addition to that genre.", }, { id: 12, - text: 'This is a sentence.', + text: "Story of a man who has unnatural feelings for a pig. Starts out with a opening scene that is a terrific example of absurd comedy. A formal orchestra audience is turned into an insane, violent mob by the crazy chantings of it's singers. Unfortunately it stays absurd the WHOLE time with no general narrative eventually making it just too off putting. Even those from the era should be turned off. The cryptic dialogue would make Shakespeare seem easy to a third grader. On a technical level it's better than you might think with some good cinematography by future great Vilmos Zsigmond. Future stars Sally Kirkland and Frederic Forrest can be seen briefly.", }, { id: 13, - text: 'This is a sentence.', + text: "Robert DeNiro plays the most unbelievably intelligent illiterate of all time. This movie is so wasteful of talent, it is truly disgusting. The script is unbelievable. The dialog is unbelievable. Jane Fonda's character is a caricature of herself, and not a funny one. The movie moves at a snail's pace, is photographed in an ill-advised manner, and is insufferably preachy. It also plugs in every cliche in the book. Swoozie Kurtz is excellent in a supporting role, but so what?

Equally annoying is this new IMDB rule of requiring ten lines for every review. When a movie is this worthless, it doesn't require ten lines of text to let other readers know that it is a waste of time and tape. Avoid this movie.", }, { - id: 13, - text: 'This is a sentence.', + id: 14, + text: 'From the beginning of the movie, it gives the feeling the director is trying to portray something, what I mean to say that instead of the story dictating the style in which the movie should be made, he has gone in the opposite way, he had a type of move that he wanted to make, and wrote a story to suite it. And he has failed in it very badly. I guess he was trying to make a stylish movie. Any way I think this movie is a total waste of time and effort. In the credit of the director, he knows the media that he is working with, what I am trying to say is I have seen worst movies than this. Here at least the director knows to maintain the continuity in the movie. And the actors also have given a decent performance.', }, ], labels: [ @@ -56,7 +56,7 @@ const vm = new Vue({ [ { id: 1, - label: 1, + label: 2, }, ], [], diff --git a/app/server/static/js/demo/demo_translation.js b/app/server/static/js/demo/demo_translation.js index 4aaa8df5..9c5eafd6 100644 --- a/app/server/static/js/demo/demo_translation.js +++ b/app/server/static/js/demo/demo_translation.js @@ -12,34 +12,38 @@ const vm = new Vue({ editedTodo: null, docs: [{ id: 1, - text: 'This is a document for named entity recognition.', + text: 'If it had not been for his help, I would have failed.', }, { id: 10, - text: 'This is a sentence.', + text: 'According to this magazine, my favorite actress will marry a jazz musician next spring.', }, { id: 11, - text: 'This is a sentence.', + text: "It's not always possible to eat well when you are traveling in this part of the world.", }, { id: 12, - text: 'This is a sentence.', + text: "It's still early. We should all just chill for a bit.", }, { id: 13, - text: 'This is a sentence.', + text: "She got a master's degree three years ago.", }, { id: 13, - text: 'This is a sentence.', + text: 'We adopted an alternative method.', }, ], annotations: [ [ { id: 1, - text: 'hotdog', + text: "S'il ne m'avait pas aidé, j'aurais échoué.", + }, + { + id: 2, + text: "S'il ne m'avait pas aidée, j'aurais échoué.", }, ], [], diff --git a/app/server/templates/annotation/annotation_base.html b/app/server/templates/annotation/annotation_base.html index 33e085c2..d98f049f 100644 --- a/app/server/templates/annotation/annotation_base.html +++ b/app/server/templates/annotation/annotation_base.html @@ -57,7 +57,7 @@ - [[ doc.text.slice(0, 40) ]]... + [[ doc.text.slice(0, 60) ]]... diff --git a/app/server/templates/annotation/document_classification.html b/app/server/templates/annotation/document_classification.html index 2e9eda93..e69975ea 100644 --- a/app/server/templates/annotation/document_classification.html +++ b/app/server/templates/annotation/document_classification.html @@ -29,7 +29,7 @@ -
+
[[ docs[pageNumber].text ]]
diff --git a/app/server/templates/base.html b/app/server/templates/base.html index bd611bb1..84c5bac0 100644 --- a/app/server/templates/base.html +++ b/app/server/templates/base.html @@ -56,7 +56,7 @@ -
+
[[ docs[pageNumber].text ]]