Part 2: Abstractions, Design, and Testing

Using config files: FromParams and Registrable

This chapter describes AllenNLP's simple dependency injection framework.

1Motivation: Dependency Injection

2Injecting dependencies with FromParams

3Handling polymorphism with Registrable

4Handling runtime and sequential dependencies

5Avoiding duplication of base class parameters

6Allowing multiple constructors for the same object

7Including your own registered components