Git Product home page Git Product logo

trapper's People

Contributors

cemilcengiz avatar devrimcavusoglu avatar fcakyon avatar sophylax avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

trapper's Issues

Provide better output from code style check

When I run the following code from the project root directory,
python tests/run_code_style.py check

I get the error below.

ERROR: SOME_FOLDERS/trapper/trapper/data/dataset_readers/dataset_reader.py Imports are incorrectly sorted and/or formatted.
Skipped 1 files
Traceback (most recent call last):
  File "tests/run_code_style.py", line 10, in <module>
    assert_shell("isort . --check --settings setup.cfg")
  File "SOME_FOLDERS/trapper/tests/utils.py", line 19, in assert_shell
    ), f"Unexpected exit code {str(actual_exit_status)}"
AssertionError: Unexpected exit code 256

Can't we just print messages for each incorrectly formatted code instead of throwing an exception?

Refactor pipelines

HuggingFace transformers' pipelinies underwent in a major major refactor in v4.11.0. Thanks to the new design, we can refactor our pipeline factory and existing pipelines as well as possibly wrapping the pipeline as a Registrable class. However, allennlp's latest release does not have that yet although their master branch has. Therefore, we may need to wait till their new release (I expect it won't take long) or use that commit to prevent a dependency mismatch.

Remove `overrides` decorator from the `Run` command

Currently the commands does not work as the commands.py module imports the overrides package whereas it is not in the requirements, hence not installed. The only reason it is used is to decorate the add_subparser method in Run class class.

Add jury or datasets/metrics integration

It would be really nice if we provide automatic evaluation metrics from datasets/metrics module, preferably through the jury library.

  • Can we wrap the metrics as Registrable classes?
  • Can we come up with some reosable default metrics to the common tasks e.g. F1, precision and recall so that a metric is chosen automatically unless the user specifies another metric (using the same mechanisms we will provide)? This part is not strictly required, but still might be nice to provide.

Use dataset.set_format in dataset collator

Instead of doing the tensor conversion manually, we can do something like
dataset.set_format(type='torch', columns=['input_ids', 'token_type_ids', 'attention_mask', 'label'])
as shown in datasets doc. This would also enable removing the unused columns (the columns not required by the models) conveniently.

POS Tagging Example Not Working

When trying to run the POS Tagging Example experiment, I get the following exception:

Traceback (most recent call last):
  File "/home/sophylax/anaconda3/envs/trapper/lib/python3.7/site-packages/allennlp/common/params.py", line 211, in pop
    value = self.params.pop(key)
KeyError: 'metric_input_handler'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/sophylax/anaconda3/envs/trapper/bin/trapper", line 8, in <module>
    sys.exit(run())
  File "/home/sophylax/Documents/Git/Github/trapper/trapper/__main__.py", line 12, in run
    main(prog="trapper")
  File "/home/sophylax/Documents/Git/Github/trapper/trapper/commands.py", line 178, in main
    args.func(args)
  File "/home/sophylax/Documents/Git/Github/trapper/trapper/commands.py", line 101, in run_experiment_from_args
    run_experiment(args.config_path, args.overrides)
  File "/home/sophylax/Documents/Git/Github/trapper/trapper/training/train.py", line 41, in run_experiment
    return _run_experiment_from_params(params)
  File "/home/sophylax/Documents/Git/Github/trapper/trapper/training/train.py", line 64, in _run_experiment_from_params
    trainer = TransformerTrainer.from_params(params)
  File "/home/sophylax/anaconda3/envs/trapper/lib/python3.7/site-packages/allennlp/common/from_params.py", line 608, in from_params
    **extras,
  File "/home/sophylax/anaconda3/envs/trapper/lib/python3.7/site-packages/allennlp/common/from_params.py", line 636, in from_params
    kwargs = create_kwargs(constructor_to_inspect, cls, params, **extras)
  File "/home/sophylax/anaconda3/envs/trapper/lib/python3.7/site-packages/allennlp/common/from_params.py", line 207, in create_kwargs
    cls.__name__, param_name, annotation, param.default, params, **extras
  File "/home/sophylax/anaconda3/envs/trapper/lib/python3.7/site-packages/allennlp/common/from_params.py", line 310, in pop_and_construct_arg
    popped_params = params.pop(name, default) if default != _NO_DEFAULT else params.pop(name)
  File "/home/sophylax/anaconda3/envs/trapper/lib/python3.7/site-packages/allennlp/common/params.py", line 216, in pop
    raise ConfigurationError(msg)
allennlp.common.checks.ConfigurationError: key "metric_input_handler" is required

Refactor tests

Currently, the tests are too complicated and lack of structure and reuse. This makes it especially harder to write tests for custom classes in new tasks.

  • We can use a class and convert some functions to methods. Maybe, some methods can be abstract (if pytest does not complain) so that the child test classes can override them.
  • We can move some common fixtures to conftest.py files or place them in the test classes I described previously.

Support global plugin files as well

Support single plugin file e.g. in ~/.trapper_plugins containing the modules that can be used in multiple projects. allennlp already supports that, so it should be easy to add.

Add Tests for Commands

We missed commands not working for a while due to not testing them in our test suite.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.