pytorch / text

Models, data loaders and abstractions for language processing, powered by PyTorch
https://pytorch.org/text
BSD 3-Clause "New" or "Revised" License
3.51k stars 810 forks source link

Can't import torchtext experimental dataset Multi30K [Translation] #1038

Closed sidwa closed 4 years ago

sidwa commented 4 years ago

📚 Documentation

Description

For example dataset: torchtext.experimental.dataset.Mulit30K the documentation shows an import statement like so

from torchtext.datasets import Multi30K

which yields:

TypeError: __init__() missing 3 required positional arguments: 'path', 'exts', and 'fields'

So the import is probably referring to Multi30k which is not the experimental dataset. Changing the import statement to:

from torchtext.experimental.datasets import Multi30K

gets another error

ImportError: cannot import name 'Multi30k' from 'torchtext.experimental.datasets' (C:\Users\siddhant\AppData\Roaming\Python\Python37\site-packages\torchtext\experimental\datasets\__init__.py)

So how do we import translation datasets?

zhangguanheng66 commented 4 years ago

Thanks for opening the issue. I just create a PR to fix. Feel free to review it. @sidwa

sidwa commented 4 years ago

@zhangguanheng66 thank you. How long does the change here take to reflect on the website? Also there is an import error that happens when I do that. Should I open a separate bug report for that?

zhangguanheng66 commented 4 years ago

@zhangguanheng66 thank you. How long does the change here take to reflect on the website? Also there is an import error that happens when I do that. Should I open a separate bug report for that?

Typically by the time of next release, which I expect to be the end of October. But I could update it early. Please open another issue for the import error.

zhangguanheng66 commented 4 years ago

BTW, can I have a stamp for the PR?