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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InstanceGenerator.js","sourceRoot":"","sources":["../../../source/Parser/TransitionBasedParser/InstanceGenerator.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"InstanceGenerator.js","sourceRoot":"","sources":["../../../source/Parser/TransitionBasedParser/InstanceGenerator.ts"],"names":[],"mappings":";;;AAKA,wIAEwF;AACxF,gHAA2G;AAG3G,MAAsB,iBAAiB;IAWnC;;;;;OAKG;IACK,0BAA0B,CAAC,IAAqC,EACrC,UAA4B,EAC5B,WAAmB;QAClD,IAAI,OAAO,GAAG,IAAI,CAAC,eAAe,CAAC,WAAW,CAAC,CAAA;QAC/C,IAAI,cAAc,GAAG,yEAAmC,CAAC,cAAc,CAAC,IAAI,EAAE,WAAW,CAAC,GAAG,CAAC,CAAA;QAC9F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AC,CAAA;IAC/D,CAAC;CACJ;AAzED,8CAyEC"}
|
|
@@ -1,116 +1,108 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Oracle = void 0;
|
|
4
|
+
const Candidate_1 = require("./Candidate");
|
|
5
|
+
const UniversalDependencyRelation_1 = require("nlptoolkit-dependencyparser/dist/Universal/UniversalDependencyRelation");
|
|
6
|
+
const UniversalDependencyType_1 = require("nlptoolkit-dependencyparser/dist/Universal/UniversalDependencyType");
|
|
7
|
+
const Command_1 = require("./Command");
|
|
8
|
+
class Oracle {
|
|
9
|
+
commandModel;
|
|
10
|
+
windowSize;
|
|
11
|
+
/**
|
|
12
|
+
* Constructs an Oracle with the given model and window size.
|
|
13
|
+
* @param model the model used for making predictions
|
|
14
|
+
* @param windowSize the size of the window used in parsing
|
|
15
|
+
*/
|
|
16
|
+
constructor(model, windowSize) {
|
|
17
|
+
this.commandModel = model;
|
|
18
|
+
this.windowSize = windowSize;
|
|
5
19
|
}
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* Finds the best valid parsing action for the ARC_EAGER transition system based on probabilities.
|
|
29
|
-
* Ensures the action is applicable given the current state.
|
|
30
|
-
* @param probabilities a map of actions to their associated probabilities
|
|
31
|
-
* @param state the current parsing state
|
|
32
|
-
* @return the best action as a string, or an empty string if no valid action is found
|
|
33
|
-
*/
|
|
34
|
-
findBestValidEagerClassInfo(probabilities, state) {
|
|
35
|
-
let bestValue = 0.0;
|
|
36
|
-
let best = "";
|
|
37
|
-
for (let key in probabilities) {
|
|
38
|
-
if (probabilities.get(key) > bestValue) {
|
|
39
|
-
if (key == "SHIFT" || key == "RIGHTARC") {
|
|
40
|
-
if (state.wordListSize() > 0) {
|
|
20
|
+
/**
|
|
21
|
+
* Finds the best valid parsing action for the ARC_EAGER transition system based on probabilities.
|
|
22
|
+
* Ensures the action is applicable given the current state.
|
|
23
|
+
* @param probabilities a map of actions to their associated probabilities
|
|
24
|
+
* @param state the current parsing state
|
|
25
|
+
* @return the best action as a string, or an empty string if no valid action is found
|
|
26
|
+
*/
|
|
27
|
+
findBestValidEagerClassInfo(probabilities, state) {
|
|
28
|
+
let bestValue = 0.0;
|
|
29
|
+
let best = "";
|
|
30
|
+
for (let key in probabilities) {
|
|
31
|
+
if (probabilities.get(key) > bestValue) {
|
|
32
|
+
if (key == "SHIFT" || key == "RIGHTARC") {
|
|
33
|
+
if (state.wordListSize() > 0) {
|
|
34
|
+
best = key;
|
|
35
|
+
bestValue = probabilities.get(key);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
if (state.stackSize() > 1) {
|
|
40
|
+
if (!(key == "REDUCE" && state.getPeek().getRelation() == null)) {
|
|
41
41
|
best = key;
|
|
42
42
|
bestValue = probabilities.get(key);
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
|
-
else {
|
|
46
|
-
if (state.stackSize() > 1) {
|
|
47
|
-
if (!(key == "REDUCE" && state.getPeek().getRelation() == null)) {
|
|
48
|
-
best = key;
|
|
49
|
-
bestValue = probabilities.get(key);
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
45
|
}
|
|
54
46
|
}
|
|
55
|
-
return best;
|
|
56
47
|
}
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
48
|
+
return best;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Finds the best valid parsing action for the ARC_STANDARD transition system based on probabilities.
|
|
52
|
+
* Ensures the action is applicable given the current state.
|
|
53
|
+
* @param probabilities a map of actions to their associated probabilities
|
|
54
|
+
* @param state the current parsing state
|
|
55
|
+
* @return the best action as a string, or an empty string if no valid action is found
|
|
56
|
+
*/
|
|
57
|
+
findBestValidStandardClassInfo(probabilities, state) {
|
|
58
|
+
let bestValue = 0.0;
|
|
59
|
+
let best = "";
|
|
60
|
+
for (let key in probabilities) {
|
|
61
|
+
if (probabilities.get(key) > bestValue) {
|
|
62
|
+
if (key == "SHIFT") {
|
|
63
|
+
if (state.wordListSize() > 0) {
|
|
64
|
+
best = key;
|
|
65
|
+
bestValue = probabilities.get(key);
|
|
74
66
|
}
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
67
|
+
}
|
|
68
|
+
else {
|
|
69
|
+
if (state.stackSize() > 1) {
|
|
70
|
+
best = key;
|
|
71
|
+
bestValue = probabilities.get(key);
|
|
80
72
|
}
|
|
81
73
|
}
|
|
82
74
|
}
|
|
83
|
-
return best;
|
|
84
75
|
}
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
76
|
+
return best;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Converts a string representation of the best action into a {@link Candidate} object.
|
|
80
|
+
* @param best the best action represented as a string, possibly with a dependency type in parentheses
|
|
81
|
+
* @return a {@link Candidate} object representing the action, or null if the action is unknown
|
|
82
|
+
*/
|
|
83
|
+
getDecisionCandidate(best) {
|
|
84
|
+
let command, type;
|
|
85
|
+
if (best.includes("(")) {
|
|
86
|
+
command = best.substring(0, best.indexOf('('));
|
|
87
|
+
let relation = best.substring(best.indexOf('(') + 1, best.indexOf(')'));
|
|
88
|
+
type = UniversalDependencyRelation_1.UniversalDependencyRelation.getDependencyTag(relation);
|
|
89
|
+
}
|
|
90
|
+
else {
|
|
91
|
+
command = best;
|
|
92
|
+
type = UniversalDependencyType_1.UniversalDependencyType.DEP;
|
|
93
|
+
}
|
|
94
|
+
switch (command) {
|
|
95
|
+
case "SHIFT":
|
|
96
|
+
return new Candidate_1.Candidate(Command_1.Command.SHIFT, type);
|
|
97
|
+
case "REDUCE":
|
|
98
|
+
return new Candidate_1.Candidate(Command_1.Command.REDUCE, type);
|
|
99
|
+
case "LEFTARC":
|
|
100
|
+
return new Candidate_1.Candidate(Command_1.Command.LEFTARC, type);
|
|
101
|
+
case "RIGHTARC":
|
|
102
|
+
return new Candidate_1.Candidate(Command_1.Command.RIGHTARC, type);
|
|
112
103
|
}
|
|
104
|
+
return null;
|
|
113
105
|
}
|
|
114
|
-
|
|
115
|
-
|
|
106
|
+
}
|
|
107
|
+
exports.Oracle = Oracle;
|
|
116
108
|
//# sourceMappingURL=Oracle.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Oracle.js","sourceRoot":"","sources":["../../../source/Parser/TransitionBasedParser/Oracle.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Oracle.js","sourceRoot":"","sources":["../../../source/Parser/TransitionBasedParser/Oracle.ts"],"names":[],"mappings":";;;AAGA,2CAAsC;AACtC,wHAAmH;AACnH,gHAA2G;AAE3G,uCAAkC;AAElC,MAAsB,MAAM;IAEd,YAAY,CAAO;IACnB,UA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ACT,OAAO,IAAI,qBAAS,CAAC,iBAAO,CAAC,MAAM,EAAE,IAAI,CAAC,CAAA;YAC9C,KAAK,SAAS;gBACV,OAAO,IAAI,qBAAS,CAAC,iBAAO,CAAC,OAAO,EAAE,IAAI,CAAC,CAAA;YAC/C,KAAK,UAAU;gBACX,OAAO,IAAI,qBAAS,CAAC,iBAAO,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAA;QACpD,CAAC;QACD,OAAO,IAAI,CAAA;IACf,CAAC;CACJ;AAnHD,wBAmHC"}
|
|
@@ -1,46 +1,36 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RandomOracle = void 0;
|
|
4
|
+
const Oracle_1 = require("./Oracle");
|
|
5
|
+
const Decision_1 = require("./Decision");
|
|
6
|
+
const UniversalDependencyType_1 = require("nlptoolkit-dependencyparser/dist/Universal/UniversalDependencyType");
|
|
7
|
+
const UniversalDependencyRelation_1 = require("nlptoolkit-dependencyparser/dist/Universal/UniversalDependencyRelation");
|
|
8
|
+
const Command_1 = require("./Command");
|
|
9
|
+
class RandomOracle extends Oracle_1.Oracle {
|
|
10
|
+
constructor(model, windowSize) {
|
|
11
|
+
super(model, windowSize);
|
|
5
12
|
}
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* Makes a random decision based on a uniform distribution over possible actions.
|
|
24
|
-
* @param state The current state of the parser.
|
|
25
|
-
* @return A Decision object representing the randomly chosen action.
|
|
26
|
-
*/
|
|
27
|
-
makeDecision(state) {
|
|
28
|
-
let command = Math.floor(Math.random() * 3);
|
|
29
|
-
let relation = Math.floor(Math.random() * 58);
|
|
30
|
-
switch (command) {
|
|
31
|
-
case 0:
|
|
32
|
-
return new Decision_1.Decision(Command_1.Command.LEFTARC, UniversalDependencyRelation_1.UniversalDependencyRelation.universalDependencyTags[relation], 0);
|
|
33
|
-
case 1:
|
|
34
|
-
return new Decision_1.Decision(Command_1.Command.RIGHTARC, UniversalDependencyRelation_1.UniversalDependencyRelation.universalDependencyTags[relation], 0);
|
|
35
|
-
case 2:
|
|
36
|
-
return new Decision_1.Decision(Command_1.Command.SHIFT, UniversalDependencyType_1.UniversalDependencyType.DEP, 0);
|
|
37
|
-
}
|
|
38
|
-
return null;
|
|
39
|
-
}
|
|
40
|
-
scoreDecisions(state, transitionSystem) {
|
|
41
|
-
return null;
|
|
13
|
+
/**
|
|
14
|
+
* Makes a random decision based on a uniform distribution over possible actions.
|
|
15
|
+
* @param state The current state of the parser.
|
|
16
|
+
* @return A Decision object representing the randomly chosen action.
|
|
17
|
+
*/
|
|
18
|
+
makeDecision(state) {
|
|
19
|
+
let command = Math.floor(Math.random() * 3);
|
|
20
|
+
let relation = Math.floor(Math.random() * 58);
|
|
21
|
+
switch (command) {
|
|
22
|
+
case 0:
|
|
23
|
+
return new Decision_1.Decision(Command_1.Command.LEFTARC, UniversalDependencyRelation_1.UniversalDependencyRelation.universalDependencyTags[relation], 0);
|
|
24
|
+
case 1:
|
|
25
|
+
return new Decision_1.Decision(Command_1.Command.RIGHTARC, UniversalDependencyRelation_1.UniversalDependencyRelation.universalDependencyTags[relation], 0);
|
|
26
|
+
case 2:
|
|
27
|
+
return new Decision_1.Decision(Command_1.Command.SHIFT, UniversalDependencyType_1.UniversalDependencyType.DEP, 0);
|
|
42
28
|
}
|
|
29
|
+
return null;
|
|
30
|
+
}
|
|
31
|
+
scoreDecisions(state, transitionSystem) {
|
|
32
|
+
return null;
|
|
43
33
|
}
|
|
44
|
-
|
|
45
|
-
|
|
34
|
+
}
|
|
35
|
+
exports.RandomOracle = RandomOracle;
|
|
46
36
|
//# sourceMappingURL=RandomOracle.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RandomOracle.js","sourceRoot":"","sources":["../../../source/Parser/TransitionBasedParser/RandomOracle.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"RandomOracle.js","sourceRoot":"","sources":["../../../source/Parser/TransitionBasedParser/RandomOracle.ts"],"names":[],"mappings":";;;AAAA,qCAAgC;AAEhC,yCAAoC;AAEpC,gHAA2G;AAC3G,wHAAmH;AACnH,uCAAkC;AAGlC,MAAa,YAAa,SAAQ,eAAM;IAEpC,YAAY,KAAY,EAAE,UAAkB;QACxC,KAAK,CAAC,KAAK,EAAE,UAAU,CAAC,CAAA;IAC5B,CAAC;IAED;;;;OAIG;IACI,YAAY,CAAC,KAAY;QAC5B,IAAI,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,CAAA;QAC3C,IAAI,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,EAAE,CAAC,CAAA;QAC7C,QAAQ,OAAO,EAAC,CAAC;YACb,KAAK,CAAC;gBACF,OAAO,IAAI,mBAAQ,CAAC,iBAAO,CAAC,OAAO,EAAE,yDAA2B,CAAC,uBAAuB,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAA;YAC1G,KAAK,CAAC;gBACF,OAAO,IAAI,mBAAQ,CAAC,iBAAO,CAAC,QAAQ,EAAE,yDAA2B,CAAC,uBAAuB,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAA;YAC3G,KAAK,CAAC;gBACF,OAAO,IAAI,mBAAQ,CAAC,iBAAO,CAAC,KAAK,EAAE,iDAAuB,CAAC,GAAG,EAAE,CAAC,CAAC,CAAA;QAC1E,CAAC;QACD,OAAO,IAAI,CAAA;IACf,CAAC;IAES,cAAc,CAAC,KAAY,EAAE,gBAAkC;QACrE,OAAO,IAAI,CAAC;IAChB,CAAC;CAEJ;AA7BD,oCA6BC"}
|
|
@@ -1,21 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RandomScoringOracle = void 0;
|
|
4
|
+
const ScoringOracle_1 = require("./ScoringOracle");
|
|
5
|
+
class RandomScoringOracle extends ScoringOracle_1.ScoringOracle {
|
|
6
|
+
score(state) {
|
|
7
|
+
return Math.random();
|
|
5
8
|
}
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
}
|
|
9
|
-
})(function (require, exports) {
|
|
10
|
-
"use strict";
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.RandomScoringOracle = void 0;
|
|
13
|
-
const ScoringOracle_1 = require("./ScoringOracle");
|
|
14
|
-
class RandomScoringOracle extends ScoringOracle_1.ScoringOracle {
|
|
15
|
-
score(state) {
|
|
16
|
-
return Math.random();
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
exports.RandomScoringOracle = RandomScoringOracle;
|
|
20
|
-
});
|
|
9
|
+
}
|
|
10
|
+
exports.RandomScoringOracle = RandomScoringOracle;
|
|
21
11
|
//# sourceMappingURL=RandomScoringOracle.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RandomScoringOracle.js","sourceRoot":"","sources":["../../../source/Parser/TransitionBasedParser/RandomScoringOracle.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"RandomScoringOracle.js","sourceRoot":"","sources":["../../../source/Parser/TransitionBasedParser/RandomScoringOracle.ts"],"names":[],"mappings":";;;AAAA,mDAA8C;AAG9C,MAAa,mBAAoB,SAAQ,6BAAa;IAElD,KAAK,CAAC,KAAY;QACd,OAAO,IAAI,CAAC,MAAM,EAAE,CAAA;IACxB,CAAC;CAEJ;AAND,kDAMC"}
|
|
@@ -1,17 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
define(["require", "exports"], factory);
|
|
8
|
-
}
|
|
9
|
-
})(function (require, exports) {
|
|
10
|
-
"use strict";
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.ScoringOracle = void 0;
|
|
13
|
-
class ScoringOracle {
|
|
14
|
-
}
|
|
15
|
-
exports.ScoringOracle = ScoringOracle;
|
|
16
|
-
});
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ScoringOracle = void 0;
|
|
4
|
+
class ScoringOracle {
|
|
5
|
+
}
|
|
6
|
+
exports.ScoringOracle = ScoringOracle;
|
|
17
7
|
//# sourceMappingURL=ScoringOracle.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScoringOracle.js","sourceRoot":"","sources":["../../../source/Parser/TransitionBasedParser/ScoringOracle.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ScoringOracle.js","sourceRoot":"","sources":["../../../source/Parser/TransitionBasedParser/ScoringOracle.ts"],"names":[],"mappings":";;;AAEA,MAAsB,aAAa;CAElC;AAFD,sCAEC"}
|
|
@@ -1,67 +1,57 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SimpleInstanceGenerator = void 0;
|
|
4
|
+
const InstanceGenerator_1 = require("./InstanceGenerator");
|
|
5
|
+
const Instance_1 = require("nlptoolkit-classification/dist/Instance/Instance");
|
|
6
|
+
const DiscreteIndexedAttribute_1 = require("nlptoolkit-classification/dist/Attribute/DiscreteIndexedAttribute");
|
|
7
|
+
const UniversalDependencyTreeBankFeatures_1 = require("nlptoolkit-dependencyparser/dist/Universal/UniversalDependencyTreeBankFeatures");
|
|
8
|
+
class SimpleInstanceGenerator extends InstanceGenerator_1.InstanceGenerator {
|
|
9
|
+
constructor() {
|
|
10
|
+
super();
|
|
5
11
|
}
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
* @param command The command to be associated with the generated instance.
|
|
26
|
-
* @return The generated {@link Instance} object with attributes based on the state and command.
|
|
27
|
-
*/
|
|
28
|
-
generate(state, windowSize, command) {
|
|
29
|
-
let instance = new Instance_1.Instance(command);
|
|
30
|
-
let attributes = new Array();
|
|
31
|
-
for (let i = 0; i < windowSize; i++) {
|
|
32
|
-
let word = state.getStackWord(i);
|
|
33
|
-
if (word == null) {
|
|
34
|
-
attributes.push(new DiscreteIndexedAttribute_1.DiscreteIndexedAttribute("null", 0, 18));
|
|
12
|
+
/**
|
|
13
|
+
* Generates an instance based on the state, window size, and command.
|
|
14
|
+
* @param state The current state of the parser, which includes the stack and word list.
|
|
15
|
+
* @param windowSize The size of the window used for feature extraction.
|
|
16
|
+
* @param command The command to be associated with the generated instance.
|
|
17
|
+
* @return The generated {@link Instance} object with attributes based on the state and command.
|
|
18
|
+
*/
|
|
19
|
+
generate(state, windowSize, command) {
|
|
20
|
+
let instance = new Instance_1.Instance(command);
|
|
21
|
+
let attributes = new Array();
|
|
22
|
+
for (let i = 0; i < windowSize; i++) {
|
|
23
|
+
let word = state.getStackWord(i);
|
|
24
|
+
if (word == null) {
|
|
25
|
+
attributes.push(new DiscreteIndexedAttribute_1.DiscreteIndexedAttribute("null", 0, 18));
|
|
26
|
+
this.addEmptyAttributes(attributes);
|
|
27
|
+
}
|
|
28
|
+
else {
|
|
29
|
+
if (word.getName() == "root") {
|
|
30
|
+
attributes.push(new DiscreteIndexedAttribute_1.DiscreteIndexedAttribute("root", 0, 18));
|
|
35
31
|
this.addEmptyAttributes(attributes);
|
|
36
32
|
}
|
|
37
33
|
else {
|
|
38
|
-
if (word.getName() == "root") {
|
|
39
|
-
attributes.push(new DiscreteIndexedAttribute_1.DiscreteIndexedAttribute("root", 0, 18));
|
|
40
|
-
this.addEmptyAttributes(attributes);
|
|
41
|
-
}
|
|
42
|
-
else {
|
|
43
|
-
attributes.push(new DiscreteIndexedAttribute_1.DiscreteIndexedAttribute(word.getUpos().toString(), UniversalDependencyTreeBankFeatures_1.UniversalDependencyTreeBankFeatures.posIndex(word.getUpos().toString()) + 1, 18));
|
|
44
|
-
this.addFeatureAttributes(word, attributes);
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
for (let i = 0; i < windowSize; i++) {
|
|
49
|
-
let word = state.getWordListWord(i);
|
|
50
|
-
if (word != null) {
|
|
51
34
|
attributes.push(new DiscreteIndexedAttribute_1.DiscreteIndexedAttribute(word.getUpos().toString(), UniversalDependencyTreeBankFeatures_1.UniversalDependencyTreeBankFeatures.posIndex(word.getUpos().toString()) + 1, 18));
|
|
52
35
|
this.addFeatureAttributes(word, attributes);
|
|
53
36
|
}
|
|
54
|
-
else {
|
|
55
|
-
attributes.push(new DiscreteIndexedAttribute_1.DiscreteIndexedAttribute("root", 0, 18));
|
|
56
|
-
this.addEmptyAttributes(attributes);
|
|
57
|
-
}
|
|
58
37
|
}
|
|
59
|
-
|
|
60
|
-
|
|
38
|
+
}
|
|
39
|
+
for (let i = 0; i < windowSize; i++) {
|
|
40
|
+
let word = state.getWordListWord(i);
|
|
41
|
+
if (word != null) {
|
|
42
|
+
attributes.push(new DiscreteIndexedAttribute_1.DiscreteIndexedAttribute(word.getUpos().toString(), UniversalDependencyTreeBankFeatures_1.UniversalDependencyTreeBankFeatures.posIndex(word.getUpos().toString()) + 1, 18));
|
|
43
|
+
this.addFeatureAttributes(word, attributes);
|
|
44
|
+
}
|
|
45
|
+
else {
|
|
46
|
+
attributes.push(new DiscreteIndexedAttribute_1.DiscreteIndexedAttribute("root", 0, 18));
|
|
47
|
+
this.addEmptyAttributes(attributes);
|
|
61
48
|
}
|
|
62
|
-
return instance;
|
|
63
49
|
}
|
|
50
|
+
for (let attribute of attributes) {
|
|
51
|
+
instance.addAttribute(attribute);
|
|
52
|
+
}
|
|
53
|
+
return instance;
|
|
64
54
|
}
|
|
65
|
-
|
|
66
|
-
|
|
55
|
+
}
|
|
56
|
+
exports.SimpleInstanceGenerator = SimpleInstanceGenerator;
|
|
67
57
|
//# sourceMappingURL=SimpleInstanceGenerator.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SimpleInstanceGenerator.js","sourceRoot":"","sources":["../../../source/Parser/TransitionBasedParser/SimpleInstanceGenerator.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SimpleInstanceGenerator.js","sourceRoot":"","sources":["../../../source/Parser/TransitionBasedParser/SimpleInstanceGenerator.ts"],"names":[],"mappings":";;;AAAA,2DAAsD;AAEtD,+EAA0E;AAC1E,gHAA2G;AAC3G,wIAEwF;AAGxF,MAAa,uBAAwB,SAAQ,qCAAiB;IAE1D;QACI,KAAK,EAAE,CAAC;IACZ,CAAC;IAED;;;;;;OAMG;IACH,QAAQ,CAAC,KAAY,EAAE,UAAkB,EAAE,OAAe;QACtD,IAAI,QAAQ,GAAG,IAAI,mBAAQ,CAAC,OAAO,CAAC,CAAA;QACpC,IAAI,UAAU,GAAG,IAAI,KAAK,EAAa,CAAA;QACvC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,UAAU,EAAE,CAAC,EAAE,EAAE,CAAC;YAClC,IAAI,IAAI,GAAG,KAAK,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;YACjC,IAAI,IAAI,IAAI,IAAI,EAAE,CAAC;gBACf,UAAU,CAAC,IAAI,CAAC,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AAC,IAAI,CAAC,IAAI,mDAAwB,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAA;gBAC5D,IAAI,CAAC,kBAAkB,CAAC,UAAU,CAAC,CAAA;YACvC,CAAC;QACL,CAAC;QACD,KAAK,IAAI,SAAS,IAAI,UAAU,EAAE,CAAC;YAC/B,QAAQ,CAAC,YAAY,CAAC,SAAS,CAAC,CAAA;QACpC,CAAC;QACD,OAAO,QAAQ,CAAA;IACnB,CAAC;CAEJ;AA/CD,0DA+CC"}
|
|
@@ -1,30 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.StackRelation = void 0;
|
|
4
|
+
class StackRelation {
|
|
5
|
+
word;
|
|
6
|
+
relation;
|
|
7
|
+
constructor(word, relation) {
|
|
8
|
+
this.word = word;
|
|
9
|
+
this.relation = relation;
|
|
5
10
|
}
|
|
6
|
-
|
|
7
|
-
|
|
11
|
+
clone() {
|
|
12
|
+
return new StackRelation(this.word.clone(), this.relation);
|
|
8
13
|
}
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.StackRelation = void 0;
|
|
13
|
-
class StackRelation {
|
|
14
|
-
constructor(word, relation) {
|
|
15
|
-
this.word = word;
|
|
16
|
-
this.relation = relation;
|
|
17
|
-
}
|
|
18
|
-
clone() {
|
|
19
|
-
return new StackRelation(this.word.clone(), this.relation);
|
|
20
|
-
}
|
|
21
|
-
getWord() {
|
|
22
|
-
return this.word;
|
|
23
|
-
}
|
|
24
|
-
getRelation() {
|
|
25
|
-
return this.relation;
|
|
26
|
-
}
|
|
14
|
+
getWord() {
|
|
15
|
+
return this.word;
|
|
27
16
|
}
|
|
28
|
-
|
|
29
|
-
|
|
17
|
+
getRelation() {
|
|
18
|
+
return this.relation;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
exports.StackRelation = StackRelation;
|
|
30
22
|
//# sourceMappingURL=StackRelation.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StackRelation.js","sourceRoot":"","sources":["../../../source/Parser/TransitionBasedParser/StackRelation.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"StackRelation.js","sourceRoot":"","sources":["../../../source/Parser/TransitionBasedParser/StackRelation.ts"],"names":[],"mappings":";;;AAKA,MAAa,aAAa;IAEL,IAAI,CAAiC;IACrC,QAAQ,CAA6B;IAEtD,YAAY,IAAqC,EAAE,QAAqC;QACpF,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA;QAChB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAA;IAC5B,CAAC;IAED,KAAK;QACD,OAAO,IAAI,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAA;IAC9D,CAAC;IAED,OAAO;QACH,OAAO,IAAI,CAAC,IAAI,CAAA;IACpB,CAAC;IAED,WAAW;QACP,OAAO,IAAI,CAAC,QAAQ,CAAA;IACxB,CAAC;CACJ;AArBD,sCAqBC"}
|