GitHunt
GE

germanattanasio/relationship-extraction-python

:snake: Sample Python Application for the IBM Watson Relationship Extraction Service

Relationship Extraction Python Sample

The IBM Watson Relationship Extraction service parses sentences into their various components and detects relationships between the components. It can process new terms (like people's names in a news feed) it has never analyzed before through contextual analysis. Sentence components include parts of speech (noun, verb, adjective, conjunction, etc.) and functions (subjects, objects, predicates, etc.). The service maps the relationships between the components so that users or analytics engines can more easily understand the meaning of individual sentences and documents.

Getting Started

In order to run the application in your local environment you will have to install the dependencies listed in requirements.txt.

pip install -r requirements.txt

requests is being used to call the Relationship Extraction API.

Usage

Simple text analysis:

echo "New York is awesome" | python main.py

You can also pipe a file:

cat article.txt | python main.py

From .txt to .xml:

cat article.txt | python main.py > article.xml

License

This library is licensed under Apache 2.0. Full license text is
available in COPYING.

Open Source @ IBM

Find more open source projects on the IBM Github Page

Languages

Python100.0%

Contributors

Apache License 2.0
Created March 10, 2015
Updated January 26, 2025
germanattanasio/relationship-extraction-python | GitHunt