跳转到主要内容

语言识别工具包

项目描述

DOI PyPI version Python Support Build Status Code style: black GitHub last commit GitHub commits since latest release (by SemVer) CodeFactor

lidtk

lidtk - 语言识别工具包 - 被编写用于研究语言性能的当前状态。

安装

安装lidtk的推荐方法是

$ pip install lidtk --user

如果您想获取最新版本

$ git clone https://github.com/MartinThoma/lidtk.git; cd lidtk
$ pip install -e . --user

我建议获取WiLI-2018数据集

用法

$ 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

通常的顺序是

  1. lidtk download:请使用WiLI-2018而不是自己下载数据集。
  2. lidtk create-dataset:如果您使用WiLI-2018,可以跳过此步骤
  3. lidtk analyze-unicode-block --start 0 --end 128
  4. lidtk tfidf_nn train vectorizer --config lidtk/classifiers/config/tfidf_nn.yaml
  5. lidtk tfidf_nn train vectorizer --config lidtk/classifiers/config/tfidf_nn.yaml
  6. lidtk tfidf_nn wili --config lidtk/classifiers/config/tfidf_nn.yaml

或者直接使用一个

$ lidtk cld2 predict --text 'This text is written in some language.'

eng

开发

使用tox检查测试。

项目详细信息


下载文件

下载适合您平台的文件。如果您不确定选择哪个,请了解更多关于安装包的信息。

源码分发

lidtk-0.3.0.tar.gz (38.7 kB 查看哈希值)

上传时间 源码

构建分发

lidtk-0.3.0-py3-none-any.whl (54.7 kB 查看哈希值)

上传时间 Python 3

支持