Skip to content

Instantly share code, notes, and snippets.

@marcossilva
Created December 9, 2022 20:50
Show Gist options
  • Save marcossilva/85358923d8548a5f7f0f869ee652bec0 to your computer and use it in GitHub Desktop.
Save marcossilva/85358923d8548a5f7f0f869ee652bec0 to your computer and use it in GitHub Desktop.
Initalize GecBERTModel using pre-trained model weights
from gector.gec_model import GecBERTModel
VOCAB_PATH = "test_fixtures/roberta_model/vocabulary"
MODEL_PATH = "test_fixtures/roberta_model/weights.th"
# Initialize model
model = GecBERTModel(
vocab_path=VOCAB_PATH,
model_paths=[MODEL_PATH],
max_len=50,
min_len=3,
iterations=5,
min_error_probability=0.0,
lowercase_tokens=0,
model_name="roberta",
special_tokens_fix=1,
log=False,
confidence=0,
del_confidence=0,
is_ensemble=0,
weights=None,
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment