      output_dir=("Optional output directory", "option", "o", Path),
      n_texts=("Number of texts to train from", "option", "t", int),
      n_iter=("Number of training iterations", "option", "n", int),
      init_tok2vec=("Pretrained tok2vec weights", "option", "t2v", Path),
  )
  def main(config_path, output_dir=None, n_iter=20, n_texts=2000, init_tok2vec=None, dataset="imdb", threshold=20):
      if not config_path or not config_path.exists():
          raise ValueError(f"Config file not found at {config_path}")
 
</s> remove     model=("Model name. Defaults to blank 'en' model.", "option", "m", str),
 </s> add     config_path=("Path to config file", "positional", None, Path), </s> remove         tok2vec.set_dim("nO", width)
 </s> add         if tok2vec.has_dim("nO") is not False:
            tok2vec.set_dim("nO", width) </s> remove         self.model.set_dim("nO", nO)
 </s> add         if self.model.has_dim("nO") is not False:
            self.model.set_dim("nO", nO) </s> remove     # Note: original defaults were ngram_size=1 and no_output_layer=False
 </s> add 
    dataset=("Dataset to train on (default: imdb)", "option", "d", str),
    threshold=("Min. number of instances for a given label (default 20)", "option", "m", int)
      output_dir=("Optional output directory", "option", "o", Path),
      n_texts=("Number of texts to train from", "option", "t", int),
      n_iter=("Number of training iterations", "option", "n", int),
      init_tok2vec=("Pretrained tok2vec weights", "option", "t2v", Path),
    dataset=("Dataset to train on (default: imdb)", "option", "d", str),
    threshold=("Min. number of instances for a given label (default 20)", "option", "m", int)
  )
  def main(config_path, output_dir=None, n_iter=20, n_texts=2000, init_tok2vec=None, dataset="imdb", threshold=20):
      if not config_path or not config_path.exists():
          raise ValueError(f"Config file not found at {config_path}")
keep keep keep add keep keep keep keep
 Train textcat with config (#5143)

* bring back default build_text_classifier method

* remove _set_dims_ hack in favor of proper dim inference

* add tok2vec initialize to unit test

* small fixes

* add unit test for various textcat config settings

* logistic output layer does not have nO

* fix window_size setting

* proper fix

* fix W initialization

* Update textcat training example

* Use ml_datasets
* Convert training data to `Example` format
* Use `n_texts` to set proportionate dev size

* fix _init renaming on latest thinc

* avoid setting a non-existing dim

* update to thinc==8.0.0a2

* add BOW and CNN defaults for easy testing

* various experiments with train_textcat script, fix softmax activation in textcat bow

* allow textcat train script to work on other datasets as well

* have dataset as a parameter

* train textcat from config, with example config

* add config for training textcat

* formatting

* fix exclusive_classes

* fixing BOW for GPU

* bump thinc to 8.0.0a3 (not published yet so CI will fail)

* add in link_vectors_to_models which got deleted

Co-authored-by: Adriane Boyd <adrianeboyd@gmail.com> 
examples/training/train_textcat.py