nlptoolkit-universaldependencyparser 1.0.0 → 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.
Files changed (119) hide show
  1. package/dist/Parser/TransitionBasedParser/Agenda.js +64 -0
  2. package/dist/Parser/TransitionBasedParser/Agenda.js.map +1 -0
  3. package/dist/Parser/TransitionBasedParser/ArcEagerInstanceGenerator.js +71 -0
  4. package/dist/Parser/TransitionBasedParser/ArcEagerInstanceGenerator.js.map +1 -0
  5. package/dist/{ArcEagerOracle.d.ts → Parser/TransitionBasedParser/ArcEagerOracle.d.ts} +1 -0
  6. package/dist/Parser/TransitionBasedParser/ArcEagerOracle.js +30 -0
  7. package/dist/Parser/TransitionBasedParser/ArcEagerOracle.js.map +1 -0
  8. package/dist/Parser/TransitionBasedParser/ArcEagerTransitionParser.js +104 -0
  9. package/dist/Parser/TransitionBasedParser/ArcEagerTransitionParser.js.map +1 -0
  10. package/dist/{ArcStandardOracle.d.ts → Parser/TransitionBasedParser/ArcStandardOracle.d.ts} +1 -0
  11. package/dist/Parser/TransitionBasedParser/ArcStandardOracle.js +27 -0
  12. package/dist/Parser/TransitionBasedParser/ArcStandardOracle.js.map +1 -0
  13. package/dist/Parser/TransitionBasedParser/ArcStandardTransitionParser.js +120 -0
  14. package/dist/Parser/TransitionBasedParser/ArcStandardTransitionParser.js.map +1 -0
  15. package/dist/{Candidate.d.ts → Parser/TransitionBasedParser/Candidate.d.ts} +1 -0
  16. package/dist/Parser/TransitionBasedParser/Candidate.js +19 -0
  17. package/dist/Parser/TransitionBasedParser/Candidate.js.map +1 -0
  18. package/dist/{Command.d.ts → Parser/TransitionBasedParser/Command.d.ts} +1 -1
  19. package/dist/{Command.js → Parser/TransitionBasedParser/Command.js} +4 -1
  20. package/dist/Parser/TransitionBasedParser/Command.js.map +1 -0
  21. package/dist/{Decision.d.ts → Parser/TransitionBasedParser/Decision.d.ts} +1 -0
  22. package/dist/Parser/TransitionBasedParser/Decision.js +16 -0
  23. package/dist/Parser/TransitionBasedParser/Decision.js.map +1 -0
  24. package/dist/Parser/TransitionBasedParser/InstanceGenerator.js +67 -0
  25. package/dist/Parser/TransitionBasedParser/InstanceGenerator.js.map +1 -0
  26. package/dist/{Oracle.d.ts → Parser/TransitionBasedParser/Oracle.d.ts} +1 -0
  27. package/dist/Parser/TransitionBasedParser/Oracle.js +108 -0
  28. package/dist/Parser/TransitionBasedParser/Oracle.js.map +1 -0
  29. package/dist/{RandomOracle.d.ts → Parser/TransitionBasedParser/RandomOracle.d.ts} +1 -0
  30. package/dist/Parser/TransitionBasedParser/RandomOracle.js +36 -0
  31. package/dist/Parser/TransitionBasedParser/RandomOracle.js.map +1 -0
  32. package/dist/Parser/TransitionBasedParser/RandomScoringOracle.js +11 -0
  33. package/dist/Parser/TransitionBasedParser/RandomScoringOracle.js.map +1 -0
  34. package/dist/Parser/TransitionBasedParser/ScoringOracle.js +7 -0
  35. package/dist/Parser/TransitionBasedParser/ScoringOracle.js.map +1 -0
  36. package/dist/Parser/TransitionBasedParser/SimpleInstanceGenerator.js +57 -0
  37. package/dist/Parser/TransitionBasedParser/SimpleInstanceGenerator.js.map +1 -0
  38. package/dist/Parser/TransitionBasedParser/StackRelation.js +22 -0
  39. package/dist/Parser/TransitionBasedParser/StackRelation.js.map +1 -0
  40. package/dist/Parser/TransitionBasedParser/StackWord.js +34 -0
  41. package/dist/Parser/TransitionBasedParser/StackWord.js.map +1 -0
  42. package/dist/{State.d.ts → Parser/TransitionBasedParser/State.d.ts} +2 -0
  43. package/dist/Parser/TransitionBasedParser/State.js +156 -0
  44. package/dist/Parser/TransitionBasedParser/State.js.map +1 -0
  45. package/dist/{TransitionParser.d.ts → Parser/TransitionBasedParser/TransitionParser.d.ts} +1 -0
  46. package/dist/Parser/TransitionBasedParser/TransitionParser.js +156 -0
  47. package/dist/Parser/TransitionBasedParser/TransitionParser.js.map +1 -0
  48. package/dist/{TransitionSystem.d.ts → Parser/TransitionBasedParser/TransitionSystem.d.ts} +1 -1
  49. package/dist/Parser/TransitionBasedParser/TransitionSystem.js +9 -0
  50. package/dist/Parser/TransitionBasedParser/TransitionSystem.js.map +1 -0
  51. package/dist/index.d.ts +20 -0
  52. package/dist/index.js +37 -0
  53. package/dist/index.js.map +1 -0
  54. package/package.json +8 -7
  55. package/source/Parser/TransitionBasedParser/ArcEagerOracle.ts +2 -0
  56. package/source/Parser/TransitionBasedParser/ArcEagerTransitionParser.ts +1 -0
  57. package/source/Parser/TransitionBasedParser/ArcStandardOracle.ts +2 -0
  58. package/source/Parser/TransitionBasedParser/ArcStandardTransitionParser.ts +1 -0
  59. package/source/Parser/TransitionBasedParser/Candidate.ts +1 -0
  60. package/source/Parser/TransitionBasedParser/Command.ts +1 -1
  61. package/source/Parser/TransitionBasedParser/Decision.ts +1 -0
  62. package/source/Parser/TransitionBasedParser/Oracle.ts +2 -0
  63. package/source/Parser/TransitionBasedParser/RandomOracle.ts +2 -0
  64. package/source/Parser/TransitionBasedParser/State.ts +2 -0
  65. package/source/Parser/TransitionBasedParser/TransitionParser.ts +2 -0
  66. package/source/Parser/TransitionBasedParser/TransitionSystem.ts +1 -1
  67. package/source/index.ts +20 -0
  68. package/tsconfig.json +4 -4
  69. package/dist/Agenda.js +0 -72
  70. package/dist/Agenda.js.map +0 -1
  71. package/dist/ArcEagerInstanceGenerator.js +0 -81
  72. package/dist/ArcEagerInstanceGenerator.js.map +0 -1
  73. package/dist/ArcEagerOracle.js +0 -39
  74. package/dist/ArcEagerOracle.js.map +0 -1
  75. package/dist/ArcEagerTransitionParser.js +0 -113
  76. package/dist/ArcEagerTransitionParser.js.map +0 -1
  77. package/dist/ArcStandardOracle.js +0 -36
  78. package/dist/ArcStandardOracle.js.map +0 -1
  79. package/dist/ArcStandardTransitionParser.js +0 -129
  80. package/dist/ArcStandardTransitionParser.js.map +0 -1
  81. package/dist/Candidate.js +0 -27
  82. package/dist/Candidate.js.map +0 -1
  83. package/dist/Command.js.map +0 -1
  84. package/dist/Decision.js +0 -25
  85. package/dist/Decision.js.map +0 -1
  86. package/dist/InstanceGenerator.js +0 -77
  87. package/dist/InstanceGenerator.js.map +0 -1
  88. package/dist/Oracle.js +0 -115
  89. package/dist/Oracle.js.map +0 -1
  90. package/dist/RandomOracle.js +0 -45
  91. package/dist/RandomOracle.js.map +0 -1
  92. package/dist/RandomScoringOracle.js +0 -21
  93. package/dist/RandomScoringOracle.js.map +0 -1
  94. package/dist/ScoringOracle.js +0 -17
  95. package/dist/ScoringOracle.js.map +0 -1
  96. package/dist/SimpleInstanceGenerator.js +0 -67
  97. package/dist/SimpleInstanceGenerator.js.map +0 -1
  98. package/dist/StackRelation.js +0 -30
  99. package/dist/StackRelation.js.map +0 -1
  100. package/dist/StackWord.js +0 -42
  101. package/dist/StackWord.js.map +0 -1
  102. package/dist/State.js +0 -161
  103. package/dist/State.js.map +0 -1
  104. package/dist/TransitionParser.js +0 -164
  105. package/dist/TransitionParser.js.map +0 -1
  106. package/dist/TransitionSystem.js +0 -6
  107. package/dist/TransitionSystem.js.map +0 -1
  108. package/index.js +0 -20
  109. package/source/tsconfig.json +0 -13
  110. /package/dist/{Agenda.d.ts → Parser/TransitionBasedParser/Agenda.d.ts} +0 -0
  111. /package/dist/{ArcEagerInstanceGenerator.d.ts → Parser/TransitionBasedParser/ArcEagerInstanceGenerator.d.ts} +0 -0
  112. /package/dist/{ArcEagerTransitionParser.d.ts → Parser/TransitionBasedParser/ArcEagerTransitionParser.d.ts} +0 -0
  113. /package/dist/{ArcStandardTransitionParser.d.ts → Parser/TransitionBasedParser/ArcStandardTransitionParser.d.ts} +0 -0
  114. /package/dist/{InstanceGenerator.d.ts → Parser/TransitionBasedParser/InstanceGenerator.d.ts} +0 -0
  115. /package/dist/{RandomScoringOracle.d.ts → Parser/TransitionBasedParser/RandomScoringOracle.d.ts} +0 -0
  116. /package/dist/{ScoringOracle.d.ts → Parser/TransitionBasedParser/ScoringOracle.d.ts} +0 -0
  117. /package/dist/{SimpleInstanceGenerator.d.ts → Parser/TransitionBasedParser/SimpleInstanceGenerator.d.ts} +0 -0
  118. /package/dist/{StackRelation.d.ts → Parser/TransitionBasedParser/StackRelation.d.ts} +0 -0
  119. /package/dist/{StackWord.d.ts → Parser/TransitionBasedParser/StackWord.d.ts} +0 -0
@@ -1,39 +0,0 @@
1
- (function (factory) {
2
- if (typeof module === "object" && typeof module.exports === "object") {
3
- var v = factory(require, exports);
4
- if (v !== undefined) module.exports = v;
5
- }
6
- else if (typeof define === "function" && define.amd) {
7
- define(["require", "exports", "./Oracle", "./Decision", "./SimpleInstanceGenerator"], factory);
8
- }
9
- })(function (require, exports) {
10
- "use strict";
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.ArcEagerOracle = void 0;
13
- const Oracle_1 = require("./Oracle");
14
- const Decision_1 = require("./Decision");
15
- const SimpleInstanceGenerator_1 = require("./SimpleInstanceGenerator");
16
- class ArcEagerOracle extends Oracle_1.Oracle {
17
- constructor(model, windowSize) {
18
- super(model, windowSize);
19
- }
20
- makeDecision(state) {
21
- let instanceGenerator = new SimpleInstanceGenerator_1.SimpleInstanceGenerator();
22
- let instance = instanceGenerator.generate(state, this.windowSize, "");
23
- let best = this.findBestValidEagerClassInfo(this.commandModel.predictProbability(instance), state);
24
- let decisionCandidate = this.getDecisionCandidate(best);
25
- if (decisionCandidate.getCommand() == Command.SHIFT) {
26
- return new Decision_1.Decision(Command.SHIFT, null, 0.0);
27
- }
28
- else if (decisionCandidate.getCommand() == Command.REDUCE) {
29
- return new Decision_1.Decision(Command.REDUCE, null, 0.0);
30
- }
31
- return new Decision_1.Decision(decisionCandidate.getCommand(), decisionCandidate.getUniversalDependencyType(), 0.0);
32
- }
33
- scoreDecisions(state, transitionSystem) {
34
- return null;
35
- }
36
- }
37
- exports.ArcEagerOracle = ArcEagerOracle;
38
- });
39
- //# sourceMappingURL=ArcEagerOracle.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ArcEagerOracle.js","sourceRoot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of module.exports === "object") {
3
- var v = factory(require, exports);
4
- if (v !== undefined) module.exports = v;
5
- }
6
- else if (typeof define === "function" && define.amd) {
7
- define(["require", "exports", "./TransitionParser", "nlptoolkit-dependencyparser/dist/Universal/UniversalDependencyTreeBankWord", "./ArcEagerInstanceGenerator", "./StackWord", "./State"], factory);
8
- }
9
- })(function (require, exports) {
10
- "use strict";
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.ArcEagerTransitionParser = void 0;
13
- const TransitionParser_1 = require("./TransitionParser");
14
- const UniversalDependencyTreeBankWord_1 = require("nlptoolkit-dependencyparser/dist/Universal/UniversalDependencyTreeBankWord");
15
- const ArcEagerInstanceGenerator_1 = require("./ArcEagerInstanceGenerator");
16
- const StackWord_1 = require("./StackWord");
17
- const State_1 = require("./State");
18
- class ArcEagerTransitionParser extends TransitionParser_1.TransitionParser {
19
- constructor() {
20
- super();
21
- }
22
- dependencyParse(universalDependencyTreeBankSentence, oracle) {
23
- let sentence = this.createResultSentence(universalDependencyTreeBankSentence);
24
- let state = this.initialState(sentence);
25
- while (state.wordListSize() > 0 || state.stackSize() > 1) {
26
- let decision = oracle.makeDecision(state);
27
- switch (decision.getCommand()) {
28
- case Command.SHIFT:
29
- state.applyShift();
30
- break;
31
- case Command.LEFTARC:
32
- state.applyArcEagerLeftArc(decision.getUniversalDependencyType());
33
- break;
34
- case Command.RIGHTARC:
35
- state.applyArcEagerRightArc(decision.getUniversalDependencyType());
36
- break;
37
- case Command.REDUCE:
38
- state.applyReduce();
39
- break;
40
- default:
41
- break;
42
- }
43
- }
44
- return sentence;
45
- }
46
- simulateParse(sentence, windowSize) {
47
- let topRelation = null;
48
- let instanceGenerator = new ArcEagerInstanceGenerator_1.ArcEagerInstanceGenerator();
49
- let instanceList = new Array();
50
- let wordMap = new Map();
51
- let wordList = new Array();
52
- let stack = new Array();
53
- for (let j = 0; j < sentence.wordCount(); j++) {
54
- let word = sentence.getWord(j);
55
- if (word instanceof UniversalDependencyTreeBankWord_1.UniversalDependencyTreeBankWord) {
56
- let clone = word.clone();
57
- clone.setRelation(null);
58
- wordMap.set(j + 1, word);
59
- wordList.push(new StackWord_1.StackWord(clone, j + 1));
60
- }
61
- }
62
- stack.push(new StackWord_1.StackWord());
63
- let state = new State_1.State(stack, wordList, new Array());
64
- while (wordList.length > 0 || stack.length > 1) {
65
- let firstRelation;
66
- let first;
67
- if (wordList.length != 0) {
68
- first = wordList[0].getWord();
69
- firstRelation = wordMap.get(wordList[0].getToWord()).getRelation();
70
- }
71
- else {
72
- first = null;
73
- firstRelation = null;
74
- }
75
- let top = stack[stack.length - 1].getWord();
76
- if (top.getName() != "root") {
77
- topRelation = wordMap.get(stack[stack.length - 1].getToWord()).getRelation();
78
- }
79
- if (stack.length > 1) {
80
- if (firstRelation != null && firstRelation.to() == top.getId()) {
81
- instanceList.push(instanceGenerator.generate(state, windowSize, "RIGHTARC(" + firstRelation + ")"));
82
- let word = wordList.splice(0, 1)[0];
83
- stack.push(new StackWord_1.StackWord(wordMap.get(word.getToWord()), word.getToWord()));
84
- }
85
- else if (first != null && topRelation != null && topRelation.to() == first.getId()) {
86
- instanceList.push(instanceGenerator.generate(state, windowSize, "LEFTARC(" + topRelation + ")"));
87
- stack.pop();
88
- }
89
- else if (wordList.length > 0) {
90
- instanceList.push(instanceGenerator.generate(state, windowSize, "SHIFT"));
91
- stack.push(wordList.splice(0, 1)[0]);
92
- }
93
- else {
94
- instanceList.push(instanceGenerator.generate(state, windowSize, "REDUCE"));
95
- stack.pop();
96
- }
97
- }
98
- else {
99
- if (wordList.length > 0) {
100
- instanceList.push(instanceGenerator.generate(state, windowSize, "SHIFT"));
101
- stack.push(wordList.splice(0, 1)[0]);
102
- }
103
- else {
104
- break;
105
- }
106
- }
107
- }
108
- return instanceList;
109
- }
110
- }
111
- exports.ArcEagerTransitionParser = ArcEagerTransitionParser;
112
- });
113
- //# sourceMappingURL=ArcEagerTransitionParser.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Arc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Q,CAAC,MAAM,GAAG,CAAC,EAAE;wBAC5B,YAAY,CAAC,IAAI,CAAC,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;qBACvC;yBAAM;wBACH,YAAY,CAAC,IAAI,CAAC,iBAAiB,CAAC,QAAQ,CAAC,KAAK,EAAE,UAAU,EAAE,QAAQ,CAAC,CAAC,CAAA;wBAC1E,KAAK,CAAC,GAAG,EAAE,CAAA;qBACd;iBACJ;qBAAM;oBACH,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE;wBACrB,YAAY,CAAC,IAAI,CAAC,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;qBACvC;yBAAM;wBACH,MAAK;qBACR;iBACJ;aACJ;YACD,OAAO,YAAY,CAAA;QACvB,CAAC;KAEJ;IA1FD,4DA0FC"}
@@ -1,36 +0,0 @@
1
- (function (factory) {
2
- if (typeof module === "object" && typeof module.exports === "object") {
3
- var v = factory(require, exports);
4
- if (v !== undefined) module.exports = v;
5
- }
6
- else if (typeof define === "function" && define.amd) {
7
- define(["require", "exports", "./Oracle", "./Decision", "./SimpleInstanceGenerator"], factory);
8
- }
9
- })(function (require, exports) {
10
- "use strict";
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.ArcStandardOracle = void 0;
13
- const Oracle_1 = require("./Oracle");
14
- const Decision_1 = require("./Decision");
15
- const SimpleInstanceGenerator_1 = require("./SimpleInstanceGenerator");
16
- class ArcStandardOracle extends Oracle_1.Oracle {
17
- constructor(model, windowSize) {
18
- super(model, windowSize);
19
- }
20
- makeDecision(state) {
21
- let instanceGenerator = new SimpleInstanceGenerator_1.SimpleInstanceGenerator();
22
- let instance = instanceGenerator.generate(state, this.windowSize, "");
23
- let best = this.findBestValidStandardClassInfo(this.commandModel.predictProbability(instance), state);
24
- let decisionCandidate = this.getDecisionCandidate(best);
25
- if (decisionCandidate.getCommand() == Command.SHIFT) {
26
- return new Decision_1.Decision(Command.SHIFT, null, 0.0);
27
- }
28
- return new Decision_1.Decision(decisionCandidate.getCommand(), decisionCandidate.getUniversalDependencyType(), 0.0);
29
- }
30
- scoreDecisions(state, transitionSystem) {
31
- return null;
32
- }
33
- }
34
- exports.ArcStandardOracle = ArcStandardOracle;
35
- });
36
- //# sourceMappingURL=ArcStandardOracle.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ArcStandardOracle.js","sourceRoot":"","sources":["../source/Parser/TransitionBasedParser/ArcStandardOracle.ts"],"names":[],"mappings":";;;;;;;;;;;;IAAA,qCAAgC;IAEhC,yCAAoC;IAEpC,uEAAkE;IAElE,MAAa,iBAAkB,SAAQ,eAAM;QAEzC,YAAY,KAAY,EAAE,UAAkB;YACxC,KAAK,CAAC,KAAK,EAAE,UAAU,CAAC,CAAA;QAC5B,CAAC;QAEM,YAAY,CAAC,KAAY;YAC5B,IAAI,iBAAiB,GAAG,IAAI,iDAAuB,EAAE,CAAA;YACrD,IAAI,QAAQ,GAAG,iBAAiB,CAAC,QAAQ,CAAC,KAAK,EAAE,IAAI,CAAC,UAAU,EAAE,EAAE,CAAC,CAAA;YACrE,IAAI,IAAI,GAAG,IAAI,CAAC,8BAA8B,CAAC,IAAI,CAAC,YAAY,CAAC,kBAAkB,CAAC,QAAQ,CAAC,EAAE,KAAK,CAAC,CAAC;YACtG,IAAI,iBAAiB,GAAG,IAAI,CAAC,oBAAoB,CAAC,IAAI,CAAC,CAAA;YACvD,IAAI,iBAAiB,CAAC,UAAU,EAAE,IAAI,OAAO,CAAC,KAAK,EAAE;gBACjD,OAAO,IAAI,mBAAQ,CAAC,OAAO,CAAC,KAAK,EAAE,IAAI,EAAE,GAAG,CAAC,CAAA;aAChD;YACD,OAAO,IAAI,mBAAQ,CAAC,iBAAiB,CAAC,UAAU,EAAE,EAAE,iBAAiB,CAAC,0BAA0B,EAAE,EAAE,GAAG,CAAC,CAAA;QAC5G,CAAC;QAES,cAAc,CAAC,KAAY,EAAE,gBAAkC;YACrE,OAAO,IAAI,CAAA;QACf,CAAC;KAEJ;IArBD,8CAqBC"}
@@ -1,129 +0,0 @@
1
- (function (factory) {
2
- if (typeof module === "object" && typeof module.exports === "object") {
3
- var v = factory(require, exports);
4
- if (v !== undefined) module.exports = v;
5
- }
6
- else if (typeof define === "function" && define.amd) {
7
- define(["require", "exports", "./TransitionParser", "./StackWord", "./SimpleInstanceGenerator", "nlptoolkit-dependencyparser/dist/Universal/UniversalDependencyTreeBankWord", "./State"], factory);
8
- }
9
- })(function (require, exports) {
10
- "use strict";
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.ArcStandardTransitionParser = void 0;
13
- const TransitionParser_1 = require("./TransitionParser");
14
- const StackWord_1 = require("./StackWord");
15
- const SimpleInstanceGenerator_1 = require("./SimpleInstanceGenerator");
16
- const UniversalDependencyTreeBankWord_1 = require("nlptoolkit-dependencyparser/dist/Universal/UniversalDependencyTreeBankWord");
17
- const State_1 = require("./State");
18
- class ArcStandardTransitionParser extends TransitionParser_1.TransitionParser {
19
- constructor() {
20
- super();
21
- }
22
- /**
23
- * Checks if there are more relations with a specified ID in the list of words.
24
- * @param wordList The list of words to check.
25
- * @param id The ID to check for.
26
- * @return True if no more relations with the specified ID are found; false otherwise.
27
- */
28
- checkForMoreRelation(wordList, id) {
29
- for (let word of wordList) {
30
- if (word.getWord().getRelation().to() == id) {
31
- return false;
32
- }
33
- }
34
- return true;
35
- }
36
- /**
37
- * Performs dependency parsing on the given sentence using the provided oracle.
38
- * @param universalDependencyTreeBankSentence The sentence to be parsed.
39
- * @param oracle The oracle used to make parsing decisions.
40
- * @return The parsed sentence with dependency relations established.
41
- */
42
- dependencyParse(universalDependencyTreeBankSentence, oracle) {
43
- let sentence = this.createResultSentence(universalDependencyTreeBankSentence);
44
- let state = this.initialState(sentence);
45
- while (state.wordListSize() > 0 || state.stackSize() > 1) {
46
- let decision = oracle.makeDecision(state);
47
- switch (decision.getCommand()) {
48
- case Command.SHIFT:
49
- state.applyShift();
50
- break;
51
- case Command.LEFTARC:
52
- state.applyLeftArc(decision.getUniversalDependencyType());
53
- break;
54
- case Command.RIGHTARC:
55
- state.applyRightArc(decision.getUniversalDependencyType());
56
- break;
57
- default:
58
- break;
59
- }
60
- }
61
- return sentence;
62
- }
63
- /**
64
- * Simulates the parsing process for a given sentence using the Arc Standard parsing algorithm.
65
- * @param sentence The sentence to be parsed.
66
- * @param windowSize The size of the window used for feature generation.
67
- * @return An ArrayList of {@link Instance} objects representing the parsed actions.
68
- */
69
- simulateParse(sentence, windowSize) {
70
- let instanceGenerator = new SimpleInstanceGenerator_1.SimpleInstanceGenerator();
71
- let instanceList = new Array();
72
- let wordList = new Array();
73
- let stack = new Array();
74
- for (let j = 0; j < sentence.wordCount(); j++) {
75
- let word = sentence.getWord(j);
76
- if (word instanceof UniversalDependencyTreeBankWord_1.UniversalDependencyTreeBankWord) {
77
- wordList.push(new StackWord_1.StackWord(word, j + 1));
78
- }
79
- }
80
- stack.push(new StackWord_1.StackWord());
81
- let state = new State_1.State(stack, wordList, new Array());
82
- if (wordList.length > 0) {
83
- instanceList.push(instanceGenerator.generate(state, windowSize, "SHIFT"));
84
- stack.push(wordList.splice(0, 1)[0]);
85
- if (wordList.length > 1) {
86
- instanceList.push(instanceGenerator.generate(state, windowSize, "SHIFT"));
87
- stack.push(wordList.splice(0, 1)[0]);
88
- }
89
- while (wordList.length > 0 || stack.length > 1) {
90
- let top = stack[stack.length - 1].getWord();
91
- let topRelation = top.getRelation();
92
- if (stack.length > 1) {
93
- let beforeTop = stack[stack.length - 2].getWord();
94
- let beforeTopRelation = beforeTop.getRelation();
95
- if (beforeTop.getId() == topRelation.to() && this.checkForMoreRelation(wordList, top.getId())) {
96
- instanceList.push(instanceGenerator.generate(state, windowSize, "RIGHTARC(" + topRelation + ")"));
97
- stack.pop();
98
- }
99
- else if (top.getId() == beforeTopRelation.to()) {
100
- instanceList.push(instanceGenerator.generate(state, windowSize, "LEFTARC(" + beforeTopRelation + ")"));
101
- stack.splice(stack.length - 2, 1);
102
- }
103
- else {
104
- if (wordList.length > 0) {
105
- instanceList.push(instanceGenerator.generate(state, windowSize, "SHIFT"));
106
- stack.push(wordList.splice(0, 1)[0]);
107
- }
108
- else {
109
- break;
110
- }
111
- }
112
- }
113
- else {
114
- if (wordList.length > 0) {
115
- instanceList.push(instanceGenerator.generate(state, windowSize, "SHIFT"));
116
- stack.push(wordList.splice(0, 1)[0]);
117
- }
118
- else {
119
- break;
120
- }
121
- }
122
- }
123
- }
124
- return instanceList;
125
- }
126
- }
127
- exports.ArcStandardTransitionParser = ArcStandardTransitionParser;
128
- });
129
- //# sourceMappingURL=ArcStandardTransitionParser.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ArcStandardTransitionParser.js","sourceRoot":"","sources":["../source/Parser/TransitionBasedParser/ArcStandardTransitionParser.ts"],"names":[],"mappings":";;;;;;;;;;;;IAAA,yDAAoD;IAMpD,2CAAsC;IACtC,uEAAkE;IAClE,gIAEoF;IACpF,mCAA8B;IAG9B,MAAa,2BAA4B,SAAQ,mCAAgB;QAE7D;YACI,KAAK,EAAE,CAAA;QACX,CAAC;QAED;;;;;WAKG;QACK,oBAAoB,CAAC,QAA0B,EAAE,EAAU;YAC/D,KAAK,IAAI,IAAI,IAAI,QAAQ,EAAE;gBACvB,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC,WAAW,EAAE,CAAC,EAAE,EAAE,IAAI,EAAE,EAAE;oBACzC,OAAO,KAAK,CAAC;iBAChB;aACJ;YACD,OAAO,IAAI,CAAA;QACf,CAAC;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,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;yBACvC;6BAAM;4BACH,MAAK;yBACR;qBACJ;iBACJ;aACJ;YACD,OAAO,YAAY,CAAA;QACvB,CAAC;KAEJ;IA5GD,kEA4GC"}
package/dist/Candidate.js DELETED
@@ -1,27 +0,0 @@
1
- (function (factory) {
2
- if (typeof module === "object" && typeof module.exports === "object") {
3
- var v = factory(require, exports);
4
- if (v !== undefined) module.exports = v;
5
- }
6
- else if (typeof define === "function" && define.amd) {
7
- define(["require", "exports"], factory);
8
- }
9
- })(function (require, exports) {
10
- "use strict";
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
- }
24
- }
25
- exports.Candidate = Candidate;
26
- });
27
- //# sourceMappingURL=Candidate.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Candidate.js","sourceRoot":"","sources":["../source/Parser/TransitionBasedParser/Candidate.ts"],"names":[],"mappings":";;;;;;;;;;;;IAEA,MAAa,SAAS;QAIlB,YAAY,OAAgB,EAAE,uBAAgD;YAC1E,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;YACtB,IAAI,CAAC,uBAAuB,GAAG,uBAAuB,CAAA;QAC1D,CAAC;QAED,UAAU;YACN,OAAO,IAAI,CAAC,OAAO,CAAA;QACvB,CAAC;QAED,0BAA0B;YACtB,OAAO,IAAI,CAAC,uBAAuB,CAAA;QACvC,CAAC;KAEJ;IAjBD,8BAiBC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"Command.js","sourceRoot":"","sources":["../source/Parser/TransitionBasedParser/Command.ts"],"names":[],"mappings":"AAAA,IAAK,OAEJ;AAFD,WAAK,OAAO;IACR,6CAAQ,CAAA;IAAE,2CAAO,CAAA;IAAE,uCAAK,CAAA;IAAE,yCAAM,CAAA;AACpC,CAAC,EAFI,OAAO,KAAP,OAAO,QAEX"}
package/dist/Decision.js DELETED
@@ -1,25 +0,0 @@
1
- (function (factory) {
2
- if (typeof module === "object" && typeof module.exports === "object") {
3
- var v = factory(require, exports);
4
- if (v !== undefined) module.exports = v;
5
- }
6
- else if (typeof define === "function" && define.amd) {
7
- define(["require", "exports", "./Candidate"], factory);
8
- }
9
- })(function (require, exports) {
10
- "use strict";
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
- });
25
- //# sourceMappingURL=Decision.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Decision.js","sourceRoot":"","sources":["../source/Parser/TransitionBasedParser/Decision.ts"],"names":[],"mappings":";;;;;;;;;;;;IACA,2CAAsC;IAEtC,MAAa,QAAS,SAAQ,qBAAS;QAInC,YAAY,OAAgB,EAAE,uBAAgD,EAAE,KAAa;YACzF,KAAK,CAAC,OAAO,EAAE,uBAAuB,CAAC,CAAC;YACxC,IAAI,CAAC,KAAK,GAAG,KAAK,CAAA;QACtB,CAAC;QAED,QAAQ;YACJ,OAAO,IAAI,CAAC,KAAK,CAAA;QACrB,CAAC;KACJ;IAZD,4BAYC"}
@@ -1,77 +0,0 @@
1
- (function (factory) {
2
- if (typeof module === "object" && typeof module.exports === "object") {
3
- var v = factory(require, exports);
4
- if (v !== undefined) module.exports = v;
5
- }
6
- else if (typeof define === "function" && define.amd) {
7
- define(["require", "exports", "nlptoolkit-dependencyparser/dist/Universal/UniversalDependencyTreeBankFeatures", "nlptoolkit-classification/dist/Attribute/DiscreteIndexedAttribute"], factory);
8
- }
9
- })(function (require, exports) {
10
- "use strict";
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.InstanceGenerator = void 0;
13
- const UniversalDependencyTreeBankFeatures_1 = require("nlptoolkit-dependencyparser/dist/Universal/UniversalDependencyTreeBankFeatures");
14
- const DiscreteIndexedAttribute_1 = require("nlptoolkit-classification/dist/Attribute/DiscreteIndexedAttribute");
15
- class InstanceGenerator {
16
- /**
17
- * Adds an attribute for a specific feature type of a given word to the list of attributes.
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));
52
- }
53
- /**
54
- * Adds attributes for various feature types of a given word to the list of attributes.
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");
73
- }
74
- }
75
- exports.InstanceGenerator = InstanceGenerator;
76
- });
77
- //# sourceMappingURL=InstanceGenerator.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"InstanceGenerator.js","sourceRoot":"","sources":["../source/Parser/TransitionBasedParser/InstanceGenerator.ts"],"names":[],"mappings":";;;;;;;;;;;;IAKA,wIAEwF;IACxF,gHAA2G;IAG3G,MAAsB,iBAAiB;QAWnC;;;;;WAKG;QACK,0BAA0B,CAAC,IAAqC,EACrC,UAA4B,EAC5B,WAAmB;YAClD,IAAI,OAAO,GAAG,IAAI,CAAC,eAAe,CAAC,WAAW,CAAC,CAAA;YAC/C,IAAI,cAAc,GAAG,yEAAmC,CAAC,cAAc,CAAC,IAAI,EAAE,WAAW,CAAC,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CAAC,CAAA;QAC/D,CAAC;KACJ;IAzED,8CAyEC"}
package/dist/Oracle.js DELETED
@@ -1,115 +0,0 @@
1
- (function (factory) {
2
- if (typeof module === "object" && typeof module.exports === "object") {
3
- var v = factory(require, exports);
4
- if (v !== undefined) module.exports = v;
5
- }
6
- else if (typeof define === "function" && define.amd) {
7
- define(["require", "exports", "./Candidate", "nlptoolkit-dependencyparser/dist/Universal/UniversalDependencyRelation", "nlptoolkit-dependencyparser/dist/Universal/UniversalDependencyType"], factory);
8
- }
9
- })(function (require, exports) {
10
- "use strict";
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.Oracle = void 0;
13
- const Candidate_1 = require("./Candidate");
14
- const UniversalDependencyRelation_1 = require("nlptoolkit-dependencyparser/dist/Universal/UniversalDependencyRelation");
15
- const UniversalDependencyType_1 = require("nlptoolkit-dependencyparser/dist/Universal/UniversalDependencyType");
16
- class Oracle {
17
- /**
18
- * Constructs an Oracle with the given model and window size.
19
- * @param model the model used for making predictions
20
- * @param windowSize the size of the window used in parsing
21
- */
22
- constructor(model, windowSize) {
23
- this.commandModel = model;
24
- this.windowSize = windowSize;
25
- }
26
- /**
27
- * Finds the best valid parsing action for the ARC_EAGER transition system based on probabilities.
28
- * Ensures the action is applicable given the current state.
29
- * @param probabilities a map of actions to their associated probabilities
30
- * @param state the current parsing state
31
- * @return the best action as a string, or an empty string if no valid action is found
32
- */
33
- findBestValidEagerClassInfo(probabilities, state) {
34
- let bestValue = 0.0;
35
- let best = "";
36
- for (let key in probabilities) {
37
- if (probabilities.get(key) > bestValue) {
38
- if (key == "SHIFT" || key == "RIGHTARC") {
39
- if (state.wordListSize() > 0) {
40
- best = key;
41
- bestValue = probabilities.get(key);
42
- }
43
- }
44
- else {
45
- if (state.stackSize() > 1) {
46
- if (!(key == "REDUCE" && state.getPeek().getRelation() == null)) {
47
- best = key;
48
- bestValue = probabilities.get(key);
49
- }
50
- }
51
- }
52
- }
53
- }
54
- return best;
55
- }
56
- /**
57
- * Finds the best valid parsing action for the ARC_STANDARD transition system based on probabilities.
58
- * Ensures the action is applicable given the current state.
59
- * @param probabilities a map of actions to their associated probabilities
60
- * @param state the current parsing state
61
- * @return the best action as a string, or an empty string if no valid action is found
62
- */
63
- findBestValidStandardClassInfo(probabilities, state) {
64
- let bestValue = 0.0;
65
- let best = "";
66
- for (let key in probabilities) {
67
- if (probabilities.get(key) > bestValue) {
68
- if (key == "SHIFT") {
69
- if (state.wordListSize() > 0) {
70
- best = key;
71
- bestValue = probabilities.get(key);
72
- }
73
- }
74
- else {
75
- if (state.stackSize() > 1) {
76
- best = key;
77
- bestValue = probabilities.get(key);
78
- }
79
- }
80
- }
81
- }
82
- return best;
83
- }
84
- /**
85
- * Converts a string representation of the best action into a {@link Candidate} object.
86
- * @param best the best action represented as a string, possibly with a dependency type in parentheses
87
- * @return a {@link Candidate} object representing the action, or null if the action is unknown
88
- */
89
- getDecisionCandidate(best) {
90
- let command, type;
91
- if (best.includes("(")) {
92
- command = best.substring(0, best.indexOf('('));
93
- let relation = best.substring(best.indexOf('(') + 1, best.indexOf(')'));
94
- type = UniversalDependencyRelation_1.UniversalDependencyRelation.getDependencyTag(relation);
95
- }
96
- else {
97
- command = best;
98
- type = UniversalDependencyType_1.UniversalDependencyType.DEP;
99
- }
100
- switch (command) {
101
- case "SHIFT":
102
- return new Candidate_1.Candidate(Command.SHIFT, type);
103
- case "REDUCE":
104
- return new Candidate_1.Candidate(Command.REDUCE, type);
105
- case "LEFTARC":
106
- return new Candidate_1.Candidate(Command.LEFTARC, type);
107
- case "RIGHTARC":
108
- return new Candidate_1.Candidate(Command.RIGHTARC, type);
109
- }
110
- return null;
111
- }
112
- }
113
- exports.Oracle = Oracle;
114
- });
115
- //# sourceMappingURL=Oracle.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Oracle.js","sourceRoot":"","sources":["../source/Parser/TransitionBasedParser/Oracle.ts"],"names":[],"mappings":";;;;;;;;;;;;IAGA,2CAAsC;IACtC,w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