• Stars
    star
    333
  • Rank 126,599 (Top 3 %)
  • Language
    Python
  • License
    MIT License
  • Created almost 6 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Generate Hacker News Comments from Titles

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/.

A pretrained model together with some instructions may be found at https://hncynic.leod.org/hncynic-trained-model-v1.tar.gz.

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.
  3. twitter-bot: Run a twitter bot.

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.

More Repositories

1

posh

Type-Safe Graphics Programming with Functional Shaders
Rust
136
star
2

rendology

Glium-based 3D rendering pipeline
Rust
64
star
3

ultimate-scale

Build increasingly large machines to solve increasingly difficult problems
Rust
61
star
4

pareen

Rust library for parameterized inbetweening
Rust
51
star
5

malen

Rust
12
star
6

coarse-prof

Tiny library for coarse-grained hierarchical profiling in Rust
Rust
10
star
7

catcheb

Secret multiplayer browser game
Rust
9
star
8

particle-frenzy

Simple 2D particle system in Rust
Rust
5
star
9

aural-travels

Turn Album Covers Into Music If You Want To Do That For Some Reason
Jupyter Notebook
3
star
10

catch-rs

Rust
2
star
11

hooks

Multiplayer catching game
Rust
1
star
12

flow

Rust
1
star
13

lang

A compiler for a language. Written in C++. Using LLVM. That's all I know for now.
C++
1
star
14

leod.github.io

Ruby
1
star
15

netgame

Rust
1
star
16

scdata

Jupyter Notebook
1
star
17

shady

Rust
1
star
18

configs

My various linux configs
Vim Script
1
star
19

untimely

Rust
1
star
20

exponentially_slow_compile

Rust
1
star
21

dotfiles

Linux Dotfiles
Shell
1
star
22

glace

OpenGL with Icing
Rust
1
star
23

stecs

Static entities; components static (i.e. stecs)
Rust
1
star
24

wosh

posh on wgpu
Rust
1
star
25

defend

Backup of some code from around 2009-2010 I think
D
1
star
26

shadergoo

Rust
1
star
27

haskell-rpg2d

haskell-rpg2d is an attempt by a Haskell newbie to write a relatively simple 2D RPG in Haskell
Haskell
1
star
28

nndefense

Rust
1
star
29

destiny

Rust
1
star
30

cereal

A simple cerealisation library
Rust
1
star
31

jlogic

Very inefficient interpreter for a very small subset of Prolog (for learning purposes)
Java
1
star
32

tmart

TM generated 2D art
C
1
star
33

albumlist

A mixture of hacks to create an overview over my music library combining MPD, Last.fm and more. Don't try this at home.
Python
1
star
34

bit_manager

Fork of Scott Taylor's bit_manager (https://crates.io/crates/bit_manager)
Rust
1
star