Rhetorical Structure Analysis: Discourse and Argumentation
Module: Natural Language Processing | Difficulty: Advanced
RST Discourse Tree
- Nuclear: central units
- Satellite: supporting units
- Relations: contrast, elaboration, etc.
Discourse Parsing
Argumentation Mining
Evaluation
| Task | Metric | Score |
|---|---|---|
| RST Parsing | F1 | 78.5 |
| Relation Classification | F1 | 72.3 |
| Argument Detection | F1 | 81.2 |
import torch
import torch.nn as nn
class RSTParser(nn.Module):
def __init__(self, bert_model, n_relations):
super().__init__()
self.bert = bert_model
self.shift_reduce = nn.Linear(768*2, 3) # shift, reduce, nop
self.relation classifier = nn.Linear(768*2, n_relations)
def forward(self, doc_repr):
# Simplified shift-reduce parsing
stack = []
buffer = list(doc_repr)
actions = []
while buffer or len(stack) > 1:
features = torch.cat([stack[-1], buffer[0]]) if buffer else stack[-1]
action = self.shift_reduce(features)
actions.append(action)
return actions
Research Insight: RST parsing provides a hierarchical representation of document structure. The key challenge is the exponential number of possible tree structures. Transition-based parsers reduce complexity from exponential to linear.