Instructions to use dragonSwing/vibert-capu with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use dragonSwing/vibert-capu with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("token-classification", model="dragonSwing/vibert-capu")# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("dragonSwing/vibert-capu", dtype="auto") - Notebooks
- Google Colab
- Kaggle
Upload gec_model.py
#1
by Cnydo - opened
- gec_model.py +1 -1
gec_model.py
CHANGED
|
@@ -89,11 +89,11 @@ class GecBERTModel(torch.nn.Module):
|
|
| 89 |
self.lowercase_tokens = lowercase_tokens
|
| 90 |
self.min_error_probability = min_error_probability
|
| 91 |
self.vocab = Vocabulary.from_files(vocab_path)
|
|
|
|
| 92 |
self.log = log
|
| 93 |
self.iterations = iterations
|
| 94 |
self.confidence = confidence
|
| 95 |
self.resolve_cycles = resolve_cycles
|
| 96 |
-
|
| 97 |
assert (
|
| 98 |
chunk_size > 0 and chunk_size // 2 >= overlap_size
|
| 99 |
), "Chunk merging required overlap size must be smaller than half of chunk size"
|
|
|
|
| 89 |
self.lowercase_tokens = lowercase_tokens
|
| 90 |
self.min_error_probability = min_error_probability
|
| 91 |
self.vocab = Vocabulary.from_files(vocab_path)
|
| 92 |
+
self.incorr_index = self.vocab.get_token_index("INCORRECT", "d_tags")
|
| 93 |
self.log = log
|
| 94 |
self.iterations = iterations
|
| 95 |
self.confidence = confidence
|
| 96 |
self.resolve_cycles = resolve_cycles
|
|
|
|
| 97 |
assert (
|
| 98 |
chunk_size > 0 and chunk_size // 2 >= overlap_size
|
| 99 |
), "Chunk merging required overlap size must be smaller than half of chunk size"
|