Transformers outputs and interpretation
Extracted entities, classifications, answers, summaries, and embeddings from biomedical NLP.
Each job returns task-specific results — extracted entities, classifications, answers, summaries, or embeddings depending on what you ran. These turn unstructured text into structured knowledge you can feed into target identification, drug repurposing, or knowledge-graph construction.
Output artifacts
The transformers_inference tool wraps a generic Hugging Face pipeline() call and is not currently wired into the registered tool set or backed by a deployed Modal app — see the warning on Transformers on the platform. The field names below describe a standard Hugging Face pipeline's output shape for each task, not a verified platform-specific schema.
Each completed Transformers job returns task-specific results depending on which task you ran: ner, classification, zero_shot, qa, summarization, or embeddings. There is no separate relation-extraction task — infer relationships from co-occurring NER entities, or use qa against the source text.
NER output fields
| Field | Type | Description |
|---|---|---|
| text | string | The original input text |
| entities | array | List of extracted entity objects |
| entity.word | string | The entity text span (e.g., "EGFR") |
| entity.entity_type | string | Entity category (Drug, Gene, Disease, Chemical, Mutation, Cell Line) |
| entity.start | integer | Character start position in the text |
| entity.end | integer | Character end position in the text |
| entity.score | float | Confidence score (0-1) |
| entity_counts | object | Frequency counts by entity type |
Interpreting NER confidence scores
| Score Range | Confidence | Interpretation |
|---|---|---|
| 0.9-1.0 | Very high | Entity almost certainly correct; standard biomedical terms |
| 0.7-0.9 | High | Entity likely correct; may need verification for ambiguous terms |
| 0.5-0.7 | Moderate | Entity possibly correct; check context for false positives |
| <0.5 | Low | The pipeline still returns these; there is no confidence-threshold parameter to filter them |
Common entity patterns
- Multi-word entities: "non-small cell lung cancer" is a single Disease entity; check that boundaries are correct
- Abbreviations: Both the full form and abbreviation may be extracted separately (e.g., "epidermal growth factor receptor (EGFR)" yields two Gene mentions)
- Nested entities: Some entities may overlap (e.g., "EGFR T790M" contains both a Gene and a Mutation); both are reported
- Negated entities: Entities in negated contexts ("not associated with BRCA1") are still extracted; check surrounding text for negation
Question answering and summarization output fields
| Field | Type | Description |
|---|---|---|
| answer | string | Extracted answer span (qa) or generated summary text (summarization) |
| score | float | Confidence score (0-1); qa only |
| start / end | integer | Character offsets of the answer span in the source text (qa only) |
Text classification output fields
| Field | Type | Description |
|---|---|---|
| label | string | Predicted class label |
| score | float | Prediction confidence (0-1) |
| probabilities | object | Per-class probability distribution |
Interpreting classification
- High confidence (>0.8): Strong prediction; document clearly belongs to the assigned category
- Moderate confidence (0.5-0.8): Document may have characteristics of multiple categories
- Low confidence (~0.5): Near the decision boundary; manual review recommended
Embedding output fields
| Field | Type | Description |
|---|---|---|
| embedding | array | Dense vector representation (768-dimensional for BERT models) |
| model | string | Model used for embedding generation |
| pool_strategy | string | Pooling method used |
Using embeddings
- Cosine similarity: Compare two document embeddings for semantic similarity
- Clustering: Group documents by embedding proximity (k-means, HDBSCAN)
- Semantic search: Find documents closest to a query embedding
- Visualization: Project embeddings to 2D with t-SNE or UMAP for exploration
Batch output format
For multi-document batch jobs:
- Each document gets its own entity list, classification, answer, summary, or embedding result
- Results are keyed by document index or PMID
- Aggregate statistics include total entity counts and most frequent entities
Downloading artifacts
- JSON export: Structured annotations with all entity positions, types, and scores
- CSV export: Entity table with columns for document, entity text, type, start, end, and score
- Annotated HTML: Original text with color-coded entity highlighting
- Embedding files: NPY or CSV format for downstream ML use
Canvas visualization
When a Transformers job completes, a result card appears on the canvas showing:
- Annotated text with highlighted entities (color-coded by type)
- Entity frequency bar chart
- Classification result with confidence bar
- Answer span or generated summary (for
qaorsummarization)
Quality checks
- Verify that known entities in the input text are captured (recall check)
- Check entity boundaries for multi-word terms (no partial words)
- Confirm entity types are correct (gene vs. protein naming can be ambiguous)
- Compare extracted entities across models (BioBERT vs. PubMedBERT) for consensus
Read next
Was this page helpful?