47fac22230
- .claude/CLAUDE.md - .claude/commands/subagentes.md - .claude/rules/INDEX.md - .mcp.json - bash/functions/cybersecurity/analyze_dns.md - bash/functions/cybersecurity/audit_http_headers.md - bash/functions/cybersecurity/audit_ssh_config.md - bash/functions/cybersecurity/check_firewall.md - bash/functions/cybersecurity/detect_suspicious_users.md - bash/functions/cybersecurity/encrypt_file.md - ... Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1.6 KiB
1.6 KiB
name, kind, lang, domain, version, purity, signature, description, tags, uses_functions, uses_types, returns, returns_optional, error_type, imports, params, output, tested, tests, test_file_path, file_path
| name | kind | lang | domain | version | purity | signature | description | tags | uses_functions | uses_types | returns | returns_optional | error_type | imports | params | output | tested | tests | test_file_path | file_path | |||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| embedding_encode | function | py | infra | 1.0.0 | impure | def embedding_encode(model: SentenceTransformer, texts: list, mode: str = 'document') -> list | Genera embeddings normalizados para textos. Aplica prefijos e5 automaticamente segun mode (document/query). |
|
|
false | error_go_core |
|
|
list[list[float]]: embeddings normalizados (L2=1), dimensión 384 para e5-small | false | python/functions/embedding/model.py |
Ejemplo
model = embedding_load_model(".local/models/e5-small")
# Indexar documentos
doc_embs = embedding_encode(model, ["La IA transforma la industria", "Python es versatil"], mode="document")
# Buscar
query_embs = embedding_encode(model, ["¿Que es machine learning?"], mode="query")
Notas
mode="document" agrega prefijo "passage: ", mode="query" agrega "query: ". Estos prefijos son requeridos por modelos e5 para retrieval optimo. Los embeddings retornados son float32 normalizados (norma L2 = 1). Para e5-small la dimension es 384. Throughput ~1900 docs/s en CPU.