I have installed flair library via the following command
JavaScript
x
2
1
!pip install flair
2
but when i tries to import it, it will generate error like “ModuleNotFoundError: No module named ‘flair'”
Code:
JavaScript
1
5
1
import torch
2
import numpy as np
3
from flair.data import Sentence
4
from flair.embeddings import TransformerDocumentEmbeddings
5
Advertisement
Answer
install via the following command make sure you use –user option otherwise you will get a permission error in windows 10.
JavaScript
1
2
1
!pip install --user flair
2
after install flair you have to restart kernel in jupyter notebook