相关疑难解决方法(0)

如何在Windows中添加到pythonpath?

我有一个托管所有Django应用程序的目录(C:\My_Projects).我想将此目录添加到我的PYTHONPATH所以我可以直接调用这些应用程序.

我尝试从Windows GUI()添加C:\My_Projects\;到我的Path变量My Computer > Properties > Advanced System Settings > Environment Variables.但它仍然没有读取coltrane模块并生成此错误:

错误:没有名为coltrane的模块

python windows environment-variables pythonpath

347
推荐指数
17
解决办法
129万
查看次数

Stanford Parser和NLTK

是否可以在NLTK中使用Stanford Parser?(我不是在谈论斯坦福POS.)

python parsing nlp nltk stanford-nlp

89
推荐指数
8
解决办法
9万
查看次数

NLTK无法找到Java文件!斯坦福POS塔格

我一直在努力让斯坦福POS Tagger工作一段时间。在一个旧的SO帖子中,我找到了以下代码(略作修改):

stanford_dir = 'C:/Users/.../stanford-postagger-2017-06-09/'

from nltk.tag import StanfordPOSTagger
#from nltk.tag.stanford import StanfordPOSTagger # I tried it both ways
from nltk import word_tokenize

# Add the jar and model via their path (instead of setting environment variables):
jar = stanford_dir + 'stanford-postagger.jar'
model = stanford_dir + 'models/english-left3words-distsim.tagger'

pos_tagger = StanfordPOSTagger(model, jar, encoding='utf8')

text = pos_tagger.tag(word_tokenize("What's the airspeed of an unladen swallow ?"))
print(text)
Run Code Online (Sandbox Code Playgroud)

但是,出现以下错误:

LookupError: 

===========================================================================
NLTK was unable to find the java file!
Use software specific configuration …
Run Code Online (Sandbox Code Playgroud)

python nlp nltk stanford-nlp

1
推荐指数
1
解决办法
4060
查看次数