我在运行任何与 nltk 相关的内容时遇到了一些重大问题。
什么有效:
running python script with nltk on my pc
running python script without nltk from a page on my server which is accessed remotely or locally
什么不起作用:
running python script with nltk from a php script on my server which is accessed remotely or locally
我尝试过的:
converting the python script into an exe
running python from c++ which is run from php
playing around with php.ini file
基本上我的问题是,如果我执行一个包含来自 php 的 nltk 相关代码的 python 文件,就会发生错误,我不知道是什么,我尝试从 python 脚本打印到文件,它会创建文件,但它保持空白,这就是我能说的。
目前,我也在尝试设置 cgi,这样我就可以尝试从 perl 运行 python 脚本或直接使用 python 作为 cgi,但在让 cgi 工作时遇到了问题。
伙计们有什么想法吗?
在经历了很多脑痛之后,我不得不转向使用 php 来进行词形还原。
PhPMorphy作为nltk的替代品做得很好。