<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Quiw Punpun on Medium]]></title>
        <description><![CDATA[Stories by Quiw Punpun on Medium]]></description>
        <link>https://medium.com/@quiwpunpun?source=rss-dbfedeabff6a------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*C2JNmfBV5xm7e0JaB-rF6Q.jpeg</url>
            <title>Stories by Quiw Punpun on Medium</title>
            <link>https://medium.com/@quiwpunpun?source=rss-dbfedeabff6a------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 18 Nov 2026 23:04:24 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@quiwpunpun/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[How to use Artillery to perform automate testing for Amity Chat]]></title>
            <link>https://tutorials.amity.co/how-to-use-artillery-to-perform-automate-testing-for-amity-chat-daa98e1ceb7f?source=rss-dbfedeabff6a------2</link>
            <guid isPermaLink="false">https://medium.com/p/daa98e1ceb7f</guid>
            <category><![CDATA[social-cloud]]></category>
            <category><![CDATA[amity]]></category>
            <category><![CDATA[artillery]]></category>
            <dc:creator><![CDATA[Quiw Punpun]]></dc:creator>
            <pubDate>Fri, 02 Apr 2021 09:13:36 GMT</pubDate>
            <atom:updated>2021-04-02T09:13:36.410Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Automate testing</strong> is a <strong>Software testing technique to test and compare the actual outcome with the expected outcome</strong>. This can be achieved by writing test scripts or using any automation testing tool. Test automation is used to automate repetitive tasks and other testing tasks which are difficult to perform manually.</p><p>by : <a href="https://www.softwaretestinghelp.com/automation-testing-tutorial-1/">https://www.softwaretestinghelp.com/automation-testing-tutorial-1/</a></p><h3>What is objectives of automate testing ?</h3><ul><li>To reduce Testing Cost and Time.</li><li>To reduce Redundancy.</li><li>To speed up the Testing Process.</li><li>To help improve Quality.</li><li>To improve Test coverage.</li><li>To reduce Manual Intervention.</li></ul><p>by : <a href="http://www.qatutorial.com/Software_Test_Automation#:~:text=Goals%20and%20Objectives%20of%20Software,To%20help%20improve%20Quality">http://www.qatutorial.com/Software_Test_Automation#:~:text=Goals%20and%20Objectives%20of%20Software,To%20help%20improve%20Quality</a>.</p><h3>How to automate testing ?</h3><p>In this topic I will write by myself ! (lol) and we’ll follow by Topic</p><ul><li>Why Artillery ?</li><li>Prepare Artillery</li><li>Test Artillery</li><li>Create scenario</li><li>Run automate testing</li></ul><h3>Why Artillery ?</h3><p>link information <a href="https://artillery.io/docs/guides/overview/why-artillery.html">here</a> for decide your way to automate testing. But for me because it’s <strong>free </strong>and <strong>easy</strong> to use and you can <strong>load-test</strong> with this tool too.</p><p>By the way you can use whatever you want to use but for this content we’ll use Artillery for example.</p><h3>Prepare Artillery</h3><p>First of all we must to have a product for automate testing and we’ll use <a href="https://artillery.io/">Artillery</a> for automate testing. Product I will use<strong> Amity Chat</strong> (1 of <a href="https://www.amity.co/about">Amity </a>product) If you don’t have product for test I’m sorry you must have. In this time let install <strong>Nodejs </strong>I recommend <strong>version 12+ (</strong>Artillery <strong>require)</strong></p><p><strong>I have 2 choices for install Nodejs ! for long term I suggest solution nvm.</strong><em> *** if you want to use more than one version I recommend install “nvm” !!!</em></p><h4>1. Solution NVM</h4><p><strong>link download : </strong><a href="https://github.com/coreybutler/nvm-windows"><strong>https://github.com/coreybutler/nvm-windows</strong></a></p><p>( If installed nvm you can use command for install nodejs v.12 )</p><pre>nvm install 12.0.0</pre><p>and use version 12</p><pre>nvm use 12.0.0</pre><h4>2. Solution Install only Nodejs v12</h4><p><strong>link download : </strong><a href="https://nodejs.org/en/download/"><strong>https://nodejs.org/en/download/</strong></a></p><p>and then install Artillery with this command (<a href="https://artillery.io/docs/guides/getting-started/installing-artillery.html">more information</a>)</p><pre>RUN npm install -g artillery --allow-root --unsafe-perm=true</pre><p>Now test this command</p><pre>artillery</pre><p>If result look like below image we’re done on process prepare.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*voKAmKFAiVL8nz5r25tD8w.png" /><figcaption>run command artillery</figcaption></figure><h3>Test artillery</h3><p>Create file name test.yaml and copy code to the file then save it.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/590beafa973c01a0cb2c7a3ba30ddd80/href">https://medium.com/media/590beafa973c01a0cb2c7a3ba30ddd80/href</a></iframe><p>and run command here.</p><pre>artillery run test.yaml</pre><p>Your terminal must me like this.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/503/1*L0S6VfTlu0Ijvf2epCJgvA.png" /><figcaption>terminal</figcaption></figure><p>and then when Artillery finish it’ll show like this but maybe result not same.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/338/1*6ir7cSKUoftzoMmnMOxa1g.png" /></figure><p><strong>What we just did it ?</strong></p><p>We just test GET <a href="https://google.com/">www.google.com</a> with 2000 VUs (Visual Users) in 200 seconds ! If you want to know command of Artillery more <a href="https://artillery.io/docs/guides/guides/command-line.html">Click Here!</a> But I will always explain what I do.</p><ol><li><strong>If you want to have report you can use -o like this</strong></li></ol><pre>artillery run test.yaml -o result.json</pre><p>Artillery will create result JSON for you</p><p>2.<strong> If you think JSON very hard to read Artillery can create HTML for visualize report</strong></p><pre>artillery report result.json -o result.html</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Hf8gwvAJigVhwNHKW47TPQ.png" /></figure><p>3. <strong>How to generate VUs ?</strong></p><p>duration for how many time to generate VUs</p><p>arrivalCount such as…</p><pre>duration : 10<br>arrivalCount : 10</pre><p>is mean create 10 VUs in 10 sec (1 VU/s)</p><p>arrivalRate such as…</p><pre>duration : 10<br>arrivalRate : 10</pre><p>this means create 10 VUs/s</p><p>and in arrivalRate you can use rampTo such as…</p><pre>duration : 10<br>arrivalRate : 10<br>rampTo : 20</pre><p>this means 1st second will create 10 VUs/s until 10th second will create 20VUs/s</p><p>You can adapt phase like this</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/d138f4b9dd77c1b8eff8cde662db9dee/href">https://medium.com/media/d138f4b9dd77c1b8eff8cde662db9dee/href</a></iframe><p>This means we create 10 VUs in 20 second then create 10VUs/sec and ramp to 20VUs/s in 20 second then create 20VUs/s and ramp to 10 VUs/second in 30 second</p><p>4. <strong>How to create scenarios ?</strong></p><p>Artillery can<strong> GET / POST / PUT / PATCH / DELETE </strong>requests and also use <strong>socketio , websocket</strong></p><p>I sorry for I don’t have example because it’s so long story but you can check it <a href="https://artillery.io/docs/guides/guides/http-reference.html">here </a>!</p><p>I have a little bit example for you ! ;)</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/ef5fba3edb861be6486003d3d6d07b7d/href">https://medium.com/media/ef5fba3edb861be6486003d3d6d07b7d/href</a></iframe><h3>Create scenario</h3><p>Amity Social Cloud mainly utilizes Socket.io as the main communication engine, however socket.io engine of Artillery does not support the scenario we want to create, therefore we will use <a href="https://artillery.io/docs/guides/plugins/plugin-expectations-assertions.html">plugin-expect</a> and <a href="https://artillery.io/docs/guides/guides/socketio-reference.html">acknowledge</a> to check status code.</p><p>We can create 2 scenarios on one script and use weight to split Virtual users up into multiple groups. For example if I want 15,000 VUs run on first scenario and 5,000 VUs run on second scenario the calculation should be as followed:</p><p>=&gt; 20,000/4 = 5,000 VUs</p><p>therefore weight of first scenario is 3</p><p>weight of second scenario is 1</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/111464cb5077c3f5e83ad81e1d780aa5/href">https://medium.com/media/111464cb5077c3f5e83ad81e1d780aa5/href</a></iframe><p>and then Run !!!</p><p>Check your result.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0cpB7cddppRa-5Ea2OuAgA.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=daa98e1ceb7f" width="1" height="1" alt=""><hr><p><a href="https://tutorials.amity.co/how-to-use-artillery-to-perform-automate-testing-for-amity-chat-daa98e1ceb7f">How to use Artillery to perform automate testing for Amity Chat</a> was originally published in <a href="https://tutorials.amity.co/">Amity Developers</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[มือใหม่สร้างเว็บง่าย ๆ ด้วย Bootstrap !!!]]></title>
            <link>https://quiwpunpun.medium.com/%E0%B8%A1%E0%B8%B7%E0%B8%AD%E0%B9%83%E0%B8%AB%E0%B8%A1%E0%B9%88%E0%B8%AA%E0%B8%A3%E0%B9%89%E0%B8%B2%E0%B8%87%E0%B9%80%E0%B8%A7%E0%B9%87%E0%B8%9A%E0%B8%87%E0%B9%88%E0%B8%B2%E0%B8%A2-%E0%B9%86-%E0%B8%94%E0%B9%89%E0%B8%A7%E0%B8%A2-bootstrap-a86ebe6a19f9?source=rss-dbfedeabff6a------2</link>
            <guid isPermaLink="false">https://medium.com/p/a86ebe6a19f9</guid>
            <category><![CDATA[web-basic]]></category>
            <category><![CDATA[web]]></category>
            <category><![CDATA[login]]></category>
            <category><![CDATA[bootstrap]]></category>
            <category><![CDATA[web-bootstrap]]></category>
            <dc:creator><![CDATA[Quiw Punpun]]></dc:creator>
            <pubDate>Sun, 24 Jan 2021 17:32:06 GMT</pubDate>
            <atom:updated>2021-01-24T17:32:06.133Z</atom:updated>
            <content:encoded><![CDATA[<h3>มือใหม่สร้างเว็บง่าย ๆ ด้วย Bootstrap !!!</h3><h3>วันนี้ผมจะมาสอนเขียนเว็บง่าย ๆ ด้วย Bootstrap !!<br>มาลุยกันเลย !!</h3><p>** สำหรับมือใหม่ ! มือเก๋ามีอะไรแนะนำ Comment ไว้เลยยยยยยย ขอบคุณล่วงหน้าครับผม **</p><h3>สิ่งที่ต้องมี !</h3><ol><li>VSCode =&gt; ไว้เขียน Code ใครมีตัวที่ถนัด ใช้ที่ถนัดได้เลยเด้อ ! <a href="https://code.visualstudio.com/download">download</a></li><li>AppServ =&gt; หลากหลายประโยชน์มาก แต่หลัก ๆ ผมเอาไว้เปิดเว็บที่ตัวเองเขียน ! <a href="https://www.appserv.org/en/download/">download</a></li></ol><h3>วิธีลงทั้ง 2 ตัวยากหน่อย</h3><ol><li>เปิด .exe ที่โหลดมา</li><li>กด Next…</li><li>กด Next…</li><li>กด Next…</li><li>กด Next…</li></ol><h3><strong>และก็ Next ไปนั่นแหละครับ 55555555</strong></h3><p>(ใครมีปัญหา ทัก Facebook มาก็ได้ครับขั้นตอน Setup Quiw Punpun)</p><h3>เอาหล่ะเริ่ม !</h3><p>เปิด VSCode แล้วทำตามรูปเลยเด้อ</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*87lIQu-g5Eug1fFjQwu5eQ.jpeg" /><figcaption>เปิด VSCode</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4Yo9wO2UdJMyMWIihglirg.jpeg" /><figcaption>กดที่ Add Folder to Workspace…</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dT5_eaL8Ybu4vgqumhDc2g.jpeg" /><figcaption>ไปที่ที่เราลง AppServ ส่วนใหญ่จะอยู่ที่ไดรฟ์ C:/AppServ</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FxeJqIJsIeqzEV64o1V01w.jpeg" /><figcaption>กดที่ www และ Add</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3SDmsj9UCG7JOlo12HwunA.jpeg" /><figcaption>Folder www จะถูกนำเข้ามาใช้ที่ VSCode</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2NzIX44fo60_RCrklEV6VA.jpeg" /><figcaption>คลิกขวาที่ Folder www และเลือก New Folder</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9Eqo09TT5QmM91S_Z3yT3w.jpeg" /><figcaption>ตั้งชื่อ Folder และ Enter จะได้ Folder ใหม่</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Af5cPeivQtXK2MpAdSRmXg.jpeg" /><figcaption>คลิกขวาที่ Folder ที่เราพึ่งสร้าง เลือก New File</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*i4z1e1p1XDZuPxnA2E9szg.jpeg" /><figcaption>ตั้งชื่อ File index.html</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cSnqgTE_4MpdsXAXTrC9tA.jpeg" /><figcaption>Save File</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*s01znRimqRi2stNv4wYFbA.jpeg" /><figcaption>เปิดเว็บที่เราพึ่งสร้างขึ้น</figcaption></figure><h3>หากใครมาถึงขั้นตอนนี้แล้ว ยินดีด้วยคุณสร้างเว็บของตัวเองได้แล้ว !!</h3><h3>เอาหล่ะต่อมา มาทำให้มันสวยขึ้นด้วย Bootstrap !!</h3><p>Copy Code นี้ไปไว้ที่ไฟล์ index.html ของคุณได้เลย ! และอย่าลืม Ctrl + S (Save)</p><p>** ไม่ต้องเหลือข้อความที่ใส่ไปนะ**</p><pre>&lt;!doctype html&gt;<br>&lt;html lang=&quot;en&quot;&gt;<br>  &lt;head&gt;<br>    &lt;!-- Required meta tags --&gt;<br>    &lt;meta charset=&quot;utf-8&quot;&gt;<br>    &lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1&quot;&gt;<br><br>    &lt;!-- Bootstrap CSS --&gt;<br>    &lt;link href=&quot;https://cdn.jsdelivr.net/npm/bootstrap@5.0.0-beta1/dist/css/bootstrap.min.css&quot; rel=&quot;stylesheet&quot; integrity=&quot;sha384-giJF6kkoqNQ00vy+HMDP7azOuL0xtbfIcaT9wjKHr8RbDVddVHyTfAAsrekwKmP1&quot; crossorigin=&quot;anonymous&quot;&gt;<br><br>    &lt;title&gt;Hello, world!&lt;/title&gt;<br>  &lt;/head&gt;<br>  &lt;body&gt;<br>    &lt;h1&gt;Hello, world!&lt;/h1&gt;<br><br>   <br><br>    &lt;!-- Bootstrap Bundle with Popper --&gt;<br>    &lt;script src=&quot;https://cdn.jsdelivr.net/npm/bootstrap@5.0.0-beta1/dist/js/bootstrap.bundle.min.js&quot; integrity=&quot;sha384-ygbV9kiqUc6oa4msXn9868pTtWMgiQaeYH7/t7LECLbyPA2x65Kgf80OJFdroafW&quot; crossorigin=&quot;anonymous&quot;&gt;&lt;/script&gt;<br><br>    <br>  &lt;/body&gt;<br>&lt;/html&gt;</pre><p>Ref Code : <a href="https://getbootstrap.com/docs/5.0/getting-started/introduction/">https://getbootstrap.com/docs/5.0/getting-started/introduction/</a></p><h3><strong>ตอนนี้เราได้เริ่มต้นใช้ Bootstrap เรียบร้อยแล้ว !</strong></h3><p>ต่อมา เราจะมาทำ Front-end Login ง่าย ๆ กัน หน้าตาจะเป็นประมาณนี้นะครับ</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JJ2y5_qtDFbRMMKIhgZwjw.jpeg" /></figure><p>ก่อนอื่นเราจะรู้จัก Html กันสักเล็กน้อย</p><p><strong>HTML </strong>ย่อมาจาก <strong>Hypertext Markup Language</strong> เป็นภาษาคอมพิวเตอร์รูปแบบหนึ่ง ที่มีโครงสร้างการเขียนโดยอาศัยตัวกำกับ (Tag) ควบคุมการแสดงผลข้อความ รูปภาพ หรือวัตถุ อื่น ๆ ผ่านโปรแกรมเบราเซอร์</p><p>Ref : <a href="https://sites.google.com/site/somyongregina/academic/hnwy-kar-reiyn-ru-thi-1/html-languae">https://sites.google.com/site/somyongregina/academic/hnwy-kar-reiyn-ru-thi-1/html-languae</a></p><p><strong>Tag </strong>ที่ว่านั้นก็คือ <strong>&lt;html&gt;&lt;/html&gt;</strong> หรือ <strong>&lt;body&gt;&lt;/body&gt;</strong> หรือ <strong>&lt;head&gt;&lt;/head&gt;</strong> หรืออื่น ๆ ที่มี <strong>&lt;&gt;&lt;/&gt;</strong> หรือบางอันจะเป็น <strong>&lt;/&gt;</strong> เลย</p><p>ทีนี้ Code ที่เรามีตอนนี้ ที่ Bootstrap นำมาให้ Copy วางนั้น เป็น Code พื้นฐานที่ทุกเว็บต้องมีหากใช้ Bootstrap อยู่แล้ว ต่อมาเราจะมาลองใช้ Bootstrap อื่น ๆ กัน</p><p>ก่อนอื่นเราจะสร้างสี่เหลี่ยมกรอบด้วย <strong>&lt;div&gt;&lt;/div&gt;</strong> ก่อน</p><pre>&lt;div class=&quot;d-flex justify-content-center align-items-center mt-5 mb-5 w-100&quot;&gt;<br>   &lt;div style=&quot; width: 800px; border: 1px solid black; padding: 50px;&quot;&gt;&lt;/div&gt;<br>&lt;/div&gt;</pre><p>div ด้านนอกที่ผมให้มานั้น จะเป็นกรอบรอบนอก ซึ่งจะมีการ display ข้อมูลเป็น flex โดยให้ content ด้านในอยู่ตรงกลาง ทั้งในแนวแกนตั้ง และแนวนอน</p><p>การใช้ bootstrap เราจะใช้ class ในการเรียก style ต่าง ๆ ครับ ตรงนี้</p><pre><strong>d-flex justify-content-center align-items-center mt-5 mb-5 w-100</strong></pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aGUN-i6vkWzIbHEuUWf3ig.png" /></figure><pre><strong>d-flex = display flex<br>justify-content-center = items ต่าง ๆ อยู่อยู่ใน tag นี้ อยู่ตรงกลางแนวนอน<br>align-items-center = items ต่าง ๆ อยู่อยู่ใน tag นี้ อยู่ตรงกลางแนวตั้ง<br>ดูเพิ่มเติมที่ </strong><a href="https://getbootstrap.com/docs/5.0/utilities/flex/">https://getbootstrap.com/docs/5.0/utilities/flex/</a></pre><pre><strong>ส่วน mt-5 , mb-5 คือ margin-top และ margin-bottom หรือ คือการห่างจากด้าน<br>บน และห่างจากด้านล่าง นั่นเอง และ w-100 คือ width 100%<br>ดูเพิ่มเติมได้ที่</strong> <a href="https://getbootstrap.com/docs/5.0/utilities/spacing/#gap">https://getbootstrap.com/docs/5.0/utilities/spacing/#gap</a></pre><p>ส่วน div ด้านในนั้นเราจะทำการสร้างตามที่เราอยากได้ โดยการใช้ style และเขียนด้วย css ขึ้นมา</p><pre>&lt;div style=&quot;width: 800px; border: 1px solid black; padding: 50px;&quot;&gt;&lt;/div&gt;</pre><p>ซึ่งความหมายของ css ในแต่ละตัวนั้นคือ</p><pre>width: 800px; กว้าง 800 pixel<br>border: 1px solid black; กรอบหนา 1 pixel แบบ solid สีดำ<br>padding: 50px; content ด้านในห่างจากกรอบ 50 pixel (ทุกด้าน ซ้าย ขวา บน ล่าง)</pre><p>หากใครงงเรื่อง margin , padding รูปนี้จะอธิบายท่านได้</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/861/1*3D4xGMtN1pY_HMUjL2icPQ.png" /><figcaption>อธิบาย margin — padding</figcaption></figure><p>ต่อมาเราจะเอา Content ของ Bootstrap มาใส่ใน div ด้านในกัน เลือกกันได้เลยที่ Web นี้ <a href="https://getbootstrap.com/docs/5.0/getting-started/introduction/">https://getbootstrap.com/docs/5.0/getting-started/introduction/</a></p><h3>จะมี Code ให้เราเลือก Copy ได้เพียบ !</h3><p>แต่หากทำตามผม ผมให้ Copy อันนี้ครับ</p><pre>&lt;form&gt;<br>  &lt;div class=&quot;mb-3&quot;&gt;<br>    &lt;label for=&quot;exampleInputEmail1&quot; class=&quot;form-label&quot;&gt;Email address&lt;/label&gt;<br>    &lt;input type=&quot;email&quot; class=&quot;form-control&quot; id=&quot;exampleInputEmail1&quot; aria-describedby=&quot;emailHelp&quot;&gt;<br>    &lt;div id=&quot;emailHelp&quot; class=&quot;form-text&quot;&gt;We&#39;ll never share your email with anyone else.&lt;/div&gt;<br>  &lt;/div&gt;<br>  &lt;div class=&quot;mb-3&quot;&gt;<br>    &lt;label for=&quot;exampleInputPassword1&quot; class=&quot;form-label&quot;&gt;Password&lt;/label&gt;<br>    &lt;input type=&quot;password&quot; class=&quot;form-control&quot; id=&quot;exampleInputPassword1&quot;&gt;<br>  &lt;/div&gt;<br>  &lt;div class=&quot;mb-3 form-check&quot;&gt;<br>    &lt;input type=&quot;checkbox&quot; class=&quot;form-check-input&quot; id=&quot;exampleCheck1&quot;&gt;<br>    &lt;label class=&quot;form-check-label&quot; for=&quot;exampleCheck1&quot;&gt;Check me out&lt;/label&gt;<br>  &lt;/div&gt;<br>  &lt;button type=&quot;submit&quot; class=&quot;btn btn-primary&quot;&gt;Submit&lt;/button&gt;<br>&lt;/form&gt;</pre><p><strong>นำไปใส่ใน tag &lt;div&gt; ด้านในของเรา</strong></p><p>จะได้ประมาณนี้ครับ (ผมตกแต่งเพิ่มไปนิดหน่อย)</p><pre>&lt;body&gt;<br>&lt;h1&gt;Hello, world!&lt;/h1&gt;<br>&lt;div class=&quot;d-flex justify-content-center align-items-center mt-5 mb-5 w-100&quot;&gt;<br>&lt;div class=&quot;block-style&quot;&gt;<br>&lt;h1&gt;Hello, world!&lt;/h1&gt;<br>&lt;hr&gt;<br>&lt;form&gt;</pre><pre>&lt;div class=&quot;mb-3&quot;&gt;</pre><pre>&lt;label for=&quot;exampleInputEmail1&quot; class=&quot;form-label&quot;&gt;Email address&lt;/label&gt;</pre><pre>&lt;input type=&quot;email&quot; class=&quot;form-control&quot; id=&quot;exampleInputEmail1&quot; aria-describedby=&quot;emailHelp&quot;&gt;</pre><pre>&lt;div id=&quot;emailHelp&quot; class=&quot;form-text&quot;&gt;We&#39;ll never share your email with anyone else.&lt;/div&gt;</pre><pre>&lt;/div&gt;</pre><pre>&lt;div class=&quot;mb-3&quot;&gt;</pre><pre>&lt;label for=&quot;exampleInputPassword1&quot; class=&quot;form-label&quot;&gt;Password&lt;/label&gt;</pre><pre>&lt;input type=&quot;password&quot; class=&quot;form-control&quot; id=&quot;exampleInputPassword1&quot;&gt;</pre><pre>&lt;/div&gt;</pre><pre>&lt;div class=&quot;mb-3 form-check&quot;&gt;</pre><pre>&lt;input type=&quot;checkbox&quot; class=&quot;form-check-input&quot; id=&quot;exampleCheck1&quot;&gt;</pre><pre>&lt;label class=&quot;form-check-label&quot; for=&quot;exampleCheck1&quot;&gt;Check me out&lt;/label&gt;</pre><pre>&lt;/div&gt;</pre><pre>&lt;button type=&quot;submit&quot; class=&quot;btn btn-primary w-100&quot;&gt;Submit&lt;/button&gt;</pre><pre>&lt;/form&gt;<br>&lt;/div&gt;<br>&lt;/div&gt;</pre><p>จากนั้นลอง Save แล้วก็เปิดที่ localhost/myweb ของทุกคนได้เลยยยย หน้าตาจะเป็นแบบนี้เลยย</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HZXOa8ECHghRcCdCuHb7xQ.jpeg" /></figure><p>Code โดยรวมจะเป็นแบบนี้นะครับ</p><pre>&lt;!doctype html&gt;<br>&lt;html lang=&quot;en&quot;&gt;<br>&lt;head&gt;<br>&lt;!-- Required meta tags --&gt;</pre><pre>&lt;meta charset=&quot;utf-8&quot;&gt;</pre><pre>&lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1&quot;&gt;&lt;!-- Bootstrap CSS --&gt;&lt;link href=&quot;https://cdn.jsdelivr.net/npm/bootstrap@5.0.0-beta1/dist/css/bootstrap.min.css&quot; rel=&quot;stylesheet&quot; integrity=&quot;sha384-giJF6kkoqNQ00vy+HMDP7azOuL0xtbfIcaT9wjKHr8RbDVddVHyTfAAsrekwKmP1&quot; crossorigin=&quot;anonymous&quot;&gt;&lt;title&gt;Hello, world!&lt;/title&gt;<br>&lt;style&gt;<br>.block-style {</pre><pre>width: 800px;</pre><pre>border: 1px solid black;</pre><pre>padding: 50px;</pre><pre>}</pre><pre>&lt;/style&gt;</pre><pre>&lt;/head&gt;<br>&lt;body&gt;<br>&lt;div class=&quot;d-flex justify-content-center align-items-center mt-5 mb-5 w-100&quot;&gt;</pre><pre>&lt;div class=&quot;block-style&quot;&gt;</pre><pre>&lt;h1&gt;Hello, world!&lt;/h1&gt;</pre><pre>&lt;hr&gt;</pre><pre>&lt;form&gt;</pre><pre>&lt;div class=&quot;mb-3&quot;&gt;</pre><pre>&lt;label for=&quot;exampleInputEmail1&quot; class=&quot;form-label&quot;&gt;Email address&lt;/label&gt;</pre><pre>&lt;input type=&quot;email&quot; class=&quot;form-control&quot; id=&quot;exampleInputEmail1&quot; aria-describedby=&quot;emailHelp&quot;&gt;</pre><pre>&lt;div id=&quot;emailHelp&quot; class=&quot;form-text&quot;&gt;We&#39;ll never share your email with anyone else.&lt;/div&gt;</pre><pre>&lt;/div&gt;</pre><pre>&lt;div class=&quot;mb-3&quot;&gt;</pre><pre>&lt;label for=&quot;exampleInputPassword1&quot; class=&quot;form-label&quot;&gt;Password&lt;/label&gt;</pre><pre>&lt;input type=&quot;password&quot; class=&quot;form-control&quot; id=&quot;exampleInputPassword1&quot;&gt;</pre><pre>&lt;/div&gt;</pre><pre>&lt;div class=&quot;mb-3 form-check&quot;&gt;</pre><pre>&lt;input type=&quot;checkbox&quot; class=&quot;form-check-input&quot; id=&quot;exampleCheck1&quot;&gt;</pre><pre>&lt;label class=&quot;form-check-label&quot; for=&quot;exampleCheck1&quot;&gt;Check me out&lt;/label&gt;</pre><pre>&lt;/div&gt;</pre><pre>&lt;button type=&quot;submit&quot; class=&quot;btn btn-primary w-100&quot;&gt;Submit&lt;/button&gt;</pre><pre>&lt;/form&gt;</pre><pre>&lt;/div&gt;</pre><pre>&lt;/div&gt;</pre><pre>&lt;!-- Optional JavaScript; choose one of the two! --&gt;</pre><pre>&lt;!-- Option 1: Bootstrap Bundle with Popper --&gt;<br>&lt;script src=&quot;https://cdn.jsdelivr.net/npm/bootstrap@5.0.0-beta1/dist/js/bootstrap.bundle.min.js&quot;</pre><pre>integrity=&quot;sha384-ygbV9kiqUc6oa4msXn9868pTtWMgiQaeYH7/t7LECLbyPA2x65Kgf80OJFdroafW&quot;</pre><pre>crossorigin=&quot;anonymous&quot;&gt;&lt;/script&gt;</pre><pre>&lt;/body&gt;</pre><pre>&lt;/html&gt;</pre><p>เอาหล่ะมาถึงตรงนี้ หากสงสัยตรงไหนถามมาได้เลยนะครับ สำหรับ “การใช้ Bootstrap” สรุปว่ามันใช้ Class ในการเรียก Style ต่าง ๆ ซึ่งจริง ๆ มีให้เลือกใช้อีกมาก ๆ เลย ทั้งการ Validation คำตอบ และการนำ Javascript มาช่วยเพิ่มความ Cool !</p><h3>แต่เราจะมาต่อกันใน Part หน้าสำหรับ</h3><h3>“การทำ ระบบ Login“</h3><p>สำหรับวันนี้ไปก่อนแล้วครับ ขอบคุณครับผมมมมม</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a86ebe6a19f9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[เมื่อบอทตอบไม่ได้ ทำยังไงดีนะ]]></title>
            <link>https://medium.com/convolab/%E0%B9%80%E0%B8%A1%E0%B8%B7%E0%B9%88%E0%B8%AD%E0%B8%9A%E0%B8%AD%E0%B8%97%E0%B8%95%E0%B8%AD%E0%B8%9A%E0%B9%84%E0%B8%A1%E0%B9%88%E0%B9%84%E0%B8%94%E0%B9%89-%E0%B8%97%E0%B8%B3%E0%B8%A2%E0%B8%B1%E0%B8%87%E0%B9%84%E0%B8%87%E0%B8%94%E0%B8%B5%E0%B8%99%E0%B8%B0-87c14514acf2?source=rss-dbfedeabff6a------2</link>
            <guid isPermaLink="false">https://medium.com/p/87c14514acf2</guid>
            <category><![CDATA[convolab]]></category>
            <category><![CDATA[chatbots]]></category>
            <dc:creator><![CDATA[Quiw Punpun]]></dc:creator>
            <pubDate>Fri, 06 Sep 2019 15:09:40 GMT</pubDate>
            <atom:updated>2019-09-06T15:09:40.988Z</atom:updated>
            <content:encoded><![CDATA[<p>ปัจจุบัน ในองค์กรใหญ่ ๆ บริษัท Enterprise ต่าง ๆ ที่รู้จัก Chatbot เป็นอย่างดี จะเข้าใจว่า Chatbot คืออะไร ทำได้ประมาณไหน และจุดประสงค์เพื่ออะไร</p><p>ซึ่งหากใครมองว่า Chatbot จะมาแทน Agent , Operator หรือ Call Center จากประสบการณ์ของผมนั้น Chatbot ไม่ได้มาแย่งงานอาชีพเหล่านี้ เพียงแต่สามารถลดคำถามที่ ซ้ำ ๆ บ่อย ๆ ได้ เมื่อมีคำถามยาว ๆ รายละเอียดลงลึก แน่นอนว่าบอทตอบไม่ได้แน่นอน แต่เมื่อบอทตอบไม่ได้ เราจะทำอย่างไรกับ User ที่เข้ามาคุยกับบอทของเรา</p><p>การที่บอทตอบไม่ได้มี 5 สาเหตุ</p><ol><li>เทรนบอทไม่เพียงพอ กรณีนี้ให้เพิ่ม sample เข้าไปก็เป็นใช้ได้ครับ</li><li>คำถามเป็นคำถามยาวมาก ใน 1 ข้อความ กรณีนี้หากจำนวนตัวอักษรเยอะขนาด 1,000 ตัวอักษร บอทตอบไม่ได้ถือเป็นเรื่องปกติ</li><li>User เข้ามาลองเล่น โดยไม่ได้เข้าใจจุดประสงค์ของบอท กรณีนี้เกิดจากบอทไม่ได้มีการแนะนำตัวเอง เป็นหน้า chat โล่ง ๆ</li><li>Intent ไม่ได้ผูกกับคำตอบใด ๆ เลย กรณีนี้เพียงแค่ใส่คำตอบลงไปครับ</li><li>ระบบล่ม ไฟดับ กรณีนี้เกินคาด 55555</li></ol><p>ซึ่งทั้ง 5 สาเหตุควรมีการตอบสนอง User ไม่ให้เคว้ง งงงวยว่าสรุปฉันต้องทำไงกับบอทตัวนี้ดี โดย</p><ol><li>บอทตอบกลับว่า เราทำแบบนี้ได้นะลองพิมพ์แบบนี้สิ และมีเมนูให้เลือกเพิ่มเติม</li><li>ส่งต่อ Agent เลย</li><li>บอทถาม คุณหมายถึงสิ่งนี้หรือเปล่า</li></ol><p>ทั้ง 3 แบบนี้ขึ้นอยู่กับเจ้าของบอทเอง</p><p>เช่น ถ้าเจ้าของอยากให้ ไม่เข้าใจก็คุยกับ Agent เลย ก็ส่งไม้ต่อให้ Agent</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/454/1*mc5Btdk3579nkdHw8N05xA.png" /></figure><p>หรือ อยากให้ตอบไม่ได้สัก 3 ครั้งค่อยส่งต่อ</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/454/1*v3iKr66NmAzhYLmW-Q9eQQ.png" /></figure><p>หรือ ส่งคำแนะนำบอทไปเลยว่าบอททำอะไรได้</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/454/1*_sXIMmFwfIRXaJlA79M4dg.png" /></figure><p>หรือถาม User ว่าที่คุณมาน่ะต้องการอะไร</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nQO98dDhKQNIQoWe2RZsAQ.jpeg" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=87c14514acf2" width="1" height="1" alt=""><hr><p><a href="https://medium.com/convolab/%E0%B9%80%E0%B8%A1%E0%B8%B7%E0%B9%88%E0%B8%AD%E0%B8%9A%E0%B8%AD%E0%B8%97%E0%B8%95%E0%B8%AD%E0%B8%9A%E0%B9%84%E0%B8%A1%E0%B9%88%E0%B9%84%E0%B8%94%E0%B9%89-%E0%B8%97%E0%B8%B3%E0%B8%A2%E0%B8%B1%E0%B8%87%E0%B9%84%E0%B8%87%E0%B8%94%E0%B8%B5%E0%B8%99%E0%B8%B0-87c14514acf2">เมื่อบอทตอบไม่ได้ ทำยังไงดีนะ</a> was originally published in <a href="https://medium.com/convolab">ConvoLab</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[[Solution] IT Support Chatbot]]></title>
            <link>https://medium.com/convolab/solution-it-support-chatbot-44b8e34b34cc?source=rss-dbfedeabff6a------2</link>
            <guid isPermaLink="false">https://medium.com/p/44b8e34b34cc</guid>
            <category><![CDATA[solutions]]></category>
            <category><![CDATA[convolab]]></category>
            <category><![CDATA[chatbots]]></category>
            <category><![CDATA[chatbots-for-business]]></category>
            <category><![CDATA[chatbot-development]]></category>
            <dc:creator><![CDATA[Quiw Punpun]]></dc:creator>
            <pubDate>Sun, 23 Jun 2019 02:01:02 GMT</pubDate>
            <atom:updated>2019-06-23T02:01:02.101Z</atom:updated>
            <content:encoded><![CDATA[<p>หากจะสร้าง IT Support Chatbot สำหรับภายในองค์กร หน้าตาจะเป็นแบบไหนนะ</p><p>สวัสดีครับ ผม คิว Solution Specialist จาก Convolab จะมานำเสนอ เกี่ยวกับการสร้างแชทบอทให้กับ ธุรกิจ ไม่ว่าภายใน ภายนอก ให้เป็นแนวทางครับ</p><p>วันนี้จะขอนำเสนอว่าด้วยเรื่อง Chatbot IT Support</p><p>เคยเห็นฝ่าย IT Support บ่นมั่งไหมครับว่า งานก็เยอะอยู่แล้ว แต่แผนกอื่นก็มักจะมีปัญหาเกี่ยวกับคอมพิวเตอร์มาถาม ไม่ว่าจะเป็น คอมพ์ไม่ติด,หน้าจอไม่ติด,error 404 Not found,จอฟ้า หรือแม้กระทั่ง เครื่องปริ้นใช้ยังไง</p><p>ซึ่งปัญหาเหล่านี้เป็นปัญหาที่ คำตอบจะเป็นแบบเดิม ๆ เช่น</p><p>คอมพ์ไม่ติด — เช็คปลั๊กเสียบหรือยัง เสียบแล้วได้กดสวิซท์ไฟที่ปลั๊กพ่วงหรือยัง ได้เปิด power supply หลังเครื่องหรือยัง ถ้าเปิดหมดแล้ว งั้นก็ต้องเช็คภายในเคสใช่ไหมครับ</p><p>หรือ Error ต่าง ๆ ที่ขึ้นมา และมีข้อความบอกเสมอว่า Error เพราะอะไร แต่ user ไม่ได้อ่าน หรืออาจจะไม่เข้าใจ ก็เรียก</p><p>จะดีกว่าไหมถ้า Chatbot สามารถช่วยเรื่องเหล่านี้ได้เช่น</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*iokkH0f7KLpJaEfbVdBqmA.gif" /></figure><p>user : คอมไม่ติดอะ</p><p>bot : ลองเช็คว่าเสียบปลั๊กหรือยังครับ</p><p>user : เสียบแล้ว</p><p>bot : งั้นลองเช็คสวิทช์หลังเครื่องหน่อยนะครับ ว่าได้เปิดไว้หรือป่าว</p><p>user : ทำหมดแล้ววว</p><p>bot : งั้นเดี๋ยว ทางเราจะไปดูให้นะครับ 😊</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*q0kOtFmZ36h3Zk07uN5TYQ.gif" /></figure><p>หรือ หากมีการปรากฏหน้าจอ Error</p><p>user : คอม error ช่วยดูให้หน่อย</p><p>bot : ส่งรูปมาให้ดูหน่อยสิ</p><p>user : [Image]</p><p>bot : Error xxx เกิดจาก ……. ลองทำตามนี้ดูนะครับ</p><p>การสร้างบอทสำหรับ IT Support นั้นมีจุดประสงค์เพื่อให้คนภายในองค์กรที่มีปัญหาเบื้องต้นเกี่ยวกับคอมพิวเตอร์ที่เป็นคำตอบเดิม ๆ มาตอบแทนฝ่าย IT Support ที่ปกติต้องเดินไปเดินมา แผนกต่าง ๆ จนงานตัวเองไม่ได้ทำ ดังนั้นการทำบอทของ IT Support จะไม่ได้มี Feature หวือหวา แต่จะเน้น Conversation ที่ถามเกี่ยวกับปัญหาคอมพิวเตอร์ แล้วตอบได้นั่นเอง แต่ทั้งนี้ทั้งนั้นอย่าลืมว่า Chatbot นั้นไม่ได้ฉลาดจนสามารถแก้ไขปัญหาได้ครอบจักรวาลจนไม่ต้องมีคนคอยหนุนหลัง หากอะไรที่บอทตอบไม่ได้ หน้าที่ของบอทคือส่งต่อให้กับฝ่าย IT Support ไปช่วยดูอาการคอมพิวเตอร์นั่นเอง</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=44b8e34b34cc" width="1" height="1" alt=""><hr><p><a href="https://medium.com/convolab/solution-it-support-chatbot-44b8e34b34cc">[Solution] IT Support Chatbot</a> was originally published in <a href="https://medium.com/convolab">ConvoLab</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[วิธีสร้าง Chatbot ด้วย Python (Code ล้วน ๆ)]]></title>
            <link>https://medium.com/convolab/%E0%B8%A7%E0%B8%B4%E0%B8%98%E0%B8%B5%E0%B8%AA%E0%B8%A3%E0%B9%89%E0%B8%B2%E0%B8%87-chatbot-%E0%B8%94%E0%B9%89%E0%B8%A7%E0%B8%A2-python-code-%E0%B8%A5%E0%B9%89%E0%B8%A7%E0%B8%99-%E0%B9%86-945e3948fc4f?source=rss-dbfedeabff6a------2</link>
            <guid isPermaLink="false">https://medium.com/p/945e3948fc4f</guid>
            <category><![CDATA[how-to]]></category>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[chatbot-development]]></category>
            <category><![CDATA[chatbots]]></category>
            <dc:creator><![CDATA[Quiw Punpun]]></dc:creator>
            <pubDate>Sun, 07 Apr 2019 16:16:23 GMT</pubDate>
            <atom:updated>2019-04-07T16:41:16.266Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/752/0*fy2zCTBnVrAgepep.jpeg" /><figcaption><strong>Image source</strong>: <a href="http://technikes.com/wp-content/uploads/2018/06/chatbot-752x440.jpeg">http://technikes.com/</a></figcaption></figure><p>***ให้ Download และ Install โปรแกรมเหล่านี้ก่อนเริ่ม***<br>*** <a href="https://www.python.org/downloads/release/python-366/">https://www.python.org/downloads/release/python-366/</a> ***<br>*** <a href="https://sqlitestudio.pl/index.rvt?act=download">https://sqlitestudio.pl/index.rvt?act=download</a> ***</p><h3>ขั้นตอนที่ 1: ทำการลง Library ChatterBot และทดลองใช้งาน</h3><p>1. เปิด Command Prompt และพิมพ์ pip install chatterbot</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/687/0*-PBWgYhHAVKW5Hu3.PNG" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/687/0*FX4eF_ED-AlosLsU.PNG" /></figure><p>ChatterBot คือ Library ภาษา Python ที่ใช้ทำ Chatbot แบบที่เราสามารถพิมพ์ผิดได้เช่น สวัสดี หวัดดี สัวสดี ก็ยังสามารถตอบได้ เพราะ ChatterBot มีการใช้ Machine Learning แบบ Supervised Learning ในการหาค่า Confidence เพื่อดูความคล้ายคลึงของประโยค</p><p>อัลกอริทึมที่เจ้าตัว ChatterBot ใช้โดย default นั้นคือ Levenshtien Distance และอัลกอริทึมสำรองเมื่อไม่สามารถใช้ Levenshtien Distance ได้คืออัลกอริทึม SequenceMatcher เจ้าอัลกอรึทึมพวกนี้เป็นอักอริทึมที่มีไว้ใช้ในการเช็คคำผิดในประโยคนั่นเอง</p><p>ทำการเปิดโปรแกรม Python IDLE และ New File จากนั้นพิมพ์ Code ดังนี้</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MZDtIQ2aNxtlUS1UfG5Anw.png" /></figure><p>จากนั้นกด F5 Save และ Run ดูผลเมื่อได้ตามนี้ Chatbot ตัวแรกคุณสำเร็จแล้ว เย้!! <br>*** ห้ามตั้งชื่อว่า chatterbot ถ้าตั้งไปแล้วให้เปลี่ยนชื่อ ***</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/696/0*ytKgB6VWEdtylK5T.PNG" /></figure><p>จากภาพและ Code เราเทรนคำว่า</p><blockquote>“Hi, can I help you?”,<br>“Sure, I’d like to book a flight to Iceland.”,<br>“Your flight has been booked.”</blockquote><p>เป็นการเทรนแบบ List ตามลำดับจากบนลงล่างเช่นเมื่อเราพิมพ์ “Hi, can I help you ?”</p><p>บอทก็จะตอบว่า “Sure, I’d like to book a flight to Iceland.”<br>จะเห็นว่าในบรรทัด response = chatbot.get_response(‘I would like to book a flight.’)</p><p>เราใส่คำถามไปว่า ‘I would like to book a flight.’ ซึ่งไม่มีในการเทรน แต่ .get_response จะทำการหาประโยคที่ใกล้เคียงที่สุด <br>นั่นคือ “Sure, I’d like to book a flight to Iceland.”<br>คำตอบที่ได้คือ “Your flight has been booked.”</p><p>ต่อไปเราจะเริ่มสร้าง Chatbot ของตัวเองโดยไม่อิงตัวอย่างจาก Chatterbot <br>ให้ไปที่ Folder ที่เราเก็บไฟล์แชทตัวแรกและลบทิ้งไป พร้อมทั้ง db.sqlite3 <br>ให้สร้างไฟล์กระดาษเปล่า ๆ 1 ใบ Nodepad หรือ Text Document ก็ได้แล้วพิมพ์ประมาณนี้ก่อนนะครับ</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8S3KaB44bV0NWjCspqBabA.png" /></figure><p>จากนั้น Save ไฟล์นี้เป็นชื่อ train.yml อย่าลืม <br>*** .yml นะครับเป็นไฟล์ฐานข้อมูลชนิดหนึ่ง ***</p><p>New File Python ขึ้นมาใหม่และพิมพ์ดังนี้</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Bmx6ByGPs720O4uCJGbkMA.png" /></figure><p>ไฟล์นี้ผมจะทำการตั้งชื่อว่า train.py ใช้สำหรับกดเพื่อสร้าง database db.sqlite3 ที่เก็บข้อมูลคำถามของเราจากนั้นให้กด F5 หรือ Run <br>ผลจะเป็นแบบนี้</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/691/0*kZQTCSdBvCjKTQEM.PNG" /></figure><p>New File Python ขึ้นมาใหม่และพิมพ์ดังนี้</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WzDzKRnr9fQH9oTnOqcaBQ.png" /></figure><p>ไฟล์นี้ผมจะตั้งชื่อว่า chat.py เมื่อเสร็จแล้วให้กด F5 แล้วลองพิมพ์ สวัสดี หรือ หวัดดี ดูครับแชทจะตอบกลับคำว่า greeting แต่ถ้าพิมพ์มั่วหรือไม่ตรงกับคำว่า สวัสดี ที่เราได้ทำการเทรนไปมันจะตอบว่า fallback เนื่องจากเราทำการใช้ค่า confidence มาทำการคัดประโยค แล้วค่าแค่ไหนถึงจะพอดี ทำไมต้อง 0.5 อันนี้ต้องบอกว่าเกิดจากการทดลองเอาครับแล้วแต่งานกันไป แต่ผมเลือกกลาง ๆ ไว้ ต่ำสุดคือ 0 มากสุดคือ 1 นะครับลองปรับดู</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/690/0*usUPZEcKtoB0HUyy.PNG" /></figure><p>ต่อไปเราจะไปยุ่งกับ database ที่ชื่อว่า db.sqlite3 ใครยังไม่โหลดโหลดก่อนเลยนะครับ… ให้หาไฟล์ที่ชื่อว่า db.sqlite3 แล้ว copy ไฟล์แล้ว paste นะครับจากนั้นตั้งชื่อว่า answer.sqlite3 แบบนี้</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/575/0*yKnVTQfeBdutDfkI.PNG" /></figure><p>แล้วทำการเปิด SQLiteStudio ขึ้นมาแล้วคลิกที่ปุ่มรูป database+ แล้วกด + เลือก database ที่เรามีทั้ง 2 อันมาไว้ในนี้เพื่อจัดการได้เลย</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/349/0*osMptAGCCfJQE4m8.PNG" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/330/0*TzpL8hElEmtmZvTT.PNG" /><figcaption><strong>เข้าไปที่ answer.sqlite3 เลือกตารางทั้งหมด แล้วกดลบตารางทั้งหมดเพราะเราไม่ต้องการ <br>*** มันจะติด FOREIGN KEY ลบซัก 2 ครั้งก็เกลี้ยงครับ ***</strong></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/213/0*weALR1SzzUbKzBh2.PNG" /><figcaption><strong>จากนั้นก็คลิกขวาที่ Tables แล้วเลือก Create a Table</strong></figcaption></figure><p>แล้วตั้งค่าตามรูปด้านล่างเลยครับ…</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/441/0*M2Cmi9tMX1dGOirD.PNG" /></figure><p>จากนั้นกด OK กดเครื่องหมายถูกต้อง แล้วให้เราเลือกไปที่ตารางที่เราสร้างเมื่อกี้กดไปที่ Tab Data</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/487/0*epn2mbe7KbVmGXw7.PNG" /></figure><p>กด + แล้วใส่คำตอบสำหรับ greeting เข้าไปกี่คำตอบก็ได้นะครับจากนั้นกดถูกต้อง</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/163/0*J8LFZKVKw0hksuwd.PNG" /></figure><p>ทำอีกครั้งเหมือนเดิมแต่เปลี่ยนชื่อ greeting เป็น fallback แล้วใส่คำตอบลงไป เมื่อเสร็จแล้วจะได้ดังภาพ</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/609/0*vr0k6sJze8xC7Bda.PNG" /></figure><p>หลังจากนั้นให้ทำการเพิ่ม Code ที่ chat.py ลงไปดังนี้</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oMc_Dv9VCmpIKpsjJCc-fg.png" /></figure><p>ลองกด F5 รันดูผล ทดสอบพิมพ์คำว่า สวัสดี หรือพิมพ์มั่วก็ได้ครับ</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/688/0*c9WcN67E63-Jk_W8.PNG" /><figcaption>จะเห็นว่าบอทของเราสามารถตอบคำถามได้แล้วและมากกว่า 1 คำตอบหากคำไหนค่า confidence น้อยก็จะถือว่าไม่เข้าใจ <br>*** จะเห็นว่าบางคำไม่น่าไม่เข้าใจก็มีดังนั้นหมั่นเทรนเยอะ ๆ ก็จะยิ่งฉลาดมากขึ้นครับ ***</figcaption></figure><p>ครั้งหน้าถ้ามีเวลาว่างผมจะทำให้เข้าไลน์ให้นะครับ ส่วนวันนี้สวัสดีครับบบ</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=945e3948fc4f" width="1" height="1" alt=""><hr><p><a href="https://medium.com/convolab/%E0%B8%A7%E0%B8%B4%E0%B8%98%E0%B8%B5%E0%B8%AA%E0%B8%A3%E0%B9%89%E0%B8%B2%E0%B8%87-chatbot-%E0%B8%94%E0%B9%89%E0%B8%A7%E0%B8%A2-python-code-%E0%B8%A5%E0%B9%89%E0%B8%A7%E0%B8%99-%E0%B9%86-945e3948fc4f">วิธีสร้าง Chatbot ด้วย Python (Code ล้วน ๆ)</a> was originally published in <a href="https://medium.com/convolab">ConvoLab</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>