Skip to content
Back to skills

Text2vec

ASecurity

"Operate text2vec for text embeddings, similarity search, model

  • 247 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added September 9, 2026
devopspythonbashfastapiapibackend

Works with

  • cli
  • api

Security analysis

A100/100

Pro scans all 20 files and shows the line behind each finding

Scanned September 9, 2026

npx -y skills add VectorSpaceLab/AREX-Skill --skill text2vec --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Text2vec?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Text2vec
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/vectorspacelab-text2vec/badge)](https://www.skillsdirectory.com/skills/vectorspacelab-text2vec)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: text2vec
description: "Operate text2vec for text embeddings, similarity search, model
  fine-tuning, evaluation, and serving without reopening the source repository."
disable-model-invocation: true
metadata:
  disco-role: operating
license: Apache 2.0
---

# text2vec

Use this repo skill when a task involves the `text2vec` Python package, Chinese or multilingual sentence embeddings, text similarity, BM25 fallback retrieval, CoSENT/Sentence-BERT/BGE fine-tuning, or text2vec service templates.

## First checks

1. Install a compatible PyTorch build before expecting public model APIs to import.
2. Install `text2vec` and run a no-download import check:

```bash
python -c "from text2vec import SentenceModel, Similarity, BM25; print('text2vec ok')"
text2vec -h
```

3. For a safer environment probe, run the bundled helper from this skill:

```bash
python scripts/check_text2vec_env.py
```

Read [references/installation.md](references/installation.md) for optional dependency and backend decisions. Read [references/troubleshooting.md](references/troubleshooting.md) for cross-cutting install, model download, CUDA, data, CLI, and service failures.

## Route by task

| User task | Read |
|---|---|
| Generate sentence embeddings, use `SentenceModel`, run the `text2vec` CLI, choose `EncoderType`, preserve batch output rows, use Word2Vec, or understand NGram caveats | [sub-skills/embeddings/SKILL.md](sub-skills/embeddings/SKILL.md) |
| Score sentence pairs, use `Similarity`, call `cos_sim` / `semantic_search`, run dense top-k retrieval, or use BM25 as a no-network lexical fallback | [sub-skills/similarity-search/SKILL.md](sub-skills/similarity-search/SKILL.md) |
| Validate fine-tuning data, construct CoSENT/Sentence-BERT/BERT-match/BGE training commands, understand `train_model` parameters, or handle multi-GPU/bf16 training boundaries | [sub-skills/training-finetuning/SKILL.md](sub-skills/training-finetuning/SKILL.md) |
| Choose among released models, interpret Spearman/QPS tables, summarize local score files, or plan MTEB/C-MTEB-style evaluation without running large downloads by default | [sub-skills/evaluation-benchmarks/SKILL.md](sub-skills/evaluation-benchmarks/SKILL.md) |
| Build a FastAPI endpoint, compare FastAPI/Jina/Gradio service patterns, or avoid blocking forever-server verification | [sub-skills/serving-deployment/SKILL.md](sub-skills/serving-deployment/SKILL.md) |

## Package surface at a glance

- Main import: `import text2vec`.
- Important inference APIs: `SentenceModel`, `SBert`, `EncoderType`, `Word2Vec`, `BM25`, `Similarity`, `SimilarityType`, `EmbeddingType`, `cos_sim`, `semantic_search`.
- Training APIs: `CosentModel`, `SentenceBertModel`, `BertMatchModel`, `BgeModel`, plus text-matching and BGE dataset loaders.
- CLI entry point: `text2vec`, with required `--input_file` and optional `--output_file`, `--model_type`, `--model_name`, `--encoder_type`, `--batch_size`, `--max_seq_length`, `--chunk_size`, `--device`, `--show_progress_bar`, `--normalize_embeddings`, and `--multi_gpu`.
- Default neural model names usually require Hugging Face access unless cached. Prefer a local HF-compatible model directory for offline smoke tests.
- Word2Vec requires `gensim` and either a local vector file or the built-in Tencent lightweight vector download.

## Bundled root files

- [references/installation.md](references/installation.md): public install variants, required `torch` note, optional dependencies, backend choices, and environment checks.
- [references/troubleshooting.md](references/troubleshooting.md): cross-skill failure modes and recovery steps.
- [references/repo-provenance.md](references/repo-provenance.md): source snapshot used to create this skill; read before refresh decisions.
- [references/repo-routing-metadata.json](references/repo-routing-metadata.json): structured router metadata for managed repo-skill import.
- [scripts/check_text2vec_env.py](scripts/check_text2vec_env.py): no-download diagnostic helper for imports, optional deps, torch backend, BM25, `cos_sim`, and `semantic_search`.

## Operating rules

- Do not run default model downloads, full training, benchmarks, JinaHub fetches, Gradio launches, or long-lived servers unless the user explicitly approves network/runtime side effects.
- Do not use synthetic CPU smoke checks as proof of CUDA, bf16, multi-GPU, or production-scale training coverage.
- Prefer bundled validators and helpers before expensive commands: data validation before training, no-network BM25 before dense retrieval when embeddings are absent, and local model directories before default downloads.
- For stale-source decisions, compare the current checkout against [references/repo-provenance.md](references/repo-provenance.md) and refresh if APIs, docs, examples, tests, or package metadata changed.

Files in this skill

  • SKILL.md4.7 KB
  • references/installation.md3.7 KB
  • references/repo-provenance.md1.9 KB
  • references/repo-routing-metadata.json422 B
  • references/troubleshooting.md4.2 KB
  • scripts/check_text2vec_env.py5.2 KB
  • sub-skills/embeddings/SKILL.md2 KB
  • sub-skills/embeddings/references/api-reference.md7.1 KB
  • sub-skills/embeddings/references/troubleshooting.md5.1 KB
  • sub-skills/embeddings/references/word2vec-and-ngram.md3.9 KB
  • sub-skills/embeddings/references/workflows.md6.3 KB
  • sub-skills/embeddings/scripts/encode_texts.py12.4 KB
  • sub-skills/embeddings/scripts/make_tiny_word2vec_fixture.py2.6 KB
  • sub-skills/evaluation-benchmarks/SKILL.md2.3 KB
  • sub-skills/evaluation-benchmarks/references/evaluation-workflows.md5.5 KB
  • sub-skills/evaluation-benchmarks/references/model-overview.md5.7 KB
  • sub-skills/evaluation-benchmarks/references/troubleshooting.md2.7 KB
  • sub-skills/evaluation-benchmarks/scripts/summarize_scores.py12.1 KB
  • sub-skills/serving-deployment/SKILL.md1.6 KB
  • sub-skills/serving-deployment/references/serving-workflows.md7.3 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…