Python tutorials

Implementation of Attention Mechanism for Caption Generation on Transformers using TensorFlow

Overview Learning about the state of the art model that is Transformers. Understand how we can implement Transformers on the already seen image captioning problem using Tensorflow Comparing the results of Transformers vs attention models.   Introduction We have seen that Attention mechanisms (in the previous article) have become an integral part of compelling sequence modeling and transduction models in various tasks (such as image captioning), allowing modeling of dependencies without regard to their distance in the input or output […]

Read more

How to Randomly Select Elements From a List in Python

Introduction Selecting a random element or value from a list is a common task – be it for randomized result from a list of recommendations or just a random prompt. In this article, we’ll take a look at how to randomly select elements from a list in Python. We’ll cover the retrieval of both singular random elements, as well as retrieving multiple elements – with and without repetition. Selecting a Random Element From Python List The most intuitive and natural […]

Read more

Introduction to Data Visualization in Python with Pandas

Introduction People can rarely look at a raw data and immediately deduce a data-oriented observation like: People in stores tend to buy diapers and beer in conjunction! Or even if you as a data scientist can indeed sight read raw data, your investor or boss most likely can’t. In order for us to properly analyze our data, we need to represent it in a tangible, comprehensive way. Which is exactly why we use data visualization! The pandas library offers a […]

Read more

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
1 131 132 133 134 135 181