Skip to main content

    Transformers outputs and interpretation

    Extracted entities, classifications, answers, summaries, and embeddings from biomedical NLP.

    transformersoutputs

    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

    FieldTypeDescription
    textstringThe original input text
    entitiesarrayList of extracted entity objects
    entity.wordstringThe entity text span (e.g., "EGFR")
    entity.entity_typestringEntity category (Drug, Gene, Disease, Chemical, Mutation, Cell Line)
    entity.startintegerCharacter start position in the text
    entity.endintegerCharacter end position in the text
    entity.scorefloatConfidence score (0-1)
    entity_countsobjectFrequency counts by entity type

    Interpreting NER confidence scores

    Score RangeConfidenceInterpretation
    0.9-1.0Very highEntity almost certainly correct; standard biomedical terms
    0.7-0.9HighEntity likely correct; may need verification for ambiguous terms
    0.5-0.7ModerateEntity possibly correct; check context for false positives
    <0.5LowThe 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

    FieldTypeDescription
    answerstringExtracted answer span (qa) or generated summary text (summarization)
    scorefloatConfidence score (0-1); qa only
    start / endintegerCharacter offsets of the answer span in the source text (qa only)

    Text classification output fields

    FieldTypeDescription
    labelstringPredicted class label
    scorefloatPrediction confidence (0-1)
    probabilitiesobjectPer-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

    FieldTypeDescription
    embeddingarrayDense vector representation (768-dimensional for BERT models)
    modelstringModel used for embedding generation
    pool_strategystringPooling 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 qa or summarization)

    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

    Was this page helpful?

    Loading...