{"library":"spacy-curated-transformers","title":"spaCy Curated Transformers","type":"library","description":"spacy-curated-transformers provides efficient and curated transformer models designed for integration into spaCy processing pipelines. It wraps the `curated-transformers` library, offering specialized components and utilities for tasks like wordpiece tokenization and transformer-based embeddings within spaCy's `Doc` and `Span` objects. The library is actively maintained by Explosion, with a focus on compatibility with latest spaCy and Thinc versions, and releases often align with improvements in underlying transformer architectures.","language":"python","status":"active","last_verified":"Fri May 15","install":{"commands":["pip install spacy-curated-transformers"],"cli":null},"imports":["from spacy_curated_transformers.pipeline import CuratedTransformer","doc._.trf_data"],"auth":{"required":false,"env_vars":[]},"links":{"homepage":null,"github":"https://github.com/explosion/spacy-curated-transformers","docs":null,"changelog":null,"pypi":"https://pypi.org/project/spacy-curated-transformers/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null},"quickstart":{"code":"import spacy\n\n# To use spacy-curated-transformers, you typically load a spaCy model\n# that includes a 'transformer' component.\n# First, ensure you have a compatible model downloaded:\n# python -m spacy download en_core_web_trf\n\ntry:\n    # Load a pre-trained spaCy model that utilizes spacy-curated-transformers\n    nlp = spacy.load(\"en_core_web_trf\")\n    doc = nlp(\"Hello, world! This is a test sentence.\")\n\n    print(f\"Processed doc with {len(doc)} tokens.\")\n\n    # Access transformer data via the custom Doc extension\n    if doc._.has_extension(\"trf_data\") and doc._.trf_data is not None:\n        # `trf_data` contains tensors, alignment information, etc.\n        # For example, the transformer output for the first token:\n        print(f\"Transformer output for token 0 shape: {doc._.trf_data.tensors[0].shape}\")\n        print(f\"Transformer output for token 1 shape: {doc._.trf_data.tensors[1].shape}\")\n    else:\n        print(\"No transformer data found. Ensure a transformer pipe is in the pipeline.\")\n\nexcept Exception as e:\n    print(f\"Error loading or processing model: {e}\")\n    print(\"Please ensure 'en_core_web_trf' is downloaded using: python -m spacy download en_core_web_trf\")","lang":"python","description":"This quickstart demonstrates how to use a spaCy model that internally leverages `spacy-curated-transformers` to process text and access the transformer's output data. Users typically interact with the library through a pre-trained spaCy transformer pipeline.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":{"tag":null,"tag_description":null,"last_tested":"2026-05-15","installed_version":"2.1.2","pypi_latest":"2.1.2","is_stale":false,"summary":{"python_range":"3.10–3.9","success_rate":30,"avg_install_s":78.2,"avg_import_s":null,"wheel_type":"wheel"},"results":[{"runtime":"python:3.10-alpine","python_version":"3.10","os_libc":"alpine (musl)","variant":"spacy-curated-transformers","exit_code":1,"wheel_type":null,"failure_reason":"build_error","import_side_effects":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.10-slim","python_version":"3.10","os_libc":"slim (glibc)","variant":"spacy-curated-transformers","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"broken","install_time_s":86.8,"import_time_s":null,"mem_mb":null,"disk_size":"4.8G"},{"runtime":"python:3.11-alpine","python_version":"3.11","os_libc":"alpine (musl)","variant":"spacy-curated-transformers","exit_code":1,"wheel_type":null,"failure_reason":"build_error","import_side_effects":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.11-slim","python_version":"3.11","os_libc":"slim (glibc)","variant":"spacy-curated-transformers","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"broken","install_time_s":77.9,"import_time_s":null,"mem_mb":null,"disk_size":"4.9G"},{"runtime":"python:3.12-alpine","python_version":"3.12","os_libc":"alpine (musl)","variant":"spacy-curated-transformers","exit_code":1,"wheel_type":null,"failure_reason":"build_error","import_side_effects":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.12-slim","python_version":"3.12","os_libc":"slim (glibc)","variant":"spacy-curated-transformers","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"broken","install_time_s":69.9,"import_time_s":null,"mem_mb":null,"disk_size":"4.9G"},{"runtime":"python:3.13-alpine","python_version":"3.13","os_libc":"alpine (musl)","variant":"spacy-curated-transformers","exit_code":1,"wheel_type":null,"failure_reason":"build_error","import_side_effects":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.13-slim","python_version":"3.13","os_libc":"slim (glibc)","variant":"spacy-curated-transformers","exit_code":1,"wheel_type":null,"failure_reason":"build_error","import_side_effects":null,"install_time_s":39.1,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.9-alpine","python_version":"3.9","os_libc":"alpine (musl)","variant":"spacy-curated-transformers","exit_code":1,"wheel_type":null,"failure_reason":"build_error","import_side_effects":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.9-slim","python_version":"3.9","os_libc":"slim (glibc)","variant":"spacy-curated-transformers","exit_code":1,"wheel_type":null,"failure_reason":"timeout","import_side_effects":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null}]}}