@aws-amplify/predictions 5.5.24 → 5.5.25
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/lib/.tsbuildinfo +1 -3
- package/lib/Predictions.js +4 -3
- package/lib/Predictions.js.map +1 -1
- package/lib/Providers/AmazonAIConvertPredictionsProvider.js +32 -30
- package/lib/Providers/AmazonAIConvertPredictionsProvider.js.map +1 -1
- package/lib/Providers/AmazonAIIdentifyPredictionsProvider.js +52 -50
- package/lib/Providers/AmazonAIIdentifyPredictionsProvider.js.map +1 -1
- package/lib/Providers/AmazonAIInterpretPredictionsProvider.js +44 -43
- package/lib/Providers/AmazonAIInterpretPredictionsProvider.js.map +1 -1
- package/lib/Providers/AmazonAIPredictionsProvider.js +1 -0
- package/lib/Providers/AmazonAIPredictionsProvider.js.map +1 -1
- package/lib/Providers/IdentifyTextUtils.js +8 -8
- package/lib/Providers/IdentifyTextUtils.js.map +1 -1
- package/lib/Providers/Utils.js +3 -3
- package/lib/Providers/Utils.js.map +1 -1
- package/lib/Providers/index.js +5 -4
- package/lib/Providers/index.js.map +1 -1
- package/lib/index.js +6 -5
- package/lib/index.js.map +1 -1
- package/lib/types/AWSTypes.d.ts +6 -7
- package/lib/types/Predictions.d.ts +4 -5
- package/lib/types/Predictions.js +14 -13
- package/lib/types/Predictions.js.map +1 -1
- package/lib/types/Providers/AbstractConvertPredictionsProvider.js +4 -3
- package/lib/types/Providers/AbstractConvertPredictionsProvider.js.map +1 -1
- package/lib/types/Providers/AbstractIdentifyPredictionsProvider.js +4 -3
- package/lib/types/Providers/AbstractIdentifyPredictionsProvider.js.map +1 -1
- package/lib/types/Providers/AbstractInterpretPredictionsProvider.js +2 -1
- package/lib/types/Providers/AbstractInterpretPredictionsProvider.js.map +1 -1
- package/lib/types/Providers/AbstractPredictionsProvider.js +1 -0
- package/lib/types/Providers/AbstractPredictionsProvider.js.map +1 -1
- package/lib-esm/.tsbuildinfo +1 -3
- package/lib-esm/Predictions.js +4 -4
- package/lib-esm/Predictions.js.map +1 -1
- package/lib-esm/Providers/AmazonAIConvertPredictionsProvider.js +27 -26
- package/lib-esm/Providers/AmazonAIConvertPredictionsProvider.js.map +1 -1
- package/lib-esm/Providers/AmazonAIIdentifyPredictionsProvider.js +29 -28
- package/lib-esm/Providers/AmazonAIIdentifyPredictionsProvider.js.map +1 -1
- package/lib-esm/Providers/AmazonAIInterpretPredictionsProvider.js +42 -42
- package/lib-esm/Providers/AmazonAIInterpretPredictionsProvider.js.map +1 -1
- package/lib-esm/Providers/AmazonAIPredictionsProvider.js.map +1 -1
- package/lib-esm/Providers/IdentifyTextUtils.js +1 -1
- package/lib-esm/Providers/IdentifyTextUtils.js.map +1 -1
- package/lib-esm/Providers/Utils.js.map +1 -1
- package/lib-esm/types/AWSTypes.d.ts +6 -7
- package/lib-esm/types/AWSTypes.js +1 -0
- package/lib-esm/types/Predictions.d.ts +4 -5
- package/lib-esm/types/Providers/AbstractConvertPredictionsProvider.js.map +1 -1
- package/lib-esm/types/Providers/AbstractIdentifyPredictionsProvider.js.map +1 -1
- package/lib-esm/types/Providers/AbstractInterpretPredictionsProvider.js.map +1 -1
- package/package.json +36 -28
- package/src/Providers/AmazonAIIdentifyPredictionsProvider.ts +5 -3
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AmazonAIInterpretPredictionsProvider = void 0;
|
|
3
4
|
var tslib_1 = require("tslib");
|
|
4
5
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
5
6
|
// SPDX-License-Identifier: Apache-2.0
|
|
@@ -18,21 +19,21 @@ var AmazonAIInterpretPredictionsProvider = /** @class */ (function (_super) {
|
|
|
18
19
|
AmazonAIInterpretPredictionsProvider.prototype.interpretText = function (input) {
|
|
19
20
|
var _this = this;
|
|
20
21
|
return new Promise(function (res, rej) { return tslib_1.__awaiter(_this, void 0, void 0, function () {
|
|
21
|
-
var credentials, _a, _b, _c, region, _d, _e,
|
|
22
|
-
return tslib_1.__generator(this, function (
|
|
23
|
-
switch (
|
|
22
|
+
var credentials, _a, _b, _c, region, _d, _e, _f, interpretTypeConfig, _g, _h, _j, _k, _l, text, _m, interpretType, _o, _p, _q, _r, _s, language, doAll, languagePromise, languageDetectionParams, entitiesPromise, LanguageCode, _t, entitiesDetectionParams, sentimentPromise, LanguageCode, _u, sentimentParams, syntaxPromise, LanguageCode, _v, syntaxParams, keyPhrasesPromise, LanguageCode, _w, keyPhrasesParams, results, err_1;
|
|
23
|
+
return tslib_1.__generator(this, function (_x) {
|
|
24
|
+
switch (_x.label) {
|
|
24
25
|
case 0: return [4 /*yield*/, core_1.Credentials.get()];
|
|
25
26
|
case 1:
|
|
26
|
-
credentials =
|
|
27
|
+
credentials = _x.sent();
|
|
27
28
|
if (!credentials)
|
|
28
29
|
return [2 /*return*/, rej('No credentials')];
|
|
29
|
-
_a = this._config.interpretText, _b = _a === void 0 ? {} : _a, _c = _b.region, region = _c === void 0 ? '' : _c, _d = _b.defaults, _e =
|
|
30
|
-
|
|
31
|
-
|
|
30
|
+
_a = this._config.interpretText, _b = _a === void 0 ? {} : _a, _c = _b.region, region = _c === void 0 ? '' : _c, _d = _b.defaults, _e = _d === void 0 ? {} : _d, _f = _e.type, interpretTypeConfig = _f === void 0 ? '' : _f;
|
|
31
|
+
_g = (input).text, _h = _g === void 0 ? {} : _g, _j = _h.source, _k = _j === void 0 ? {} : _j, _l = _k.text, text = _l === void 0 ? '' : _l, _m = _h.type, interpretType = _m === void 0 ? interpretTypeConfig : _m;
|
|
32
|
+
_o = (input).text, _p = _o === void 0 ? {} : _o, _q = _p.source, _r = _q === void 0 ? {} : _q, _s = _r.language, language = _s === void 0 ? undefined : _s;
|
|
32
33
|
this.comprehendClient = new client_comprehend_1.ComprehendClient({
|
|
33
34
|
credentials: credentials,
|
|
34
35
|
region: region,
|
|
35
|
-
customUserAgent: core_1.getAmplifyUserAgentObject({
|
|
36
|
+
customUserAgent: (0, core_1.getAmplifyUserAgentObject)({
|
|
36
37
|
category: core_1.Category.Predictions,
|
|
37
38
|
action: core_1.PredictionsAction.Interpret,
|
|
38
39
|
}),
|
|
@@ -45,14 +46,14 @@ var AmazonAIInterpretPredictionsProvider = /** @class */ (function (_super) {
|
|
|
45
46
|
languagePromise = this.detectLanguage(languageDetectionParams);
|
|
46
47
|
}
|
|
47
48
|
if (!(doAll || interpretType === types_1.InterpretTextCategories.ENTITIES)) return [3 /*break*/, 4];
|
|
48
|
-
|
|
49
|
-
if (
|
|
49
|
+
_t = language;
|
|
50
|
+
if (_t) return [3 /*break*/, 3];
|
|
50
51
|
return [4 /*yield*/, languagePromise];
|
|
51
52
|
case 2:
|
|
52
|
-
|
|
53
|
-
|
|
53
|
+
_t = (_x.sent());
|
|
54
|
+
_x.label = 3;
|
|
54
55
|
case 3:
|
|
55
|
-
LanguageCode =
|
|
56
|
+
LanguageCode = _t;
|
|
56
57
|
if (!LanguageCode) {
|
|
57
58
|
return [2 /*return*/, rej('language code is required on source for this selection')];
|
|
58
59
|
}
|
|
@@ -61,17 +62,17 @@ var AmazonAIInterpretPredictionsProvider = /** @class */ (function (_super) {
|
|
|
61
62
|
LanguageCode: LanguageCode,
|
|
62
63
|
};
|
|
63
64
|
entitiesPromise = this.detectEntities(entitiesDetectionParams);
|
|
64
|
-
|
|
65
|
+
_x.label = 4;
|
|
65
66
|
case 4:
|
|
66
67
|
if (!(doAll || interpretType === types_1.InterpretTextCategories.SENTIMENT)) return [3 /*break*/, 7];
|
|
67
|
-
|
|
68
|
-
if (
|
|
68
|
+
_u = language;
|
|
69
|
+
if (_u) return [3 /*break*/, 6];
|
|
69
70
|
return [4 /*yield*/, languagePromise];
|
|
70
71
|
case 5:
|
|
71
|
-
|
|
72
|
-
|
|
72
|
+
_u = (_x.sent());
|
|
73
|
+
_x.label = 6;
|
|
73
74
|
case 6:
|
|
74
|
-
LanguageCode =
|
|
75
|
+
LanguageCode = _u;
|
|
75
76
|
if (!LanguageCode) {
|
|
76
77
|
return [2 /*return*/, rej('language code is required on source for this selection')];
|
|
77
78
|
}
|
|
@@ -80,17 +81,17 @@ var AmazonAIInterpretPredictionsProvider = /** @class */ (function (_super) {
|
|
|
80
81
|
LanguageCode: LanguageCode,
|
|
81
82
|
};
|
|
82
83
|
sentimentPromise = this.detectSentiment(sentimentParams);
|
|
83
|
-
|
|
84
|
+
_x.label = 7;
|
|
84
85
|
case 7:
|
|
85
86
|
if (!(doAll || interpretType === types_1.InterpretTextCategories.SYNTAX)) return [3 /*break*/, 10];
|
|
86
|
-
|
|
87
|
-
if (
|
|
87
|
+
_v = language;
|
|
88
|
+
if (_v) return [3 /*break*/, 9];
|
|
88
89
|
return [4 /*yield*/, languagePromise];
|
|
89
90
|
case 8:
|
|
90
|
-
|
|
91
|
-
|
|
91
|
+
_v = (_x.sent());
|
|
92
|
+
_x.label = 9;
|
|
92
93
|
case 9:
|
|
93
|
-
LanguageCode =
|
|
94
|
+
LanguageCode = _v;
|
|
94
95
|
if (!LanguageCode) {
|
|
95
96
|
return [2 /*return*/, rej('language code is required on source for this selection')];
|
|
96
97
|
}
|
|
@@ -99,17 +100,17 @@ var AmazonAIInterpretPredictionsProvider = /** @class */ (function (_super) {
|
|
|
99
100
|
LanguageCode: LanguageCode,
|
|
100
101
|
};
|
|
101
102
|
syntaxPromise = this.detectSyntax(syntaxParams);
|
|
102
|
-
|
|
103
|
+
_x.label = 10;
|
|
103
104
|
case 10:
|
|
104
105
|
if (!(doAll || interpretType === types_1.InterpretTextCategories.KEY_PHRASES)) return [3 /*break*/, 13];
|
|
105
|
-
|
|
106
|
-
if (
|
|
106
|
+
_w = language;
|
|
107
|
+
if (_w) return [3 /*break*/, 12];
|
|
107
108
|
return [4 /*yield*/, languagePromise];
|
|
108
109
|
case 11:
|
|
109
|
-
|
|
110
|
-
|
|
110
|
+
_w = (_x.sent());
|
|
111
|
+
_x.label = 12;
|
|
111
112
|
case 12:
|
|
112
|
-
LanguageCode =
|
|
113
|
+
LanguageCode = _w;
|
|
113
114
|
if (!LanguageCode) {
|
|
114
115
|
return [2 /*return*/, rej('language code is required on source for this selection')];
|
|
115
116
|
}
|
|
@@ -118,9 +119,9 @@ var AmazonAIInterpretPredictionsProvider = /** @class */ (function (_super) {
|
|
|
118
119
|
LanguageCode: LanguageCode,
|
|
119
120
|
};
|
|
120
121
|
keyPhrasesPromise = this.detectKeyPhrases(keyPhrasesParams);
|
|
121
|
-
|
|
122
|
+
_x.label = 13;
|
|
122
123
|
case 13:
|
|
123
|
-
|
|
124
|
+
_x.trys.push([13, 15, , 16]);
|
|
124
125
|
return [4 /*yield*/, Promise.all([
|
|
125
126
|
languagePromise,
|
|
126
127
|
entitiesPromise,
|
|
@@ -129,7 +130,7 @@ var AmazonAIInterpretPredictionsProvider = /** @class */ (function (_super) {
|
|
|
129
130
|
keyPhrasesPromise,
|
|
130
131
|
])];
|
|
131
132
|
case 14:
|
|
132
|
-
results =
|
|
133
|
+
results = _x.sent();
|
|
133
134
|
res({
|
|
134
135
|
textInterpretation: {
|
|
135
136
|
keyPhrases: results[4] || [],
|
|
@@ -141,7 +142,7 @@ var AmazonAIInterpretPredictionsProvider = /** @class */ (function (_super) {
|
|
|
141
142
|
});
|
|
142
143
|
return [3 /*break*/, 16];
|
|
143
144
|
case 15:
|
|
144
|
-
err_1 =
|
|
145
|
+
err_1 = _x.sent();
|
|
145
146
|
rej(err_1);
|
|
146
147
|
return [3 /*break*/, 16];
|
|
147
148
|
case 16: return [2 /*return*/];
|
|
@@ -212,7 +213,7 @@ var AmazonAIInterpretPredictionsProvider = /** @class */ (function (_super) {
|
|
|
212
213
|
var response = [];
|
|
213
214
|
if (tokens && Array.isArray(tokens)) {
|
|
214
215
|
response = tokens.map(function (_a) {
|
|
215
|
-
var _b = _a.Text, text = _b === void 0 ? '' : _b, _c = _a.PartOfSpeech, _d =
|
|
216
|
+
var _b = _a.Text, text = _b === void 0 ? '' : _b, _c = _a.PartOfSpeech, _d = _c === void 0 ? {} : _c, _e = _d.Tag, syntax = _e === void 0 ? '' : _e;
|
|
216
217
|
return { text: text, syntax: syntax };
|
|
217
218
|
});
|
|
218
219
|
}
|
|
@@ -286,22 +287,22 @@ var AmazonAIInterpretPredictionsProvider = /** @class */ (function (_super) {
|
|
|
286
287
|
};
|
|
287
288
|
AmazonAIInterpretPredictionsProvider.prototype.detectLanguage = function (params) {
|
|
288
289
|
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
289
|
-
var detectDominantLanguageCommand, data, _a, _b, LanguageCode, err_6;
|
|
290
|
-
return tslib_1.__generator(this, function (
|
|
291
|
-
switch (
|
|
290
|
+
var detectDominantLanguageCommand, data, _a, _b, _c, LanguageCode, err_6;
|
|
291
|
+
return tslib_1.__generator(this, function (_d) {
|
|
292
|
+
switch (_d.label) {
|
|
292
293
|
case 0:
|
|
293
|
-
|
|
294
|
+
_d.trys.push([0, 2, , 3]);
|
|
294
295
|
detectDominantLanguageCommand = new client_comprehend_1.DetectDominantLanguageCommand(params);
|
|
295
296
|
return [4 /*yield*/, this.comprehendClient.send(detectDominantLanguageCommand)];
|
|
296
297
|
case 1:
|
|
297
|
-
data =
|
|
298
|
-
_a = (data || {}).Languages, _b =
|
|
298
|
+
data = _d.sent();
|
|
299
|
+
_a = (data || {}).Languages, _b = _a === void 0 ? [{}] : _a, _c = tslib_1.__read(_b, 1), LanguageCode = _c[0].LanguageCode;
|
|
299
300
|
if (!LanguageCode) {
|
|
300
301
|
Promise.reject('Language not detected');
|
|
301
302
|
}
|
|
302
303
|
return [2 /*return*/, data.Languages[0].LanguageCode];
|
|
303
304
|
case 2:
|
|
304
|
-
err_6 =
|
|
305
|
+
err_6 = _d.sent();
|
|
305
306
|
if (err_6.code === 'AccessDeniedException') {
|
|
306
307
|
Promise.reject('Not authorized, did you enable Interpret Text on predictions category Amplify CLI? try: ' +
|
|
307
308
|
'amplify predictions add');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AmazonAIInterpretPredictionsProvider.js","sourceRoot":"","sources":["../../src/Providers/AmazonAIInterpretPredictionsProvider.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AmazonAIInterpretPredictionsProvider.js","sourceRoot":"","sources":["../../src/Providers/AmazonAIInterpretPredictionsProvider.ts"],"names":[],"mappings":";;;;AAAA,qEAAqE;AACrE,sCAAsC;AACtC,0CAK2B;AAC3B,gDAA0E;AAE1E,kCAQkB;AAClB,gEAOoC;AAEpC;IAA0D,gEAAoC;IAG7F;QACC,OAAA,MAAK,WAAE,SAAC;IACT,CAAC;IAED,8DAAe,GAAf;QACC,OAAO,sCAAsC,CAAC;IAC/C,CAAC;IAED,4DAAa,GAAb,UAAc,KAAyB;QAAvC,iBA+GC;QA9GA,OAAO,IAAI,OAAO,CAAC,UAAO,GAAG,EAAE,GAAG;;;;4BACb,qBAAM,kBAAW,CAAC,GAAG,EAAE,EAAA;;wBAArC,WAAW,GAAG,SAAuB;wBAC3C,IAAI,CAAC,WAAW;4BAAE,sBAAO,GAAG,CAAC,gBAAgB,CAAC,EAAC;wBAE9C,KAIG,IAAI,CAAC,OAAO,cADT,EAHN,qBAGI,EAAE,KAAA,EAFL,cAAW,EAAX,MAAM,mBAAG,EAAE,KAAA,EACX,gBAAiD,EAAjD,qBAA+C,EAAE,KAAA,EAArC,YAA8B,EAAxB,mBAAmB,mBAAG,EAAE,KAAA,CAE3B;wBAEhB,KAIG,CAAM,KAAK,CAAC,KADT,EAHN,qBAGI,EAAE,KAAA,EAFL,cAA0B,EAA1B,qBAAwB,EAAE,KAAA,EAAhB,YAAS,EAAT,IAAI,mBAAG,EAAE,KAAA,EACnB,YAAyC,EAAnC,aAAa,mBAAG,mBAAmB,KAAA,CAE1B;wBAET,KAAyD,CAChE,KAAY,CAAC,KAD8C,EAApD,qBAAkD,EAAE,KAAA,EAA5C,cAAqC,EAArC,qBAAmC,EAAE,KAAA,EAA3B,gBAAoB,EAApB,QA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object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AmazonAIPredictionsProvider = void 0;
|
|
3
4
|
var tslib_1 = require("tslib");
|
|
4
5
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
5
6
|
// SPDX-License-Identifier: Apache-2.0
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AmazonAIPredictionsProvider.js","sourceRoot":"","sources":["../../src/Providers/AmazonAIPredictionsProvider.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AmazonAIPredictionsProvider.js","sourceRoot":"","sources":["../../src/Providers/AmazonAIPredictionsProvider.ts"],"names":[],"mappings":";;;;AAAA,qEAAqE;AACrE,sCAAsC;AACtC,gDAAiE;AACjE,2FAA0F;AAC1F,+FAA8F;AAC9F,6FAA4F;AAmB5F;IAAiD,uDAA2B;IAK3E;QACC,YAAA,MAAK,WAAE,SAAC;QACR,KAAI,CAAC,eAAe,GAAG,IAAI,uEAAkC,EAAE,CAAC;QAChE,KAAI,CAAC,gBAAgB,GAAG,IAAI,yEAAmC,EAAE,CAAC;QAClE,KAAI,CAAC,iBAAiB,GAAG,IAAI,2EAAoC,EAAE,CAAC;;IACrE,CAAC;IAED,iDAAW,GAAX;QACC,OAAO,aAAa,CAAC;IACtB,CAAC;IAED,qDAAe,GAAf;QACC,OAAO,6BAA6B,CAAC;IACtC,CAAC;IAED,+CAAS,GAAT,UAAU,MAA0B;QACnC,IAAI,CAAC,eAAe,CAAC,SAAS,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;QAC/C,IAAI,CAAC,gBAAgB,CAAC,SAAS,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;QACjD,IAAI,CAAC,iBAAiB,CAAC,SAAS,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;QACnD,OAAO,MAAM,CAAC;IACf,CAAC;IAED,+CAAS,GAAT,UAAU,KAAyB;QAClC,OAAO,IAAI,CAAC,iBAAiB,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;IAChD,CAAC;IAED,6CAAO,GAAP,UACC,KAAiE;QAEjE,OAAO,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IAC5C,CAAC;IAED,8CAAQ,GAAR,UACC,KAAsE;QAItE,OAAO,IAAI,CAAC,gBAAgB,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IAC9C,CAAC;IACF,kCAAC;AAAD,CAAC,AA5CD,CAAiD,uCAA2B,GA4C3E;AA5CY,kEAA2B"}
|
|
@@ -1,16 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.categorizeRekognitionBlocks = categorizeRekognitionBlocks;
|
|
4
|
+
exports.categorizeTextractBlocks = categorizeTextractBlocks;
|
|
5
|
+
exports.constructTable = constructTable;
|
|
6
|
+
exports.constructKeyValue = constructKeyValue;
|
|
7
|
+
exports.extractContentsFromBlock = extractContentsFromBlock;
|
|
3
8
|
var tslib_1 = require("tslib");
|
|
4
9
|
var Utils_1 = require("./Utils");
|
|
5
10
|
function getBoundingBox(geometry) {
|
|
6
11
|
if (!geometry)
|
|
7
12
|
return undefined;
|
|
8
|
-
return Utils_1.makeCamelCase(geometry.BoundingBox);
|
|
13
|
+
return (0, Utils_1.makeCamelCase)(geometry.BoundingBox);
|
|
9
14
|
}
|
|
10
15
|
function getPolygon(geometry) {
|
|
11
16
|
if (!geometry)
|
|
12
17
|
return undefined;
|
|
13
|
-
return Utils_1.makeCamelCaseArray(Array.from(geometry.Polygon));
|
|
18
|
+
return (0, Utils_1.makeCamelCaseArray)(Array.from(geometry.Polygon));
|
|
14
19
|
}
|
|
15
20
|
/**
|
|
16
21
|
* Organizes blocks from Rekognition API to each of the categories and and structures
|
|
@@ -37,7 +42,7 @@ function categorizeRekognitionBlocks(blocks) {
|
|
|
37
42
|
text: block.DetectedText,
|
|
38
43
|
polygon: getPolygon(block.Geometry),
|
|
39
44
|
boundingBox: getBoundingBox(block.Geometry),
|
|
40
|
-
page: null,
|
|
45
|
+
page: null, // rekognition doesn't have this info
|
|
41
46
|
});
|
|
42
47
|
break;
|
|
43
48
|
case 'WORD':
|
|
@@ -54,7 +59,6 @@ function categorizeRekognitionBlocks(blocks) {
|
|
|
54
59
|
response.text.fullText = response.text.fullText.substr(0, response.text.fullText.length - 1);
|
|
55
60
|
return response;
|
|
56
61
|
}
|
|
57
|
-
exports.categorizeRekognitionBlocks = categorizeRekognitionBlocks;
|
|
58
62
|
/**
|
|
59
63
|
* Organizes blocks from Textract API to each of the categories and and structures
|
|
60
64
|
* their data accordingly.
|
|
@@ -152,7 +156,6 @@ function categorizeTextractBlocks(blocks) {
|
|
|
152
156
|
}
|
|
153
157
|
return response;
|
|
154
158
|
}
|
|
155
|
-
exports.categorizeTextractBlocks = categorizeTextractBlocks;
|
|
156
159
|
/**
|
|
157
160
|
* Constructs a table object using data from its children cells.
|
|
158
161
|
* @param {Block} table - Table block that has references (`Relationships`) to its cells
|
|
@@ -213,7 +216,6 @@ function constructTable(table, blockMap) {
|
|
|
213
216
|
polygon: getPolygon(table.Geometry),
|
|
214
217
|
};
|
|
215
218
|
}
|
|
216
|
-
exports.constructTable = constructTable;
|
|
217
219
|
/**
|
|
218
220
|
* Constructs a key value object from its children key and value blocks.
|
|
219
221
|
* @param {Block} KeyValue - KeyValue block that has references (`Relationships`) to its children.
|
|
@@ -268,7 +270,6 @@ function constructKeyValue(keyBlock, blockMap) {
|
|
|
268
270
|
boundingBox: getBoundingBox(keyBlock.Geometry),
|
|
269
271
|
};
|
|
270
272
|
}
|
|
271
|
-
exports.constructKeyValue = constructKeyValue;
|
|
272
273
|
/**
|
|
273
274
|
* Extracts text and selection from input block's children.
|
|
274
275
|
* @param {Block}} block - Block that we want to extract contents from.
|
|
@@ -316,5 +317,4 @@ function extractContentsFromBlock(block, blockMap) {
|
|
|
316
317
|
words = words.substr(0, words.length - 1); // remove trailing space.
|
|
317
318
|
return { text: words, selected: isSelected };
|
|
318
319
|
}
|
|
319
|
-
exports.extractContentsFromBlock = extractContentsFromBlock;
|
|
320
320
|
//# sourceMappingURL=IdentifyTextUtils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IdentifyTextUtils.js","sourceRoot":"","sources":["../../src/Providers/IdentifyTextUtils.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"IdentifyTextUtils.js","sourceRoot":"","sources":["../../src/Providers/IdentifyTextUtils.ts"],"names":[],"mappings":";;AA+BA,kEAwCC;AAQD,4DAgGC;AAOD,wCAmCC;AAOD,8CA4BC;AAOD,4DAwBC;;AA9QD,iCAA4D;AAE5D,SAAS,cAAc,CAAC,QAAkB;IACzC,IAAI,CAAC,QAAQ;QAAE,OAAO,SAAS,CAAC;IAChC,OAAO,IAAA,qBAAa,EAAC,QAAQ,CAAC,WAAW,CAAC,CAAC;AAC5C,CAAC;AAED,SAAS,UAAU,CAAC,QAAkB;IACrC,IAAI,CAAC,QAAQ;QAAE,OAAO,SAAS,CAAC;IAChC,OAAO,IAAA,0BAAkB,EAAC,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC;AACzD,CAAC;AAED;;;;;GAKG;AACH,SAAgB,2BAA2B,CAC1C,MAAyB;IAEzB,wFAAwF;IACxF,IAAM,QAAQ,GAAuB;QACpC,IAAI,EAAE;YACL,QAAQ,EAAE,EAAE;YACZ,KAAK,EAAE,EAAE;YACT,KAAK,EAAE,EAAE;YACT,aAAa,EAAE,EAAE;SACjB;KACD,CAAC;IACF,mEAAmE;IACnE,MAAM,CAAC,OAAO,CAAC,UAAA,KAAK;QACnB,QAAQ,KAAK,CAAC,IAAI,EAAE,CAAC;YACpB,KAAK,MAAM;gBACV,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;gBAC7C,QAAQ,CAAC,IAAI,CAAC,aA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AAC,SAAS,KAAK,MAAM,EAAE,CAAC;wBACvC,KAAK,IAAI,YAAY,CAAC,IAAI,GAAG,GAAG,CAAC;oBAClC,CAAC;yBAAM,IAAI,YAAY,CAAC,SAAS,KAAK,mBAAmB,EAAE,CAAC;wBAC3D,UAAU,GAAG,YAAY,CAAC,eAAe,KAAK,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC;oBACzE,CAAC;gBACF,CAAC;;;;;;;;;QACF,CAAC;;;;;;;;;IAED,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,EAAE,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,yBAAyB;IACpE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,UAAU,EAAE,CAAC;AAC9C,CAAC"}
|
package/lib/Providers/Utils.js
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.makeCamelCase = makeCamelCase;
|
|
4
|
+
exports.makeCamelCaseArray = makeCamelCaseArray;
|
|
5
|
+
exports.blobToArrayBuffer = blobToArrayBuffer;
|
|
3
6
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
4
7
|
// SPDX-License-Identifier: Apache-2.0
|
|
5
8
|
/**
|
|
@@ -21,7 +24,6 @@ function makeCamelCase(obj, keys) {
|
|
|
21
24
|
});
|
|
22
25
|
return newObj;
|
|
23
26
|
}
|
|
24
|
-
exports.makeCamelCase = makeCamelCase;
|
|
25
27
|
/**
|
|
26
28
|
* Given an array of object, call makeCamelCase(...) on each option.
|
|
27
29
|
*/
|
|
@@ -30,7 +32,6 @@ function makeCamelCaseArray(objArr, keys) {
|
|
|
30
32
|
return undefined;
|
|
31
33
|
return objArr.map(function (obj) { return makeCamelCase(obj, keys); });
|
|
32
34
|
}
|
|
33
|
-
exports.makeCamelCaseArray = makeCamelCaseArray;
|
|
34
35
|
/**
|
|
35
36
|
* Converts blob to array buffer
|
|
36
37
|
*/
|
|
@@ -51,5 +52,4 @@ function blobToArrayBuffer(blob) {
|
|
|
51
52
|
}
|
|
52
53
|
});
|
|
53
54
|
}
|
|
54
|
-
exports.blobToArrayBuffer = blobToArrayBuffer;
|
|
55
55
|
//# sourceMappingURL=Utils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Utils.js","sourceRoot":"","sources":["../../src/Providers/Utils.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"Utils.js","sourceRoot":"","sources":["../../src/Providers/Utils.ts"],"names":[],"mappings":";;AAMA,sCAYC;AAKD,gDAGC;AAKD,8CAeC;AA9CD,qEAAqE;AACrE,sCAAsC;AACtC;;;GAGG;AACH,SAAgB,aAAa,CAAC,GAAW,EAAE,IAAe;IACzD,IAAI,CAAC,GAAG;QAAE,OAAO,SAAS,CAAC;IAC3B,IAAM,MAAM,GAAG,EAAE,CAAC;IAClB,IAAM,YAAY,GAAG,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACpD,YAAY,CAAC,OAAO,CAAC,UAAA,GAAG;;QACvB,IAAI,GAAG,CAAC,cAAc,CAAC,GAAG,CAAC,EAAE,CAAC;YAC7B,+BAA+B;YAC/B,IAAM,YAAY,GAAG,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;YACjE,MAAM,CAAC,MAAM,CAAC,MAAM,YAAI,GAAC,YAAY,IAAG,GAAG,CAAC,GAAG,CAAC,MAAG,CAAC;QACrD,CAAC;IACF,CAAC,CAAC,CAAC;IACH,OAAO,MAAM,CAAC;AACf,CAAC;AAED;;GAEG;AACH,SAAgB,kBAAkB,CAAC,MAAgB,EAAE,IAAe;IACnE,IAAI,CAAC,MAAM;QAAE,OAAO,SAAS,CAAC;IAC9B,OAAO,MAAM,CAAC,GAAG,CAAC,UAAA,GAAG,IAAI,OAAA,aAAa,CAAC,GAAG,EAAE,IAAI,CAAC,EAAxB,CAAwB,CAAC,CAAC;AACpD,CAAC;AAED;;GAEG;AACH,SAAgB,iBAAiB,CAAC,IAAU;IAC3C,OAAO,IAAI,OAAO,CAAC,UAAC,GAAG,EAAE,GAAG;QAC3B,IAAM,MAAM,GAAG,IAAI,UAAU,EAAE,CAAC;QAChC,MAAM,CAAC,MAAM,GAAG,UAAA,MAAM;YACrB,GAAG,CAAC,MAAM,CAAC,MAAoB,CAAC,CAAC;QAClC,CAAC,CAAC;QACF,MAAM,CAAC,OAAO,GAAG,UAAA,GAAG;YACnB,GAAG,CAAC,GAAG,CAAC,CAAC;QACV,CAAC,CAAC;QACF,IAAI,CAAC;YACJ,MAAM,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC;QAChC,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACd,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,kCAAkC;QAC7C,CAAC;IACF,CAAC,CAAC,CAAC;AACJ,CAAC"}
|
package/lib/Providers/index.js
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AmazonAIPredictionsProvider = exports.AmazonAIInterpretPredictionsProvider = exports.AmazonAIIdentifyPredictionsProvider = exports.AmazonAIConvertPredictionsProvider = void 0;
|
|
3
4
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
4
5
|
// SPDX-License-Identifier: Apache-2.0
|
|
5
6
|
var AmazonAIConvertPredictionsProvider_1 = require("./AmazonAIConvertPredictionsProvider");
|
|
6
|
-
exports
|
|
7
|
+
Object.defineProperty(exports, "AmazonAIConvertPredictionsProvider", { enumerable: true, get: function () { return AmazonAIConvertPredictionsProvider_1.AmazonAIConvertPredictionsProvider; } });
|
|
7
8
|
var AmazonAIIdentifyPredictionsProvider_1 = require("./AmazonAIIdentifyPredictionsProvider");
|
|
8
|
-
exports
|
|
9
|
+
Object.defineProperty(exports, "AmazonAIIdentifyPredictionsProvider", { enumerable: true, get: function () { return AmazonAIIdentifyPredictionsProvider_1.AmazonAIIdentifyPredictionsProvider; } });
|
|
9
10
|
var AmazonAIInterpretPredictionsProvider_1 = require("./AmazonAIInterpretPredictionsProvider");
|
|
10
|
-
exports
|
|
11
|
+
Object.defineProperty(exports, "AmazonAIInterpretPredictionsProvider", { enumerable: true, get: function () { return AmazonAIInterpretPredictionsProvider_1.AmazonAIInterpretPredictionsProvider; } });
|
|
11
12
|
var AmazonAIPredictionsProvider_1 = require("./AmazonAIPredictionsProvider");
|
|
12
|
-
exports
|
|
13
|
+
Object.defineProperty(exports, "AmazonAIPredictionsProvider", { enumerable: true, get: function () { return AmazonAIPredictionsProvider_1.AmazonAIPredictionsProvider; } });
|
|
13
14
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/Providers/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/Providers/index.ts"],"names":[],"mappings":";;;AAAA,qEAAqE;AACrE,sCAAsC;AACtC,2FAA0F;AAKzF,mHALQ,uEAAkC,OAKR;AAJnC,6FAA4F;AAK3F,oHALQ,yEAAmC,OAKR;AAJpC,+FAA8F;AAK7F,qHALQ,2EAAoC,OAKR;AAJrC,6EAA4E;AAK3E,4GALQ,yDAA2B,OAKR"}
|
package/lib/index.js
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AmazonAIInterpretPredictionsProvider = exports.AmazonAIPredictionsProvider = exports.AmazonAIConvertPredictionsProvider = exports.AmazonAIIdentifyPredictionsProvider = exports.Predictions = void 0;
|
|
3
4
|
var tslib_1 = require("tslib");
|
|
4
5
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
5
6
|
// SPDX-License-Identifier: Apache-2.0
|
|
6
7
|
var Predictions_1 = require("./Predictions");
|
|
7
|
-
exports
|
|
8
|
+
Object.defineProperty(exports, "Predictions", { enumerable: true, get: function () { return Predictions_1.Predictions; } });
|
|
8
9
|
var Providers_1 = require("./Providers");
|
|
9
|
-
exports
|
|
10
|
-
exports
|
|
11
|
-
exports
|
|
12
|
-
exports
|
|
10
|
+
Object.defineProperty(exports, "AmazonAIConvertPredictionsProvider", { enumerable: true, get: function () { return Providers_1.AmazonAIConvertPredictionsProvider; } });
|
|
11
|
+
Object.defineProperty(exports, "AmazonAIIdentifyPredictionsProvider", { enumerable: true, get: function () { return Providers_1.AmazonAIIdentifyPredictionsProvider; } });
|
|
12
|
+
Object.defineProperty(exports, "AmazonAIPredictionsProvider", { enumerable: true, get: function () { return Providers_1.AmazonAIPredictionsProvider; } });
|
|
13
|
+
Object.defineProperty(exports, "AmazonAIInterpretPredictionsProvider", { enumerable: true, get: function () { return Providers_1.AmazonAIInterpretPredictionsProvider; } });
|
|
13
14
|
tslib_1.__exportStar(require("./types"), exports);
|
|
14
15
|
// chore: trigger v5-stable LTS release to complete partial publish (uuid-v11 RN fix, datastore). No functional change.
|
|
15
16
|
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;AAAA,qEAAqE;AACrE,sCAAsC;AACtC,6CAA4C;AAY3C,4FAZQ,yBAAW,OAYR;AAVZ,yCAKqB;AAOpB,mHAXA,8CAAkC,OAWA;AADlC,oHATA,+CAAmC,OASA;AAEnC,4GAVA,uCAA2B,OAUA;AAC3B,qHAVA,gDAAoC,OAUA;AAPrC,kDAAwB;AAUxB,uHAAuH"}
|
package/lib/types/AWSTypes.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
1
|
import { Geometry, Relationship } from './Predictions';
|
|
3
|
-
export
|
|
2
|
+
export type BlockList = Block[];
|
|
4
3
|
export interface Block {
|
|
5
4
|
/**
|
|
6
5
|
* <p>The type of text that's recognized in a block. In text-detection operations, the following types are returned:</p> <ul> <li> <p> <i>PAGE</i> - Contains a list of the LINE Block objects that are detected on a document page.</p> </li> <li> <p> <i>WORD</i> - A word detected on a document page. A word is one or more ISO basic Latin script characters that aren't separated by spaces.</p> </li> <li> <p> <i>LINE</i> - A string of tab-delimited, contiguous words that's detected on a document page.</p> </li> </ul> <p>In text analysis operations, the following types are returned:</p> <ul> <li> <p> <i>PAGE</i> - Contains a list of child Block objects that are detected on a document page.</p> </li> <li> <p> <i>KEY_VALUE_SET</i> - Stores the KEY and VALUE Block objects for a field that's detected on a document page. Use the <code>EntityType</code> field to determine if a KEY_VALUE_SET object is a KEY Block object or a VALUE Block object. </p> </li> <li> <p> <i>WORD</i> - A word detected on a document page. A word is one or more ISO basic Latin script characters that aren't separated by spaces that's detected on a document page.</p> </li> <li> <p> <i>LINE</i> - A string of tab-delimited, contiguous words that's detected on a document page.</p> </li> <li> <p> <i>TABLE</i> - A table that's detected on a document page. A table is any grid-based information with 2 or more rows or columns with a cell span of 1 row and 1 column each. </p> </li> <li> <p> <i>CELL</i> - A cell within a detected table. The cell is the parent of the block that contains the text in the cell.</p> </li> <li> <p> <i>SELECTION_ELEMENT</i> - A selectable element such as a radio button or checkbox that's detected on a document page. Use the value of <code>SelectionStatus</code> to determine the status of the selection element.</p> </li> </ul>
|
|
@@ -55,7 +54,7 @@ export interface Block {
|
|
|
55
54
|
*/
|
|
56
55
|
Page?: number;
|
|
57
56
|
}
|
|
58
|
-
export
|
|
57
|
+
export type TextDetectionList = TextDetection[];
|
|
59
58
|
export interface TextDetection {
|
|
60
59
|
/**
|
|
61
60
|
* <p>The word or line of text recognized by Amazon Rekognition. </p>
|
|
@@ -92,8 +91,8 @@ export interface Image {
|
|
|
92
91
|
*/
|
|
93
92
|
S3Object?: S3Object;
|
|
94
93
|
}
|
|
95
|
-
export
|
|
96
|
-
export
|
|
94
|
+
export type ImageBlob = Buffer | Uint8Array | Blob | string;
|
|
95
|
+
export type S3Bucket = string;
|
|
97
96
|
export interface S3Object {
|
|
98
97
|
/**
|
|
99
98
|
* Name of the S3 bucket.
|
|
@@ -108,8 +107,8 @@ export interface S3Object {
|
|
|
108
107
|
*/
|
|
109
108
|
Version?: S3ObjectVersion;
|
|
110
109
|
}
|
|
111
|
-
export
|
|
112
|
-
export
|
|
110
|
+
export type S3ObjectName = string;
|
|
111
|
+
export type S3ObjectVersion = string;
|
|
113
112
|
/**
|
|
114
113
|
* <p>The input document, either as bytes or as an S3 object.</p> <p>You pass image bytes to an Amazon Textract API operation by using the <code>Bytes</code> property. For example, you would use the <code>Bytes</code> property to pass a document loaded from a local file system. Image bytes passed by using the <code>Bytes</code> property must be base64 encoded. Your code might not need to encode document file bytes if you're using an AWS SDK to call Amazon Textract API operations. </p> <p>You pass images stored in an S3 bucket to an Amazon Textract API operation by using the <code>S3Object</code> property. Documents stored in an S3 bucket don't need to be base64 encoded.</p> <p>The AWS Region for the S3 bucket that contains the S3 object must match the AWS Region that you use for Amazon Textract operations.</p> <p>If you use the AWS CLI to call Amazon Textract operations, passing image bytes using the Bytes property isn't supported. You must first upload the document to an Amazon S3 bucket, and then call the operation using the S3Object property.</p> <p>For Amazon Textract to process an S3 object, the user must have permission to access the S3 object. </p>
|
|
115
114
|
*/
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
1
|
/**
|
|
3
2
|
* Base types
|
|
4
3
|
*/
|
|
@@ -119,7 +118,7 @@ export interface SpeechToTextOutput {
|
|
|
119
118
|
fullText: string;
|
|
120
119
|
};
|
|
121
120
|
}
|
|
122
|
-
export
|
|
121
|
+
export type IdentifySource = StorageSource | FileSource | BytesSource;
|
|
123
122
|
export interface IdentifyTextInput {
|
|
124
123
|
text: {
|
|
125
124
|
source: IdentifySource;
|
|
@@ -187,7 +186,7 @@ export interface Point {
|
|
|
187
186
|
x?: Number;
|
|
188
187
|
y?: Number;
|
|
189
188
|
}
|
|
190
|
-
export
|
|
189
|
+
export type Polygon = Array<Point> | Iterable<Point>;
|
|
191
190
|
export interface BoundingBox {
|
|
192
191
|
width?: Number;
|
|
193
192
|
height?: Number;
|
|
@@ -277,5 +276,5 @@ export interface Relationship {
|
|
|
277
276
|
*/
|
|
278
277
|
Ids?: Array<string> | Iterable<string>;
|
|
279
278
|
}
|
|
280
|
-
export
|
|
281
|
-
export
|
|
279
|
+
export type FeatureType = 'TABLES' | 'FORMS' | string;
|
|
280
|
+
export type FeatureTypes = FeatureType[];
|
package/lib/types/Predictions.js
CHANGED
|
@@ -3,6 +3,19 @@
|
|
|
3
3
|
// SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
/* tslint:disable:max-line-length */
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.InterpretTextCategories = void 0;
|
|
7
|
+
exports.isIdentifyFromCollection = isIdentifyFromCollection;
|
|
8
|
+
exports.isIdentifyCelebrities = isIdentifyCelebrities;
|
|
9
|
+
exports.isTranslateTextInput = isTranslateTextInput;
|
|
10
|
+
exports.isTextToSpeechInput = isTextToSpeechInput;
|
|
11
|
+
exports.isSpeechToTextInput = isSpeechToTextInput;
|
|
12
|
+
exports.isStorageSource = isStorageSource;
|
|
13
|
+
exports.isFileSource = isFileSource;
|
|
14
|
+
exports.isBytesSource = isBytesSource;
|
|
15
|
+
exports.isIdentifyTextInput = isIdentifyTextInput;
|
|
16
|
+
exports.isIdentifyLabelsInput = isIdentifyLabelsInput;
|
|
17
|
+
exports.isIdentifyEntitiesInput = isIdentifyEntitiesInput;
|
|
18
|
+
exports.isInterpretTextInput = isInterpretTextInput;
|
|
6
19
|
/**
|
|
7
20
|
* Convert types
|
|
8
21
|
*/
|
|
@@ -14,66 +27,54 @@ var InterpretTextCategories;
|
|
|
14
27
|
InterpretTextCategories["SENTIMENT"] = "SENTIMENT";
|
|
15
28
|
InterpretTextCategories["SYNTAX"] = "SYNTAX";
|
|
16
29
|
InterpretTextCategories["KEY_PHRASES"] = "KEY_PHRASES";
|
|
17
|
-
})(InterpretTextCategories
|
|
30
|
+
})(InterpretTextCategories || (exports.InterpretTextCategories = InterpretTextCategories = {}));
|
|
18
31
|
function isIdentifyFromCollection(obj) {
|
|
19
32
|
var key = 'collection';
|
|
20
33
|
var keyId = 'collectionId';
|
|
21
34
|
return obj && (obj.hasOwnProperty(key) || obj.hasOwnProperty(keyId));
|
|
22
35
|
}
|
|
23
|
-
exports.isIdentifyFromCollection = isIdentifyFromCollection;
|
|
24
36
|
function isIdentifyCelebrities(obj) {
|
|
25
37
|
var key = 'celebrityDetection';
|
|
26
38
|
return obj && obj.hasOwnProperty(key);
|
|
27
39
|
}
|
|
28
|
-
exports.isIdentifyCelebrities = isIdentifyCelebrities;
|
|
29
40
|
function isTranslateTextInput(obj) {
|
|
30
41
|
var key = 'translateText';
|
|
31
42
|
return obj && obj.hasOwnProperty(key);
|
|
32
43
|
}
|
|
33
|
-
exports.isTranslateTextInput = isTranslateTextInput;
|
|
34
44
|
function isTextToSpeechInput(obj) {
|
|
35
45
|
var key = 'textToSpeech';
|
|
36
46
|
return obj && obj.hasOwnProperty(key);
|
|
37
47
|
}
|
|
38
|
-
exports.isTextToSpeechInput = isTextToSpeechInput;
|
|
39
48
|
function isSpeechToTextInput(obj) {
|
|
40
49
|
var key = 'transcription';
|
|
41
50
|
return obj && obj.hasOwnProperty(key);
|
|
42
51
|
}
|
|
43
|
-
exports.isSpeechToTextInput = isSpeechToTextInput;
|
|
44
52
|
function isStorageSource(obj) {
|
|
45
53
|
var key = 'key';
|
|
46
54
|
return obj && obj.hasOwnProperty(key);
|
|
47
55
|
}
|
|
48
|
-
exports.isStorageSource = isStorageSource;
|
|
49
56
|
function isFileSource(obj) {
|
|
50
57
|
var key = 'file';
|
|
51
58
|
return obj && obj.hasOwnProperty(key);
|
|
52
59
|
}
|
|
53
|
-
exports.isFileSource = isFileSource;
|
|
54
60
|
function isBytesSource(obj) {
|
|
55
61
|
var key = 'bytes';
|
|
56
62
|
return obj && obj.hasOwnProperty(key);
|
|
57
63
|
}
|
|
58
|
-
exports.isBytesSource = isBytesSource;
|
|
59
64
|
function isIdentifyTextInput(obj) {
|
|
60
65
|
var key = 'text';
|
|
61
66
|
return obj && obj.hasOwnProperty(key);
|
|
62
67
|
}
|
|
63
|
-
exports.isIdentifyTextInput = isIdentifyTextInput;
|
|
64
68
|
function isIdentifyLabelsInput(obj) {
|
|
65
69
|
var key = 'labels';
|
|
66
70
|
return obj && obj.hasOwnProperty(key);
|
|
67
71
|
}
|
|
68
|
-
exports.isIdentifyLabelsInput = isIdentifyLabelsInput;
|
|
69
72
|
function isIdentifyEntitiesInput(obj) {
|
|
70
73
|
var key = 'entities';
|
|
71
74
|
return obj && obj.hasOwnProperty(key);
|
|
72
75
|
}
|
|
73
|
-
exports.isIdentifyEntitiesInput = isIdentifyEntitiesInput;
|
|
74
76
|
function isInterpretTextInput(obj) {
|
|
75
77
|
var key = 'text';
|
|
76
78
|
return obj && obj.hasOwnProperty(key);
|
|
77
79
|
}
|
|
78
|
-
exports.isInterpretTextInput = isInterpretTextInput;
|
|
79
80
|
//# sourceMappingURL=Predictions.js.map
|