Coder Social home page Coder Social logo

Comments (4)

Oneplus avatar Oneplus commented on September 3, 2024

Please refer the readme for an example.

Then, prepare your input file in the conllu format, like
1 Sue Sue _ _ _ _ _ _ _
2 likes like _ _ _ _ _ _ _
3 coffee coffee _ _ _ _ _ _ _
4 and and _ _ _ _ _ _ _
5 Bill Bill _ _ _ _ _ _ _
6 tea tea _ _ _ _ _ _ _

from elmoformanylangs.

Oneplus avatar Oneplus commented on September 3, 2024

I will close this issue. If there is a further question, please reopen it.

from elmoformanylangs.

frankier avatar frankier commented on September 3, 2024

You might find this helpful: https://github.com/EmilStenstrom/conllu

from elmoformanylangs.

jbrry avatar jbrry commented on September 3, 2024

Hi Yijia @Oneplus,

Could you give an example of running elmoformanylangs to compute ELMo representations for a conllu file and loading the vectors in a python file?

I have tried something similar to #9 but I cannot "get" the vector for a specific sentence. Using the allennlp module, I am able to get a sentence based on the sentence index, like so:

vecs_file = os.path.join(args.elmo_output_dir, 'en_lines-sentences.hdf5')   
h5py_file = h5py.File(vecs_file, 'r')  
embedding = h5py_file.get("0")

However, when I use elmoformanylangs to compute the ELMo representations, when I try get the vector it always returns a None value. I have even tried providing the full tab-separated sentence but I can never find the sentence in my program, e.g.

embedding = h5py_file.get("He and Ron went down to breakfast to find Mr and Mrs Weasley and Ginny already sitting at the kitchen table .") or embedding = h5py_file.get("0") always returns None.

The command I am running is:

python -m elmoformanylangs test --input_format conll --input ~/en_conllu/en_lines-ud-dev.conllu --model ~/ELMo/en.model/ --output_prefix sample --output_format hdf5 --output_layer -1

The output of such a command gives rather unusual looking output. E.g.

tail sample.ly-1.hdf5 looks like:
https://imgur.com/a/JWKeV4v

So my question is, does something look erroneous with my output/command or how do I load a particular sentence embedding when using a conllu file?

Thanks!

from elmoformanylangs.

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.