← all repositories
huggingface/hmtl

One model, four NLP tasks, stacked like pancakes

A 2018 Hugging Face project that trains a single PyTorch network to do entity recognition, mention detection, relation extraction, and coreference resolution simultaneously.

1.2k stars Python Language ModelsML Frameworks
hmtl
Velocity · 7d
+0.4
★ / day
Trend
steady
star history

What it does

HMTL is a multi-task learning system built on PyTorch and AllenNLP that jointly trains four semantic NLP tasks: Named Entity Recognition, Entity Mention Detection, Relation Extraction, and Coreference Resolution. The hierarchy means lower layers handle simpler patterns while upper layers tackle more complex representations—tested with Facebook’s SentEval to verify the progression.

The interesting bit

The authors claim state-of-the-art results on three of the four tasks (all except coreference), and the architecture itself is the selling point: shared embeddings and encoders with task-specific heads stacked vertically, so each layer’s output feeds the next. It’s less “clever trick” and more “careful engineering of what to share and when.”

Key highlights

  • Pre-trained weights and a web demo are available (requires git lfs pull)
  • Training is config-driven via JSON files; AllenNLP handles the plumbing
  • Includes SentEval integration to probe what each hierarchical layer actually learns
  • Setup script installs Python 3.6, virtualenv, and dependencies automatically
  • Accepted at AAAI 2019; authors include Victor Sanh, Thomas Wolf, and Sebastian Ruder

Caveats

  • Training data is not included: OntoNotes 5.0, CoNLL2003, and ACE2005 must be sourced separately due to licensing
  • Python 3.6 and specific dependency versions are locked; the README warns to “adapt the script depending on your needs”
  • TensorBoard logging is supported but requires manual TensorFlow installation

Verdict

Worth a look if you’re researching multi-task architectures or need a reproducible baseline for semantic NLP stacks. Skip it if you want a batteries-included, train-on-your-data-today solution—the data licensing friction and AllenNLP config overhead are real.

heatdrop uses Google Analytics to see which pages get read — nothing else. Your call. How we handle data.