Giter Site home page Giter Site logo

jingshuangliu22 / stanford-openie-python Goto Github PK

View Code? Open in Web Editor NEW

This project forked from philipperemy/stanford-openie-python

0.0 2.0 0.0 62.89 MB

Stanford Open Information Extraction - Python Wrapper

License: ISC License

Python 98.40% Shell 1.60%

stanford-openie-python's Introduction

Python wrapper for Stanford OpenIE

The unofficial cross-platform Python wrapper for the state-of-art information extraction library from Stanford University.

NOTE: Windows is not currently supported! Works on UNIX systems like Linux and Mac OS.

About Stanford IE

Open information extraction (open IE) refers to the extraction of structured relation triples from plain text, such that the schema for these relations does not need to be specified in advance. For example, Barack Obama was born in Hawaii would create a triple (Barack Obama; was born in; Hawaii), corresponding to the open domain relation "was born in". This software is a Java implementation of an open IE system as described in the paper:

Gabor Angeli, Melvin Johnson Premkumar, and Christopher D. Manning. Leveraging Linguistic Structure For Open Domain Information Extraction. In Proceedings of the Association of Computational Linguistics (ACL), 2015. The system first splits each sentence into a set of entailed clauses. Each clause is then maximally shortened, producing a set of entailed shorter sentence fragments. These fragments are then segmented into OpenIE triples, and output by the system.

More information can be found here : http://nlp.stanford.edu/software/openie.html

Usage

First of all, make sure Java 1.8 is installed. Open a terminal and run this command to check:

java -version

If this is not the case and if your OS is Ubuntu, you can install it this way:

sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java8-installer

The code can be invoked either programmatically or through the command line. The program can be invoked with the following command. It will display [['Barack Obama', ' was', ' born'], ['Barack Obama', ' was born in', ' Hawaii']]

git clone https://github.com/philipperemy/Stanford-OpenIE-Python.git
cd Stanford-OpenIE-Python
echo "Barack Obama was born in Hawaii." > samples.txt
python main.py -f samples.txt

Generate Graph

echo "Barack Obama was born in Hawaii." > samples.txt
python main.py -f samples.txt -g

Will generate a GraphViz DOT graph and its related PNG file in /tmp/openie/



Note: Make sure GraphViz is installed beforehand. Try to run the dot command to see if this is the case. If not, run sudo apt-get install graphviz if you're running on Ubuntu.

Support

You can either open an Issue or send me a e-mail to [email protected]. Any contributions are welcomed!

stanford-openie-python's People

Contributors

philipperemy avatar

Watchers

 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.