Building Production-Grade spaCy Text Classification Pipelines for Business Data
Unlock the full potential of spaCy with this guide to building production-grade text classification pipelines for business data.
If you play any sports that involve a ball — soccer, football, golf, basketball, tennis, cricket, rugby, and more — you’ll be happy to know that artificial intelligence (AI) can help you systematically enhance your technique and grow as a player. Or if you’re a coach, AI can assist you to become more effective.
So, where can you apply AI in your favorite sport? You can use it to observe and analyze any aspect of any sport. But to help you understand its capabilities better, we’ll focus on one feature that’s useful across multiple sports — automated ball tracking.
Ball tracking records a ball's 3D position, and sometimes other attributes like speed or spin, relative to the field (or court) and the players.
By doing so, players and coaches can analyze their techniques and improve on them. Referees and umpires can give better decisions. Broadcasters like TV and YouTube sports channels can offer insights to their viewers through engrossing visualizations.
Recent advances in AI, especially the use of deep learning and deep neural networks for computer vision tasks, enable us to reliably automate ball tracking. In addition, other useful tasks like player detection, player tracking, body parts segmentation, pose estimation, and activity recognition can be combined with ball tracking to provide comprehensive insights and analysis for any sport.
In the next sections, we’ll explore ball tracking in golf, soccer, and cricket to understand AI’s benefits.
The National Golf Foundation says 2.4-3.2 million Americans per year play golf for the first time. But only about 27% of them turn into regular players. There is a huge demand for coaching and self-teaching aids that AI can help fulfill.
If you play golf at any level, you already know that it’s a highly technical game. An unending number of factors can affect your shot — your pose and height, the swing arc, the speed and angle of approach, the type of the golf club, the club loft (angle of the club face), the materials of the club and the ball, the grass, changes in ground elevations, even the wind.
Getting good at golf can be frustrating. But being a game over which people socialize and make business deals, many players are highly motivated to get better.
This is where AI can help. Automated golf ball tracking apps let you analyze your technique and improve at your own pace. In addition to automated ball tracking, these apps combine pose estimation, swing tracking, and other analysis to address every aspect of your play.
A smartphone or a laptop is placed on a tripod about 5 feet behind the player. This position allows it to track the ball from the moment it’s launched till it hits the ground.
Most players like to review the trajectory immediately after the shot. So, real-time ball detection and tracking are essential. For high-speed golf ball detection and localization in real-time, we use a mobile-friendly lightweight object detection model like YOLOv3. YOLO reports a bounding box for the ball in the input image and a confidence score for the detection. But instead of using it to detect the ball every frame, we optimize by using it only every few frames. For the gaps, we use a faster image processing algorithm like the Kalman or particle filter.
Being such a technical game, many determined players also like to analyze their play off-course. For this, more accurate detection and object tracking are necessary. They may need a more accurate 3D trajectory by combining inputs from a second camera. For such off-course analysis, we recommend using more sophisticated models like TrackNet and TrackNetv2. They detect the ball more accurately by analyzing sequences of images.
If you’re a golf coach, AI can help you become more effective by enabling you to analyze, measure metrics, and visualize all aspects of your students’ techniques. Combining ball tracking with activity recognition, pose estimation, swing tracking, and data science algorithms like clustering gives you comprehensive insights into techniques and weaknesses.
Each of these tasks uses its own dedicated deep learning model. For activity recognition and pose estimation, we use pre-trained out-of-the-box body segmentation models from frameworks like Detectron2.
Ball and swing tracking are pretty useful by themselves. But even more useful would be the ability to simulate all the factors involved in a golf shot, vary them, and choose the ones that improve the shot.
For example, you can vary the positions and angles of your simulated arms and see how the shot improves. You can then practice this new position out on the course.
For this to work, we create a realistic simulation model that includes all the factors that influence a golf shot. But instead of modeling them explicitly using formulas, we use machine learning to learn all the complex inter-relationships between these factors. The input training data for this learning includes:
By combining these factors, the simulator learns to predict a ball’s trajectory when given all the other factors. We don’t explicitly model its physics using formulas. Instead, all the physics phenomena are embedded in the parameters of the model by simply learning from the training data.
Soccer (or football) is a very popular sport worldwide, especially in Europe, Latin America, and Africa. The sport’s ecosystem includes football clubs, coaching academies, educational institutions, and broadcast media. Let’s see how AI and particularly ball tracking systems are used in soccer.
If you’re a soccer player, automated ball tracking can help you improve your ball control and passing skills. It enables you to visualize how the ball moves in response to your leg and feet movements. You can discover weaknesses in your technique and improve upon them.
Unlike golf or cricket, in soccer, the ball is always moving with several players running around it. It’s a fast-paced game played in a large field which means the cameras have to pan around the field a lot. So, a capable ball tracking system has to overcome challenges like motion blur and frequent occlusion.
We use a sports video analysis pipeline that includes optical flow to compensate for motion blur, a fast detector like YOLOv3 or YOLOv4 for ball detection, and the unscented Kalman filter to continue tracking accurately even when the ball is blocked by players’ bodies and legs.
Since the YOLO models are general-purpose object detectors, we improve their accuracy by fine-tuning them for a specific sport. For example, we fine-tune them on a dataset of soccer ball images in their typical surroundings to help the model learn to detect soccer balls more accurately.
Automated ball tracking also helps soccer coaches record, analyze, and visualize strategies and tactics like positional play, attack, and defense. For this, we combine ball tracking with deep learning models for player detection and tracking. Multiple cameras are fixed around the periphery of the field.
Compared to commercial systems like Hawk-Eye, our custom systems are built for your specific use case allowing us to get a scorching hot in-domain accuracy.
Cricket is a popular sport in the Commonwealth countries. Its ecosystem includes cricket boards, coaching academies, educational institutions, and broadcast media. Let’s explore how AI and ball tracking are used in cricket.
Let’s see how coaches can analyze and enhance a cricketer’s skills using AI.
Good cricket tactics are all about playing mind games against your opponents. Surprise them to keep them unbalanced and on edge.
A bowler seeks to lull the batter by starting out predictably before hitting them with an unexpected swing or googly. Meanwhile, the batter constantly scans the field for weak points to send the ball to and score a quick run or a boundary. Gaps in the field, slow runners, and clumsy fielders are all targets for a clever batter.
As a coach in an academy or an institution, teaching a player to notice such patterns of play and weak points — both their own and those of their opponents — is an important goal of cricket coaching. Every player is taught to unlearn their predictability, get out of their comfort zone occasionally, and surprise their opponents.
Visualizing different aspects of play over time helps your players discover patterns of play and weak points like:
AI helps with such visualizations using automated ball tracking and pitch detection. The data are shown as heat maps, pitch maps, “wagon wheel” graphs (that show trajectories of all the shots played by a batter), and other types of visualizations.
As a coach, you’d like to give immediate feedback on bowling or batting actions while out practicing. But you also require more detailed analyses and visualizations post-practice. Both capabilities are needed in a good ball tracking solution.
In the typical coaching setting, a smartphone, or a laptop with an off-the-shelf camera, is placed near the stumps at the non-striker’s end looking down the pitch. A second device may be placed to the side to capture bowling or batting actions from the side. They record the videos for the AI models to process.
For quick ball detection in real-time, we use an object detector like YOLOv3 or YOLOv4. It’s lightweight, mobile-friendly, and fast with high frames-per-second. These object detector systems make it easy to track multiple balls as well in the same instance.
But detection in every frame is unnecessary because a cricket ball travels quite predictably, not randomly, between two frames. So, we opt for a more lightweight tracking approach using probabilistic tracking algorithms like the Kalman or particle filter. They predict the position of a ball based on its previous position.
But an additional complication in cricket is the ball pitching on the ground. A cricket ball’s pitching makes its trajectory nonlinear. To handle that, we use the unscented variant of the Kalman filter. It can predict the position of the ball, in 2D or 3D, from its previous position. When there’s a sudden flip in the vertical direction of the ball, we know that it has pitched on the ground.
For post-practice analysis, we suggest a more capable detection algorithm like TrackNet or TrackNetv2. They detect balls more accurately by examining sequences of images.
Cricket has some unique rules that require an umpire to imagine a what-if situation before giving a decision. For example, the leg before wicket (LBW) rule says that if a batter defends a ball with their pad, the umpire should mentally trace the trajectory of the ball as if the leg wasn’t present and if that imaginary path looks like it will hit the stumps, then declare the batter out.
Unsurprisingly, such subjective judgments based on imagination have led to a lot of controversial decisions over the years. The situation was improved by automated decision review systems like Hawk-Eye. However, these systems are cost-prohibitive and used only in top-tier matches.
Less expensive AI ball tracking systems can be immensely beneficial for county-level and local matches that don’t have large budgets. Our automated cricket ball tracking uses off-the-shelf devices to supply intelligent ball tracking solutions to any local coaching academy, institution, or cricket board.
For this use case, off-the-shelf cameras are typically attached around the periphery of the field. The ball tracking solution system takes in video feeds from multiple cameras and runs the ball detector on each. We again use an unscented Kalman filter for tracking because there are nonlinear direction changes.
Next, the pipeline uses multi-view geometry to combine multiple camera views into a 3D projection and calculate the 3D position of the ball. Trained on lots of videos of ball movement, the system is now able to predict the 3D trajectory of the ball using a regression model. A second regression-classification model, fine-tuned on a dataset of LBW videos, detects LBW and reports a confidence score.
AI’s human-like vision, language, and audio understanding capabilities enable it to be very useful for multiple tasks in every sport’s ecosystem, including player self-teaching, coaching, officiating, and broadcasting. Moreover, these improvements are now available cheaply to every stratum of society and level of competition, thus directly contributing to socio-economic improvements in the lives of people through sports.
With our deep expertise in AI, deep learning, and computer vision, Width.ai is the ideal implementation partner to bring your sports improvement ideas to life. Let’s talk!
Unlock the full potential of spaCy with this guide to building production-grade text classification pipelines for business data.
We compare 12 AI text summarization models through a series of tests to see how BART text summarization holds up against GPT-3, PEGASUS, and more.
Let’s take a look at what intent classification is in conversational ai and how you can build a GPT-3 intent classification model for conversational ai and chatbot pipelines.
Discover the capabilities of zero-shot object detection, which enables anyone to use a model out-of-the-box without any training and generate production-grade results.
What is facial expression recognition and what SOTA models are being used today in production
Get a simple TensorFlow facial recognition model up & running quickly with this tutorial aimed at using it in your personal spaces on smartphones & IoT devices.
Explore accurate classification algorithms using the latest innovations in deep learning, computer vision, and natural language processing.
Learn what human activity recognition means, how it works, and how it’s implemented in various industries using the latest advances in artificial intelligence.
What is the the SetFit architecture and how does it outperform GPT-3 and other few shot large language models
What is image classification and how we build production level TensorFlow image classification systems for recognizing various products on a retail shelf.
Explore the application of intelligent document processing (IDP) in different industries and dive in-depth on intelligent document pipelines.
How to build an image classification model in PyTorch with a real world use case. How you can perform product recognition with image classification
Let's build a custom CTA generator that you'll actually want to use for your website copy
We’re going to look at how we built a state of the art NLP pipeline for blended summarization and NER to process master service agreements (MDAs) that vary the outputs based on the input document and what is deemed important information.
Get a comprehensive overview of a purchase order vs. invoice, including when businesses use each, what information goes in them, and more.
Learn what Google Shopping categories are used for and how you can automate fitting products to this taxonomy using ai.
Automatically categorize your Shopify store products to the Shopify Product Taxonomy instantly with ai based PIM software
Dive deep into 3-way invoice matching, including how it works, eight benefits for your business, and the problems with doing it manually.
Smart farming using computer vision and deep learning provides the most promising path forward in the slow-moving industry of agriculture.
How we leveraged large language models to build a legal clause rewriting pipeline that generates stronger language and more clarity in legal clauses
Using ai for document information extraction to automate various parts of the loan process.
Categorize your ecommerce products to the 2021 google product taxonomy tree instantly with our Ai software
Surveying the current landscape of ecommerce automation and how you can use ai to automate huge chunks of your product management.
Classify your product data against an existing product category database or generate categories and tags in seconds using artificial intelligence
Warehouse automation plays a crucial role across your supply chain. Learn about how machine learning and ai software can be integrated into your warehouse automation stack.
4 different NLP methods of summarizing longer input text into different methods such as extractive, abstractive, and blended summarization
iscover an invoice OCR tool that will revolutionize the way you handle invoices. There’s no human intervention needed & a dramatically lower per-invoice cost.
Instead of invoice matching taking upwards of a week, it could take mere seconds with the proper automation solution. Learn more here.
Manual and template-based invoicing are riddled with low accuracy and required human intervention. Learn how to systematically eliminate these issues with the right invoice data capture software.
A complete walkthrough guide on how to use visual search in ecommerce stores to create more sales and real examples of companies already using it.
Automating the extraction of data from invoices can reduce the stress of your accountants by finding inaccuracies, digitizing paper invoices, and more.
How you can use machine learning based data matching to compare data features in a scalable architecture for deduping, record merging, and operational efficiency
Learn how lifetime value or LTV prediction can improve your marketing strategies. Then, discover the best statistical & machine learning models for your predictions.
A deep understanding of how we use gpt-3 and other NLP processes to build flexible chatbot architectures that can handle negotiation, multiple conversation turns, and multiple sales tactics to increase conversions.
The popular HR company O.C. Tanner, which has been in business since 1927 and has over 1500 employees, was looking to research and design two GPT-3 software products to be used as internal tools with their clients. GPT-3 based products can be difficult to outline and design given the sheer lack of publicly available information around optimizing and improving these systems to a production level.
We’ll compare Tableau vs QlikView in terms of popularity, integrations, ease of use, performance, security, customization, and more.
With a context-aware recommender system, you can plan ways to recreate some of the contextual conditions that persuade them to buy more from you.
We’re going to walk through building a production level twitter sentiment analysis classifier using GPT-3 with the popular tweet dataset Sentiment140.
Find out how machine learning in medical imaging is transforming the healthcare world and making it more efficient with three use cases.
Discover ways that machine learning in health care informatics has become indispensable. Review the results of two case studies and consider two key challenges.
Accelerate your growth by pivoting key areas of your business to AI. Your business outcomes will be achieved quicker & you’ll see benefits you didn’t plan for.
We built a GPT-3 based software solution to automate raw data processing and data classification. Our model handles keyword extraction, named entity recognition, text classification | Case Study
We built a custom GPT-3 pipeline for key topic extraction for an asset management company that can be used across the financial domain | Case Study
How you can use GPT-3 to create higher order product categorization and product tagging from your ecommerce listings, and how you can create a powerful product taxonomy system with ai.
5 ways you can use product matching software in ecommerce to create real value that raises your sales metrics and improves your workflow operations.
Data mining and machine learning in cybersecurity enable businesses to ensure an acceptable level of data security 24/7 in highly dynamic IT environments. Learn how data security is getting increasingly automated.
Product recognition software has tremendous potential to improve your profits and slash your costs in your retail business. Find out just how useful it is.
Big data has evolved from hype to a crucial part of scaling your organization in every modern industry. Learn more about how big data is transforming organizations and providing business impacts.
Learn how natural language processing can benefit everybody involved in education from individual students and teachers to entire universities and mass testing agencies.
Here’s how automated data capture systems can benefit your business in some key ways and some real-life examples of what it looks like in practice.
Use these power ai and machine learning tools to create business intelligence in your marketing that pushes your business understanding and analytics past your competition.
We built a custom ML pipeline to automate information extraction and fine tuned it for the legal document domain.
In this practical guide, you'll get to know the principles, architectures, and technologies used for building a data lake implementation.
Find out how machine learning in biology is accelerating research and innovation in the areas of cancer treatment, medical devices, and more.
An enterprise data warehouse (EDW) is a repository of big data for an enterprise. It’s almost exclusive to business and houses a very specific type of data.
Dlib is a versatile and well-diffused facial recognition library, with perhaps an ideal balance of resource usage, accuracy and latency, suited for real-time face recognition in mobile app development. It's becoming a common and possibly even essential library in the facial recognition landscape, and, even in the face of more recent contenders, is a strong candidate for your computer vision and facial recognition or detection framework.
Learn how to utilize machine learning to get a higher customer retention rate with this step-by-step guide to a churn prediction model.
Machine learning algorithms are helping the oil and gas industry cut costs and improve efficiency. We'll show you how.
We’ll show you the difference between machine learning vs. data mining so you know how to implement them in your organization.
Here’s why you should use deep learning algorithms in your business, along with some real-world examples to help you see the potential.
Beam search is an algorithm used in many NLP and speech recognition models as a final decision making layer to choose the best output given target variables like maximum probability or next output character.
Best Place For was looking for an image recognition based software solution that could be used to detect and identify different food dishes, drinks, and menu items in images sourced from blogs and Instagram. The images would be pulled from restaurant locations on Instagram and different menu items would be identified in the images. This software solution has to be able to handle high and low quality images and still perform at the highest production level, while accounting for runtime as well as accuracy.
Deep learning recommendation system architectures make use of multiple simpler approaches in order to remediate the shortcomings of any single approach to extracting, transforming and vectorizing a large corpus of data into a useful recommendation for an end user.
Let's take a look at the architecture used to build neural collaborative filtering algorithms for recommendation systems
GPT-3 is one of the most versatile and transformative components that you can include in your framework, application or service. However, sensational headlines have obscured its wide range of capabilities since its launch. Let’s take a look at the ways that companies and researchers are achieving real-world results with GPT-3, and examine the untapped potential of this 'celebrity AI'.
How to get started with machine learning based dynamic pricing algorithms for price optimization and revenue management
Let's take a look at how you can use spaCy, a state of the art natural language processing tool, to build custom software tools for your business that increase ROI and give you data insights your competitors wish they had.
The landscape for AI in ecommerce has changed a lot recently. Some of the most popular products and approaches have been compromised or undermined in a very short time by a new global impetus for privacy reform, and by the way that the COVID-19 pandemic has transformed the nature of retail.
Extremely High ROI Computer Vision Applications Examples Across Different Industries
Building Data Capture Services To Collect High ROI Business Data With Machine Learning and AI
Software packages and Inventory Data tools that you definitely need for all automated warehouse solutions
Inventory automation with computer vision - how to use computer vision in online retail to automate backend inventory processes