CtrlK
BlogDocsLog inGet started
Tessl Logo

extract

Run the full Semantica semantic extraction pipeline on a file or selected text — NER, relations, events, coreference resolution, triplets, and validation. Clears result cache before each run. Returns Markdown tables with entity/relation/event/triplet results and inline validator warnings.

65

Quality

77%

Does it follow best practices?

Run evals on this skill

Adds up to 20 points to the overall score

View guide

SecuritybySnyk

High

Do not use without reviewing

Fix and improve this skill with Tessl

tessl review fix ./plugins/skills/extract/SKILL.md
SKILL.md
Quality
Evals
Security

/semantica:extract

Run the full extraction pipeline. Usage: /semantica:extract [file_path | "inline text"]

$ARGUMENTS = file path, inline text in quotes, or blank (uses active editor file).


Steps

1. Resolve the source.

  • If $ARGUMENTS is a readable file path → text = open(path).read()
  • If it's quoted inline text → use directly
  • If blank → use the active editor file

2. Clear the result cache to prevent cross-invocation pollution:

from semantica.semantic_extract.cache import _result_cache
_result_cache.clear()

3. Run the full pipeline:

from semantica.semantic_extract import (
    NamedEntityRecognizer,
    RelationExtractor,
    EventDetector,
    CoreferenceResolver,
    TripletExtractor,
    ExtractionValidator,
)

# Named Entity Recognition
ner = NamedEntityRecognizer()
entities = ner.extract(text)

# Relation Extraction
rel = RelationExtractor()
relations = rel.extract(text)

# Event Detection
evt = EventDetector()
events = evt.extract(text)

# Coreference Resolution — resolve pronouns/aliases before extraction
coref = CoreferenceResolver()
resolved_text = coref.resolve(text)

# Triplet Extraction (subject–predicate–object)
triplet = TripletExtractor()
triplets = triplet.extract(resolved_text)

# Validate quality
validator = ExtractionValidator()
issues = validator.validate(entities, relations)

4. Report validator warnings above results:

⚠ ExtractionValidator: <warning message>

5. Return results as Markdown tables:

Entities (N total)

LabelTypeConfidenceSpan

Relations (M total)

SourceRelation TypeTargetConfidence

Events (K total)

LabelTypeParticipantsConfidence

Triplets (J total)

SubjectPredicateObjectConfidence

6. Summary line:

Extracted: N entities, M relations, K events, J triplets — from <source>

For large files (>50KB), process in chunks and show a progress indicator. Highlight any entities appearing in the context graph already (ContextGraph.has_node(label)) with [in graph] tag.

Repository
semantica-agi/semantica
Last updated
First committed

Is this your skill?

If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.