Browse Source

Update demo data

pull/10/head
Hironsan 6 years ago
parent
commit
b48fe62283
11 changed files with 140 additions and 38 deletions
  1. BIN
      app/db.sqlite3
  2. 2
      app/server/static/bundle/demo_named_entity.js
  3. 2
      app/server/static/bundle/demo_text_classification.js
  4. 2
      app/server/static/bundle/demo_translation.js
  5. 130
      app/server/static/js/demo/demo_named_entity.js
  6. 16
      app/server/static/js/demo/demo_text_classification.js
  7. 18
      app/server/static/js/demo/demo_translation.js
  8. 2
      app/server/templates/annotation/annotation_base.html
  9. 2
      app/server/templates/annotation/document_classification.html
  10. 2
      app/server/templates/base.html
  11. 2
      app/server/templates/demo/demo_text_classification.html

BIN
app/db.sqlite3

2
app/server/static/bundle/demo_named_entity.js
File diff suppressed because it is too large
View File

2
app/server/static/bundle/demo_text_classification.js
File diff suppressed because it is too large
View File

2
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?");
/***/ })

130
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,
},
],
[],

16
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?<br /><br />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,
},
],
[],

18
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é.",
},
],
[],

2
app/server/templates/annotation/annotation_base.html

@ -57,7 +57,7 @@
<span class="icon">
<i class="fa fa-check" v-show="annotations[index] && annotations[index].length"></i>
</span>
<span class="name">[[ doc.text.slice(0, 40) ]]...</span>
<span class="name">[[ doc.text.slice(0, 60) ]]...</span>
</a>
</div>
</div>

2
app/server/templates/annotation/document_classification.html

@ -29,7 +29,7 @@
</div>
</div>
</div>
<hr>
<hr style="margin: 0.8rem 0;">
<div class="content" v-if="docs[pageNumber]">
[[ docs[pageNumber].text ]]
</div>

2
app/server/templates/base.html

@ -56,7 +56,7 @@
</a>
<div class="navbar-dropdown">
<a href="{% url 'demo-text-classification' %}" class="navbar-item">
Text Classification
Sentiment Analysis
</a>
<a href="{% url 'demo-named-entity-recognition' %}" class="navbar-item">
Named Entity Recognition

2
app/server/templates/demo/demo_text_classification.html

@ -29,7 +29,7 @@
</div>
</div>
</div>
<hr>
<hr style="margin: 0.8rem 0;">
<div class="content" v-if="docs[pageNumber]">
[[ docs[pageNumber].text ]]
</div>

Loading…
Cancel
Save