Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cần cập nhật hướng dẫn sử dụng rõ hơn trong README #15

Open
mrquangdt opened this issue Mar 23, 2022 · 7 comments
Open

Comments

@mrquangdt
Copy link

Hi,

Bạn nào có thể hướng dẫn mình dùng thư viện này cho python với.

Mình không biết cài đặt thế nào trên môi trường ảo, nếu được cho mình chi tiết các lệnh thực hiện trên MacOS.

Tốt nhất là đóng gói thành gói để cài đặt theo kiểu: conda install VietnameseTextNormalizer hoặc pip install VietnameseTextNormalizer

@trantuanngoc
Copy link

trantuanngoc commented Jun 24, 2022

@mrquangdt b chạy jupyter notebook:
link github

@langmaninternet
Copy link
Owner

Đây của mình là source code, ko phải file chạy luôn
để chạy được bạn cần phải build được trước
Step 0: đối với MAC OSX bạn cần cài đặt được brew trước đó nhé

Step 1: sau đó cài 2 gói thư viện sau
brew install python3-dev
brew install g++

Step 2: mở terminal lên cấu hình biến môi trường
chú ý Cellar là tên user của mình, sẽ ko có trên máy tính của bạn
bạn phải tự tìm ra đường dẫn tuyệt đối đến thư mục trên máy bạn

export PYTHON3_DEV_INCULE=/usr/local/Cellar/python@3.9/3.9.1_3/Frameworks/Python.framework/Versions/3.9/include
export PYTHON3_LIB_PATH=/usr/local/Cellar/python@3.9/3.9.1_3/Frameworks/Python.framework/Versions/3.9/lib
export PYTHON3_LIB_NAME=python3.9
export GPP_COMPILER=g++

Step 3: cd đến thư mục source code mà make

@tvlanh
Copy link

tvlanh commented Jul 7, 2022

hi,
Mình đã làm theo hướng dẫn,đến bước make thì báo lỗi này,a/c xem giúp e với ạ!
VietnameseTextNormalizer % make -j
$GPP_COMPILER -c -fPIC -O3 -Wall main.cpp -I$PYTHON3_DEV_INCULE -o ObjectPython3/main.o ;
/bin/sh: -c: command not found
make: *** [ObjectPython3/main.o] Error 127

@langmaninternet
Copy link
Owner

bạn chưa setup giá trị cho biến môi trường GPP_COMPILER nhé bạn
bạn cần chạy các câu lệnh export trước khi chạy câu lệnh make

Note: export chỉ có ý nghĩa tạm thời thôi, sau khi bạn close cái terminal là các biến export mất hết
vì thế bạn cần chạy các câu lệnh export trước khi chạy câu lệnh make

@dinhgiangltk
Copy link

@trantuanngoc hi bạn, mình chạy tới bước số 3 thì gặp lỗi như sau. Nhờ bạn hướng dẫn giúp ạ.

input >>>
%env PYTHON3_DEV_INCULE=/usr/include/python3.7
%env GPP_COMPILER=g++
%cp -f MakefilePython3 Makefile

output >>>
env: PYTHON3_DEV_INCULE=/usr/include/python3.7
env: GPP_COMPILER=g++
The system cannot find the file specified.

@dinhgiangltk
Copy link

@langmaninternet hi anh Quang, em chạy thử thì báo lỗi không có module VietnameseTextNormalizer khi em import. Em đọc README thì thấy có note như hình bên dưới. Anh cho em hỏi file VietnameseTextNormalizer.so ở đâu vậy ạ? Em tìm hoài ko thấy.
image

@langmaninternet
Copy link
Owner

@langmaninternet hi anh Quang, em chạy thử thì báo lỗi không có module VietnameseTextNormalizer khi em import. Em đọc README thì thấy có note như hình bên dưới. Anh cho em hỏi file VietnameseTextNormalizer.so ở đâu vậy ạ? Em tìm hoài ko thấy. image

git này của anh là source code để build ra file VietnameseTextNormalizer.so
em làm theo hướng dẫn build để ra file so nhé

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants