Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/anthonymrios/pyclausie
Python wrapper for ClausIE.
https://github.com/anthonymrios/pyclausie
nlp open-information-extraction python relation-extraction
Last synced: 3 months ago
JSON representation
Python wrapper for ClausIE.
- Host: GitHub
- URL: https://github.com/anthonymrios/pyclausie
- Owner: AnthonyMRios
- Created: 2015-01-17T23:54:28.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2021-08-27T23:41:56.000Z (over 3 years ago)
- Last Synced: 2023-03-22T12:18:51.432Z (almost 2 years ago)
- Topics: nlp, open-information-extraction, python, relation-extraction
- Language: Python
- Size: 27.3 KB
- Stars: 27
- Watchers: 3
- Forks: 12
- Open Issues: 4
-
Metadata Files:
- Readme: README.rst
- License: LICENSE-2.0.txt
Awesome Lists containing this project
README
pyclausie
=========Python wrapper around
`ClausIE `_.
This will take a list of sentences and return a list of triples.How to Install
-------------->>> python setup.py install
Example Usage
-------------To start you must create a ClausIE instance from the pyclausie package.
::
>>> from pyclausie import ClausIE
>>> cl = ClausIE.get_instance()``get_instance()`` will automatically download the clausie jar file.
If you have an existing clausie jar file you can specifiy the file
using the jar_filename parameter.To extract triples from a sentence use the ``extract_triples()``
method. This method takes a list of sentences as input and will return
a list of Triple objects.
::
>>> sents = ['I learned that the 2012 Sasquatch music festival is '
... 'scheduled for May 25th until May 28.']
>>> triples = cl.extract_triples(sents)
>>> for triple in triples:
... print triple
Triple(index='1', subject='I', predicate='learned', object='that the 2012 Sasquatch music festival is scheduled for May 25th until May 28')
Triple(index='1', subject='the 2012 Sasquatch music festival', predicate='is scheduled', object='for May 25th until May 28')
Triple(index='1', subject='the 2012 Sasquatch music festival', predicate='is scheduled', object='for May 25th')This shows three triples returned by clausie for the given sentence.
If you wish to get the confidence score you should pass the parameter
``print_sent_confidence=True`` to the ``extract_triples()`` method.More Information
----------------Licensed under `Apache 2.0 `_.
Written by Anthony Rios