Skip to content

Instantly share code, notes, and snippets.

@hamletbatista
Last active July 29, 2019 23:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hamletbatista/f5993ee38d14643f0df71ae2303f5dfa to your computer and use it in GitHub Desktop.
Save hamletbatista/f5993ee38d14643f0df71ae2303f5dfa to your computer and use it in GitHub Desktop.
#https://uber.github.io/ludwig/user_guide/#bert-encoder
template="""
input_features:
-
name: Questions
type: text
encoder: bert
config_path: uncased_L-12_H-768_A-12/bert_config.json
checkpoint_path: uncased_L-12_H-768_A-12/bert_model.ckpt
preprocessing:
word_tokenizer: bert
word_vocab_file: uncased_L-12_H-768_A-12/vocab.txt
padding_symbol: '[PAD]'
unknown_symbol: '[UNK]'
output_features:
-
name: Category0
type: category
-
name: Category2
type: category
text:
word_sequence_length_limit: 128
training:
batch_size: 32
learning_rate: 0.00002
"""
with open("model_definition.yaml", "w") as f:
f.write(template)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment