Skip to main content

Text to Vector Tool, encode text

Project description

text2vec

text2vec, chinese text to vetor.(文本向量化表示工具,包括词向量化、句子向量化、段落向量化)

Install

  • pip3 install text2vec

or

git clone https://github.com/shibing624/text2vec.git
cd text2vec
python3 setup.py install

Usage:

import text2vec

a = '如何更换花呗绑定银行卡'
b = '花呗更改绑定银行卡'
emb = text2vec.encode(a)
print(emb)
s = text2vec.score(a, b)
print(s)

output:

0.9569100456524151

Reference

  1. 将句子表示为向量(上):无监督句子表示学习(sentence embedding)
  2. 将句子表示为向量(下):无监督句子表示学习(sentence embedding)
  3. 《A Simple but Tough-to-Beat Baseline for Sentence Embeddings》[Sanjeev Arora and Yingyu Liang and Tengyu Ma, 2017]

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

text2vec-0.1.2.tar.gz (47.9 kB view details)

Uploaded Source

File details

Details for the file text2vec-0.1.2.tar.gz.

File metadata

  • Download URL: text2vec-0.1.2.tar.gz
  • Upload date:
  • Size: 47.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.4.2 requests/2.21.0 setuptools/42.0.1 requests-toolbelt/0.8.0 tqdm/4.38.0 CPython/3.6.6

File hashes

Hashes for text2vec-0.1.2.tar.gz
Algorithm Hash digest
SHA256 d139d543c7cc201c53c32765d329c3c11e8daf55bdef8988b44475ac008bf458
MD5 54f731bdb4bbcaa96ffa3e3b37a73b1d
BLAKE2b-256 9699c9b244f77d9afcd576790677dd73347a84ff40da5ca03737c0e39ea31dd1

See more details on using hashes here.

Supported by

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