Learn Python

Learn Data Structure & Algorithm

Learn Numpy

Learn Pandas

Learn Matplotlib

Learn Seaborn

Learn Statistics

Learn Math

Learn MATLAB

Learn Machine learning

Learn Github

Learn OpenCV

Introduction

Setup

ANN

Working process ANN

Propagation

Bias parameter

Activation function

Loss function

Overfitting and Underfitting

Optimization function

Chain rule

Minima

Gradient problem

Weight initialization

Dropout

ANN Regression Exercise

ANN Classification Exercise

Hyper parameter tuning

CNN

CNN basics

Convolution

Padding

Pooling

Data argumentation

Flattening

Create Custom Dataset

Binary Classification Exercise

Multiclass Classification Exercise

Transfer learning

Transfer model Basic template

RNN

How RNN works

LSTM

Bidirectional RNN

Sequence to sequence

Attention model

Transformer model

Bag of words

Tokenization & Stop words

Stemming & Lemmatization

TF-IDF

N-Gram

Word embedding

Normalization

Pos tagging

Parser

semantic analysis

Regular expression

Learn MySQL

Learn MongoDB

Learn Web scraping

Learn Excel

Learn Power BI

Learn Tableau

Learn Docker

Learn Hadoop

What is n-gram?

N-gram is a continuous sequence of n items from a given sample text. It means that we have a given text and we have to consider some continuous n items. We can put any number in the position of n. If we take n=1 then it will be called 1-gram or unigram. If we take n=2 then 2-gram or bigram, similarly n=3 is 3-gram or trigram, and so on.


Example:
Here take a DNA sequence =AGCTTCAA

Let's see 1-gram or unigram:
A,G,C,T,T,C,A,A
Here we will take or consider one item at a time.

Let's see 2-gram or unigram:
AG,CT,GC,TT,TC,CG,GA,CA Here we will take or consider two items at a time.

Let's see 3-gram or unigram:
AGc,GCT,CTT,TTG,TGA
Here we will take or consider three items at a time.

Let's see another example:
Here we have a sentence: The sun is shining

Let's see 1-gram or unigram:
["The","sun","is","shining"]
Here we will take or consider one item at a time.

Let's see 2-gram or unigram:
["The sun","sun is","is shining"]
Here we will take or consider two items at a time.

Let's see 3-gram or unigram:
["The sun is","sun is shining"]
Here we will take or consider three items at a time.

CodersAim is created for learning and training a self learner to become a professional from beginner. While using CodersAim, you agree to have read and accepted our terms of use, privacy policy, Contact Us

© Copyright All rights reserved www.CodersAim.com. Developed by CodersAim.