Skip to content

Instantly share code, notes, and snippets.

@ShairozS
Created April 27, 2020 14:45
Show Gist options
  • Select an option

  • Save ShairozS/bb0b57b315ece90c938e5f3850f8cf9b to your computer and use it in GitHub Desktop.

Select an option

Save ShairozS/bb0b57b315ece90c938e5f3850f8cf9b to your computer and use it in GitHub Desktop.
Train EntityRecognizer
# Initialize the EntityRecognizer model
ner = EntityRecognizer(data)
# Find an optimal learning rate
lr=ner.lr_find()
# Set how many epochs (passes over training data) we'd like the model to train for
epochs = 50
# Fit the model using the found learning rate and our specified epochs
ner.fit(epochs=epochs, lr=lr)
# Visualize the results
ner.show_results()
# Save the model
ner.save(str(epochs) + "_model")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment