File size: 1,417 Bytes
95aa27c
9c6b549
2d45476
 
 
95aa27c
4527ce7
95aa27c
 
2d45476
95aa27c
 
9c6b549
2d45476
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9c6b549
2d45476
 
 
 
 
 
 
 
 
9c6b549
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
---
title: Language Graph Parser
emoji: 📊
colorFrom: blue
colorTo: purple
sdk: gradio
sdk_version: 6.0.2
app_file: app.py
pinned: false
license: mit
---

# Language Graph Parser

Parse sentences into linguistic structure graphs using deep learning.

## Model

This Space uses the [rudaoshi/lingua](https://huggingface.co/rudaoshi/lingua) model, which is a BERT-based parser with biaffine attention for word-lingua graph prediction.

## Features

- **Sentence Parsing**: Input any English sentence to parse it into a linguistic structure graph
- **Graph Visualization**: Visualize the parsed graph with nodes and edges
- **Constrained Decoding**: Use pattern-based constrained decoding for better graph structure (enabled by default)

## Usage

1. Enter a sentence in the text box
2. Optionally toggle "Use Constrained Decoding" (recommended)
3. Click "Parse Sentence" to generate the graph visualization

## Example Sentences

- "The cat sat on the mat."
- "John loves Mary."
- "I want to go to the store."

## Graph Structure

The parser generates graphs that represent:
- Predicate-argument relations (pred.arg.1, pred.arg.2, etc.)
- Modification relations (@modification, etc.)
- Discourse markers
- And more linguistic structures

## Technical Details

- **Model Architecture**: BERT + Biaffine Attention
- **Decoding**: Greedy pattern-based constrained decoding
- **Output Format**: Linguistic Graph Structure