← all repositories
shibing624/text2vec

Chinese Sentence Embeddings, Reimplemented and Ranked

text2vec implements and benchmarks Word2Vec, SBERT, CoSENT, and BGE specifically for Chinese text matching, then releases the models that win its own leaderboards.

text2vec
Not currently ranked — collecting fresh signals.
star history

What it does

text2vec is a Python toolkit that turns words, sentences, and paragraphs into vectors. It bundles PyTorch reimplementations of Word2Vec, Sentence-BERT, CoSENT, and BGE, and ships pretrained models tuned for Chinese text-similarity tasks. The project publishes extensive evaluation tables on Chinese benchmarks such as ATEC and LCQMC, treating Chinese semantic matching as a first-class problem rather than an afterthought.

The interesting bit

Most embedding libraries are English-first; text2vec flips the script by training and comparing models on native Chinese datasets. Its CoSENT implementation uses a ranking loss that the author claims converges faster and scores higher than SBERT on their own benchmarks—an admission that the training objective should mimic the cosine-similarity prediction step, not merely slap a softmax classifier on top.

Key highlights

  • Reimplements SBERT, CoSENT, and BGE in PyTorch rather than merely wrapping upstream transformers.
  • Ships ready-made models (e.g., text2vec-base-chinese, text2vec-bge-large-chinese) trained on Chinese NLI and STS data.
  • Includes a fast Word2Vec baseline using Tencent AI Lab’s 8-million-word Chinese embeddings for high-QPS retrieval.
  • Supports multi-GPU and multi-CPU inference via multiprocessing, plus a CLI for batch vectorization.
  • Publishes head-to-head benchmarks across Chinese datasets (ATEC, BQ, LCQMC, PAWSX) and English STS-B.

Verdict

Developers building Chinese search, recommendation, or paraphrase detection should grab this instead of retrofitting English embeddings. If your pipeline is strictly English and already relies on sentence-transformers, this is mostly a curiosity.

Frequently asked

What is shibing624/text2vec?
text2vec implements and benchmarks Word2Vec, SBERT, CoSENT, and BGE specifically for Chinese text matching, then releases the models that win its own leaderboards.
Is text2vec open source?
Yes — shibing624/text2vec is open source, released under the Apache-2.0 license.
What language is text2vec written in?
shibing624/text2vec is primarily written in Python.
How popular is text2vec?
shibing624/text2vec has 5k stars on GitHub.
Where can I find text2vec?
shibing624/text2vec is on GitHub at https://github.com/shibing624/text2vec.

heatdrop uses Google Analytics to see which pages get read — nothing else. Your call. How we handle data.