Ross ROSS = Recommend OSS · open-source software intelligence for agents

harvardnlp/pytorch-struct

Fast, general, and tested differentiable structured prediction in PyTorch observed · 2026-08-28

github.com/harvardnlp/pytorch-struct · homepage · Jupyter Notebook · MIT (permissive) observed · 2026-08-28

Health v2 · maintenance only

23/100

  • Activity 0
  • Release rhythm 8
  • Longevity 100
How is this computed?

round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10) — computed 2026-09-03. Adoption (stars, forks) is never an input.

  • gap_med: n/a
  • age_days: 2564
  • days_rel: n/a
  • days_push: 1596
  • n_releases_24m: 0

Full methodology

Adoption not part of the score

1133 stars · 93 forks observed · 2026-08-28

What it is AI-extracted, prompt v1, taxonomy v1, 2026-08-30, confidence not recorded

Torch-Struct is a PyTorch library of tested, GPU-accelerated implementations of core structured prediction algorithms such as CRFs, HMMs, HSMMs, dependency tree CRFs, and PCFGs. It is designed to be used as efficient batched layers inside other deep learning models, providing marginals, argmax, sampling, entropy, and partition computations.

Use cases

  • compute differentiable marginals for linear-chain CRFs in PyTorch
  • train hidden Markov models with deep learning models
  • implement dependency parsing with a tree CRF layer
  • run inside-outside algorithms for probabilistic context-free grammars
  • sample and compute argmax from structured distributions on GPU
  • add semi-Markov CRF segmentation layers to a neural network

When to choose

  • you need differentiable structured prediction layers (CRF, HMM, PCFG) in PyTorch
  • you want batched, GPU-accelerated dynamic programming for sequence or tree structures
  • you need marginals, argmax, sampling, or log-partition for structured models

When to avoid

  • you need structured prediction in TensorFlow, JAX, or non-PyTorch frameworks
  • you need actively maintained software with recent releases
  • your models only involve unstructured classification or regression

Facets

library · maturity maintenance

machine-learning deep-learning nlp machine-learning deep-learning python structured-prediction pytorch crf hmm pcfg dependency-parsing differentiable-computation natural-language-processing gpu

2 sources

Member repositories

RepositoryRoleHealth v2
harvardnlp/pytorch-structmain23

For agents

markdown · JSON · MCP: product_card(name="harvardnlp/pytorch-struct")

Data as of 2026-08-30T08:39:29.467469+00:00 · Report a problem