Cannot import name Field from torchtext.data

from torchtext.data import Field
I am using pytorch 1.13 and torchtext 0.12.0

Version 1.13 just works quite different now. You will need to check the docs and most recent examples/tutorials.

I would argue that it became more light-weight since it focuses on the important parts, and no longer on preprocessing steps like tokenization.

In short, FIELD is gone now. And to be honest, I prefer it that way.

2 Likes

Thanks, i will check it.
do you know useful resources to start with PyTorch or books?
everything I found is with the legacy version and I am confused I am new to NLP

There is a minimal example in the docs.

I actually prepared 2 simple Jupyter notebooks for my students that I don’t mind sharing. But it would have to wait until tomorrow. It’s late here :).

1 Like

Thanks in advance.
I will be waiting for you to send them!

I’ve made 2 notebooks for download here.

At some point this will all be on GitHub but it’s far from ready and polished. I hope it’s useful.

2 Likes

thanks a lot, vdw for your help

the link don’t open!

Can I also see the notebooks??
I can not open the link.
Thx again, vdw. :sweat_smile:

The link should work but I assume your browser blocks HTTP requests. I simply copied to my own virtual server; and I don’t have SSL certificates for that.

1 Like

sry, my bad.
By using Microsoft Edge, I can open and download the notebooks!!
:+1:

Hey, I am using torchtext 0.15 and encountering the same error as author. Could you share the notebooks again. Sorry for the inconvenience caused, I am still new to this.

I’ve finally managed to upload some stuff to Github. You can check out the “Data Preparation” notebooks in this repository.

1 Like

Thank you for the reply.I will look into it. Also , Can you suggest some tutorials(or notebooks) which will help me as a novice to get started?Thanks.

To get started with what exactly? :slight_smile:

I assume you mean NLP stuff with Python, or do you already have a specific task/goal in mind? Well, I like to think the repository I’ve just linked can be useful. We share this as supplementary materials with out students in our NLP university course – but this course is not only about neural network topics, as you can see from the complete repository. Apart from that, there are hundreds of good online sources (incl. the tutorials on the PyTorch website and YouTube tutorials). Admittedly, not many are specific torchtext, if this is what you’re after. Given the most recent changes in torchtext, many existing online examples won’t work anymore. It might be best to check the code snippets in the website.

Yes, I mean NLP specifically. I want to get acquainted with pytorch and torchtext , so that I can write my own models. I have started reading papers and architectures like RNN, LSTM. Thanks for the reply.

Just in case it’s still relevant, maybe these notebooks could be useful.