nlptoolkit-universaldependencyparser 1.0.1 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Parser/TransitionBasedParser/Agenda.js +52 -60
- package/dist/Parser/TransitionBasedParser/Agenda.js.map +1 -1
- package/dist/Parser/TransitionBasedParser/ArcEagerInstanceGenerator.js +56 -66
- package/dist/Parser/TransitionBasedParser/ArcEagerInstanceGenerator.js.map +1 -1
- package/dist/Parser/TransitionBasedParser/ArcEagerOracle.js +25 -35
- package/dist/Parser/TransitionBasedParser/ArcEagerOracle.js.map +1 -1
- package/dist/Parser/TransitionBasedParser/ArcEagerTransitionParser.js +89 -99
- package/dist/Parser/TransitionBasedParser/ArcEagerTransitionParser.js.map +1 -1
- package/dist/Parser/TransitionBasedParser/ArcStandardOracle.js +23 -33
- package/dist/Parser/TransitionBasedParser/ArcStandardOracle.js.map +1 -1
- package/dist/Parser/TransitionBasedParser/ArcStandardTransitionParser.js +97 -107
- package/dist/Parser/TransitionBasedParser/ArcStandardTransitionParser.js.map +1 -1
- package/dist/Parser/TransitionBasedParser/Candidate.js +15 -23
- package/dist/Parser/TransitionBasedParser/Candidate.js.map +1 -1
- package/dist/Parser/TransitionBasedParser/Command.js +10 -20
- package/dist/Parser/TransitionBasedParser/Command.js.map +1 -1
- package/dist/Parser/TransitionBasedParser/Decision.js +13 -22
- package/dist/Parser/TransitionBasedParser/Decision.js.map +1 -1
- package/dist/Parser/TransitionBasedParser/InstanceGenerator.js +63 -73
- package/dist/Parser/TransitionBasedParser/InstanceGenerator.js.map +1 -1
- package/dist/Parser/TransitionBasedParser/Oracle.js +92 -100
- package/dist/Parser/TransitionBasedParser/Oracle.js.map +1 -1
- package/dist/Parser/TransitionBasedParser/RandomOracle.js +32 -42
- package/dist/Parser/TransitionBasedParser/RandomOracle.js.map +1 -1
- package/dist/Parser/TransitionBasedParser/RandomScoringOracle.js +9 -19
- package/dist/Parser/TransitionBasedParser/RandomScoringOracle.js.map +1 -1
- package/dist/Parser/TransitionBasedParser/ScoringOracle.js +6 -16
- package/dist/Parser/TransitionBasedParser/ScoringOracle.js.map +1 -1
- package/dist/Parser/TransitionBasedParser/SimpleInstanceGenerator.js +45 -55
- package/dist/Parser/TransitionBasedParser/SimpleInstanceGenerator.js.map +1 -1
- package/dist/Parser/TransitionBasedParser/StackRelation.js +18 -26
- package/dist/Parser/TransitionBasedParser/StackRelation.js.map +1 -1
- package/dist/Parser/TransitionBasedParser/StackWord.js +28 -36
- package/dist/Parser/TransitionBasedParser/StackWord.js.map +1 -1
- package/dist/Parser/TransitionBasedParser/State.js +136 -143
- package/dist/Parser/TransitionBasedParser/State.js.map +1 -1
- package/dist/Parser/TransitionBasedParser/TransitionParser.js +137 -147
- package/dist/Parser/TransitionBasedParser/TransitionParser.js.map +1 -1
- package/dist/Parser/TransitionBasedParser/TransitionSystem.js +8 -18
- package/dist/Parser/TransitionBasedParser/TransitionSystem.js.map +1 -1
- package/dist/index.js +22 -32
- package/dist/index.js.map +1 -1
- package/package.json +7 -6
- package/tsconfig.json +4 -3
- package/source/tsconfig.json +0 -13
|
@@ -1,37 +1,27 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ArcStandardOracle = void 0;
|
|
4
|
+
const Oracle_1 = require("./Oracle");
|
|
5
|
+
const Decision_1 = require("./Decision");
|
|
6
|
+
const SimpleInstanceGenerator_1 = require("./SimpleInstanceGenerator");
|
|
7
|
+
const Command_1 = require("./Command");
|
|
8
|
+
class ArcStandardOracle extends Oracle_1.Oracle {
|
|
9
|
+
constructor(model, windowSize) {
|
|
10
|
+
super(model, windowSize);
|
|
5
11
|
}
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
const Oracle_1 = require("./Oracle");
|
|
14
|
-
const Decision_1 = require("./Decision");
|
|
15
|
-
const SimpleInstanceGenerator_1 = require("./SimpleInstanceGenerator");
|
|
16
|
-
const Command_1 = require("./Command");
|
|
17
|
-
class ArcStandardOracle extends Oracle_1.Oracle {
|
|
18
|
-
constructor(model, windowSize) {
|
|
19
|
-
super(model, windowSize);
|
|
20
|
-
}
|
|
21
|
-
makeDecision(state) {
|
|
22
|
-
let instanceGenerator = new SimpleInstanceGenerator_1.SimpleInstanceGenerator();
|
|
23
|
-
let instance = instanceGenerator.generate(state, this.windowSize, "");
|
|
24
|
-
let best = this.findBestValidStandardClassInfo(this.commandModel.predictProbability(instance), state);
|
|
25
|
-
let decisionCandidate = this.getDecisionCandidate(best);
|
|
26
|
-
if (decisionCandidate.getCommand() == Command_1.Command.SHIFT) {
|
|
27
|
-
return new Decision_1.Decision(Command_1.Command.SHIFT, null, 0.0);
|
|
28
|
-
}
|
|
29
|
-
return new Decision_1.Decision(decisionCandidate.getCommand(), decisionCandidate.getUniversalDependencyType(), 0.0);
|
|
30
|
-
}
|
|
31
|
-
scoreDecisions(state, transitionSystem) {
|
|
32
|
-
return null;
|
|
12
|
+
makeDecision(state) {
|
|
13
|
+
let instanceGenerator = new SimpleInstanceGenerator_1.SimpleInstanceGenerator();
|
|
14
|
+
let instance = instanceGenerator.generate(state, this.windowSize, "");
|
|
15
|
+
let best = this.findBestValidStandardClassInfo(this.commandModel.predictProbability(instance), state);
|
|
16
|
+
let decisionCandidate = this.getDecisionCandidate(best);
|
|
17
|
+
if (decisionCandidate.getCommand() == Command_1.Command.SHIFT) {
|
|
18
|
+
return new Decision_1.Decision(Command_1.Command.SHIFT, null, 0.0);
|
|
33
19
|
}
|
|
20
|
+
return new Decision_1.Decision(decisionCandidate.getCommand(), decisionCandidate.getUniversalDependencyType(), 0.0);
|
|
21
|
+
}
|
|
22
|
+
scoreDecisions(state, transitionSystem) {
|
|
23
|
+
return null;
|
|
34
24
|
}
|
|
35
|
-
|
|
36
|
-
|
|
25
|
+
}
|
|
26
|
+
exports.ArcStandardOracle = ArcStandardOracle;
|
|
37
27
|
//# sourceMappingURL=ArcStandardOracle.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ArcStandardOracle.js","sourceRoot":"","sources":["../../../source/Parser/TransitionBasedParser/ArcStandardOracle.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ArcStandardOracle.js","sourceRoot":"","sources":["../../../source/Parser/TransitionBasedParser/ArcStandardOracle.ts"],"names":[],"mappings":";;;AAAA,qCAAgC;AAEhC,yCAAoC;AAEpC,uEAAkE;AAElE,uCAAkC;AAElC,MAAa,iBAAkB,SAAQ,eAAM;IAEzC,YAAY,KAAY,EAAE,UAAkB;QACxC,KAAK,CAAC,KAAK,EAAE,UAAU,CAAC,CAAA;IAC5B,CAAC;IAEM,YAAY,CAAC,KAAY;QAC5B,IAAI,iBAAiB,GAAG,IAAI,iDAAuB,EAAE,CAAA;QACrD,IAAI,QAAQ,GAAG,iBAAiB,CAAC,QAAQ,CAAC,KAAK,EAAE,IAAI,CAAC,UAAU,EAAE,EAAE,CAAC,CAAA;QACrE,IAAI,IAAI,GAAG,IAAI,CAAC,8BAA8B,CAAC,IAAI,CAAC,YAAY,CAAC,kBAAkB,CAAC,QAAQ,CAAC,EAAE,KAAK,CAAC,CAAC;QACtG,IAAI,iBAAiB,GAAG,IAAI,CAAC,oBAAoB,CAAC,IAAI,CAAC,CAAA;QACvD,IAAI,iBAAiB,CAAC,UAAU,EAAE,IAAI,iBAAO,CAAC,KAAK,EAAE,CAAC;YAClD,OAAO,IAAI,mBAAQ,CAAC,iBAAO,CAAC,KAAK,EAAE,IAAI,EAAE,GAAG,CAAC,CAAA;QACjD,CAAC;QACD,OAAO,IAAI,mBAAQ,CAAC,iBAAiB,CAAC,UAAU,EAAE,EAAE,iBAAiB,CAAC,0BAA0B,EAAE,EAAE,GAAG,CAAC,CAAA;IAC5G,CAAC;IAES,cAAc,CAAC,KAAY,EAAE,gBAAkC;QACrE,OAAO,IAAI,CAAA;IACf,CAAC;CAEJ;AArBD,8CAqBC"}
|
|
@@ -1,115 +1,96 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ArcStandardTransitionParser = void 0;
|
|
4
|
+
const TransitionParser_1 = require("./TransitionParser");
|
|
5
|
+
const StackWord_1 = require("./StackWord");
|
|
6
|
+
const SimpleInstanceGenerator_1 = require("./SimpleInstanceGenerator");
|
|
7
|
+
const UniversalDependencyTreeBankWord_1 = require("nlptoolkit-dependencyparser/dist/Universal/UniversalDependencyTreeBankWord");
|
|
8
|
+
const State_1 = require("./State");
|
|
9
|
+
const Command_1 = require("./Command");
|
|
10
|
+
class ArcStandardTransitionParser extends TransitionParser_1.TransitionParser {
|
|
11
|
+
constructor() {
|
|
12
|
+
super();
|
|
5
13
|
}
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
const UniversalDependencyTreeBankWord_1 = require("nlptoolkit-dependencyparser/dist/Universal/UniversalDependencyTreeBankWord");
|
|
17
|
-
const State_1 = require("./State");
|
|
18
|
-
const Command_1 = require("./Command");
|
|
19
|
-
class ArcStandardTransitionParser extends TransitionParser_1.TransitionParser {
|
|
20
|
-
constructor() {
|
|
21
|
-
super();
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* Checks if there are more relations with a specified ID in the list of words.
|
|
25
|
-
* @param wordList The list of words to check.
|
|
26
|
-
* @param id The ID to check for.
|
|
27
|
-
* @return True if no more relations with the specified ID are found; false otherwise.
|
|
28
|
-
*/
|
|
29
|
-
checkForMoreRelation(wordList, id) {
|
|
30
|
-
for (let word of wordList) {
|
|
31
|
-
if (word.getWord().getRelation().to() == id) {
|
|
32
|
-
return false;
|
|
33
|
-
}
|
|
14
|
+
/**
|
|
15
|
+
* Checks if there are more relations with a specified ID in the list of words.
|
|
16
|
+
* @param wordList The list of words to check.
|
|
17
|
+
* @param id The ID to check for.
|
|
18
|
+
* @return True if no more relations with the specified ID are found; false otherwise.
|
|
19
|
+
*/
|
|
20
|
+
checkForMoreRelation(wordList, id) {
|
|
21
|
+
for (let word of wordList) {
|
|
22
|
+
if (word.getWord().getRelation().to() == id) {
|
|
23
|
+
return false;
|
|
34
24
|
}
|
|
35
|
-
return true;
|
|
36
25
|
}
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
26
|
+
return true;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Performs dependency parsing on the given sentence using the provided oracle.
|
|
30
|
+
* @param universalDependencyTreeBankSentence The sentence to be parsed.
|
|
31
|
+
* @param oracle The oracle used to make parsing decisions.
|
|
32
|
+
* @return The parsed sentence with dependency relations established.
|
|
33
|
+
*/
|
|
34
|
+
dependencyParse(universalDependencyTreeBankSentence, oracle) {
|
|
35
|
+
let sentence = this.createResultSentence(universalDependencyTreeBankSentence);
|
|
36
|
+
let state = this.initialState(sentence);
|
|
37
|
+
while (state.wordListSize() > 0 || state.stackSize() > 1) {
|
|
38
|
+
let decision = oracle.makeDecision(state);
|
|
39
|
+
switch (decision.getCommand()) {
|
|
40
|
+
case Command_1.Command.SHIFT:
|
|
41
|
+
state.applyShift();
|
|
42
|
+
break;
|
|
43
|
+
case Command_1.Command.LEFTARC:
|
|
44
|
+
state.applyLeftArc(decision.getUniversalDependencyType());
|
|
45
|
+
break;
|
|
46
|
+
case Command_1.Command.RIGHTARC:
|
|
47
|
+
state.applyRightArc(decision.getUniversalDependencyType());
|
|
48
|
+
break;
|
|
49
|
+
default:
|
|
50
|
+
break;
|
|
61
51
|
}
|
|
62
|
-
return sentence;
|
|
63
52
|
}
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
53
|
+
return sentence;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Simulates the parsing process for a given sentence using the Arc Standard parsing algorithm.
|
|
57
|
+
* @param sentence The sentence to be parsed.
|
|
58
|
+
* @param windowSize The size of the window used for feature generation.
|
|
59
|
+
* @return An ArrayList of {@link Instance} objects representing the parsed actions.
|
|
60
|
+
*/
|
|
61
|
+
simulateParse(sentence, windowSize) {
|
|
62
|
+
let instanceGenerator = new SimpleInstanceGenerator_1.SimpleInstanceGenerator();
|
|
63
|
+
let instanceList = new Array();
|
|
64
|
+
let wordList = new Array();
|
|
65
|
+
let stack = new Array();
|
|
66
|
+
for (let j = 0; j < sentence.wordCount(); j++) {
|
|
67
|
+
let word = sentence.getWord(j);
|
|
68
|
+
if (word instanceof UniversalDependencyTreeBankWord_1.UniversalDependencyTreeBankWord) {
|
|
69
|
+
wordList.push(new StackWord_1.StackWord(word, j + 1));
|
|
80
70
|
}
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
71
|
+
}
|
|
72
|
+
stack.push(new StackWord_1.StackWord());
|
|
73
|
+
let state = new State_1.State(stack, wordList, new Array());
|
|
74
|
+
if (wordList.length > 0) {
|
|
75
|
+
instanceList.push(instanceGenerator.generate(state, windowSize, "SHIFT"));
|
|
76
|
+
stack.push(wordList.splice(0, 1)[0]);
|
|
77
|
+
if (wordList.length > 1) {
|
|
84
78
|
instanceList.push(instanceGenerator.generate(state, windowSize, "SHIFT"));
|
|
85
79
|
stack.push(wordList.splice(0, 1)[0]);
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
let
|
|
92
|
-
let
|
|
93
|
-
if (
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
else if (top.getId() == beforeTopRelation.to()) {
|
|
101
|
-
instanceList.push(instanceGenerator.generate(state, windowSize, "LEFTARC(" + beforeTopRelation + ")"));
|
|
102
|
-
stack.splice(stack.length - 2, 1);
|
|
103
|
-
}
|
|
104
|
-
else {
|
|
105
|
-
if (wordList.length > 0) {
|
|
106
|
-
instanceList.push(instanceGenerator.generate(state, windowSize, "SHIFT"));
|
|
107
|
-
stack.push(wordList.splice(0, 1)[0]);
|
|
108
|
-
}
|
|
109
|
-
else {
|
|
110
|
-
break;
|
|
111
|
-
}
|
|
112
|
-
}
|
|
80
|
+
}
|
|
81
|
+
while (wordList.length > 0 || stack.length > 1) {
|
|
82
|
+
let top = stack[stack.length - 1].getWord();
|
|
83
|
+
let topRelation = top.getRelation();
|
|
84
|
+
if (stack.length > 1) {
|
|
85
|
+
let beforeTop = stack[stack.length - 2].getWord();
|
|
86
|
+
let beforeTopRelation = beforeTop.getRelation();
|
|
87
|
+
if (beforeTop.getId() == topRelation.to() && this.checkForMoreRelation(wordList, top.getId())) {
|
|
88
|
+
instanceList.push(instanceGenerator.generate(state, windowSize, "RIGHTARC(" + topRelation + ")"));
|
|
89
|
+
stack.pop();
|
|
90
|
+
}
|
|
91
|
+
else if (top.getId() == beforeTopRelation.to()) {
|
|
92
|
+
instanceList.push(instanceGenerator.generate(state, windowSize, "LEFTARC(" + beforeTopRelation + ")"));
|
|
93
|
+
stack.splice(stack.length - 2, 1);
|
|
113
94
|
}
|
|
114
95
|
else {
|
|
115
96
|
if (wordList.length > 0) {
|
|
@@ -121,10 +102,19 @@
|
|
|
121
102
|
}
|
|
122
103
|
}
|
|
123
104
|
}
|
|
105
|
+
else {
|
|
106
|
+
if (wordList.length > 0) {
|
|
107
|
+
instanceList.push(instanceGenerator.generate(state, windowSize, "SHIFT"));
|
|
108
|
+
stack.push(wordList.splice(0, 1)[0]);
|
|
109
|
+
}
|
|
110
|
+
else {
|
|
111
|
+
break;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
124
114
|
}
|
|
125
|
-
return instanceList;
|
|
126
115
|
}
|
|
116
|
+
return instanceList;
|
|
127
117
|
}
|
|
128
|
-
|
|
129
|
-
|
|
118
|
+
}
|
|
119
|
+
exports.ArcStandardTransitionParser = ArcStandardTransitionParser;
|
|
130
120
|
//# sourceMappingURL=ArcStandardTransitionParser.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ArcStandardTransitionParser.js","sourceRoot":"","sources":["../../../source/Parser/TransitionBasedParser/ArcStandardTransitionParser.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ArcStandardTransitionParser.js","sourceRoot":"","sources":["../../../source/Parser/TransitionBasedParser/ArcStandardTransitionParser.ts"],"names":[],"mappings":";;;AAAA,yDAAoD;AAMpD,2CAAsC;AACtC,uEAAkE;AAClE,gIAEoF;AACpF,mCAA8B;AAE9B,uCAAkC;AAElC,MAAa,2BAA4B,SAAQ,mCAAgB;IAE7D;QACI,KAAK,EAAE,CAAA;IACX,CAAC;IAED;;;;;OAKG;IACK,oBAAoB,CAAC,QAA0B,EAAE,EAAU;QAC/D,KAAK,IAAI,IAAI,IAAI,QAAQ,EAAE,CAAC;YACxB,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC,WAAW,EAAE,CAAC,EAAE,EAAE,IAAI,EAAE,EAAE,CAAC;gBAC1C,OAAO,KAAK,CAAC;YACjB,CAAC;QACL,CAAC;QACD,OAAO,IAAI,CAAA;IACf,CAAC;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C,iBAAiB,CAAC,QAAQ,CAAC,KAAK,EAAE,UAAU,EAAE,OAAO,CAAC,CAAC,CAAA;wBACzE,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;oBACxC,CAAC;yBAAM,CAAC;wBACJ,MAAK;oBACT,CAAC;gBACL,CAAC;YACL,CAAC;QACL,CAAC;QACD,OAAO,YAAY,CAAA;IACvB,CAAC;CAEJ;AA5GD,kEA4GC"}
|
|
@@ -1,27 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Candidate = void 0;
|
|
4
|
+
class Candidate {
|
|
5
|
+
command;
|
|
6
|
+
universalDependencyType;
|
|
7
|
+
constructor(command, universalDependencyType) {
|
|
8
|
+
this.command = command;
|
|
9
|
+
this.universalDependencyType = universalDependencyType;
|
|
5
10
|
}
|
|
6
|
-
|
|
7
|
-
|
|
11
|
+
getCommand() {
|
|
12
|
+
return this.command;
|
|
8
13
|
}
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.Candidate = void 0;
|
|
13
|
-
class Candidate {
|
|
14
|
-
constructor(command, universalDependencyType) {
|
|
15
|
-
this.command = command;
|
|
16
|
-
this.universalDependencyType = universalDependencyType;
|
|
17
|
-
}
|
|
18
|
-
getCommand() {
|
|
19
|
-
return this.command;
|
|
20
|
-
}
|
|
21
|
-
getUniversalDependencyType() {
|
|
22
|
-
return this.universalDependencyType;
|
|
23
|
-
}
|
|
14
|
+
getUniversalDependencyType() {
|
|
15
|
+
return this.universalDependencyType;
|
|
24
16
|
}
|
|
25
|
-
|
|
26
|
-
|
|
17
|
+
}
|
|
18
|
+
exports.Candidate = Candidate;
|
|
27
19
|
//# sourceMappingURL=Candidate.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Candidate.js","sourceRoot":"","sources":["../../../source/Parser/TransitionBasedParser/Candidate.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Candidate.js","sourceRoot":"","sources":["../../../source/Parser/TransitionBasedParser/Candidate.ts"],"names":[],"mappings":";;;AAGA,MAAa,SAAS;IACD,OAAO,CAAU;IACjB,uBAAuB,CAAyB;IAEjE,YAAY,OAAgB,EAAE,uBAAgD;QAC1E,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;QACtB,IAAI,CAAC,uBAAuB,GAAG,uBAAuB,CAAA;IAC1D,CAAC;IAED,UAAU;QACN,OAAO,IAAI,CAAC,OAAO,CAAA;IACvB,CAAC;IAED,0BAA0B;QACtB,OAAO,IAAI,CAAC,uBAAuB,CAAA;IACvC,CAAC;CAEJ;AAjBD,8BAiBC"}
|
|
@@ -1,21 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.Command = void 0;
|
|
13
|
-
var Command;
|
|
14
|
-
(function (Command) {
|
|
15
|
-
Command[Command["RIGHTARC"] = 0] = "RIGHTARC";
|
|
16
|
-
Command[Command["LEFTARC"] = 1] = "LEFTARC";
|
|
17
|
-
Command[Command["SHIFT"] = 2] = "SHIFT";
|
|
18
|
-
Command[Command["REDUCE"] = 3] = "REDUCE";
|
|
19
|
-
})(Command = exports.Command || (exports.Command = {}));
|
|
20
|
-
});
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Command = void 0;
|
|
4
|
+
var Command;
|
|
5
|
+
(function (Command) {
|
|
6
|
+
Command[Command["RIGHTARC"] = 0] = "RIGHTARC";
|
|
7
|
+
Command[Command["LEFTARC"] = 1] = "LEFTARC";
|
|
8
|
+
Command[Command["SHIFT"] = 2] = "SHIFT";
|
|
9
|
+
Command[Command["REDUCE"] = 3] = "REDUCE";
|
|
10
|
+
})(Command || (exports.Command = Command = {}));
|
|
21
11
|
//# sourceMappingURL=Command.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Command.js","sourceRoot":"","sources":["../../../source/Parser/TransitionBasedParser/Command.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Command.js","sourceRoot":"","sources":["../../../source/Parser/TransitionBasedParser/Command.ts"],"names":[],"mappings":";;;AAAA,IAAY,OAEX;AAFD,WAAY,OAAO;IACf,6CAAQ,CAAA;IAAE,2CAAO,CAAA;IAAE,uCAAK,CAAA;IAAE,yCAAM,CAAA;AACpC,CAAC,EAFW,OAAO,uBAAP,OAAO,QAElB"}
|
|
@@ -1,25 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Decision = void 0;
|
|
4
|
+
const Candidate_1 = require("./Candidate");
|
|
5
|
+
class Decision extends Candidate_1.Candidate {
|
|
6
|
+
point;
|
|
7
|
+
constructor(command, universalDependencyType, point) {
|
|
8
|
+
super(command, universalDependencyType);
|
|
9
|
+
this.point = point;
|
|
5
10
|
}
|
|
6
|
-
|
|
7
|
-
|
|
11
|
+
getPoint() {
|
|
12
|
+
return this.point;
|
|
8
13
|
}
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.Decision = void 0;
|
|
13
|
-
const Candidate_1 = require("./Candidate");
|
|
14
|
-
class Decision extends Candidate_1.Candidate {
|
|
15
|
-
constructor(command, universalDependencyType, point) {
|
|
16
|
-
super(command, universalDependencyType);
|
|
17
|
-
this.point = point;
|
|
18
|
-
}
|
|
19
|
-
getPoint() {
|
|
20
|
-
return this.point;
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
exports.Decision = Decision;
|
|
24
|
-
});
|
|
14
|
+
}
|
|
15
|
+
exports.Decision = Decision;
|
|
25
16
|
//# sourceMappingURL=Decision.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Decision.js","sourceRoot":"","sources":["../../../source/Parser/TransitionBasedParser/Decision.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Decision.js","sourceRoot":"","sources":["../../../source/Parser/TransitionBasedParser/Decision.ts"],"names":[],"mappings":";;;AACA,2CAAsC;AAGtC,MAAa,QAAS,SAAQ,qBAAS;IAElB,KAAK,CAAQ;IAE9B,YAAY,OAAgB,EAAE,uBAAgD,EAAE,KAAa;QACzF,KAAK,CAAC,OAAO,EAAE,uBAAuB,CAAC,CAAC;QACxC,IAAI,CAAC,KAAK,GAAG,KAAK,CAAA;IACtB,CAAC;IAED,QAAQ;QACJ,OAAO,IAAI,CAAC,KAAK,CAAA;IACrB,CAAC;CACJ;AAZD,4BAYC"}
|
|
@@ -1,77 +1,67 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
* @param word The word whose feature value is used to create the attribute.
|
|
19
|
-
* @param attributes The list of attributes to which the new attribute will be added.
|
|
20
|
-
* @param featureType The type of the feature to be extracted from the word.
|
|
21
|
-
*/
|
|
22
|
-
addAttributeForFeatureType(word, attributes, featureType) {
|
|
23
|
-
let feature = word.getFeatureValue(featureType);
|
|
24
|
-
let numberOfValues = UniversalDependencyTreeBankFeatures_1.UniversalDependencyTreeBankFeatures.numberOfValues("tr", featureType) + 1;
|
|
25
|
-
if (feature != undefined) {
|
|
26
|
-
attributes.push(new DiscreteIndexedAttribute_1.DiscreteIndexedAttribute(feature, UniversalDependencyTreeBankFeatures_1.UniversalDependencyTreeBankFeatures.featureValueIndex("tr", featureType, feature) + 1, numberOfValues));
|
|
27
|
-
}
|
|
28
|
-
else {
|
|
29
|
-
attributes.push(new DiscreteIndexedAttribute_1.DiscreteIndexedAttribute("null", 0, numberOfValues));
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
/**
|
|
33
|
-
* Adds a set of default (empty) attributes to the list of attributes. These attributes represent
|
|
34
|
-
* various feature types with default "null" values.
|
|
35
|
-
* @param attributes The list of attributes to which the default attributes will be added.
|
|
36
|
-
*/
|
|
37
|
-
addEmptyAttributes(attributes) {
|
|
38
|
-
attributes.push(new DiscreteIndexedAttribute_1.DiscreteIndexedAttribute("null", 0, UniversalDependencyTreeBankFeatures_1.UniversalDependencyTreeBankFeatures.numberOfValues("tr", "PronType") + 1));
|
|
39
|
-
attributes.push(new DiscreteIndexedAttribute_1.DiscreteIndexedAttribute("null", 0, UniversalDependencyTreeBankFeatures_1.UniversalDependencyTreeBankFeatures.numberOfValues("tr", "NumType") + 1));
|
|
40
|
-
attributes.push(new DiscreteIndexedAttribute_1.DiscreteIndexedAttribute("null", 0, UniversalDependencyTreeBankFeatures_1.UniversalDependencyTreeBankFeatures.numberOfValues("tr", "Number") + 1));
|
|
41
|
-
attributes.push(new DiscreteIndexedAttribute_1.DiscreteIndexedAttribute("null", 0, UniversalDependencyTreeBankFeatures_1.UniversalDependencyTreeBankFeatures.numberOfValues("tr", "Case") + 1));
|
|
42
|
-
attributes.push(new DiscreteIndexedAttribute_1.DiscreteIndexedAttribute("null", 0, UniversalDependencyTreeBankFeatures_1.UniversalDependencyTreeBankFeatures.numberOfValues("tr", "Definite") + 1));
|
|
43
|
-
attributes.push(new DiscreteIndexedAttribute_1.DiscreteIndexedAttribute("null", 0, UniversalDependencyTreeBankFeatures_1.UniversalDependencyTreeBankFeatures.numberOfValues("tr", "Degree") + 1));
|
|
44
|
-
attributes.push(new DiscreteIndexedAttribute_1.DiscreteIndexedAttribute("null", 0, UniversalDependencyTreeBankFeatures_1.UniversalDependencyTreeBankFeatures.numberOfValues("tr", "VerbForm") + 1));
|
|
45
|
-
attributes.push(new DiscreteIndexedAttribute_1.DiscreteIndexedAttribute("null", 0, UniversalDependencyTreeBankFeatures_1.UniversalDependencyTreeBankFeatures.numberOfValues("tr", "Mood") + 1));
|
|
46
|
-
attributes.push(new DiscreteIndexedAttribute_1.DiscreteIndexedAttribute("null", 0, UniversalDependencyTreeBankFeatures_1.UniversalDependencyTreeBankFeatures.numberOfValues("tr", "Tense") + 1));
|
|
47
|
-
attributes.push(new DiscreteIndexedAttribute_1.DiscreteIndexedAttribute("null", 0, UniversalDependencyTreeBankFeatures_1.UniversalDependencyTreeBankFeatures.numberOfValues("tr", "Aspect") + 1));
|
|
48
|
-
attributes.push(new DiscreteIndexedAttribute_1.DiscreteIndexedAttribute("null", 0, UniversalDependencyTreeBankFeatures_1.UniversalDependencyTreeBankFeatures.numberOfValues("tr", "Voice") + 1));
|
|
49
|
-
attributes.push(new DiscreteIndexedAttribute_1.DiscreteIndexedAttribute("null", 0, UniversalDependencyTreeBankFeatures_1.UniversalDependencyTreeBankFeatures.numberOfValues("tr", "Evident") + 1));
|
|
50
|
-
attributes.push(new DiscreteIndexedAttribute_1.DiscreteIndexedAttribute("null", 0, UniversalDependencyTreeBankFeatures_1.UniversalDependencyTreeBankFeatures.numberOfValues("tr", "Polarity") + 1));
|
|
51
|
-
attributes.push(new DiscreteIndexedAttribute_1.DiscreteIndexedAttribute("null", 0, UniversalDependencyTreeBankFeatures_1.UniversalDependencyTreeBankFeatures.numberOfValues("tr", "Person") + 1));
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.InstanceGenerator = void 0;
|
|
4
|
+
const UniversalDependencyTreeBankFeatures_1 = require("nlptoolkit-dependencyparser/dist/Universal/UniversalDependencyTreeBankFeatures");
|
|
5
|
+
const DiscreteIndexedAttribute_1 = require("nlptoolkit-classification/dist/Attribute/DiscreteIndexedAttribute");
|
|
6
|
+
class InstanceGenerator {
|
|
7
|
+
/**
|
|
8
|
+
* Adds an attribute for a specific feature type of a given word to the list of attributes.
|
|
9
|
+
* @param word The word whose feature value is used to create the attribute.
|
|
10
|
+
* @param attributes The list of attributes to which the new attribute will be added.
|
|
11
|
+
* @param featureType The type of the feature to be extracted from the word.
|
|
12
|
+
*/
|
|
13
|
+
addAttributeForFeatureType(word, attributes, featureType) {
|
|
14
|
+
let feature = word.getFeatureValue(featureType);
|
|
15
|
+
let numberOfValues = UniversalDependencyTreeBankFeatures_1.UniversalDependencyTreeBankFeatures.numberOfValues("tr", featureType) + 1;
|
|
16
|
+
if (feature != undefined) {
|
|
17
|
+
attributes.push(new DiscreteIndexedAttribute_1.DiscreteIndexedAttribute(feature, UniversalDependencyTreeBankFeatures_1.UniversalDependencyTreeBankFeatures.featureValueIndex("tr", featureType, feature) + 1, numberOfValues));
|
|
52
18
|
}
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
* @param word The word whose feature values are used to create the attributes.
|
|
56
|
-
* @param attributes The list of attributes to which the new attributes will be added.
|
|
57
|
-
*/
|
|
58
|
-
addFeatureAttributes(word, attributes) {
|
|
59
|
-
this.addAttributeForFeatureType(word, attributes, "PronType");
|
|
60
|
-
this.addAttributeForFeatureType(word, attributes, "NumType");
|
|
61
|
-
this.addAttributeForFeatureType(word, attributes, "Number");
|
|
62
|
-
this.addAttributeForFeatureType(word, attributes, "Case");
|
|
63
|
-
this.addAttributeForFeatureType(word, attributes, "Definite");
|
|
64
|
-
this.addAttributeForFeatureType(word, attributes, "Degree");
|
|
65
|
-
this.addAttributeForFeatureType(word, attributes, "VerbForm");
|
|
66
|
-
this.addAttributeForFeatureType(word, attributes, "Mood");
|
|
67
|
-
this.addAttributeForFeatureType(word, attributes, "Tense");
|
|
68
|
-
this.addAttributeForFeatureType(word, attributes, "Aspect");
|
|
69
|
-
this.addAttributeForFeatureType(word, attributes, "Voice");
|
|
70
|
-
this.addAttributeForFeatureType(word, attributes, "Evident");
|
|
71
|
-
this.addAttributeForFeatureType(word, attributes, "Polarity");
|
|
72
|
-
this.addAttributeForFeatureType(word, attributes, "Person");
|
|
19
|
+
else {
|
|
20
|
+
attributes.push(new DiscreteIndexedAttribute_1.DiscreteIndexedAttribute("null", 0, numberOfValues));
|
|
73
21
|
}
|
|
74
22
|
}
|
|
75
|
-
|
|
76
|
-
|
|
23
|
+
/**
|
|
24
|
+
* Adds a set of default (empty) attributes to the list of attributes. These attributes represent
|
|
25
|
+
* various feature types with default "null" values.
|
|
26
|
+
* @param attributes The list of attributes to which the default attributes will be added.
|
|
27
|
+
*/
|
|
28
|
+
addEmptyAttributes(attributes) {
|
|
29
|
+
attributes.push(new DiscreteIndexedAttribute_1.DiscreteIndexedAttribute("null", 0, UniversalDependencyTreeBankFeatures_1.UniversalDependencyTreeBankFeatures.numberOfValues("tr", "PronType") + 1));
|
|
30
|
+
attributes.push(new DiscreteIndexedAttribute_1.DiscreteIndexedAttribute("null", 0, UniversalDependencyTreeBankFeatures_1.UniversalDependencyTreeBankFeatures.numberOfValues("tr", "NumType") + 1));
|
|
31
|
+
attributes.push(new DiscreteIndexedAttribute_1.DiscreteIndexedAttribute("null", 0, UniversalDependencyTreeBankFeatures_1.UniversalDependencyTreeBankFeatures.numberOfValues("tr", "Number") + 1));
|
|
32
|
+
attributes.push(new DiscreteIndexedAttribute_1.DiscreteIndexedAttribute("null", 0, UniversalDependencyTreeBankFeatures_1.UniversalDependencyTreeBankFeatures.numberOfValues("tr", "Case") + 1));
|
|
33
|
+
attributes.push(new DiscreteIndexedAttribute_1.DiscreteIndexedAttribute("null", 0, UniversalDependencyTreeBankFeatures_1.UniversalDependencyTreeBankFeatures.numberOfValues("tr", "Definite") + 1));
|
|
34
|
+
attributes.push(new DiscreteIndexedAttribute_1.DiscreteIndexedAttribute("null", 0, UniversalDependencyTreeBankFeatures_1.UniversalDependencyTreeBankFeatures.numberOfValues("tr", "Degree") + 1));
|
|
35
|
+
attributes.push(new DiscreteIndexedAttribute_1.DiscreteIndexedAttribute("null", 0, UniversalDependencyTreeBankFeatures_1.UniversalDependencyTreeBankFeatures.numberOfValues("tr", "VerbForm") + 1));
|
|
36
|
+
attributes.push(new DiscreteIndexedAttribute_1.DiscreteIndexedAttribute("null", 0, UniversalDependencyTreeBankFeatures_1.UniversalDependencyTreeBankFeatures.numberOfValues("tr", "Mood") + 1));
|
|
37
|
+
attributes.push(new DiscreteIndexedAttribute_1.DiscreteIndexedAttribute("null", 0, UniversalDependencyTreeBankFeatures_1.UniversalDependencyTreeBankFeatures.numberOfValues("tr", "Tense") + 1));
|
|
38
|
+
attributes.push(new DiscreteIndexedAttribute_1.DiscreteIndexedAttribute("null", 0, UniversalDependencyTreeBankFeatures_1.UniversalDependencyTreeBankFeatures.numberOfValues("tr", "Aspect") + 1));
|
|
39
|
+
attributes.push(new DiscreteIndexedAttribute_1.DiscreteIndexedAttribute("null", 0, UniversalDependencyTreeBankFeatures_1.UniversalDependencyTreeBankFeatures.numberOfValues("tr", "Voice") + 1));
|
|
40
|
+
attributes.push(new DiscreteIndexedAttribute_1.DiscreteIndexedAttribute("null", 0, UniversalDependencyTreeBankFeatures_1.UniversalDependencyTreeBankFeatures.numberOfValues("tr", "Evident") + 1));
|
|
41
|
+
attributes.push(new DiscreteIndexedAttribute_1.DiscreteIndexedAttribute("null", 0, UniversalDependencyTreeBankFeatures_1.UniversalDependencyTreeBankFeatures.numberOfValues("tr", "Polarity") + 1));
|
|
42
|
+
attributes.push(new DiscreteIndexedAttribute_1.DiscreteIndexedAttribute("null", 0, UniversalDependencyTreeBankFeatures_1.UniversalDependencyTreeBankFeatures.numberOfValues("tr", "Person") + 1));
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Adds attributes for various feature types of a given word to the list of attributes.
|
|
46
|
+
* @param word The word whose feature values are used to create the attributes.
|
|
47
|
+
* @param attributes The list of attributes to which the new attributes will be added.
|
|
48
|
+
*/
|
|
49
|
+
addFeatureAttributes(word, attributes) {
|
|
50
|
+
this.addAttributeForFeatureType(word, attributes, "PronType");
|
|
51
|
+
this.addAttributeForFeatureType(word, attributes, "NumType");
|
|
52
|
+
this.addAttributeForFeatureType(word, attributes, "Number");
|
|
53
|
+
this.addAttributeForFeatureType(word, attributes, "Case");
|
|
54
|
+
this.addAttributeForFeatureType(word, attributes, "Definite");
|
|
55
|
+
this.addAttributeForFeatureType(word, attributes, "Degree");
|
|
56
|
+
this.addAttributeForFeatureType(word, attributes, "VerbForm");
|
|
57
|
+
this.addAttributeForFeatureType(word, attributes, "Mood");
|
|
58
|
+
this.addAttributeForFeatureType(word, attributes, "Tense");
|
|
59
|
+
this.addAttributeForFeatureType(word, attributes, "Aspect");
|
|
60
|
+
this.addAttributeForFeatureType(word, attributes, "Voice");
|
|
61
|
+
this.addAttributeForFeatureType(word, attributes, "Evident");
|
|
62
|
+
this.addAttributeForFeatureType(word, attributes, "Polarity");
|
|
63
|
+
this.addAttributeForFeatureType(word, attributes, "Person");
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
exports.InstanceGenerator = InstanceGenerator;
|
|
77
67
|
//# sourceMappingURL=InstanceGenerator.js.map
|