@aws-amplify/predictions 5.5.24 → 5.5.26
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.d.ts +5 -0
- package/lib/Predictions.js +9 -3
- package/lib/Predictions.js.map +1 -1
- package/lib/Providers/AmazonAIConvertPredictionsProvider.d.ts +5 -0
- package/lib/Providers/AmazonAIConvertPredictionsProvider.js +37 -30
- package/lib/Providers/AmazonAIConvertPredictionsProvider.js.map +1 -1
- package/lib/Providers/AmazonAIIdentifyPredictionsProvider.d.ts +5 -0
- package/lib/Providers/AmazonAIIdentifyPredictionsProvider.js +57 -50
- package/lib/Providers/AmazonAIIdentifyPredictionsProvider.js.map +1 -1
- package/lib/Providers/AmazonAIInterpretPredictionsProvider.d.ts +5 -0
- package/lib/Providers/AmazonAIInterpretPredictionsProvider.js +49 -43
- package/lib/Providers/AmazonAIInterpretPredictionsProvider.js.map +1 -1
- package/lib/Providers/AmazonAIPredictionsProvider.d.ts +5 -0
- package/lib/Providers/AmazonAIPredictionsProvider.js +6 -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 +285 -5
- package/lib/types/Predictions.js +77 -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.d.ts +5 -0
- package/lib-esm/Predictions.js +9 -4
- package/lib-esm/Predictions.js.map +1 -1
- package/lib-esm/Providers/AmazonAIConvertPredictionsProvider.d.ts +5 -0
- package/lib-esm/Providers/AmazonAIConvertPredictionsProvider.js +32 -26
- package/lib-esm/Providers/AmazonAIConvertPredictionsProvider.js.map +1 -1
- package/lib-esm/Providers/AmazonAIIdentifyPredictionsProvider.d.ts +5 -0
- package/lib-esm/Providers/AmazonAIIdentifyPredictionsProvider.js +34 -28
- package/lib-esm/Providers/AmazonAIIdentifyPredictionsProvider.js.map +1 -1
- package/lib-esm/Providers/AmazonAIInterpretPredictionsProvider.d.ts +5 -0
- package/lib-esm/Providers/AmazonAIInterpretPredictionsProvider.js +47 -42
- package/lib-esm/Providers/AmazonAIInterpretPredictionsProvider.js.map +1 -1
- package/lib-esm/Providers/AmazonAIPredictionsProvider.d.ts +5 -0
- package/lib-esm/Providers/AmazonAIPredictionsProvider.js +5 -0
- 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 +285 -5
- package/lib-esm/types/Predictions.js +63 -0
- package/lib-esm/types/Predictions.js.map +1 -1
- 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/Predictions.ts +5 -0
- package/src/Providers/AmazonAIConvertPredictionsProvider.ts +5 -0
- package/src/Providers/AmazonAIIdentifyPredictionsProvider.ts +10 -3
- package/src/Providers/AmazonAIInterpretPredictionsProvider.ts +5 -0
- package/src/Providers/AmazonAIPredictionsProvider.ts +5 -0
- package/src/types/Predictions.ts +281 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AbstractInterpretPredictionsProvider.js","sourceRoot":"","sources":["../../../src/types/Providers/AbstractInterpretPredictionsProvider.ts"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,EAAE,2BAA2B,EAAE,MAAM,+BAA+B,CAAC;AAC5E,OAAO,EAGN,oBAAoB,GACpB,MAAM,gBAAgB,CAAC;AAExB;IAAmE,wDAA2B;IAA9F;;IAgBA,CAAC;IAfA,0DAAW,GAAX;QACC,OAAO,WAAW,CAAC;IACpB,CAAC;IAED,wDAAS,GAAT,UAAU,KAAyB;QAClC,IAAI,oBAAoB,CAAC,KAAK,CAAC,EAAE;
|
|
1
|
+
{"version":3,"file":"AbstractInterpretPredictionsProvider.js","sourceRoot":"","sources":["../../../src/types/Providers/AbstractInterpretPredictionsProvider.ts"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,EAAE,2BAA2B,EAAE,MAAM,+BAA+B,CAAC;AAC5E,OAAO,EAGN,oBAAoB,GACpB,MAAM,gBAAgB,CAAC;AAExB;IAAmE,wDAA2B;IAA9F;;IAgBA,CAAC;IAfA,0DAAW,GAAX;QACC,OAAO,WAAW,CAAC;IACpB,CAAC;IAED,wDAAS,GAAT,UAAU,KAAyB;QAClC,IAAI,oBAAoB,CAAC,KAAK,CAAC,EAAE,CAAC;YACjC,OAAO,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;QAClC,CAAC;IACF,CAAC;IAES,4DAAa,GAAvB,UACC,KAAyB;QAEzB,MAAM,IAAI,KAAK,CAAC,iDAAiD,CAAC,CAAC;IACpE,CAAC;IACF,2CAAC;AAAD,CAAC,AAhBD,CAAmE,2BAA2B,GAgB7F"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aws-amplify/predictions",
|
|
3
|
-
"version": "5.5.
|
|
3
|
+
"version": "5.5.26",
|
|
4
4
|
"description": "Machine learning category of aws-amplify",
|
|
5
5
|
"main": "./lib/index.js",
|
|
6
6
|
"module": "./lib-esm/index.js",
|
|
@@ -45,17 +45,17 @@
|
|
|
45
45
|
"src"
|
|
46
46
|
],
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"@aws-amplify/core": "5.8.
|
|
49
|
-
"@aws-amplify/storage": "5.9.
|
|
50
|
-
"@aws-sdk/client-comprehend": "3.
|
|
51
|
-
"@aws-sdk/client-polly": "3.
|
|
52
|
-
"@aws-sdk/client-rekognition": "3.
|
|
53
|
-
"@aws-sdk/client-textract": "3.
|
|
54
|
-
"@aws-sdk/client-translate": "3.
|
|
48
|
+
"@aws-amplify/core": "5.8.19",
|
|
49
|
+
"@aws-amplify/storage": "5.9.24",
|
|
50
|
+
"@aws-sdk/client-comprehend": "3.982.0",
|
|
51
|
+
"@aws-sdk/client-polly": "3.982.0",
|
|
52
|
+
"@aws-sdk/client-rekognition": "3.982.0",
|
|
53
|
+
"@aws-sdk/client-textract": "3.982.0",
|
|
54
|
+
"@aws-sdk/client-translate": "3.982.0",
|
|
55
55
|
"@aws-sdk/eventstream-marshaller": "3.6.1",
|
|
56
56
|
"@aws-sdk/util-utf8-node": "3.6.1",
|
|
57
57
|
"buffer": "4.9.2",
|
|
58
|
-
"tslib": "^
|
|
58
|
+
"tslib": "^2.0.0",
|
|
59
59
|
"uuid": "^11.1.1"
|
|
60
60
|
},
|
|
61
61
|
"size-limit": [
|
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
"name": "Predictions (Convert provider)",
|
|
70
70
|
"path": "./lib-esm/index.js",
|
|
71
71
|
"import": "{ Amplify, Predictions, AmazonAIConvertPredictionsProvider }",
|
|
72
|
-
"limit": "
|
|
72
|
+
"limit": "65 kB"
|
|
73
73
|
},
|
|
74
74
|
{
|
|
75
75
|
"name": "Predictions (Identify provider)",
|
|
@@ -91,23 +91,23 @@
|
|
|
91
91
|
"transformIgnorePatterns": [
|
|
92
92
|
"node_modules/(?!(fast-xml-parser)/)"
|
|
93
93
|
],
|
|
94
|
-
"globals": {
|
|
95
|
-
"ts-jest": {
|
|
96
|
-
"diagnostics": false,
|
|
97
|
-
"tsConfig": {
|
|
98
|
-
"lib": [
|
|
99
|
-
"es5",
|
|
100
|
-
"es2015",
|
|
101
|
-
"dom",
|
|
102
|
-
"esnext.asynciterable",
|
|
103
|
-
"es2017.object"
|
|
104
|
-
],
|
|
105
|
-
"allowJs": true
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
},
|
|
109
94
|
"transform": {
|
|
110
|
-
"^.+\\.(js|jsx|ts|tsx)$":
|
|
95
|
+
"^.+\\.(js|jsx|ts|tsx)$": [
|
|
96
|
+
"ts-jest",
|
|
97
|
+
{
|
|
98
|
+
"diagnostics": false,
|
|
99
|
+
"tsconfig": {
|
|
100
|
+
"lib": [
|
|
101
|
+
"es5",
|
|
102
|
+
"es2015",
|
|
103
|
+
"dom",
|
|
104
|
+
"esnext.asynciterable",
|
|
105
|
+
"es2017.object"
|
|
106
|
+
],
|
|
107
|
+
"allowJs": true
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
]
|
|
111
111
|
},
|
|
112
112
|
"testRegex": "(/__tests__/.*|\\.(test|spec))\\.(tsx?|jsx?)$",
|
|
113
113
|
"moduleFileExtensions": [
|
|
@@ -118,7 +118,15 @@
|
|
|
118
118
|
"jsx"
|
|
119
119
|
],
|
|
120
120
|
"testEnvironment": "jsdom",
|
|
121
|
-
"
|
|
121
|
+
"testEnvironmentOptions": {
|
|
122
|
+
"customExportConditions": [
|
|
123
|
+
"node",
|
|
124
|
+
"node-addons"
|
|
125
|
+
]
|
|
126
|
+
},
|
|
127
|
+
"setupFiles": [
|
|
128
|
+
"<rootDir>/../../jest.setup.js"
|
|
129
|
+
],
|
|
122
130
|
"coverageThreshold": {
|
|
123
131
|
"global": {
|
|
124
132
|
"branches": 0,
|
|
@@ -134,5 +142,5 @@
|
|
|
134
142
|
"lib-esm"
|
|
135
143
|
]
|
|
136
144
|
},
|
|
137
|
-
"gitHead": "
|
|
145
|
+
"gitHead": "d0b923913b92145813d1470bfbdc9b4dfa915c20"
|
|
138
146
|
}
|
package/src/Predictions.ts
CHANGED
|
@@ -247,5 +247,10 @@ export class PredictionsClass {
|
|
|
247
247
|
}
|
|
248
248
|
}
|
|
249
249
|
|
|
250
|
+
/**
|
|
251
|
+
* @deprecated Amplify JavaScript v5 is in maintenance mode. Upgrade to v6.
|
|
252
|
+
* See the migration guide:
|
|
253
|
+
* https://docs.amplify.aws/gen1/javascript/build-a-backend/troubleshooting/migrate-from-javascript-v5-to-v6/
|
|
254
|
+
*/
|
|
250
255
|
export const Predictions = new PredictionsClass({});
|
|
251
256
|
Amplify.register(Predictions);
|
|
@@ -35,6 +35,11 @@ const eventBuilder = new EventStreamMarshaller(toUtf8, fromUtf8);
|
|
|
35
35
|
|
|
36
36
|
const LANGUAGES_CODE_IN_8KHZ = ['fr-FR', 'en-AU', 'en-GB', 'fr-CA'];
|
|
37
37
|
|
|
38
|
+
/**
|
|
39
|
+
* @deprecated Amplify JavaScript v5 is in maintenance mode. Upgrade to v6.
|
|
40
|
+
* See the migration guide:
|
|
41
|
+
* https://docs.amplify.aws/gen1/javascript/build-a-backend/troubleshooting/migrate-from-javascript-v5-to-v6/
|
|
42
|
+
*/
|
|
38
43
|
export class AmazonAIConvertPredictionsProvider extends AbstractConvertPredictionsProvider {
|
|
39
44
|
private translateClient: TranslateClient;
|
|
40
45
|
private pollyClient: PollyClient;
|
|
@@ -20,6 +20,7 @@ import {
|
|
|
20
20
|
DetectModerationLabelsCommand,
|
|
21
21
|
DetectModerationLabelsCommandInput,
|
|
22
22
|
RecognizeCelebritiesCommand,
|
|
23
|
+
Attribute,
|
|
23
24
|
} from '@aws-sdk/client-rekognition';
|
|
24
25
|
import {
|
|
25
26
|
IdentifyLabelsInput,
|
|
@@ -35,7 +36,6 @@ import {
|
|
|
35
36
|
isIdentifyCelebrities,
|
|
36
37
|
isIdentifyFromCollection,
|
|
37
38
|
IdentifyFromCollection,
|
|
38
|
-
FeatureTypes,
|
|
39
39
|
} from '../types';
|
|
40
40
|
import {
|
|
41
41
|
Image,
|
|
@@ -49,6 +49,7 @@ import {
|
|
|
49
49
|
DetectDocumentTextCommandInput,
|
|
50
50
|
AnalyzeDocumentCommand,
|
|
51
51
|
AnalyzeDocumentCommandInput,
|
|
52
|
+
FeatureType,
|
|
52
53
|
} from '@aws-sdk/client-textract';
|
|
53
54
|
import { makeCamelCase, makeCamelCaseArray, blobToArrayBuffer } from './Utils';
|
|
54
55
|
import {
|
|
@@ -56,6 +57,11 @@ import {
|
|
|
56
57
|
categorizeTextractBlocks,
|
|
57
58
|
} from './IdentifyTextUtils';
|
|
58
59
|
|
|
60
|
+
/**
|
|
61
|
+
* @deprecated Amplify JavaScript v5 is in maintenance mode. Upgrade to v6.
|
|
62
|
+
* See the migration guide:
|
|
63
|
+
* https://docs.amplify.aws/gen1/javascript/build-a-backend/troubleshooting/migrate-from-javascript-v5-to-v6/
|
|
64
|
+
*/
|
|
59
65
|
export class AmazonAIIdentifyPredictionsProvider extends AbstractIdentifyPredictionsProvider {
|
|
60
66
|
private rekognitionClient: RekognitionClient;
|
|
61
67
|
private textractClient: TextractClient;
|
|
@@ -159,7 +165,7 @@ export class AmazonAIIdentifyPredictionsProvider extends AbstractIdentifyPredict
|
|
|
159
165
|
|
|
160
166
|
// get default value if format isn't specified in the input.
|
|
161
167
|
const format = input.text.format || configFormat;
|
|
162
|
-
const featureTypes:
|
|
168
|
+
const featureTypes: FeatureType[] = []; // structures we want to analyze (e.g. [TABLES, FORMS]).
|
|
163
169
|
if (format === 'FORM' || format === 'ALL') featureTypes.push('FORMS');
|
|
164
170
|
if (format === 'TABLE' || format === 'ALL') featureTypes.push('TABLES');
|
|
165
171
|
|
|
@@ -372,7 +378,8 @@ export class AmazonAIIdentifyPredictionsProvider extends AbstractIdentifyPredict
|
|
|
372
378
|
return Promise.reject(err);
|
|
373
379
|
});
|
|
374
380
|
|
|
375
|
-
const
|
|
381
|
+
const attributes: Attribute[] = ['ALL'];
|
|
382
|
+
const param = { Attributes: attributes, Image: inputImage };
|
|
376
383
|
|
|
377
384
|
if (
|
|
378
385
|
isIdentifyCelebrities(input.entities) &&
|
|
@@ -26,6 +26,11 @@ import {
|
|
|
26
26
|
DetectSentimentCommand,
|
|
27
27
|
} from '@aws-sdk/client-comprehend';
|
|
28
28
|
|
|
29
|
+
/**
|
|
30
|
+
* @deprecated Amplify JavaScript v5 is in maintenance mode. Upgrade to v6.
|
|
31
|
+
* See the migration guide:
|
|
32
|
+
* https://docs.amplify.aws/gen1/javascript/build-a-backend/troubleshooting/migrate-from-javascript-v5-to-v6/
|
|
33
|
+
*/
|
|
29
34
|
export class AmazonAIInterpretPredictionsProvider extends AbstractInterpretPredictionsProvider {
|
|
30
35
|
private comprehendClient: ComprehendClient;
|
|
31
36
|
|
|
@@ -22,6 +22,11 @@ import {
|
|
|
22
22
|
InterpretTextOutput,
|
|
23
23
|
} from '../types';
|
|
24
24
|
|
|
25
|
+
/**
|
|
26
|
+
* @deprecated Amplify JavaScript v5 is in maintenance mode. Upgrade to v6.
|
|
27
|
+
* See the migration guide:
|
|
28
|
+
* https://docs.amplify.aws/gen1/javascript/build-a-backend/troubleshooting/migrate-from-javascript-v5-to-v6/
|
|
29
|
+
*/
|
|
25
30
|
export class AmazonAIPredictionsProvider extends AbstractPredictionsProvider {
|
|
26
31
|
private convertProvider: AmazonAIConvertPredictionsProvider;
|
|
27
32
|
private identifyProvider: AmazonAIIdentifyPredictionsProvider;
|