语言识别工具包
lidtk的Python项目详细描述
lidtk公司
语言识别工具包lidtk是为了 调查语言表现的现状。在
安装
建议安装clana的方法是:
$ pip install lidtk --user
如果需要最新版本:
^{pr2}$我建议您使用WiLI-2018 dataset。在
使用
$ lidtk --help
Usage: lidtk [OPTIONS] COMMAND [ARGS]...
Options:
--version Show the version and exit.
--help Show this message and exit.
Commands:
analyze-data Utility function for the languages...
analyze-unicode-block Analyze how important a Unicode block is for...
char-distrib Use the character distribution language...
cld2 Use the CLD-2 language classifier.
create-dataset Create sharable dataset from downloaded...
download Download 1000 documents of each language.
google-cloud Use the CLD-2 language classifier.
langdetect Use the langdetect language classifier.
langid Use the langid language classifier.
map Map predictions to something known by WiLI
nn Use a neural network classifier.
textcat Use the CLD-2 language classifier.
tfidf_nn Use the TfidfNNClassifier classifier.
例如:
$ lidtk cld2 predict --text 'This is a test.'
eng
通常的顺序是:
lidtk download
:请使用WiLI-2018,而不是自己下载数据集。在lidtk create-dataset
:如果使用WiLI-2018,则可以跳过此步骤lidtk analyze-unicode-block --start 0 --end 128
lidtk tfidf_nn train vectorizer --config lidtk/classifiers/config/tfidf_nn.yaml
lidtk tfidf_nn train vectorizer --config lidtk/classifiers/config/tfidf_nn.yaml
lidtk tfidf_nn wili --config lidtk/classifiers/config/tfidf_nn.yaml
或者直接使用:
$ lidtk cld2 predict --text 'This text is written in some language.'
eng
发展
使用tox
检查测试。在
- 项目
标签: