Code Monkey home page Code Monkey logo

relation_classification_nlp's Introduction

Relation_Classification_NLP

Given 10 predefined relations like cause-effect, product-producer, etc, the goal is to define the relation and the direction of the relation between 2 entities in a sentence. The implemtation consists of a basic BiGRU model and a CNN model with outperforms the basic model.

The CNN model has been used as even after adding POS and dependency features the CNN model outperforms the biGRU model (basic model).The convolution layer is defined using keras layer implementation of Conv1D and max-pool using keras layer implementation of GlobalMaxPool1D. Define decoder using its keras layer implementation. In the call function, first the window processing is done using embedding_lookup for word and pos embeddings. Then we concatenate word and pos embeddings and then apply convolution on the concatenated output. Then max-pooling is done by calling the previously defined max_pool layer. At last, we extract sentence level features using the previously defined decoder.

The CNN model has been implemented with one convolutional layer. The architecture details are described in below Figure.

Observations (CNN Model):

Regularization lambda value when set to (10)^(-4):
 - Val loss for last epoch (09): 2.0366
 - Val F1 score: 0.5981
Training the model for word embeddings and dependency features:
 - Val loss for epoch: 2.0204
 - Val F1 score: 0.6044
Training the model for word embeddings and POS features:
 - Val loss for epoch: 2.323
 - Val F1 score: 0.5065
The prediction files for each have been uploaded.

relation_classification_nlp's People

Contributors

trisha11r avatar

Watchers

 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.