monpa-team / monpa

MONPA 罔拍是一個提供正體中文斷詞、詞性標註以及命名實體辨識的多任務模型

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

AttributeError: module 'monpa' has no attribute 'cut'

jay0932 opened this issue · comments

import monpa
sentence = "蔡英文總統今天受邀參加台北市政府所舉辦的陽明山馬拉松比賽。"
result = monpa.cut(sentence)

for t in result:
print(t)

Traceback (most recent call last):
File "monpa.py", line 1, in
import monpa
File "/Users/jay/py/tmu/monpa.py", line 5, in
result = monpa.cut(sentence)
AttributeError: module 'monpa' has no attribute 'cut'

Python 3.6.8 :: Anaconda custom (64-bit) / MacOS & Ubuntu16
1.Can't Download model-511.pt
2. Error Code AttributeError: module 'monpa' has no attribute 'cut'

please don't use "monpa" as your python file name since you import monpa that will make confusion.

The download link is fine. in case you download an incomplete model file, please delete model-511.pt and import monpa again for initial downloading. you can find the monpa package installed path by

import os
import monpa
os.path.dirname(os.path.abspath(monpa.__file__))

please don't use "monpa" as your python file name since you import monpa that will make confusion.

The download link is fine. in case you download an incomplete model file, please delete model-511.pt and import monpa again for initial downloading. you can find the monpa package installed path by

import os
import monpa
os.path.dirname(os.path.abspath(monpa.__file__))

rename file name ,it is work.
Thanks!