2 Followers
·
Follow

Image for post
Image for post

Introduction

In this tutorial, we’ll build a Flask & React app with GPT-2 capabilities. We’ll go step by step, by tweaking the generator’s “interface”, then we’ll build the Flask server and finally the React frontend.

By the end of this tutorial, here’s what our app should look like:

Image for post
Image for post
GPT-2 gracing us with its wisdom

Generating text with GPT-2

Thanks to pytorch-transformers, it’s actually really easy to play with state of the art NLP models. We’ll use a recipe found in pytorch-transformers/examples/run_generation.py as a template for our app.

First let’s install our dependencies

Now that we have our generation script, we need to change it a bit so it plays nice with our Flask app. …


Image for post
Image for post

The most popular tracking methods involve persistent identifiers, like the famous cookies. But what if we delete those cookies? What if we go incognito?

It turns out that there other ways to track users without relying on persistent identifiers. Browser fingerprinting is one of them. Since it doesn’t need to store anything, there’s nothing to delete and going private won’t do the trick.

Image for post
Image for post

We’ll write a small React app to demonstrate how to collect a device’s fingerprint and IP address metadata. The app will run entirely in the browser, and no data will be stored.

Motivation

By gathering that information together and storing it on its own servers, a site can track your browsing habits without the use of persistent identifiers stored on your computer, like cookies. Fingerprinting can also be used to recreate a tracking cookie for a user after the user has deleted it. Users that are aware of cookies can remove them within their browser settings, but fingerprinting subverts the built-in browser mechanisms that allow users to avoid being tracked. (EFF | The GDPR and Browser Fingerprinting: How It Changes the Game for the Sneakiest Web Trackers).

About

Molamk

Jack of all trades coder, passionate about chess and electric guitars - molamk.com

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store