Questions tagged [elmo]

A tag for ELMo, a way to model words into a deep contextualized representation. It is part of and developed by AllenNLP.

ELMo is a deep contextualized word representation that models both (1) complex characteristics of word use (e.g., syntax and semantics), and (2) how these uses vary across linguistic contexts (i.e., to model polysemy). These word vectors are learned functions of the internal states of a deep bidirectional language model (biLM), which is pre-trained on a large text corpus. They can be easily added to existing models and significantly improve the state of the art across a broad range of challenging NLP problems, including question answering, textual entailment and sentiment analysis.

75 questions
1
vote
1 answer

Allennlp german elmo model

I want to build a Q&A bot with allennlp. I already found the code for it and an English model - I want to use the bot with german. I already searched for it, but I only found this model which is unfortunately not compatible with allennlp. Do you…
Unterbelichtet
  • 628
  • 2
  • 7
  • 18
1
vote
1 answer

Is it possible and how to reduce the dimensions of ELMO embeddings using tf-hub elmo model?

I am using ELMO model from tensorflow hub. import tensorflow as tf import tensorflow_hub as hub from tensorflow.contrib import predictor elmo = hub.Module("https://tfhub.dev/google/elmo/3", trainable=False) The default output dimension is 1024. Is…
loadbox
  • 646
  • 14
  • 34
1
vote
1 answer

FailedPreconditionError: Error while reading resource variable module/bilm/CNN_proj/W_proj from Container: localhost

I am trying to use pre-trained elmo embeddings in jupyter notebook with python 3.7. Tensorflow version - 1.14.0 This is my code def ElmoEmbeddingLayer(x): print(x.shape) module = hub.Module("https://tfhub.dev/google/elmo/3",…
RitikaNandi
  • 45
  • 1
  • 7
1
vote
1 answer

Keras Prediction result (getting score,use of argmax)

I am trying to use the elmo model for text classification for my own dataset. The training is completed and the number of classes is 4(used keras model and elmo embedding).In the prediction, I got a numpy array. I am attaching the sample code and…
Amal Joseph
  • 23
  • 1
  • 5
1
vote
1 answer

TensorFlow - tensorflow.python.framework.errors_impl.FailedPreconditionError

I tried to update the following code from TF 1.7 to TF 1.14 : def build(self, input_shape): self.max_length = input_shape[1] self.word_mapping = [x[1] for x in sorted(self.idx2word.items(), key=lambda x: x[0])] self.lookup_table =…
Ana Maïs
  • 41
  • 3
1
vote
1 answer

Problems with variable_scope in ELMo Embedding layer with Keras

I'm trying to use a custom ElmoEmbeddingLayer for my model in Keras with tensorflow-gpu==2.0.0-rc0. This is the class: class ElmoEmbeddingLayer(Layer): def __init__(self, trainable=True, output_mode="default", **kwargs): assert…
1
vote
1 answer

Get similarity score between 2 words using Pre trained Bert, Elmo

I am trying to compare Glove, Fasttext, Bert ,Elmo on basis on similarity between 2 words using pre-trained models of Wiki. Glove and Fasttext had pretrained models which could easily be used with gensim word2vec in python. Does Elmo and Bert have…
Yatin Gupta
  • 653
  • 5
  • 12
1
vote
0 answers

How to reshape keras mask within custom layer

Note: I posted about this issue already here. I'm creating a new question because: 1. I think the issue specifically relates to reshaping my mask within my custom layer, but I'm not sure enough of that to completely ignore the other error I wrote…
KMunro
  • 348
  • 4
  • 14
1
vote
0 answers

Not able to install Bert Serving server. "Could not find a version that satisfies the requirement bert-serving-server"

I'm trying to set up bert-as-service on my office machine and I keep getting the same error. I have Python 3.6.8 :: Anaconda, Inc. and Tensorflow 1.10.0 on my Conda environment and Python 3.7.2 on my local machine(CMD)(Windows 10). I dont have…
Kash
  • 11
  • 4
1
vote
1 answer

My ELMo trained model gives output dictionary with different fields from those from the tf.hub model

When using a pre-trained ElMo model, I get an output dictionary different from the output dictionary explained in the published tf.hub model My output dictionary's signature is > model = BidirectionalLanguageModel(options_file, weight_file) >…
A_Matar
  • 2,210
  • 3
  • 31
  • 53
1
vote
1 answer

Using Elmo with tf.Keras throws ValueError: could not convert string to float

I am trying to use Elmo with tf.keras. However, the call to model.fitcauses ValueError: could not convert string to float Tensorflow version: 1.13.1 Numpy version: 1.14.6 Here is the full code: import tensorflow as tf import tensorflow_hub as…
Shubhanshu Mishra
  • 6,210
  • 6
  • 21
  • 23
1
vote
1 answer

Output from elmo pretrained model

I am working on sentiment analysis. I am using elmo method to get word embeddings. But i am confused with the output this method is giving. Consider the code given in tensor flow website: elmo = hub.Module("https://tfhub.dev/google/elmo/2",…
0
votes
0 answers

Unable to train BiLSTM due to FailedPreconditionError

I am building a BiLSTM model using Elmo embeddings with TensorFlow Hub. My code looks like this: import tensorflow as tf import tensorflow_hub as hub from keras.layers import Layer import keras.backend as K class ElmoEmbeddingLayer(Layer): def…
0
votes
0 answers

What value can be got by GetActualTorque() function on Elmo API?

We are trying to control more than 20 motors daisy chained together. We are using an Elmo controller (Platinum Maestro) as controller, communicating via EtherCAT. The PC environment is Ubuntu 20.04, and the control is attempted using "Maestro…