From 5685daa087d65738281e174f3a64d3701b8bc984 Mon Sep 17 00:00:00 2001 From: "WANG, Chen" Date: Tue, 3 Mar 2020 15:01:17 +0800 Subject: [PATCH 01/12] Create a new demo page from docs index --- docs/index.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/index.rst b/docs/index.rst index cb7f30af41..8c9d0e05f1 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -81,3 +81,4 @@ You may find the 60-min Gluon crash course linked from there especially helpful. api/index community/index genindex + demo From 64496bd4c967265bed9841396031c401db170e56 Mon Sep 17 00:00:00 2001 From: Chen Wang Date: Tue, 3 Mar 2020 15:35:34 +0800 Subject: [PATCH 02/12] Add a new demo web page into Git --- docs/demo.rst | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 docs/demo.rst diff --git a/docs/demo.rst b/docs/demo.rst new file mode 100644 index 0000000000..d9e06a4eac --- /dev/null +++ b/docs/demo.rst @@ -0,0 +1,22 @@ +A Simple Demo for GluonNLP +========================== + +Introduction +------------ + +This demo is using MMS Server + +Demo +---- + +Please input the following into the text box: + +.. raw:: html + + ["Positive sentiment", "Negative sentiment"] +
+ + +
From 515a1bc27ab56056f0fc3e80f6760edcfd73f80b Mon Sep 17 00:00:00 2001 From: Chen Wang Date: Sun, 8 Mar 2020 13:08:49 +0800 Subject: [PATCH 03/12] Refactor on the demo folder --- docs/demo/index.rst | 7 +++++++ docs/{demo.rst => demo/sentiment.rst} | 6 +++--- docs/index.rst | 2 +- 3 files changed, 11 insertions(+), 4 deletions(-) create mode 100644 docs/demo/index.rst rename docs/{demo.rst => demo/sentiment.rst} (54%) diff --git a/docs/demo/index.rst b/docs/demo/index.rst new file mode 100644 index 0000000000..f269269827 --- /dev/null +++ b/docs/demo/index.rst @@ -0,0 +1,7 @@ +Demos +===== + +.. toctree:: + :maxdepth: 2 + + sentiment \ No newline at end of file diff --git a/docs/demo.rst b/docs/demo/sentiment.rst similarity index 54% rename from docs/demo.rst rename to docs/demo/sentiment.rst index d9e06a4eac..1c0de1f1fe 100644 --- a/docs/demo.rst +++ b/docs/demo/sentiment.rst @@ -1,10 +1,10 @@ -A Simple Demo for GluonNLP -========================== +Sentiment Analysis +================== Introduction ------------ -This demo is using MMS Server +Sentiment Analysis predicts whether an input is positive or negative. The model is based on BERT base, and are trained on the binary classification setting of the Stanford Sentiment Treebank. It achieves about 87% and 93.4% accuracy on the test set. Demo ---- diff --git a/docs/index.rst b/docs/index.rst index 8c9d0e05f1..a66ff04033 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -80,5 +80,5 @@ You may find the 60-min Gluon crash course linked from there especially helpful. examples/index api/index community/index + demo/index genindex - demo From 5ba9be761a4036bfe23e29e22cadfe96cb9a45a1 Mon Sep 17 00:00:00 2001 From: Chen Wang Date: Sun, 8 Mar 2020 17:14:44 +0800 Subject: [PATCH 04/12] Correct the accuracy; Enhance styles --- docs/demo/sentiment.rst | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/docs/demo/sentiment.rst b/docs/demo/sentiment.rst index 1c0de1f1fe..92a02ade2e 100644 --- a/docs/demo/sentiment.rst +++ b/docs/demo/sentiment.rst @@ -4,19 +4,21 @@ Sentiment Analysis Introduction ------------ -Sentiment Analysis predicts whether an input is positive or negative. The model is based on BERT base, and are trained on the binary classification setting of the Stanford Sentiment Treebank. It achieves about 87% and 93.4% accuracy on the test set. +Sentiment Analysis predicts whether an input is positive or negative. The model is based on BERT base, and are trained on the binary classification setting of the Stanford Sentiment Treebank. It achieves about 93.4% accuracy on the dev set. Demo ---- Please input the following into the text box: + ["Positive sentiment", "Negative sentiment"] + .. raw:: html - ["Positive sentiment", "Negative sentiment"] -
- - -
+
+
+ +
+ +
From f41a6bf36f0f19a62222b06cdf44fa91016cb611 Mon Sep 17 00:00:00 2001 From: Chen Wang Date: Thu, 12 Mar 2020 17:46:50 +0800 Subject: [PATCH 05/12] Add to the styles of the sentiment analysis page. --- docs/demo/sentiment.rst | 43 +++++++++++++++++++++++++++++++++++++---- 1 file changed, 39 insertions(+), 4 deletions(-) diff --git a/docs/demo/sentiment.rst b/docs/demo/sentiment.rst index 92a02ade2e..e49edcf050 100644 --- a/docs/demo/sentiment.rst +++ b/docs/demo/sentiment.rst @@ -15,10 +15,45 @@ Please input the following into the text box: .. raw:: html + +
-
- +
+
- + + +
+ Result will appear here. +
\ No newline at end of file From c734e00907405f9900d8caddde32f3c90b6f2cd7 Mon Sep 17 00:00:00 2001 From: Chen Wang Date: Thu, 12 Mar 2020 20:44:51 +0800 Subject: [PATCH 06/12] Add select input event listener for textbox --- docs/demo/sentiment.rst | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/docs/demo/sentiment.rst b/docs/demo/sentiment.rst index e49edcf050..40c29a436f 100644 --- a/docs/demo/sentiment.rst +++ b/docs/demo/sentiment.rst @@ -56,4 +56,11 @@ Please input the following into the text box:
Result will appear here. -
\ No newline at end of file +
+ + \ No newline at end of file From b5de608f61c598b5c8f4adc4cbb1726d1feb0433 Mon Sep 17 00:00:00 2001 From: Chen Wang Date: Tue, 17 Mar 2020 21:34:08 +0800 Subject: [PATCH 07/12] Change the http method to GET --- docs/demo/sentiment.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/demo/sentiment.rst b/docs/demo/sentiment.rst index 40c29a436f..aded949ed1 100644 --- a/docs/demo/sentiment.rst +++ b/docs/demo/sentiment.rst @@ -43,7 +43,7 @@ Please input the following into the text box: -
+
Enter text or - -
- -
- - +
+ +
+
Result will appear here.
\ No newline at end of file From a9cf247eb72fe05a0f57f997f9da68fecd8b622b Mon Sep 17 00:00:00 2001 From: Chen Wang Date: Wed, 18 Mar 2020 21:19:00 +0800 Subject: [PATCH 09/12] Change from element selector to id selector --- docs/demo/sentiment.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/demo/sentiment.rst b/docs/demo/sentiment.rst index f19e01f09d..3754a12c3e 100644 --- a/docs/demo/sentiment.rst +++ b/docs/demo/sentiment.rst @@ -42,7 +42,7 @@ Demo -
+
@@ -61,7 +61,7 @@ Demo $("select+div+input").click(function () { let request_url = 'http://34.222.89.17:8888/bert_sst/predict?data=["' + - $("input").val() + '"]'; + $("#input").val() + '"]'; $.ajax({ url: request_url, success: function (result) { if (result[4] === '0') From 213a4ce2e295dc7928edc0ef9a27de79389b6025 Mon Sep 17 00:00:00 2001 From: Chen Wang Date: Sat, 21 Mar 2020 08:44:54 +0800 Subject: [PATCH 10/12] Update sample sentences --- docs/demo/sentiment.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/demo/sentiment.rst b/docs/demo/sentiment.rst index 3754a12c3e..148a366ef9 100644 --- a/docs/demo/sentiment.rst +++ b/docs/demo/sentiment.rst @@ -9,7 +9,7 @@ Sentiment Analysis predicts whether an input is positive or negative. The model Demo ---- - You can either input a sentence into the textbox or select one sample from the select control. +You can either input a sentence into the textbox or select one sample from the select control. .. raw:: html @@ -38,8 +38,8 @@ Demo background-position: right .7em top 50%, 0 0; background-size: .65em auto, 100%;"> - - + +
From 3798985db9d94e93a08baeeb6e1f1ed0ab31c679 Mon Sep 17 00:00:00 2001 From: Chen Wang Date: Wed, 25 Mar 2020 09:59:13 +0800 Subject: [PATCH 11/12] Update a new default sentence --- docs/demo/sentiment.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/demo/sentiment.rst b/docs/demo/sentiment.rst index 148a366ef9..fd329cb6a5 100644 --- a/docs/demo/sentiment.rst +++ b/docs/demo/sentiment.rst @@ -38,8 +38,8 @@ You can either input a sentence into the textbox or select one sample from the s background-position: right .7em top 50%, 0 0; background-size: .65em auto, 100%;"> - - + +
From 7f9717cc5c16aee0945149b9c8bc93d139e90b09 Mon Sep 17 00:00:00 2001 From: Chen Wang Date: Thu, 2 Apr 2020 15:07:11 +0800 Subject: [PATCH 12/12] Change prediction IP to a Elastic IP --- docs/demo/sentiment.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/demo/sentiment.rst b/docs/demo/sentiment.rst index fd329cb6a5..dcec5f356a 100644 --- a/docs/demo/sentiment.rst +++ b/docs/demo/sentiment.rst @@ -60,7 +60,7 @@ You can either input a sentence into the textbox or select one sample from the s }); $("select+div+input").click(function () { - let request_url = 'http://34.222.89.17:8888/bert_sst/predict?data=["' + + let request_url = 'http://52.12.156.84:8888/bert_sst/predict?data=["' + $("#input").val() + '"]'; $.ajax({ url: request_url, success: function (result) {