This is a guest post co-authored by Nafi Ahmet Turgut, Hasan Burak Yel and Damla Şentürk from Getir.
Founded in 2015, Getir has positioned itself as the pioneer in ultra-fast grocery delivery. This innovative technology company has revolutionized the last mile delivery segment with its exciting ‘groceries in minutes’ proposition. With a presence across Turkey, the UK, the Netherlands, Germany and the United States, Getir has become a multinational force to be reckoned with. Today, the Getir brand represents a diversified conglomerate comprising nine different industries, all operating synergistically under a single umbrella.
In this post, we explain how we built an end-to-end product category prediction suite to help commercial teams using Amazon SageMaker and AWS Batch, reducing model training time by 90%.
Understanding our existing product assortment in a detailed manner is a critical challenge we, along with many businesses, face in today’s fast-paced and competitive marketplace. An effective solution to this problem is product category prediction. A model that creates a comprehensive category tree allows our commercial teams to compare our existing product portfolio against that of our competitors, providing a strategic advantage. Therefore, our central challenge is to build and implement an accurate product category prediction model.
We leveraged the powerful tools provided by AWS to address this challenge and effectively navigate the complex field of machine learning (ML) and predictive analytics. Our efforts have resulted in the successful creation of an end-to-end product category forecasting suite that combines the strengths of SageMaker and AWS Batch.
This ability to predict analytics, particularly the accurate prediction of product categories, has proven invaluable. It provided our teams with important data-driven insights that optimized inventory management, improved customer interactions, and strengthened our market presence.
The methodology we explain in this post ranges from the initial phase of feature set collection to the final implementation of the prediction pipeline. An important aspect of our strategy was to use SageMaker and AWS Batch to improve pre-trained BERT models for seven different languages. Additionally, our seamless integration with AWS Amazon Simple Storage Service (Amazon S3) object storage was key to efficiently storing and accessing these sophisticated models.
SageMaker is a fully managed ML service. With SageMaker, data scientists and developers can quickly and effortlessly build and train ML models and then deploy them directly to a production-ready hosted environment.
As a fully managed service, AWS Batch helps you run bulk computing workloads of any scale. AWS Batch automatically provisions compute resources and optimizes workload distribution based on workload volume and scale. With AWS Batch, you don’t need to install or manage batch computing software, so you can focus your time on analyzing results and solving problems. We used GPU jobs which help us to run tasks that use single instance GPU.
Solution overview
Five people from Getir’s data science team and infrastructure team collaborated on this project. The project was completed in a month and moved to production after a week of testing.
The diagram below shows the architecture of the solution.
The model pipeline is run separately for each country. The architecture includes two GPU AWS Batch cron jobs for each country, running on defined schedules.
We overcame some challenges by strategically deploying the GPU resources of SageMaker and AWS Batch. The process used to address each difficulty is detailed in the following sections.
Improve multilingual BERT models with AWS Batch GPU jobs
We looked for a solution to support multiple languages for our diverse user base. BERT models were an obvious choice because of their established ability to efficiently handle complex natural language tasks. In order to adapt these models to our needs, we harnessed the power of AWS by using single-node GPU render jobs. This allowed us to optimize the pre-trained BERT models for each of the seven languages we needed support for. Through this method, we ensured high accuracy in predicting product categories, overcoming any language barriers.
Efficient storage of models using Amazon S3
Our next step was to tackle model storage and management. For this, we chose Amazon S3, known for its scalability and security. Storing the optimized BERT models in Amazon S3 allowed us to provide easy access to different teams within our organization, thus significantly streamlining our development process. This was a critical aspect in achieving agility in our operations and seamlessly integrating our ML efforts.
Building an end-to-end prediction pipeline
An efficient pipeline was required to make better use of our pretrained models. We first developed these models in SageMaker, an action that enabled real-time predictions with low latency, thus improving our user experience. For larger-scale batch predictions, which were equally critical to our operations, we used AWS Batch GPU jobs. This ensured optimal use of our resources, giving us a perfect balance of performance and efficiency.
Explore future possibilities with SageMaker MMEs
As we continue to evolve and seek efficiencies in our ML pipeline, one avenue we wish to explore is using SageMaker’s Multi-Model Endpoints (MME) to develop our optimized models. With MMEs, we can potentially streamline the development of various enhanced models, ensuring efficient model management, while benefiting from native SageMaker features such as shadow variants, autoscaling, and Amazon CloudWatch integration. This exploration aligns with our continued pursuit of improving our predictive analytics capabilities and delivering superior experiences to our customers.
conclusion
The successful integration of SageMaker and AWS Batch not only addressed our specific challenges, but also greatly enhanced our operational efficiency. Through the implementation of a sophisticated product category forecasting pipeline, we are able to empower our commercial teams with data-driven insights, thereby facilitating more effective decision-making.
Our results speak volumes for the effectiveness of our approach. We have achieved 80% prediction accuracy across all four levels of category sensitivity, which plays an important role in shaping the product mix for each country we serve. This level of precision extends our approach beyond language barriers and ensures that we cover our diverse user base with maximum accuracy.
Additionally, by using strategically scheduled GPU AWS Batch jobs, we were able to reduce model training durations by 90%. This efficiency has further streamlined our processes and enhanced our operational agility. Efficient model storage using Amazon S3 has played a critical role in this achievement, balancing both real-time and batch predictions.
For more information on how to get started building your own ML pipelines with SageMaker, see the Amazon SageMaker resources. AWS Batch is a great choice if you’re looking for a low-cost, scalable solution for running batch jobs with low operational costs. To get started, see Getting Started with AWS Batch.
About the Authors
Nafi Ahmet Turgut he finished his master’s degree in Electrical & Electronic Engineering and worked as a graduate researcher. His focus was building machine learning algorithms to simulate neural network anomalies. He joined Getir in 2019 and currently works as Senior Data Science & Analytics Manager. His team is responsible for designing, implementing and maintaining end-to-end machine learning algorithms and data-driven solutions for Getir.
Hasan Burak Gel he received his degree in Electrical & Electronic Engineering at Boğaziçi University. He worked at Turkcell, focusing mainly on time series forecasting, data visualization and network automation. He joined Getir in 2021 and currently works as a Data Science & Analytics Manager with responsibility for Search, Recommendation and Growth.
Damla Senturk received her degree in Computer Engineering from Galatasaray University. She is pursuing her master’s degree in Computer Engineering at Boğaziçi University. He joined Getir in 2022 and works as a Data Scientist. He has worked on commercial projects, supply chain projects and discovery related projects.
Esra Kayabalı is a Senior Solutions Architect at AWS, specializing in analytics, including data warehousing, data lakes, big data analytics, batch and real-time data streaming, and data integration. He has 12 years of experience in software development and architecture. She is passionate about learning and teaching cloud technologies.