Python tutorials

Emotion classification on Twitter Data Using Transformers

Introduction The world of Natural language processing is recently overtaken by the invention of Transformers. Transformers are entirely indifferent to the conventional sequence-based networks. RNNs are the initial weapon used for sequence-based tasks like text generation, text classification, etc. But with the arrival of LSTM and GRU cells, the issue with capturing long-term dependency in the text got resolved. But learning the model with LSTM cells is a hard task as we cannot make it learn parallelly.

Read more

Python: Update All Packages With pip-review

Introduction Updating Python packages can be a hassle. There are many of them – it’s hard to keep track of all the newest versions, and even when you decide what to update, you still have to update each of them manually. To address this issue, pip-review was created. It lets you smoothly manage all available PyPi updates with simple commands. Originally a part of the pip-tools package, it now lives on as a standalone convenience wrapper around pip. In this […]

Read more

Out-of-the-box NLP functionalities for your project using Transformers Library!

This article was published as a part of the Data Science Blogathon. Introduction In this tutorial, you will learn how you can integrate common Natural Language Processing (NLP) functionalities into your application with minimal effort. We will be doing this using the ‘transformers‘ library provided by Hugging Face. 1. First, Install the transformers library. # Install the library !pip install transformers 2. Next, import the necessary functions. # Necessary imports from transformers import pipeline 3. Irrespective of the task that […]

Read more

How to Access Index in Python’s for Loop

Introduction Python is a very high-level programming language, and it tends to stray away from anything remotely resembling internal data structure. Because of this, we usually don’t really need indices of a list to access its elements, however, sometimes we desperately need them. In this article, we will go over different approaches on how to access an index in Python’s for loop. How to Access Index in Python’s for Loop? The easiest, and most popular method to access the index […]

Read more

Comparing Datetimes in Python – With and Without Timezones

Introduction When working with dates, oftentimes, you’d like to know if a given date comes before or after another date. We can get these answers by comparing dates. In this article, we will learn how to use the Python datetime module to create and compare both naive (without timezone info) and aware (with timezone info) dates. To compare the dates, we will use the comparison operators in Python: , ==, =, !=. Note: The datetime module has two methods for […]

Read more

Analysis of Brazilian E-commerce Text Review Dataset Using NLP and Google Translate

This article was published as a part of the Data Science Blogathon. Introduction Comprehending the reviews of customers is very crucial for a business to be successful. Analyzing the reviews helps to properly discern the customer different preferences, likes, dislikes, etc. These extracted insights can then be used to improve customer service and experience.  In this article, we would be working on a Brazilian E-commerce reviews dataset where we would perform some exploratory data analysis (EDA) on reviews text, derive […]

Read more

Python: Safely Create Nested Directory

Introduction File manipulation is one of the most important skills to master in any programming language, and doing it correctly is of utmost importance. Making a mistake could cause an issue in your program, other programs running on the same system, and even the system itself. Possible errors can occur due to the parent directory not existing, or by other programs changing files in the file system at the same time, creating something that is called a race condition. A […]

Read more

How to Merge DataFrames in Pandas – merge(), join(), append(), concat() and update()

Introduction Pandas provides a huge range of methods and functions to manipulate data, including merging DataFrames. Merging DataFrames allows you to both create a new DataFrame without modifying the original data source or alter the original data source. If you are familiar with the SQL or a similar type of tabular data, you probably are familiar with the term join, which means combining DataFrames to form a new DataFrame. If you are a beginner it can be hard to fully […]

Read more

How to Use Global and Nonlocal Variables in Python

Introduction In this article we’ll be taking a look at Global and Non-Local Variables in Python and how you to use them to avoid issues when writing code. We’ll be starting off with a brief primer on variable scopes before we launch into the how and why of using global and non-local variables in your own functions. Scopes in Python Before we can get started, we first have to touch on scopes. For those of you who are less familiar, […]

Read more

Fake news classifier on US Election News📰 | LSTM 🈚

Introduction News media has become a channel to pass on the information of what’s happening in the world to the people living. Often people perceive whatever conveyed in the news to be true. There were circumstances where even the news channels acknowledged that their news is not true as they wrote. But some news has a significant impact not only on the people or    

Read more
1 134 135 136 137 138 184