close
The Wayback Machine - https://web.archive.org/web/20201126235355/https://github.com/PetrochukM/PyTorch-NLP/issues/61
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

Support loading fasttext model from custom file #61

Open
frenzykryger opened this issue Jan 3, 2019 · 4 comments
Open

Support loading fasttext model from custom file #61

frenzykryger opened this issue Jan 3, 2019 · 4 comments

Comments

@frenzykryger
Copy link

@frenzykryger frenzykryger commented Jan 3, 2019

What if I want to use own pretrained fasttext model (or even commoncrawl model instead of standard wiki one)? E.g. look what they publish now: https://fasttext.cc/docs/en/crawl-vectors.html.
Current FastText impl

    url_base = 'https://s3-us-west-1.amazonaws.com/fasttext-vectors/wiki.{}.vec'
    aligned_url_base = 'https://s3.amazonaws.com/arrival/embeddings/wiki.multi.{}.vec'

    def __init__(self, language="en", aligned=False, **kwargs):
        if aligned:
            url = self.aligned_url_base.format(language)
        else:
url = self.url_base.format(language)

doesn't allow you to do such basic stuff.

@PetrochukM
Copy link
Owner

@PetrochukM PetrochukM commented Jan 3, 2019

Hi There! This should be easy to add, please submit a PR if you have the time! Thanks!

@tu-artem
Copy link

@tu-artem tu-artem commented Jan 15, 2019

Hi! isn't it possible to use more general _PretrainedWordVectors here? This class allows loading custom vectors from files or urls. @PetrochukM may be it would be good to make it more user-friendly?

@PetrochukM
Copy link
Owner

@PetrochukM PetrochukM commented Jan 15, 2019

Sure, happy to have it more user-friendly.

Sorry, I do not time to contribute to this project at the moment, trying to run a startup.

@PetrochukM
Copy link
Owner

@PetrochukM PetrochukM commented Apr 3, 2019

Please feel free to send a PR!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.