Giter Club home page Giter Club logo

Comments (8)

glample avatar glample commented on July 2, 2024 2

What you could do is start the supervised.py code by providing your source and target embeddings, then just after this line: https://github.com/facebookresearch/MUSE/blob/master/supervised.py#L66
you can modify the mapping attribute of the model to reload your best_mappings.pth. You can check this function to see how to do this:

def reload_best(self):

Something like this should work:

to_reload = torch.from_numpy(torch.load('your_path/best_mappings.pth'))
W = trainer.mapping.weight.data
assert to_reload.size() == W.size()
W.copy_(to_reload.type_as(W))

Then, by simply calling trainer.build_dictionary(), trainer.dico will contain the dictionary you are looking for.

from muse.

glample avatar glample commented on July 2, 2024 1

Yes, the output vectors are aligned and you can directly use that.

from muse.

aconneau avatar aconneau commented on July 2, 2024

@jamsheer2u you need to implement a function that takes a Malayalam word as input, and compute the cosine similarity between this word and all the words in Hindi. Then take the word in Hindi that has the highest cosine with the input Malayalam word.
We will provide a demo ipython notebook to load some word vectors and play with it.

from muse.

jamsheer2u avatar jamsheer2u commented on July 2, 2024

from muse.

glample avatar glample commented on July 2, 2024

Hi @jamsheer2u,
This repo is for embeddings only. But we will probably open-source code for unsupervised NMT in the future.

from muse.

naman-agrawal avatar naman-agrawal commented on July 2, 2024

How to use best_mappings.pth generated by unsupervised.py on english<---->spanish language pairs to get a dictionary/list of words? @glample

from muse.

naman-agrawal avatar naman-agrawal commented on July 2, 2024

thank you!

from muse.

fratamico avatar fratamico commented on July 2, 2024

After doing unsupervised training, are the output vectors produced the aligned ones? Or do I need to also use the .pth file to align them.

I'm trying to both build a dictionary and compute the distance between the pairs.

from muse.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.