ConGrs / web_interface /README.md
Shahzaib98's picture
initial commit
102ae18

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

  1. Install dependencies:
pip install -r requirements.txt
  1. Start the server:
python server.py
  1. Open your browser and navigate to:
http://localhost:8080

Usage

Browsing Existing Graphs

  1. Select Dataset: Choose a dataset from the dropdown menu
  2. Select Entity: Choose an entity from the available options
  3. View Graph: The graph will be automatically loaded and displayed
  4. View Information: Graph metadata and consensus text will be shown

Creating New Graphs

  1. Enter Text: Input multiple text sequences (one per line)
  2. Create Graph: Click "Create Graph" to generate a new ConGr
  3. Save Graph: Optionally save the graph to a pickle file

API Endpoints

  • GET /api/datasets - Get available datasets
  • GET /api/entities?dataset=<dataset> - Get entities for a dataset
  • POST /api/load_existing_graph - Load an existing graph
  • POST /api/create_graph - Create a new graph from text sequences
  • POST /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