CUNY-CL / udtube

Neural morphological analyzer
Apache License 2.0
4 stars 3 forks source link

Encoder module #27

Closed kylebgorman closed 3 months ago

kylebgorman commented 3 months ago

Right now the logic about setting up the pre-trained Hugging Face encoders lives in a protected method of the UDTube module. This probably unnecessarily extends this module, and there is basically a if/elif/else cascade to deal with special cases that's likely to get longer. Here is what I'd suggest as an alternative:

Then, we just call into this module in the constructor for UDTube.

This is slightly cleaner and stores code with lots of special casing in a module that most users will never have to look at.