无法在Google应用引擎中使用TfidfVectorizer [英] unable to use TfidfVectorizer in Google app engine

查看:205
本文介绍了无法在Google应用引擎中使用TfidfVectorizer的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在Google App Engine中编写一个python程序,它使用sklearn中的TfidfVectorizer来计算tf-idf。



我添加了sklearn库并将其导入为:

  from sklearn.feature_extraction.text import TfidfVectorizer 

然而,它给了我 no模块命名_check_build ,虽然它在库中已导入。



注意:我在纯python中有相同的代码,它工作得很好, python语法或导入没有任何问题;这个问题从GAE开始。



您是否知道解决这个问题的方法? / div>

如果您没有使用任何特定于GAE的工具,请尝试在 Heroku 上部署您的应用程序。
它让你部署一个包含所有已安装库的整个虚拟环境。具体来说,Scikit-learn在Heroku上工作得很好。例如,查看此Github回购


I am writing a python program in Google App Engine that calculates tf-idf using TfidfVectorizer in sklearn.

I have added sklearn library and have the import as:

from sklearn.feature_extraction.text import TfidfVectorizer

However it gives me no module named _check_build although it is in the library that I have imported.

Note: I have the same code in pure python and it works just fine so there is nothing wrong with the python syntax or imports; The problem starts with GAE.

Do you know any way to solve this issue?

解决方案

if you are not using any of GAE-specific tools, try deploying your app on Heroku. It let's you deploy a whole virtual environment with all the installed libraries on it. Specifically, Scikit-learn works on Heroku just fine. Check this Github repo for example.

这篇关于无法在Google应用引擎中使用TfidfVectorizer的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆