Skip to main content

NLP human utils

Project description

:rocket: iNLP :facepunch:


Install

  • pip install iNLP or pip install git+https://github.com/Jie-Yuan/iNLP.git

Usage

inlp.convert

  • 简繁体转换
from inlp.convert import chinese

chinese.s2t('忧郁的台湾乌龟') # chinese.simple2tradition('忧郁的台湾乌龟')
chinese.t2s('憂郁的臺灣烏龜') # chinese.tradition2simple('憂郁的臺灣烏龜')
  • 全角半角转换
from inlp.convert import char

char.half2full("0123456789")
char.full2half("0123456789")

inlp.explode

  • 汉字拆成字
from inlp.explode import Chars

Chars().get_chars('袁') # ['土 口 衣']
  • 汉字拆成笔画
from inlp.explode import Strokes

Strokes().get_strokes('袁') # ['一', '丨', '一', '丨', 'フ', '一', 'ノ', 'フ', 'ノ', '丶']

inlp.similarity

  • 基于词库的相似度
from inlp.similarity import thesaurus

s1 = ['周杰伦', '是', '一个', '歌手']
s2 = ['刘若英', '是', '个', '演员']

thesaurus.cilin(s1, s2) # 基于词林的相似度
thesaurus.hownet(s1, s2) # 基于知网的相似度
  • 基于hash的相似度
from inlp.similarity import simhash

simhash(s1, s2)

计划:增加基于词向量相似词相似句的方法

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

iNLP-0.0.2.tar.gz (62.7 kB view details)

Uploaded Source

Built Distribution

iNLP-0.0.2-py3-none-any.whl (2.3 MB view details)

Uploaded Python 3

File details

Details for the file iNLP-0.0.2.tar.gz.

File metadata

  • Download URL: iNLP-0.0.2.tar.gz
  • Upload date:
  • Size: 62.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for iNLP-0.0.2.tar.gz
Algorithm Hash digest
SHA256 dc011ab2334f8f59a8974cbbebb684317ad5b9436d2d9b23ff9b5211e22824dc
MD5 f77853c4ceebfd1ccdbe8d8d24ee0f35
BLAKE2b-256 31a2fc50899c08517dbad42044ee74d6a7d2266620d24657e7a6150ab2de2a8f

See more details on using hashes here.

File details

Details for the file iNLP-0.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for iNLP-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 806c20ed37e985c5e75cabefa0edf1bd90f16debdfe6984ecce0778a7a478b57
MD5 03db2c3ce5bc4a376a56bec5484ee773
BLAKE2b-256 8c8a734f46ef7cb96ea286dd860b48acc7d83ea98dd923b2560f1523c70a72a0

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page