Coder Social home page Coder Social logo

nlpathits / figet-hyperbolic-space Goto Github PK

View Code? Open in Web Editor NEW
35.0 6.0 1.0 2.84 MB

Code for the paper "Fine-Grained Entity Typing in Hyperbolic Space"

License: MIT License

Python 97.64% Shell 2.36%
nlp figet entity-typing entity-types hyperbolic-geometry hyperbolic-distance hyperbolic-space fine-grained-classification fine-grained-entity-typing graph-embeddings

figet-hyperbolic-space's Introduction

Fine-Grained Entity Typing in Hyperbolic Space

Code for the paper "Fine-Grained Entity Typing in Hyperbolic Space" published at RepL4NLP @ ACL 2019

Model overview:

Citation

The source code and data in this repository aims at facilitating the study of fine-grained entity typing. If you use the code/data, please cite it as follows:

@inproceedings{lopez-etal-2019-fine,
    title = "Fine-Grained Entity Typing in Hyperbolic Space",
    author = "L{\'o}pez, Federico  and
      Heinzerling, Benjamin  and
      Strube, Michael",
    booktitle = "Proceedings of the 4th Workshop on Representation Learning for NLP (RepL4NLP-2019)",
    month = aug,
    year = "2019",
    address = "Florence, Italy",
    publisher = "Association for Computational Linguistics",
    url = "https://www.aclweb.org/anthology/W19-4319",
    pages = "169--180",
}

Dependencies

  • PyTorch 1.1
  • tqdm
  • tensorboardX
  • pyflann

A conda environment can be created as well from the environment.yml file.

To embed the graphs into the different metric spaces the library Hype was used.

Running the code

1. Download data

Download and uncompress Ultra-Fine dataset and GloVe word embeddings:

./scripts/figet.sh get_data

2. Preprocess data

The parameter freq-sym can be replaced to store different preprocessing configurations:

./scripts/figet.sh preprocess freq-sym

3. Train model

The name of the preprocessing used in the previous step must be given as a parameter.

./scripts/figet.sh train freq-sym

3. Do inference

./scripts/figet.sh inference freq-sym

Acknowledgements

We thank to Choi et al for the release of the Ultra-Fine dataset and their model.

License

MIT

figet-hyperbolic-space's People

Contributors

fedelopez77 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

Forkers

sxrczh

figet-hyperbolic-space's Issues

Run on custom dataset

Hi,
Thank you for releasing such a nice and easy to use code.
I wanted to ask about procedure to get predictions on a custom dataset. From what I understand infer.py computes all f-scores on top of predictions using figet.Coach. I believe this line would allow me get fine grained predictions and I should dump them. Is it correct?

Also for dataset formatting, I should pass the sentences to a NER model and format it in form of left_context, mention_span, right_context right?

Speed-up the validate phase

Hi,

I'm training your model using a different target space.

I'm noticing a very long computation time in the validate-typing-dev-# phase (15 minutes per epoch when the target space has 63 labeled vectors, 48 minutes when the types are approximately 200).

I know that in this phase the pyFLANN library is used an I think that is the Nearest Neighbor algorithm that slows down this phase.

Since the original dataset presents more than 8k types in the target space I think that you speed up this phase (or maybe I'm missing something in the code, but I didn't touch anything in the validation code) so I am here to ask if there is some method to speed up the training phase.

Thanks

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.