Found 33676 Articles for Programming

Training Unigram Tagger in NLP

Mithilesh Pradhan
Updated on 09-Aug-2023 12:07:58

232 Views

Introduction A single token is called a unigram. A unigram tagger is the type of tagger that requires only one word for inferring the Parts of Speech of a word. It has the context of a single word.NLTK library provides us with the UnigramTagger and is inherited from NgramTagger. In this article let us understand the training process of Unigram Tagger in NLP. Unigram Tagger and its training using NLTK WORKING The UnigramTagger is inherited from the ContextTagger. A context() method is implemented. The context method has the same arguments as the choose_tag() From the context() method, a ... Read More

How to combine Groupby and Multiple Aggregate Functions in Pandas?

Niharika Aitam
Updated on 09-Aug-2023 15:19:57

1K+ Views

The groupby() and aggregate() are the two functions available in the pandas library. The groupby() function The groupby() function allows you to group a DataFrame by one or more columns. It internally performs a combination of operations such as splitting the object, applying a function, and combining the results, on the dataframe object. This function returns DataFrameGroupBy object which contains information about the groups. Once we obtain this object we can perform various operations such as calculating the mean, calculating the sum and average etc… Syntax Following is the syntax of the groupby() function – DataFrame.groupby(by=None, axis=0, level=None, as_index=True, ... Read More

Training a tokenizer and filtering stop words in a sentence

Mithilesh Pradhan
Updated on 27-Feb-2025 17:41:45

265 Views

Introduction In NLP tokenizing text into sentences is a very crucial preprocessing task. Tokenization is the process of breaking the text corpus into individual sentences. In NLTK, the default tokenizer does a good task to tokenize text however it fails to do so in cases where the text contains punctuations, symbols, etc. that are non-standard. In such cases, we need to train a tokenizer. In this article let us explore the training of a tokenizer and also see the usage of filter words or stopwords. Tokenizing a Sentence in NLP The default tokenizer in NLTK can be used on the ... Read More

Synsets for a word in WordNet in NLP

Mithilesh Pradhan
Updated on 09-Aug-2023 11:53:20

1K+ Views

Introduction WordNet is a large database of words present in the NLTK library in present in many languages for Natural Language related use cases. NLTK library has an interface known as Synset that allows us to look for words in WordNet. Verbs, Nouns, etc. are grouped into sunsets. WordNet and Synsets The below diagram shows the structure of WordNet. In WordNet, the relationship between words is maintained. For example, words like sad are similar and find the application under similar contexts. These words can be interchanged during usage. These kinds of words are grouped for synsets. Each synset is ... Read More

How to choose elements from the list with different probability using NumPy?

Niharika Aitam
Updated on 09-Aug-2023 14:55:24

1K+ Views

There are multiple ways to choose elements from the list with the different probability using the numpy library. In python, NumPy library provides a module named random, which has several functions such as choice(), multinomial() etc., which are used to choose elements from an array with different probabilities. The sum of all probability values defined in the list should be equal to 1. Let’s see each way one by one. Using the random.choice() function The random module provides the function choice(), which is used to calculate a random sample from the given 1-d array with the specified probability distribution. ... Read More

How to check whether the element of a given NumPy array is non-zero?

Niharika Aitam
Updated on 09-Aug-2023 14:53:33

240 Views

There are multiple ways to check whether the element of a given Numpy array is Non-zero. Here are few common ways that we can apply. Using Boolean indexing Boolean Indexing is a technique in Numpy library, that allows for the selection of specific elements from the array based on the Boolean condition. This creates a Boolean mask containing True or False values, which have the same shape and size as per the Boolean condition. Example Following example how to use Boolean indexing to check whether the element of a given numpy array is non-zero. import numpy as np arr = ... Read More

How to check whether the day is a weekday or not using Pandas in Python?

Niharika Aitam
Updated on 09-Aug-2023 14:51:19

4K+ Views

The Python pandas library provides different functions to check whether the day is a weekday or not namely, weekday(), day_name(), isoweekday() etc., Pandas is an open source python library which is used for data manipulation, data analysis, data visualization, data structures etc. This library is widely used in data science and data analysis which provides data cleaning, exploration and transformation. There are many modules and functions available in pandas to work with the given data. Using the weekday() function In python, the weekday() function can be used to determine whether a given day is a weekday or not. This ... Read More

Impacts of Artificial Intelligence in everyday life

Mithilesh Pradhan
Updated on 09-Aug-2023 11:27:02

226 Views

In today’s date, Artificial Intelligence has impacted our lives way in that nothing else could have impacted. It has changed how our daily jobs are done and has involvement in major areas of our industry, lives, and almost everything. Here in this article, we are going to see some areas in our lives where Artificial Intelligence has significantly played its role. Health Industry Healthcare is a growing and crucial industry in the 21st century. Not only it is providing a better life to people but also saving millions of lives every day. We just can't overlook the health aspect of ... Read More

How to check whether specified values are present in NumPy array?

Niharika Aitam
Updated on 09-Aug-2023 14:47:20

9K+ Views

We have different modules and functions available in python language to check whether specified values are present in the given Numpy array. Numpy is abbreviated as Numerical Python, which is a python library used to perform the mathematical, statistical and scientific calculations. The result of the numpy array is returned in the format of array. The arrays can be created in one dimension, two dimension and so on up to 32 dimensions. The Numpy library provides a number of modules and functions which helps us to perform scientific calculations and mathematical calculations. Let’s see each way one by one to ... Read More

Exploring Data Distribution

Mithilesh Pradhan
Updated on 27-Feb-2025 17:44:10

610 Views

Introduction The distribution of data gives us useful insights into the data while working with any data science or machine learning use case. Data Distribution is how the data is available and its present condition, the information about specific parts of the data, any outliers in the data as well as central tendencies related to the data. To explore the data distribution there popular graphical methods that prove beneficial while working with the data. In this article let us explore these methods. Know more about your data: The Graphical Way Histograms & KDE Density Plots Histograms are the most ... Read More

Advertisements