<?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 Jaskaran Singh on Medium]]></title>
        <description><![CDATA[Stories by Jaskaran Singh on Medium]]></description>
        <link>https://medium.com/@jusky8?source=rss-dc0dbf98fc07------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*sDfgFIL_fFmFH-aq.jpg</url>
            <title>Stories by Jaskaran Singh on Medium</title>
            <link>https://medium.com/@jusky8?source=rss-dc0dbf98fc07------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 01:39:22 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@jusky8/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[Navigating the Cloud Journey]]></title>
            <link>https://jusky8.medium.com/navigating-the-cloud-journey-8a4cd5dbcc97?source=rss-dc0dbf98fc07------2</link>
            <guid isPermaLink="false">https://medium.com/p/8a4cd5dbcc97</guid>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[cloud-native]]></category>
            <dc:creator><![CDATA[Jaskaran Singh]]></dc:creator>
            <pubDate>Tue, 02 Mar 2021 05:58:11 GMT</pubDate>
            <atom:updated>2021-03-02T05:58:11.170Z</atom:updated>
            <content:encoded><![CDATA[<p>In a relatively short span of time, we’ve evolved from the traditional approach of software development, in which the resources needed to run applications were deployed on-premise, to the cloud native age, in which the applications running in the cloud are purpose built and optimized to take full advantage of cloud benefits such as elasticity and resiliency.</p><p>It seems that everyone in the industry is talking about cloud native — including the role of distributed systems, microservices, containers, serverless computing, and other emerging technologies and architectures. While many organizations are somewhere in the process of defining and optimizing their cloud approach, there’s still a fair amount of confusion among IT practitioners and decision makers about what cloud native really means and what the ultimate goals and expectations should be for an organization leveraging modern technologies and practices.</p><p>The biggest question of all may be “<em>How can my organization be successful with a cloud native approach and what impact will this successful technology approach have on my business objectives?</em>”</p><p>This post aims to answer this fundamental question by relating the technical and cultural initiatives essential to the cloud native journey back to how they drive positive outcomes for both IT and the business. I will also sprinkle in some best practices for extracting maximum value out of your cloud environment. Before we go into what is cloud native computing, we should first understand what are the goals of an enterprise application, how can we go about achieving those goals using cloud native computing, and how do we evaluate our performance metrics against those goals.</p><h3>Goals of an Enterprise application</h3><p>Every enterprise starts out by laying out a set of goals that it would like to achieve in order to service its customers. We want applications to be always available, be perpetually upgraded with new state-of-the-art features, and provide personalized experiences. We can summarize these goals into 5 pillars of an enterprise application</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*09s2PITE6Ecjnj-4YVZ1Nw.png" /></figure><p><strong>1. Business Continuity</strong></p><p>The Business Continuity pillar outlines how a business will continue operating during an unplanned disruption in service and contains contingencies for business processes, assets, human resources and business partners — every aspect of the business that might be affected. The business continuity goal has the following design principles</p><ul><li><strong>Availability: </strong>can be described as the percentage of a time period when the service will be able to respond to the request i.e <em>system uptime</em></li><li><strong>Durability:</strong> refers to the on-going existence of the object or resource. Note that it does not mean you can access it, only that it continues to exist.</li><li><strong>Reliability:</strong> is closely related to availability, however, a system can be ‘available’ but not be working properly. Reliability is the probability that a system will work as designed.</li><li><strong>Resiliency:</strong> can be described as the ability to a system to self-heal after damage, failure, load, or attack. Note that this does not mean that it will be available continuously during the event, only that it will self recover.</li></ul><p>The business continuity plan should account for any disaster that can take down your applications and impact your data. In an ideal world, your data protection infrastructure would immediately restore all applications and data right at the time and point of failure. These operations are resource-consuming and expensive, and hence business needs to set objectives for recovering from a disaster according to their budget, resources and application priority. Recovery Point Objective (RPO) and Recovery Time Objective (RTO) are two of the most important parameters of a disaster recovery or data protection plan. The RPO/RTO, along with a business impact analysis, provides the basis for identifying and analyzing viable strategies for inclusion in the business continuity plan. Viable strategy options include any which would enable resumption of a business process in a time frame at or near the RPO/RTO. <em>RTO</em> is the maximum acceptable time an application can be unavailable after an incident. <em>RPO</em> is the maximum duration of data loss that is acceptable during a disaster.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Q87G4ux-ukhKanJtySDl6A.png" /></figure><p><strong>2. Security</strong></p><p>The security pillar describes how to take advantage of cloud technologies to protect data, systems, and assets in a way that can improve your security posture. There are seven design principles for security in the cloud that a well architected enterprise solution should implement</p><ul><li>Implement a strong identity foundation: Implement the principle of least privilege and enforce separation of duties with appropriate authorization for each interaction with your resources. Centralize identity management, and aim to eliminate reliance on long-term static credentials.</li><li>Enable traceability: Monitor, alert, and audit actions and changes to your environment in real time. Integrate log and metric collection with systems to automatically investigate and take action.</li><li>Apply security at all layers: Apply a defense in depth approach with multiple security controls. Apply to all layers (for example, edge of network, VPC, load balancing, every instance and compute service, operating system, application, and code).</li><li>Automate security best practices: Automated software-based security mechanisms improve your ability to securely scale more rapidly and cost effectively. Create secure architectures, including the implementation of controls that are defined and managed as code in version-controlled templates.</li><li>Protect data in transit and at rest: Classify your data into sensitivity levels and use mechanisms, such as encryption, tokenization, and access control where appropriate.</li><li>Keep people away from data: Use mechanisms and tools to reduce or eliminate the need for direct access or manual processing of data. This reduces the risk of mishandling or modification and human error when handling sensitive data.</li><li>Prepare for security events: Prepare for an incident by having incident management and investigation policy and processes that align to your organizational requirements. Run incident response simulations and use tools with automation to increase your speed for detection, investigation, and recovery.</li></ul><p><strong>3. Agility</strong></p><p>Agility is the ability of an organization to rapidly adapt to market and environmental changes in productive and cost-effective ways. In order to stay competitive, every business wants to make sure their systems are state of the art and keeping up with the times. Here are some of the goals that a business strive to achieve.</p><ul><li>Quicker Time-to-market: Cloud computing allows companies to significantly decrease the time it takes to provision and de-provision IT infrastructure, speeding delivery of IT projects that are critical to revenue growth or cost reduction. While a physical server could take days or weeks to procure and provision, a cloud server takes minutes. Faster time to market means faster time to revenue.</li><li>Faster Innovation: Cloud computing allows companies to support an increased pace of product development and marketing programs that better align IT infrastructure and management costs with the goals and objectives of the business.</li><li>Make frequent, small, reversible changes: Design workloads to allow components to be updated regularly to increase the flow of beneficial changes into your workload. Make changes in small increments that can be reversed if they fail to aid in the identification and resolution of issues introduced to your environment (without affecting customers when possible).</li><li>Anticipate failure: Perform “pre-mortem” exercises to identify potential sources of failure so that they can be removed or mitigated. Test your failure scenarios and validate your understanding of their impact. Test your response procedures to ensure they are effective and that teams are familiar with their execution. Set up regular game days to test workload and team responses to simulated events.</li><li>Learn from all operational failures: Drive improvement through lessons learned from all operational events and failures. Share what is learned across teams and through the entire organization.</li></ul><p><strong>4. Scalability and Performance Efficiency</strong></p><p>Performance efficiency is the ability of your workload to scale to meet the demands placed on it by users in an efficient manner. The Performance Efficiency pillar includes the ability to use computing resources efficiently to meet system requirements, and to maintain that efficiency as demand changes and technologies evolve. <em>Scalability</em> is the ability of a system to handle increased load. An important consideration in achieving performance efficiency is to consider how your application scales and to implement PaaS offerings that have built-in scaling operations. Services can scale automatically to match demand to accommodate workload. They will scale out to ensure capacity during workload peaks and scaling will return to normal automatically when the peak drops. Here are some of the goals:</p><ul><li>Become Data-driven — Embrace a data-driven culture to deliver timely insights to everyone in your organization across all your data. To harness this culture, get the best <em>performance</em> from your analytics solution across all your data, ensure data has the <em>security</em> and privacy needed for your business environment, and make sure you have tools that enable everyone in your organization to gain insights from your data.</li><li>Perform load testing to set limits — Load testing helps ensure that your applications can scale and do not go down during peak traffic. Load test each application to understand how it performs at various scales. To learn about Azure service limits, see Managing limits.</li><li>Understand billing for metered resources — Your business requirements will determine the tradeoffs between cost and level of performance efficiency. Azure doesn’t directly bill based on the resource cost. Charges for a resource, such as a virtual machine, are calculated by using one or more meters. Meters are used to track a resource’s usage over time. These meters are then used to calculate the bill.</li><li>Monitor and optimize — Lack of monitoring new services and the health of current workloads are major inhibitors in workload quality. The overall monitoring strategy should take into consideration not only scalability, but resiliency (infrastructure, application, and dependent services) and application performance as well. For purposes of scalability, looking at the metrics would allow you to provision resources dynamically and scale with demand.</li><li>Use serverless architectures: Serverless architectures remove the need for you to run and maintain physical servers for traditional compute activities. For example, serverless storage services can act as static websites (removing the need for web servers) and event services can host code. This removes the operational burden of managing physical servers, and can lower transactional costs because managed services operate at cloud scale</li></ul><p><strong>5. Cost Optimization</strong></p><p>The Cost Optimization pillar includes the ability to run systems to deliver business value at the lowest price point. Here are some of the goals that organizations strive to meet:</p><ul><li>Keep within the cost constraints: Every design choice has cost implications. Before choosing an architectural pattern consider the budget constraints set by the company. As part of design, identify acceptable boundaries on scale, redundancy, and performance against cost. After estimating the initial cost, set budgets and alerts at different scopes to measure the cost. One of cost drivers can be unrestricted resources. These resources typically need to scale and consume more cost to meet demand.</li><li>Aim for scalable costs: A key benefit of the cloud is the ability to scale dynamically. The workload cost should scale linearly with demand. You can save cost through automatic scaling. Choose smaller instances for a highly variable workload and scale out to get the required level of performance, rather than up. This choice will enable you to make your cost calculations and estimates granular.</li><li>Pay for consumption: Adopt a leasing model instead of owning infrastructure. Azure offers many SaaS and PaaS resources that simplify overall architecture. The cost of hardware, software, development, operations, security, and data center space included in the pricing model. Also, choose pay-as-you-go over fixed pricing. That way, as a consumer, you’re charged for only what you use.</li><li>Right resources, right size: Choose the right resources that are aligned with business goals and can handle the performance of the workload. An inappropriate or misconfigured service can impact cost. For example, building a multi-region service when the service levels don’t require high-availability or geo-redundancy will increase cost without any reasonable business justification. Certain infrastructure resources are delivered as fix-sized building blocks. Ensure that these blocks are adequately sized to meet capacity demand, deliver expected performance without wasting resources.</li><li>Monitor and optimize: Treat cost monitoring and optimization as a process, rather than a point-in-time activity. Conduct regular cost reviews and measure and forecast the capacity needs so that you can provision resources dynamically and scale with demand. Review the cost management recommendations and take action.</li></ul><h3>The Cloud Journey</h3><p>Every enterprise in today’s modern era tries to meet the goals we just discussed. Your software needs to be up, 24/7. You need to be able to release frequently to give your users the instant gratification they seek. The mobility and always-connected state of your users drives a need for your software to be responsive to larger and more fluctuating request volumes than ever before. And connected devices (“things”) form a distributed data fabric of unprecedented size that requires new storage and processing approaches. These needs, along with the availability of new platforms on which you can run the software, have led directly to the emergence of a new architectural style for software: cloud-native software.</p><p>In the pre-cloud era software was developed as a waterfall approach, software took years to create, with infrequent releases of new features. Development, quality assurance, and operations were distinct groups, often operating in silos. Applications were deployed on infrastructure that consisted of physical hardware which was usually located in on-premise or in data centers. With the advent of server virtualization, virtual servers were deployed to consolidate operations on fewer, larger physical servers. Operational tasks were highly manual, limiting the scale at which systems could operate. Over time, provisioning and maintaining the physical and virtual infrastructure were made less onerous by configuration management tools. When it came to planning how a system would handle increases in load, many organizations intentionally provisioned workloads to be oversized to meet business requirements. This might make sense in on-premises environments because it ensured <em>capacity</em> during peak usage. Capacity reflects resource availability (CPU and memory). This was a major consideration for processes that would be in place for a number of years.</p><p>The cloud model is a departure from previous data center strategies since the model provides a pool of resources that can be consumed by users as services as opposed to dedicating infrastructure to each individual application. In the case of public cloud, these services can take the shape of end- user applications, back-office platforms, or virtual servers –- all hosted over the Internet with simple billing models that charge the user for just what they use. Companies embraced the cloud as a way to focus on their core business and offload portions of their IT infrastructure, paying only for the resources consumed. Automation became more prevalent for cloud operations and management, including provisioning, configuration, scaling, and self-healing. During the initial years of the cloud technology adoption, organizations tried to follow a simple “<em>lift and shift</em>” approach which involved merely migrating applications from the data centers to the cloud without making any changes to application architecture. Multi-tier applications were simply migrated from local physical servers to a virtualized cloud environment.</p><p>While the lift and shift approach can be feasible as a short-time solution for mission-critical systems (or a long-term allocation of auxiliary systems), many enterprise businesses had realized that in order to use the cloud efficiently, one has to use it to the fullest extent. There are simply bottlenecks and single points of failure (SPOF) like the vertically-built databases that cannot be removed without disassembling the system and reassembling it anew.<br>This also makes impossible using the autoscaling and serverless computing features the cloud platforms provide. Obviously, if the app was built without these features in mind, its architecture cannot support them, which leads us to a necessity of redesign of the app from scratch to become cloud-native.</p><p>Enterprises are realizing that a simple migration or “lift and shift” of applications to the cloud is not enough to exploit the true benefits of the cloud. Businesses are jumping onto the Cloud-Native bandwagon by optimizing applications and their environments to take maximum advantage of the core characteristics of cloud computing with the goal of achieving transformational digital and business outcomes.Cloud system engineers have made many innovative improvements in cloud platforms and infrastructures. These initiatives have spawned several engineering trends that continue to this day. One such trend is the move from monolithic systems toward microservice architectures, which has enabled the cloud native movement we see exploding today.</p><h3>Embarking on your Cloud Native Journey</h3><h4>It Doesn’t Happen Overnight</h4><p>Cloud native is more than migrating existing applications to the cloud or flipping a switch to turn on new cloud services. It’s also more than developing your applications from scratch in the cloud. It’s about how you develop and run applications, not just where those applications are deployed.</p><p>Which is why becoming cloud native doesn’t happen the instant you leverage cloud services or infrastructure. Rather, it requires fundamental changes to processes, architecture, culture, and measurement. These changes take time and commitment, and the cycle is iterative and constant.</p><p>There isn’t a single, one-size-fits-all strategy for migrating legacy applications to the cloud. The right migration strategy for you will depend on your organization’s needs and priorities, and the kind of applications you are migrating. You also need to understand where you want to spend more time and investment that gives you the best return on investment. Would you like rather have your team work on the building new functionality that adds value to your business, or have them manage infrastructure and software? These are hard questions to answer, and you need to understand what options you have at your disposal before starting on that journey. These options differ in terms of what services they offer, and more importantly who shares the responsibility of managing them. These options can be categorized as IaaS, PaaS and SaaS.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*rcR0C9Nv3UmtyaEG2j-1nw.png" /><figcaption>IaaS vs PaaS vs SaaS</figcaption></figure><p>IaaS stands for “infrastructure as a service”. It refers to cloud-based infrastructure resources and services that can be leveraged by an organization to build and manage their servers, network, virtualization, and data storage. IaaS customers can control their own infrastructure without having to physically manage it on-site. Setting up infrastructure on-premise requires a significant initial investment in physical hardware and maintenance costs. IaaS helps you avoid the expense and complexity of buying and managing your own physical servers and other datacenter infrastructure. You can reduce your time to market as you don’t have to wait for your physical hardware to arrive in your datacenter. Instead you can use the readily available infrastructure provided by the cloud provider, as and when you need it. You can also scale up and down the capacity to meet the demands of your business. This model offers a flexible pay-as-you-go model, and does not bind you in a long term commitment.</p><p>PaaS stands for “platform as a service.” It refers to cloud-based platform services that provide developers with a framework they can use to build custom applications upon. <br>PaaS allows you to avoid the expense and complexity of buying and managing software licenses, the underlying application infrastructure and middleware, container orchestrators such as Kubernetes, or the development tools and other resources. You manage the applications and services you develop, and the cloud service provider typically manages everything else.</p><p>SaaS stands for “software as a service.” It refers to cloud-based software that is hosted online by a vendor and is available for purchase on a subscription basis. SaaS products are among the most commonly-used cloud computing services used by companies to build and grow their businesses. SaaS is easy to use and manage, and it’s highly scalable, as it doesn’t need to be downloaded and installed on individual devices in order to deploy it to an entire team or company. This is particularly helpful for distributed global teams of people who don’t work in close physical proximity.</p><p>As you can see, as you move from on-premise to SaaS, your responsibility as a business decreases in terms of things that you need to manage.</p><p>Not all applications warrant the investment of moving to a platform as a service (PaaS) model or developing a cloud-native application model. In many cases, you can take a phased or incremental approach to invest in moving your assets to the cloud, based on your business needs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*M9GbriEy-2pj65uz6K_3zw.png" /></figure><p>For modern applications with the best long-term agility and value for the organization, you might benefit from investing in <em>cloud-native </em>application architectures. However, for applications that are existing or legacy assets, the key is to spend minimal time and money (no rearchitecting or code changes) while moving them to the cloud, to realize significant benefits.The above diagram shows the possible paths you can take when you move existing applications to the cloud in incremental phases.But first, you need to identify which category your application falls into:</p><p><strong>Cloud Infrastructure-Ready </strong>applications: In this migration approach, you simply migrate or re-host your current on-premises applications to an infrastructure as a service (IaaS) platform. Your apps have almost the same composition as before, but now you deploy them to VMs in the cloud. This simple type of migration is typically known in the industry as “<strong><em>Lift &amp; Shift</em></strong>.”</p><p><strong><em>Advantages</em></strong></p><ul><li>No re-architecting, no new code</li><li>Least effort for quick migration</li><li>Basic availability guarantees</li><li>After moving to the cloud, it’s easier to modernize even more</li></ul><p><strong><em>Challenges</em></strong></p><ul><li>Smaller cloud value, other than shift in operating expense or closing data centers</li><li>Little is managed: No OS or middleware patching</li></ul><p><strong>Cloud Optimized </strong>applications: At this level and still without rearchitecting or altering significant code, you can gain additional benefits from running your app in the cloud with modern technologies like containers and additional cloud-managed services. You improve the agility of your applications to ship faster by refining your enterprise development operations (DevOps) processes. You achieve this by using technologies like Containers, which is based on Docker Engine. Containers remove the friction that’s caused by application dependencies when you deploy in multiple stages. In this maturity model, you can deploy containers on IaaS or PaaS while using additional cloud-managed services related to databases, cache as a service, monitoring, and continuous integration/continuous deployment (CI/CD) pipelines.</p><p><strong><em>Advantages</em></strong></p><ul><li>No re-architecting, no new code</li><li>Minimal code/config changes Containers offer small incremental effort over VMs</li><li>Improved deployment and DevOps agility to release because of containers</li><li>Increased density and lower deployment costs</li><li>Portability of apps and dependencies</li><li>Flexibility of host targets: PaaS approaches or IaaS</li></ul><p><strong><em>Challenges</em></strong></p><ul><li>Containerizing is an additional step in the learning curve for developers and IT Operations</li><li>DevOps and CI/CD pipelines is usually ‘a must’ for this approach. If not currently present in the culture of the organization, it might be an additional challenge</li></ul><p><strong>Cloud-Native </strong>applications: This migration approach typically is driven by business need and targets modernizing your mission-critical applications. At this level, you use PaaS services to move your apps to PaaS computing platforms. You implement cloud-native applications and microservices architecture to evolve applications with long-term agility, and to scale to new limits. This type of modernization usually requires architecting specifically for the cloud. New code often must be written, especially when you move to cloud-native application and microservice-based models. This approach can help you gain benefits that are difficult to achieve in your monolithic and on-premises application environment.</p><p><strong><em>Advantages</em></strong></p><ul><li>Architect for the cloud, you get the best benefits from the cloud but new code is needed</li><li>Microservices cloud- native approaches</li><li>Modern mission-critical applications, cloud- resilient hyper-scalable</li><li>Fully managed services</li><li>Optimized for scale</li><li>Optimized for autonomous agility by subsystem</li><li>Built on deployment and</li><li>DevOps</li></ul><p><strong><em>Challenges</em></strong></p><ul><li>Requires re-architecture for cloud native apps and microservice architectures and usually requires significant code refactoring or rewriting when modernizing (increased time and budget)</li></ul><h3>Weighing the benefits of Cloud migration</h3><p>I started this article by laying out some of the goals of an enterprise application. Lets us now take a look at what is the end result we are trying to achieve if all our goals are met.</p><ol><li><strong>Speed to market</strong>​: The cloud allows organizations to decrease the time it takes to provision IT infrastructure, speeding delivery of IT projects that are critical to revenue growth or cost reduction. While a physical server could take days or weeks to procure and provision, a cloud server takes minutes. Faster time to market means faster time to revenue.</li><li><strong>Cost Savings</strong>​: With traditional on-premise enterprise solutions, IT architects build dedicated, hard-wired infrastructure that often is over-sized to accommodate worst-case capacity estimates — but with little capability for scaling to meet future increase in demand. This results in excessive and wasteful over-capacity. But the cloud methodology allows you to be only responsible for what you use. Pay-as-you-go cloud computing system allows users to scale, modify and provision computing resources, including but not limited to software, storage and other platforms. How much you’ll be charged are based on used services, versus an entire infrastructure. Hence, paying only for the IT capacity you actually consume generates major savings. By using cloud infrastructure, you don’t have to spend huge amounts of money on purchasing and maintaining equipment. This drastically reduces capex costs. You don’t have to invest in hardware, facilities, utilities, or building out a large data center to grow your business. You do not even need large IT teams to handle your cloud data center operations, as you can enjoy the expertise of your cloud provider’s staff.</li><li><strong>Data Security</strong>​: One of the major concerns of every business, regardless of size and industry, is the security of its data. Data breaches and other cyber crimes can devastate a company’s revenue, customer loyalty and brand positioning. Cloud offers many advanced security features that guarantee that data is securely stored and handled. Cloud storage providers implement baseline protections for their platforms and the data they process, such authentication, access control, and encryption. From there, most enterprises supplement these protections with added security measures of their own to bolster cloud data protection and tighten access to sensitive information in the cloud.</li><li><strong>Scalability</strong>​: Different companies have different IT needs — a large enterprise of 1000+ employees won’t have the same IT requirements as a start-up.Using cloud is a great solution because it enables enterprise to efficiently — and quickly — scale up/down their IT departments, according to business demands. Cloud based solutions are ideal for businesses with growing or fluctuating bandwidth demands. If your business demands increase, you can easily increase your cloud capacity without having to invest in physical infrastructure. This level of agility can give businesses using cloud computing a real advantage over competitors. This scalability minimizes the risks associated with in-house operational issues and maintenance. You have high-performance resources at your disposal with professional solutions and zero up-front investment. Scalability is probably the greatest advantage of the cloud.</li><li><strong>Disaster Recovery</strong>​: One of the factors that contributes to the success of a business is control. Unfortunately, no matter how in control your organization may be when it comes to its own processes, there will always be things that are completely out of your control, and in today’s market, even a small amount of unproductive downtime can have a resoundingly negative effect. Downtime in your services leads to lost productivity, revenue, and brand reputation. But while there may be no way for you to prevent or even anticipate the disasters that could potentially harm your organization, there is something you can do to help speed your recovery. Cloud-based services provide quick data recovery for all kinds of emergency scenarios, from natural disasters to power outages.</li><li><strong>Competitive edge</strong>​: One of the factors that contributes to the success of a business is control. Unfortunately, no matter how in control your organization may be when it comes to its own processes, there will always be things that are completely out of your control, and in today’s market, even a small amount of unproductive downtime can have a resoundingly negative effect. Downtime in your services leads to lost productivity, revenue, and brand reputation. But while there may be no way for you to prevent or even anticipate the disasters that could potentially harm your organization, there is something you can do to help speed your recovery. Cloud-based services provide quick data recovery for all kinds of emergency scenarios, from natural disasters to power outages.</li></ol><h3>Conclusion</h3><p>While adopting a cloud native approach may not always be fast or easy, the rewards can make the effort worthwhile for both IT and the business. Your cloud native journey success depends on tighter, faster feedback loops about bugs, new features, performance, customer experience, and targeted business outcomes.You should be tracking key performance indicators (KPIs) related to the core capabilities for cloud native so teams have a common frame of reference with which to analyze and improve the system.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8a4cd5dbcc97" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Learning to Rank for Information Retrieval]]></title>
            <link>https://jusky8.medium.com/learning-to-rank-for-information-retrieval-9a0bd9f0b27d?source=rss-dc0dbf98fc07------2</link>
            <guid isPermaLink="false">https://medium.com/p/9a0bd9f0b27d</guid>
            <category><![CDATA[learning-to-rank]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[searchrelevance]]></category>
            <dc:creator><![CDATA[Jaskaran Singh]]></dc:creator>
            <pubDate>Tue, 15 Dec 2020 23:48:59 GMT</pubDate>
            <atom:updated>2020-12-15T23:48:59.392Z</atom:updated>
            <content:encoded><![CDATA[<p>The digital age is all about effectively having a stronger, faster, convenient, and more efficient way of life across the board. Every type of business, large or small, across varying industries, is making the change to e-commerce. Product discovery on the e-commerce platform has become increasingly more important to provide a better shopping experience for the customers, and provide relevant search results leading to higher conversion rates.</p><blockquote>Search relevancy addresses the problem: How relevant are the search results based on the user query?</blockquote><p>The field of search relevancy is an evolving field and comprises of simple techniques that are based on heuristics, namely computed metrics that are used to compute a set of code metrics and combine them by creating detection rules; while they have a reasonable accuracy, a recent trend is represented by the use of machine learning where code metrics are used as predictors of the smelliness of code artifacts.</p><p>Learning to Rank (LTR) is an important and powerful technique which utilizes supervised machine learning to address the problem of search relevancy. An LTR approach leverages machine learning to automatically tune relevancy factors, which not only alleviates the pain associated with manual processes like boosts and blocks, but also promises significantly improved relevancy with the use of state of the art modeling techniques.</p><p>There are significant practical barriers to using LTR. First of all, LTR capabilities are library and API-level building blocks, with reference documentation that would only make sense to a very experienced search engineer. Secondly, LTR component does not actually train any models; it is left up to you to custom build a model training pipeline from scratch. Lastly, figuring out how all these pieces fit together to create an end- to-end LTR solution requires a significant amount of engineering and data science expertise.</p><p>This blog post provides guidance on how to implement an end-to-end Learning to Rank solution that greatly reduces the amount of effort required to implement and operationalize LTR. When combined with insights derived from user behavior signals LTR offers significant gains in search relevancy. Here are the steps involved in a typical LTR model training workflow</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Taxth_HMBBjUYjZ2TUGgmA.png" /><figcaption>LTR Pipeline</figcaption></figure><h3>Learning to Rank components</h3><h4>Training Data preparation</h4><p>Like any machine learning exercise, we need to prepare the training data on which to train our model on. This data set has multiple components which are described below</p><p><strong><em>Judgements</em></strong></p><p>To begin with, we need a set of relevance “<em>judgments”</em>, known as ground truth. These judgements are basically curated relevance of documents per query, and can be thought of expression of the “<em>ideal”</em> ordering. This “<em>ideal</em>” ordering can be difficult to obtain as it may require lot of manual effort and time to come up with the true list. Another option is to use user-generated signals that may be used as implicit labels. This approach generally produces judgements of lower quality and are more noisy. One such user-generated signal that you can use is the clicks; that is given a query-document pair, the number of clicks is used as the training label. Higher number of clicks indicate higher relevance. We will be using machine learning to learn a complex function that optimizes the rank of results/documents for these queries such that the “relevant” documents are more likely to be ranked before irrelevant documents.</p><p><strong><em>Features</em></strong></p><p>The second part of the training data are the features. Features are signals that explain the document’s relevancy scores. Features are defined in JSON and uploaded to your search engine.</p><p>The search engine uses the feature definition to extract the values from the documents. Given the judgements a.k.a the query-document pairs, The feature definition is used to output feature vectors for each query. The judgements + features set (query, document, feature vector) forms the training data for the LTR model.</p><h4>Model Training</h4><p>Once you have prepared your training set, you can train your model. Training models occurs outside the search engine. You don’t use LTR plugin to train the models. You can train models using technology of your choice and upload the trained model artifacts using one of the available serialization formats (RankLib, XGBoost, and others).</p><h4>Using your trained model</h4><p>Once you have trained your model, you need to upload it into your search engine. You don’t want to execute the ML model on on every result in your index. These models are CPU intensive and their complexity directly depends on how many products they have to examine and rank. This is fine to dozens and hundreds, but not for thousands or millions. This is why you can’t run full LTR model against all matching products. More often, you’ll execute your model on the top N of a baseline relevance query. This process is called as re-scoring</p><h4>Model Evaluation</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ChA0MF4RnWFhMN2JdK64Mw.png" /></figure><p>Given a user query, for example “black jogger pants”, we want to maximize the order of relevance of returned products. How good is our list as compared to the ideal list? Suppose we know the ideal judgement list, we can define an overall score for the ideal list. Then we calculate the same score for our target expressions list, and compare how close it it to the ideal score. This score is called as the Document Cumulative Gain (DCG).</p><p>Going back to our “black jogger pants” search query, lets say we get back 6 results. Also lets assume we know the ideal relevancy of these items. Given that information, we can calculate the DCG metric for our expressions list. Similarly, we will calculate DCG metric for our ideal judgements list and call it as Ideal Document Cumulative Gain (IDCG). Note that in this calculation we assume that the more relevant results are at higher positions. Finally we calculate the Net Document Cumulative Gain (NDCG) as a ratio of DCG to IDCG. Our goal is to optimize this NDCG score.</p><h3>Learning to Rank Example</h3><p>Lets take an example from <a href="https://www.kaggle.com/tmdb/tmdb-movie-metadata?select=tmdb_5000_movies.csv">IMDB dataset</a>. This dataset contains listing of about 5000 movies and we will try to build a search catalog where the users can look for the movies by title. Our intent is to provide our users with the best possible listing with the movies ordered by their relevance matched by the search query. In building such a system we need to first start with our training data, and as mentioned in this article previously we will start with out judgements list. Judgements lists are the ideal results that we should get based on a query and their relevancy score. For example: when users search for “Rambo” we can indicate which movies ought to come back for “Rambo” based on our user’s expectations of search. Relevancy_score establishes the ideal ordering of results. For example, if we grade documents from 0–4, where 4 is exactly relevant.</p><h4>Sample Judgements</h4><pre>query, document, relevancy_score # document_id<br>rambo, Rambo, 4 <em># 7555</em><br>rambo, Rambo III, 3 # 1370<br>rambo, Rambo: First Blood Part II, 3 # 1369<br>rambo, First Blood, 3 # 1368</pre><h4>Feature Definition</h4><p>Next we need to define our features and upload them to our search engine. Here are 2 example features that scores how well a query matches the title and the overview fields, and is based on a TF*IDF score.</p><pre># Feature definition for TF*IDF score on matching on title field<br>{    <br> &quot;query&quot;: { <br>   &quot;match&quot;: {            <br>     &quot;title&quot;: &quot;{{keywords}}&quot;        <br>   }    <br> }<br>}</pre><pre># Feature definition for TF*IDF score on matching on overview field<br>{    <br> &quot;query&quot;: { <br>   &quot;match&quot;: {            <br>     &quot;overview&quot;: &quot;{{keywords}}&quot;        <br>   }    <br> }<br>}</pre><h4>Feature Extraction (Judgements + Features)</h4><p>Once you have defined the features, you need to extract the feature values for each query in your Judgements list. We want to get feature values for all documents that have judgment for each search term, one search term at a time. For example, our Judgement list contains single query “Rambo”, so we will run it against our search engine to extract the feature values for each matching document.</p><p>NOTE: The search result may return more document than there are in your Judgements list, so you may want to filter those out</p><pre><a href="http://localhost:8983/solr/techproducts/query?q=test&amp;fl=id,score,%5Bfeatures%5D">http://&lt;your_solr_server&gt;/solr/tmdb/query?q=rambo&amp;fl=id,score,[features</a>]</pre><pre># The output will include feature values as a comma-separated list:<br>{<br>  <strong>&quot;responseHeader&quot;</strong>:{<br>    <strong>&quot;status&quot;</strong>:0,<br>    <strong>&quot;QTime&quot;</strong>:0,<br>    <strong>&quot;params&quot;</strong>:{<br>      <strong>&quot;q&quot;</strong>:&quot;rambo&quot;,<br>      <strong>&quot;fl&quot;</strong>:&quot;id,score,[features]&quot;<br>     }<br>   },<br>   <strong>&quot;response&quot;</strong>:{<br>    <strong>&quot;numFound&quot;</strong>:2,<strong>&quot;start&quot;</strong>:0,<strong>&quot;maxScore&quot;</strong>:1.959392,<br>    <strong>&quot;docs&quot;</strong>:[<br>      {<br>        <strong>&quot;id&quot;</strong>:&quot;<em>7555</em>&quot;,<br>        <strong>&quot;score&quot;</strong>:1.959392,<br>        &quot;<strong>[features]&quot;</strong>:<br>                &quot;title_score=9.8376875,overview_score=12.318446&quot;<br>      },<br>      {<br>        <strong>&quot;id&quot;</strong>:&quot;1370&quot;,<br>        <strong>&quot;score&quot;</strong>:1.5513437,<br>        <strong>&quot;[features]&quot;</strong>:<br>                &quot;title_score=10.7808075,overview_score=9.510193&quot;<br>      },<br>      .......</pre><pre>    ]<br>  }<br>}</pre><p>Once you get the feature values, you can join your judgment list with feature values to produce a training set.</p><pre>query, document, relevancy_score, title_score, overview_score<br>rambo, Rambo, 4, 9.8376875, 12.318446<br>rambo, Rambo III, 3, 10.7808075, 9.510193<br>rambo, Rambo: First Blood Part II, 3, 10.7808075, 6.8449354<br>rambo, First Blood, 3, 10.7808075, 0.0</pre><h4>Training data</h4><p>The training data needs to be formatted according to the library you are using. For example if you are using <a href="https://sourceforge.net/p/lemur/wiki/RankLib%20File%20Format/">RankLib</a> then you need to format data of the form</p><pre>&lt;target&gt; qid:&lt;qid&gt; &lt;feature&gt;:&lt;value&gt; &lt;feature&gt;:&lt;value&gt; ... &lt;feature&gt;:&lt;value&gt; # &lt;info&gt;</pre><p>Looking at the above dataset, relevancy_score is the &lt;target&gt;, each query is indexed to an int for example “Rambo” will be qid:1, “Star Wars” will be qid:2 and so on. Features are labeled with ordinals starting at 1. So 1:9.8376875 represents title_score feature will the feature value of 9.8376875, and so on. Everything after # is a comment. The above training set can be transformed in a set that looks like as below:</p><pre>4   qid:1   1:9.8376875     2:12.318446 <em># 7555  </em>Rambo<br>3   qid:1   1:10.7808075    2:9.510193 <em># 1370   </em>Rambo III<br>3   qid:1   1:10.7808075    2:6.8449354 <em># 1369  </em>Rambo: First Blood Part II<br>3   qid:1   1:10.7808075    2:0.0 <em># 1368        </em>First Blood</pre><h4>Model Training</h4><p>You need to train the model outside of your search engine. You can choose to train a simple linear model, use XGBoost or RankLib that has multiple variants including LambdaMART. Here is an example of using RankLib to train your model</p><pre>java -jar RankLib-2.8.jar -ranker <em>%s</em> -train<em>%r</em>s -save <em>%s</em> -frate 1.0&quot; % (whichModel, judgmentsWithFeaturesFile, modelOutput)</pre><p>ranker: Specify which ranking algorithm to use. There are currently 9 algorithms that you can choose from (example: LambdaMART, AdaRank)</p><p>train: specifies location of your training data</p><p>save: Save the learned model to the specified file</p><blockquote><em>Some considerations:</em> Feature normalization transforms feature values to a more consistent range (like 0 to 1 or -1 to 1) at training time to better understand their relative impact. Some models, especially linear ones (like <a href="http://www.cs.cornell.edu/people/tj/svm_light/svm_rank.html">SVMRank</a>), rely on normalization to work correctly. Make sure your data is prepared in accordance with the requirements of your ranking algorithms</blockquote><p>Ranklib will output a model in it’s own serialization format. For example a LambdaMART model output looks like:</p><pre><em>## LambdaMART</em><br><em>## No. of trees = 1000</em><br><em>## No. of leaves = 10</em><br><em>## No. of threshold candidates = 256</em><br><em>## Learning rate = 0.1</em><br><em>## Stop early = 100</em><br><br>&lt;ensemble&gt;<br>    &lt;tree id=&quot;1&quot; weight=&quot;0.1&quot;&gt;<br>        &lt;split&gt;<br>            &lt;feature&gt; 2 &lt;/feature&gt;<br>            ...</pre><h4>Upload Model</h4><p>Once you have trained your model, you need to upload your model artifacts. Here is an example</p><pre>POST _ltr/_featureset/movie_features/_createmodel<br>{<br>    &quot;model&quot;: {<br>        &quot;name&quot;: &quot;my_ranklib_model&quot;,<br>        &quot;model&quot;: {<br>            &quot;type&quot;: &quot;model/ranklib&quot;,<br>            &quot;definition&quot;: &quot;## LambdaMART<strong>\n</strong><br>                            <em>## No. of trees = 1000</em><br>                            <em>## No. of leaves = 10</em><br>                            <em>## No. of threshold candidates = 256</em><br>                            <em>## Learning rate = 0.1</em><br>                            <em>## Stop early = 100</em><br><br>                            &lt;ensemble&gt;<br>                                &lt;tree id=&quot;1&quot; weight=&quot;0.1&quot;&gt;<br>                                    &lt;split&gt;<br>                                        &lt;feature&gt; 2 &lt;/feature&gt;<br>                                        ...<br>                        &quot;<br>        }<br>    }<br>}</pre><h4>Running a Rerank Query</h4><p>To rerank the results of a query, add the rq parameter to your search, for example:</p><pre><a href="http://localhost:8983/solr/techproducts/query?q=test&amp;fl=id,score,%5Bfeatures%5D">http://&lt;your_solr_server&gt;/solr/tmdb/query?</a>q=rambo&amp;rq=\{!ltr model=my_ranklib_model reRankDocs=100}&amp;fl=id,score</pre><h3>A Note of Caution</h3><p>There are some drawbacks to LTR, particularly when used with clicks on search results. This is a concern both of model training and evaluation. For example, when offered all the world’s bountiful harvest, <em>users tend to pick the thing on the top</em>. Meaning, if Google stopped offering anything besides the “I’m Feeling Lucky” button, user behavior would largely remain unchanged (except the <a href="https://en.wikipedia.org/wiki/Bounce_rate">bounce rate</a> would be lower). This can bias results toward what your search is already returning, therein reducing the point. This point needs to be taken into consideration when preparing your judgements.</p><h3>Conclusion</h3><p>LTR is a powerful machine learning technique that uses supervised machine learning to train the model to find “relative order.” of your search results. It can provide substantial benefits to your search pipeline. By employing a well architected pipeline you can inject the machine learning capabilities into your workflow to provide a better user experience for your shoppers.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9a0bd9f0b27d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Applying Machine Learning in Search Applications]]></title>
            <link>https://jusky8.medium.com/applying-machine-learning-in-search-applications-d49898bf5a93?source=rss-dc0dbf98fc07------2</link>
            <guid isPermaLink="false">https://medium.com/p/d49898bf5a93</guid>
            <dc:creator><![CDATA[Jaskaran Singh]]></dc:creator>
            <pubDate>Thu, 08 Oct 2020 18:23:34 GMT</pubDate>
            <atom:updated>2020-10-08T18:23:34.262Z</atom:updated>
            <content:encoded><![CDATA[<p>The coronavirus pandemic has put e-commerce at the forefront of retail. Traditional retailers are trying to leverage their in-store appeal for consumers and move into the world of e-commerce with an effective omnichannel strategy that offers a seamless shopping experience online and offline. Product discovery on the e-commerce platform thus becomes increasingly more important to provide a better shopping experience for the customers, and provide relevant search results leading to higher conversion rates. In my <a href="https://medium.com/@jusky8/role-of-site-search-in-ecommerce-25aff6413dc4">last blog post</a>, I touched upon the different components that go in an online search application. This post expands on the last one and talks about the role of Machine Learning in online search</p><p>Online shoppers have short attention spans and long memories. You must have heard the phrase</p><blockquote>“If They Can’t Find It, They Can’t Buy It”.</blockquote><p>Engaging customer by providing relevant results that match their search criteria and personalized to the user provides an intuitive shopping experience. Results on first page have a much higher chance of conversion than the results on latter pages. This blog post discusses an approach on finding and ranking the most relevant products for a given user query.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SNQqLdY0B9WM99M48-BZxw.png" /><figcaption>ML powered search pipeline</figcaption></figure><p>A user’s quest to find the products they are looking for starts with the ubiquitous search box. The input queries are analyzed first to make sure they are free from misspellings or misordering. One way to approach this problem is using what is called as Head/Tail query analysis. Head queries are ones that users search a lot resulting in successful outcome like clicks or purchases. Head queries usually involve an explicit intent; example jeans, socks that imply a product category, or levis, nike that imply a brand, or a combination like levis jeans. Tail queries are queries that doesn’t occur a lot with low outcome. These queries tend to be longer words or multi-word phrases, and are tricky to handle because of their sheer variety. These queries generally could mean a typo, a number not typed correctly, or even a synonym. By replacing, or rewriting, a tail query to its corresponding head query we may be able to improve the returned search results for the tail query.</p><p>A long tail indicates very little traffic coming from a large majority of queries (that is, most of our queries are not generating any clicks). Tail queries may mean missed opportunities. You should run offline head/tail analysis on all your queries and classifies tail distribution so that you can identify the issues and fix them.</p><blockquote><em>The core idea is to convert tail queries into head queries</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4KHMm1f342CnqrhveSEhMQ.png" /><figcaption>Head/Tail query analysis</figcaption></figure><p><strong><em>How can Head/Tail Analysis work?</em></strong><br>For each tail query, try to find its closest matching head queries, and based on the difference between the tail and head queries, assign reasons for why any given query is a tail query and prescribe an improvement.</p><p><em>Collect historical user behavior signals like what user clicked on, what they rewrote after a failed query search, and try to identify synonyms, misspellings, and more popular “head” queries.</em></p><p>For example, if users frequently type “manger” and “manager” in succession, you can deduce the misspelling or if two queries differ by one word or phrase and the spelling of that phrase or term is similar, you probably have a misspelling. This can be fixed so that misspelled queries match the head queries that actually returned results. For synonym detection, detect when two queries are alike and used in similar contexts, or contain synonyms. Evaluate which query is more effective in terms of click-through rates and replace one with the other. Here are some of the possible reasons for tail queries and suggested improvements:</p><ol><li>Spelling: Query contains one or more misspellings; we can apply spelling suggestions based on the matching head.</li><li>Number: Query contains an attribute search on a specific dimension. To normalize these queries we can parse the number to deal with different formatting, and/or pay attention to unit synonyms or enrich the product catalog. For example, “3x5” should be converted to “3’ X 5’” to match the dimension field.</li><li>Other-specific: Query contains specific descriptive words plus a head query, which means the user is searching for a very specific product or has a specific requirement. We can boost on the specific part to have better relevancy.</li><li>Other-extra: This is similar to ‘other-specific’ but the descriptive part may lead to ambiguity, so it requires boosting the head query portion of the query instead of the specific or descriptive words.</li><li>Rare-term: This is a scenario where the user is searching for a rare item which would require caution with boosting.</li><li>Re-wording: Query contains a sequence of terms in a less-common order. Flipping the word order to a more common one can change a tail query to a head query, and allows for consistent boosting on the last term in many cases.</li><li>Stopwords: Query contains stopwords plus head query. We would need to drop stopwords.</li></ol><p><strong><em>Identifying Query Intent</em></strong></p><p>The key to relevancy is understanding your users’ intentions. However, not all queries express intent clearly. While queries such as “red dress” and “mens shorts” are fairly clear, some queries such as “jaguar” are not which could be a user searching for the animal, the operating system, the car or the Jacksonville Jaguars football team to name just a few. To address this, we employ a query intent engine which uses a combination of techniques, including Machine Learning and Natural Language Processing (NLP), to surface the right results for customers.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*umszZIR4oydpMUHuHIoppA.png" /></figure><p>Queries are analyzed first by the Query Intent Engine. This is a service that parses each query to understand customer intent using semantic knowledge. It also gathers intelligence from a machine learning model before arriving at a decision. It can identify whether any part of a query is either a product attribute, class name, category, dimensions, or a brand. When someone searches for “black nike socks”, the Intent Engine determines that the word “black” likely refers to the color, “nike” to brand, and “socks” to product type. It then directs the Search Engine accordingly, i.e, to show the Socks with the “Color: black” and “Brand: nike” filter applied.</p><p>The semantic knowledge required to complete this action is compiled by dedicated NLP jobs that pull data from the various sources mentioned above. These jobs extract semantic information from text and store it in optimized data structures to facilitate fast search. Following this, NLP jobs apply a series of transformations and cleanup steps including tokenization, stemming, applying stopwords, and synonyms. Additional intelligence comes from a machine learning model that predicts the types of products to show, depending on the query. This model is essentially a query classifier. It is trained on historical click data through the NLP pipeline. Having been equipped with information from multiple sources, the Intent Engine then decides on the next best action.</p><h4>Text Matching in Search Systems</h4><p>Full text search engines based on Apache Lucene employ general-purpose keyword search algorithms with a document being the unit of search and index. An index consists of one or more Documents, and a Document consists of one or more Fields. In database terminology, a Document corresponds to a table row, and a Field corresponds to a table column. Product catalogs are stored in these systems as documents with fields like product name, attributes, description and the taxonomy. User queries are tokenized into single words and each word is searched within the index using boolean logic. The results returned from the query matching need to be ranked, mostly using a ranking formula that is based on word statistics, e.g. every product is given a score of how relevant it is to the customer query. This ranking is based on word statistics, e.g. it relies on counting how often particular words from the query are mentioned in the product data and how common this word is across all the products in the catalog. Examples of ranking formulae are BM25 and TF-IDF. Search engines may employ some more techniques by tnormalizing words, reducing them to their stems, so that “jog” will match “jogging”. They also employ thesauri (or thesauruses) with numerous synonyms so that a “dress” will match a “gown”.</p><p>The full text approach to retail search suffers from multiple problems, however. First of all, the method of matching individual words often backfires when a word is part of a multi-word concept. Compare the usage of the word “board” in such different contexts as “board game” and “cheese board”. Matching those words outside of their context will lead to displaying many irrelevant, accidental results which will drown customers in useless data. Additionally, word counting is not the best proxy for defining customer intent. If we are searching for a particular combination of attributes, such as “turquoise skirt”, we may have a situation where the fact that “turquoise” is a very rare word in the catalog will dominate the scoring formulae and the result will show all turquoise products on top, even if they are not skirts.</p><p>The baseline approach described is purely based on the search query and how well it matches the documents. It is inflexible and is unable to learn and adjust automatically as the content and the types of searches adjust and evolve over time. In absence of a well defined query, it becomes extremly difficult to identify the customer intent. For example, when a customer is searching for “eagles”, is it Eagles the band or Philadelphia Eagles or the bird (or all 3)? What other information can we use? You can rely on your first party data, or try to procure second or even third party data for improving your relevancy results.</p><p>First-party data is the data you have collected about your customers and comes from your own website through cookies or via your app, CRM, customer feedback, in-store beacons, purchases, contact center, point-of-sale communication, or any other information given with the consent of users. It is a result of direct, trusted relationship and communication with a consumer. Second-party data in a nutshell is someone else’s first party data. Third-party data is generally aggregated from many different sources and consists of rich behavioral or demographic data. It is often an inferred (implicit) data, which means that it is based on past user behavior and not on information, provided explicitly by the user. It is often collected by an entity that doesn’t have a direct relationship with consumers.</p><p>Lets talk about first party data, as that is what you directly control. How your customer engages with your e-commerce platform can produce tons of signals related to their search and shopping behavior, and these contextual clues can leveraged to further improve the quality of product discovery experience. A signal-based system uses search context and user interaction data to derive insights about what users are looking for and how best to provide it to them. Signal-based systems can react and adjust search responses and order them according to the relevance that is obtained from user analysis and context about what the user actually wants.<br>Typically, signals are events with time stamps that provide information relevant to search. annotations (likes/dislikes), user clicks, purchases, add-to-cart, product views are all examples of signals. Raw signal data is generally a large set of small data points that in and of themselves are not informative without further processing. Aggregation is the “processing” part of signal processing. An aggregator reads in raw signals and returns interesting summaries, ranging from simple sums to sophisticated statistical functions. In short, the individual signals are collected, aggregated, analyzed, and then used to provide clues to the search system about what the user is looking for and trying to find. These clues are then used to provide the most relevant answers and/or recommendations that can be used to get the best answer or provide the “next best action.”</p><h4>Use Machine Learning to improve Relevancy Results</h4><p>So far we have talked about taking advantage of signals to improve our search results. These signals can be engineered as features and used by a machine learning approach called as learn-to-rank (LTR). In general, we will have 3 kinds of features:</p><ul><li>Query features: What queries are the users using</li><li>Document features, which in our e-commerce case can be things like price, units sold, sales, popularity, number of views, number of reviews, newness, etc…</li><li>query-document features — those are features which represent how well document matches the query (eg: did it match the color attribute?) as well as feedback on the quality of the results (eg: did the user click on a particular document that was returned in the query)</li></ul><p>You can provide various other set of features based on your requirements.</p><ul><li>User personalization: Given the user’s short-term search history, we can infer useful information that can help us personalize future searches. Some of these include Brand Affinity, Category Affinity, Average Purchase Price etc.</li><li>Localization: Where is the user coming from</li><li>Weather: Use the current weather conditions to fine tune your search. A user looking for “Boots” in Minnesota in the month of March may expect a total different set of results vs someone in Texas</li></ul><p>You don’t want to execute the ML model on on every result in your index. These models are CPU intensive and their complexity directly depends on how many products they have to examine and rank. This is fine to dozens and hundreds, but not for thousands or millions. This is why you can’t run full LTR model against all matching products. More often, you’ll execute your model on the top N of a baseline relevance query. This process is called as re-scoring</p><p>In some search systems, re-ranking is happening not inside search engine, but in a dedicated microservice or even a third party system. Still, this doesn’t change the fact that only the top few dozen results get re-sorted by the machine learning algorithm. It also adds serialization and wiring overhead to the system.</p><h3>Conclusion</h3><p>As more and more people move their shopping experience to online channels, it is really critical that your application is capable of serving the search results that match user’s intent. Augmenting your search pipeline with more advanced machine learning techniques, you can ensure your application can learn from the user’s shopping behavior as well as use external signals to help users find what they are looking for. Machine learning is an essential part of the modern search system. and is helping in many areas of search workflow, such as intent classifications, query parsing, facet selection, and, most importantly, results re-ranking. In subsequent posts, I will go into the implementation details of each of these components.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d49898bf5a93" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Role of Site Search in eCommerce]]></title>
            <link>https://jusky8.medium.com/role-of-site-search-in-ecommerce-25aff6413dc4?source=rss-dc0dbf98fc07------2</link>
            <guid isPermaLink="false">https://medium.com/p/25aff6413dc4</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[search-engines]]></category>
            <dc:creator><![CDATA[Jaskaran Singh]]></dc:creator>
            <pubDate>Sun, 20 Sep 2020 02:35:50 GMT</pubDate>
            <atom:updated>2020-09-20T02:35:50.617Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rLtaLzYufYYaB6ZpVTyoEA.png" /></figure><p>Not too long ago most people shopped in their local stores complete with parking and weather problems, long lines, and wobbly shopping carts. Older generations grew up without being able to shop online. In today’s mobile-first world, customers are more connected and demanding. Online buying has grown exponentially over the years. Covid 19 accelerated the move from in-store shopping to online shopping, and this trend is here to stay.</p><p>Product discovery on the e-commerce platform thus has become increasingly more important to provide a better shopping experience for the customers, and provide relevant search results leading to higher conversion rates.</p><p>Online shoppers have short attention spans and long memories. You must have heard the phrase</p><blockquote>“If They Can’t Find It, They Can’t Buy It”.</blockquote><p>Engaging customer by providing relevant results that match their search criteria and personalized to the user provides an intuitive shopping experience. Results on first page have a much higher chance of conversion than the results on latter pages.</p><p>A user’s search journey typically starts with the search box. They may or may not know exactly what they are looking for. Sometimes the query is misspelt, and at times it may not match against products in your catalog. Auto-suggest provides relevant, helpful alternative or additional suggestions that may be close to the query being searched by the user. It also provides the corrected spelling of a misspelled word. Sophisticated search applications use algorithms to provide the most logical choices to finish the search. Using natural language processing and custom dictionaries, applications can store and recognize previous searches, search and rank data within your product databases, and weigh frequency (or recency) of searched phrases to supply the user with the most relevant suggested terms. Once the search query is matched against the products in your catalog, you are tasked with showing the most relevant results to your users. Understanding query intent and showing more personalized results helps in better user search experience. The query may be broad matching hundreds of products. You want to give your users option of filtering the results via facets. A modern search application combines the power of Autosuggestion, search relevancy and facets to provide a powerful experience keeping their users engaged and have them keep coming back to the platform.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iDKMKeoxIshrn06IgR5x3Q.png" /><figcaption>Autosuggestion, Facets and Search Relevancy</figcaption></figure><h3>Auto Suggestion</h3><p>Not all shoppers on your eCommerce website come looking for a product they have already thought of. While a lot of shoppers know what they want to buy, you’ll find some are impulsive shoppers. Some of them just finished chatting with a friend who’s referred you and that’s why they are on your site out of curiosity. Auto-suggest provides relevant, helpful alternative or additional suggestions that may or may not be close to the query being searched by the user. You may be tempted to utilize the list of common queries from the search logs. Remember, user queries may be misleading, inappropriate, or contain terms that have no results. Instead, suggest <em>curated</em> query terms that retrieve useful results. The suggestions can be based on your search logs or on your content’s descriptive metadata. It is also critical that you highlight those suggested-query terms that match the input query, so users can easily identify the similarity.</p><h3>Facets</h3><p>Faceted search has become a critical feature for enhancing findability and the user search experience for all types of search applications. Facets are the checkboxes, dropdown menus, fields and other UI elements often presented with a set of search results so the user can further sharpen and refine their query. Faceted search is the dynamic clustering of items or search results into categories that let users drill into search results (or even skip searching entirely) by any value in any field. Each facet displayed also shows the number of hits within the search that match that category. Users can then “drill down” by applying specific constraints to the search results. It allows the exact results that fit the user’s criteria and goals to be surfaced. So a set of search results for “laptops” will show checkboxes for brands, dropdown for average customer review, and fields for ideal price range.</p><p>You can fine tune your facets to show the most relevant options at the top. For example instead of showing the brands by alphabetical order, you can show the most popular or trending brand at the top of the facet. Curating your facets based on trends, user’s preferences, or even the geo-location can provide a better user experience and lead to higher conversion rates.</p><h3>Improving Search Results</h3><p>Engaging customer by providing relevant results that match their search criteria and personalized to the user provides an intuitive shopping experience. Results on first page have a much higher chance of conversion than the results on latter pages. Thus it becomes increasingly important that you provide relevant results that match user query intent, as well as rank them to boost the most relevant results.</p><blockquote>Search relevancy addresses the problem: How relevant are the search results based on the user query?</blockquote><p>Relevance can be hard to get right, since it is highly dependent on context and a number of changing variables. A result that is relevant for a customer might not be relevant for the business owning the search engine, and vice versa. Additionally, different people will have different ways to express what they are looking for, and even for the exact same query, different users will expect different results. The field of search relevancy has evolved over time, with traditional ranking systems using frequency of keywords in documents to predict their relevance to more advance techniques like Learning to Rank (LTR) which utilizes supervised machine learning to automatically tune relevancy factors, which not only alleviates the pain associated with manual processes like boosts and blocks, but also promises significantly improved relevancy with the use of state of the art modeling techniques.</p><p>A signal-based system uses search context and user interaction data to derive insights about what users are looking for and how best to provide it to them. Signal-based systems can react and adjust search responses and order them according to the relevance that is obtained from user analysis and context about what the user actually wants. External factors like a user’s location, the current weather conditions and user’s past shopping history can be used to make the experience more personalized.</p><h3>Conclusion</h3><p>More and more retailers are trying to improve their eCommerce platforms to cater to the changing shopping behavior. It has become important that your search system keeps pace with ever changing user preferences and taste, and learn to adapt to the current trends. In subsequent posts, I will go into the details of each of the functionalities mentioned above, how you can design them and implement them within your platform for an enhanced user experience.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=25aff6413dc4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[OnPepper launching new document extraction service]]></title>
            <link>https://jusky8.medium.com/onpepper-launching-new-document-extraction-service-ff834d716e3?source=rss-dc0dbf98fc07------2</link>
            <guid isPermaLink="false">https://medium.com/p/ff834d716e3</guid>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[nlp]]></category>
            <category><![CDATA[serverless]]></category>
            <category><![CDATA[azure]]></category>
            <dc:creator><![CDATA[Jaskaran Singh]]></dc:creator>
            <pubDate>Wed, 11 Sep 2019 13:41:43 GMT</pubDate>
            <atom:updated>2019-09-11T13:41:43.093Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/188/1*RNBfHB_qLPlumD6WsJ-kxQ.png" /></figure><p>Manual data entry remains one of the biggest challenges any organization faces these days. Collecting and inputting data into your business applications can be a time-consuming, expensive, error prone and labor intensive process. However, manual data entry is still common for many business processes, despite its inherent drawbacks. Your organization may receive data in multiple forms: email, pdf, paper to name a few. Scaling your business process to ingest all this data in a timely fashion is a daunting task.</p><p>Many organizations have chosen simple optical character recognition (OCR) software as the technology to fill in their data entry void. However that approach is not without its drawbacks. Most OCR systems require manual customization or configuration. Rules and workflows for each document and form often need to be hard-coded and updated with each change to the form or when dealing with multiple forms. If the form deviates from the rules, the output is often scrambled and unusable.</p><p>We at Pepper continually look at emerging and bleeding edge technologies to meet our client needs. Currently we use Microsoft Azure Search to index all the uploaded documents to create smart search indexes that allow our users to search through millions of financial statements quickly. However, we still needed a way to extract information in a way that could reduce the manual data entry needs of our clients. We chose AWS to complement our existing services to automatically extracts text and data from scanned documents. This approach goes beyond simple optical character recognition (OCR) to also identify the contents of fields in forms and information stored in tables. The service overcomes these challenges of traditional OCR applications by using machine learning to instantly “read” virtually any type of document to accurately extract text and data without the need for any manual effort or custom code.</p><p>Below is a high level architecture overview of our Document data extraction service.</p><ol><li>The process starts when a user uploads a document to Pepper. We use Azure Blob Storage to store all our documents. The document is sent to Azure Search for indexing so that the user can search the uploaded document later on. For the document extraction service, a message is sent to an Azure Queue Storage</li><li>A azure function is invoked with an event that contains queue message. This azure function is responsible for copying the document from Azure Blob Storage to AWS S3</li><li>A AWS Lambda function is invoked whenever a new document is copied to S3 which submits an Amazon Textract job to process the document</li><li>As Amazon Textract is finished processing a document it sends a completion notification to an SNS topic.</li><li>SNS then triggers another Lambda function to get results from Amazon Textract and store it to S3.</li><li>When the results hits S3, it triggers a lambda function which posts the results to an Azure function</li><li>The azure function receives the results and store them to Azure blob storage</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*A0Bfb_muYfXei_phE18D3Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*r7M08M_h9jAfZCWtcogGgQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ayOhtm35lIp_QidCYxEReA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*N2JZa_kBvxZmcx3MKsJuQA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BzU-y39zy8htu2NhPhEJbg.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ff834d716e3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Text Classification using Machine Learning]]></title>
            <link>https://jusky8.medium.com/text-classification-using-machine-learning-5838293c9f2?source=rss-dc0dbf98fc07------2</link>
            <guid isPermaLink="false">https://medium.com/p/5838293c9f2</guid>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[text-classification]]></category>
            <category><![CDATA[nlp]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Jaskaran Singh]]></dc:creator>
            <pubDate>Tue, 13 Aug 2019 04:50:15 GMT</pubDate>
            <atom:updated>2019-08-13T23:59:46.662Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gkqmCAuxIY4g4I-2IDHtlw.png" /></figure><p>Text classification is the process of assigning text to one or more classes or categories. It is one of the fundamental tasks in Natural Language Processing (NLP) with broad applications such as sentiment analysis, topic labeling, spam detection, and intent detection.</p><p>Text data is available everywhere: Files, powerPoint presentations, email, audio files, social media postings, web pages, chats to name a few. Most of this text data is largely unstructured. Extracting useful insights from this unstructured data is a hard problem. You can use Text classification to organize, structure, and categorize your data and derive useful insights from it. Text Classification is widely used in business applications for things like sentiment analysis and categorization of text (eg: spam detection in emails or categorizing articles into set of topics)</p><p>Broadly speaking, a text classification workflow can be summarized using the following steps</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xRx8Oq3Stv0Vzho1PdF9iw.png" /></figure><p>This blog post intends to provide a blueprint of the steps taken in a typical text classification project using machine learning. The intent is to provide a high-level, end-to-end workflow using visual representation. There is a saying “A picture is worth a thousand words”, and taking inspiration from that adage, much of what i want to share is conveyed through the below infographic.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9vXVcq9yFt581pfxcPNK_Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3IsKJnsil3wrPqE7Tf0eeA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5DIiDlh8brzraqelPS7F4Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*f2txC9ApgK0FsPtDEpZTOw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3hhFMzFU9WJ6Q557b_JauQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*d558a7Mhd1162lOFUJ_Qvw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oyaSxuCtkYg9wOyGcP7Veg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DiDTOi2B_9Xt1w9uXixLWg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Vare6Gw1iEDNwnede_d-rA.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5838293c9f2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Data Science Journey]]></title>
            <link>https://jusky8.medium.com/data-science-journey-14a6c8af9227?source=rss-dc0dbf98fc07------2</link>
            <guid isPermaLink="false">https://medium.com/p/14a6c8af9227</guid>
            <category><![CDATA[data-analysis]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Jaskaran Singh]]></dc:creator>
            <pubDate>Mon, 07 Jan 2019 16:23:59 GMT</pubDate>
            <atom:updated>2019-01-07T16:23:59.464Z</atom:updated>
            <content:encoded><![CDATA[<p>Data science continues to evolve as one of the most promising and in-demand fields that enables organizations to unravel meaningful insights, and generate data-drive evidences that can benefit them in a significant way, and provide a competitive edge. In order to uncover useful intelligence for their organizations, data scientists must master the full spectrum of the data science life cycle and possess a level of flexibility and understanding to maximize returns at each phase of the process.</p><h3>What is Data Science?</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*omKWvuzzb-9ufEGhHMFiUw.png" /></figure><blockquote>Data science is an interdisciplinary field that spans mathematics, statistics, computer science along with core domain knowledge to provide a set of fundamental principles, processes and methods that guide the extraction of knowledge and insights from data.</blockquote><p>This blog post intends to provide a blueprint of the steps taken in a typical data science project to derive meaningful value and insights from raw data. In future posts, I will elaborate each step in detail, but for now this should provide a high level view.</p><p>There is a saying “A picture is worth a thousand words”, and taking inspiration from that adage, much of what i want to share is conveyed through the below infographic. In a future post, I will elaborate on each phase in detail</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xklO4CUh58LPlhWZ6jPWlQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3aDmzTnqpLXRq5mpCvgGQA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zREtyihZ1Vgocs3Mt7K3nA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*h2C-FM8ZkbME9nLEmmtUTg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FlMh72IkVhGpY46xRh8suw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wTMmKntsBf7aO_mgsA6VTA.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=14a6c8af9227" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>