<?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 Solomon Soh on Medium]]></title>
        <description><![CDATA[Stories by Solomon Soh on Medium]]></description>
        <link>https://medium.com/@solomonsoh?source=rss-5065e694d0e0------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*UulZtVtn82Gz_ei-P-8T_w.jpeg</url>
            <title>Stories by Solomon Soh on Medium</title>
            <link>https://medium.com/@solomonsoh?source=rss-5065e694d0e0------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 03 Dec 2026 16:30:00 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@solomonsoh/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 Apex CRM Puts an AI Sales Agent in Every Rep’s Pocket]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-snippet">*Building a Gemini-powered CRM assistant that knows your pipeline as well as you do*</p><p class="medium-feed-link"><a href="https://solomonsoh.medium.com/how-apex-crm-puts-an-ai-sales-agent-in-every-reps-pocket-571c1847ab0e?source=rss-5065e694d0e0------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://solomonsoh.medium.com/how-apex-crm-puts-an-ai-sales-agent-in-every-reps-pocket-571c1847ab0e?source=rss-5065e694d0e0------2</link>
            <guid isPermaLink="false">https://medium.com/p/571c1847ab0e</guid>
            <dc:creator><![CDATA[Solomon Soh]]></dc:creator>
            <pubDate>Sun, 14 Jun 2026 03:09:34 GMT</pubDate>
            <atom:updated>2026-06-14T03:09:34.648Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Election Fever Singapore — So noisy, AI help please?]]></title>
            <link>https://solomonsoh.medium.com/election-fever-singapore-so-noisy-ai-help-please-e57b3d40a4eb?source=rss-5065e694d0e0------2</link>
            <guid isPermaLink="false">https://medium.com/p/e57b3d40a4eb</guid>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[elections]]></category>
            <dc:creator><![CDATA[Solomon Soh]]></dc:creator>
            <pubDate>Thu, 01 May 2025 15:27:22 GMT</pubDate>
            <atom:updated>2025-05-01T15:38:00.907Z</atom:updated>
            <content:encoded><![CDATA[<h3>Election Fever Singapore — So noisy, AI help please?</h3><p><strong>Caution</strong>: Research Driven. Important not to publish early to avoid a self-fulfilling prophecy, and not to introduce bias.</p><p>With the higher margin error rates, it is then incremental to improve the performance. 2 parallel methodologies were experimented.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*K8O8iiuOWTRPpyt2DqCq4w.png" /></figure><h4>Methodology I results</h4><ol><li>LLMs can potentially learn star players to adjust (increase) win rates significantly.</li><li>Some conditions have to be pre-set, such as no team can get 0% votes.</li><li>The agent also has to allocate vote shares amongst the competing teams such that the sum = 1 and based on historical trends, estimates each team’s trajectory interdependence.</li><li>It can be seen that the performance gains is not consistent across the years.</li></ol><pre><br>+------+---------------------------+-----------------------+<br>| Year | Single Macro Model Error  | Ensembled Model Error |<br>+------+---------------------------+-----------------------+<br>| 2020 | 14.13%                    | 10.67%                |<br>| 2015 | 12.81%                    | 14.85%                |<br>| 2011 | 21.80%                    | 14.80%                |<br>| 2006 | 27.11%                    | 14.40%                |<br>| 2001 | 25.04%                    | 26.93%                |<br>+------+---------------------------+-----------------------+<br></pre><h4>Methodology II results (Preferred due to stable gains):</h4><ol><li>Similar to Methodology I, the goal is to separate the effects of the party and the candidates.</li><li>Methodology II attempts to use candidates’ data to adjust the original win rate by the first model, so it differs significantly from Methodology I in that it is not a simple aggregator but rather a drift model.</li><li>It has the same boundary conditions as Methodology I, but added conditions to clip the gap in win rates between the teams to be within a reasonable range, which is twice the difference of the original win rate from the mean.</li><li>Earlier iterations of Methodology II saw a tightening of the maximum drifts allowable on the original win rate.</li><li>These params can be further tuned in future iterations</li></ol><pre><br>+------+---------------------------+-----------------------+<br>| Year | Single Macro Model Error  | Ensembled Model Error |<br>+------+---------------------------+-----------------------+<br>| 2020 | 14.13%                    | 13.53%                |<br>| 2015 | 12.81%                    | 13.75%                |<br>| 2011 | 21.80%                    | 15.74%                |<br>| 2006 | 27.11%                    | 26.46%                |<br>| 2001 | 25.04%                    | 23.58%                |<br>+------+---------------------------+-----------------------+<br></pre><h4>Results</h4><p>After the 2-stage modelling, some constituencies became closer to the borderline, which, from the incumbent party’s perspective to be more unsafe and almost certainly that they will lose it to the respective opponents, e.g., East Coast and Sengkang.</p><p>Some constituencies remain risky at the lower bound, such as West Coast-Jurong West and Bukit Panjang, which were equally heavily contested in 2020. Interestingly, the ensembled approach likely increases the standard errors for some constituencies, such as Potong Pasir and Nee Soon lower bound decreased significantly but remains a PAP stronghold.</p><pre><br>+---------+--------------------------------+----------+----------------+--------------------+--------------------------+<br>| ward_id |          constituency          | win_rate | lower_win_rate | ensembled_win_rate | ensembled_lower_win_rate |<br>+---------+--------------------------------+----------+----------------+--------------------+--------------------------+<br>|      11 | Hougang                        |   0.3879 |         0.3202 |             0.3879 |                   0.3301 |<br>|       0 | Aljunied                       |   0.4005 |         0.3402 |            0.41025 |                   0.3651 |<br>|       9 | East Coast                     |   0.5339 |         0.4702 |         0.46937133 |               0.41337029 |<br>|      47 | Sengkang                       |   0.4788 |         0.4102 |                0.5 |                   0.4557 |<br>|      23 | West Coast-Jurong West         |   0.5168 |         0.4502 |             0.5184 |                   0.4751 |<br>|      19 | Potong Pasir                   |   0.6067 |         0.5402 |         0.53337252 |                0.4749099 |<br>|      30 | Bukit Panjang                  |   0.5373 |         0.4702 |            0.53865 |                   0.4951 |<br>|      34 | Nee Soon                       |    0.619 |         0.5502 |          0.5441859 |               0.48370127 |<br>|      45 | Marymount                      |   0.5504 |         0.4902 |             0.5477 |                   0.5026 |<br>|       8 | Chua Chu Kang                  |   0.5864 |         0.5072 |             0.5864 |                   0.5218 |<br>|      16 | Marine Parade-Braddell Heights |   0.5774 |         0.5102 |             0.6012 |                   0.5501 |<br>|      31 | Yio Chu Kang                   |   0.6082 |         0.5402 |             0.6091 |                   0.5651 |<br>|      35 | Pioneer                        |     0.62 |         0.5502 |               0.62 |                   0.5551 |<br>|      44 | Kebun Baru                     |   0.6292 |         0.5602 |             0.6296 |                   0.5701 |<br>|      21 | Tampines                       |   0.6641 |         0.6012 |            0.63205 |                   0.5756 |<br>|      21 | Tampines Changkat              |   0.6641 |         0.6012 |            0.63205 |                   0.5756 |<br>|      22 | Queenstown                     |    0.631 |         0.5702 |             0.6405 |                   0.5751 |<br>|      22 | Tanjong Pagar                  |    0.631 |         0.5702 |             0.6405 |                   0.5751 |<br>|      28 | Pasir Ris-Changi               |   0.6416 |         0.5707 |             0.6416 |                  0.58615 |<br>|      28 | Punggol                        |   0.6416 |         0.5707 |             0.6416 |                  0.58615 |<br>|      43 | Marsiling-Yew Tee              |   0.6318 |         0.5702 |             0.6459 |                   0.5951 |<br>|       5 | Bukit Gombak                   |   0.6514 |         0.5902 |             0.6532 |                   0.6126 |<br>|      12 | Jalan Besar                    |   0.6536 |         0.5902 |             0.6543 |                   0.6126 |<br>|      24 | Holland-Bukit Timah            |   0.6636 |         0.6012 |             0.6668 |                   0.6206 |<br>|       3 | Bishan-Toa Payoh               |   0.6723 |         0.6132 |            0.67615 |                   0.6366 |<br>|       1 | Jalan Kayu                     |   0.7191 |         0.6612 |            0.68365 |                   0.6397 |<br>|       1 | Ang Mo Kio                     |   0.7191 |         0.6612 |            0.68365 |                   0.6397 |<br>|      20 | Sembawang                      |   0.6729 |         0.6102 |            0.70145 |                   0.6301 |<br>|      20 | Sembawang West                 |   0.6729 |         0.6102 |            0.70145 |                   0.6301 |<br>|      37 | Radin Mas                      |   0.7401 |         0.6702 |             0.7031 |                  0.66065 |<br>|      33 | Mountbatten                    |   0.7382 |         0.6702 |             0.7382 |                   0.6801 |<br>|      26 | Jurong East-Bukit Batok        |   0.7461 |         0.6872 |             0.7461 |                  0.70165 |<br>|      26 | Jurong Central                 |   0.7461 |         0.6872 |             0.7461 |                  0.70165 |<br>+---------+--------------------------------+----------+----------------+--------------------+--------------------------+<br><br></pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e57b3d40a4eb" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Election Fever Singapore — Who will win?]]></title>
            <link>https://solomonsoh.medium.com/election-fever-singapore-who-will-win-75f91095794e?source=rss-5065e694d0e0------2</link>
            <guid isPermaLink="false">https://medium.com/p/75f91095794e</guid>
            <category><![CDATA[ge2025]]></category>
            <category><![CDATA[reinforcement-learning]]></category>
            <category><![CDATA[elections]]></category>
            <dc:creator><![CDATA[Solomon Soh]]></dc:creator>
            <pubDate>Thu, 01 May 2025 15:14:45 GMT</pubDate>
            <atom:updated>2025-05-01T15:14:45.572Z</atom:updated>
            <content:encoded><![CDATA[<h3>Election Fever Singapore — Who will win?</h3><p><strong>Caution</strong>: Research Driven. Important not to publish early to avoid a self-fulfilling prophecy, and not to introduce bias.</p><p>After leveraging on LLMs to do descriptive and diagnostic analysis on the candidates and get to know them better, obviously the next urgent questions is who will win.</p><h4>Context</h4><p>It is not uncommon to attempt to predict election results. The SG context is prime for leveraging AI to predict because of the following factors:</p><ol><li>Highly stable and consistent political landscape, which supports any baseline trends modelling except for some drifts and deltas, that is the crux of what the AI would hope to capture.</li><li>There is only 1 ruling party historically enjoying decades of monopoly, which enables the problem to be crafted as a simple regression/classification problem focusing only on the win rates or the win/loss of the ruling party, respectively, with the opposing parties to simply received the remaining vote share out of 100%. For elections worldwide that are more dynamic, a better modelling approach could be reinforcement learning games. This is not necessarily significant for the SG context.</li></ol><h4>Methodology</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/580/1*iKBTezMeGVMNko3catKmIg.png" /></figure><ul><li>Hierarchical modelling is the overarching methodology.</li><li>The timeframe for backtesting is 30 years across the past 5 elections, which already provides sufficient breadth of economic situations.</li><li>To prevent leakage, entity names are not ingested into the models but rather tokenized before analysis.</li><li>For every election, only data up till the last election can be utilized.</li><li>Due to consistent electoral boundary changes, it is critical to perform historical mapping. The new constituency has to map to the same ID as the closest constituency in the last election. The old constituency ID will not be reused.</li><li>Model is tuned and validated by backtesting and also anchored with inputs of known opposition-held constituencies because, as mentioned, only uniquely in the SG context, PAP enjoys the majority of the seats which is a great primer for anchoring in LLMs.</li></ul><p>LLM agent is instructionally tuned and prompted to do the following chain-of-thought analysis:</p><ol><li>Calculate trend and moving averages per competing party.</li><li>For each constituency, forecast the win rate for the ruling PAP party.</li><li>Calculate the 90% confidence lower and upper bounds. 90% is used for more confidence and allows a tighter band for comparisons. This is especially so given the standard errors of this problem being generally large.</li></ol><h4>Results</h4><p>WP is almost certain to take (keep) Hougang, Aljunied, and Sengkang.</p><p>PAP may potentially lose West Coast-Jurong West, East Coast, Bukit Panjang, and Marymount, with the worst vote share at around 45% for these constituencies.</p><p>Hence, using subject-matter-knowledge, PSP and WP may each gain 1 more GRC. West Coast and East Coast are also high-stakes GRCs in these elections, as the media has reported. Other GRCs that are equally heavily focused on, such as Punggol and Tampines, show that the incumbent PAP seems to enjoy a safe 10% buffer of votes above the mean to keep them.</p><pre><br>+------+--------------------------------+----------+----------------+-----------------+--------+------------+<br>| Ward |          Constituency          | Win Rate | Lower Win Rate | Higher Win Rate | Winner | Confidence |<br>+------+--------------------------------+----------+----------------+-----------------+--------+------------+<br>|   11 | Hougang                        |   0.3879 |         0.3202 |          0.4556 | WP     | High       |<br>|    0 | Aljunied                       |   0.4005 |         0.3402 |          0.4608 | WP     | High       |<br>|   47 | Sengkang                       |   0.4788 |         0.4102 |          0.5474 | WP     | High       |<br>|   23 | West Coast-Jurong West         |   0.5168 |         0.4502 |          0.5834 | PSP    | Borderline |<br>|    9 | East Coast                     |   0.5339 |         0.4702 |          0.5976 | WP     | Borderline |<br>|   30 | Bukit Panjang                  |   0.5373 |         0.4702 |          0.6044 | SDP    | Borderline |<br>|   45 | Marymount                      |   0.5504 |         0.4902 |          0.6106 | PSP    | Borderline |<br>|   16 | Marine Parade-Braddell Heights |   0.5774 |         0.5102 |          0.6446 | PAP    | High       |<br>|    8 | Chua Chu Kang                  |   0.5864 |         0.5072 |          0.6656 | PAP    | High       |<br>|   19 | Potong Pasir                   |   0.6067 |         0.5402 |          0.6732 | PAP    | High       |<br>|   31 | Yio Chu Kang                   |   0.6082 |         0.5402 |          0.6762 | PAP    | High       |<br>|   34 | Nee Soon                       |    0.619 |         0.5502 |          0.6878 | PAP    | High       |<br>|   35 | Pioneer                        |     0.62 |         0.5502 |          0.6898 | PAP    | High       |<br>|   44 | Kebun Baru                     |   0.6292 |         0.5602 |          0.6982 | PAP    | High       |<br>|   22 | Queenstown                     |    0.631 |         0.5702 |          0.6918 | PAP    | High       |<br>|   22 | Tanjong Pagar                  |    0.631 |         0.5702 |          0.6918 | PAP    | High       |<br>|   43 | Marsiling-Yew Tee              |   0.6318 |         0.5702 |          0.6934 | PAP    | High       |<br>|   28 | Pasir Ris-Changi               |   0.6416 |         0.5707 |          0.7125 | PAP    | High       |<br>|   28 | Punggol                        |   0.6416 |         0.5707 |          0.7125 | PAP    | High       |<br>|    5 | Bukit Gombak                   |   0.6514 |         0.5902 |          0.7126 | PAP    | High       |<br>|   12 | Jalan Besar                    |   0.6536 |         0.5902 |           0.717 | PAP    | High       |<br>|   24 | Holland-Bukit Timah            |   0.6636 |         0.6012 |           0.726 | PAP    | High       |<br>|   21 | Tampines                       |   0.6641 |         0.6012 |           0.727 | PAP    | High       |<br>|   21 | Tampines Changkat              |   0.6641 |         0.6012 |           0.727 | PAP    | High       |<br>|    3 | Bishan-Toa Payoh               |   0.6723 |         0.6132 |          0.7314 | PAP    | High       |<br>|   20 | Sembawang                      |   0.6729 |         0.6102 |          0.7356 | PAP    | High       |<br>|   20 | Sembawang West                 |   0.6729 |         0.6102 |          0.7356 | PAP    | High       |<br>|    1 | Jalan Kayu                     |   0.7191 |         0.6612 |           0.777 | PAP    | High       |<br>|    1 | Ang Mo Kio                     |   0.7191 |         0.6612 |           0.777 | PAP    | High       |<br>|   33 | Mountbatten                    |   0.7382 |         0.6702 |          0.8062 | PAP    | High       |<br>|   37 | Radin Mas                      |   0.7401 |         0.6702 |            0.81 | PAP    | High       |<br>|   26 | Jurong East-Bukit Batok        |   0.7461 |         0.6872 |          0.8049 | PAP    | High       |<br>|   26 | Jurong Central                 |   0.7461 |         0.6872 |          0.8049 | PAP    | High       |<br>+------+--------------------------------+----------+----------------+-----------------+--------+------------+<br><br></pre><h4>Validation:</h4><ol><li>Error rate is not the same across the constituencies. Some constituencies enjoy lower errors, whereas others have higher.</li><li>The confidence of this methodology is secured when in 2020, it predicted a confident loss of Aljunied and Hougang by PAP (to WP). Though the model estimated PAP to win 49% and 42% respectively but in actuality, PAP performed worse, at 40% and 39%. Therefore, the error rate was quite high, up to +/-22%, despite forecasting the same binary results.’</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/628/1*c16Lok-eQbOFi4DCtw0k2Q.png" /></figure><p>3. In 2020, the model suggested Kebun Baru, Marymount, Punggol West, and Sengkang to be at risk of losing. Indeed, Sengkang was lost by the PAP (flipped blue to WP) in 2020. This adds confidence to the elections to provide early indications of risky constituencies. The keeping of other constituencies that were suggested to be at risk, together with Sengkang, does not weaken the use of the model as an early indication of high-stakes constituencies.</p><p>4. Model’s past forecast performances is low.</p><p>+ — — — + — — — — — — — — — +<br>| Year | Error Percentage |<br>+ — — — + — — — — — — — — — +<br>| 2020 | 14.13% |<br>| 2015 | 12.81% |<br>| 2011 | 21.80% |<br>| 2006 | 27.11% |<br>| 2001 | 25.04% |<br>+ — — — + — — — — — — — — — +</p><p>5. Overall, the model improved over the elections, likely largely driven by having more data.</p><p>6. There is no significant difference in accuracy and error rates across new versus old constituencies.</p><p>Points to note:</p><ul><li>There are many ways to approach/solve the problem, but in lieu of insufficient experimentation time due to the short campaigning window, a guided approach with subject-matter-expertise and intuition is applied.</li><li>The research comes in multiple phase with the first phase being focusing on macro-level data and predictions.</li><li>Future experiments can be to group constituencies at higher categories, such as geographical districts.</li><li>Future experiments can create synthetic historical counterfactual data for simulations.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=75f91095794e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Election Fever Singapore — Let AI do the talking instead.]]></title>
            <link>https://solomonsoh.medium.com/election-fever-singapore-let-ai-do-the-talking-instead-3f73c1ca031f?source=rss-5065e694d0e0------2</link>
            <guid isPermaLink="false">https://medium.com/p/3f73c1ca031f</guid>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[clustering]]></category>
            <category><![CDATA[elections]]></category>
            <category><![CDATA[llm-agent]]></category>
            <category><![CDATA[forecasting]]></category>
            <dc:creator><![CDATA[Solomon Soh]]></dc:creator>
            <pubDate>Thu, 01 May 2025 14:53:22 GMT</pubDate>
            <atom:updated>2025-05-01T14:53:22.770Z</atom:updated>
            <content:encoded><![CDATA[<h3>Election Fever Singapore — Let AI do the talking instead.</h3><p><strong>Caution</strong>: Research Driven. Important to not published early to avoid self-fulfilling prophecy, and not to introduce bias.</p><p>Season to leverage forecasters and LLMs (Large Language Models) to analyse or predict election results.</p><h4>Methodology</h4><ol><li>Collect public data on every GE2025 candidate.</li><li>Only candidates who can easily be found on their respective parties’ websites are analyzed and clustered.</li><li>Focus on the candidates’ profiles is more meaningful than just a broad stroke on the party, which is already an overarching legacy, particularly in the SG context.</li><li>Fit into different LLMs and summarized with a final LLM to illustrate the reality where parties’ slate of candidates are evaluated by different experts before an aggregated national perception of the parties’ slate is developed.</li><li>A profile per party is generated based on a clustering of its full slate of candidates.</li><li>The profile is synthesized from what each party decided to market about their candidates, thereby it is not guided by the ground truth of the personnel. Nonetheless, some truths guide the understanding of the parties.</li><li>The analysis simply uses AI to summarize a central single personality per party by considering each party’s total pool of candidates’ profiles, regardless of the number of candidates filed.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/368/1*7d6JuvzdJafiX-Ba1H0plw.png" /><figcaption>AI Architecture</figcaption></figure><h4>Results</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/177/1*qeP9KiaMUXMJTFuyZfvCBA.png" /></figure><p>A People’s Power Party member is a principled advocate for democratic reform with deep community roots. This person combines practical life experience with a commitment to serve everyday Singaporeans who are struggling with rising costs and economic challenges.</p><p>This composite personality is typically:</p><ul><li>Resilient and self-made — Someone who has overcome personal challenges through hard work, often starting from humble beginnings</li><li>Multi-skilled with diverse professional experience — Ranging from civil service to entrepreneurship to blue-collar work</li><li>Community-oriented — Actively engaged in grassroots activities and charity work to help vulnerable Singaporeans</li><li>Reform-minded — Believes in stronger checks and balances in governance, transparency, and accountability</li><li>Economically pragmatic — Concerned about cost of living, housing affordability, and job security for Singaporeans</li><li>Values-driven — Guided by principles of social justice, fairness, and empathy</li><li>Outspoken on policy issues — Not afraid to take controversial stances on issues like COVID-19 vaccine policies</li></ul><p>The party’s central figure would embody their core values of “Unity, Stability, Continuity and Sustainability” while advocating for democratic socialism, balanced national development, and a system with proper separation of powers to achieve long-term stability for Singapore.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/174/1*2g2VSsIILN9v3TWNgtAQMg.png" /></figure><p>The typical NSP candidate is a mid-40s working professional with strong community roots who balances practical work experience with educational credentials. They present themselves as approachable “everyday Singaporeans” who understand ground issues through direct engagement rather than theoretical policy discussions. Their personality combines quiet determination with genuine empathy, emphasizing that they’ve been consistently present in Sembawang since 2015, not just appearing during election season.</p><p>They position themselves as educators, mentors, and listeners who are driven by principled service rather than political ambition. The central message in their character is one of authentic connection — someone who has personally experienced cost-of-living pressures, educational challenges, and community needs. They champion accessible education, elder care, affordable housing, and mental health support with a focus on long-term sustainability rather than quick fixes.</p><p>Their collective personality emphasizes being present, prepared, and “people-first” — contrasting themselves with opponents they imply are disconnected from everyday realities. They embody a blend of pragmatic problem-solving (drawn from their varied professional backgrounds) with idealism about democratic values and inclusive community-building.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/201/1*x1BIWJzISmiyg2zwpcZRiw.png" /></figure><p>The typical PSP candidate is a highly educated professional with significant career accomplishments, often with international experience or educational credentials from prestigious institutions. They commonly hold advanced degrees in fields like law, business, medicine, or engineering, and many were government scholarship recipients.</p><p>Their career backgrounds typically involve leadership positions in the private sector, with experience spanning industries such as finance, law, technology, education, and healthcare. Many have entrepreneurial experience, having founded or led companies.</p><p>These candidates share a common concern about growing inequality, rising costs of living, and the desire for greater democratic representation in Singapore. They emphasize creating a more inclusive society that balances economic growth with social safety nets, where diverse viewpoints are represented in policy-making.</p><p>A notable pattern is their focus on specific demographic concerns: supporting seniors, addressing middle-income struggles, advocating for workers’ rights, and ensuring younger Singaporeans can thrive in the future. Many candidates also showcase their community service commitments, whether through NGOs, volunteer work, or grassroots organizing.</p><p>Their collective personality reflects a blend of professional competence, socio-economic concern, and civic-mindedness, positioning themselves as experienced professionals who understand the challenges faced by ordinary Singaporeans.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/177/1*10fHHnPDRSKX_sW5nsL8sg.png" /></figure><p>The Workers’ Party candidate is typically a highly-educated professional with diverse real-world experience who believes in political balance and representation for all Singaporeans. They are often mid-career individuals who have achieved success in their fields — whether law, finance, education, civil service, or entrepreneurship — and are driven by a sense of civic duty to create a more balanced political landscape in Singapore.</p><p>These candidates tend to be pragmatic idealists who want to ensure that alternative viewpoints are heard in Parliament. They believe one-party dominance is detrimental to Singapore’s long-term interests and are committed to providing a credible “check and balance” to the ruling party without being oppositional for opposition’s sake.</p><p>Many have juggled their professional careers with years of grassroots volunteering — participating in house visits, Meet-the-People Sessions, and community events — demonstrating their commitment to understanding ground issues and connecting with ordinary Singaporeans. Their approach emphasizes listening over speaking and practical problem-solving over ideology.</p><p>They are often motivated by personal values around fairness, inclusivity, and creating opportunities for future generations. Many express concern about inequality, housing affordability, and cost of living pressures, and see themselves as representing those whose voices might otherwise be marginalized in policy discussions.</p><p>Above all, these candidates present themselves as ordinary Singaporeans who have stepped forward to serve, believing that a stronger democracy requires citizens willing to participate actively in the political process despite the personal costs and challenges involved.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/82/1*ltvU-36PCVPc07G-v0VqZg.png" /></figure><p>The typical PAP candidate is a community-focused servant leader who balances professional excellence with deep grassroots involvement. They are dedicated to creating an inclusive, sustainable Singapore where no one is left behind.</p><p>Their approach is pragmatic yet compassionate, emphasizing economic progress alongside social support systems. They typically have substantial professional experience in either the public or private sectors, often with leadership roles that demonstrate capability and vision.</p><p>Family values are central to their identity — most are married with children and speak about family as the bedrock of society. Their community service frequently targets vulnerable groups including seniors, youth, and low-income families.</p><p>The candidate is solutions-oriented, implementing practical programs like subsidized groceries, free haircuts, health screenings, and education support. They advocate for lifelong learning, digital inclusion, and sustainable living.</p><p>Beyond local concerns, they maintain a global outlook, recognizing Singapore’s place in the international community while emphasizing multiracial harmony and social cohesion at home.</p><p>Overall, they embody a blend of pragmatism and compassion, valuing both progress and tradition, and seeing their role as building bridges between policy and people to create a Singapore that balances economic prosperity with social well-being.</p><h4>Points to note</h4><p>Historical candidates’ data are almost non-existent. Too expensive to do background research, especially for historical candidates. Therefore, a static GE2025 clustering analysis is sufficient.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3f73c1ca031f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[31 Days of Learning (1 Day 1 Course): Embracing a Data-Centric Approach in AI Development]]></title>
            <link>https://solomonsoh.medium.com/31-days-of-learning-1-day-1-course-embracing-a-data-centric-approach-in-ai-development-49244ba626b4?source=rss-5065e694d0e0------2</link>
            <guid isPermaLink="false">https://medium.com/p/49244ba626b4</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[Solomon Soh]]></dc:creator>
            <pubDate>Thu, 31 Oct 2024 03:12:08 GMT</pubDate>
            <atom:updated>2024-10-31T03:12:08.078Z</atom:updated>
            <content:encoded><![CDATA[<p>Embarking on a journey to learn one course per day for a full 31-day month was both an ambitious challenge and a transformative experience. Immersing myself in a diverse array of AI and machine learning topics, I aimed to expand my technical skills and uncover deeper insights into effective AI development. Throughout this journey, one theme consistently emerged: the paramount importance of being data-centric rather than solely model-centric.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1001/1*QFXmmtzLdpb1wlPA4GuJLQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*HD90tstAVEjHd0VExM0fzQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/994/1*WUPKOlRgw2w0Z2_7wkZGkw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*Sib0wjVOYLsMI3BH0N9Fbg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/992/1*8LvXccPueOxl5sIkxgxzPA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*eyXMqN2hO-hjtEYWmUdhew.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1008/1*_NG0BiFRxSBRgwfIisU5bw.png" /></figure><p>Over the years, innovations in Large Language Models (LLMs) have increasingly centered around data rather than solely focusing on model architecture. While algorithms and computational power advancements have played significant roles, the most impactful improvements in LLM performance have been driven by data-centric approaches. Here’s how LLM innovations have been shaped by a focus on data:</p><h4>1. Scaling Up Training Data</h4><p>- <strong>Quantity Matters</strong>: Early language models were trained on relatively small datasets. Innovations like OpenAI’s GPT series demonstrated that scaling up the amount of training data leads to substantial performance gains. GPT-3, for instance, was trained on hundreds of gigabytes of text data, enabling it to perform a wide range of tasks without task-specific training.</p><p>- <strong>Diverse Sources</strong>: Incorporating data from diverse sources (books, articles, websites) has allowed models to learn a broader spectrum of language patterns and knowledge.</p><h4>2. Emphasis on Data Quality</h4><p>- <strong>Cleaning and Filtering</strong>: As datasets grew, so did the need for quality control. Innovations included sophisticated data cleaning processes to remove duplicates, correct errors, and filter out irrelevant or harmful content.</p><p>- <strong>Reducing Bias</strong>: Identifying and mitigating biases in training data became a priority. Techniques like data balancing and bias detection algorithms were developed to create more fair and ethical models.</p><h4>3. Instruction Tuning and Human Feedback</h4><p>- <strong>Instruction Tuning</strong>: Models like InstructGPT were fine-tuned using datasets that included human-written prompts and responses. This made the models better at following human instructions.</p><p>- <strong>Reinforcement Learning from Human Feedback (RLHF)</strong>: Incorporating human preferences through RLHF allowed models to align more closely with human values and produce more helpful and less harmful outputs.</p><h4>4. Multimodal Data Integration</h4><p>- <strong>Combining Text and Images</strong>: Innovations like GPT-4 extended capabilities to process and generate not just text but also images, requiring the integration of visual data into training.</p><p>- <strong>Data Alignment</strong>: Aligning multimodal data required new techniques in data preprocessing and representation, emphasizing the centrality of data handling in model development.</p><h4>5. Domain-Specific Models</h4><p>- <strong>Specialized Datasets</strong>: Training models on domain-specific data (like medical or legal texts) resulted in better performance in those areas. Models like BioBERT and LegalBERT are prime examples.</p><p>- <strong>Customization</strong>: Creating and curating specialized datasets became a crucial innovation strategy to tailor models for specific industry needs.</p><h4>6. Handling Longer Contexts</h4><p>- <strong>Extended Context Windows</strong>: Innovations allowed models to consider longer sequences of data, improving coherence and context retention in outputs.</p><p>- <strong>Efficient Data Processing</strong>: New data management techniques were necessary to handle and optimize these longer inputs without prohibitive computational costs.</p><h4>7. Data Augmentation and Synthetic Data</h4><p>- <strong>Generating More Data</strong>: Techniques to artificially expand datasets, such as data augmentation and synthetic data generation, became important for improving model robustness.</p><p>- <strong>Diversity Through Augmentation</strong>: Augmenting data helped in exposing models to a wider variety of scenarios and linguistic patterns.</p><h4>8. Real-Time Data and Continual Learning</h4><p>- <strong>Adaptive Models</strong>: Some innovations focused on allowing models to learn from new data in real-time, making them more adaptable to changing information landscapes.</p><p>- <strong>Data Pipelines</strong>: Developing efficient data pipelines for continuous integration of new data became essential.</p><h4>9. Ethical Data Sourcing</h4><p>- <strong>Consent and Privacy</strong>: Innovations included methods for ensuring that training data was sourced ethically, respecting privacy and consent.</p><p>- <strong>Transparent Data Practices</strong>: Providing transparency about data sources and allowing for data removal improved public trust and model compliance with regulations.</p><h4>In Summary:</h4><p>LLM innovations have been deeply rooted in data-centric strategies, recognizing that:</p><p>- <strong>Data Quality Enhances Performance</strong>: High-quality, well-curated data leads to models that perform better and are more reliable.</p><p>- <strong>Data Diversity Improves Generalization</strong>: Exposure to diverse data enables models to handle a wider range of tasks and reduces biases.</p><p>- <strong>Data Alignment with Human Values</strong>: Incorporating human feedback and ethical considerations into data helps align models with societal norms and values.</p><p>- <strong>Data Efficiency Enables Scalability</strong>: Efficient data processing techniques make it feasible to train larger models without proportional increases in computational resources.</p><h4>Conclusion</h4><p>While model architectures and algorithms are important, the most significant leaps in LLM capabilities have been achieved through innovations in how data is collected, processed, and utilized. The shift towards a data-centric approach recognizes that the foundation of any AI model’s intelligence lies in the data it learns from. As we continue to develop more advanced LLMs, focusing on data will remain pivotal in pushing the boundaries of what these models can achieve.</p><h4>P.S.</h4><ol><li>Courses learnt were mostly from DeepLearning.AI</li><li>Write-up generated with prompt and instruction tuning</li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=49244ba626b4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Case Study 7]]></title>
            <link>https://solomonsoh.medium.com/case-study-7-eb185babdd4a?source=rss-5065e694d0e0------2</link>
            <guid isPermaLink="false">https://medium.com/p/eb185babdd4a</guid>
            <dc:creator><![CDATA[Solomon Soh]]></dc:creator>
            <pubDate>Wed, 29 Dec 2021 06:42:48 GMT</pubDate>
            <atom:updated>2021-12-29T06:42:48.546Z</atom:updated>
            <content:encoded><![CDATA[<p>“<em>Design a cross-platform way to help tutor adults in nutrition</em>”</p><h3>The problem</h3><p>The main causes of death in EU countries are circulatory diseases and various types of cancer. The best prevention is a healthy lifestyle but many adults don’t have good nutrition knowledge, feel lost in the information flow and are trapped in old habits.</p><h3>The goal</h3><p>Create a non-judgemental nutrition platform tutoring adults about nutrition with a supportive community encouraging people to make healthier choices.</p><h3>Duration</h3><p>3 weeks</p><h3>Tasks</h3><ul><li>Start the UX design process: empathize, define, ideate</li><li>Create wireframes and low-fidelity prototypes</li><li>Create mockups and high-fidelity prototypes</li><li>Design a complimentary responsive website</li></ul><h3>User research</h3><p>The user interviews were focused on what is the attitude towards healthy eating and what is the knowledge of nutrition. I wanted to discover if there were some techniques already in use, how they work and if they didn’t, then why. It was also important to find out what digital medium users use as I wanted to reach audiences of various ages.</p><p>Interview script</p><p><strong>Intro:</strong></p><ul><li>Welcome, thanks and the introduction of the project.</li><li>Before we begin, do I have your consent to take video recordings of this interview? The data will be used and seen only by me and deleted after completing this project.</li><li>I want you to know that there isn’t any wrong answer. I would like to know your honest opinion. I understand that eating habits can be triggering and highly personal. If you don’t feel comfortable answering some questions. Just tell me to go next. It is not a problem.</li><li>Do you have some questions so far?</li></ul><p><strong>Interview questions:</strong></p><ul><li>What is your favourite food?</li><li>On a scale of 1 (the least) to 10 (the most), how much do you think you know about nutrition?</li><li>How do you feel about nutrition and healthy food?</li><li>On a scale of 1 (the least) to 10 (the most), how healthy do you think your diet is?</li><li>Have you ever used some techniques to make your diet healthier?</li><li>How did it work? Why didn’t it work?</li><li>What would be the biggest motivator to start eating healthier for you?</li><li>What medium are you using in your daily life? Mobile or computer? Mobile apps or web apps?</li><li>When you need to learn or find something, how do you do it? What is the best way for you to learn new things?</li><li>Do you have something more to add on the topic of nutrition/healthy food?</li><li>Thanks and goodbye</li></ul><h3>Empathy maps</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/52/0*GoA_3X-zQ9dv5ECD" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/0*aym2fVmHZ81gZyq8.png" /></figure><h3>Personas</h3><p>The user research discovered that users in the demographic group 25–39 years old are more likely to actively search for information online and the motivation is to stay healthy and to make overall better choices in their day-to-day life. In the 40–60 y.o. group, the main motivators to improve eating habits and deepen nutrition knowledge are health problems. For these users, it is more difficult to break the unhealthy patterns and the need for a supportive community is greater.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/60/0*IFnodAjZbBiNhSKP" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/0*O2j5wT-MuF-u4IrI.png" /></figure><p>Tommy persona</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/60/0*WRz1X_EzDsdH0APj" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/0*M-6H3zhOoczX66An.png" /></figure><p>Alma persona</p><h3>User journeys</h3><p>The user journeys reflect the priorities in the app usage for each user.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/60/0*LYmaTQpFAsngbZbg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/0*pJfOgIhKNUGka3VJ.png" /></figure><p>Tommy’s journey</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/60/0*c_yRGvCkSLcpBRiC" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/0*FSNX5jFvVRoEIqT6.png" /></figure><p>Alma’s journey</p><h3>Problem statements</h3><p>Alma is a busy mum with poor eating habits eager to improve who needs easy to learn information and a supportive community because she must change old habits but it is difficult when being alone in it.</p><p>Tommy is an active healthy adult who needs engaging content with the option to learn more and share interesting info with peers because knowing about nutrition helps him to make overall better choices to stay healthy.</p><h3>Competitive audit</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/60/0*8BK8o53wp0bT02Vx" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/0*_MoGNsy284ABXOhv.png" /></figure><p>Competitive audit sheet</p><p>Most of the food-related apps are for calories count and weight loss which weren’t the goals of my project, neither relevant to the needs of my users. It is very disturbing to find many platforms creating the impression of skinny = healthy. Such an image is false and dangerous.</p><p>Competitors’ strengths</p><ul><li><strong>SuperFood</strong> — easy to add recipes to favourites and create a shopping list</li><li><strong>YouAte</strong> — very straightforward feature, easy to learn</li><li><strong>Myfitnesspal </strong>— a large source of information helping people to reach their fitness goals</li></ul><p>Competitors’ weaknesses</p><ul><li><strong>SuperFood</strong> — lacks a blog about food and information in general. A person only gets information about nutrition in specific recipes. The pictures of dishes are rather lower quality.</li><li><strong>YouAte </strong>— lacks a blog about food and information in general. Before a user starts journaling, the app is empty.</li><li><strong>Myfitnesspal </strong>— creates no emotion and delights when using the app.</li></ul><p>Gaps</p><ul><li><strong>SuperFood — </strong>lacks information about food except showing the nutritional value of their specific dishes. The app is evoking some positivity through the food but other apps are having gaps in this area.</li><li><strong>YouAte</strong> — lacks content before a user starts adding the journal which could feel intimidating</li><li><strong>Myfitnesspal </strong>— creates a cold, impersonal feeling with outdated UI.</li></ul><p>Opportunities</p><ul><li>Choose positive, welcoming and enthusiastic visuals</li><li>4Cs through app and web app</li><li>Option of notetaking to track feelings connected to food</li><li>No judgement attitude</li><li>Clear buttons and icons labels</li></ul><h3>Ideation</h3><p>Already after finishing the competitive audit, I started to have ideas on how to tackle the user problems but I always want to go past the first impressions and thoughts and get deeper insights. I applied Crazy Eights ideating each problem statement and How Might We for the platform.</p><ul><li>How might we reward people who complete a topic or a level?</li><li>How might we excite people to keep eating healthy?</li><li>How might we prove that better personal eating habits create a greater good for society?</li><li>How might we change personal eating habits into the coolest trend among all age groups?</li><li>How might we link a person’s eating habits to medical bills?</li></ul><h3>Wireframes and lo-fi prototypes</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/60/0*KXS6-RrUHAb_cg3o" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/0*xo73Ye4Niqv1wpCi.png" /></figure><p>Home page sketches</p><p>The aim was to create an engaging home page where users can find something new every day to motivate visiting more frequently.</p><p>The home page includes three parts:</p><ul><li>Top: daily tips about nutrition</li><li>Middle: a shortcut to keep learning where finished</li><li>Bottom: tasty and healthy recipe ideas</li></ul><p>The main use of the app is learning, therefore I checked different platforms to see the layout and structure of classes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/56/0*DzVz4cGPJ3vtzt-m" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/0*cN6IBK2m-8E6ZAgB.png" /></figure><p>Home and Class pages</p><p>For the community zone, I decided to go with two parts — forums for discussion and groups for creating public or closed groups. I checked platforms like Facebook, LinkedIn and Myfitnesspal for inspiration.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/60/0*c7Mbb8XcHi1hkHvm" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/0*86wX74m5yNCLTFUJ.png" /></figure><p>Community pages</p><h3>Usability testing</h3><h3>UX Research plan</h3><p>The goal of usability testing was to figure out if users find the two core flows — learning about nutrition and connecting with other people — in the app easy to use and suitable for their needs.</p><ul><li>Are there any parts of flow in Class or Community that users get stuck in?</li><li>Are users able to finish a learning chapter?</li><li>How do users feel about the learning method?</li><li>Are users able to find Groups in the Community?</li></ul><p>Methodology</p><ul><li>Moderated (tasks)</li><li>Location: Tallinn, Estonia and Remote (video calls)</li><li>Date: 01–02 October</li><li>5 participants will complete learning one chapter and enter a discussion forum</li><li>Each session takes 15 minutes including an introduction and a list of tasks</li></ul><p>Script</p><p><strong>Intro:</strong></p><ul><li>Welcome, thanks and the introduction of the project.</li><li>Before we begin, do I have your consent to take video recordings of this interview? The data will be used and seen only by me and deleted after completing this project.</li><li>I want you to know that this isn’t a test. There is no “right” answer, and none of your responses will be considered wrong. If you cannot complete a task, it is the design usability problem, not a reflection of your ability. Please be honest and provide me with critical feedback, it is the best help.</li><li>First, I’ll ask you a few basic questions, then I will give you a couple of tasks, please think aloud through the process, let me know if something confuses you.</li><li>Do you have any questions so far?</li></ul><p><strong>Basic questions:</strong></p><ul><li>How was your breakfast/lunch/dinner?</li><li>When did you last study at an online course? What was the source of motivation for you to continue through the course?</li></ul><p><strong>Prompt 1:</strong></p><ul><li>Open the app, tell me from top to bottom, what do you see?</li><li>You started the topic and would want to continue learning, how would you open the new chapter?</li><li>Let’s say you watched the video and read the articles, how would you mark the chapter as completed?</li><li>How do you feel about the flow of learning?</li><li>Why was XXX confusing for you?</li></ul><p><strong>Prompt 2:</strong></p><ul><li>You are learning about a Plant-based diet and would like to check what others think about this topic. How would you enter the discussion?</li><li>If I tell you that you can join a Group in this app, where would you find it?</li><li>How do you feel about the structure of the Community?</li><li>Why was XXX confusing for you?</li></ul><h3>Analyze and synthesize research results</h3><p>I gathered all the data and created affinity diagrams which helped me to discover the patterns and create insights and prioritised based on urgency.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/60/0*ZpRFl3t6KQxISeVl" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/0*MF0OgXx8r4cLoC6y.png" /></figure><p>Affinity diagrams</p><p>Priority 0</p><ul><li>Based on the theme that:<strong> </strong>most users did not understand there is a Group page, an insight is: strong trigger as a button needs to be created.</li></ul><p>Priority 1</p><ul><li>Based on the theme that:<strong> </strong>not all users understood the forum, an insight is: threads must be well visible.</li><li>Based on the theme that:<strong> </strong>most of the users mentioned the need for a reward system to keep motivated, an insight is: add points for each chapter and visible streak count.</li></ul><p>Priority 2</p><ul><li>Based on the theme that:<strong> </strong>few users mentioned a wish to journal, an insight is: add another feature to allow users journaling about their food and see the nutrition value of their dishes.</li></ul><h3>Refining the design</h3><h3>Mockups</h3><p>Before creating mockups, I prefer to have a style sheet to keep the consistency and speed up the process. The <a href="https://www.figma.com/community/file/862720187637258109">Segment UI </a>kit was very helpful in building it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/60/0*bpRYMjju5pI4KmMH" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/0*7WPbbO_c1wB0_gmy.png" /></figure><p>This is the first project that I didn’t connect to any existing institution and created the colour palette from scratch. I used <a href="https://coolors.co/">Coolors</a> to find juicy looking colour scheme as I wanted to avoid the obvious green option. I made sure all the text meets <a href="https://www.figma.com/community/plugin/733159460536249875/A11y---Color-Contrast-Checker">AAA colour contrast requirements</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/52/0*4eBRkqRvVtuWORps" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/0*856DAVPMJCOVDM5G.png" /></figure><p>Home and class pages</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/60/0*0tFkJcDxKllN14Fk" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/0*bUnIwU-CMzVgwgKb.png" /></figure><p>Community pages</p><h3>Hi-fi prototypes</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/28/0*M3lSzV-ZvCISdRg6" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/228/0*UN4dlBvrUDpM41dw.gif" /></figure><p>Class flow</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/28/0*FBnE5kGn4iChrEAh" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/228/0*uFRW_xs_JuEuUL0l.gif" /></figure><p>Community flow</p><h3>Responsive website</h3><p>During the user interviews, I discovered that users represented by persona Alma prefer to interact with websites rather than mobile applications while using mobile phones as well as personal computers. The responsive website included variations for mobile, tablet and desktop screen sizes.</p><p>The site map ensured a consistent experience across devices.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/515/0*T3rJebUsQpWKGfwx.png" /></figure><p>I used the same style sheet as for the mobile application but optimized the elements to fit the specific user needs of each device.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/60/0*NQzqMBLS8RbBHM32" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/0*msRVR5SjFLKOUVU9.png" /></figure><p>Web app for mobile, tablet and desktop</p><h3>Conclusion</h3><h3>Impact</h3><p>Users have a big interest in making better eating choices but breaking old habits is incredibly hard. This platform fills the void for nutrition learning and networking in a non-judgemental, engaging way.</p><h3>Next steps</h3><ul><li>Conduct user interviews about other functionalities of the app as journaling and recipes to fully meet users needs.</li><li>Conduct research on how successful the app is in reaching the goal to improve users health.</li></ul><h3>Learning</h3><ul><li>Food and diet can be very personal topics for many, therefore, a very sensitive approach is needed in user interviews.</li><li>Although the gradients palette is on the cooler side, the palette keeps it simple, not overwhelming the users.</li><li>Sliding buttons can be tricky to design and are not as intuitive for users as regular buttons.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=eb185babdd4a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Latest 6 top ways to tune Amazon Redshift Performance]]></title>
            <link>https://medium.com/analytics-vidhya/latest-6-top-ways-to-tune-amazon-redshift-performance-193090ad2570?source=rss-5065e694d0e0------2</link>
            <guid isPermaLink="false">https://medium.com/p/193090ad2570</guid>
            <category><![CDATA[amazon-web-services]]></category>
            <category><![CDATA[big-data]]></category>
            <category><![CDATA[data-warehouse]]></category>
            <category><![CDATA[performance-optimization]]></category>
            <category><![CDATA[redshift]]></category>
            <dc:creator><![CDATA[Solomon Soh]]></dc:creator>
            <pubDate>Sat, 14 Aug 2021 08:55:05 GMT</pubDate>
            <atom:updated>2021-08-16T04:58:51.203Z</atom:updated>
            <content:encoded><![CDATA[<p>Amazon Redshift is a very popular PB-level massively parallel data warehouse that provides an open standard JDBC/ODBC driver interface for users to directly interface with existing business intelligence tools and reuse existing analysis and query methods. This short guide is more of simple tips to optimize the performance of Amazon Redshift and provide in-depth analysis and operation guidance for various optimization methods.</p><h3>First, Query throughput is more important than query concurrency</h3><p>Configuring concurrency (such as memory management) can introduce concurrency capabilities into Amazon Redshift’s internal machine learning model through the Automatic WLM and Query Priorities queue priority mechanism. This enables automated processes to allocate more resources for certain workloads in large-scale production clusters. This approach is to maximize throughput and ensure that the Amazon Redshift cluster can complete a specific amount of work within a specific period of time, such as achieving 300 queries per minute or processing 1,500 SQL statements per hour. It is hence recommended to make full use of the concurrency mechanism to increase throughput, because throughput is a type of core performance index that has a direct impact on cluster users.</p><p>In addition to maximizing throughput by optimizing the Automatic WLM settings, the concurrent expansion function in Amazon Redshift can also extend the throughput of the cluster to 10 times the inherent throughput of the original cluster. Amazon Redshift currently sets 10 times as a soft limit for throughput. Contact the customer team to adjust the limit.</p><h3>Second, use Amazon Redshift JDBC or ODBC driver</h3><p>Amazon Web Services recommends that you use the Amazon Redshift JDBC or ODBC driver to improve performance. Each driver corresponds to a variety of optional configurations and can be further adjusted to control the amount of statement usage and the specific number of rows in the result set.</p><h3>Third, use automation features</h3><p>Amazon Redshift has added a number of automated functions, providing 100% information support for SET DW, incorporating table maintenance into Amazon Web Services service responsibilities (no longer borne by the user), and adopting more intelligent default Settings enhance out-of-the-box performance. Even if the table tasks change over time, Amazon Redshift Advisor will continue to monitor the cluster to look for various optimization opportunities. Amazon Web Services also released a benchmark solution for quantifying the performance of Amazon Redshift to easily reproduce the performance test results.</p><p>The automated features also further reduce the barriers of entry to use Amazon Redshift. This enables faster time-to-production and also better monitoring of Redshift throughput.</p><h3>Fourth, use RA3 nodes and Amazon Redshift Spectrum to achieve independent expansion of computing and storage resources</h3><p>Amazon Redshift Managed Storage will adjust the number of computing resources without being distracted by storage capacity issues. In addition, the concurrent expansion allows us to adjust other computing resources in the entire cluster according to actual needs. Amazon Redshift Spectrum uses the nearly unlimited storage capacity provided by Amazon Simple Storage Service (Amazon S3) to support the on-demand computing layer. Its capacity can be up to 10 times the capacity of the main cluster, and it now provides supporting materialized view support options. The complementary tools help to independently expand computing and storage resources.</p><h3>Fifth, use pause and restore functions to optimize usage costs</h3><p>Now, all Amazon Redshift clusters can use the pause and restore functions. For clusters created on-demand, the cluster pause operation will stop billing for services calculated per second. The reserved instance cluster can define a specific access time or freeze a data set at a specific point in time through the pause and restore function.</p><h3>Sixth, use materialized view to obtain pre-calculated results</h3><p>Materialized views can greatly improve the query performance of highly repetitive, predictable analytical workloads, including queries in dashboards, business intelligence tools, and data processing operations such as extraction, loading, and transformation (ELT). Data engineers can easily and easily create and maintain a set of efficient data processing pipelines that include materialized views, while seamlessly extending performance advantages to various data analysis and business intelligence tools.</p><p>In addition, materialized views are also suitable for query operations that need to be executed repeatedly and the results are predictable. Applications can query pre-computed data retained in materialized views without having to perform resource-intensive queries repeatedly on large tables.</p><p>When the data in the base table changes, you can issue the Amazon Redshift SQL statement “refresh materialized view” to refresh the materialized view. After issuing the refreshing statement, your materialized view will contain the same data content as a regular view. Refresh can take two specific forms: incremental refresh and full refresh (recalculation). Amazon Redshift will also refresh the changed data in the base table incrementally as much as possible after completing the last materialized view refresh.</p><p>To demonstrate how it works, we can create a set of sample schemas to store each transaction record. Creating a materialized view SQL statement to join the records from the two tables, thereby building a materialized view, and then summarizing the specific transactional records.</p><pre>CREATE MATERIALIZED VIEW xxx AS <br> (<br> SELECT xxx<br> FROM table_a, table_b<br> WHERE table_a.store_id = table_b.id<br> GROUP BY xxx<br> );</pre><p>Now, this set of materialized views can be queried like regular views or tables. When the data in the underlying base table changes, the materialized view cannot automatically reflect these changes. You can use the refresh materialized view SQL command to reflect the changes in the base table to the data in the materialized view according to your needs.</p><pre>REFRESH MATERIALIZED VIEW city_sales;</pre><p>You can also extend the advantages of materialized views to external data in Amazon S3 data lakes and other federated data sources. Using materialized views, pre-calculated results can be more easily stored, managed and referenced by SELECT statements from external tables and Amazon Redshift tables. Based on this, all subsequent queries that reference materialized views will run faster because they use the pre-computed results stored in Amazon Redshift without actually accessing external tables. You can also use this to reduce the operating costs of repeated access to external data sources, and ensure that such high-cost access is performed only when it is clear that the materialized view needs to be refreshed.</p><h3>Conclusion</h3><p>In summary, Amazon Redshift has released more enhanced features and also integration with tools that can aid performance optimization on Redshift. As data volume and velocity increase, it becomes more important to ensure that query efficiency and throughput are maintained or even optimized. These tips serve to aid any Data Engineers or Data scientists in pushing the boundaries in managing PB-level data warehouse with Redshift.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=193090ad2570" width="1" height="1" alt=""><hr><p><a href="https://medium.com/analytics-vidhya/latest-6-top-ways-to-tune-amazon-redshift-performance-193090ad2570">Latest 6 top ways to tune Amazon Redshift Performance</a> was originally published in <a href="https://medium.com/analytics-vidhya">Analytics Vidhya</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Data Warehouse — Separation of Cloud and Storage]]></title>
            <link>https://medium.com/analytics-vidhya/data-warehouse-separation-of-cloud-and-storage-85a7b92415a6?source=rss-5065e694d0e0------2</link>
            <guid isPermaLink="false">https://medium.com/p/85a7b92415a6</guid>
            <category><![CDATA[analytics]]></category>
            <category><![CDATA[big-data]]></category>
            <category><![CDATA[cloud-native]]></category>
            <category><![CDATA[data-warehouse]]></category>
            <category><![CDATA[alibabacloud]]></category>
            <dc:creator><![CDATA[Solomon Soh]]></dc:creator>
            <pubDate>Sun, 30 May 2021 04:50:41 GMT</pubDate>
            <atom:updated>2021-06-09T03:14:14.407Z</atom:updated>
            <content:encoded><![CDATA[<h3>Data Warehouse — Separation of Cloud and Storage</h3><p>There have been greater demands for cloud data warehouses to separate computing and storage. Some databases are still in the Cloud Hosting stage, just migrating the original architecture to the cloud host, using cloud resources. Some databases have entered the Cloud Native stage, based on the infrastructure of the IAAS layer of the cloud platform, to build flexibility, serverless, data sharing and other capabilities.</p><p>The advantage of separating storage and computing resources is that you can independently plan storage and computing resource specifications and capacities. In this way, the expansion, reduction, and release of computing resources can be completed relatively quickly, and will not bring additional data relocation costs. Storage and computing can also better combine their respective characteristics and choose resource specifications and designs that are more suitable for them.</p><h4>Let’s take a look at Alibaba Cloud’s native data warehouse AnalyticDB MySQL as it enhances its flexibility in the past few years.</h4><p>AnalyticDB was originally built based on the traditional Massive Parallel Processing (MPP) architecture like AWS RedShift. Recently, AnalyticDB launched a flexible model with a separate architecture for computing and storage. The AnalyticDB elastic model is divided into access layer, computing layer, and storage layer. The access layer is compatible with the MySQL protocol, including access control, optimizer, metadata, query scheduling and other modules, responsible for real-time data writing and query.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*40T-u54j7j3je0HSUqrUbw.png" /><figcaption>AnalyticDB Current Architecture</figcaption></figure><h4>Storage Layer</h4><p>Under the elastic architecture, the storage layer is responsible for real-time data writing, index construction, data scanning, and push-down predicate calculations (filtering, column clipping, partition clipping, etc.), and is no longer responsible for query calculation tasks. Data is still organized by MPP in the storage layer.</p><p>Data is evenly scattered among partitions (shards) in a hash and random manner. The shard method can easily achieve strong consistency in real-time data writing. Shard-level concurrent reading can be realized when scanning to ensure concurrency. At the same time, the storage layer provides integrated cold and hot hierarchical storage capabilities.</p><p>Data can be stored in the local SSD in the form of hot tables, stored in the underlying DFS in the form of cold tables, or stored in the form of cold and hot mixed tables to achieve the realization of hot and cold data Automatic migration, detailed in the article “The Secret of Data Warehouse Hierarchical Storage Technology”.</p><h4>Computing Layer</h4><p>In the flexible mode, the computing layer is composed of several computing nodes, and the computing nodes are responsible for receiving the physical execution plan issued by the access layer and converting them into corresponding operators according to the physical execution plan.</p><p>The computing layer adopts a vectorized execution model, and the data between operators interact in a pipeline manner. Several rows (generally several thousand rows) of data form a batch, and the internal data of the batch is organized in the form of column storage.</p><p>In addition, code is dynamically generated according to the query plan to speed up the calculation, including expression calculation, sorting, and type comparison. The planned pattern is used as the key to cache the dynamically generated code, thereby reducing the cost of dynamically generating code under interactive query.</p><h4>Execution plan</h4><p>With the ease of separation between computation and storage, a new Resharding operator can then be added to the computing layer. The operator is responsible for loading data from the storage layer. Data is transferred between the storage layer and the computing layer in batch and column storage. A single request will transmit multiple batches of data, generally not larger than 32MB.</p><p>Since the storage layer still retains the MPP data pre-partitioning method, the optimizer will reduce unnecessary data repartitions during join and aggregation operations based on this distribution feature when generating the execution plan.</p><p>In addition, the optimizer will also determine whether the filter in the query can use the storage layer index, and try to push down the filter that can be identified by the storage layer to the storage layer and use the index to speed up filtering, reducing data transmission with the computing layer. The filters that cannot be pushed down remain in the computing layer for filtering.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/790/1*F8qlJx_mZoA1ognXfQhQ7g.png" /><figcaption>Execution Plan Example</figcaption></figure><h4>Data loading optimization</h4><p>Compared with the original architecture, the separation of computing and storage has one more remote data access, which will have a greater impact on the latency and throughput of queries.</p><ul><li>By merging connections, the number of network interactions for small data queries is reduced, and query delays are reduced.</li><li>The batch data is compressed based on the column storage format, which reduces the consumption of network bandwidth and effectively improves the loading throughput of the Resharding operator.</li><li>The network module loads asynchronously put the data into the buffer, and the resharding operator obtains the data from the buffer so that the CPU and network IO are fully parallel.</li></ul><h4>Dynamic Partition Redistribution</h4><p>Between the Resharding operator and the Scan operator, the shards are redistributed according to the following principles:</p><ul><li>Multiple partitions from the same storage node should be scattered to different computing nodes as much as possible.</li><li>Within the same query, the same partitions of different tables will be mapped to the same computing node.</li><li>The same partition is randomly assigned to different computing nodes between different queries.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*pajcgmcXYnv2o42Q.png" /><figcaption>Resharding Demostration</figcaption></figure><p><strong>Unlike Snowflake and Redshift, there is no fixed mapping relationship between computing nodes and partitions</strong>, because computing nodes do not have a local cache, and the acceleration of data access depends entirely on the SDD and memory cache of the storage layer. This dynamic redistribution method can greatly alleviate problems such as uneven partitions and data skew in partitions, and will not cause hot spots for fixed computing nodes.</p><p>It can be seen with the example of Alibaba Cloud Native AnalyticDB, there is greater opportunity for computing resource pooling, on-demand elastic capabilities that enable enterprises to scale up and down drastically. The shared storage can extend its capabilities independently of that of the computing layer. Through these elastic capabilities, it can better satisfy customers’ demands for cloud data warehouses and further reduce customers’ usage costs. Looking forward to the future development of Cloud Data Warehouses technologies.</p><blockquote>REFERENCES</blockquote><blockquote>Snowflake <a href="https://www.snowflake.com/">https://www.snowflake.com/</a></blockquote><blockquote>Snowflake versus Redshift <a href="https://levelup.gitconnected.com/snowflake-vs-redshift-ra3-the-need-for-more-than-just-speed-52e954242715">https://levelup.gitconnected.com/snowflake-vs-redshift-ra3-the-need-for-more-than-just-speed-52e954242715</a></blockquote><blockquote>Databricks <a href="https://databricks.com/session/taking-advantage-of-a-disaggregated-storage-and-compute-architecture">https://databricks.com/session/taking-advantage-of-a-disaggregated-storage-and-compute-architecture</a></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=85a7b92415a6" width="1" height="1" alt=""><hr><p><a href="https://medium.com/analytics-vidhya/data-warehouse-separation-of-cloud-and-storage-85a7b92415a6">Data Warehouse — Separation of Cloud and Storage</a> was originally published in <a href="https://medium.com/analytics-vidhya">Analytics Vidhya</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Sentiment Analysis for Customer Experience With Python and Streamlit]]></title>
            <link>https://medium.com/analytics-vidhya/sentiment-analysis-for-customer-experience-with-python-and-streamlit-42e8ea1db56?source=rss-5065e694d0e0------2</link>
            <guid isPermaLink="false">https://medium.com/p/42e8ea1db56</guid>
            <category><![CDATA[chatbots]]></category>
            <category><![CDATA[analytics]]></category>
            <category><![CDATA[sentiment-analysis]]></category>
            <category><![CDATA[nlp]]></category>
            <category><![CDATA[streamlit]]></category>
            <dc:creator><![CDATA[Solomon Soh]]></dc:creator>
            <pubDate>Tue, 25 May 2021 02:00:23 GMT</pubDate>
            <atom:updated>2021-05-27T16:39:54.125Z</atom:updated>
            <content:encoded><![CDATA[<h4>Start leveraging on Vonage Messaging API to improve customer service such as collating review feedback from social media platforms such as Facebook.</h4><p>Sentiment analysis mines insights from customers feedback using natural language processing techniques to determine whether feedback data is positive, negative or neutral. Business leverage on sentiment analysis to monitor product and brand sentiment and also understand what the customer needs.</p><p>This tutorial covers the following items:</p><ul><li>Initialise the Messages API Sandbox on Vonage</li><li>Collect data from customers through Facebook</li><li>Create a bot to handle feedback from customers on Facebook by:</li><li>Storing this data into a database or text file</li><li>Returning relevant responses to the customer</li><li>Create a dashboard through Streamlit to understand the sentiments of customers feedback in real-time</li><li>Measure customers sentiments with a positive, negative, neutral scale</li><li>Analyze customers key pain points with visualization</li></ul><h3>Prerequisites</h3><ul><li><a href="https://nodejs.org/en/download/">Node.js</a></li><li><a href="https://www.python.org/download/releases/3.0/">Python3</a></li></ul><h3>Vonage API Account</h3><p>To complete this tutorial, you will need a <a href="http://developer.nexmo.com/ed?c=blog_text&amp;ct=2021-05-04-sentiment-analysis-for-customer-experience-with-python-and-streamlit">Vonage API account</a>. If you don’t have one already, you can <a href="http://developer.nexmo.com/ed?c=blog_text&amp;ct=2021-05-04-sentiment-analysis-for-customer-experience-with-python-and-streamlit">sign up today</a> and start building with free credit. Once you have an account, you can find your API Key and API Secret at the top of the <a href="http://developer.nexmo.com/ed?c=blog_text&amp;ct=2021-05-04-sentiment-analysis-for-customer-experience-with-python-and-streamlit">Vonage API Dashboard</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*HHgYf7h7WINxcO_O.png" /></figure><h3>Creating a Facebook Bot</h3><p>The Messages API Sandbox allows businesses to send and receive messages through various social channels, such as WhatsApp, Facebook, and Viber. It also allows businesses to send SMS and MMS through this API. In order to send messages through any of the external social channels, you’ll need a business account with each provider and have it connected to your Vonage APIs account.</p><p>For this tutorial we’ll be using Facebook, so make sure you have a Facebook account ready to test with.</p><p>To start creating our application, in the directory of your project run the following command to initialize the node project, and then install the third party libraries required:</p><pre>npm init -y<br>npm install express body-parser nedb @vonage/server-sdk@beta dotenv</pre><p>The above commands will create package.json, package.lock files as well as a node_modules directory. Within the package.json file you’ll see the libraries we’ve just installed such as express and vonage/server-sdk. An example of what you’ll see is shown below:</p><pre>{<br>  &quot;name&quot;: &quot;facebook-bot&quot;,<br>  &quot;version&quot;: &quot;1.0.0&quot;,<br>  &quot;description&quot;: &quot;Sign up for a Vonage API account at https://dashboard.nexmo.com.&quot;,<br>  &quot;main&quot;: &quot;index.js&quot;,<br>  &quot;scripts&quot;: {<br>    &quot;serve&quot;: &quot;node index.js&quot;<br>  },<br>  &quot;keywords&quot;: [],<br>  &quot;author&quot;: &quot;&quot;,<br>  &quot;license&quot;: &quot;ISC&quot;,<br>  &quot;dependencies&quot;: {<br>    &quot;@vonage/server-sdk&quot;: &quot;^2.10.7-beta&quot;,<br>    &quot;body-parser&quot;: &quot;^1.19.0&quot;,<br>    &quot;dotenv&quot;: &quot;^8.2.0&quot;,<br>    &quot;express&quot;: &quot;^4.17.1&quot;,<br>    &quot;nedb&quot;: &quot;^1.8.0&quot;<br>  },<br>  &quot;devDependencies&quot;: {}<br>}</pre><p>When a message comes in from Facebook, Vonage will send an HTTP request to a preconfigured webhook URL. Your Node application should be accessible to the internet to receive it, so we recommend using <a href="https://learn.vonage.com/blog/2017/07/04/local-development-nexmo-ngrok-tunnel-dr">Ngrok</a>.</p><p>In your Terminal, run the following command to launch Ngrok on port 3000 (Please note, the forwarding URL changes each time ngrok is restarted so keep that in mind if you were to restart ngrok):</p><pre>npx ngrok http 3000</pre><p>We now need to create an application in the <a href="https://dashboard.nexmo.com/applications/new">dashboard</a>. Make sure to add a name relevant to the purpose of the application, then toggle Messages on as this application will need to make use of the Messages API. Then click the button “Generate public and private key”. This will force your browser to download a private.key file. Place this within the root directory of your project. Finally, click the Generate new application button, this will redirect you to the application show page. Make a copy of the Application ID shown on the page as this will also be needed in the code further below.</p><p>While you’re on this page, we need to define the webhooks URLs. A webhook is an extension of an API, but instead of your code requesting data from the API platform, Vonage sends the data to you. The data arrives in a web request to your application, which may be the result of an earlier API call (this type of webhook is also called a “callback”), such as an asynchronous request to the Messaging API. Webhooks are also used to notify your application of events such as an incoming message to be stored in a file or send an outgoing message to the app.</p><p>The URLs need to be updated in the <a href="https://dashboard.nexmo.com/messages/sandbox">dashboard</a> as shown below (Be sure to replace &lt;ngrok URL&gt; with your ngrok url):</p><ul><li>Inbound Webhooks: http://&lt;ngrok URL&gt;/webhooks/inbound</li><li>Status Webhooks: http://&lt;ngrok URL&gt;/webhooks/status</li></ul><p>Navigate back to the <a href="https://dashboard.nexmo.com/messages/sandbox">Messages Sandbox</a> to whitelist your Facebook account with the Facebook Messenger Sandbox. Click Add to sandbox and follow the instructions provided on the page.</p><p>Store your credentials into a .env file that can be accessed through index.js.</p><pre>VONAGE_API_KEY=###<br>VONAGE_API_SECRET=###<br>VONAGE_APPLICATION_ID=e0c5d5d8-###</pre><p>Next, in the index.js file, include modules that have been installed previously such as express, Vonage server-sdk as shown in the example below:</p><pre>const app = require(&#39;express&#39;)()<br>const bodyParser = require(&#39;body-parser&#39;)<br>const nedb = require(&#39;nedb&#39;)<br>const Vonage = require(&#39;@vonage/server-sdk&#39;)</pre><p>Then, we need to create a database with the filename messages.db, add the following line into your index.js file:</p><pre>const messages = new nedb({ filename: &#39;messages.db&#39;, autoload: true })</pre><p>We now need to initialize a new Vonage object with our credentials consisting of the API key, API secret, application ID, along with the path and filename of the private.key. We also need to set the host URL of the API to point at the sandbox URL. In your index.js file add the following code:</p><pre>const vonage = new Vonage({<br>  apiKey: process.env.VONAGE_API_KEY,<br>  apiSecret: process.env.VONAGE_API_SECRET,<br>  applicationId: process.env.VONAGE_APPLICATION_ID,<br>  privateKey: &#39;./private.key&#39;<br>}, {<br>  apiHost: &#39;https://messages-sandbox.nexmo.com&#39;<br>})</pre><p>We’re going to create a function called sendMessage, which will send messages to Facebook in response to the customers’ queries, feedback, or reviews. In the function, which is shown in the example below, there is a to and a from, which will be instructions to the API. The to (or recipient) needs to be the whitelisted Facebook account. Add the function below into your index.js file:</p><pre>function sendMessage(sender, recipient, text) {<br>  const to = { type: &#39;messenger&#39;, id: recipient }<br>  const from = { type: &#39;messenger&#39;, id: sender }<br>  const message = { content: { type: &#39;text&#39;, text: text } }<br> <br>  vonage.channel.send(to, from, message, function(error, result) {<br>    if(error) { return console.error(error) }<br>    console.log(result)<br>  })<br>}</pre><p>In the example above you’ll see vonage.channel.send, which sends a message with the parameters of to, from and message and in the event of an error, returns this error, and will log the error message.</p><p>Next, we’ll need to add the webhook in our application to listen for the path /webhooks/inbound in the URL, which will receive messages from the Messages API whenever a Facebook message is received. It parses and obtains the messenger id of the sender from the body and also the text that is sent, together with the timestamp and insert in the response messages given either a condition of error if-else will be a successful understanding of the users’ feedback.</p><p>If an error occurs, the message sent back to the sender will be “Sorry! Could you repeat?”. On the other hand, should the messenger retrieve and send the message by the customers to the app, it will be stored in messages.db while a response of “Thanks for your feedback and review!” will be returned to the users. So add the following to your index.js file:</p><pre>app.post(&#39;/inbound&#39;, function(request, response) {<br>  if (request.body.message.content.text.toLowerCase().trim() === &#39;recap&#39;) {<br>    messages.find({&#39;from.id&#39;: request.body.from.id }, function (error, records) {<br>      if (error) { return console.error(error) }<br>      const message = records.map(function(record) {<br>        return record.message.content.text + &#39; (sent at &#39; + record.timestamp + &#39;)&#39;<br>      }).join(&#39;\n\n&#39;)<br>      sendMessage(request.body.to.id, request.body.from.id, message)<br>    })<br>  } else {<br>    messages.insert(request.body, function (error, record) {<br>      if (error) {<br>        sendMessage(request.body.to.id, request.body.from.id, &#39;Sorry! Could you repeat?&#39;)<br>        return console.error(error)<br>      }<br>      sendMessage(request.body.to.id, request.body.from.id, &#39;Thanks for your feedback and review!&#39;)<br>    })<br>  }<br> <br>  response.send(&#39;ok&#39;)<br>})</pre><p>Lastly, we need to add another listener for the /webhooks/status endpoint, which will return the message “ok”. We also need to add the listen functionality, which keeps the application running and listening as a webserver on port 3000. So at the bottom of your index.js file add the following:</p><pre>app.post(&#39;/status&#39;, function(request, response) {<br>  console.log(request.body)<br>  response.send(&#39;ok&#39;)<br>})<br>app.listen(3000)</pre><p>Now it’s time to test your application! First you need to run your web application, in your Terminal, run the following command:</p><pre>node index.js</pre><p>Now, if you go to <a href="https://www.messenger.com/">Facebook Messenger</a>, find the Vonage Sandbox user and send it a message. You’ll receive a response in Messenger.</p><h3>Analyze User’s Feedback</h3><p>The data from the customers’ Facebook through Vonage sandbox is stored in the messages.db file. In a simulated demonstration, a user critiqued the products and services of a bespoke firm and a sample of the data is recorded in the example script below.</p><pre>{&quot;message_uuid&quot;:&quot;e6e659be-3cdb-464f-96ef-8597cb307586&quot;,&quot;from&quot;:{&quot;type&quot;:&quot;messenger&quot;,&quot;id&quot;:&quot;3819505444810553&quot;},&quot;to&quot;:{&quot;type&quot;:&quot;messenger&quot;,&quot;id&quot;:&quot;107083064136738&quot;},&quot;message&quot;:{&quot;content&quot;:{&quot;type&quot;:&quot;text&quot;,&quot;text&quot;:&quot;how terrible can this product be, does not solve my pain point&quot;}},&quot;timestamp&quot;:&quot;2021-03-15T08:43:30.993Z&quot;,&quot;_id&quot;:&quot;6TdDhlo8CVxEr7tq&quot;}<br>{&quot;message_uuid&quot;:&quot;7775fa83-f073-481c-8866-c60bca28ec97&quot;,&quot;from&quot;:{&quot;type&quot;:&quot;messenger&quot;,&quot;id&quot;:&quot;3819505444810553&quot;},&quot;to&quot;:{&quot;type&quot;:&quot;messenger&quot;,&quot;id&quot;:&quot;107083064136738&quot;},&quot;message&quot;:{&quot;content&quot;:{&quot;type&quot;:&quot;text&quot;,&quot;text&quot;:&quot;how can there be no response for so long on such bad service&quot;}},&quot;timestamp&quot;:&quot;2021-03-15T08:44:37.924Z&quot;,&quot;_id&quot;:&quot;GSVzREWsYllKHOlJ&quot;}</pre><p>We can see that each message_uuid is unique for each message sent to the Facebook bot. The from and to specifies the identity of the customers and bot respectively. The message contains the content which is in a type of text and is simply the feedback provided by the customer. To analyze this feedback, they will be visualized through the python Streamlit framework with libraries such as TextBlob, WordCloud, Matplotlib, and Pandas. Create a new file called dashboard.py and add the following code into this new file:</p><pre>import streamlit as st<br>from textblob import TextBlob<br>from wordcloud import WordCloud, STOPWORDS, ImageColorGenerator<br>import matplotlib.pyplot as plt<br>import pandas as pd<br>st.set_option(&#39;deprecation.showPyplotGlobalUse&#39;, False)</pre><p><a href="https://streamlit.io/">Streamlit</a> is an open-source app framework for Machine Learning and Data Science teams. <a href="https://textblob.readthedocs.io/en/dev/">TextBlob</a> is a Python library for processing textual data. It provides a simple API for diving into common natural language processing (NLP) tasks. WordCloud is a technique to show which words are the most frequent among the given text. <a href="https://matplotlib.org/">Matplotlib</a> is a comprehensive library for creating static, animated, and interactive visualizations in Python. <a href="https://pandas.pydata.org/">Pandas</a> is a fast, powerful, flexible and easy to use open-source data analysis and manipulation tool, built on top of the Python programming language.</p><p>With all these tools, first, we open the data stored in messages.db, read and process every record of feedback collected from all users. We look for the messages/content and remove the timestamp because that is not needed for the analysis of sentiment in the feedback. The processed feedback will be stored in a list.</p><p>The example below carries out the instructions listed above. Add this to the bottom of your dashboard.py file:</p><pre>file1 = open(&#39;messages.db&#39;, &#39;r&#39;)<br>Lines = file1.readlines()<br>feedback_list = list()<br>for line in Lines:<br>   feedback = line.split(&quot;:&quot;)[11]<br>   feedback = feedback.replace(&#39;}},&quot;timestamp&quot;&#39;,&quot;&quot;)<br>   feedback_list.append(feedback)</pre><p>Next, we generate a word cloud to visualize the frequency of the words provided in the feedback by the users. We can see that certain keywords are much more prominent such as “terrible”, “long”, “bad” etc. Wordcloud simply counts how many times each word has appeared in all the sentences of feedback provided by customers. A better way would be to analyze the overall sentiment of the customer.</p><p>We can use TextBlob basic sentiment polarity analysis on the sentence that gives a relatively reliable estimate of the emotive experiences of the customer from their textual feedback and store in a new list of sentiment values. Now in your dashboard.py add the following code:</p><pre>sentiment_values = list()<br>for feedback in feedback_list:<br>    sentiment_feedback = TextBlob(feedback).sentiment.polarity<br>    sentiment_values.append(sentiment_feedback)</pre><p>Next, we will show the overall sentiment within a range of -1 to 1. For sentiment polarities above 0, the output will be green whereas, for those negative values which mean unhappiness, the sentiment will be shown as red on the webpage. Copy the following into your dashboard.py file:</p><pre>st.title(&quot;Overall Sentiment&quot;)<br>if average_sentiment &gt; 0:<br>   colors = &#39;green&#39;<br>else:<br>   colors = &#39;red&#39;</pre><p>Currently, the overall sentiment is -0.417 which suggests that overall a lot of the feedback is not in support of the products and services of the firm. We can see the feedback in a table with each of the feedback sentiments being shown. There are few sentiments of 0 value. This means that the analysis found this feedback to be neutral and cannot understand the negative connotations of the message. We can see that “This product cannot match up…” and “will only use this product if it is given to me free” would suggest negative sentiments yet, the result is neutral or positive. Hence, a more complex model to learn and train can be developed for sentiment analysis for this use case. Moreover, the overall sentiment analysis may not want to be just a simple average but rather potential more complex calculations or a weighted average.</p><p>The Streamlit web dashboard app can be started by initializing the following command. Streamli needs to be installed for the web dashboard to be set up. Other deployment methods in flask or Django work equally as well and can be explored.</p><pre>streamlit run dashboard.py</pre><p>In conclusion, this tutorial has shown how to set up and connect a Vonage Messages API to Facebook and collect feedback from customers which is then analyzed using sentiment analysis to do real-time monitoring of the sentiments of customers.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=42e8ea1db56" width="1" height="1" alt=""><hr><p><a href="https://medium.com/analytics-vidhya/sentiment-analysis-for-customer-experience-with-python-and-streamlit-42e8ea1db56">Sentiment Analysis for Customer Experience With Python and Streamlit</a> was originally published in <a href="https://medium.com/analytics-vidhya">Analytics Vidhya</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Comparisons amongst various methods to handle streaming data]]></title>
            <link>https://medium.com/analytics-vidhya/comparisons-amongst-various-methods-to-handle-streaming-data-a293f7be9087?source=rss-5065e694d0e0------2</link>
            <guid isPermaLink="false">https://medium.com/p/a293f7be9087</guid>
            <category><![CDATA[big-data]]></category>
            <category><![CDATA[parallel-processing]]></category>
            <category><![CDATA[function-compute]]></category>
            <category><![CDATA[alibabacloud]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <dc:creator><![CDATA[Solomon Soh]]></dc:creator>
            <pubDate>Sun, 14 Mar 2021 01:50:50 GMT</pubDate>
            <atom:updated>2021-03-14T13:02:11.749Z</atom:updated>
            <content:encoded><![CDATA[<p>In recent years, in some shopping malls, libraries, airports or port environments, we can often see some robots turning around. They are well-known for guiding customers. Not only that, in fact, some pioneering companies will also use robots to collect the characteristic data of these densely populated areas, and report these characteristic data to perform rapid cleaning and processing, thereby providing meaningful countermeasures or guidance. Commercial transformation such as information (advertising) placement decisions.</p><p>These robots will be delivered on-demand at different time periods and will report when the collected data changes significantly or within a certain fixed period. When data collection changes greatly, reporting tends to be frequent, and the demand for subsequent data cleaning and processing tasks will increase simultaneously.</p><p>In this article, we will discuss how to deal with such scenarios of query processing more appropriately in terms of technology selection.</p><p>Scene characteristics and requirements for efficient and fast query processing:</p><h3>1. Data channel connection capability</h3><ul><li>With the expansion of the business, the delivery of robots will increase simultaneously with the data channel. There is enough expansion flexibility for the data channel and can be expanded on demand. At the same time, the connection level can support 10W+ level expansion.</li></ul><h4>Kafka could be a good tool</h4><ul><li>As a general data collection information channel, Kafka has a wide range of applications and diversified access methods. The community is perfect and the cost of learning is low. Kafka itself is easy to build, and the coordination scheme with downstream big data processing products is mature.</li><li>However, the dynamic processing of Kafka’s expansion is complicated.<br>It is necessary to build a stable supporting program for additional processing clusters.</li></ul><h4>Alternatively, the Message queue MQTT solution</h4><ul><li>It supports millions of connections, fulfils the requirements that can cover business development, and leaves enough room for business expansion.<br>The MQTT protocol is very concise and has advantages in the transmission between the terminal and the service. MQTT supports the QoS quality reached by various messages. and also various client access implementation languages. The connection status of the client can be observed in real-time to facilitate the discovery of abnormal conditions.</li><li>The only limitation is that big data processing is not as mature as Kafka.</li></ul><h3>2. Concise data cleaning ability</h3><ul><li>The processing of data is essentially the summary and statistics of the data, and the logical realization is not complicated. For the peak and valley changes of the data itself, it is enough to have the simplest and effective matching expansion and contraction processing capabilities, and it is not desirable to introduce complex traditional big data-level cumbersome solutions for cleaning.</li></ul><h4>Big data solutions (Storm, Spark, Flink, etc.)</h4><ul><li>An open-source general solution with a large amount of information and a mature solution.</li><li>The challenge lies in the construction, operation and maintenance being complex, and additional monitoring and recovery methods need to be provided. Need to learn how to accept various components (the following figure is an example of Storm).</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/329/0*sna75VpDb94s8aya.jpg" /><figcaption>Storm Architecture</figcaption></figure><h4>Alternatively, the Function calculation scheme</h4><ul><li>Expand and shrink on demand, with a 100-millisecond-level expansion and contraction capability, suitable for the peak and valley changes of the data volume. There is no need to manage the cleaning environment. The concept is also simple and the learning cost is low.</li><li>Function computing is usually only available on various cloud vendors. The requirements must be run on the cloud.</li></ul><h3>3. Flexible data access capabilities</h3><ul><li>The amount of access is dynamically changing, and there will be unpredictable amplitudes with different times, festivals, emergencies, etc. Changes, so flexible access capabilities are required in this business. The business side does not want to achieve it through current limiting, because it will affect the business volume itself.</li></ul><h4>API Gateway+Functional Computing Solution</h4><ul><li>Real-time elasticity processing according to the number of customer requests. Use on-demand, don’t worry about peak hours, and won’t pay for idle. Automatically comes with professional access to monitor the market.</li><li>However, a small number of learning costs.</li></ul><h3>4. Excellent storage capacity</h3><ul><li>In this scenario, data writing and reading are concurrently high, and customers want to use NoSQL for storage. The NoSQL type can best support the sorting function. Redis is used in the scheme introduced in this article, and no more analysis is introduced.</li></ul><p>Bringing all together, a flexible, connected pipeline can be developed on Alibaba Cloud with excellent data storage and cleaning capabilities.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rVi48a4jnNaYeREkPIhKag.png" /><figcaption>Pipeline Sample</figcaption></figure><h4>MQTT Node.JS</h4><pre>module.exports.handler = function(event, context, callback) { <br>    var event = JSON.parse(event);<br>    var content = {<br>      path: event.path,<br>      method: event.method,<br>      headers: event.headers,<br>      queryParameters: event.queryParameters,<br>      pathParameters: event.pathParameters,<br>      body: event.body<br>    // Include logics here<br>    // Include logics to extract data from Redis<br>      }<br>    var response = {<br>         isBase64Encoded: false,<br>         statusCode: &#39;200&#39;,<br>         headers: {<br>           &#39;x-custom-header&#39;: &#39;header value&#39;<br>         },<br>         body: content<br>       };<br>     callback(null, response)<br> };</pre><p>Concluding that in the current Big Data era, there are many instruments for reporting various pulse data, such as sensors for new energy vehicles, reporting of bus location, unlocking of smart property management, parking management of smart parking lots, sales of unmanned stores, and so on. In various scenarios, the processing of reported data is ubiquitous, and the scenarios mentioned above can be implemented by referencing optimization in the way of MQTT+FC+API Gateway in this solution.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a293f7be9087" width="1" height="1" alt=""><hr><p><a href="https://medium.com/analytics-vidhya/comparisons-amongst-various-methods-to-handle-streaming-data-a293f7be9087">Comparisons amongst various methods to handle streaming data</a> was originally published in <a href="https://medium.com/analytics-vidhya">Analytics Vidhya</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>