Skip to main content

Pytorch and Tensorflow implemention of box embedding models

Project description

Open-source library for Box Embeddings and Box Representations, built on PyTorch & TensorFlow.


Tests Typing/Doc/Style Binder


Installing via pip

The preferred way to install Box Embeddings is via pip. Just run pip install box-embeddings

Installing from source

You can also install Box Embeddings by cloning our git repository

git clone

Create a Python 3.7 or 3.8 virtual environment, and install Box Embeddings in editable mode by running:

pip install --editable . --user
pip install -r core_requirements.txt

Package Overview

Command Description
box_embeddings An open-source library for NLP or graph learning
box_embeddings.common Utility modules that are used across the library
box_embeddings.initializations Initialization modules
box_embeddings.modules A collection of modules to operate on boxes
box_embeddings.parameterizations A collection of modules to parameterize boxes


  1. If you use simple hard boxes with surrogate loss then cite the following paper:
  title={Probabilistic Embedding of Knowledge Graphs with Box Lattice Measures},
  author={Vilnis, Luke and Li, Xiang and Murty, Shikhar and McCallum, Andrew},
  booktitle={Proceedings of the 56th Annual Meeting of the Association for
  Computational Linguistics (Volume 1: Long Papers)},
  1. If you use softboxes without any regularizaton the cite the following paper:
title={Smoothing the Geometry of Probabilistic Box Embeddings},
author={Xiang Li and Luke Vilnis and Dongxu Zhang and Michael Boratko and Andrew McCallum},
booktitle={International Conference on Learning Representations},
  1. If you use softboxes with regularizations defined in the Regularizations module then cite the following paper:
title={Representing Joint Hierarchies with Box Embeddings},
author={Dhruvesh Patel and Shib Sankar Dasgupta and Michael Boratko and Xiang Li and Luke Vilnis
and Andrew McCallum},
booktitle={Automated Knowledge Base Construction},
  1. If you use Gumbel box then cite the following paper:
  title={Improving Local Identifiability in Probabilistic Box Embeddings},
  author={Dasgupta, Shib Sankar and Boratko, Michael and Zhang, Dongxu and Vilnis, Luke
  and Li, Xiang Lorraine and McCallum, Andrew},
  journal={arXiv preprint arXiv:2010.04831},

The code for this library can be found here.



We welcome all contributions from the community to make Box Embeddings a better package. If you're a first time contributor, we recommend you start by reading our guide.


Box Embeddings is an open-source project developed by the research team from the Information Extraction and Synthesis Laboratory at the College of Information and Computer Sciences (UMass Amherst).

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

box_embeddings-0.1.0.tar.gz (31.6 kB view hashes)

Uploaded Source

Built Distribution

box_embeddings-0.1.0-py3-none-any.whl (61.0 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page