MCPcopy Index your code
hub / github.com/asyml/stave

github.com/asyml/stave @0.0.2

Chat with this repo
repository ↗ · DeepWiki ↗ · release 0.0.2 ↗ · + Follow
427 symbols 1,128 edges 108 files 80 documented · 19%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README


License Build Status

This project is currently under development.

Stave is a fast, lightweight, extensible web-based text annotation and visualization tool designed to support a wide range of data types and NLP tasks. Stave offers the following features:

  • Semantic Annotation: supports both template and custom data types
  • Multi-document Annotation: supports cross-document annotations and coreference
  • Customizable Interface: supports creation of task-specific interface with independently developed plugins
  • Machine-Human Collaboration: keeps human in the loop to verify and correct machine suggestions
  • Easy Integration: supports seamless integration with pre-built NLP workflows
  • Safe Data Serialization: supports a JSON-serializable format for easy data saving, loading and distribution

Stave was originally developed and is actively contributed by Petuum in collaboration with other institutes. A mirror of this repository is maintained by Petuum Open Source.

Get Started

Installation

pip install stave

Quick Start

```bash stave -s start -l -o

This will start the Stave server with example project loaded. `-s` allows Stave to run with all the default configuration. `-l` will load example projects and `-o` will open a browser window. If you want to start Stave as a headless server, simply remove the `-o` flag. You can log in with default user name `admin` and default password `admin`. You can start viewing the projects and some annotations/applications that we have prepared.

Or if you just want to start Stave from scratch, you can:

```bash
stave start

You can still log in with default user name admin and default password admin, which leads you to an empty project page.

At any time, you can still load the example projects:

stave load-samples

Stave Configuration

After you start the Stave server, a .stave/ folder is automatically created under your home directory ~. It has the following structure:

~/.stave/
---- stave.conf
---- db.sqlite3
---- log
  • stave.conf holds a json object of configurations.
  • db.sqlite3 is the default database for Stave server.
  • log is the default logging file.

You can view or update the configuration by running the subcommand config. You may follow the prompts to interactively set up the configuration:

stave config -i

For more information, refer to:

stave config -h

More about the command line tool:

To learn more about Stave CLI, run the following command to see the help message:

stave -h

Developer Quick Start

Environment

The project is tested on:

Python 3.6+ Django 3.2.4 yarn 1.22.10

Run Django server

  • cd simple-backend
  • make sure your python command is using python3, or use a virtual env by:
  • python3 -m venv venv create virtual env (skip if already created)
  • . venv/bin/activate use virtual env
  • make sure django is installded, or install it by:
  • python -m pip install Django
  • ./start-dev.sh
  • This script will create an example sqlite3 DB from SQL: db.sqlite3

Start the Frontend

After the server starts, then simply - yarn && yarn start - go to http://127.0.0.1:8000

The default username/password for the demonstration data is admin/admin

License

Apache License 2.0

Companies and Universities Supporting Stave

                  

Extension points exported contracts — how you extend this code

NLPViewerProp (Interface)
(no doc)
src/nlpviewer/index.tsx
DropUploadProp (Interface)
(no doc)
src/app/components/dropUpload/DropUpload.tsx
PluginComponentProp (Interface)
(no doc)
src/plugins/lib/interface.ts
LineWithArrowProp (Interface)
(no doc)
src/nlpviewer/components/LineWithArrow.tsx
State (Interface)
(no doc)
src/app/pages/SignUp.tsx
TextInputProp (Interface)
(no doc)
src/plugins/dialogue_box/TextInput.tsx
LinkMultiLineProp (Interface)
(no doc)
src/nlpviewer/components/LinkMultiLine.tsx
WholePack (Interface)
(no doc)
src/app/pages/Viewer.tsx

Core symbols most depended-on inside this repo

get
called by 70
simple-backend/stave_backend/lib/stave_viewer.py
postData
called by 24
src/app/lib/api.ts
fetch_doc_check_perm
called by 14
simple-backend/stave_backend/lib/utils.py
attributeId
called by 6
src/nlpviewer/lib/utils.ts
shortId
called by 6
src/nlpviewer/lib/utils.ts
isEntryAnnotation
called by 6
src/nlpviewer/lib/utils.ts
post
called by 5
simple-backend/stave_backend/lib/stave_viewer.py
fetch_project_check_perm
called by 5
simple-backend/stave_backend/lib/utils.py

Shape

Function 255
Method 65
Interface 57
Class 50

Languages

TypeScript64%
Python36%

Modules by API surface

src/app/lib/api.ts40 symbols
simple-backend/stave_backend/lib/stave_viewer.py30 symbols
src/nlpviewer/lib/interfaces.ts28 symbols
src/nlpviewer/lib/utils.ts24 symbols
src/nlpviewer/lib/text-spacer.ts19 symbols
simple-backend/stave_backend/handlers/document.py18 symbols
simple-backend/stave_backend/lib/stave_project.py17 symbols
src/nlpviewer/components/TextViewer.tsx12 symbols
src/app/pages/Projects.tsx10 symbols
simple-backend/stave_backend/lib/stave_session.py10 symbols
simple-backend/stave_backend/handlers/project.py10 symbols
src/nlpviewer/components/TextArea.tsx9 symbols

For agents

$ claude mcp add stave \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact