<?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 Sunny May on Medium]]></title>
        <description><![CDATA[Stories by Sunny May on Medium]]></description>
        <link>https://medium.com/@1048463053?source=rss-2d0781cefb8------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*tgdf0m03-jOOn4kIn8ZAzA.jpeg</url>
            <title>Stories by Sunny May on Medium</title>
            <link>https://medium.com/@1048463053?source=rss-2d0781cefb8------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 01 Dec 2026 15:49:48 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@1048463053/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[Why Chat Surveys Matter and How to Build Your Own]]></title>
            <link>https://medium.com/@1048463053/why-chat-surveys-matter-and-how-to-build-your-own-f19db16bfbf0?source=rss-2d0781cefb8------2</link>
            <guid isPermaLink="false">https://medium.com/p/f19db16bfbf0</guid>
            <category><![CDATA[online-survey]]></category>
            <category><![CDATA[surveys]]></category>
            <category><![CDATA[chat-survey]]></category>
            <category><![CDATA[build-survey]]></category>
            <dc:creator><![CDATA[Sunny May]]></dc:creator>
            <pubDate>Tue, 26 Dec 2023 05:45:24 GMT</pubDate>
            <atom:updated>2023-12-26T05:45:24.037Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hnPjw9GpgtGjssOcMjW7sg.png" /></figure><h3>What is a chat survey?</h3><p>A chat survey is an online survey that gathers information from users through conversational interactions, presenting questions one at a time and adjusting based on the user’s previous answers. Unlike traditional form surveys that use structured questions through links, chat surveys offer a more dynamic and interactive user experience.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*moOxHsyZye1izEXMiBQDxQ.png" /><figcaption>Form survey and chat survey</figcaption></figure><p><strong>Chat surveys VS form surveys</strong></p><ol><li><strong>Interface</strong>: Chat surveys primarily utilize text responses, while form surveys allow for more advanced interactions, such as uploading media.</li><li><strong>Data validation</strong>: Most platforms for building form surveys support common data types like text, number, email, date, and time. However, platforms for building chat surveys, similar to building agents, support additional data types like phone numbers and regions. This enables automatic data validation, reducing manual effort.</li><li><strong>Integration</strong>: Form surveys have fixed appearances, making it challenging to integrate them with existing communication channels. In contrast, chat surveys can be easily integrated into websites or channels like Facebook and WhatsApp, providing a seamless user experience. Users don’t need to click on a survey link and navigate to another page, ensuring security as well.</li><li><strong>Conditional questions</strong>: Conditional questions are questions that depend on the answer to a previous question. Some survey platforms do not support conditional questions, while others impose limitations on certain data types. However, chat survey platforms like OpenCUI make it easy to add conditional questions, even supporting complex conditions.</li></ol><p>In summary, chat surveys are ideal for those seeking simple interfaces, automatic data validation for various data types, integration into websites or other channels, inclusion of conditional questions, and effective handling of user responses.</p><h3>How to build a chat survey?</h3><p>Common use cases for survey include collecting customer experience, areas for improvement, data for market research, employee engagement level and effetiveness of products. To illustrate the process of building a chat survey, we will use the OpenCUI platform and the following sample questionnaire related to prescription drugs, diabetes, banking, and healthcare plans.</p><pre>[Q1]: Do you currently take six or more prescription drugs? <br>    &gt; If yes, go to [Q1a]: How many prescription medications do you take?<br>    <br>[Q2]: Have you ever been diagnosed with diabetes?<br>    &gt; If yes, go to [Q2a]:<br>    Which diabetes have you been diagnosed with?<br>    1. Type 1 diabetes<br>    2. Type 2 diabetes<br>    3. Pre-diabetes<br>    4. Atypical diabetes<br>    <br>[Q3]: Would you like us to contact you to open a checking or savings account when this is available?<br><br>[Q4]: Which plan are you currently on? <br>    1. Dual Eligible<br>    2. Medicare<br>    3. Medicaid</pre><h4>Prepare the options: Create entities</h4><p>In OpenCUI, fixed options for questions can be provided using entities. For this survey, we can create entities to represent the options available for specific questions, such as DiabetesType and Plan.</p><ol><li><strong>DiabetesType</strong> : Type 1 diabetes, Type 2 diabetes, pre-diabetes,and atypical diabetes.</li><li><strong>Plan</strong>: Dual Eligible, Medicare and Medicaid.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ILcZw2arknu6J9OkXpKRYA.png" /><figcaption>DiabetesType entity</figcaption></figure><h4>Add conditional questions: Create frames</h4><p>Conditional questions, such as Q1a and Q2a, can be handled using frames in OpenCUI. Frames allow for the inclusion of conditional questions that are only asked when the answer to their main question is positive. Slots can be added within each frame to extract information from the user’s responses.</p><ol><li>For Q1a, create a frame <strong>GetDrugsNumber</strong> and add a slot number with type <strong>Int</strong>. Then, set Q1a as a prompt for this slot.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZrbGOywM8O4fynEwVRbhxQ.png" /><figcaption>Set a prompt</figcaption></figure><p>2. For Q2a, create a frame <strong>GetDiabetesType</strong> and add a slot diabetesType with type <strong>DiabetesType</strong>. Similarly, set Q2a as a prompt for this slot. Since there are fixed options for this slot, enable value recommandation and display the options using the provided code snippet:</p><pre>//Source<br>DiabetesType.getAllInstances()<br><br>// Body<br>[${it.index + 1}] ${it.value!!.expression()}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eVsgC59E6nkjjKSilz5NPg.png" /><figcaption>Add value recommandation</figcaption></figure><h4>Compose the survey: Create a skill</h4><p>For the main questions, create a skill <strong>GetQuestionaireAnswers</strong> to include them. Boolean gates can be added for conditional questions, determining whether to proceed to the corresponding frames based on the user’s responses. When the user responds affirmatively to a gated prompt, the relevant frame will be accessed and progressed through.</p><ol><li>For Q1, add a slot with type <strong>GetDrugsNumber</strong> and set Q1 as the gated prompt for this slot.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*66TC9tQul1xCPCn9U-3-ow.png" /><figcaption>Set gated prompt</figcaption></figure><p>2. For Q2, follow the same strategy and add a slot with type <strong>GetDiabetesType</strong> , setting Q2 as the gated prompt for this slot.</p><p>3. For Q3, add a slot isAcctOpenContact with type <strong>Boolean</strong> and set Q3 as the prompt for this slot.</p><p>4. For Q4, add a slot currentPlan with type <strong>Plan </strong>and<strong> </strong>set<strong> </strong>Q4 as the prompt for this slot. Similar to the slot diabetesType, add value recommandation for this slot using the provided code snippet:</p><pre>//Source<br>Plan.getAllInstances()<br><br>// Body<br>[${it.index + 1}] ${it.value!!.expression()}</pre><h3>Test the chat survey</h3><p>After building the chat survey, it’s crucial to test its functionality. The debug tool can be used to simulate conversations and ensure that the survey behaves as expected.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FIfekrlyTZ6f4wl8NcuRtg.png" /><figcaption>Conversation: Chat survey</figcaption></figure><p>In this article, we have focused on defining the interaction part of the chat survey. The storage part, which involves storing user answers, has not been covered. However, it can be easily implemented using a PostgreSQL provider to upload data into a PostgreSQL database. If you would like to learn more about this, please leave a comment.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f19db16bfbf0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Build a Restaurant Agent with Microsoft Copilot Studio]]></title>
            <link>https://medium.com/@1048463053/a-comprehensive-guide-to-building-a-restaurant-agent-with-microsoft-copilot-studio-f5eeb9761b90?source=rss-2d0781cefb8------2</link>
            <guid isPermaLink="false">https://medium.com/p/f5eeb9761b90</guid>
            <category><![CDATA[microsoft-copilot]]></category>
            <category><![CDATA[guidelines]]></category>
            <category><![CDATA[agents]]></category>
            <dc:creator><![CDATA[Sunny May]]></dc:creator>
            <pubDate>Mon, 11 Dec 2023 09:52:22 GMT</pubDate>
            <atom:updated>2023-12-20T05:25:42.591Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vugcbiROTRJ97s1ZR1xcVw.png" /></figure><p><a href="https://www.microsoft.com/en-us/microsoft-copilot/microsoft-copilot-studio">Microsoft Copilot Studio</a> is an advanced tool that enables the creation of powerful AI-powered copilots for a range of applications. While many guides detail its information retrieval capabilities, this guide presents a different angle — designing a restaurant assistant. We will walk you through the process and discuss significant aspects when executing complex tasks.</p><h3>Use case 1: Table reservation</h3><p>Restaurants often need to oversee table reservations. For an agent to effectively handle reservations, it must collect key details like the number of diners, the preferred date and time for booking. Once confirmed, this data should be stored where restaurant staff can access it.</p><h4>Handling insufficient user information</h4><p>Initially, we attempted to save the date and time as a dateTime type. However, if a user only provides a date, the system automatically defaults the time to &quot;12:00 AM&quot;.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tHNWMoZNPoOyfuxjM3AtYw.png" /><figcaption>User provides date without specific time, defaulted to “12:00 AM”</figcaption></figure><p>To rectify this, we decided to collect date and time separately. As the platform doesn’t offer “Time” as a prebuilt entity nor support it as a custom entity, we used the “Date and Time” entity to collect the time. We then extracted the time value using <a href="https://learn.microsoft.com/en-us/power-platform/power-fx/overview">Power FX</a> language:</p><pre>Time( Hour(Topic.dateTime), Minute(Topic.dateTime), Second(Topic.dateTime) )</pre><h4>Uploading reservation using actions</h4><p>Before confirming a reservation, we need to save this information where restaurant operators can access it. <a href="https://learn.microsoft.com/en-us/connectors/connectors">Connector</a> actions are handy for managing data. For instance, <a href="https://learn.microsoft.com/en-us/connectors/excelonline/">Excel Online</a> connector or <a href="https://learn.microsoft.com/en-us/connectors/postgresql/">PostgreSQL</a> connector could be used.</p><p>For demonstration, let’s consider the Excel Online connector. In Microsoft 365, we created a new excel sheet with a table to store reservation information.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xv_1vf9p4dDJgqkXihzIdg.png" /><figcaption>Table in Restaurant.xsl</figcaption></figure><p>In Copilot Studio, we added a <strong>Call an action</strong> node and selected the “<a href="https://learn.microsoft.com/en-us/connectors/excelonline/#add-a-row-into-a-table">Add a row into a table</a>” action. However, due to a bug, the columns of the table didn’t load as expected. Once this bug is rectified, the reservation data should be saved successfully.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UnsxruRjV9IUq5GMuwgH2g.png" /><figcaption>Comparison of Copilot Studio and Power App input fields</figcaption></figure><p>For now, we’ll skip the uploading section. The final conversation might resemble the following:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ARJd7vB7wus_LQxX-au4og.png" /><figcaption>Reservation conversation (Horizontal Arrangement)</figcaption></figure><h3>Use case 2: Food ordering</h3><p>Let’s now tackle another common task — food ordering. In this scenario, we have three categories: pizza, appetizer, and drink. Each category offers several options.</p><h4>Recommending dishes based on categories</h4><p>In food ordering scenarios, the choices for category, dish, size, and toppings are fixed. We created entities to store these fixed options. This allows the copilot to recognize them accurately and recommend values based on different entities.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CG47HJ5hiNCCJBL7b0a66g.png" /><figcaption>DishName entity definition</figcaption></figure><p>To show different dishes based on the chosen category, we added two <strong>Condition</strong> nodes to list dish options for each category.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CYLq-WYk7JVtGioMptrEeA.png" /><figcaption>Nodes defining conditions (Horizontal Arrangement)</figcaption></figure><h4>Handling Multi-select Options</h4><p>For multi-select options such as selecting multiple pizza toppings, Copilot Studio uses the <a href="https://learn.microsoft.com/en-us/power-apps/maker/canvas-apps/working-with-tables#table">Table</a> type. However, since table types cannot be changed, we used the <a href="https://learn.microsoft.com/en-us/power-platform/power-fx/reference/function-concatenate#concatenate-with-a-single-column-table">Concatenate</a> function to combine multiple options into a string. Here’s how:</p><ol><li>Add a <strong>Set variable value</strong> node: Initialize a toppingList variable to an empty string: &quot;&quot;.</li><li>Add a <strong>Question</strong> node: Ask which toppings the user wants (Topping; saved as topping)</li><li>Add a <strong>Set variable value</strong> node: Conbine the current topping list with the user’s choice into a single string. Set a toppingList variable to <strong>Formula</strong>:</li></ol><pre>Concatenate( Topic.toppingList, &quot;,&quot;, Topic.topping ) </pre><p>4. Add a <strong>Question</strong> node: Ask if the user wants additional toppings (Boolean; saved as isAddMore)</p><p>5. Add a <strong>Condition</strong> node: If isAddMore is equal to true, go back to the previous <strong>Question</strong> node.</p><p>6. Add a <strong>Set variable value</strong> node: Remove the first character “,” from the toppingList variable. Set a toppingList variable to <strong>Formula:</strong></p><pre>Mid(Topic.toppingList, 2, Len(Topic.toppingList) - 1) </pre><p>By following these steps and adding the necessary nodes, the copilot worked as expected.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PnpSPA6Vebxo4PgeDkeMPQ.png" /><figcaption>Food ordering conversation (Horizontal Arrangement)</figcaption></figure><p>Note that there’s currently no function to add records to an existing table, making storing multiple dishes challenging. A solution to this issue is still in progress.</p><h3>Key take aways</h3><p><strong>Benefits of Copilot Studio</strong></p><ul><li>It provides an intuitive, flow-based approach to building copilots.</li><li>It allows integration with business data through various <a href="https://learn.microsoft.com/en-us/connectors/connectors">connectors</a>.</li><li>Formulas written in <a href="https://learn.microsoft.com/en-us/power-platform/power-fx/overview">Power FX</a> language add flexibility and can be encoded into messages.</li><li>Custom entities enhance your copilot’s intelligence.</li></ul><p><strong>Points of caution</strong></p><ul><li>The Condition node only supports two branches, complicating scenarios needing multiple conditions. Also, once these nodes are set, their structure becomes unchangeable, eliminating the option for adjustments through dragging.</li><li>Some functionalities in Copilot Studio are still in preview versions and may not work perfectly.</li><li>Power FX has certain limitations. Ensure that the specific functionality you need is supported by Power FX.</li><li>All values added to custom entities are not separated by language. If you plan to support bilingualism, you may need to manually select options in different languages.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f5eeb9761b90" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to evaluate chatbots?]]></title>
            <link>https://medium.com/@1048463053/how-to-evaluate-chatbots-1a3ca919c01d?source=rss-2d0781cefb8------2</link>
            <guid isPermaLink="false">https://medium.com/p/1a3ca919c01d</guid>
            <category><![CDATA[chatbots]]></category>
            <dc:creator><![CDATA[Sunny May]]></dc:creator>
            <pubDate>Fri, 03 Nov 2023 10:06:43 GMT</pubDate>
            <atom:updated>2023-12-11T07:54:28.807Z</atom:updated>
            <content:encoded><![CDATA[<h3>Chatbot Evaluation</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ii0EM30lsFRziTG7FvBJXg.png" /></figure><p>Are you interested in understanding how your chatbot works? Or are you planning to build a chatbot and wondering what factors to consider before starting? Maybe you’re experiencing low user satisfaction and want to improve it. In any case, it’s essential to know how to evaluate chatbots. Evaluating your chatbot will provide valuable insights into its performance and help you identify areas for improvement. It can also assist beginners in designing a chatbot framework for optimal performance. This article will discuss the metrics used to evaluate chatbots and provide suggestions for improvement.</p><h3>Metrics to evaluate chatbots</h3><p>The following metrics are relevant for evaluating task-oriented chatbots that involve multi-turn conversations. Before proceeding, ensure that you have sufficient conversation history available for analysis.</p><h4>Task success rate</h4><p>The task success rate measures how effectively the dialogue system fulfills the user’s information requirements. A higher task success rate indicates better chatbot performance. To calculate the task success rate, you need to define the target information to be retrieved and the user’s desired information. For example, in a flight ticket selling scenario, you may need to retrieve flights and their prices based on user-provided information such as departure city, arrival city, and preferences. Incorrectly collected user information can lead to task failure. For instance, if the user states, “I would like to book a flight from Seattle to New York, please,” but the chatbot confuses the departure and arrival cities, the user may not be able to purchase the desired ticket.</p><p>Quantitative analysis can be performed using the <a href="https://dl.acm.org/doi/pdf/10.3115/976909.979652">PARASIDE</a> framework, employing a <a href="https://en.wikipedia.org/wiki/Confusion_matrix">confusion matrix</a> to represent correct and incorrect extraction of target information and the <a href="https://en.wikipedia.org/wiki/Cohen%27s_kappa">Kappa coefficient</a> to measure success.</p><h4>Dialog cost</h4><p>Dialog cost measures aspects related to the length of the dialogue. A lower dialog cost indicates better chatbot performance. For example, the cost can be measured by the number of inappropriate repair utterances. In the flight ticket booking scenario, a user might say, “You’re useless, can’t you do anything right?” Additionally, dialog cost can also be measured by the number of turns required to fill a single slot in a sub-dialogue. In the same scenario, a user may say, “I actually wanted to book a business ticket instead of an economy ticket,” which requires more turns to gather the necessary information. Sometimes, users’ requests cannot be fulfilled within the available options, leading to additional turns. For example, if there are no business tickets available, the chatbot may need to ask the user to change their selection, such as the previously chosen date and time.</p><h4>Handoff rate</h4><p>Handoff rate refers to the percentage or frequency of conversations that are transferred from a chatbot to a human agent during a customer interaction. A lower handoff rate indicates better chatbot performance. Handoff typically occurs when the chatbot determines that it cannot effectively handle the user’s request. This can happen in cases of complex technical inquiries like “I’m experiencing an error with my payment, can you help me?” or specific account-related questions like “I need assistance with updating my contact information.” Handoff can also occur when users become frustrated or impatient and explicitly request human support, stating “I want to talk to a real person” due to a desire for personalized assistance.</p><h4>Utterance and response matching score</h4><p>The utterance and response matching score evaluates how well the chatbot’s responses align with user utterances. System responses should satisfy user queries, ensuring coherence between the response and the last user utterance. For example, if a user asks, “Can you recommend a good restaurant nearby?” The appropriate response would be “Sure! There’s a highly-rated Italian restaurant called ‘La Trattoria’ just a few blocks away. They serve delicious pasta and pizza.” However, if the system misunderstands the user’s utterance, the response may not be related to the user’s query, such as “To get to the nearest restaurant, take a left turn at the next intersection and then go straight for about 500 meters.”</p><p>Similarly, system responses should also be coherent with follow-up user utterances. For example, if the user answers, “I will be leaving on Saturday, and I am departing from Cambridge,” the last system response should be “There are <em>[value_choice] </em>trains leaving<em> [value_departure]</em> on <em>[value_day]</em>. What time would you like to leave?” instead of “There are <em>[value_choice]</em> trains that day. Do you have time to travel?”</p><p>According to <a href="https://openreview.net/pdf?id=V0-0TzFvQaq">DialogueScore</a>, the utterance-response scorer and the response utterance scorer described above lacks the dialogue history information which is the major topic of dialogue tasks. Therefore, coherence score should also include dialogue histories. Since the NLI system is designed to measure the relation of a pair of texts, the softmaxed score of the system is regarded as the final DialogueScore.</p><h3>Improving chatbot after evaluation</h3><p>After evaluating your chatbot, you may identify areas for improvement to enhance its performance and user satisfaction. Here are some suggestions:</p><h4>Better dialog understanding</h4><p>To increase the task success rate, improve the matching between user utterances and system responses, and reduce the handoff rate resulting from the inability to extract user information, consider enhancing the dialog understanding capabilities of your chatbot. With the emergence of large language models (LLMs), explore how to leverage them effectively. If the LLM struggles to extract specific information due to a lack of inner business knowledge, you can dynamically embed some business-specific terms into the prompts as a long-term solution. For more details on improving dialog understanding, refer to “<a href="https://opencui.medium.com/dialog-understanding-8-improve-function-calling-with-rag-ff96109a7a3f">Dialog understanding #8: A RAG Implementation</a>.”</p><h4>Better dialog policy</h4><p>To reduce dialog cost, focus on improving your dialog policy. In the flight booking scenario, the chatbot can inform the user when only economy tickets are available instead of asking the user to select the ticket type. Additionally, promptly inform users if their selection is unavailable to minimize the number of turns required. For example, instead of confirming each booking detail with the user, the chatbot should check the availability of each selection. If there are no flights to a certain city, the chatbot doesn’t need to wait for the user to select the ticket type. For more details on improving dialog policy, refer to “<a href="https://medium.com/opencui-official/type-based-conversational-user-interface-67e562185e56">Dialog Policy #3: Schema-guided approach</a>.”</p><h3>Parting words</h3><p>To evaluate a chatbot, gather conversation history and measure metrics such as task success rate, dialog cost, handoff rate, and utterance and response matching score. To improve your chatbot after evaluation or better design its framework, consider implementing more suitable approaches for dialog understanding and dialog policy.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1a3ca919c01d" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>