Skip to content
This repository has been archived by the owner on Aug 9, 2019. It is now read-only.
/ rstviewer Public archive

DEPRECATED, please use my fork of rstWeb instead.

License

Notifications You must be signed in to change notification settings

arne-cl/rstviewer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Warning

** This repository is DEPRECATED, please use my fork of rstWeb instead:

https://github.com/arne-cl/rstWeb

rstviewer

This library allows you to convert Rhetorical Structure Theory rs3 files into HTML pages or PNG images.

The code is heavily based on Amir Zeldes' rstWeb, a web based annotation tool for rhetorical structures.

Usage

rstviewer can be used from the command line as well as a Python library. Here are the command line options:

usage: rstviewer [-h] [-f [OUTPUT_FORMAT]] rs3_file [output_file]

Convert an RS3 file into an HTML file containing the RST tree.

positional arguments:
  rs3_file
  output_file

optional arguments:
  -h, --help            show this help message and exit
  -f [OUTPUT_FORMAT], --output-format [OUTPUT_FORMAT]
                        output format: html (default), png

An RS3 file can be converted into an HTML page, where the RST tree is drawn on a canvas using Javascript/jsPlumb:

rstviewer input.rs3 output.html

To convert an RS3 file into an image of the RST tree like this one, type:

rstviewer -f png input.rs3 output.png

an rs3 file converted into a PNG image

You can also use rstviewer as a library, e.g. to embed an RST tree into a Jupyter notebook:

an rs3 file embedded into an IPython/Jupyter notebook

Installation

To use rstviewer to convert rs3 files into HTML pages, clone the repo and install it with python.

git clone https://github.com/arne-cl/rstviewer.git
cd rstviewer
sudo python setup.py install

To generate PNG images, you will additionally need to install selenium and PhantomJS:

sudo apt install phantomjs
sudo pip install selenium

Citing

If you're using rstviewer for a project or article, please cite Amir's original work:

In: Proceedings of NAACL-HLT 2016 System Demonstrations. San Diego, CA, 1-5.