-
Notifications
You must be signed in to change notification settings - Fork 1
/
generate_pdtb_features.py
31 lines (17 loc) · 1.07 KB
/
generate_pdtb_features.py
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
class PDTBFeatures:
def __init__(self):
# load the PDTB outputs --
self.mainPath = "./auto-grader/ArgumentDetection/"
self.pdtbInput = 'data/pdtb/input/'
expansionFile = open( self.mainPath + self.pdtbInput + 'expansion_sr.op')
self.expansions = expansionFile.readlines()
contingencyFile = open( self.mainPath + self.pdtbInput + 'contingency_sr.op')
self.contigencies = contingencyFile.readlines()
comparisonFile = open( self.mainPath + self.pdtbInput + 'comparison_sr.op')
self.comparisons = comparisonFile.readlines()
def returnPDTBOps(self,position):
featureMap = {}
featureMap["PDTB_EXPANSION"] = self.expansions[position].strip()
featureMap["PDTB_COMPARISON"] = self.comparisons[position].strip()
featureMap["PDTB_CONTINGENCY"] = self.contigencies[position].strip()
return featureMap