Friday, July 26, 2024

What is Natural Language Processing (NLP)?

Natural Language Processing is the branch of Artificial Intelligence that gives machines the ability to read, understand, and derive meaning from human languages.


Definition :

NLP stands for Natural Language Processing. It is a field of artificial intelligence and computational linguistics that focuses on enabling computers to understand, interpret, and generate human language in a way that is both meaningful and valuable. NLP involves the interaction between computers and human language, encompassing tasks such as language understanding, language generation, language translation, sentiment analysis, and more.

NLP aims to bridge the gap between human communication and computer understanding, allowing machines to process and analyze large amounts of textual data, extract insights, and perform various language-related tasks


NLP combines the field of linguistic and computer science to decrypt language structure and guidelines and to make models that can comprehend, break down and separate significant details from text and speech


Humans interact with each other through various forms of mediums transferring vast amounts of data. This data is very useful in terms of understanding customer behavior and learning customer habits.
This data is mostly unstructured and data scientist uses this data to train machines, to understand human linguistics.

Understanding NLP :

NLP encompasses a wide range of tasks, from language understanding to language generation, and it forms the foundation for various applications that involve processing and analyzing text or speech data.

NLG (Natural Language Generation) and NLU (Natural Language Understanding) are two key components of NLP that focus on different aspects of working with human language.

  • Natural Language Generation (NLG): NLG is about generating human-like language from structured data or concepts.
Example of NLG: Imagine an e-commerce platform that generates product descriptions for various items based on their attributes. An NLG system could take information like product specifications, features, and customer reviews, and transform it into a well-written product description.

  • Natural Language Understanding (NLU): NLU is about extracting meaning and intent from unstructured human language input.
Example of NLU: Consider a virtual assistant like Siri or Google Assistant. When you ask, "What's the weather like today?", the NLU component of these assistants needs to understand your intent (asking for the weather) and extract relevant information (today's weather forecast) from your input. NLU helps the system grasp the user's intention and respond appropriately.

How NLP works:

NLP algorithm is a big chunk of several small algorithms.  In normal condition, a machine is given unstructured data, like a simple sentence, which it needs to interpret and generate human-like answers. Let us understand how NLP works using our sample sentence above

Example sentence: There are townhouses available for rent in Nashville's downtown 



1. Tokenization :

The first step in NLP involves preparing the raw text for analysis. This often includes tasks like tokenization (breaking text into words or subword units), removing punctuation, converting text to lowercase, and handling special characters. This step aims to create a structured representation of the text that can be easily processed.

In our case - our sentence will be tokenized as 
"There", "are", "townhouses", "available", "for", "rent", "in", "Nashville's", "downtown", "."

During tokenization, the sentence is further neutralized by following below processes 

1.1 Removal of Stop Words

 At this stage, from the sentence all words which do not add much meaning to our sentences, are removed from the sentence. Some example of stop words are "and", "is", "are", "as", "the" etc.. 

In our case - our sentence after removing stop-words will look like
"townhouses", "available", "rent", "Nashville's", "downtown", "."

1.2. Stemming 

The next step is to further normalize the sentence by identifying Stem words for each token. The machines are made built with a dictionary of every word which can mean the same because of it added prefixes or suffixes. 
For example:  "ran", "runs" and "running" - for these three different words a STEM word "run" will be defined.

BUT, stemming does not work for every token.
For example, the words "universal" and "university" would not stem from "universe". In such cases, the machine goes through the process of Lemmatization.

1.3 Lemmatization

In this case, the machine takes the token and looks for its meaning from a dictionary and then stems down to its root stem word.


2. Part-of-Speech Tagging:

In this step - each token is assigned a part-of-speech tag to indicate its grammatical role in the sentence:


In our case - our sentence looks like
 "townhouses" (NOUN), "available" (ADJective), "rent" (NOUN), \ "Nashville's" (NOUN), "downtown" (NOUN)


3. Semantic Analysis:

The sentence's meaning is interpreted, taking into account the relationships established during syntactic analysis where The structure of the sentence is determined, identifying relationships between words. The sentence conveys that there are townhouses that can be rented in the downtown area of Nashville.

4. Named Entity Recognition (NER):

The NER step identifies named entities (people, places, organizations, etc.) in the sentence:

In case of our sentence: 
"Nashville" is recognized as a location entity.

5. Contextual Understanding (Transformer Model):

If a transformer model like BERT or GPT is used, it would analyze the sentence bidirectionally, considering the context of all words. This contextual understanding helps the model grasp the subtle nuances and relationships in the sentence.


Applications of NLP


Language Translation: NLP powers the technology behind language translation services like Google Translate (https://translate.google.com/), allowing people to communicate across language barriers effortlessly.

Sentiment Analysis: Businesses use NLP to gauge public sentiment by analyzing social media posts, customer reviews, product feedback, and news articles, helping them make informed decisions and tailor their strategies.

Chatbots and Virtual Assistants:  This is definitely a breakthrough, where now every time you call for assistance, you interact with robots instead of humans. NLP drives the conversational abilities for chatbots on websites, enhancing customer interactions and providing instant assistance.

Text Summarization: NLP algorithms are used to condense lengthy articles, documents, and reports into concise summaries, aiding in information extraction and quick comprehension. For- example Chat GPT

Speech Recognition: Voice-activated devices, like Siri, Alexa, and Hey-Google, are speech-to-text applications that rely on NLP for accurate speech recognition, enabling hands-free communication and transcription.

Named Entity Recognition: NLP helps identify and classify entities such as names of people, organizations, and locations in text, useful for information extraction and knowledge management.


Challenges in NLP


Despite its impressive capabilities, NLP faces several challenges:

Ambiguity of sentences.

Contextual Understanding

For example the word phrase “What?” when used with different emotions can mean different.
  • When a person in Shock – will say the phrase “What?” with eyes widely open.
  • When a person is confused – will say the phrase “What?” with eyebrows shrunk or tilted.
  • When a person is surprised – will say the phrase “What?” with his mouth open and wide eyes.

We, humans, can read facial expressions and phrases to understand a sentence with emotion – but for machines, this is still a challenge and needs more explanation of how to capture words with emotions.


But nevertheless, NLP is a fast-growing sector in AI and on-demand skill. One of the most significant breakthroughs in NLP is the development of transformer models, which have revolutionized the field. Models like BERT (Bidirectional Encoder Representations from Transformers) and GPT (Generative Pre-trained Transformer) have set new benchmarks in tasks like language understanding, machine translation, and text generation. These models leverage vast amounts of training data and extensive computational resources to achieve remarkable performance on a variety of NLP tasks.

NLP techniques often leverage machine learning approaches, including deep learning, recurrent neural networks (RNNs), convolutional neural networks (CNNs), and transformer models, like the ones used in the GPT series developed by OpenAI.

Conclusion


Natural Language Processing has brought us closer to the dream of seamless communication between humans and machines. Consider translating languages on the fly, or searching via speech to bring personalized customer experience in apps NLP has woven itself into the fabric of modern society.

Let us understand how a simple sentence is broken down to make a machine understand what it means.

Guide to learning software testing

Guide to learning software testing

The Software Testing field offers a wealth of opportunities for those wishing to build a successful career in the Software Industry. 

Whether you're interested in software testing, quality assurance, or any other field, it's important to understand the steps you need to take to prepare for the testing role and improve your chances of getting the job. This blog post provides a comprehensive guide on how to start preparing for your role and ultimately being employed.

Types of Software Testing

Software Testing types can broadly be divided as 
  1. Manual testing  - where you will do the testing of each and every page and feature manually. 

  2. Automation Testing  - this implies testing certain pages and features using tools and also includes manual testing.

Nowadays learning only the manual aspect of software testing is not enough, as there is a lot of competition and saturation of jobs in software testing  - so it is always suggested to build your skill in both manual and automation testing.

Well just to give you heads-up, automation testing is not hard to learn but it does require you to have development skills and you need to learn at least one coding language like Java, javascript, python, groovy, etc. 



How to start with testing

1. START  THE UNDERSTANDING - 

starting with an understanding of the topic is very important for example :

  • What software testing is? - Simply it is a way to test code, in a way the end user is going to use this software and not in a way how dev writes the code. It is the mindset of the tester that makes the software testing perfect.

  • How does it work? -  Software testing follows a definte process. It starts at the time the application is designed. The common steps involved are
                       Understanding requirement,
                       Creating testcases,
                       Identifying test cases eligible for automation,
                       Defining performance test thershold,
                       Defining test environment,
                       Execution of test,
                       Verifying and logging defects,
                       Creating report

  • Why it is needed? - As a user, if you find any issue with application you are interacting, you will immediately reject it and never use the app again. So you see as a business owner you would never want any big or small defect to be there when you publish your application to the world. Hence the need of the software being well tested is very important 

2. KNOW THE REQUIRED SKILLS - 

You need to know what all skillset you will need to perform when you are in the job responsibilities and the role that you will actually need to break into.

The most important skill as a quality assurance person is COMMUNICATION. Your communication skill counts a lot when you are being judged for QA role. 

Communication skill can include:

  • Fluency in English while talking.
  • Skills on managing email communication.
  • Skill set on what to be logged when creating a defect.


A simple way you can say software is made  with three layers -

  • ForntEnd 
  • MiddleWare
  • Backend



In the case of software testing, you need to gain a skill set in all three areas of software testing - which
implies you need to learn :

  • How you can test FrontEnd of the software? 
      Skills and tools needed 
    • Manual testing skill, web application using diffrent browser and/or mobile testing.
    • Tools like Jira, Confluence, ALM.
    • Excel sheet.
    • Automation testing tools like selenium.

  • How you can test MiddleWare of Software?
      Skills and tools needed 
    • RestFull APIs and gateways
    • Postman needed for API testing
    • Burp needed for security
    • Automation testing using Appium or RestAssured.

  • How you can test the Backend of the Software?
      Skills and tools needed 
    • Relational Database schema understanding
    • Queries in SQL, MySQL, Oracle
    • Linux commands
    • Basic cloud services knowledge like Azure, AWS and GCP.
Explore the areas and write down what all skills you need to learn:

What are the least must skill needed for software testing

In order to apply for a job the least mininum requirement that you should have in your CV is 

  • SQL queries / CRUD (Create, retrieve, update and delete) operation in database.
  • API testing / Postman.
  • Manual Test case creation and defect logging process.
  • Excel sheet usability and how to use basic formulas.
  • Testing an applications on diffrent types of browsers.
  • Knowdlege on operating systems likes windows and McOS
  • Basic manual testing approach like Smoke testing, Regression testing, Usability testing, penetration testing

3. START LEARNING:

Now the question is how should you start learning software testing? 
To start learning software testing, you do not need to spend money to learn there are a lot of courses available online:

1. Complete one course on manual software testing: You can follow any channel that you find easy to understand, but stick to it and complete the full course, some recommendations are :
2. Complete one course on automation software testing 
3. Also you can purchase a book on software testing, some examples are :
4. Read Blogs:
 you can follow the below blogs and learn concepts in software testing
  • StackExchange - They have weekly blogs coming out. You can also ask questions and get answers to any query related to software testing on their site.
  • Softwaretestingmaterial - They too have a weekly blog to follow.

Can I just learn manual testing and start applying for jobs?

Yes, you can, but keep in mind these days manual testing jobs are very rare to find. Industries are looking for people with automation experience. 

Is software testing a well-paying job?

Yes, it is a well-paid job. In the US you can get anything from 60K to 150K annually which is quite good to get.


Can I become a developer after I start my career in software testing?

Yes again, you can switch to a development role even after you start your career in software testing, but remember you will need to gain a development skillset for that. 
Switching can be easier for you in two ways 
   - You can switch a role within your own organization and so you won't have to look for a new company
      - Since you are in IT already and working, you know the basic of how the software works and what developers do, this understanding will make it easy for you to learn coding.

To know what to do  - check this blog 

Conclusion :

So in short, I see going into software testing does require you to do some prep work and learn but it is not very hard. If you in this path of learning to be a tester or you are already a software tester let me know your thoughts below 👇.

Please subscribe to my blogs for weekly blogs on tech and on new concepts. :) 


Techniques for AI

  Techniques for AI  We all know humans have a super powerful brain that can think, feel and predict things.  For instance: When we see a ni...