Comments (4)
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.
I will close this issue. If there is a further question, please reopen it.
from elmoformanylangs.
You might find this helpful: https://github.com/EmilStenstrom/conllu
from elmoformanylangs.
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)
- Error when importing elmofromanylans in my code HOT 2
- HELP! An error occur run: 'from elmoformanylangs import Embedder' HOT 2
- Convert csv to conllu format HOT 1
- anyone ever had this problem?
- Fine-tuning existing models
- token的时候create_one_batch方法中获取bow和eow的id的时候为什么互换了两个id的位置
- A suggestion about simplified-Chinese ELMo
- Programmatic way to get dimension of embedding
- Logging is very noisy HOT 1
- Default to sample...json as needed HOT 1
- 请问简体中文的训练语料可以从哪里获得呢?
- Document Embedding
- 请问如何进行elmo2sents
- --train_path data/en.raw \ 训练数据的格式是什么样的
- Dependency Parsing usage
- Running the model on GPU HOT 1
- from elmoformanylangs import Embedder HOT 9
- Pre-trained model download link invalid HOT 2
- The size of output model is very large when exporting to ONNX format.
- directory error HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from elmoformanylangs.