Giter Club home page Giter Club logo

relation_extraction's Introduction

Relation_Extraction

Relation Classification via Convolutional Deep Neural Network

The code is an implementation of the paper http://www.aclweb.org/anthology/C14-1220 using tensorflow.

##Algorithm

  • I almost followed the technique used in the paper mentioned above, only tweaking with some parameters such as dimensions of word vector, position vectors, optimization function and so on.
  • Basic architecture is a convolution layer, max pool and final softamx layer. We can always add/delete the number of conv and max-pool layers b/w the input layer and the final softmax layer. I used only 1 conv and 1 max pool.

##Files

  • text_cnn.py - It is a class which implements the architecture of the model. So it accepts the input, contains all the layers such as conv2d(convolution layer), max_pool etc. which process the input vector and finally gives the output in terms of predictions for each class.
  • data_helpers.py - It is a generic script which contains helpers such as generating batches, loading the training data etc.
  • train.py - This module creates the input vector from the training data, and finally trains the model on the data and saves it on the disk.
  • temp.py - This is a pyspark code used to fetch data from the HBase table and predict the class of each row using the trained model.

##Challenges

  • My training data is around 7K rows. Due to this, the accuracy is around 70.34% on the test set. So as the training set grows, I'm sure the model will perform much better.
  • My data set consists of inter sentencial entities with entities linked with a cause-effect relationship. However, this model can extended to a n class problem.

##TODO

  • Use RNNs maybe LSTMS for the training.
  • Fine tuning the model.

###PYSPARK can now be used with TensorFlow for online training and testing. In my case I am using pysark for online testing.

relation_extraction's People

Contributors

wadhwasahil avatar

Watchers

 avatar  avatar  avatar

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.