Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add __setitem__ func to torchtext.experimental.vocab.Vocab #1113

Open
wants to merge 56 commits into
base: main
Choose a base branch
from

Conversation

zhangguanheng66
Copy link
Contributor

@zhangguanheng66 zhangguanheng66 commented Dec 23, 2020

On top of #1027

Add __setitem__ func to torchtext.experimental.vocab.Vocab. A __delitem__ func is added as well.

[RuntimeError] if the token exists, a error message is sent out and ask users to delete the existing token from vocab.

Note: for the vocab, we don't support the assignment between a single index and multiple tokens.

@codecov
Copy link

codecov bot commented Dec 23, 2020

Codecov Report

Merging #1113 (fe5ce92) into master (9053d95) will increase coverage by 0.06%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1113      +/-   ##
==========================================
+ Coverage   79.46%   79.52%   +0.06%     
==========================================
  Files          47       47              
  Lines        3175     3185      +10     
==========================================
+ Hits         2523     2533      +10     
  Misses        652      652              
Impacted Files Coverage Δ
torchtext/experimental/vocab.py 100.00% <100.00%> (ø)

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 9053d95...fe5ce92. Read the comment docs.

@zhangguanheng66 zhangguanheng66 changed the title [DO NOT REVIEW] Add __setitem__ func to torchtext.experimental.vocab.Vocab Add __setitem__ func to torchtext.experimental.vocab.Vocab Jan 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants