Coder Social home page Coder Social logo

nlp-deep-learning's Introduction

Deep learning for relation extraction example

See https://backtick.se/blog/nlp-relation-extraction

Proof of concept. Needs a larger training set.

Installation

Requires Docker, Tested with Python 3.6.2. Note that Tensorflow does not support Python 3.7 yet.

pip install -r req.txt

Running

# start StanfordCoreNLP service on port 9000
docker-compose up -d

# Train model
python train.py

# Give it a sentence
python predict.py "I was impressed by the battery life"

# outputs:

      -  b.DESC  b.ENT  i.DESC  i.ENT       word    vote
---------------------------------------------------------      
0  0.51    0.12   0.28    0.07   0.03          I       -
1  0.70    0.03   0.14    0.07   0.06        was       -
2  0.03    0.94   0.01    0.02   0.00  impressed  b.DESC
3  0.85    0.04   0.04    0.04   0.03         by       -
4  0.78    0.02   0.02    0.12   0.06        the       -
5  0.06    0.13   0.61    0.17   0.03    battery   b.ENT
6  0.24    0.01   0.06    0.09   0.60       life   i.ENT

nlp-deep-learning's People

Contributors

oskarhandmark 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.