Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ImportError: cannot import name 'SpanLabel' from 'flair.data' #3

Open
SanWall opened this issue Mar 1, 2022 · 1 comment
Open

ImportError: cannot import name 'SpanLabel' from 'flair.data' #3

SanWall opened this issue Mar 1, 2022 · 1 comment

Comments

@SanWall
Copy link

SanWall commented Mar 1, 2022

Hi when trying to

from dehyphen import FlairScorer

I get following error:

---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-12-1bbf8cdaa7d0> in <module>
      3 import os
      4 import sqlite3
----> 5 from dehyphen import FlairScorer

/usr/local/lib/python3.9/site-packages/dehyphen/__init__.py in <module>
      7     text_to_format,
      8 )
----> 9 from .scorer import FlairScorer

/usr/local/lib/python3.9/site-packages/dehyphen/scorer.py in <module>
      1 from functools import lru_cache
      2 
----> 3 import flair
      4 from flair.embeddings import FlairEmbeddings
      5 

/usr/local/lib/python3.9/site-packages/flair/__init__.py in <module>
     20 # from . import visual
     21 # from . import trainers
---> 22 from . import nn
     23 from .training_utils import AnnealOnPlateau
     24 

/usr/local/lib/python3.9/site-packages/flair/nn/__init__.py in <module>
      1 from .dropout import LockedDropout, WordDropout
----> 2 from .model import Model, Classifier, DefaultClassifier

/usr/local/lib/python3.9/site-packages/flair/nn/model.py in <module>
     13 import flair
     14 from flair import file_utils
---> 15 from flair.data import DataPoint, Sentence, Dictionary, SpanLabel
     16 from flair.datasets import DataLoader, SentenceDataset
     17 from flair.training_utils import Result, store_embeddings

ImportError: cannot import name 'SpanLabel' from 'flair.data' (/usr/local/lib/python3.9/site-packages/flair/data.py)

Why so? Thanks!

@HannaKnoetzele
Copy link

Me too, I whink because if you have installed the newest flair-Version (0.11), the class SpanLabel is not existing anymore. So you should install the previous version 0.10

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants