ABOUT ME

-

Today
-
Yesterday
-
Total
-
  • 한국어 ner 시작하기 - pytorch-bert-crf-ner 사용후기
    프로그래밍/자연어처리 2024. 8. 26. 17:07
    반응형

     

     

    flair는 사용 태그 개수가 적어서 한국어 특화된 개체명인식기를 찾다 발견했습니다. 

     

     

    https://github.com/eagle705/pytorch-bert-crf-ner.git

     

    GitHub - eagle705/pytorch-bert-crf-ner: KoBERT와 CRF로 만든 한국어 개체명인식기 (BERT+CRF based Named Entity Recogn

    KoBERT와 CRF로 만든 한국어 개체명인식기 (BERT+CRF based Named Entity Recognition model for Korean) - eagle705/pytorch-bert-crf-ner

    github.com

     

     

    우성 저장소를 클론하고.. 

     git clone https://github.com/eagle705/pytorch-bert-crf-ner.git

     

    requiremets.txt에 있는 패키지들을 설치합니다

     

    pip install -r requirements.txt

     

     

    아앗... 오류가... 


    error: subprocess-exited-with-error
    Building wheel for numpy (pyproject.toml) did not run successfully.
    exit code: 1 [807 lines of output] setup.py:67:
    RuntimeWarning: NumPy 1.19.3 may not yet support Python 3.11.

     

     

    chatgpt의 조언에 따라 python 3.8로 변경하려는데 설치가 안되어 있어서 우선 python 3.8 설치부터 진행하였습니다... 

     

    현재 Python 3.11에서 h5py==3.1.0 및 numpy==1.19.3를 설치하려다 발생한 오류는, 주로 numpy 1.19.3가 Python 3.11과 호환되지 않기 때문입니다. BLAS 및 LAPACK 라이브러리와 관련된 문제도 발생하고 있습니다. 문제를 해결하기 위해 다음 단계를 시도해 보세요: 호환되는 Python 버전 사용: numpy 1.19.3는 Python 3.11과 완전히 호환되지 않으므로, Python 버전을 3.8 또는 3.9로 낮추는 것을 고려해 보세요. 이 버전들은 numpy 1.19.3 및 h5py 3.1.0과 잘 작동합니다

     

     

    https://www.python.org/downloads/release/python-380/

     

     

     

     

     

     

    기존 ner 코드들과 패키지 충돌이 나지 않도록 아예 새로운 프로젝트를 생성해서

    python 3.8 설치를 하고 pycharm 가상환경도 3.8 버전으로 설정하였습니다. 

     

     

    그리고 다시 설치.. 

     

    ERROR: Could not find a version that satisfies the requirement mxnet==1.9.1 (from versions: 0.12.0, 0.12.1, 1.0.0, 1.0.0.post1, 1.0.0.post3, 1.0.0.post4, 1.1.0.post0, 1.2.0, 1.6.0)
    ERROR: No matching distribution found for mxnet==1.9.1
    WARNING: You are using pip version 21.1.2; however, version 24.2 is available.
    You should consider upgrading via the 'D:\PycharmProjects\pythonProject1\venv\Scripts\python.exe -m pip install --upgrade pip' command.

     

    pip 도 업그레이드를 하고 다시 설치.. 

     

     

    그리고 mxnet 버전 오류... 

     

    ERROR: Ignored the following versions that require a different python version: 3.8.0 Requires-Python >=3.9; 3.8.0rc1 Requires-Python >=3.9; 3.8.1 Requires-Python >=3.9; 3.8.2 Requires-Python >=3.9; 3.8.3 Requires-Python >=3.9; 3.8.4 Re quires-Python >=3.9; 3.9.0 Requires-Python >=3.9; 3.9.0rc2 Requires-Python >=3.9; 3.9.1 Requires-Python >=3.9; 3.9.1.post1 Requires-Python >=3.9; 3.9.2 Requires-Python >=3.9 ERROR: Could not find a version that satisfies the requirement mxnet==1.9.1 (from versions: 0.12.0, 0.12.1, 1.0.0, 1.0.0.post1, 1.0.0.post3, 1.0.0.post4, 1.1.0.post0, 1.2.0, 1.6.0) ERROR: No matching distribution found for mxnet==1.9.1

     

     

    이건 python 3.9 이상 버전이 필요하댄다.. 어쩌란건가 ㅠㅠ

     

    다시 python 3.8로 바꾸면 numpy/h5py 오류가 나서 그냥 requirements.txt 에서 mxnet 버전 다운로드했습니다.. 

    mxnet==1.8.0

     

     

    그래도 계속 같은 오류가 나네요 

     

    설치부터 이렇게 이슈가 있으면 사용하면서는 더 문제일 것 같아서 그냥  flair 사용하는 것으로 결론을 내렸습니다... 

     

     

     

     

     

     

    728x90
    반응형
Designed by Tistory.