How to use command line interface

After you run the command to start your model on the command line interface, you can start using it.

This guide walks you through the full workflow of using your pipeline from the command line, including:

  • Initializing your pipeline
  • Viewing and updating your data
  • Training and replacing your model
  • Editing hyperparameters
  • Evaluating your model
  • Downloading your trained model

Initialize model

If you start the pipeline from zero, you can follow the steps below:

  1. Enter a name for your pipeline

  2. Enter the address of the data you want to use in your pipeline. Make sure it matches the expected data format. If it is a pre-built pipeline, you can read more about the expected format in the pre-built model cards.

  3. Decide how you want to split your data. A part of it should be used for training and the other part should be used for evaluation. The divide must add to 1. So if you want to use half your data for training and half for validation, enter 0.5 for both.

  4. Now, the message “✅ Pipeline successfully initialized!” shows and you can click “p” to go to the prepare stage.

View data in the pipeline

If you want to view some data in your pipeline, go to the prepare stage and follow the steps below:

  1. Click “v” to view tokenized data, and “r” to view untokenized raw data.
  2. Enter a number and hit enter to view the datapoint at that position. The position runs from 1 to number of data. Or you can hit enter without entering anything to view a random data point.
  3. Repeat step 2 or enter “q” to quit and go back to prepare’s main menu.

Update data after initialization

If you want to update your training and validation data after initialization, you don’t have to re-initialize. Go to the prepare stage and follow the steps below:

  1. Click “u” to update your dataset.
  2. Enter your new address and click enter. Your data is updated. If you had initialized this session, the split you entered will be used. Otherwise, if this session was started from a specific stage, the division will be 0.8 for training and 0.2 for validation.

Train your model

If you want to start training your model, you can go to the train stage and follow the steps below:

  1. Click “t” to start training. The training epochs and loss will be shown once every epoch is done.

Replace model

If you think your model hasn’t performed well in the training you performed and want to replace it with a new untrained model, you can do this in the train stage:

  1. Click “r” to replace the model.
  2. A question to confirm that you want to replace your model shows, enter y and click enter. Given that no error occurs, a success message shows that it was replaced.

Change hyper-parameter values

If you want to update hyper-parameter values, in the train stage, follow the steps below:

  1. Click “u” to update your hyperparameters.
  2. For all updated hyperparameters, you can either enter a new value and click enter, or you can leave it empty to use the previous model. Once all the hyperparameters are entered, you can see the updated values in the train stage main menu.

Evaluate or validate your model

You can get a validation score of your data in the train and deploy stages. To do so follow the step below:

  1. Click “e” to use your validation data. A metric name and number will be shown.

If you want to evaluate your model in the deploy stage, follow the steps below:

  1. Click “a” to add your evaluation data.

  2. Enter the directory of your data and click enter.

  3. Once you uploaded your evaluation data, you can see a new option “n” to use this data in evaluation. Click “n” to evaluate your newly uploaded data. A metric name and number will be shown.

Download the model

If you want to download your model after you trained and evaluated it, in the deploy stage follow the steps below:

  1. Click “s”
  2. Enter a directory where you want to save your model. Then click enter. Your model will be downloaded as a .bin file in the directory specified.

This completes the end-to-end workflow for using Bojai’s command-line interface to manage machine learning pipelines.

If you have suggestions on adding more features, submit a GitHub issue describing the new model in detail.