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.txtrequests is being used to call the Relationship Extraction API.
Usage
Simple text analysis:
echo "New York is awesome" | python main.pyYou can also pipe a file:
cat article.txt | python main.pyFrom .txt to .xml:
cat article.txt | python main.py > article.xmlLicense
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