ludwig text-classification training

0xkoji - Feb 24 '19 - - Dev Community

uber/ludwig
https://github.com/uber/ludwig

Ludwig is a toolbox built on top of TensorFlow that allows to train and test deep learning models without the need to…
github.com

install

$ pip install ludwig
$ python -m spacy download en
Enter fullscreen mode Exit fullscreen mode

Tested text-classification

$ mkdir text-classification
$ cd text-classification
$ wget http://boston.lti.cs.cmu.edu/classes/95-865-K/HW/HW2/reuters-allcats-6.zip
$ unzip reuters-allcats-6.zip
$ vim model_definition.yaml
Enter fullscreen mode Exit fullscreen mode

model_definition.yam

input_features:
    -
        name: text
        type: text
        encoder: parallel_cnn
        level: word
output_features:
    -
        name: class
        type: category
Enter fullscreen mode Exit fullscreen mode

train.sh

#!/bin/sh

ludwig experiment \
  --data_csv reuters-allcats.csv \
  --model_definition_file model_definition.yaml
Enter fullscreen mode Exit fullscreen mode

Visualize

$ ludwig visualize --visualization learning_curves --training_statistics ./results/experiment_run_0/training_statistics.json
_         _        _      
| |_  _ __| |_ __ _(_)__ _ 
| | || / _` \ V  V / / _` |
|_|\_,_\__,_|\_/\_/|_\__, |
                     |___/ 
ludwig v0.1.0 - Experiment
Enter fullscreen mode Exit fullscreen mode
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .