Skip to content

Releases: yzhangcs/parser

SuPar v1.1.4

28 Dec 16:54
Compare
Choose a tag to compare

Release Notes

This release is meant to fix the following issues:

  • Fix incorrect masking of ConstituencyCRF
  • Handle single-root case in MatrixTree
  • Retain the computational graph for marginals

We also add implementations of sparsemax and SparsemaxSemiring (see details in Martins et al. 2016 and Rush et al. 2020).

SuPar v1.1.3

25 Oct 12:40
Compare
Choose a tag to compare

Release Notes

Highlights

We add implementations of many structured prediction algorithms presented in the form of torch.disrtibutions and semiring notations1, including

Take LinearChainCRF as an example:

>>> from supar import LinearChainCRF
>>> batch_size, seq_len, n_tags = 2, 5, 4
>>> lens = torch.tensor([3, 4])
>>> value = torch.randint(n_tags, (batch_size, seq_len))
>>> s1 = LinearChainCRF(torch.randn(batch_size, seq_len, n_tags),
                        torch.randn(n_tags+1, n_tags+1),
                        lens)
>>> s2 = LinearChainCRF(torch.randn(batch_size, seq_len, n_tags),
                        torch.randn(n_tags+1, n_tags+1),
                        lens)
>>> s1.max
tensor([4.4120, 8.9672], grad_fn=<MaxBackward0>)
>>> s1.argmax
tensor([[2, 0, 3, 0, 0],
        [3, 3, 3, 2, 0]])
>>> s1.log_partition
tensor([ 6.3486, 10.9106], grad_fn=<LogsumexpBackward>)
>>> s1.log_prob(value)
tensor([ -8.1515, -10.5572], grad_fn=<SubBackward0>)
>>> s1.entropy
tensor([3.4150, 3.6549], grad_fn=<SelectBackward>)
>>> s1.kl(s2)
tensor([4.0333, 4.3807], grad_fn=<SelectBackward>)

Bug fixes

  • Fix bug of model saving (#82)
  • Fix issue of stride setting for small BERT (#86)
  • Fix preprocessing crashes for some UD treebanks (#85)
  1. The implementations of structured distributions and semirings are heavily borrowed from torchstruct with some tailoring. For more details, see their tutorial paper and Goodman's paper.

SuPar v1.1.2

23 Jul 10:43
Compare
Choose a tag to compare

Release Notes

  • ELMo support
  • Checkpoint support
  • Dataloader now yields Batch objects
  • Fix con name conflict in Windows system (#74)

SuPar v1.1.1

12 May 06:06
Compare
Choose a tag to compare
Keep the version

SuPar v1.1.0

26 Apr 17:16
Compare
Choose a tag to compare

Release Notes

New Features

  • Built-in tokenizers (#47)
  • Variational Inference methods
    • Mean Field Variational Inference
    • Loopy Belief Propagation
  • Semantic Dependency Parsers
    • Biaffine
    • MFVI/LBP
  • Model finetuning

Bug Fixes

  • Fix issue of building nltk.Tree from string with parentheses (#59, #65)

Available Parsers

SuPar v1.0.0

23 Aug 18:10
Compare
Choose a tag to compare

Release Notes

Released Models

The following parsers are released in SuPar package and the corresponding English/Chinese pretrained models can be found in the attachments.

References