短语:生成给定语料库的短语
phrase的Python项目详细描述
短语
基于nltk和gensim自动生成短语的库。
安装
使用pip将包添加到python路径:
`bash pip install phrase `
用法
创建短语词典并打印出前25个短语:
`bash create_phrase_dictionary <corpus_folder> <phrase_dictionary_output_filename> `
这不是一个轻松的过程,它可能需要大量的记忆和时间,所以要注意。
测试
要运行所有测试,需要运行py.test来获取单元测试。莴苣目前正用于bdd检测。 需要从tests文件夹运行,或者将tests/添加到pythonpath中(测试使用units.helpers模块) `bash py.test PYTHONPATH=tests lettuce tests/features cd tests lettuce features/ `