profile
viewpoint

allenai/allennlp 9154

An open-source NLP research library, built on PyTorch.

allenai/acl2018-semantic-parsing-tutorial 377

Materials from the ACL 2018 tutorial on neural semantic parsing

allenai/allennlp-as-a-library-example 108

A simple example for how to build your own model using AllenNLP as a dependency.

allenai/allennlp-semparse 63

A framework for building semantic parsers (including neural module networks) with AllenNLP, built by the authors of AllenNLP

allenai/allennlp-guide 15

Code and material for the AllenNLP Guide

allenai/deep_qa_experiments 7

Scala framework for running experiments with allenai/deep_qa

allenai/open_vocab_semparse 4

Open vocabulary semantic parsing

push eventnitishgupta/allennlp-semparse

Matt Gardner

commit sha 9df13140c53524fdee05b02d2c5fafdd49227eb8

partially done with function composition

view details

push time in 9 hours

push eventnitishgupta/allennlp-semparse

Matt Gardner

commit sha 0e4ce104b6cd609db040bfa3707b6e686318427b

use * as lisp function for function composition

view details

push time in 16 hours

push eventnitishgupta/allennlp-semparse

Matt Gardner

commit sha c790461a13b0eaaa48fdef0e3c66ad59e80fd113

currying now works

view details

push time in a day

push eventnitishgupta/allennlp-semparse

Matt Gardner

commit sha ab562104ad1e1f76434a3b6cf8bb72032f70c1de

implemented curried execution

view details

push time in 2 days

push eventnitishgupta/allennlp-semparse

Matt Gardner

commit sha a19bee0395a820d681cdf725c0350006bb5ab694

documentation, and syntax changes in test code

view details

push time in 2 days

push eventmatt-gardner/allennlp-semparse

Evan Pete Walsh

commit sha 5bafed1738ad828c08befbb16b6e2142c1bdfef4

update AllenNLP dependency (#28) * update AllenNLP dependency * fixes * less invasive change * update CI Python to 3.8 * revert statelet changes * try different change * remove commented-out code Co-authored-by: Matt Gardner <mattg@allenai.org>

view details

epwalsh

commit sha 1ede5d747a23cb27ab8a620f6f10a1388a08e4e7

tick version for release

view details

push time in 2 days

push eventallenai/allennlp-guide

Derek Chia

commit sha f048de5155905b893771714eb1d8f03792f74305

Update your-first-model.md (#146) typo

view details

push time in 2 days

PR merged allenai/allennlp-guide

Fix typo in your-first-model.md

Fix up a typo

+1 -1

0 comment

1 changed file

DerekChia

pr closed time in 2 days

PullRequestReviewEvent

pull request commentallenai/allennlp

Made Interpret code handle mismatched cases better

I don't know why the GPU check failed, but it looks like it didn't even run. This should be ready for review now. The coverage numbers look lower than they actually are, because some of these things get tested in the models repo. Let me know if you'd like me to add more tests in this PR.

matt-gardner

comment created time in 4 days

push eventmatt-gardner/allennlp

Elad Segal

commit sha ce14bdc09c32067d90910bbeaa02d40ebd703112

Allow usage of .tar.gz with PretrainedModelInitializer (#4709) * Allow usage of .tar.gz with PretrainedModelInitializer * changelog * typing * simplify code with contextmanager * make the code cleaner * fix * change cleanup * fix * fix * fix typing * fix according to review * black and typing * fix * load dataset readers in `load_archive` * black * lint * review fixes * fix * fix * remove unused condition Co-authored-by: Dirk Groeneveld <dirkg@allenai.org>

view details

Elad Segal

commit sha 006bab483426363f2dc1c3bde67bcecab2575b82

Don't use PretrainedModelInitializer when loading a model (#4711) * Don't use PretrainedModelInitializer when loading a model * fix according to review * empty * remove unused condition * changelog * fix test * Adds a function for backwards compatibility Co-authored-by: Dirk Groeneveld <dirkg@allenai.org>

view details

Evan Pete Walsh

commit sha 0e64b4d3281808fac0fe00cc5b56e5378dbb7615

fix docstring for PyTorchSeq2VecWrapper (#4734)

view details

Matt Gardner

commit sha 2e9110d3023cd7810b48e4728e8f02db159eac42

Merge branch 'master' into mismatched_interpret

view details

push time in 4 days

push eventmatt-gardner/allennlp

Matt Gardner

commit sha ee150238fdbef475758d0f25dc71d7155c707e36

changelog

view details

push time in 4 days

push eventmatt-gardner/allennlp

Matt Gardner

commit sha bb69e96a751e6980e748b6b0eaa6a324460f27ae

Add albert to find_embedding_layer heuristics

view details

push time in 4 days

push eventmatt-gardner/allennlp

Matt Gardner

commit sha 0862bfd1799917d1667731ad9612d7b4a3ffc684

more debugging on CI...

view details

push time in 4 days

push eventmatt-gardner/allennlp

Matt Gardner

commit sha c51dadffd866bab57b7c151cb8e50db0f331c8ba

committing some debugging stuff, because I see different behavior locally than I do in CI

view details

push time in 5 days

issue commentallenai/allennlp

Dependabot is running on forks

@schmmd, those are for vulnerabilities, and they are not enabled on my fork.

matt-gardner

comment created time in 5 days

PR opened allenai/allennlp

Made Interpret code handle mismatched cases better

Fixes #4360. The basic problem is that mismatched indexing led to gradients being computed at the top of a transformer, instead of at the end. In order to solve that problem, we need to get gradients at the embedding layer, but aggregate them into token-level gradients. The piece that knows about the mapping from wordpieces to tokens is an offsets dictionary in the TextFieldTensors. We need to pull that out during a forward pass, so that when we get gradients during a backward pass we can aggregate things correctly.

This PR adds a forward hook in places where there was a backward hook, to check for mismatched indexing and return the offsets, if present. It also updates the logic where gradients were processed to combine things in the right way. I would have liked to isolate the changes a little bit more than this, but I didn't see a way to do it; at least the only things that needed to change are the base Predictor and the SaliencyInterpreters, and not any individual model, or anything.

I did not touch any Attackers. Those still might not work with mismatched indexing. But, we have #4355 tracking attacker problems, which I suspect is related, and I'll be looking into that one next, maybe next week.

I think this needs a couple of small tests, so it's not quite ready for review, but I'm running it through CI to see what's missing.

+169 -48

0 comment

5 changed files

pr created time in 5 days

create barnchmatt-gardner/allennlp

branch : mismatched_interpret

created branch time in 5 days

push eventmatt-gardner/allennlp

Evan Pete Walsh

commit sha e0b2e26579ab68da6e0bdcec996996c1177f3975

display class decorators in API docs (#4685)

view details

Evan Pete Walsh

commit sha 17c3b84b3233d118796e0d492fd558f00f336fb6

Fix small typo (#4686)

view details

Michael Schmitz

commit sha eb7f2568037029508aa402ceac7097f9d289d527

Add StackOverflow link to README (#4694)

view details

Evan Pete Walsh

commit sha 3506e3fd2d4a4bc205123f41767b2d005f3c79dc

ensure parameters that are actual dictionaries get logged (#4697)

view details

Elad Segal

commit sha edcb6d3466d2c4263f1e6a5731c6ace5358f47e8

Fix a bug in saving vocab during distributed training (#4705) * is_master bug fix * changelog * remove is_master * changelog

view details

Evan Pete Walsh

commit sha 39ddb523060d34f20c718f4d62d87893a51752a0

CLI improvements (#4692) Co-authored-by: Dirk Groeneveld <dirkg@allenai.org>

view details

Evan Pete Walsh

commit sha 90f003799e9fd6f786f54027441600ac6e871d20

fix reported batch_loss (#4706)

view details

Evan Pete Walsh

commit sha 327188b882b2739855abbc0b2cfd8ea4943297a1

improve memory helper functions (#4699) * improve memory helper functions * fixes Co-authored-by: Dirk Groeneveld <dirkg@allenai.org>

view details

Elad Segal

commit sha 40bb47adcc62b5414ba2166b3ae0bd70cc4dbd42

Load weights to cpu with PretrainedModelInitializer (#4712) * load weights to cpu with PretrainedModelInitializer * changelog

view details

Elad Segal

commit sha c14ea40e8fb700a15b2dc875c3a522295e1a8bed

Save checkpoint before running evaluation (#4704) * save model weights before evaluation * Update CHANGELOG.md * black * Update CHANGELOG.md Co-authored-by: Evan Pete Walsh <epwalsh10@gmail.com> Co-authored-by: Dirk Groeneveld <dirkg@allenai.org>

view details

Evan Pete Walsh

commit sha 001e1f76edfa6ff463a6edb1007e3f92f7c01a56

new way of setting env variables in GH Actions (#4700) Co-authored-by: Dirk Groeneveld <dirkg@allenai.org>

view details

Will Merrill

commit sha 321d4f48f6c14a559386afa4d19ae96b829fd025

TrainerCallback with batch/epoch/end hooks (#4708) * Wrote tests and stuff. But can't test on PC.. * Added TrainerCallback with metaclass that automatically creates Batch/Epoch callbacks wrapping it. * Reformatting. * Changelog * Added type: ignore's * Updated with docstrings. * Refactored _make_callback_type into metaclass. Co-authored-by: Dirk Groeneveld <dirkg@allenai.org>

view details

Evan Pete Walsh

commit sha ae7cf85b8f755f086341a087aeca1ba7c1df3769

automatically find local open port in distributed training (#4696) * auto find open port * fixes * only do on localhost * fix spelling * fix comment * fix Co-authored-by: Dirk Groeneveld <dirkg@allenai.org>

view details

Vikash

commit sha bc6f15accc2392c42d97e2bdee7bcb47a664f597

Fixes rouge metric calculation corrected for distributed training (#4717) * Fixes #4715 : Rouge metric calculation corrected for distributed training * CHANGELOG

view details

jvstokes

commit sha b099b69c72489a0bc25382e3a0009a5f0bb394c8

Add top_k and top_p sampling to BeamSearch (#4695) * Draft of top_k and top_p sampling for beam search * Fixed indexing issue in samplers * small fix for top-k sampler * Beam search passing all tests * Cleaned up beam search PR * remove prints * remove prints in test * merge master in and fix lint * make beam search registrable * Made BeamSearch Registrable * fix documentation in BeamSearch and Samplers * Update allennlp/nn/beam_search.py Co-authored-by: Evan Pete Walsh <epwalsh10@gmail.com> * pushing again * Apply suggestions from code review Co-authored-by: Jackson Stokes <jacksons@Jacksons-MacBook-Pro.local> Co-authored-by: Evan Pete Walsh <epwalsh10@gmail.com>

view details

Elad Segal

commit sha 1ff0658c510abe525c8136eadc62b43968a0c3d6

Added logging for the main process when running in distributed mode (#4710) * Log main process as well when running in distributed mode * changelog Co-authored-by: Dirk Groeneveld <dirkg@allenai.org>

view details

Evan Pete Walsh

commit sha 3a85e3595b71c05fbd9acb014e3d76b5b7dd0bc4

add reasonable timeout to gpu checks job (#4719)

view details

Nicola Sahar

commit sha cccad29addf269d121fe7a5c3c2f202f4cfe867d

Updated AllenNlpTestCase docstring (#4722) * Updated AllenNlpTestCase docstring * Updated CHANGELOG.md

view details

dependabot[bot]

commit sha d3c69f757e73492e6ef13028f208a13264ae26a6

Bump mypy from 0.782 to 0.790 (#4723) * Bump mypy from 0.782 to 0.790 Bumps [mypy](https://github.com/python/mypy) from 0.782 to 0.790. - [Release notes](https://github.com/python/mypy/releases) - [Commits](https://github.com/python/mypy/compare/v0.782...v0.790) Signed-off-by: dependabot[bot] <support@github.com> * make mypy happy Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: epwalsh <epwalsh10@gmail.com>

view details

Evan Pete Walsh

commit sha 24519fd964a469e9443d050d87ace3680135a0f5

fix typehint on checkpointer method (#4726)

view details

push time in 5 days

push eventmatt-gardner/allennlp-models

Matt Gardner

commit sha dbd46b47027e1bd522efaf08ec29bfc978a0a6c4

Add test for sentiment analysis (#117) * Add test for sentiment analysis * changelog

view details

Evan Pete Walsh

commit sha 7c3be82ffa954581fb5249aea5beb106c31a85b4

upgrade to actions cache v2 (#116) Co-authored-by: Dirk Groeneveld <dirkg@allenai.org>

view details

Evan Pete Walsh

commit sha 27c0ca503875b2b36e137c91c896c4f021193292

always run configs CI job (#118) * always run configs CI job * try fix test filters

view details

Akshita Bhagia

commit sha c4ef4c84634d48cc833cdb8d5b9071c668eacd46

Prepare for release v1.1.0rc4

view details

dependabot-preview[bot]

commit sha 31b00e7089e1d563259ab5715ae616352c88981b

Bump markdown-include from 0.5.1 to 0.6.0 (#121) Bumps [markdown-include](https://github.com/cmacmackin/markdown-include) from 0.5.1 to 0.6.0. - [Release notes](https://github.com/cmacmackin/markdown-include/releases) - [Commits](https://github.com/cmacmackin/markdown-include/compare/v0.5.1...v0.6.0) Signed-off-by: dependabot-preview[bot] <support@dependabot.com> Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>

view details

Akshita Bhagia

commit sha 3742b4a0f97a9e1c10b10d9ce17f5950bfca4924

Distributed metrics (#123) * distributed metrics: SquadEmAndF1 * distributed metrics: DropEmAndF1 * update changelog * distributed metrics: MentionRecall * removing comment * changing float to int

view details

Akshita Bhagia

commit sha ce8ef9b33d34a3a30ac565996530ecb4ab581a92

formatting changes for new version of black (#125)

view details

Stefan Schouten

commit sha 2e5444997f416c112c0c6e02cc33175c24982049

Combinable quora sequences (#119) * combinable input fields for quora * import * update changelog * format Co-authored-by: Matt Gardner <mattg@allenai.org>

view details

Tom Sherborne

commit sha 44a3ca594d50c63ec7a7a513d8b28fd17d68c23b

Update BartEncoder docstring for embeddings guidance (#127) * Update BartEncoder docstring for guidance on using BartEncoder with embeddings * Update from PyLint * Update allennlp_models/generation/models/bart.py * Update allennlp_models/generation/models/bart.py Co-authored-by: Matt Gardner <mattg@allenai.org>

view details

Dirk Groeneveld

commit sha 2c2e4e43ba062fb22192d120ed5d01a95a58dab8

Fixes the BERT SRL model (#124) * Fixes the BERT SRL model * Productivity through formatting * changelog * Put the vocab into tags * Productivity through formatting * Formatting * Fix random import * Use newly trained model * Updates test Co-authored-by: Matt Gardner <mattg@allenai.org>

view details

dependabot-preview[bot]

commit sha 36ad6b3396b645930ecf83ca56c1563e0a63310b

Bump conllu from 4.0 to 4.1 (#126) Bumps [conllu](https://github.com/EmilStenstrom/conllu) from 4.0 to 4.1. - [Release notes](https://github.com/EmilStenstrom/conllu/releases) - [Commits](https://github.com/EmilStenstrom/conllu/commits) Signed-off-by: dependabot-preview[bot] <support@dependabot.com> Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>

view details

epwalsh

commit sha 5ffc207250b3111c03ad5e4689d0ca33b7dd1e0f

Prepare for release v1.1.0

view details

tpanza

commit sha 57908bb4d8984ccefd6ab6ebe2cc7e41c4fd973f

allow multiple token embedders, but only use first with non-empty type (#129) * allow multiple token embedders, but only use first with non-empty type * blacken the modified code * update CHANGELOG * Throw an exception if we already know the model isn't going to work. * Checks the config by parsing it Co-authored-by: Anthony P Panza <anthony.p.panza@boeing.com> Co-authored-by: Dirk Groeneveld <dirkg@allenai.org>

view details

Evan Pete Walsh

commit sha 2d7e1f6073aa3c3027fc323f00219d9c80d7b742

Fixes for new transformers release (#130) * fixes for latest transformers version * fix coref fixture * patch to commit * update patch * patch again * Undo core version patch

view details

epwalsh

commit sha 34251927c950a873a5d37169a71b5310a613459e

remove TODO

view details

dependabot-preview[bot]

commit sha a1f9a05314ab742d65f39d5dcb944192a014ab77

Create Dependabot config file (#132) Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>

view details

dependabot-preview[bot]

commit sha 16513bd685f6b143d2937a2044a40b18b886f9b0

Bump conllu from 4.1 to 4.2 (#133) Bumps [conllu](https://github.com/EmilStenstrom/conllu) from 4.1 to 4.2. - [Release notes](https://github.com/EmilStenstrom/conllu/releases) - [Commits](https://github.com/EmilStenstrom/conllu/commits) Signed-off-by: dependabot-preview[bot] <support@dependabot.com> Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> Co-authored-by: Evan Pete Walsh <epwalsh10@gmail.com>

view details

Evan Pete Walsh

commit sha 5fabe32355eebcbb885dacf102311be88842221e

official support Python 3.8 🐍 (#135) * support Python 3.8 * update Dockerfile to 3.8 * drop 3.6 in CI * clean up setup.py

view details

Akshita Bhagia

commit sha 0cb9e0f6190d097d568a2f94a719bd010d12b6be

Model cards update (#136) * adding modelcard template, filling info for transformerqa * updating contact info * updating changelog * ensuring that the template does not show up in list of models

view details

dependabot[bot]

commit sha 436e04785cd1f8193c57db27d56e913e6527e22d

Update mkdocs-material requirement from <5.6.0,>=5.5.0 to >=5.5.0,<6.1.0 (#138) Updates the requirements on [mkdocs-material](https://github.com/squidfunk/mkdocs-material) to permit the latest version. - [Release notes](https://github.com/squidfunk/mkdocs-material/releases) - [Changelog](https://github.com/squidfunk/mkdocs-material/blob/master/docs/changelog.md) - [Commits](https://github.com/squidfunk/mkdocs-material/compare/5.5.0...6.0.1) Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

view details

push time in 5 days

issue commentallenai/allennlp

Can't get correct output using .saliency_interpret_from_json() from Interpret

I have some thoughts on how to fix this. If I'm lucky, I can maybe get to it tomorrow; if not, I'm not sure, but I might be able to make it happen next week.

koren-v

comment created time in 5 days

push eventallenai/allennlp-website

Anthony Chen

commit sha 8891a098bd5bc13d9a4b38b0fd1ba291688e248a

update MOCHA paper and data links (#160) * added links to paper/data and images of authors * removed .DS_Store * update citation

view details

push time in 9 days

PR merged allenai/allennlp-website

update MOCHA paper and data links
  • Added link to Arxiv paper
  • Added link to MOCHA dataset
  • Added photos of authors
+106 -39

0 comment

5 changed files

anthonywchen

pr closed time in 9 days

PullRequestReviewEvent

issue openedallenai/allennlp

Dependabot is running on forks

See here for a PR that was created by dependabot on my fork. My guess is that this is because of this file, but it wasn't obvious to me how to disable this on forks (nothing in the documentation that I could easily find, either).

created time in 9 days

issue closedallenai/allennlp

Thank you and acknowledgement

Hi @matt-gardner , just wanted to say thanks for your help in answering my questions when using your framework. It was a big help for my experiments and research project. My project was recently accepted as an oral presentation at the workshop ClinicalNLP @EMNLP 2020; and I just thought I would give you an acknowledgement:

image

Does that look OK to you?

Thanks!

closed time in 9 days

johntiger1

issue commentallenai/allennlp

Thank you and acknowledgement

Glad it was helpful, and congrats on your acceptance! Yes, that text seems fine.

johntiger1

comment created time in 9 days

delete branch allenai/nlphighlights

delete branch : jon-test-fix

delete time in 10 days

push eventallenai/nlphighlights

Matt Gardner

commit sha 890001368d30819903568808dab700051a34d394

Added missing episodes

view details

Matt Gardner

commit sha d8c4e0d316237658fb3c2e845a515af9e236b7be

Merge branch 'master' of github.com:allenai/nlphighlights

view details

push time in 10 days

PullRequestReviewEvent

push eventallenai/allennlp-semparse

Matt Gardner

commit sha cc0414302730c88da2d8aeef9da2dfc6e39c43bb

remove commented-out code

view details

push time in 14 days

push eventallenai/allennlp-semparse

Matt Gardner

commit sha 8dd3f2571df9f302bd9fd3c2eb8c55b9daea2c86

try different change

view details

push time in 14 days

delete branch allenai/allennlp-semparse

delete branch : Modernize

delete time in 14 days

push eventmatt-gardner/allennlp-semparse

Michael Schmitz

commit sha 339e617861a7616618a503cc98e1e9c8b28a1b06

Update allennlp dependency (#21) * Update allennlp dependency * fix calls to Embedding() Co-authored-by: Matt Gardner <mattg@allenai.org>

view details

Ted Goddard

commit sha 28b7cf5aaf957e7311b501fe336c30330d398334

Update to support Allen NLP 1.0 (#25) * Update requirements.txt * Rename decode to make_output_human_readable * Rename decode to make_output_human_readable * Rename decode to make_output_human_readable * Rename decode to make_output_human_readable * remove conversion to float * fix tests * fix configs * flake * more flake... * change test names * fix more tests Co-authored-by: Matt Gardner <mattg@allenai.org>

view details

Evan Pete Walsh

commit sha 6d0e63ee1f44ffc08be57db2228e49606d380b25

improve CI (#26) * update GitHub Actions * check setup.py as well * add build, test, and publish jobs * fix

view details

Evan Pete Walsh

commit sha a905015e828e57bdf8672297b3111383714aa454

update README (#27) * update README * fix badge

view details

epwalsh

commit sha 4a576f41124fd37ef025309657258f9387cf22a2

update version for PyPI

view details

push time in 14 days

Pull request review commentallenai/allennlp-semparse

update AllenNLP dependency

 def __eq__(self, other):                 [                     self._nonterminal_stack == other._nonterminal_stack,                     util.tensors_equal(self._valid_actions, other._valid_actions),-                    self._is_nonterminal == other._is_nonterminal,+                    all(+                        [+                            self._is_nonterminal.__module__ == other._is_nonterminal.__module__,+                            self._is_nonterminal.__name__ == other._is_nonterminal.__name__,+                        ]+                    ),

But if I look here, it looks like all of the tests pass. Where are you seeing a failure?

epwalsh

comment created time in 14 days

PullRequestReviewEvent

Pull request review commentallenai/allennlp-semparse

update AllenNLP dependency

 def __eq__(self, other):                 [                     self._nonterminal_stack == other._nonterminal_stack,                     util.tensors_equal(self._valid_actions, other._valid_actions),-                    self._is_nonterminal == other._is_nonterminal,+                    all(+                        [+                            self._is_nonterminal.__module__ == other._is_nonterminal.__module__,+                            self._is_nonterminal.__name__ == other._is_nonterminal.__name__,+                        ]+                    ),

Can you point me to the error? I'm not sure why this would be necessary, unless it's a python version issue, where with newer versions of python the old comparison doesn't work. It looked like the only thing failing in your initial commit was black.

epwalsh

comment created time in 14 days

PullRequestReviewEvent

pull request commentallenai/allennlp-guide

Remove note about Optuna installation

Thanks!

himkt

comment created time in 16 days

push eventallenai/allennlp-guide

Makoto Hiramatsu

commit sha edbbe7ca786bb978c441439a47d0086c47125a65

Remove note about Optuna installation (#144)

view details

push time in 16 days

PR merged allenai/allennlp-guide

Remove note about Optuna installation

Follow-up for #143.

We release Optuna v2.2.0, which includes pruning support for AllenNLPExecutor. Now we can install Optuna v2.2.0 by pip install optuna, so let me remove the note!

+0 -7

0 comment

1 changed file

himkt

pr closed time in 16 days

PullRequestReviewEvent

issue commentallenai/allennlp-template-python-script

Question about the version of allennlp?

Yes, this repo is currently written for version 1.0. In version 1.1, DataLoader changed to an abstract base class, and you should use MultiProcessDataLoader(train_data, batch_size=8, shuffle=True) instead.

Helicqin

comment created time in 19 days

push eventallenai/allennlp-website

Anthony Chen

commit sha 2453f14345b94df27ea3e7e9754fca5330c958ab

Add page for MOCHA (#159) * added page for MOCHA * fix small typo

view details

push time in 19 days

PR merged allenai/allennlp-website

Add page for MOCHA

Landing page for our EMNLP paper on MOCHA. Links not yet populated.

+76 -0

0 comment

1 changed file

anthonywchen

pr closed time in 19 days

PullRequestReviewEvent

Pull request review commentallenai/allennlp-guide-examples

Preparing for grammar based models

 def generate_expression(self,                                                   allowed_operators[operator_index:])         second_argument = self.generate_expression(num_operations_for_second,                                                    allowed_operators[operator_index:])-        meaning_representation = operator["meaning"] + first_argument["meaning"] + second_argument["meaning"]-        meaning_representation = ['('] + meaning_representation + [')']+        meaning_representation_parts = [operator["meaning"],

I'd recommend running black on this code.

pdasigi

comment created time in 20 days

PullRequestReviewEvent
PullRequestReviewEvent

push eventmatt-gardner/allennlp

Matt Gardner

commit sha da3ca0a82e752bac2f2e6ebba42778bc422c2497

finish docstring

view details

push time in 20 days

pull request commentallenai/allennlp

Multitask data loading and scheduling

Ok @dirkgr, I think this is ready for review. Tests pass locally, with fake dataset readers and simple scheduling. I haven't implemented the more complex scheduling stuff yet, but those should be really easy with these building blocks, and should wait for a subsequent PR.

I wasn't sure how to see coverage information locally, so I'm not sure if I'm missing anything big for the tests. I think I tested enough, but if there's something you notice that isn't tested enough, let me know.

matt-gardner

comment created time in 20 days

push eventmatt-gardner/allennlp

Matt Gardner

commit sha 6907001dd5fcae278025fae3931f737383bd61f3

add more-itertools to setup.py

view details

push time in 20 days

push eventmatt-gardner/allennlp

Matt Gardner

commit sha 2f59b3020a546d4a60d8ea6573a3ec0892328764

changelog

view details

push time in 20 days

push eventmatt-gardner/allennlp

Matt Gardner

commit sha 0be0faa58fac98a69babb1125e73b5e759a52e7e

added some tests

view details

push time in 20 days

pull request commentallenai/allennlp-models

BART based (passage, answer) --> question generation model

ICLR deadline is Friday morning; I'd guess work on this will pick up a bit after that.

nitishgupta

comment created time in 20 days

push eventmatt-gardner/allennlp

Matt Gardner

commit sha b88b876575c636f7cb9a56f165a7aa22d4726e9f

put in some initial schedulers and samplers; just need to write tests

view details

push time in 20 days

push eventmatt-gardner/allennlp

Matt Gardner

commit sha fdd21d2566434b18d3a2b671f3969b760a0bc6a3

Getting close; saving state before fixing lint and adding tests

view details

Matt Gardner

commit sha e03dc4372b41375cd15bfd4918d405e8c79b51d9

mypy and flake

view details

push time in 21 days

delete branch matt-gardner/allennlp

delete branch : old_code

delete time in 21 days

delete branch matt-gardner/allennlp

delete branch : wikitables_scripts

delete time in 21 days

delete branch matt-gardner/allennlp

delete branch : semparse_naqanet

delete time in 21 days

delete branch matt-gardner/allennlp

delete branch : drop_negatives

delete time in 21 days

delete branch allenai/allennlp

delete branch : padding

delete time in 21 days

delete branch allenai/allennlp

delete branch : TobiFixes

delete time in 21 days

delete branch allenai/allennlp

delete branch : v0.9.0-3971

delete time in 21 days

delete branch matt-gardner/allennlp

delete branch : train_nlvr2

delete time in 21 days

push eventmatt-gardner/allennlp

Matt Gardner

commit sha f1e46fdc181bc3d895a0cfe25f2513efc7732d49

Add MultiTaskModel (#4601) * Initial design of the multi-task model * PR comments, more implementation * changelog and docs fix * More tests, and fixes for those tests * mypy and make test less flaky * Update allennlp/models/multitask.py * Update allennlp/models/multitask.py Co-authored-by: Dirk Groeneveld <groeneveld@gmail.com> * Update allennlp/models/multitask.py Co-authored-by: James Barry <james.barry26@mail.dcu.ie> * respect active heads in get_metrics * Clean up changelog * black (apparently github UI doesn't add newlines?) Co-authored-by: Dirk Groeneveld <dirkg@allenai.org> Co-authored-by: Dirk Groeneveld <groeneveld@gmail.com> Co-authored-by: James Barry <james.barry26@mail.dcu.ie>

view details

Matt Gardner

commit sha 2958295b7bb83ebe68276419f1d715a3472d3a51

Some initial work, still a bunch left to do

view details

Dirk Groeneveld

commit sha 1c35d0115230de5573a3aed49c3d0d84f8467cf8

Adds a utility function that can shuffle iterables

view details

Matt Gardner

commit sha 5c177faf08281a5f2f7b641a788bc45fc73cdf85

remove shuffle

view details

push time in 21 days

create barnchmatt-gardner/allennlp

branch : vision

created branch time in 21 days

push eventallenai/nlphighlights

Matt Gardner

commit sha 55ed1f805ec53b366ac89b677c24212b4e25e047

fixed descriptions through episode 27

view details

push time in 21 days

push eventallenai/nlphighlights

Matt Gardner

commit sha d589f23cd91f969978064a62684b4195c9c14afc

moved scripts, added a script for adding one episode at a time

view details

Matt Gardner

commit sha 2a010f9c8498a4efffa24d1b935eb8394c6847b2

added missing episodes

view details

push time in 21 days

issue closedallenai/allennlp

from allennlp.data.dataset_readers.seq2seq import Seq2SeqDatasetReader in v 1.1.0

<!-- Please fill this template entirely and do not erase any of it. We reserve the right to close without a response bug reports which are incomplete.

If you can't fill in the checklist then it's likely that this is a question, not a bug, in which case it probably belongs on our discource forum instead:

https://discourse.allennlp.org/ -->

Checklist

<!-- To check an item on the list replace [ ] with [x]. -->

  • [x] I have verified that the issue exists against the master branch of AllenNLP.
  • [x] I have read the relevant section in the contribution guide on reporting bugs.
  • [x] I have checked the issues list for similar or identical bug reports.
  • [x] I have checked the pull requests list for existing proposed fixes.
  • [x] I have checked the CHANGELOG and the commit log to find out if the bug was already fixed in the master branch.
  • [x] I have included in the "Description" section below a traceback from any exceptions related to this bug.
  • [x] I have included in the "Related issues or possible duplicates" section beloew all related issues and possible duplicate issues (If there are none, check this box anyway).
  • [x] I have included in the "Environment" section below the name of the operating system and Python version that I was using when I discovered this bug.
  • [x] I have included in the "Environment" section below the output of pip freeze.
  • [x] I have included in the "Steps to reproduce" section below a minimally reproducible example.

Description

<!-- Please provide a clear and concise description of what the bug is here. -->

<details> <summary><b>Python traceback:</b></summary> <p>

<!-- Paste the traceback from any exception (if there was one) in between the next two lines below -->

>>> from allennlp.data.dataset_readers.seq2seq import Seq2SeqDatasetReader
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'allennlp.data.dataset_readers.seq2seq'

</p> </details>

Related issues or possible duplicates

  • None

Environment

<!-- Provide the name of operating system below (e.g. OS X, Linux) --> OS: Linux

<!-- Provide the Python version you were using (e.g. 3.7.1) --> Python version: 3.7.9

<details> <summary><b>Output of <code>pip freeze</code>:</b></summary> <p>

<!-- Paste the output of pip freeze in between the next two lines below -->

allennlp==1.1.0
allennlp-models==1.1.0
attrs==20.2.0
Automat==20.2.0
blis==0.4.1
boto3==1.15.4
botocore==1.18.4
catalogue==1.0.0
certifi==2020.6.20
chardet==3.0.4
click==7.1.2
Comet==3.1.0
comet-ml==3.2.1
configobj==5.0.6
conllu==4.1
constantly==15.1.0
cymem==2.0.3
dulwich==0.20.6
everett==1.0.2
filelock==3.0.12
ftfy==5.8
future==0.18.2
h5py==2.10.0
hyperlink==20.0.1
idna==2.10
importlib-metadata==2.0.0
incremental==17.5.0
iniconfig==1.0.1
jmespath==0.10.0
joblib==0.16.0
jsonnet==0.16.0
jsonpickle==1.4.1
jsonschema==3.2.0
lxml==4.5.2
more-itertools==8.5.0
murmurhash==1.0.2
netifaces==0.10.9
nltk==3.5
numpy==1.19.2
nvidia-ml-py3==7.352.0
overrides==3.1.0
packaging==20.4
plac==1.1.3
pluggy==0.13.1
preshed==3.0.2
protobuf==3.13.0
py==1.9.0
py-rouge==1.1
PyHamcrest==2.0.2
pyparsing==2.4.7
pyrsistent==0.17.3
pytest==6.0.2
python-dateutil==2.8.1
regex==2020.7.14
requests==2.24.0
s3transfer==0.3.3
sacremoses==0.0.43
scikit-learn==0.23.2
scipy==1.5.2
sentencepiece==0.1.91
six==1.15.0
spacy==2.3.2
srsly==1.0.2
tensorboardX==2.1
thinc==7.4.1
threadpoolctl==2.1.0
tokenizers==0.8.1rc1
toml==0.10.1
torch==1.6.0
tqdm==4.49.0
transformers==3.0.2
Twisted==20.3.0
urllib3==1.25.10
wasabi==0.8.0
wcwidth==0.2.5
websocket-client==0.57.0
word2number==1.1
wrapt==1.12.1
wurlitzer==2.0.1
zipp==3.2.0
zope.interface==5.1.0

</p> </details>

Steps to reproduce

Activate the conda env for allennlp 1.1.0, start python console. Import allennlp and then from allennlp.data.dataset_readers.seq2seq import Seq2SeqDatasetReader.

<details> <summary><b>Example source:</b></summary> <p>

<!-- Add a fully runnable example in between the next two lines below that will reproduce the bug -->

import allennlp
from allennlp.data.dataset_readers.seq2seq import Seq2SeqDatasetReader

</p> </details>

closed time in 21 days

izaskr

delete branch matt-gardner/allennlp

delete branch : multitask

delete time in 21 days

push eventallenai/allennlp

Matt Gardner

commit sha f1e46fdc181bc3d895a0cfe25f2513efc7732d49

Add MultiTaskModel (#4601) * Initial design of the multi-task model * PR comments, more implementation * changelog and docs fix * More tests, and fixes for those tests * mypy and make test less flaky * Update allennlp/models/multitask.py * Update allennlp/models/multitask.py Co-authored-by: Dirk Groeneveld <groeneveld@gmail.com> * Update allennlp/models/multitask.py Co-authored-by: James Barry <james.barry26@mail.dcu.ie> * respect active heads in get_metrics * Clean up changelog * black (apparently github UI doesn't add newlines?) Co-authored-by: Dirk Groeneveld <dirkg@allenai.org> Co-authored-by: Dirk Groeneveld <groeneveld@gmail.com> Co-authored-by: James Barry <james.barry26@mail.dcu.ie>

view details

push time in 21 days

PR merged allenai/allennlp

Add MultiTaskModel merge when ready

Fixes the first part of #4422.

This isn't quite ready for a full review yet, there are a few minor things left to implement. But the basics are in place enough that a quick design review of what's here would be good, before I get too much farther.

This is currently based off of the vision branch, targeting 2.0, but there isn't really anything here that would stop us merging this directly into master, if we wanted. I could go either way on what to do with this.

+649 -12

8 comments

11 changed files

matt-gardner

pr closed time in 21 days

push eventmatt-gardner/allennlp

Matt Gardner

commit sha d7f54a97e12c5bb7044f476977b6be4fc5592a41

black (apparently github UI doesn't add newlines?)

view details

push time in 21 days

push eventmatt-gardner/allennlp

Dirk Groeneveld

commit sha 5f040fb691d8a4e0b62bf0d5f8142f89cf917f7d

Merge branch 'master' into multitask

view details

Evan Pete Walsh

commit sha e1aa57cfd5c9ea12cae6923d9c889692d8688ab2

improve robustness of cached_path when extracting archives (#4622) * improve robustness of cache_path when extracting archives * dirks comment

view details

Evan Pete Walsh

commit sha d7124d4bc97790e4316f5a3189e0730e382ac4c7

fix len calculation for new data loader (#4618) * fix len calculation for new data loader * add test Co-authored-by: Dirk Groeneveld <dirkg@allenai.org>

view details

Evan Pete Walsh

commit sha aa750becf439224df59f80eb57aef5737cf11337

fix Average metric (#4624) * fix Average metric * try spawn * try again * oops * clean up, fix evalb too * use different start method for GPU vs CPU tests * add comment

view details

epwalsh

commit sha dcc9cdc763a92bdd078128b760399a85449faea5

Prepare for release v1.1.0

view details

Dirk Groeneveld

commit sha bf3206a28cd504d91ccd4a8fdbd07cbf549e2f2f

Workaround for Python not finding imports in spawned processes (#4630)

view details

Elad Segal

commit sha 6d480aaeeda0b035e593b15b81c8ea2a49fa342e

Improve handling of **kwargs in FromParams (#4629) * Improve handling of **kwargs in FromParams * remove duplicated line * improved handling of *args and *kwargs in FromParams * changelog * **kwargs is needed * Revert "**kwargs is needed" This reverts commit c74a94cdf142c720262431f29da9f61a11a4b5cd. * revert FromParams changes * ignore *args * change optimizers' inheritance order * add bare constructor to ForParams * Revert "add bare constructor to ForParams" This reverts commit 4afe072d8dd4529b79d439a4f08f66528386035f. * Revert "change optimizers' inheritance order" This reverts commit d9fe03634730b5a567b147202156cc4ecbfe491f. * remove comment

view details

dependabot-preview[bot]

commit sha 2df364ff5f95f2ad44c699e066c8e371b1d7959b

Update transformers requirement from <3.1,>=3.0 to >=3.0,<3.2 (#4621) * Update transformers requirement from <3.1,>=3.0 to >=3.0,<3.2 Updates the requirements on [transformers](https://github.com/huggingface/transformers) to permit the latest version. - [Release notes](https://github.com/huggingface/transformers/releases) - [Commits](https://github.com/huggingface/transformers/compare/v3.0.0...v3.1.0) Signed-off-by: dependabot-preview[bot] <support@dependabot.com> * update CHANGELOG * exclude 3.0, patch models in tests * handle missing position_ids in transformer state dicts * fix * oops, fix again * Undo models version patch Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> Co-authored-by: Evan Pete Walsh <epwalsh10@gmail.com>

view details

Evan Pete Walsh

commit sha 191b641e0de4aa9823cb6c282e3ee3effdf16a21

make existing readers work with multi-process loading (#4597) * make existing readers work with multi-process loading * add 'overrides' decorator * call apply_token_indexers in predictor * clean up * fix tests

view details

Dirk Groeneveld

commit sha f886fd066498499551f6a81117e47acf3ab915ff

Merge remote-tracking branch 'origin/master' into vision

view details

Dirk Groeneveld

commit sha 0e33b0bac5282f2f1ac64bf36bc58ff94902a851

Return consistent types from metrics (#4632) * Return consistent types from metrics * Changelog * Remove unused import

view details

Dirk Groeneveld

commit sha 41872ae43c7d1293a72f968a3c5321b0b777f7f0

Merge remote-tracking branch 'origin/master' into vision

view details

dependabot-preview[bot]

commit sha f0e7a78ce54c295dd4b5f729c6d6adcb20d15745

Create Dependabot config file (#4635) Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>

view details

John Giorgi

commit sha e4fd5a0c1afb324c0de2451fb0c84241c136b270

Multi-label F-beta metric (#4562) * Add multi-label Fbeta metric * Add tests for multi-label fbeta measure * Import FBetaMeasureMultiLabel from metrics module * Fix typo in import statement * Add multi-label Fbeta metric * Add tests for multi-label fbeta measure * Import FBetaMeasureMultiLabel from metrics module * Fix typo in import statement * Handle all edge cases beside true negatives * Add tests for edge cases besides true negatives * Fix bug breaking GPU tests * Rename FBetaMultiLabelMeasure everywhere * Properly compute _true_negative_sum * Adds an F1MultiLabel measure * Remove redunant code in __init__ * Replace torch.where with ge check * Add note about FBetaMultiLabelMeasure to CHANGELOG Co-authored-by: Dirk Groeneveld <dirkg@allenai.org>

view details

Dirk Groeneveld

commit sha fa22f73155c5ad0f8f68a14f6d85de20717ad649

Merge remote-tracking branch 'origin/master' into vision

view details

Matt Gardner

commit sha 2678b5857db01239f8894f11f7393877b7eacd79

Update allennlp/models/multitask.py

view details

Matt Gardner

commit sha 0c44d4db1d03babed3b54cbb3b34b39de390e071

Update allennlp/models/multitask.py Co-authored-by: Dirk Groeneveld <groeneveld@gmail.com>

view details

Matt Gardner

commit sha 0b1fa20faaaa6541c7a6fd7ac36206157f537f64

Update allennlp/models/multitask.py Co-authored-by: James Barry <james.barry26@mail.dcu.ie>

view details

Matt Gardner

commit sha 25bf79662b9886fab62215542448385b7f78e0a9

respect active heads in get_metrics

view details

Matt Gardner

commit sha 18808b19e2f8a720a741a83b67ed41fd5cf49332

Merge branch 'multitask' of github.com:matt-gardner/allennlp into multitask

view details

push time in 21 days

Pull request review commentallenai/allennlp

Add MultiTaskModel

 and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0   by adding a class-level variable called `authorized_missing_keys` to any PyTorch module that a `Model` uses.   If defined, `authorized_missing_keys` should be a list of regex string patterns. - Added `FBetaMultiLabelMeasure`, a multi-label Fbeta metric. This is a subclass of the existing `FBetaMeasure`.+- A `MultiTaskModel` and abstractions to use with it, including `Backbone` and `Head`.  The

@dirkgr, @epwalsh, I just updated the changelog to fix this; it might be good to double check the things I moved to make sure I didn't miss anything. Feel free to change how I did this if you want to separate these things differently.

matt-gardner

comment created time in 21 days

PullRequestReviewEvent

push eventmatt-gardner/allennlp

Matt Gardner

commit sha 8e7245858a504d234468706f9bf65e24c2beacca

Clean up changelog

view details

push time in 21 days

Pull request review commentallenai/allennlp

Add MultiTaskModel

 and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0   by adding a class-level variable called `authorized_missing_keys` to any PyTorch module that a `Model` uses.   If defined, `authorized_missing_keys` should be a list of regex string patterns. - Added `FBetaMultiLabelMeasure`, a multi-label Fbeta metric. This is a subclass of the existing `FBetaMeasure`.+- A `MultiTaskModel` and abstractions to use with it, including `Backbone` and `Head`.  The

Note: the vision branch should probably have a separate unreleased-2.0 or something, as this is currently mixing things that will get released from the master branch before 2.0 with 2.0 stuff. I moved the 2.0 stuff I recognized up from the 1.1 release notes, but it'll just get stale again with the next release.

matt-gardner

comment created time in 21 days

PullRequestReviewEvent

push eventmatt-gardner/allennlp

Matt Gardner

commit sha 0bbe84b4c2e61f111c7adacbede4729945b802ff

An initial VilBERT model for NLVR2 (#4423) * Some initial work; lots left to do * Initial test mostly passing, though things are still a bit of a mess * tests are passing with small fixtures * remove prints * Test more stuff * PathLike * Make vilbert pass tests * PR comments * call float before log * add CI Co-authored-by: Dirk Groeneveld <dirkg@allenai.org>

view details

Dirk Groeneveld

commit sha f87df83970bf5b818181e6709eec27962648994b

Merge remote-tracking branch 'origin/master' into vision

view details

epwalsh

commit sha 6cc508d7d90e81c23868f9c865b17817b8f7cb20

Merge branch 'master' into vision

view details

Dirk Groeneveld

commit sha 313796116ce7abdc79ed95b99f20a8e05254319b

Merge remote-tracking branch 'origin/master' into vision

view details

epwalsh

commit sha 71d7cb4ef689a405ef604695fdb837e0a3da6396

Merge branch 'master' into vision

view details

epwalsh

commit sha 3833f7a59b63721cdb0302b9e58e3e2e2bf4c05a

Merge branch 'master' into vision

view details

Matt Gardner

commit sha a7d45de1f7b98fd411fa16f7fe26c7e18a280dc5

Initializing a VilBERT model from a pre-trained transformer (#4495) * saving state * Code is running, though it is returning zero gradients (but not None) * initial test passing, still working on albert * albert works, but bert-base-uncased still gives zero gradients * Loading of weights should now work * black, flake, mypy * remove drop and mask functionality from reader * make comment better * fix tests * flake Co-authored-by: Dirk Groeneveld <dirkg@allenai.org>

view details

Dirk Groeneveld

commit sha 6f820050f2d47429b2d92c7056525282d8e6397d

Merge remote-tracking branch 'origin/master' into vision

view details

Evan Pete Walsh

commit sha e74a736550a17a23bf521c9a21cc5a2c0e168588

new data loading (#4497) * first implementation * update docstrings * fixes * fix sharding logic * clean up DatasetReader * fix samplers * fixes * fixes * patch models for now * more fixes * fix linting error * fix model test case * some fixes * fix linting err * updates * rename dataloader -> data_loader * fixes * more JoinableQueue * set daemon=True * fixes * fix * fixes * fix * update shuffle logic * load instances right away when not lazy * add tqdm when num_workers <= 0 * apply_token_indexers * fix bug causing high mem usage * address some of @dirkgr's comments * fix lazy * use sensible default for max_batches_in_mem * ensure workers terminated on err * fix * start adding some tests * more tests * add some more tests * address most of Matt's comments * update PyTorchDataLoader test * get rid of lazy option * fix linting * update docs, change max_batches_per_epoch to max_instances_per_epcoh * update CHANGELOG * fix drop_last validation * fix py2md test fixture * handle drop_last * update docs * implement sharding for most readers * fix worker init fn * limit tqdm output * fixes

view details

epwalsh

commit sha 95e8253246a8db06ce0902337d0b764a911ce69d

Merge branch 'master' into vision

view details

Evan Pete Walsh

commit sha 44c8791c877c40369891f9df3c49ba374c05c5f4

ensure vision CI runs on each commit (#4582) * ensure vision CI runs on each commit * fix * try fix CHANGELOG check

view details

epwalsh

commit sha 1b08fd6292af84b17e6ebdbfc255af30f25ba26f

ensure models check runs on right branch

view details

Dirk Groeneveld

commit sha cde06e62f14098b57d8ffa68af44a32f4b5b8e4c

Changelog

view details

Evan Pete Walsh

commit sha 3d114197026a5993b4dcdf4192f5151d01253898

Formatting updates for new version of black (#4607) * reformat for new version of black (#4605) * reformat for new version of black * pin black * reformat for black * fix

view details

Evan Pete Walsh

commit sha de9165e14a6fe59c08e398ce5b0b5572224d25ce

rename 'node_rank' to 'global_rank' in dataset reader 'DistributedInfo' (#4608) * rename 'node_rank' to 'global_rank' * Clarify doc comments * fix line length

view details

Evan Pete Walsh

commit sha 319794a10442741cba39c11ab554d3f39a75d6ee

remove duplicate padding calculations in collate fn (#4617)

view details

Dirk Groeneveld

commit sha 8746361267cd6b19956946f8991e4fd835e40824

Merge branch 'master' into vision # Conflicts: # allennlp/commands/train.py # tests/data/dataset_readers/dataset_reader_test.py # tests/data/samplers/bucket_batch_sampler_test.py

view details

Evan Pete Walsh

commit sha e1aa57cfd5c9ea12cae6923d9c889692d8688ab2

improve robustness of cached_path when extracting archives (#4622) * improve robustness of cache_path when extracting archives * dirks comment

view details

Evan Pete Walsh

commit sha d7124d4bc97790e4316f5a3189e0730e382ac4c7

fix len calculation for new data loader (#4618) * fix len calculation for new data loader * add test Co-authored-by: Dirk Groeneveld <dirkg@allenai.org>

view details

Evan Pete Walsh

commit sha aa750becf439224df59f80eb57aef5737cf11337

fix Average metric (#4624) * fix Average metric * try spawn * try again * oops * clean up, fix evalb too * use different start method for GPU vs CPU tests * add comment

view details

push time in 21 days

push eventmatt-gardner/allennlp

Matt Gardner

commit sha 25bf79662b9886fab62215542448385b7f78e0a9

respect active heads in get_metrics

view details

Matt Gardner

commit sha 18808b19e2f8a720a741a83b67ed41fd5cf49332

Merge branch 'multitask' of github.com:matt-gardner/allennlp into multitask

view details

push time in 21 days

push eventmatt-gardner/allennlp

Matt Gardner

commit sha 0b1fa20faaaa6541c7a6fd7ac36206157f537f64

Update allennlp/models/multitask.py Co-authored-by: James Barry <james.barry26@mail.dcu.ie>

view details

push time in 21 days

Pull request review commentallenai/allennlp

Add MultiTaskModel

+from collections import defaultdict+import inspect+from typing import Any, Dict, List, Set++from overrides import overrides+import torch++from allennlp.data import Vocabulary+from allennlp.modules import Backbone+from allennlp.models.model import Model+from allennlp.models.heads import Head+from allennlp.nn import InitializerApplicator+++def get_forward_arguments(module: torch.nn.Module) -> Set[str]:+    signature = inspect.signature(module.forward)+    return set([arg for arg in signature.parameters if arg != "self"])+++@Model.register("multitask")+class MultiTaskModel(Model):+    """+    A `MultiTaskModel` consists of a `Backbone` that encodes its inputs in some way, then a+    collection of `Heads` that make predictions from the backbone-encoded inputs.  The predictions+    of each `Head` are combined to compute a joint loss, which is then used for training.++    This model works by taking `**kwargs` in `forward`, and passing the right arguments from that to+    the backbone and to each head.  By default, we use `inspect` to try to figure out getting the+    right arguments to the right modules, but we allow you to specify these arguments yourself in+    case our inference code gets it wrong.++    It the caller's responsibility to make sure that the backbone and all heads are compatible with+    each other, and with the input data that comes from a `MultiTaskDatasetReader`.  We give some+    arguments in this class and in `MultiTaskDatasetReader` to help with plumbing the arguments in+    complex cases (e.g., you can change argument names so that they match what the backbone and+    heads expect).++    # Parameters++    vocab: `Vocab`+    backbone: `Backbone`+    heads: `Dict[str, Head]`+    loss_weights: `Dict[str, float]`, optional (default = `equal weighting`)+        If you want, you can specify a weight for each head, which we will multiply the loss by when+        aggregating across heads.  This is equivalent in many cases to specifying a separate+        learning rate per head, and just putting a weighting on the loss is much easier than+        figuring out the right way to specify that in the optimizer.+    arg_name_mapping: `Dict[str, Dict[str, str]]`, optional (default = `identity mapping`)+        The mapping changes the names in the `**kwargs` dictionary passed to `forward` before+        passing on the arguments to the backbone and heads.  This is keyed by component, and the+        top-level keys must match the keys passed in the `heads` parameter, plus a "backbone" key+        for the backbone.  If you are using dataset readers that use dataset-specific names for+        their keys, this lets you change them to be consistent.  For example, this dictionary might+        end up looking like this: `{"backbone": {"question": "text", "review": "text"},+        "classifier1": {"sentiment": "label"}, "classifier2": {"topic": "label"}}`.+        Though in this particular example, we have two different inputs mapping to the same key in+        the backbone; this will work, as long are you are careful that you don't give both of those+        inputs in the same batch. If we see overlapping keys, we will crash.  If you want to be able+        to do this kind of mixed training in the same batch, you need to handle that in your data+        code, not here; we won't handle complex batching inside this model.+    allowed_arguments: `Dict[str, Set[str]]`, optional (default = `inferred`)+        The list of arguments that should be passed from `**kwargs` to the `forward` method for the+        backbone and each head.  If you provide this, the keys in here should match the keys given+        in the `heads` parameter, plus a "backbone" key for the backbone arguments.  If not given,+        we will use the `inspect` module to figure this out.  The only time that this inference+        might fail is if you have optional arguments that you want to be ignored, or+        something.  You very likely don't need to worry about this argument.+    initializer: `InitializerApplicator`, optional (default=`InitializerApplicator()`)+        If provided, will be used to initialize the model parameters.+    """++    def __init__(+        self,+        vocab: Vocabulary,+        backbone: Backbone,+        heads: Dict[str, Head],+        *,+        loss_weights: Dict[str, float] = None,+        arg_name_mapping: Dict[str, Dict[str, str]] = None,+        allowed_arguments: Dict[str, Set[str]] = None,+        initializer: InitializerApplicator = InitializerApplicator(),+        **kwargs,+    ):+        super().__init__(vocab, **kwargs)+        self._backbone = backbone+        self._heads = torch.nn.ModuleDict(heads)+        self._arg_name_mapping = arg_name_mapping or defaultdict(dict)++        self._allowed_arguments = allowed_arguments or {+            "backbone": get_forward_arguments(backbone),+            **{key: get_forward_arguments(heads[key]) for key in heads},+        }+        self._loss_weights = loss_weights or defaultdict(lambda: 1.0)+        self._active_heads: List[str] = None+        initializer(self)++    def set_active_heads(self, active_heads: List[str]) -> None:+        """+        By default, the `MultiTaskModel` will try to infer which heads to run from the arguments+        passed to `forward`.  During training, we will only run a head if we have all of its+        arguments, including optional arguments, which typically means the argument is the+        prediction target; if we don't have it, we typically can't compute a loss, so running during+        training is pointless.  During evaluation, we will run all heads.++        If you want to limit which heads are run during evaluation, or if the inference for which+        task to run during training is incorrect (e.g., if your head has multiple optional+        arguments, and only some are actually required to compute a loss), then you can use this+        method to override our inference and force the use of whatever set of hads you want.++        To get back to the default mode of operation, call this method with `None` as an argument.+        """+        self._active_heads = active_heads++    def forward(self, **kwargs) -> Dict[str, torch.Tensor]:  # type: ignore+        backbone_arguments = self._get_arguments(kwargs, "backbone")+        backbone_outputs = self._backbone(**backbone_arguments)++        outputs = {**backbone_outputs}+        loss = None+        for head_name in self._heads:+            if self._active_heads is not None and head_name not in self._active_heads:+                continue++            combined_arguments = {**backbone_outputs, **kwargs}+            head_arguments = self._get_arguments(combined_arguments, head_name)++            if (+                self._active_heads is None+                and self.training+                and head_arguments.keys() != self._allowed_arguments[head_name]+            ):+                continue++            head_outputs = self._heads[head_name](**head_arguments)+            for key in head_outputs:+                outputs[f"{head_name}_{key}"] = head_outputs[key]++            if "loss" in head_outputs:+                head_loss = self._loss_weights[head_name] * head_outputs["loss"]+                if loss is None:+                    loss = head_loss+                else:+                    loss += head_loss++        if loss is not None:+            outputs["loss"] = loss++        return outputs++    def _get_arguments(self, available_args: Dict[str, Any], component: str) -> Dict[str, Any]:+        """+        Given a list of things we might want to pass to a component (where "component" is either the+        backbone or a head), this method figures out which things we should actually pass, by+        mapping names and looking at allowed arguments.+        """+        allowed_args = self._allowed_arguments[component]+        name_mapping = self._arg_name_mapping[component]+        kept_arguments = {}+        for key, value in available_args.items():+            new_key = name_mapping.get(key, key)+            if new_key in allowed_args:+                if new_key in kept_arguments:+                    raise ValueError(+                        f"Got duplicate argument {new_key} for {component}. This likely means that"+                        " you mapped multiple inputs to the same name. This is generally ok for"+                        " the backbone, but you have to be sure each batch only gets one of those"+                        " inputs.  This is typically not ok for heads, and means something is not"+                        " set up right."+                    )+                kept_arguments[new_key] = value+        return kept_arguments++    @overrides+    def get_metrics(self, reset: bool = False) -> Dict[str, float]:+        metrics = {}+        for head_name in self._heads:+            for key, value in self._heads[head_name].get_metrics(reset).items():+                metrics[f"{head_name}_{key}"] = value+        return metrics++    @overrides+    def make_output_human_readable(+        self, output_dict: Dict[str, torch.Tensor]+    ) -> Dict[str, torch.Tensor]:+        output_dict = self._backbone.make_output_human_readable(output_dict)+        for head_name in self._heads:+            if self._active_heads is not None and head_name not in self._active_heads:+                continue

Yes, good catch, thanks.

matt-gardner

comment created time in 21 days

PullRequestReviewEvent

Pull request review commentallenai/allennlp

Add MultiTaskModel

+from collections import defaultdict+import inspect+from typing import Any, Dict, List, Set++from overrides import overrides+import torch++from allennlp.data import Vocabulary+from allennlp.modules import Backbone+from allennlp.models.model import Model+from allennlp.models.heads import Head+from allennlp.nn import InitializerApplicator+++def get_forward_arguments(module: torch.nn.Module) -> Set[str]:+    signature = inspect.signature(module.forward)+    return set([arg for arg in signature.parameters if arg != "self"])+++@Model.register("multitask")+class MultiTaskModel(Model):+    """+    A `MultiTaskModel` consists of a `Backbone` that encodes its inputs in some way, then a+    collection of `Heads` that make predictions from the backbone-encoded inputs.  The predictions+    of each `Head` are combined to compute a joint loss, which is then used for training.++    This model works by taking `**kwargs` in `forward`, and passing the right arguments from that to+    the backbone and to each head.  By default, we use `inspect` to try to figure out getting the+    right arguments to the right modules, but we allow you to specify these arguments yourself in+    case our inference code gets it wrong.++    It the caller's responsibility to make sure that the backbone and all heads are compatible with+    each other, and with the input data that comes from a `MultiTaskDatasetReader`.  We give some+    arguments in this class and in `MultiTaskDatasetReader` to help with plumbing the arguments in+    complex cases (e.g., you can change argument names so that they match what the backbone and+    heads expect).++    # Parameters++    vocab: `Vocab`+    backbone: `Backbone`+    heads: `Dict[str, Head]`+    loss_weights: `Dict[str, float]`, optional (default = `equal weighting`)+        If you want, you can specify a weight for each head, which we will multiply the loss by when+        aggregating across heads.  This is equivalent in many cases to specifying a separate+        learning rate per head, and just putting a weighting on the loss is much easier than+        figuring out the right way to specify that in the optimizer.+    arg_name_mapping: `Dict[str, Dict[str, str]]`, optional (default = `identity mapping`)+        The mapping changes the names in the `**kwargs` dictionary passed to `forward` before+        passing on the arguments to the backbone and heads.  This is keyed by component, and the+        top-level keys must match the keys passed in the `heads` parameter, plus a "backbone" key+        for the backbone.  If you are using dataset readers that use dataset-specific names for+        their keys, this lets you change them to be consistent.  For example, this dictionary might+        end up looking like this: `{"backbone": {"question": "text", "review": "text"},+        "classifier1": {"sentiment": "label"}, "classifier2": {"topic": "label"}}`.+        Though in this particular example, we have two different inputs mapping to the same key in+        the backbone; this will work, as long are you are careful that you don't give both of those+        inputs in the same batch. If we see overlapping keys, we will crash.  If you want to be able+        to do this kind of mixed training in the same batch, you need to handle that in your data+        code, not here; we won't handle complex batching inside this model.+    allowed_arguments: `Dict[str, Set[str]]`, optional (default = `inferred`)+        The list of arguments that should be passed from `**kwargs` to the `forward` method for the+        backbone and each head.  If you provide this, the keys in here should match the keys given+        in the `heads` parameter, plus a "backbone" key for the backbone arguments.  If not given,+        we will use the `inspect` module to figure this out.  The only time that this inference+        might fail is if you have optional arguments that you want to be ignored, or+        something.  You very likely don't need to worry about this argument.+    initializer: `InitializerApplicator`, optional (default=`InitializerApplicator()`)+        If provided, will be used to initialize the model parameters.+    """++    def __init__(+        self,+        vocab: Vocabulary,+        backbone: Backbone,+        heads: Dict[str, Head],+        *,+        loss_weights: Dict[str, float] = None,+        arg_name_mapping: Dict[str, Dict[str, str]] = None,+        allowed_arguments: Dict[str, Set[str]] = None,+        initializer: InitializerApplicator = InitializerApplicator(),+        **kwargs,+    ):+        super().__init__(vocab, **kwargs)+        self._backbone = backbone+        self._heads = torch.nn.ModuleDict(heads)+        self._arg_name_mapping = arg_name_mapping or defaultdict(dict)++        self._allowed_arguments = allowed_arguments or {+            "backbone": get_forward_arguments(backbone),+            **{key: get_forward_arguments(heads[key]) for key in heads},+        }+        self._loss_weights = loss_weights or defaultdict(lambda: 1.0)+        self._active_heads: List[str] = None+        initializer(self)++    def set_active_heads(self, active_heads: List[str]) -> None:

It's given in the docstring... I assume you're asking if the uses specified in the docstring will ever happen in practice. I don't know, as I don't know yet how exactly this will get used. But, e.g., say you're doing TAPT, and you don't want the LM head to run during evaluation, to speed things up. Or maybe you can use this in conjunction with a callback in the trainer to implement Jiasen's particular method of multi-task scheduling.

In short, I'm not totally sure yet, but I found myself hard-coding some assumptions about which heads to use in forward, and so I wanted to give a means of bypassing those assumptions if desired.

matt-gardner

comment created time in 21 days

PullRequestReviewEvent

Pull request review commentallenai/allennlp

Add MultiTaskModel

+from collections import defaultdict+import inspect+from typing import Any, Dict, List, Set++from overrides import overrides+import torch++from allennlp.data import Vocabulary+from allennlp.modules import Backbone+from allennlp.models.model import Model+from allennlp.models.heads import Head+from allennlp.nn import InitializerApplicator+++def get_forward_arguments(module: torch.nn.Module) -> Set[str]:+    signature = inspect.signature(module.forward)+    return set([arg for arg in signature.parameters if arg != "self"])+++@Model.register("multitask")+class MultiTaskModel(Model):+    """+    A `MultiTaskModel` consists of a `Backbone` that encodes its inputs in some way, then a+    collection of `Heads` that make predictions from the backbone-encoded inputs.  The predictions+    of each `Head` are combined to compute a joint loss, which is then used for training.++    This model works by taking `**kwargs` in `forward`, and passing the right arguments from that to+    the backbone and to each head.  By default, we use `inspect` to try to figure out getting the+    right arguments to the right modules, but we allow you to specify these arguments yourself in+    case our inference code gets it wrong.++    It the caller's responsibility to make sure that the backbone and all heads are compatible with+    each other, and with the input data that comes from a `MultiTaskDatasetReader`.  We give some+    arguments in this class and in `MultiTaskDatasetReader` to help with plumbing the arguments in+    complex cases (e.g., you can change argument names so that they match what the backbone and+    heads expect).++    # Parameters++    vocab: `Vocab`+    backbone: `Backbone`+    heads: `Dict[str, Head]`+    loss_weights: `Dict[str, float]`, optional (default = `equal weighting`)+        If you want, you can specify a weight for each head, which we will multiply the loss by when+        aggregating across heads.  This is equivalent in many cases to specifying a separate+        learning rate per head, and just putting a weighting on the loss is much easier than+        figuring out the right way to specify that in the optimizer.+    arg_name_mapping: `Dict[str, Dict[str, str]]`, optional (default = `identity mapping`)+        The mapping changes the names in the `**kwargs` dictionary passed to `forward` before+        passing on the arguments to the backbone and heads.  This is keyed by component, and the+        top-level keys must match the keys passed in the `heads` parameter, plus a "backbone" key+        for the backbone.  If you are using dataset readers that use dataset-specific names for+        their keys, this lets you change them to be consistent.  For example, this dictionary might+        end up looking like this: `{"backbone": {"question": "text", "review": "text"},+        "classifier1": {"sentiment": "label"}, "classifier2": {"topic": "label"}}`.+        Though in this particular example, we have two different inputs mapping to the same key in+        the backbone; this will work, as long are you are careful that you don't give both of those+        inputs in the same batch. If we see overlapping keys, we will crash.  If you want to be able+        to do this kind of mixed training in the same batch, you need to handle that in your data+        code, not here; we won't handle complex batching inside this model.+    allowed_arguments: `Dict[str, Set[str]]`, optional (default = `inferred`)+        The list of arguments that should be passed from `**kwargs` to the `forward` method for the+        backbone and each head.  If you provide this, the keys in here should match the keys given+        in the `heads` parameter, plus a "backbone" key for the backbone arguments.  If not given,+        we will use the `inspect` module to figure this out.  The only time that this inference+        might fail is if you have optional arguments that you want to be ignored, or+        something.  You very likely don't need to worry about this argument.+    initializer: `InitializerApplicator`, optional (default=`InitializerApplicator()`)+        If provided, will be used to initialize the model parameters.+    """++    def __init__(+        self,+        vocab: Vocabulary,+        backbone: Backbone,+        heads: Dict[str, Head],+        *,+        loss_weights: Dict[str, float] = None,+        arg_name_mapping: Dict[str, Dict[str, str]] = None,+        allowed_arguments: Dict[str, Set[str]] = None,+        initializer: InitializerApplicator = InitializerApplicator(),+        **kwargs,+    ):+        super().__init__(vocab, **kwargs)+        self._backbone = backbone+        self._heads = torch.nn.ModuleDict(heads)+        self._arg_name_mapping = arg_name_mapping or defaultdict(dict)++        self._allowed_arguments = allowed_arguments or {+            "backbone": get_forward_arguments(backbone),+            **{key: get_forward_arguments(heads[key]) for key in heads},+        }+        self._loss_weights = loss_weights or defaultdict(lambda: 1.0)+        self._active_heads: List[str] = None+        initializer(self)++    def set_active_heads(self, active_heads: List[str]) -> None:+        """+        By default, the `MultiTaskModel` will try to infer which heads to run from the arguments+        passed to `forward`.  During training, we will only run a head if we have all of its+        arguments, including optional arguments, which typically means the argument is the+        prediction target; if we don't have it, we typically can't compute a loss, so running during+        training is pointless.  During evaluation, we will run all heads.++        If you want to limit which heads are run during evaluation, or if the inference for which+        task to run during training is incorrect (e.g., if your head has multiple optional+        arguments, and only some are actually required to compute a loss), then you can use this+        method to override our inference and force the use of whatever set of hads you want.

My breaking e key strikes again. I need to get my keyboard fixed...

matt-gardner

comment created time in 21 days

PullRequestReviewEvent

push eventmatt-gardner/allennlp

Matt Gardner

commit sha 0c44d4db1d03babed3b54cbb3b34b39de390e071

Update allennlp/models/multitask.py Co-authored-by: Dirk Groeneveld <groeneveld@gmail.com>

view details

push time in 22 days

Pull request review commentallenai/allennlp

Add MultiTaskModel

+from collections import defaultdict+import inspect+from typing import Any, Dict, List, Set++from overrides import overrides+import torch++from allennlp.data import Vocabulary+from allennlp.modules import Backbone+from allennlp.models.model import Model+from allennlp.models.heads import Head+from allennlp.nn import InitializerApplicator+++def get_forward_arguments(module: torch.nn.Module) -> Set[str]:+    signature = inspect.signature(module.forward)+    return set([arg for arg in signature.parameters if arg != "self"])+++@Model.register("multitask")+class MultiTaskModel(Model):+    """+    A `MultiTaskModel` consists of a `Backbone` that encodes its inputs in some way, then a+    collection of `Heads` that make predictions from the backbone-encoded inputs.  The predictions+    of each `Head` are combined to compute a joint loss, which is then used for training.++    This model works by taking `**kwargs` in `forward`, and passing the right arguments from that to+    the backbone and to each head.  By default, we use `inspect` to try to figure out getting the+    right arguments to the right modules, but we allow you to specify these arguments yourself in+    case our inference code gets it wrong.++    It the caller's responsibility to make sure that the backbone and all heads are compatible with+    each other, and with the input data that comes from a `MultiTaskDatasetReader`.  We give some+    arguments in this class and in `MultiTaskDatasetReader` to help with plumbing the arguments in+    complex cases (e.g., you can change argument names so that they match what the backbone and+    heads expect).++    # Parameters++    vocab: `Vocab`+    backbone: `Backbone`+    heads: `Dict[str, Head]`+    loss_weights: `Dict[str, float]`, optional (default = `equal weighting`)+        If you want, you can specify a weight for each head, which we will multiply the loss by when+        aggregating across heads.  This is equivalent in many cases to specifying a separate+        learning rate per head, and just putting a weighting on the loss is much easier than+        figuring out the right way to specify that in the optimizer.

If the gradient is None, the momentum computation is skipped (I just checked what Adam does, and I assume the others do the same). So this should do the right thing.

matt-gardner

comment created time in 22 days

PullRequestReviewEvent

Pull request review commentallenai/allennlp

Add MultiTaskModel

+from allennlp.models.model import Model+++class Head(Model):

Agreed, and I'm planning on doing something similar when I create a new baseline for ORB this quarter.

matt-gardner

comment created time in 22 days

PullRequestReviewEvent

push eventmatt-gardner/allennlp

Evan Pete Walsh

commit sha e1aa57cfd5c9ea12cae6923d9c889692d8688ab2

improve robustness of cached_path when extracting archives (#4622) * improve robustness of cache_path when extracting archives * dirks comment

view details

Evan Pete Walsh

commit sha aa750becf439224df59f80eb57aef5737cf11337

fix Average metric (#4624) * fix Average metric * try spawn * try again * oops * clean up, fix evalb too * use different start method for GPU vs CPU tests * add comment

view details

epwalsh

commit sha dcc9cdc763a92bdd078128b760399a85449faea5

Prepare for release v1.1.0

view details

Dirk Groeneveld

commit sha bf3206a28cd504d91ccd4a8fdbd07cbf549e2f2f

Workaround for Python not finding imports in spawned processes (#4630)

view details

Elad Segal

commit sha 6d480aaeeda0b035e593b15b81c8ea2a49fa342e

Improve handling of **kwargs in FromParams (#4629) * Improve handling of **kwargs in FromParams * remove duplicated line * improved handling of *args and *kwargs in FromParams * changelog * **kwargs is needed * Revert "**kwargs is needed" This reverts commit c74a94cdf142c720262431f29da9f61a11a4b5cd. * revert FromParams changes * ignore *args * change optimizers' inheritance order * add bare constructor to ForParams * Revert "add bare constructor to ForParams" This reverts commit 4afe072d8dd4529b79d439a4f08f66528386035f. * Revert "change optimizers' inheritance order" This reverts commit d9fe03634730b5a567b147202156cc4ecbfe491f. * remove comment

view details

dependabot-preview[bot]

commit sha 2df364ff5f95f2ad44c699e066c8e371b1d7959b

Update transformers requirement from <3.1,>=3.0 to >=3.0,<3.2 (#4621) * Update transformers requirement from <3.1,>=3.0 to >=3.0,<3.2 Updates the requirements on [transformers](https://github.com/huggingface/transformers) to permit the latest version. - [Release notes](https://github.com/huggingface/transformers/releases) - [Commits](https://github.com/huggingface/transformers/compare/v3.0.0...v3.1.0) Signed-off-by: dependabot-preview[bot] <support@dependabot.com> * update CHANGELOG * exclude 3.0, patch models in tests * handle missing position_ids in transformer state dicts * fix * oops, fix again * Undo models version patch Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> Co-authored-by: Evan Pete Walsh <epwalsh10@gmail.com>

view details

Dirk Groeneveld

commit sha 0e33b0bac5282f2f1ac64bf36bc58ff94902a851

Return consistent types from metrics (#4632) * Return consistent types from metrics * Changelog * Remove unused import

view details

dependabot-preview[bot]

commit sha f0e7a78ce54c295dd4b5f729c6d6adcb20d15745

Create Dependabot config file (#4635) Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>

view details

John Giorgi

commit sha e4fd5a0c1afb324c0de2451fb0c84241c136b270

Multi-label F-beta metric (#4562) * Add multi-label Fbeta metric * Add tests for multi-label fbeta measure * Import FBetaMeasureMultiLabel from metrics module * Fix typo in import statement * Add multi-label Fbeta metric * Add tests for multi-label fbeta measure * Import FBetaMeasureMultiLabel from metrics module * Fix typo in import statement * Handle all edge cases beside true negatives * Add tests for edge cases besides true negatives * Fix bug breaking GPU tests * Rename FBetaMultiLabelMeasure everywhere * Properly compute _true_negative_sum * Adds an F1MultiLabel measure * Remove redunant code in __init__ * Replace torch.where with ge check * Add note about FBetaMultiLabelMeasure to CHANGELOG Co-authored-by: Dirk Groeneveld <dirkg@allenai.org>

view details

Evan Pete Walsh

commit sha e8e89d5acffb16b65e48688fb4b3ad369cba0510

add flag for saving predictions to 'evaluate' command (#4637) * add flag for saving predictions to 'evaluate' command * Apply suggestions from code review * format

view details

Nelson Liu

commit sha de5d68bc93c70440ad447b07d6f8ab6953186d3f

Fix tensor.nonzero() function overload warning (#4644) * Fix tensor.nonzero() function overload warning * Update changelog

view details

Matt Mulholland

commit sha c7b7c0085d946bdfec010c614f3545d6bab7a35c

Feature/prevent temp directory retention (#4643) * Remove extracted archive directory in load_archive instead of at exit * Update CHANGELOG

view details

Evan Pete Walsh

commit sha 824f97d457bff15955a6793535092e334e761515

smooth out release process (#4648) * smooth out release process * fix wording * another small fix

view details

Evan Pete Walsh

commit sha 2d5f24bd94ba229741a1a17e09b540a374447c77

improve how cached_path extracts archives (#4645) * improve archive extraction * fixes * Update CHANGELOG.md * make _resource_to_filename() private * use different lock file for extraction * formatting

view details

epwalsh

commit sha fbd2ccca1dd767e919a62d344c6b6569fc38227a

fix numbering in RELEASE_GUIDE

view details

Evan Pete Walsh

commit sha 175c76beda1d4d68011e1405fcd647dc77f4b212

fix confusing distributed logging info (#4654)

view details

Matt Mulholland

commit sha d7c06fe7e78a2f23fb569944ce1b273541d85dee

Expose from_pretrained keyword arguments (#4651) * Add ability to pass through transformers cache-related kwargs such as cache_dir and local_files_only * Add a couple tests for cached_transformers * Update CHANGELOG * Fix formatting * Apply suggestions * Add/fix tokenizers_kwargs/transformer_kwargs in a few places; add documentation wherever it occurs * Update CHANGELOG.md Co-authored-by: Evan Pete Walsh <epwalsh10@gmail.com> * Update bert_pooler.py transformer_kwargs documentation * Apply suggestions from code review Co-authored-by: Evan Pete Walsh <epwalsh10@gmail.com> * Remove test_from_pretrained_kwargs_local_files_only_missing_from_cache test * Use AllenNlpTestCase in cached_transformers_test.py Co-authored-by: Evan Pete Walsh <epwalsh10@gmail.com>

view details

Evan Pete Walsh

commit sha b833f9059b7c203f8c79dcfeaefbe25458cb1282

fix multi-line links in docs (#4660)

view details

epwalsh

commit sha e5e3d0207cfba70d062b8d5fca0e57a702be6f9b

tick version for nightly releases

view details

dependabot[bot]

commit sha c9f376bf71ddc01f0b49458ef335a198d8d045cb

Update transformers requirement from <3.2,>=3.1 to >=3.1,<3.3 (#4663) Updates the requirements on [transformers](https://github.com/huggingface/transformers) to permit the latest version. - [Release notes](https://github.com/huggingface/transformers/releases) - [Commits](https://github.com/huggingface/transformers/compare/v3.1.0...v3.2.0) Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

view details

push time in 22 days

issue commentallenai/allennlp

How I can use Masked Language Modeling in Python

You can see here that the value of 5 is hard-coded into the model. You'd have to change that in order to get more than 5 values out. Perhaps best to just add a constructor parameter to set that threshold value. Also you could imagine adding an output that returns the probabilities of the target ids; we already compute a loss, from which you could derive the probabilities, but that's a bit annoying.

You could do this by just copying that model and modifying it as you which; a PR to submit those particular changes back would be welcome.

taicaile

comment created time in 22 days

push eventallenai/nlphighlights

Matt Gardner

commit sha edeac90d569ccdabb83777f92b4a4e4cb056bd25

added soundcloud embeds

view details

push time in 22 days

push eventallenai/nlphighlights

Matt Gardner

commit sha 3c6fda2c2044c5294ee768da67c07557c46010f3

Adding descriptions from soundcloud

view details

Matt Gardner

commit sha b81ee3ad4ec926dce9c22eb78dddf7bd4e3a2bad

Merge branch 'master' of github.com:allenai/nlphighlights

view details

push time in 22 days

Pull request review commentallenai/allennlp

add build-vocab command

+"""+Subcommand for building a vocabulary from a training config.+"""++import argparse+import json+import logging+import os+import tarfile+import tempfile++from overrides import overrides++from allennlp.commands.subcommand import Subcommand+from allennlp.common.params import Params+from allennlp.training.util import make_vocab_from_params+++logger = logging.getLogger(__name__)+++@Subcommand.register("build-vocab")+class BuildVocab(Subcommand):+    @overrides+    def add_subparser(self, parser: argparse._SubParsersAction) -> argparse.ArgumentParser:+        description = """Build a vocabulary from an experiment config file."""+        subparser = parser.add_parser(self.name, description=description, help=description)++        subparser.add_argument("param_path", type=str, help="path to an experiment config file")++        subparser.add_argument(+            "output_path", type=str, help="path to save the vocab tar.gz file to"+        )++        subparser.add_argument(+            "-f",+            "--force",+            action="store_true",+            help="force write if the output_path already exists",+        )++        subparser.add_argument(+            "-o",+            "--overrides",+            type=str,+            default="",+            help=(+                "a json(net) structure used to override the experiment configuration, e.g., "+                "'{\"iterator.batch_size\": 16}'.  Nested parameters can be specified either"+                " with nested dictionaries or with dot syntax."+            ),+        )++        subparser.set_defaults(func=build_vocab_from_args)++        return subparser+++def build_vocab_from_args(args: argparse.Namespace):+    if not args.output_path.endswith(".tar.gz"):+        raise ValueError("param 'output_path' should end with '.tar.gz'")++    if os.path.exists(args.output_path) and not args.force:+        raise RuntimeError(f"{args.output_path} already exists. Use --force to overwrite.")++    output_directory = os.path.dirname(args.output_path)+    os.makedirs(output_directory, exist_ok=True)++    params = Params.from_file(args.param_path)++    with tempfile.TemporaryDirectory() as temp_dir:+        # Serializes the vocab to 'tempdir/vocabulary'.+        make_vocab_from_params(params, temp_dir)++        # We create a temp file to archive the vocab to in case something goes wrong+        # while creating the archive so we're not left with a corrupted file.+        temp_archive = tempfile.NamedTemporaryFile(

This whole "create inside a temp file" seems like a complex piece of code that happens in a few places and could maybe be shared. Then again, you've got some vocabulary-specific stuff in here. What happens in other places when we save the vocab? Is there similar logic there? Just a note to consider whether it's worth sharing this logic somewhere. Might not be worth it.

epwalsh

comment created time in 25 days

Pull request review commentallenai/allennlp

add build-vocab command

+"""+Subcommand for building a vocabulary from a training config.+"""++import argparse+import json+import logging+import os+import tarfile+import tempfile++from overrides import overrides++from allennlp.commands.subcommand import Subcommand+from allennlp.common.params import Params+from allennlp.training.util import make_vocab_from_params+++logger = logging.getLogger(__name__)+++@Subcommand.register("build-vocab")+class BuildVocab(Subcommand):+    @overrides+    def add_subparser(self, parser: argparse._SubParsersAction) -> argparse.ArgumentParser:+        description = """Build a vocabulary from an experiment config file."""+        subparser = parser.add_parser(self.name, description=description, help=description)++        subparser.add_argument("param_path", type=str, help="path to an experiment config file")++        subparser.add_argument(+            "output_path", type=str, help="path to save the vocab tar.gz file to"+        )++        subparser.add_argument(+            "-f",+            "--force",+            action="store_true",+            help="force write if the output_path already exists",+        )++        subparser.add_argument(+            "-o",+            "--overrides",+            type=str,+            default="",+            help=(+                "a json(net) structure used to override the experiment configuration, e.g., "+                "'{\"iterator.batch_size\": 16}'.  Nested parameters can be specified either"

You might consider a more meaningful help text here.

                "'{\"vocabulary.min_count\": {\"labels\": 10}}'.  Nested parameters can be specified either"

(not sure if using dots the whole way would work... maybe it would)

epwalsh

comment created time in 25 days

more