Skip to content
This repository has been archived by the owner on Jul 4, 2023. It is now read-only.

Support loading fasttext model from custom file #102

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

YuhengHuang42
Copy link

Add two simple parameters to class FastText, making it possible to load fasttext model from custom file.

@YuhengHuang42
Copy link
Author

Related to issue 61

@codecov-commenter
Copy link

codecov-commenter commented Jul 1, 2020

Codecov Report

Merging #102 into master will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #102   +/-   ##
=======================================
  Coverage   94.41%   94.42%           
=======================================
  Files          64       64           
  Lines        1611     1613    +2     
=======================================
+ Hits         1521     1523    +2     
  Misses         90       90           
Impacted Files Coverage Δ
torchnlp/metrics/__init__.py 100.00% <ø> (ø)
torchnlp/word_to_vector/fast_text.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 cde86ba...56a59d8. Read the comment docs.

@PetrochukM
Copy link
Owner

Hi! Thanks for your contribution.

It looks like the parameters introduced are directly passed into PretrainedWordVectors. Should we just use PretrainedWordVectors instead of FastText to solve the issue?

@YuhengHuang42
Copy link
Author

Hi! Thanks for your contribution.

It looks like the parameters introduced are directly passed into PretrainedWordVectors. Should we just use PretrainedWordVectors instead of FastText to solve the issue?

Yes, this is a good idea. It is more suitable for the problem. I didn't understand the related class thoroughly before.

@PetrochukM
Copy link
Owner

Would you like to change PretrainedWordVectors to be public? Or would you like me to?

@multinucliated
Copy link

How do I load this in pytorch or pytorch-nlp crawl-300d-2M-subword/crawl-300d-2M-subword.bin ?

Is this feature completed or still in progress ?

@YuhengHuang42
Copy link
Author

YuhengHuang42 commented Jul 17, 2020

How do I load this in pytorch or pytorch-nlp crawl-300d-2M-subword/crawl-300d-2M-subword.bin ?

Is this feature completed or still in progress ?

If I understand correctly, it should be done by just passing the name of your file to the "name" parameter.

However, the suggestion from PetrochukM is more appropriate, if you have time you could follow his suggestion and fix the issue. Thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants