GithubHelp home page GithubHelp logo

relationextraction's Introduction

Relation Extraction

This library implements an approach to extract RDF relations from a given sentence.

Requirements

Java 8, Maven 3

Example

Input:

Barack Obama is married to Michelle Obama.

Output:

<http://dbpedia.org/resource/Barack_Obama> <http://dbpedia.org/ontology/spouse> <http://dbpedia.org/resource/Michelle_Obama>.

Config

A sample config file

{
  "learn":{
    "window": 2,
    "bayes": 1.0,
    "neighbour": 20
  },
  "mongo":{
    "hostname":"...",
    "port": 12345,
    "credentials":{
      "name":"username",
      "password":"password"
    },
    "database":"..."
  }
}

Description for learn:

  • window: the number of feature used left to the first entity and right to the last entity
  • bayes: the bayes smoothing parameter for unknown features
  • neighbour: the number of nearest neighbours to select

How to use

The project consists of three main entry points:

  1. RelationExtraction.java
  2. ExtractionTester.java
  3. FileExtractor.java

Relation Extraction

This project can be start up by giving a path to a configuration file. If the path is invalid or not given, then it will start up with a default configuration. The script will train a model on a set of training data. The created model will then be evaluated. Output:

  • F1 score for each relation
  • Precision for each relation
  • Recall for each relation
  • The overall precision

Extraction Tester

This project can be start up by giving a path to a configuration file. If the path is invalid or not given, then it will start up with a default configuration. The script will train a model. Then the user can give input sentences. The script will print found relations in Turtle format.

File Extractor

To start the script you have to provide the following arguments:

  1. a config file
  2. input path for file containing sentences
  3. output path for the found relations in Turtle format

This script do the same as the extraction tester but can automatically process a bunch of input sentences.

relationextraction's People

Contributors

cedricrupb avatar zain-malik 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.