Flair: Cannot import FastTextEmbeddings

Created on 17 Jul 2019  路  4Comments  路  Source: flairNLP/flair

Following the instructions on https://github.com/zalandoresearch/flair/blob/master/resources/docs/TUTORIAL_3_WORD_EMBEDDING.md I tried to user FastTextEmbedddings. While I was able to use all other types of supported embeddings (WordEmbeddings, FlairEmbeddings, StackedEmbeddings ...) without any problem, it is not possible for me to import FastTextEmbeddings:

from flair.embeddings import FastTextEmbeddings

gives the following error:

ImportError                               Traceback (most recent call last)
<ipython-input-7-df89b90f0bb1> in <module>()
----> 1 from flair.embeddings import FastTextEmbeddings
ImportError: cannot import name 'FastTextEmbeddings'

I am using Flair in a Google Colab notebook. Any ideas why FastTextEmbeddings do not work, while all remaining types work fine?

question

Most helpful comment

Hello @mustaszewski the FastTextEmbeddings have just been added to the master branch of Flair and are not part of release 0.4.2. If you want to use them, you can install the current master version like this:

pip install --upgrade git+https://github.com/zalandoresearch/flair.git

All 4 comments

Hello @mustaszewski the FastTextEmbeddings have just been added to the master branch of Flair and are not part of release 0.4.2. If you want to use them, you can install the current master version like this:

pip install --upgrade git+https://github.com/zalandoresearch/flair.git

Great, thank you, that solved the issue.

@alanakbik I follow the pip install --upgrade instruction as above, but still get the import error. Kindly advise what could have potentially gone wrong. Thanks.
Screenshot 2019-07-24 at 3 29 22 PM

@yslinkelaberetiv could you try in a fresh virtual environment (with no Flair installed) and instead of installing flair with pip install flair use the above command?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mittalsuraj18 picture mittalsuraj18  路  3Comments

jewl123 picture jewl123  路  3Comments

alanakbik picture alanakbik  路  3Comments

stefan-it picture stefan-it  路  3Comments

davidsbatista picture davidsbatista  路  3Comments