Closed boydxh closed 1 year ago
Hi @boydxh , this is a known issue, see https://github.com/flairNLP/flair/issues/2969 https://github.com/flairNLP/flair/issues/2853 https://github.com/flairNLP/flair/issues/2833 https://github.com/flairNLP/flair/issues/2105
Currently you have the following options:
0.12
release is out, we are currently working on the last finegrainingHello @boydxh, Flair 0.12 is now released. Could you try another install to see if it works now?
Hi, I just tried pip install flair on Win11 (Anaconda Prompt). It didn't work: ERROR: Failed building wheel for tokenizers Failed to build gensim tokenizers ERROR: Could not build wheels for tokenizers, which is required to install pyproject.toml-based projects
Btw, git installation didn't work as well
@Sajjad-Mahmoudi Flair 0.12 now requires at least Python 3.7. Could you share more details of your setup?
I could install it with Python 3.10. However, I have new issues (using PyCharm): 1) from flair.models import MultiTagger (Cannot find reference 'MultiTagger' in 'init.py' ) 2) When I run the command below: sentence = Sentence("Behavioral abnormalities in the Fmr1 KO2 Mouse Model of Fragile X Syndrome", use_tokenizer=SciSpacyTokenizer()), I got the error below: OSError: [E053] Could not read config file from C:\Users\mahmo\anaconda3\envs\hunFlair\lib\site-packages\en_core_sci_sm\en_core_sci_sm-0.2.5\config.cfg
@Sajjad-Mahmoudi the MultiTagger
was absorbed into the new MultitaskModel
. The bio tagger is now loaded like this:
from flair.data import Sentence
from flair.nn import Classifier
# make a sentence
sentence = Sentence('Behavioral abnormalities in the Fmr1 KO2 Mouse Model of Fragile X Syndrome.')
# load the NER tagger
tagger = Classifier.load('bioner')
# run NER over sentence
tagger.predict(sentence)
# print the sentence with all annotations
print(sentence)
See: https://github.com/flairNLP/flair/blob/master/resources/docs/TUTORIAL_TAGGING_NER.md#biomedical-data
Hello @boydxh, Flair 0.12 is now released. Could you try another install to see if it works now?
Hi! Just tried again - it successfully installed without the error message, but when I tried the first tutorial I received an error message. So I tried running collect_env.py and got the exact same error message. Output below.
$ python3 collect_env.py [0:24:07] Traceback (most recent call last): File "/Users/Helena.Boyd/nlp/collect_env.py", line 4, in <module> import flair File "/Users/Helena.Boyd/.local/share/virtualenvs/nlp-j9jQos4W/lib/python3.10/site-packages/flair/__init__.py", line 19, in <module> from . import models File "/Users/Helena.Boyd/.local/share/virtualenvs/nlp-j9jQos4W/lib/python3.10/site-packages/flair/models/__init__.py", line 1, in <module> from .clustering import ClusteringModel File "/Users/Helena.Boyd/.local/share/virtualenvs/nlp-j9jQos4W/lib/python3.10/site-packages/flair/models/clustering.py", line 13, in <module> from flair.datasets import DataLoader File "/Users/Helena.Boyd/.local/share/virtualenvs/nlp-j9jQos4W/lib/python3.10/site-packages/flair/datasets/__init__.py", line 125, in <module> from .biomedical import ANAT_EM File "/Users/Helena.Boyd/.local/share/virtualenvs/nlp-j9jQos4W/lib/python3.10/site-packages/flair/datasets/biomedical.py", line 25, in <module> from flair.tokenization import ( ImportError: cannot import name 'SentenceSplitter' from 'flair.tokenization' (/Users/Helena.Boyd/.local/share/virtualenvs/nlp-j9jQos4W/lib/python3.10/site-packages/flair/tokenization.py) (nlp) FAIL
@boydxh thanks for the update! The output is strange since it looks like it is trying to load some classes from old locations. Could you paste the code that throws this error?
@boydxh thanks for the update! The output is strange since it looks like it is trying to load some classes from old locations. Could you paste the code that throws this error?
Hi again, I tried to run setup.py which bumps the flair version:
`from setuptools import find_packages, setup
with open("requirements.txt") as f: required = f.read().splitlines()
setup( name="flair", version="0.12", description="A very simple framework for state-of-the-art NLP", long_description=open("README.md", encoding="utf-8").read(), long_description_content_type="text/markdown", author="Alan Akbik", author_email="alan.akbik@gmail.com", url="https://github.com/flairNLP/flair", packages=find_packages(exclude="tests"), # same as name license="MIT", install_requires=required, include_package_data=True, python_requires=">=3.7", )`
Describe the bug
I cannot download flair because of a legacy install failure with the package sentencepiece.
To Reproduce
Expected behaivor
Expected successful install of flair. If I bypass the sentencepiece wheel error by running "pip3 install flair --only-binary=sentencepiece" then flair will install but hardly any of the features (as described in the tutorials) work.
Logs and Stack traces
Screenshots
No response
Additional Context
No response
Environment
I cannot run collect_env.py because I cannot install flair.