Coder Social home page Coder Social logo

hncynic's Introduction

hncynic

The best Hacker News comments are written with a complete disregard for the linked article. hncynic is an attempt at capturing this phenomenon by training a model to predict Hacker News comments just from the submission title. More specifically, I trained a Transformer encoder-decoder model on Hacker News data. In my second attempt, I also included data from Wikipedia.

The generated comments are fun to read, but often turn out meaningless or contradictory -- see here for some examples generated from recent HN titles.

There is a demo live at https://hncynic.leod.org/.

Steps

Hacker News

Train a model on Hacker News data only:

  1. data: Prepare the data and extract title-comment pairs from the HN data dump.
  2. train: Train a Transformer translation model on the title-comment pairs using TensorFlow and OpenNMT-tf.

Transfer Learning

Train a model on Wikipedia data, then switch to Hacker News data:

  1. data-wiki: Prepare data from Wikipedia articles.
  2. train-wiki: Train a model to predict Wikipedia section texts from titles.
  3. train-wiki-hn: Continue training on HN data.

Hosting

  1. serve: Serve the model with TensorFlow serving.
  2. ui: Host a web interface for querying the model.

Future Work

  • Acquire GCP credits, train for more steps.
  • It's probably nonideal to use encoder-decoder models. In retrospect, I should have trained a language model instead, on data like title <SEP> comment (see also: GPT-2).
  • I've completely excluded HN comments that are replies from the training data. It might be interesting to train on these as well.

hncynic's People

Contributors

leod avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.