Spaces:
Sleeping
Sleeping
ConGr Visualizer Web Interface
A web-based interface for exploring and visualizing ConGrs (Consensus Graphs) from research datasets.
Features
Browse Existing Graphs
- Dataset Selection: Choose from available datasets (BIO, FP, HIST, REFS, MATH, AIME)
- Entity Selection: Browse entities within each dataset
- Model Information: See which language models were used for each graph
- Graph Visualization: Interactive network visualization using vis.js
- Metadata Display: View graph statistics and consensus text
Create New Graphs
- Text Input: Enter multiple text sequences to create new ConGrs
- Real-time Visualization: See the graph structure as it's created
- Save Functionality: Save created graphs to pickle files
Available Datasets
- BIO: Biography datasets with various public figures
- FP: False Presupposition datasets
- HIST: Historical events datasets
- REFS: Reference datasets
- MATH: Mathematical problem datasets
- AIME: American Invitational Mathematics Examination datasets
Models
The graphs are generated using various language models:
- olmo7b
- qwen72b
- llama70b
- llama8b
Installation
- Install dependencies:
pip install -r requirements.txt
- Start the server:
python server.py
- Open your browser and navigate to:
http://localhost:8080
Usage
Browsing Existing Graphs
- Select Dataset: Choose a dataset from the dropdown menu
- Select Entity: Choose an entity from the available options
- View Graph: The graph will be automatically loaded and displayed
- View Information: Graph metadata and consensus text will be shown
Creating New Graphs
- Enter Text: Input multiple text sequences (one per line)
- Create Graph: Click "Create Graph" to generate a new ConGr
- Save Graph: Optionally save the graph to a pickle file
API Endpoints
GET /api/datasets- Get available datasetsGET /api/entities?dataset=<dataset>- Get entities for a datasetPOST /api/load_existing_graph- Load an existing graphPOST /api/create_graph- Create a new graph from text sequencesPOST /api/save_graph- Save a graph to file
Testing
Run the test script to verify the server is working correctly:
python test_server.py
File Structure
web_interface/
βββ server.py # Flask server
βββ index.html # Web interface
βββ requirements.txt # Python dependencies
βββ test_server.py # Test script
βββ README.md # This file
Graph Information
When viewing a graph, you can see:
- Dataset: The source dataset
- Entity: The specific entity or topic
- Model: The language model used
- Sequences: Number of input sequences
- Nodes: Number of nodes in the graph
- Edges: Number of edges in the graph
- Consensus: The consensus text generated from the graph
Visualization Features
- Hierarchical Layout: Graphs are displayed in a hierarchical structure
- Color Coding: Consensus nodes are highlighted in green
- Interactive: Zoom, pan, and hover for more information
- Responsive: Works on desktop and mobile devices