Closed floscha closed 6 years ago
Merging #23 into master will increase coverage by
0.02%
. The diff coverage is100%
.
@@ Coverage Diff @@
## master #23 +/- ##
==========================================
+ Coverage 94.49% 94.52% +0.02%
==========================================
Files 54 54
Lines 1508 1516 +8
==========================================
+ Hits 1425 1433 +8
Misses 83 83
Impacted Files | Coverage Δ | |
---|---|---|
torchnlp/word_to_vector/pretrained_word_vectors.py | 79.06% <100%> (+2.14%) |
:arrow_up: |
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 049f534...dfa987a. Read the comment docs.
This looks great! Thank you!
This PR extends the
__getitem()__
method of the_PretrainedWordVectors
base class forlist
andtuple
types in order to retrieve word vectors for multiple tokens at once.It also adds unit tests to assert that retrieval for mutiple tokens works correctly and an exception is thrown for invalid types.
For example, the following code will return a 4x300
torch.FloatTensor
object: