-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME
76 lines (49 loc) · 1.8 KB
/
README
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
=================================
Installing and using RstMarcuTree
=================================
Introduction
============
This library helps you to process a Rhetorical Structure Theory Discourse Tree
It returns a RSTTree representing the tree composed by RSTNode.
The tree is enriched with attribute like promotion set described by Daniel Marcu in paper:
* Building up rhetorical structure tree 1996
* Discourse trees are good indicators of importance in test 1999
Installation
============
RstMarcuTree has support for python 2.7
dependencies: discoursegraphs
$ pip2.7 install rstmarcutree
Usage
=====
The library process a file containing a rst tree in .dis format.
You can use online discourse dependency parser like feng hirst 2014 parser to produce
a discourse tree of a text.
Vanessa Wei Feng and Graeme Hirst, 2014.
A Linear-Time Bottom-Up Discourse Parser with Constraints and Post-Editing.
Vanessa Wei Feng and Graeme Hirst, 2014.
Two-pass Discourse Segmentation with Pairing and Global Features.
You can use:
https://github.com/NLPbox/rst-converter-service
to easily convert the file in .dis output:
having ./test_rst.dis file path in python2.7 console or script you can just just:
>>> from rstmarcutree import load_tree
>>>
>>> rst_tree = load_tree('./test_rst.dis')
>>>
>>> root = rst_tree.get_node_by_index(0)
>>>
>>> root_satellite = root.get_satellite()
To get the saliency score of terminal nodes between 0 and 1:
>>> edus = tree.get_edus()
>>> for edu in edus:
>>> print edu.get_saliency_score()
Test
====
If you directly clone the repository, supposed you have already installed
rstmarcutree, you can test it with:
$ cd tests
$ python test_marcu_classes.py
$ python test_saliency_score.py
Contact
========
For help or if you find any bug write to christian.colonna@studio.unibo.it