Skip to content

CatalystCode/ClausIE-Server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ClausIE-Server

CI status Docker status

What's this?

This repository contains a dockerized web service to quickly get started with Open Information Extraction (OpenIE).

The web service is implemented in Spark Java and wraps the ClausIE OpenIE tool created by the Max Planck Institute.

Usage

First, run the ClausIE-Server via docker:

docker run -d -p 4567:4567 cwolff/clausieserver

Second, prepare an input file with text to process via OpenIE. The file should have one sentence per line:

AE remained in Princeton until his death.
AE is a scientist of the 20th century.
AE has won the Nobel Prize in 1921.

Next, call the ClausIE-Server. The file with the input text should be passed as multipart/form-data under the form key upload:

curl -F "upload=@sentences.txt" "http://localhost:4567/openie/form"

The service will respond with the OpenIE relations extracted from the sentences in JSON-object per line format. Note that one sentence may produce multiple relations:

{"argument":"in Princeton until his death","line":0,"subject":"AE","relation":"remained"}
{"argument":"in Princeton","line":0,"subject":"AE","relation":"remained"}
{"argument":"death","line":0,"subject":"his","relation":"has"}
{"argument":"a scientist of the 20th century","line":1,"subject":"AE","relation":"is"}
{"argument":"a scientist","line":1,"subject":"AE","relation":"is"}
{"argument":"the Nobel Prize in 1921","line":2,"subject":"AE","relation":"has won"}

License