unsupervised-pos-tagging
unsupervised-pos-tagging copied to clipboard
Seems like makefile's result is broken!
Hi! I translated your instruction by Google Translate and tried to compile .so files as described, but /bayesian_hmm/run/train_en.py
returns the following:
File "train_en.py", line 2, in <module>
import treetaggerwrapper
ModuleNotFoundError: No module named 'treetaggerwrapper'
I also found out that import bhmm
doesn't work also:
ImportError: /home/*****/unsupervised-pos-tagging/bayesian-hmm/run/bhmm.so: undefined symbol: _ZN5boost7archive23basic_binary_oprimitiveINS0_15binary_oarchiveEcSt11char_traitsIcEE4saveERKNSt7__cxx1112basic_stringIcS4_SaIcEEE
make install
didn't work for me, so I've used make install_ubuntu
and it didn't give me any error message, and bhmm.so
exists in run
directory.
I used boost 1.64
Any suggestions how to fix this?
Hi. I forgot to write how to install treetaggerwrapper.
pip3 install treetaggerwrapper
Is the path of boost in the makefile correct?
When i run make install
it yields around 20 messages like
/home/****/anaconda3/pkgs/boost-cpp-1.64.0-1/include/boost/type_traits/detail/ice_eq.hpp:17:71: note: #pragma message: NOTE: Use of this header (ice_eq.hpp) is deprecated
# pragma message("NOTE: Use of this header (ice_eq.hpp) is deprecated")
``` and doesn't display any error message (as well as any success message, simply finishes)
Did you set LD_LIBRARY_PATH to include the directory where the libboost_serialization.so is?
export LD_LIBRARY_PATH=/path/to/boost/libs:$LD_LIBRARY_PATH
Actually I did not, but it didn't change anything. While my BOOST path was /home/******/anaconda3/pkgs/boost-cpp-1.64.0-1
, I added to LD_LIBRARY_PATH the following: /home/******/anaconda3/pkgs/boost-cpp-1.64.0-1/lib/
Please run the following command:
ldd bhmm.so
It said me the following:
linux-vdso.so.1 => (0x00007fff1bdfe000)
libstdc++.so.6 => /home/******/anaconda3/lib/libstdc++.so.6 (0x00007f1945441000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f1945138000)
libgcc_s.so.1 => /home/******/anaconda3/lib/libgcc_s.so.1 (0x00007f1944f26000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f1944b5c000)
/lib64/ld-linux-x86-64.so.2 (0x00007f19459f3000)
The error still persists, but the undefined symbol
value changed a bit.
If compilation is done correctly, libboost_serialization.so should be displayed.
linux-vdso.so.1 => (0x00007ffd6f3c7000)
libpython3.5m.so.1.0 => /usr/lib/x86_64-linux-gnu/libpython3.5m.so.1.0 (0x00007ff49c77a000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007ff49c55d000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007ff49c358000)
libutil.so.1 => /lib/x86_64-linux-gnu/libutil.so.1 (0x00007ff49c155000)
libboost_serialization.so.1.65.1 => /home/musyoku/boost/lib/libboost_serialization.so.1.65.1 (0x00007ff49bf13000)
libboost_python3.so.1.65.1 => /home/musyoku/boost/lib/libboost_python3.so.1.65.1 (0x00007ff49bccc000)
libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007ff49b943000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007ff49b63a000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007ff49b422000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007ff49b058000)
libexpat.so.1 => /lib/x86_64-linux-gnu/libexpat.so.1 (0x00007ff49ae2f000)
libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007ff49ac14000)
/lib64/ld-linux-x86-64.so.2 (0x00005636624fa000)
Well, i tried newer (1.65.0) BOOST version and still got no success. Despite the fact that locate serialization.so
finds me a something and I export path to the found folder to LD_LIBRARY_PATH, I still can't achieve proper output of ldd bhmm.so
So I have 2 questions:
- Could you provide a Docker container with working program?
- Are there any other realizations of unsupervised POS-tagging algorithms that don't require BOOST? I've never gotten problems w/ Python DL frameworks and Python itself.
Please modify the makefile as follows:
install_ubuntu:
$(CC) -Wl,--no-as-needed -Wno-deprecated -Wl,--no-undefined $(INCLUDE) $(SOFLAGS) src/python.cpp src/bhmm/*.cpp src/python/*.cpp -o run/bhmm.so -O3 $(LDFLAGS)
https://stackoverflow.com/questions/2356168/force-gcc-to-notify-about-undefined-references-in-shared-libraries https://stackoverflow.com/questions/1780003/import-error-on-boost-python-hello-program
- It is difficult to learn docker for me.
- I also looked for an implementation, but I didnt find it.
I am using Ubuntu 16.04. I installed Boost 1.65 from source. http://www.boost.org/users/history/version_1_65_0.html
./bootstrap.sh --with-python=python3 --with-python-version=3.5
./b2 python=3.5 -d2 -j4 --prefix /home/musyoku/boost install
python3 --version
Python 3.5.2
which python3
/usr/bin/python3
Hello! I tried to compile bhmm.so but getting an error of make: no rule to make
install target stop.
please have a look and suggest, how to fix this issue?
I have installed boost 1.55 on ubuntu 16.04.6 and python 3.7.4. if they matter for the above error let me know.