Closed shishirb126 closed 3 years ago
let's remove the unused import to fix lint
[2020-10-01T17:31:46.031Z] ************* Module gluonnlp.vocab.vocab
[2020-10-01T17:31:46.031Z] src/gluonnlp/vocab/vocab.py:33:0: W0611: Unused DefaultLookupDict imported from data.utils (unused-import)
Description
The v0.x vocab implementation uses a custom dict implementation to handle case where unknown tokens are specified. When looking up multiple tokens, it is faster to work with a Python dict directly. A similar change has already been made in the master branch. This change pulls it to the v0.x branch.
Results from a micro benchmark below. Current implementation:
With the patch:
Checklist
Essentials
Changes
Comments
cc @dmlc/gluon-nlp-team