SigmaTriple / README.md
feras-vbrl's picture
Upload 7 files
d876e1d verified

A newer version of the Streamlit SDK is available: 1.45.0

Upgrade
metadata
title: SigmaTriple
emoji: πŸ”
colorFrom: blue
colorTo: indigo
sdk: streamlit
sdk_version: 1.32.0
app_file: app.py
pinned: false

Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference

SigmaTriple: Knowledge Graph Extraction from Markdown

This Hugging Face Space provides a Streamlit interface for extracting knowledge graphs from markdown text using the SciPhi/Triplex model.

Features

  • Extract Knowledge Graphs: Automatically identify entities and relationships from markdown text
  • Customizable Entity Types and Predicates: Define the types of entities and relationships you want to extract
  • Batch Processing: Process large markdown files efficiently using vllm
  • Interactive Visualization: View the extracted knowledge graph as an interactive network diagram
  • File Upload Support: Upload markdown files directly or input text manually

How It Works

  1. The application uses the SciPhi/Triplex model, which is fine-tuned for knowledge graph extraction
  2. Markdown text is processed to extract plain text content
  3. For large texts, batch processing is applied with overlapping chunks to ensure context is maintained
  4. The model identifies entities and relationships based on the specified entity types and predicates
  5. Results are parsed and visualized as an interactive knowledge graph

Usage

  1. Configure Entity Types and Predicates:

    • In the sidebar, customize the entity types (e.g., PERSON, ORGANIZATION) and predicates (e.g., WORKS_AT, FOUNDED) you want to extract
  2. Input Text:

    • Choose between direct text input or file upload
    • For text input, simply paste your markdown text in the provided area
    • For file upload, select a markdown (.md), markdown (.markdown), or text (.txt) file
  3. Extract Knowledge Graph:

    • Click the "Extract Knowledge Graph" button to process the text
    • View the raw model output, extracted triplets table, and interactive visualization

Technical Details

  • Uses the SciPhi/Triplex model for knowledge graph extraction
  • Implements vllm for efficient batch processing when available
  • Falls back to standard transformers library if vllm is not available
  • Visualizes knowledge graphs using NetworkX and PyVis

Example Use Cases

  • Research Papers: Extract key concepts and relationships from academic papers
  • Documentation: Create knowledge graphs from technical documentation
  • Content Analysis: Identify key entities and relationships in articles or blog posts
  • Educational Content: Visualize relationships between concepts in educational materials

Limitations

  • The quality of extraction depends on the clarity and structure of the input text
  • Very large documents may require significant processing time
  • The model may not capture all relationships, especially those requiring deep contextual understanding

Credits