Downloads · 30 days
163
10% of all-time downloads
gotutiyan/gector-deberta-base-5k
gector-deberta-base-5k is a machine learning model from gotutiyan. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for transformers.
Downloads · 30 days
163
10% of all-time downloads
All-time downloads
1.6K
Public
Parameters
142M
1.1 GB on disk
Likes
0
Public
Click a slice to open those files.
.bin570 MB · 50%
How the weights are stored.
F32142M · 100%
From the Hugging Face model README
Only non-commercial purposes.
This is an unofficial pretrained model of GECToR (Omelianchuk+ 2020).
The code is avaliable from https://github.com/gotutiyan/gector.
CLI
python predict.py --input <raw text file> --restore_dir gotutiyan/gector-deberta-base-5k --out <path to output file>
API
from transformers import AutoTokenizer
from gector.modeling import GECToR
from gector.predict import predict, load_verb_dict
import torch
model_id = 'gotutiyan/gector-deberta-base-5k'
model = GECToR.from_pretrained(model_id)
if torch.cuda.is_available():
model.cuda()
tokenizer = AutoTokenizer.from_pretrained(model_id)
encode, decode = load_verb_dict('data/verb-form-vocab.txt')
srcs = [
'This is a correct sentence.',
'This are a wrong sentences'
]
corrected = predict(
model, tokenizer, srcs,
encode, decode,
keep_confidence=0.0,
min_error_prob=0.0,
n_iteration=5,
batch_size=2,
)
print(corrected)