Giter Site home page Giter Site logo

spherere's Introduction

SphereRE: Distinguishing Lexical Relations with Hyperspherical Relation Embeddings

By Chengyu Wang (https://chywang.github.io)

Introduction: This software does supevised lexical relation classification based on word embeddings. The model learns representations of lexical relation triples by mapping them to the hyperspherical embedding space, where relation triples of different lexical relations are well separated. The types of lexical relations are classified based on hyperspherical relation embeddings and classifical word embeddings.

Paper

  1. Wang et al. SphereRE: Distinguishing Lexical Relations with Hyperspherical Relation Embeddings. ACL 2019

APIs

  1. GenerateLabelMap.py: Establish the mappings between lexical relation types and class indices.

  2. TrainProj.py: Train the linear projection models for each lexical relation type.

  3. TrainInitialLR.py: Train the logisitic regression classifier for lexical relation classification in the intial stage.

  4. PredictInitLabelProb.py: Predict label probabilities for the testing data.

  5. TransductiveSample.py: Sample data sequences for SphereRE learning.

  6. RelationEmbedLearn.py: Learn SphereRE vectors.

  7. TrainFinalNN.py: Train the final neural network for lexical relation classification and make predictions over the testing set.

Notes

  1. Due to the large size of neural language models, we do not provide the fastText model in this project. Please use your own neural language model instead, if you would like to try the algorithm over your datasets.

  2. The example dataset is BLESS. Other datasets mentioned in the paper are also publicly available.

Dependencies

The main Python packages that we use in this project include but are not limited to:

  1. gensim: 2.0.0
  2. numpy: 1.15.4
  3. scikit-learn: 0.18.1

The codes can run properly under the packages of other versions as well.

More Notes on the Algorithm

This is a slightly updated version of the algorithm of our ACL 2019 paper. The produced results can be a little bit higher than the results reported in the original paper.

Citations

If you find this software useful for your research, please cite the following paper.

@inproceedings{acl2019,
   author = {Chengyu Wang and Xiaofeng He and Aoying Zhou},
   title = {SphereRE: Distinguishing Lexical Relations with Hyperspherical Relation Embeddings},
   booktitle = {Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics},
   pages = {1727--1737},
   year = {2019}
}

More research works can be found here: https://chywang.github.io.

spherere's People

Contributors

chywang avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

freekang

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.