pytorchtorchtext

Legacy torchtext 0.9.0


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?


Solution

  • EDIT:

    Also, in the first link, there are counterparts for legacy Datasets.

    Old answer (might be useful)

    You could go for an alias, namely:

    import torchtext.legacy as torchtext
    

    But this is a bad idea for multiple reasons:

    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