word-discovery
word-discovery copied to clipboard
ValueError: Failed to count ngrams by KenLM.
memory参数调大调小都不行,预料并不大,done=32512 ,一直报这个错误。
你把raise ValueError('Failed to count ngrams by KenLM.')
那一句注释掉,看看能跑出正常结果不?
报相同的错误 ./count_ngrams: error while loading shared libraries: libboost_program_options.so.1.58.0: cannot open shared object file: No such file or directory
那就自己重新编译count_ngrams。
请问如何重新编译count_ngrams,会的东西比较少,还请多指教
下载库后编译:(cd 到 kenlm 目录下)
mkdir -p build
cd build
cmake ..
make -j 4
编译完成后会生成 count_ngrams 文件。 运行前需要将 build/bin 目录下的 count_ngrams 文件复制到当前 word_discovery.py 相同目录下,即可。
@YingZhuY CMake Error at /opt/homebrew/Cellar/cmake/3.21.2/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:230 (message): Could NOT find Boost (missing: Boost_INCLUDE_DIR program_options system thread unit_test_framework) (Required is at least version "1.41.0") Call Stack (most recent call first): /opt/homebrew/Cellar/cmake/3.21.2/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:594 (_FPHSA_FAILURE_MESSAGE) /opt/homebrew/Cellar/cmake/3.21.2/share/cmake/Modules/FindBoost.cmake:2345 (find_package_handle_standard_args) CMakeLists.txt:85 (find_package)
cmake不成功怎么办……
+10086.。。。
cmake ..
brew install boost