dragonSwing Cnydo commited on
Commit
261c60f
1 Parent(s): 5859a7b

Upload gec_model.py (#1)

Browse files

- Upload gec_model.py (a054769d1cd4d149db1357e29ff211fb4186ecf5)


Co-authored-by: An Thành Long <Cnydo@users.noreply.huggingface.co>

Files changed (1) hide show
  1. 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"