In the latest release of torchtext they moved a lot of features to torchtext.legacy
, I want to do the same things like torchtext.legacy.data.Field
and other features without using legacy
, is that can be done? and how?
Also, in the first link, there are counterparts for legacy Datasets.
You could go for an alias, namely:
import torchtext.legacy as torchtext
But this is a bad idea for multiple reasons:
torchtext.legacy.data.Field
)torchtext
should torchtext
, not torchtext.legacy
torchtext
as... torchtext
- because this alias is already taken.You could also do some workarounds like assigning torch.legacy.data.Field
to torch.data.Field
and what not, but it is a horrible idea.
If you want to work with this legacy
stuff, you can always stay with smaller version of torchtext
like 0.8.0
and this would make sense