Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/cyclecycle/visualise-spacy-pattern

Visualise spacy dependency patterns
https://github.com/cyclecycle/visualise-spacy-pattern

Last synced: 21 days ago
JSON representation

Visualise spacy dependency patterns

Awesome Lists containing this project

README

        

# Visualise spacy pattern

## Installation

```bash
pip install visualise-spacy-pattern
```

## Usage

```python
import visualise_spacy_pattern

# Load the example dependency pattern
pattern_file = 'examples/pattern_1.json'
with open(pattern_file) as f:
pattern = json.load(f)

graph = visualise_spacy_pattern.to_pydot(pattern)
png = graph.create_png()
graph_file = 'examples/graph_1.png'.format()
with open(graph_file, 'wb') as f:
f.write(png)
```