Errors more
Resource u'tokenizers/punkt/english.pickle' not found. Please
use the NLTK Downloader to obtain the resource: >>>
nltk.download()
Searched in:
- '/var/www/nltk_data'
- '/usr/share/nltk_data'
- '/usr/local/share/nltk_data'
- '/usr/lib/nltk_data'
- '/usr/local/lib/nltk_data'
Traceback (most recent call last):
File "/var/www/CSCE-470-Anime-Recommender/py/app.py", line 40, in <module>
cl = NaiveBayesClassifier(Functions.classify(UserData))
File "/usr/local/lib/python2.7/dist-packages/textblob/classifiers.py", line 192, in __init__
self.train_features = [(self.extract_features(d), c) for d, c in self.train_set]
File "/usr/local/lib/python2.7/dist-packages/textblob/classifiers.py", line 169, in extract_features
return self.feature_extractor(text, self.train_set)
File "/usr/local/lib/python2.7/dist-packages/textblob/classifiers.py", line 81, in basic_extractor
word_features = _get_words_from_dataset(train_set)
File "/usr/local/lib/python2.7/dist-packages/textblob/classifiers.py", line 63, in _get_words_from_dataset
return set(all_words)
File "/usr/local/lib/python2.7/dist-packages/textblob/classifiers.py", line 62, in <genexpr>
all_words = chain.from_iterable(tokenize(words) for words, _ in dataset)
File "/usr/local/lib/python2.7/dist-packages/textblob/classifiers.py", line 59, in tokenize
return word_tokenize(words, include_punc=False)
File "/usr/local/lib/python2.7/dist-packages/textblob/tokenizers.py", line 72, in word_tokenize
for sentence in sent_tokenize(text))
File "/usr/local/lib/python2.7/dist-packages/textblob/base.py", line 64, in itokenize
return (t for t in self.tokenize(text, *args, **kwargs))
File "/usr/local/lib/python2.7/dist-packages/textblob/decorators.py", line 38, in decorated
raise MissingCorpusError()
MissingCorpusError:
Looks like you are missing some required data for this feature.
To download the necessary data, simply run
python -m textblob.download_corpora
or use the NLTK downloader to download the missing data: http://nltk.org/data.html
If this doesn't fix the problem, file an issue at https://github.com/sloria/TextBlob/issues.
我本地没有taggers/averaged_perceptron_tagger/averaged_perceptron_tagger.pickle这个文件,打开本地nltk_data,发现还真是,只有下载了
解决方法:使用nltk下载
nltk.download()
下载过程中会有个弹窗,要自己选择下载的文件,在Models里第一个averaged_perceptron_tagger,然后点击下载,如果网络环境比较好的话,很快就可以下载完成了。
(2)翻译问题
textblob 的翻译程序在
/usr/lib/python2.7/site-packages/textblob/translate.py
他主要是使用了google的翻译,代码中的链接为
url = "http://translate.google.com/translate_a/t"
所以,国内是访问不料这个网址的,所以就翻译不了
(1)找不到数据文件错误Errors more Resource u'tokenizers/punkt/english.pickle' not found. Please use the NLTK Downloader to obtain the resource: >>> nltk.download() ...
一、
TEXT
和
BLOB
的区别
TEXT
和
BLOB
家族之间仅有的不同是
BLOB
类型存储的是二进制数据,没有排序规则或字符集,而
TEXT
类型有字符集或排序规则。说白了如果要储存
中
文则选择
TEXT
。
二、默认值
问题
Strict Mode下不能设置默认值,否则会报can’t have a default value错:
mysql> create table `test`.`
text
_
blob
`(
-> `a_
text
`
text
DEFAULT ' ' ,
-> `b_
blob
`
blob
ERROR 1101 (42000):
BLOB
/
TEXT
column 'a_tex
首先将这两个压缩包解压到你环境下的Lib/site-packages下面。
每个人的环境都是不一样的所以不要抄,你只需要找到你的site-packages。
如果真的找不到就在命令行
中
直接下载,虽然不会成功,但是它会提示你要
安装
的路径。
然后在你的环境先下面按住shift然后右键打开Powershell窗口。
然后输入上面的命令(他的意思是运...
新增:与
Python
3.7一起
使用
所有直接可访问的
text
blob
_de类(例如Sentence()或Word() )都
使用
默认的德语模型初始化
不适用于德语的属性或方法会引发NotImplementedError
德语句子边界检测和标记化( NLTKPunktTokenizer )
统一
使用
指定的标记生成的所有工具( NLTKPunktTokenizer或PatternTokenizer )
使用
关键字include_punc=True的词性标记( PatternTagger )(默认为False )
标签集转换在PatternTagger与关键\u8bcdtagset='penn'|'universal'|'stts' (
+ 4.10.1 在Unix操作系统上
安装
Perl
+ 4.10.2 在 Win32上
安装
ActiveState Perl
+ 4.10.3 在 Win32 上
安装
MySQL Perl 分发
+ 4.10.4
使用
Perl DBI/DBD接口遇到的
问题
o 4.11 系统特定的
问题
+ 4.11.1 Solaris注意事项
+ 4.11.2 Solaris 2.7 注意事项
+ 4.11.3 Solaris x86 注意事项
+ 4.11.4 SunOS 4 注意事项
+ 4.11.5 Linux (所有的Linux版本)注意事项
下载运行
text
blob
包后可能会出现这样的提示:
text
blob
.exceptions.MissingCorpusError:
Looks like you are missing some required data for this feature.
To download the necessary data, simply run
python
-m
text
blob
.download...
Text
Blob
简介
Text
Blob
是一个用
Python
编写的开源的文本处理库。它可以用来执行很多自然语言处理的任务,比如,词性标注,名词性成分提取,情感分析,文本翻译,等等。
Github地...
下载nltk语料库出现getaddrinfo failed 如下错误:
这里只需将Server Index路径改成NLTK官网http://www.nltk.org/nltk_data/即可。
但是选
中
要下载的
安装
包点击Download下载,会发现下载很慢,而且很容易出错。
二. 解决nltk下载很慢
1)百度云下载扩展包。
链接:https://pan.baidu.com/s/1LWM3o7iR
String connectStr = "DefaultEndpointsProtocol=https;AccountName=<your_account_name>;AccountKey=<your_account_key>;EndpointSuffix=core.windows.net";
String containerName = "<your_container_name>";
String
blob
Name = "<your_
blob
_name>";
String filePath = "<your_local_file_path>";
// Create a
Blob
ServiceClient object
Blob
ServiceClient
blob
ServiceClient = new
Blob
ServiceClientBuilder().connectionString(connectStr).buildClient();
// Get a reference to a container
Blob
ContainerClient containerClient =
blob
ServiceClient.get
Blob
ContainerClient(containerName);
// Get a reference to a
blob
Blob
Client
blob
Client = containerClient.get
Blob
Client(
blob
Name);
// Download the
blob
to a local file
blob
Client.downloadToFile(filePath);
请注意,您需要将`<your_account_name>`,`<your_account_key>`,`<your_container_name>`,`<your_
blob
_name>`和`<your_local_file_path>`替换为您自己的值。