text
text copied to clipboard
Helper function for Vocab object
I found it hard to understand how to preform a "full loop" of Token -> index -> Token, I think the intended manner is to just access the itos variable of the vocab. This feels to me to be inconsistent with how the API is setup to get a index for a token, which uses the getitem overload. While this is not a perfect solution, I do think it will help other new users to have a guiding hand about how to get at this information.
Hi @TuckerBMorgan!
Thank you for your pull request and welcome to our community.
Action Required
In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.
Process
In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.
Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed
. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.
If you have received this in error or have any questions, please contact us at [email protected]. Thanks!
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks!
Codecov Report
Merging #1254 (b455c91) into master (735d5e7) will decrease coverage by
0.08%
. The diff coverage is20.00%
.
@@ Coverage Diff @@
## master #1254 +/- ##
==========================================
- Coverage 80.76% 80.68% -0.09%
==========================================
Files 67 67
Lines 3624 3629 +5
==========================================
+ Hits 2927 2928 +1
- Misses 697 701 +4
Impacted Files | Coverage Δ | |
---|---|---|
torchtext/vocab.py | 88.81% <20.00%> (-1.19%) |
:arrow_down: |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact)
,ø = not affected
,? = missing data
Powered by Codecov. Last update 735d5e7...b455c91. Read the comment docs.
You can use itos
attribute in the vocab object. Just FYI, this vocab will be retired and replaced with torchtext.experimental.vocab
. cc @parmeet
Covered by current functionality, but might be a good idea to include in the documentation how to get a token.