All Questions

Tagged with
20
votes
3answers
6k views

Keras Text Preprocessing - Saving Tokenizer object to file for scoring

I've trained a sentiment classifier model using Keras library by following the below steps(broadly).Convert Text corpus into sequences using Tokenizer object/classBuild a model using the model.fit()...
27
votes
7answers
33k views

How to return history of validation loss in Keras

Using Anaconda Python 2.7 Windows 10.I am training a language model using the Keras exmaple:print('Build model...')model=Sequential()model.add(GRU(512, return_sequences=True, input_shape=(...
2
votes
2answers
2k views

Where to start: Natural language processing and AI using Python

My goal is to write a program capable of extracting tone, personality, and intent from human language inquiries (e.g. I type: How are you doing today? And the AI system responds with something like: ...
4
votes
1answer
5k views

How to put more weight on certain features in machine learning?

If using a library like scikit-learn, how do I assign more weight on certain features in the input to a classifier like SVM? Is this something people do or is there another solution to my problem?
1
vote
1answer
1k views

How to concatenate word vectors to form sentence vector

I have learned in some essays (Tomas Mikolov...) that a better way of forming the vector for a sentence is to concatenate the word-vector. but due to my clumsy in mathematics, I am still not sure ...
20
votes
2answers
12k views

CBOW v.s. skip-gram: why invert context and target words?

In this page, it is said that: [...] skip-gram inverts contexts and targets, and tries to predict each context word from its target word [...]However, looking at the training dataset it produces,...
6
votes
1answer
1k views

how do I use a very large (>2M) word embedding in tensorflow?

I am running a model with a very big word embedding (>2M words). When I use tf.embedding_lookup, it expects the matrix, which is big. When I run, I subsequently get out of GPU memory error. If I ...
4
votes
1answer
280 views

PyTorch: Relation between Dynamic Computational Graphs - Padding - DataLoader

As far as I understand, the strength of PyTorch is supposed to be that it works with dynamic computational graphs. In the context of NLP, that means that sequences with variable lengths do not ...
1
vote
1answer
664 views

how's the input word2vec get fine-tuned when training CNN

When I read the paper "Convolutional Neural Networks for Sentence Classification"-Yoon Kim-New York University, I noticed that the paper implemented the "CNN-non-static" model--A model with pre-...
7
votes
2answers
1k views

What is “unk” in the pretrained GloVe vector files (e.g. glove.6B.50d.txt)?

I found "unk" token in the glove vector file glove.6B.50d.txt downloaded from https://nlp.stanford.edu/projects/glove/. Its value is as follows:unk -0.79149 0.86617 0.11998 0.00092287 0.2776 -0....
3
votes
1answer
297 views

What does the “source hidden state” refer to in the Attention Mechanism?

The attention weights are computed as:I want to know what the h_s refers to.In the tensorflow code, the encoder RNN returns a tuple:encoder_outputs, encoder_state=tf.nn.dynamic_rnn(...)As I ...
2
votes
0answers
38 views

what is the kind of max pooling in this nlp questionhierarchy description

I'm trying to implement this description and that what I didI generated uni_gram & bi_gram & tri_gram of shape(?,15,512) "using padding "& then for each word I concatenate the three ...
0
votes
1answer
2k views

how to fine-tune word2vec when training our CNN for text classification?

I have 3 Questions about it, please help me out, I would really appreciate! Many thanks in advance!1.when I train my own CNN for text classification, I use word2vec to initialise the words, then I ...

angop.ao, elkhabar.com, noa.al, afghanpaper.com, bbc.com, time.com, cdc.gov, nih.gov, xnxx.com, github.com,