{"id":6884,"date":"2018-11-09T12:32:04","date_gmt":"2018-11-09T09:32:04","guid":{"rendered":"https:\/\/ssrlab.by\/?p=6884"},"modified":"2020-12-15T12:50:44","modified_gmt":"2020-12-15T09:50:44","slug":"demanstratsyjny-servis-py","status":"publish","type":"post","link":"https:\/\/ssrlab.by\/en\/6884","title":{"rendered":"Service Demonstrator Py"},"content":{"rendered":"<p>The <strong><a href=\"https:\/\/corpus.by\/ServiceDemonstratorPy\/?lang=en\">\u00abService Demonstrator Py\u00bb<\/a><\/strong> is an implementation of the \u201cService Demonstrator\u201d in the Python programming language. This is a ready-made open-source groundwork for creating future services of the Internet platform for text and speech processing www.corpus.by. Also, the service demonstrates the possible principle of the work of future services created on its basis. The service receives electronic text. The user can select an arbitrary set of options. After clicking the button, the service displays information about which text was entered and which settings were selected.<\/p>\n<p>&nbsp;<\/p>\n<p><strong>Access to the service via the API<\/strong><\/p>\n<p>To access the service\u00a0<strong><a href=\"https:\/\/corpus.by\/ServiceDemonstratorPy\/?lang=en\">\u00abService Demonstrator Py\u00bb<\/a><\/strong> via the API, you should send an AJAX-request (type: POST) to the address https:\/\/corpus.by\/ServiceDemonstratorPy\/api. With an input array <em><strong>data\u00a0<\/strong><\/em>the following parameters are passed:<\/p>\n<ul>\n<li><strong><em>input<\/em><\/strong>\u00a0\u2014 arbitrary input text.<\/li>\n<li><em><strong>checkbox1,\u00a0checkbox2,\u00a0checkbox3<\/strong><\/em> \u2014 markers of checkbox activity; take the values <em>\u00ab0\u00bb<\/em> and \u00ab<em>1\u00bb<\/em>.<\/li>\n<li><em><strong>radio <\/strong><\/em>\u2014 active radiobuttons marker; takes values<em> \u00abradiobutton1\u00bb, \u00abradiobutton2\u00bb, \u00abradiobutton3\u00bb, \u00abradiobutton4\u00bb, \u00abradiobutton5\u00bb.<\/em><\/li>\n<li><strong><em>selector\u00a0<\/em><\/strong>\u2014 marker of the selected item in the drop-down menu; It takes values \u00ab<em>option1\u00bb, \u00aboption2\u00bb, \u00aboption3\u00bb, \u00aboption4\u00bb.<\/em><\/li>\n<\/ul>\n<p>Example of AJAX-request:<\/p>\n<blockquote><p><span style=\"font-family: 'courier new', courier, monospace; font-size: 12px;\">$.ajax({<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 12px;\">\u00a0 \u00a0type: &#8220;POST&#8221;,<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 12px;\">\u00a0 \u00a0url: &#8220;https:\/\/corpus.by\/ServiceDemonstratorPy\/api&#8221;,<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 12px;\">\u00a0 \u00a0data: {<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 12px;\">\u00a0 \u00a0 \u00a0 &#8220;input&#8221;: &#8220;\u0423\u0432\u0430\u0445\u043e\u0434\u043d\u044b \u0442\u044d\u043a\u0441\u0442.&#8221;,<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 12px;\">\u00a0 \u00a0 \u00a0 &#8220;selector&#8221;: &#8220;option1&#8221;,<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 12px;\">\u00a0 \u00a0 \u00a0 &#8220;radio&#8221;: &#8220;radiobutton2&#8221;,<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 12px;\">\u00a0 \u00a0 \u00a0 &#8220;checkbox1&#8221;: 1,<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 12px;\">\u00a0 \u00a0 \u00a0 &#8220;checkbox2&#8221;: 1,<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 12px;\">\u00a0 \u00a0 \u00a0 &#8220;checkbox3&#8221;: 1<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 12px;\">\u00a0 \u00a0},<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 12px;\">\u00a0 \u00a0origin: &#8220;*&#8221;,<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 12px;\">\u00a0 \u00a0contentType: &#8220;application\/json; charset=utf-8&#8221;,<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 12px;\">\u00a0 \u00a0headers: {<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 12px;\">\u00a0 \u00a0 \u00a0 &#8220;x-api-key&#8221; : \u201c123\u201d<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 12px;\">\u00a0 \u00a0},<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 12px;\">\u00a0 \u00a0success: function(msg){ },<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 12px;\">\u00a0 \u00a0error: function(err) { }<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 12px;\">});<\/span><\/p><\/blockquote>\n<p>The server returns a JSON-array with the following parameters:<\/p>\n<ul>\n<li><em><strong>text\u00a0<\/strong><\/em>\u2014 input text.<\/li>\n<li><em><strong>result<\/strong><\/em> \u2014 resulting text.<\/li>\n<\/ul>\n<p>For example, the following reply will be formed on the above listed AJAX-request:<\/p>\n<blockquote><p><span style=\"font-family: 'courier new', courier, monospace; font-size: 12px;\">[<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 12px;\">\u00a0 \u00a0{<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 12px;\">\u00a0 \u00a0 \u00a0 &#8220;text&#8221;: &#8220;\u0423\u0432\u0430\u0445\u043e\u0434\u043d\u044b \u0442\u044d\u043a\u0441\u0442.&#8221;,<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 12px;\">\u00a0 \u00a0 \u00a0 &#8220;result&#8221;:\u00a0<\/span><span style=\"font-family: 'courier new', courier, monospace; font-size: 12px;\">&#8220;<\/span><span style=\"font-family: 'courier new', courier, monospace; font-size: 12px;\">\u0422\u044d\u043a\u0441\u0442: \u0423\u0432\u0430\u0445\u043e\u0434\u043d\u044b \u0442\u044d\u043a\u0441\u0442.\\n\u041e\u043f\u0446\u044b\u044f: \u043e\u043f\u0446\u044b\u044f #1\\n\u041a\u043d\u043e\u043f\u043a\u0430-\u043f\u0435\u0440\u0430\u043a\u043b\u044e\u0447\u0430\u043b\u044c\u043d\u0456\u043a: \u043a\u043d\u043e\u043f\u043a\u0430-\u043f\u0435\u0440\u0430\u043a\u043b\u044e\u0447\u0430\u043b\u044c\u043d\u0456\u043a #2\\n\u0427\u044d\u043a\u0431\u043e\u043a\u0441: 1, 2, 3&#8243;<br \/>\n}<br \/>\n]<\/span><\/p><\/blockquote>\n<p>&nbsp;<\/p>\n<p><strong>Links to sources<\/strong><\/p>\n<p>Service page: <a title=\"Allophone Plotter\" href=\"https:\/\/corpus.by\/ServiceDemonstratorPy\/?lang=en\" target=\"_blank\" rel=\"noopener noreferrer\">https:\/\/corpus.by\/ServiceDemonstratorPy\/?lang=en<\/a><\/p>","protected":false},"excerpt":{"rendered":"<p>The \u00abService Demonstrator Py\u00bb is an implementation of the \u201cService Demonstrator\u201d in the Python programming language. This is a ready-made open-source groundwork for creating future services of the Internet platform for text and speech processing www.corpus.by. Also, the service demonstrates the possible principle of the work of future services created on its basis. The service [&hellip;]<\/p>\n<a class = \"excerpt\" href=\"https:\/\/ssrlab.by\/en\/6884\">Read more...<\/a>","protected":false},"author":6,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[5,290,329],"tags":[],"_links":{"self":[{"href":"https:\/\/ssrlab.by\/en\/wp-json\/wp\/v2\/posts\/6884"}],"collection":[{"href":"https:\/\/ssrlab.by\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ssrlab.by\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ssrlab.by\/en\/wp-json\/wp\/v2\/users\/6"}],"replies":[{"embeddable":true,"href":"https:\/\/ssrlab.by\/en\/wp-json\/wp\/v2\/comments?post=6884"}],"version-history":[{"count":7,"href":"https:\/\/ssrlab.by\/en\/wp-json\/wp\/v2\/posts\/6884\/revisions"}],"predecessor-version":[{"id":7613,"href":"https:\/\/ssrlab.by\/en\/wp-json\/wp\/v2\/posts\/6884\/revisions\/7613"}],"wp:attachment":[{"href":"https:\/\/ssrlab.by\/en\/wp-json\/wp\/v2\/media?parent=6884"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ssrlab.by\/en\/wp-json\/wp\/v2\/categories?post=6884"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ssrlab.by\/en\/wp-json\/wp\/v2\/tags?post=6884"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}