项目作者: KhaledSharif

项目描述 :
My work in progress on training a language model on a jokes corpus, as per the OpenAI Request for Research
高级语言: Python
项目地址: git://github.com/KhaledSharif/openai-jokes.git
创建时间: 2018-03-22T14:11:32Z
项目社区:https://github.com/KhaledSharif/openai-jokes

开源协议:

下载


OpenAI Jokes

Training a character-level language model on a corpus of jokes.

How to obtain the training dataset

  1. git clone https://github.com/taivop/joke-dataset.git
  2. cd joke-dataset
  3. export PATH_TO_JOKES=$PWD

How to train

  1. git clone https://github.com/KhaledSharif/openai-jokes.git
  2. cd openai-jokes
  3. python3 lstm_text_generation.py --path=$PATH_TO_JOKES/reddit_jokes.json --batch_size=512 --epochs=1000

Training arguments

  1. python3 lstm_text_generation.py --help
  1. --path PATH Path to JSON file containing jokes
  2. --learning_rate LEARNING_RATE
  3. Learning rate as a float
  4. --clipping_value CLIPPING_VALUE
  5. Clipping value of the gradient as a float
  6. --number_of_layers NUMBER_OF_LAYERS
  7. Number of layers in the LSTM, integer
  8. --lstm_size LSTM_SIZE
  9. Number of neurons in each individual LSTM, integer
  10. --lstm_bidirectional LSTM_BIDIRECTIONAL
  11. LSTM direction (uni or bi), boolean
  12. --batch_normalization BATCH_NORMALIZATION
  13. Batch normalization (enabled or disabled), boolean
  14. --epochs EPOCHS Number of training epochs, integer
  15. --batch_size BATCH_SIZE
  16. Training batch size, integer

Output after 100 epochs

  1. Epoch 100/100
  2. 833320/833320 [==============================] - 391s 469us/step - loss: 0.1055
  3. ----- generating text after epoch: 99
  4. ----- diversity: 0.2
  5. ----- generating with seed: "n had a right for privacy he said theref"
  6. n had a right for privacy he said therefore her number she said got a new baby boy masking words wave horseage he says a happy but i haven't allowed to do a gorgeous but i really needs to go back to the doctor and says 'that's mord friend yes she's a shot | why are standing bakery karaaaaaaaaaaaaaaaaaaaaaaaaaaaamn! | i made a doctor did in a joke about poor dad still not | if you either music away for a minute? firm years and i take him
  7. ----- diversity: 0.5
  8. ----- generating with seed: "n had a right for privacy he said theref"
  9. n had a right for privacy he said therefore he comes back in her she shoots the disground bread and close to their house who do you see? one is a shut of water | what do you call a megaphian for a listen in the deal is that i go home to come to see my own cowarderph? a rectomous was really bad and no punchline its like a partner but she wings up and fortunately asks her poor what's the most love advim he says back to me no idea now that
  10. ----- diversity: 1.0
  11. ----- generating with seed: "n had a right for privacy he said theref"
  12. n had a right for privacy he said therefore her petacle say? he he was a huge liber's house | donald trump advance have a women perious long? none asked the way's the other punchister but i just wave the dish the blonde replies well everything that he's probably illegal they susped to come as a christmas tree's testicles for it while he was about to over his dick into a gate the temple says i was a doctor? damate who was throwing up i s
  13. ----- diversity: 1.2
  14. ----- generating with seed: "n had a right for privacy he said theref"
  15. n had a right for privacy he said therefore her pay he decides he'd have a problem of the next hate good news and voodoo dick fix meme?! | i have to fix the iphone before i saw the poor woman he is bored but there is a very problem of minutes feet constation for the sterical of the story? robotoge it a newspaper are you aware of people i was over! | my wife and i asked my wife the ship! let's remain the fridge answer wall well son a wom