python app for training spaCy models
Check out TagEditor for creating training data
Option 1: No installation required.
Download zip archive files NGym.7z.001 and NGym.7z.002 into the same folder, and unzip NGym.7z.001.
Launch ng.exe
Option 2: from cmd
git clone https://github.com/d5555/NeuralGym
pip install neuralgym/.
To run application open terminal (cmd) and type: python -m ngym
or ngym
or
python
>>>import ngym
- Create an output directory where the trained model will be saved.
- Select
train
anddev
data files in spaCy format. You can use TagEditor to create your training dataset. For demonstration purposes there are 2 dataset files,imdb_train.spacy
(400 docs) andimdb_dev.spacy
(100 docs) annotated with POS ,Dependencies, NER and Textcategories. - Select a source model (it can be any spaCy model compatible with spaCy 3.0+) for training from source. You can specify either a source model name, eg en_core_web_sm or select a folder with model. If you specify the model name without full path, the model should be placed into the application's main folder (including model's dist-info folder) or add path to the Python folder where spaCy models are installed by pushing button
Add sys path
. Usually it is Python...\Lib\site-package. For example ... "C:\Python39\Lib\site-packages"
To train from source check on Training optionsFrom source
respectively or uncheck them to start from blank model.
Labels in the training data should match labels in the original model otherwise start from blank model. - Check on Use averages so the model to be saved with parameter averaging after training is done.
- Press Start to initialize training. You can disrupt training process at any time by clicking stop.
- After training is completed there will be 2 folders in the output directory, 'Best model' and 'Last model'.
- Button Reset allows to restore default settings in case of an error. Or delete 'config.cfg' in the main folder.