
Contact prediction for Telefónica – service before the call
A machine learning model recognises in near real time why a customer would get in touch – and delivers the right information to the portal and the app beforehand.

Intro: Machine learning solutions made to measure
As one of Germany’s leading telecommunications providers, Telefónica Germany GmbH & Co. OHG faces the constant challenge of putting immense volumes of data to work for contact optimisation and better customer service.
In a long-standing partnership, Codify supports Telefónica with machine learning and software expertise to build and operate tailor-made ML solutions for service optimisation. The ML applications improve service quality for millions of customers by proactively providing relevant information in the online portal and in the app — tailored to the individual concern.
Codify also built applications that improve the customer experience in more targeted ways, such as showing predicted hotline waiting times on the web and in the app, or routing callers according to their needs. In addition, Codify supported Telefónica in migrating applications from on-premises to Microsoft Azure.
One key result of this collaboration is the prediction of hotline contacts: an ML model recognises the customer’s concern in near real time, and the information they need is then provided to them proactively. This use case is described in more detail below.
Challenge: Event-chain modelling, explainable AI, near real time
Contact prediction puts the customer and their concerns first. Providing relevant information early is meant to avoid calls that can easily be resolved online — questions about invoices, orders or moving house, for example.
Building a tailor-made ML solution in an enterprise environment brought the following challenges:
- Near real-time prediction for genuine proactivity: for the application to recognise a concern in time, individual information has to be available in near real time — before the customer picks up the phone. That demand for freshness carries technological and architectural requirements with it.
- Event-chain modelling to predict individual customer journeys: classifying a customer’s concern depends on looking at chains of events. That view, however, comes with a considerable increase in complexity. The distribution of customer concerns also shows a pronounced class imbalance that has to be accounted for during modelling.
- Explainable AI to understand complex relationships: however strong a model’s predictive power, the question of why always follows. Event models are especially complex in this respect, and the model’s decision or forecast has to remain traceable.
Approach: From use case to operation in three phases
Codify developed the contact prediction iteratively:
- Phase 1 – Use case definition & proof of concept: joint workshops with Telefónica’s domain experts identified the most promising use cases. For one selected use case, a lean PoC with a control group concept was built to gauge technical feasibility and potential business value quickly.
- Phase 2 – Model development and training: an LSTM model was chosen for the event-chain modelling. Training called for particular care with the many event-related hyperparameters and with the pronounced class imbalance.
- Phase 3 – Deployment & monitoring: the model was rolled out for the customer concerns that predict well, so that the matching information appears in the online portal and in the app. An automated CI/CD pipeline allows for continuous optimisation of the model and the rollout of further measures. Comprehensive monitoring and alerting keep the production application running reliably.
Outcome: Data-driven, service-strong, measurable
This innovative ML project produced deep insights and considerable value:
- Data-driven decisions: the business units receive precise, data-based insights and forecasts that significantly improve strategic planning.
- Higher service quality: better, more needs-oriented customer service.
- Demonstrable business value: hotline contacts avoided.
More projects


Supercard PAY – Smart payment seamlessly integrated
Highlights
- ✓Highest security standards for payment processing
- ✓Seamless integration into an app with millions of users
- ✓Flawless go-live without incidents


BBQ-Butler – The world's first app-controlled, self-cleaning grill system
Highlights
- ✓Robust, scalable hybrid-cloud architecture (GCP & AWS IoT)
- ✓World's first app-controlled, self-cleaning grill
- ✓Guidance from first idea to market readiness


Primeo Energie digital platform – agility through modular system architecture
Highlights
- ✓Replaced a monolithic architecture with modular Self-Contained Systems
- ✓Significant increase in agility and scalability
- ✓More efficient and faster development
Get in touch directly & without obligation
- ✓Non-binding initial consultation
- ✓Personal advice from our expert team
- ✓Response within 24 hours
