Skip to content

malllabiisc/sictf

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Relation Schema Induction

Given a set of documents from a specific domain (e.g., medical research journals), how do we automatically build a Knowledge Graph (KG) for that domain? Automatic identification of relations and their schemas, i.e., type signature of arguments of relations (e.g., undergo(Patient, Surgery)), is an important first step towards this goal. We refer to this problem as Relation Schema Induction (RSI).

SICTF

SICTF solves the problem of Relation Schema Induction, defined below. Given the surface triples as a Tensor, Noun Phrase Side Information as a Matrix and Relation similarity as a Matrix, SICTF performs a joint factorization.

Setup:

To get the project's source code, clone the github repository:

$ git clone https://github.com/malllabiisc/sictf.git

Install VirtualEnv in python3 using the following (optional):

$ [sudo] apt-get install python3-pip
$ [sudo] pip3 install virtualenv 

Create and activate your virtual environment (optional):

$ virtualenv venv
$ source venv/bin/activate

Install all the required packages (dependencies):

$ pip3 install -r requirements.txt

Dependencies:

Please install the following dependencies for SCITF to run: numpy, scipy, scikit-learn, joblib, python3.3 or above.

Usage:

To use sictf, you can start with these following samples commands:

$ python3 tensorCreatorForCNNRescalWithScores.py ../Data/Medline/ Triples.txt NpSideInfo.txt RelSim.txt
$ python3 runCRescal.py outfolder 10 10 1 3 3 20 False 0.1 0.1 0.1 0.1 0.1

Help

Help for running the setup.

Place the triples and side information in a folder at the same level as *.py scripts

Run the Following commands sequentially afterwards ( with -h flag for help)

python3 tensorCreatorForCNNRescalWithScores.py

usage: tensorCreatorForCNNRescalWithScores.py [-h] inputFolder fname sideInfoMatrix relSim

positional arguments:

  • inputFolder -- Enter the name of folder which containts the data file
  • fname -- Enter name of the file that is the source of triplets
  • sideInfoMatrix -- Enter the name the file that contains side information
  • relSim -- Enter the name of the file that contains Verb phrase Similarity information

optional arguments:

-h, --help show this help message and exit

##########

python3 runCRescal.py -h

usage: runCRescal.py [-h] outputFolderName minRank maxRank step Top TopRC maxIters fitFlag lA lR lV Ws Wrs

positional arguments:

  • outputFolderName -- Enter the name of the Output Folder :
  • minRank -- Enter Rank for min Rescal Decomposition :
  • maxRank -- Enter Rank for max Rescal Decomposition :
  • step -- Enter step for Rank (Please ensure minRank +n*step = maxRank):
  • Top -- Enter cut-off for top Entities:
  • TopRC -- Enter cut-off for top RelMatrix Entries:
  • maxIters -- Enter Max no. of iterations:
  • fitFlag -- Enter True is fit computation desired, False if not, None for uncertainity (Advised to keep as False)
  • lA -- Enter Lambda A
  • lR -- Enter Lambda R
  • lV -- Enter Lambda V
  • Ws -- Enter Side Info term weight
  • Wrs -- Enter Relation Similarity term weight

optional arguments:

  • -h, --help show this help message and exit

Reference

[1] Madhav Nimishakavi, Uday Singh Saini and Partha Talukdar. Relation Schema Induction using Tensor Factorization with Side Information. November 2016. Proceedings of the 2016 Conference on Empirical Methods in Natural Language Processing (EMNLP 2016).

About

Relation Schema Induction using SICTF

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages