Category Archives: Machine Learning

Part 1: Demystifying NER – How Named Entity Recognition Helps Understand Test Cases

NER - Named Entity Recognition
NER – Named Entity Recognition

Blog Series Overview

Writing test cases in plain English is second nature for most QA professionals—but what if machines could understand and act on those instructions directly? This is where Named Entity Recognition (NER), a powerful Natural Language Processing (NLP) technique, comes into play. By identifying key entities like actions, screens, and objects from everyday language, NER helps bridge the gap between human-readable test steps and machine-executable automation scripts. In this post, we’ll explore how NER in QA can transform natural language test cases into structured data that powers AI-driven test automation.

What is Named Entity Recognition (NER)?

Named Entity Recognition (NER) is a subtask of Natural Language Processing (NLP) that identifies and classifies words or phrases in a sentence into predefined categories. In the context of NLP test automation, NER plays a crucial role in breaking down plain English test steps into actionable components. For example:

  • Screens – UI areas like "Login screen" or "Job Order page"
  • Actions – Operations like "insert", "submit", "delete"
  • Objects – Functional items such as "Job order", "form", or "user"

For more details about NER, check this Wikipedia Link

How I trained my NER model?

To build a truly custom test automation solution, I didn’t rely on generic models. Instead, I fine-tuned a BERT-based Named Entity Recognition (NER) model specifically trained to understand test case language written in natural English.

Why BERT?

I chose bert-base-cased from Hugging Face Transformers as the base model for a few reasons:

  • It’s pre-trained on a massive corpus of English (Wikipedia + BookCorpus), giving it a solid grasp of language structure.
  • The “cased” version preserves capitalization, which is often useful in UI terms like “Login Screen” vs “login screen”.
  • It’s proven to perform well on token-level classification tasks like NER, especially after fine-tuning on a domain-specific dataset.

My Fine-Tuning Approach

I created a small, task-focused dataset where each sentence is a simple test step like:

“Create Job Order Screen”

Each sentence is tokenized and labeled like this:

["Create", "Job", "Order", "Screen"]
["0", "B-ORDER", "I-ORDER", "B-TOOL"]

This tagging format is based on the IOB (Inside-Outside-Beginning) scheme commonly used for NER tasks.

The Training Pipeline

Here’s the overall workflow I followed:

  1. Tokenization:
    Used BertTokenizerFast to tokenize inputs while aligning labels with tokenized outputs.
  2. Dataset Preparation:
    • Created synthetic but diverse train and test datasets.
    • Used Hugging Face datasets.Dataset class for formatting and transformation.
  3. Label Alignment:
    Carefully handled alignment between original tokens and subwords, marking non-aligned subwords with -100 (to be ignored during loss computation).
  4. Fine-Tuning:
    Used the Trainer API from Hugging Face with:
    • Learning rate: 2e-5
    • Batch size: 16
    • Epochs: 5 for better convergence
    • Evaluation metrics: Precision, Recall, F1-score using sklearn
  5. Model Saving:
    Finally, saved both the fine-tuned model and tokenizer locally for reuse:
model.save_pretrained("./fine_tuned_ner")
tokenizer.save_pretrained("./fine_tuned_ner")

This saved model is now capable of understanding test steps like:

“Open Job Order Screen”
“Open Service Request Screen”
“Initiate Quality Check Screen”

and accurately tagging entities such as:

  • B-SCREEN, I-SCREEN – for multi-word actions
  • B-TOOL – for tools or execution components

Now that the model is trained and saved, it’s time to put it to work—converting plain English test steps into structured, automation-ready formats.

In the next post, we’ll dive into intent detection—how it complements NER and helps drive even smarter automation pipelines.

Chatbots should be Smarter

Recently I published a blog on Why business will need a chat bot. You can read it here.

Why Each Business Will Need A Chat bot

In that blog I mentioned that this bots need to be very very smart to interact with humans. The algorithms should be powerful to have conversation with humans because humans will do every possible tricks to trap bots and sometime it fails. Survival of fittest, rule of Darwin is applicable to AI as well. Only strong and intelligent algorithm will survive. If you are creating bot make sure you make it really smart, then only it will survive.

Lets start blog by one incident I recently had with bots. I was working with Amazon AWS and faced some issue in it and solved it my self so as per my practice I immediately published a blog and published on twitter. Following is my tweet.

And I got reply from AWS twitter bot.

Technically bot is not wrong as I mentioned word “not working” in my tweet but that was my blog title but it understood as an issue and replied with suggestion so it’s not complete fail but as I mentioned bots need to be smart enough to identify what exactly customer needs and reply to it.

Along with Artificial Intelligence a chat bot needs Emotional Intelligence (EI) to understand human emotions. As we move into the future, AI needs humanizing qualities to improve the way it interacts with us, meets our needs for information, and even controls the other technology around us. As AI becomes more ubiquitous, society needs chat bots to become emotionally intelligent if they are to be used to their full capabilities. Humanizing the chat bot is the next step toward a more connected and integrated future. Blending technology with human capabilities such as emotion and empathy can revolutionize the workplace and other facets of life. In my opinion, smarter AI is one of the most exciting prospects of the future.

Why Your Business Needs A Chat bot

Recently we have been discussing to add a chatbot for our new venture. That lead me to write this article on why a business will need a chatbot and what are the advantages of it.

What is a Chat bot?

In a very simple definition, a chat bot is a computer program designed to simulate conversation with human users, especially over the Internet.

So yes a chat bot is nothing but a computer program which can handle communication with users over the internet using the smart and artificial intelligence programmed in it by the developers. So in a way chat bot is your virtual customer care executive which does not exits in real life but it’s in computer. Many of the businesses and website have real time talk to customer care on their website. You start a chat and in few moments you got a reply from one of the executive.
But may times it’s not human it’s bot replying to your queries and helping you in finding a solutions to your problem. It talks like human, it behaves like human and it lead conversions like human but the fact is it’s chat bot program which is replying to you. Many of the businesses are using the chat bots successfully and many of the companies are developing chat bots. Real challenge right now in chat bot development is that you have to make it really really smart to handle all types of conversation and with the increasing use of Artificial intelligence, machine learning and deep learning, natural language processing chat bots are becoming smarter and smarter. Even smarter than human as well.
One of the biggest trends in social media, specially social messaging apps, are bots and bot stores. Technology analysts predicted that bot stores will be the biggest thing since the rise of app stores. in 2017 we will see many developments on chat bots. Most of the businesses will opt for chat bot services to improve their business practices and customer care. Here are some reasons on Why Your Business Needs a Chat Bot

1) 24 X 7 Customer care

Computer do not eat, computer do not sleep, it needs only constant power to be on for 24 X 7 hours. So if you are using chat bot for the customer care, your customers will get 24 X 7 hours services. They can contact you any time and your bot will reply to them on behalf of you. This way your customer will be much satisfied and you can attend customers queries across the globe and different time zones. You don’t need a call center and team of executives to handle it and it’s cost effective too as you don’t have to pay salary to customer care executives and do not need to invest in customer care center infrastructure, just invest in a chat bot and it will work for you all the time.

2) Better Customer Engagements with Buying Influence

Most of the companies selling online their services and products are using chat bots customer engagement. A customer browsing through your websites, products and services online on your website and chat bot can give more options to your customers based on customer preference and it will be more interactive experience to your customers and users as they feel it as a very personalized approach and they will be happy with this and you will get better customer engagements with this. Also chat bot can ask for the user preferences like what style they want and what brand they want and based on that, it will suggest the buying options thus influencing customer with more buying options.

3) Boost Social Media Engagement

In April, Facebook announced it would be opening up its increasingly influential Messenger platform in beta — and allowing brands to start using chatbots there. Not only can this help brands to achieve better sales, but it’s also a natural way with which to bolster social media engagement. By deploying a useful chatbot on Facebook, you’ll be far more likely to attract users on to your business page – where you are hopefully already bending over backwards in order to drive sales and engage with consumers on a personal level.

4) Simplify Your Business Processes

A chat bot is not just for the customer care and sales, it can even help you with your businesses. A custom chat bot designed for your business can help you simplify your business processes and let you be more productive in your business. A chat bot can also take business decisions based on certain parameters and help you in maintaining flow of your business.

In a way, chat bot is going to take industry by storm in upcoming years and chat bot will act as

  • Your lawyer
  • Your personal stylist
  • Your personal assistant
  • Your doctor
  • Your financial advisor
  • Your teacher
  • Your Accountant

and many more you can imagine.

Top 5 Real World Examples of Machine Learning

What is Machine Learning?

Machine learning is a type of artificial intelligence (AI) that provides computers with the ability to learn without being explicitly programmed. Machine learning focuses on the development of computer programs that can change when exposed to new data.  Evolved from the study of pattern recognition and computational learning theory in artificial intelligence, machine learning explores the study and construction of algorithms that can learn from and make predictions on data. The process of machine learning is similar to that of data mining. Both systems search through data to look for patterns. 
Machine learning is now widely used by many software manufactures. Most of the IT companies are now investing in Machine learning. Developers are working on creating complex algorithms to enhance machine learning in systems and provide more intelligence to end users. Here in this blog we will see five real world examples of machine learning.

1) Word prediction and corrections in Office 365 by Microsoft

Just when you thought Google’s AI products are the best, Microsoft strikes back with AI in Microsoft Word that blows away Google Docs. The recent version of office 365 has mind blowing machine learning added in word prediction and corrections. It just don’t correct it but it will also learn from your way of writing and learns the words which you use frequently. It’s really awesome. You can read more about it on following link.

2) Facebook and Machine Learning

Facebook builds its business by learning about its users and packaging their data for advertisers. It then reinvests this money into offering us new, useful functionality – currently video and shopping – which it also uses to learn even more about us. Facebook achieve its goals of providing greater convenience to users, and enabling them to learn more about us. You can read more at following link.

3) JP Moragan Software COIN

The program, called COIN, for Contract Intelligence, does the mind-numbing job of interpreting commercial-loan agreements that, until the project went online in June, consumed 360,000 hours of work each year by lawyers and loan officers. The software reviews documents in seconds. COIN is just the start for the biggest U.S. bank. The firm recently set up technology hubs for teams specializing in big data, robotics and cloud infrastructure to find new sources of revenue, while reducing expenses and risks. Read more at below link.

4) Google’s Self Driving Cars

Google’s self-driving cars can tour you around the streets of Mountain View, California. Google has mapped 2,000 miles of road. The US road network has 4 million miles of road. Google’s team uses machine learning algorithms to create models of other people on the road. Every single mile of driving is logged, and that data fed into computers that classify how different types of objects act in all these different situations. While some driver behavior could be hardcoded in (“When the lights turn green, cars go”), they don’t exclusively program that logic, but learn it from actual driver behavior. You can read more about it on following link.

5) Google Maps use Machine Learning to Predict Parking Difficulty

Google Maps now tackles parking problems as well. Google quietly launched a new parking feature for Google Maps on Android across 25 major US cities. If you are in these metro areas, you will now see a red parking sign that indicates limited parking availability to help you plan your trip. The interesting part of this update is that it does not rely on internet-connected parking meters; which often provide incomplete or wrong information due to illegal parkers or those who depart early from their spot. Instead, Google Maps combined crowdsourced data and relatively simple machine learning algorithms to classify parking difficulty. You can read more about it at following link.