- Knowledge Bases (KBs) are effective tools for Question Answering (QA) but are often too restrictive (due to fixed schema) and too sparse (due to limitations of Information Extraction (IE) systems).
- The paper proposes Key-Value Memory Networks, a neural network architecture based on Memory Networks that can leverage both KBs and raw data for QA.
- The paper also introduces MOVIEQA, a new QA dataset that can be answered by a perfect KB, by Wikipedia pages and by an imperfect KB obtained using IE techniques thereby allowing a comparison between systems using any of the three sources.
- Link to the paper.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import numpy as np | |
| from keras.layers import GRU, initializations, K | |
| from collections import OrderedDict | |
| class GRULN(GRU): | |
| '''Gated Recurrent Unit with Layer Normalization | |
| Current impelemtation only works with consume_less = 'gpu' which is already | |
| set. | |
| # Arguments |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """ Trains an agent with (stochastic) Policy Gradients on Pong. Uses OpenAI Gym. """ | |
| import numpy as np | |
| import cPickle as pickle | |
| import gym | |
| # hyperparameters | |
| H = 200 # number of hidden layer neurons | |
| batch_size = 10 # every how many episodes to do a param update? | |
| learning_rate = 1e-4 | |
| gamma = 0.99 # discount factor for reward |
- act2vec, trace2vec, log2vec, model2vec https://link.springer.com/chapter/10.1007/978-3-319-98648-7_18
- apk2vec https://arxiv.org/abs/1809.05693
- app2vec http://paul.rutgers.edu/~qma/research/ma_app2vec.pdf
- ast2vec https://arxiv.org/abs/2103.11614
- attribute2vec https://arxiv.org/abs/2004.01375
- author2vec http://dl.acm.org/citation.cfm?id=2889382
- baller2vec https://arxiv.org/abs/2102.03291
- bb2vec https://arxiv.org/abs/1809.09621
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Example for my blog post at: | |
| # http://danijar.com/introduction-to-recurrent-networks-in-tensorflow/ | |
| import functools | |
| import sets | |
| import tensorflow as tf | |
| def lazy_property(function): | |
| attribute = '_' + function.__name__ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """ | |
| Possibly correct implementation of an all conv neural network using a single residual module | |
| This code was written for instruction purposes and no attempt to get the best results were made. | |
| References: | |
| Deep Residual Learning for Image Recognition: http://arxiv.org/pdf/1512.03385v1.pdf | |
| STRIVING FOR SIMPLICITY, THE ALL CONVOLUTIONAL NET: http://arxiv.org/pdf/1412.6806v3.pdf | |
| A video walking through the code and main ideas: https://youtu.be/-N_zlfKo4Ec |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def get_H_n(X): | |
| return X[:, -1, :] # get last element from time dim | |
| def get_Y(X): | |
| return X[:, :110, :] # get first xmaxlen elem from time dim | |
| def get_R(X): | |
| Y, alpha = X.values() # Y should be (L,k) and alpha should be (L,) and ans should be (k,) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python | |
| # coding: utf-8 | |
| """Sampling Sequence Data from model""" | |
| import numpy as np | |
| import tensorflow as tf | |
| import json | |
| import cPickle as pickle | |
| import itertools as it | |
| from rnnlib import PTBModel |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| '''This scripts implements Kim's paper "Convolutional Neural Networks for Sentence Classification" | |
| with a very small embedding size (20) than the commonly used values (100 - 300) as it gives better | |
| result with much less parameters. | |
| Run on GPU: THEANO_FLAGS=mode=FAST_RUN,device=gpu,floatX=float32 python imdb_cnn.py | |
| Get to 0.853 test accuracy after 5 epochs. 13s/epoch on Nvidia GTX980 GPU. | |
| ''' | |
| from __future__ import print_function |