anhaidgroup / deepmatcher

Python package for performing Entity and Text Matching using Deep Learning.
BSD 3-Clause "New" or "Revised" License
565 stars 130 forks source link

Using Deepmatcher 0.1.2 in Kaggle - torchtext.legacy issue #85

Open paulindani opened 3 years ago

paulindani commented 3 years ago

Using Deepmatcher 0.1.2 in Kaggle - torchtext.legacy issue

I have tried to use Deepmatcher 0.1.2 in Kaggle.com. I have tried both !pip install -qqq deepmatcher==0.1.2 and !pip install -qqq deepmatcher Once the installation is done, when I try to import the package with import deepmatcher as dm the following error appears:


ModuleNotFoundError Traceback (most recent call last)

in ----> 1 import deepmatcher as dm /opt/conda/lib/python3.7/site-packages/deepmatcher/__init__.py in 8 import sys 9 ---> 10 from .data import process as data_process 11 from .models import modules 12 from .models.core import (MatchingModel, AttrSummarizer, WordContextualizer, /opt/conda/lib/python3.7/site-packages/deepmatcher/data/__init__.py in ----> 1 from .field import MatchingField, reset_vector_cache 2 from .dataset import MatchingDataset 3 from .iterator import MatchingIterator 4 from .process import process, process_unlabeled 5 from .dataset import split /opt/conda/lib/python3.7/site-packages/deepmatcher/data/field.py in 11 import fasttext 12 import torch ---> 13 from torchtext.legacy import data, vocab 14 from torchtext.utils import download_from_url 15 from urllib.request import urlretrieve ModuleNotFoundError: No module named 'torchtext.legacy' ------------------------------------------------------------ By default, torchtext version 0.8.0a0+cd6902d is installed in Kaggle. This version of torchtext has the following sub packages: **dir(tochtext)** ['__all__', '__builtins__', '__cached__', '__doc__', '__file__', '__loader__', '__name__', '__package__', '__path__', '__spec__', '__version__', 'data', 'datasets', 'git_version', 'nn', 'utils', 'version', 'vocab'] So there is no torchtext.legacy. I also could not find any version of torchtext where both data and vocab were in torchtext.legacy. So there may be a bug in deepmatcher 0.1.2 related to torchtext.legacy. When I install deepmatcher 0.1.1 with **!pip install -qqq deepmatcher==0.1.1** everything is working fine. I have tested some examples both on CPU and GPU and there are no issues.
sidharthms commented 3 years ago

This happens when your installed version of torchtext is out of date - deepmatcher requires torchtext 0.9 due to certain backwards incompatible changes made in 0.9. I'll update the pip required version in setup.py.

adcoh commented 2 years ago

@sidharthms also experiencing this issue. Checked the torchtext release notes and it's been removed as of v.0.12.0.

rafaelbo commented 2 years ago

I also have this issue, and I have torchtext v0.12.0. I saw on stackoverflow that it was supposed to work with torchtext v0.10.0 but this version isn't available on pip anymore.

ERROR: Could not find a version that satisfies the requirement torchtext==0.10.0 (from versions: 0.1.1, 0.2.0, 0.2.1, 0.2.3, 0.3.1, 0.4.0, 0.5.0, 0.6.0, 0.12.0) ERROR: No matching distribution found for torchtext==0.10.0

sidharthms commented 2 years ago

We'll look at migrating into the new torchtext over the next 1-2 months, but in the meantime you can get it working on most Linux platforms I believe (you can try running on Colab https://colab.research.google.com/ online) - torchtext 0.10 is still available for those https://pypi.org/project/torchtext/0.10.1/#files. 0.10 is not available for the newer Mac versions apparently.

On Fri, Jun 10, 2022 at 4:09 PM rafaelbo @.***> wrote:

I also have this issue, and I have torchtext v0.12.0. I saw on stackoverflow that it was supposed to work with torchtext v0.10.0 but this version isn't available on pip anymore.

ERROR: Could not find a version that satisfies the requirement torchtext==0.10.0 (from versions: 0.1.1, 0.2.0, 0.2.1, 0.2.3, 0.3.1, 0.4.0, 0.5.0, 0.6.0, 0.12.0) ERROR: No matching distribution found for torchtext==0.10.0

— Reply to this email directly, view it on GitHub https://github.com/anhaidgroup/deepmatcher/issues/85#issuecomment-1152792779, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABWE5ZLJSBADAAMMZNUUA3TVOPDLHANCNFSM46S5MEGA . You are receiving this because you were mentioned.Message ID: @.***>