Python: How to Print Without Newline or Space

Introduction The print() function in Python appends a newline to the output when displayed on the tty (teletypewriter A.K.A the terminal). When you don’t want your message displayed with newlines or with spaces, how can you change the behavior of print()? This can easily be achieved by altering the default values of the sep and end parameters of the print() function. Printing Without a Newline Until Python version 2.x, print was a reserved keyword that acts as a special statement. […]

Read more

How to Split a List Into Even Chunks in Python

Introduction Splitting strings and lists are common programming activities in Python and other languages. Sometimes we have to split our data in peculiar ways, but more commonly – into even chunks. The language does not have a built-in function to do this and in this tutorial, we’ll take a look at how to split a list into even chunks in Python. For most cases, you can get by using generators: def chunk_using_generators(lst, n): for i in range(0, len(lst), n): yield […]

Read more

Language Detection Using Natural Language Processing

Introduction Every Machine Learning enthusiast has a dream of building/working on a cool project, isn’t it? Mere understandings of the theory aren’t enough, you need to work on projects, try to deploy them, and learn from them. Moreover, working on specific domains like NLP gives you wide opportunities and problem statements to explore. Through this article, I wish to introduce you to an amazing project, the Language Detection model using Natural Language Processing. This will take you through a real-world […]

Read more

Issue #121 – Finding the Optimal Vocabulary Size for Neural Machine Translation

11 Mar21 Issue #121 – Finding the Optimal Vocabulary Size for Neural Machine Translation Author: Akshai Ramesh, Machine Translation Scientist @ Iconic Introduction Sennrich et al. (2016) introduced a variant of byte pair encoding (BPE) (Gage, 1994) for word segmentation, which is capable of encoding open vocabularies with a compact symbol vocabulary of variable-length subword units. With the use of BPE, the Neural Machine Translation (NMT) systems are capable of open-vocabulary translation by representing rare and unseen words as a […]

Read more

A Hands-On Introduction to Hugging Face’s AutoNLP 101

Hugging Face, founded in 2016, has revolutionized the way people approach Natural Language Processing in this day and age. Based in New York, Hugging Face started out as a chatbot company with its primary focus today on the Transformers library and helping the developers integrate NLP into their own products or services. Hugging Face has made it incredibly easy for an individual to train their data on huge state-of-the-art models only with a couple of lines. Solving NLP, one commit […]

Read more

Build a Contact Book With Python, PyQt, and SQLite

Building projects is arguably one of the more approachable and effective ways of learning to program. Real projects require you to apply different and varied coding skills. They also encourage you to research topics that pop up as you’re solving problems in the development process. In this tutorial, you’ll create a contact book application with Python, PyQt, and SQLite. In this tutorial, you’ll learn how to: Create a graphical user interface (GUI) for your contact book application using Python and […]

Read more

How to Sort a Pandas DataFrame by Date

Introduction Pandas is an extremely popular data manipulation and analysis library. It’s the go-to tool for loading in and analyzing datasets for many. Correctly sorting data is a crucial element of many tasks regarding data analysis. In this tutorial, we’ll take a look at how to sort a Pandas DataFrame by date. Let’s start off with making a simple DataFrame with a few dates: import pandas as pd data = {‘Name’:[“John”, “Paul”, “Dhilan”, “Bob”, “Henry”], ‘Date of Birth’: [“01/06/86”, “05/10/77”, […]

Read more

Django View Authorization: Restricting Access

Django provides tools for both authentication and authorization. Django view authorization is typically done with decorators. This course will show you how to use these view decorators to enforce authorized viewing of pages in your Django site. By the end of this course you’ll know how to: Use HttpRequest and HttpRequest.user objects Authenticate and authorize users Differentiate between regular, staff, and admin users Secure a view with the @login_required decorator Restrict a view to different roles with the @user_passes_test decorator […]

Read more

Machine Translation Weekly 70: Loss Masking instead of Data Filtering

This week, I will have a closer look at a recent pre-print introducing an alternative for parallel data filtering for machine translation training. The title of the pre-print is Gradient-guided Loss Masking for Neural Machine Translation and comes from CMU and Google. Training data cleanness is a surprisingly important factor for machine translation quality. A large part of the data that we use for training comes from crawling the Internet, so there is no quality guarantee. On the other hand, […]

Read more

Python: Check if Array/List Contains Element/Value

Introduction In this tutorial, we’ll take a look at how to check if a list contains an element or value in Python. We’ll use a list of strings, containing a few animals: animals = [‘Dog’, ‘Cat’, ‘Bird’, ‘Fish’] Check if List Contains Element With for Loop A simple and rudimentary method to check if a list contains an element is looping through it, and checking if the item we’re on matches the one we’re looking for. Let’s use a for […]

Read more
1 670 671 672 673 674 912