TurkuNLP / Turku-neural-parser-pipeline

A neural parsing pipeline for segmentation, morphological tagging, dependency parsing and lemmatization with pre-trained models for more than 50 languages. Top ranker in the CoNLL-18 Shared Task.
https://turkunlp.github.io/Turku-neural-parser-pipeline/
Apache License 2.0
111 stars 31 forks source link

Colab tnpp-diaparse.ipynb fails with import error #40

Open fergusq opened 1 year ago

fergusq commented 1 year ago

I get the following error when trying the notebook:

---------------------------------------------------------------------------

ModuleNotFoundError                       Traceback (most recent call last)

[<ipython-input-4-d883b15aac58>](https://localhost:8080/#) in <module>
----> 1 import pytorch_lightning

6 frames

[/usr/local/lib/python3.7/dist-packages/pytorch_lightning/utilities/apply_func.py](https://localhost:8080/#) in <module>
     29 if _TORCHTEXT_AVAILABLE:
     30     if _compare_version("torchtext", operator.ge, "0.9.0"):
---> 31         from torchtext.legacy.data import Batch
     32     else:
     33         from torchtext.data import Batch

ModuleNotFoundError: No module named 'torchtext.legacy'

Requiring an older version of torchtext should fix the problem, or updating pytorch_lightning to a newer version that doesn't use the legacy package.