sap-leonardo
Advanced tools
Comparing version 0.5.2 to 0.5.3
@@ -15,1 +15,2 @@ export * from "./imageclassification"; | ||
export * from "./product_image_classification"; | ||
export * from "./topic_detection"; |
@@ -20,1 +20,2 @@ "use strict"; | ||
__export(require("./product_image_classification")); | ||
__export(require("./topic_detection")); |
@@ -31,3 +31,3 @@ "use strict"; | ||
}).then(done, done); | ||
}); | ||
}).timeout(60000); | ||
}); | ||
@@ -64,3 +64,3 @@ describe("multi-instance image segmentation image:jpg", () => { | ||
}).then(done, done); | ||
}); | ||
}).timeout(60000); | ||
}); | ||
@@ -67,0 +67,0 @@ }); |
@@ -19,3 +19,3 @@ "use strict"; | ||
}).then(done, done); | ||
}); | ||
}).timeout(20000); | ||
}); | ||
@@ -33,3 +33,3 @@ describe("image to text with options", () => { | ||
}).then(done, done); | ||
}); | ||
}).timeout(20000); | ||
it("should return a German text", (done) => { | ||
@@ -45,3 +45,3 @@ const options = { lang: "de", outputType: "txt", pageSegMode: "1", modelType: "lstmStandard" }; | ||
}).then(done, done); | ||
}); | ||
}).timeout(20000); | ||
}); | ||
@@ -48,0 +48,0 @@ describe("image to text (via job)", () => { |
@@ -32,3 +32,3 @@ "use strict"; | ||
const similarityScoringWithOptions = new index_1.SimilarityScoring(process.env.API_KEY); | ||
describe("texts", () => { | ||
describe("numSimilarVectors", () => { | ||
it("should detect similarity scores for 1 similar vector", (done) => { | ||
@@ -48,2 +48,47 @@ const optionsOne = JSON.stringify({ numSimilarVectors: 1 }); | ||
}); | ||
describe("algorithm", () => { | ||
it("should detect similarity scores for naive", (done) => { | ||
const optionsOne = JSON.stringify({ numSimilarVectors: 2, algorithm: "naive" }); | ||
similarityScoringWithOptions.similarityScoring(null, JSON.stringify(data), optionsOne).then((body) => { | ||
chai_1.expect(body).to.have.property("id"); | ||
chai_1.expect(body).to.have.property("predictions"); | ||
chai_1.expect(body).to.have.property("processedTime"); | ||
chai_1.expect(body).to.have.property("status").to.be.equal("DONE"); | ||
chai_1.expect(body.predictions).to.be.an("array").have.lengthOf(3); | ||
// for (let i = 0; i < 3; i++) { | ||
// expect(body.predictions[i].similarVectors[0].score).to.be.equal(predictions[i].similarVectors[0].score); | ||
// } | ||
chai_1.expect(body.predictions).to.be.an("array").have.lengthOf(3).is.eql(predictions); | ||
}).then(done, done); | ||
}); | ||
it("should detect similarity scores for matrix_mult", (done) => { | ||
const optionsOne = JSON.stringify({ numSimilarVectors: 2, algorithm: "matrix_mult" }); | ||
similarityScoringWithOptions.similarityScoring(null, JSON.stringify(data), optionsOne).then((body) => { | ||
chai_1.expect(body).to.have.property("id"); | ||
chai_1.expect(body).to.have.property("predictions"); | ||
chai_1.expect(body).to.have.property("processedTime"); | ||
chai_1.expect(body).to.have.property("status").to.be.equal("DONE"); | ||
chai_1.expect(body.predictions).to.be.an("array").have.lengthOf(3); | ||
// for (let i = 0; i < 3; i++) { | ||
// expect(body.predictions[i].similarVectors[0].score).to.be.equal(predictions[i].similarVectors[0].score); | ||
// } | ||
chai_1.expect(body.predictions).to.be.an("array").have.lengthOf(3).is.eql(predictions); | ||
}).then(done, done); | ||
}); | ||
it("should detect similarity scores for clustering", (done) => { | ||
const optionsOne = JSON.stringify({ numSimilarVectors: 2, algorithm: "clustering" }); | ||
similarityScoringWithOptions.similarityScoring(null, JSON.stringify(data), optionsOne).then((body) => { | ||
chai_1.expect(body).to.have.property("id"); | ||
chai_1.expect(body).to.have.property("predictions"); | ||
chai_1.expect(body).to.have.property("processedTime"); | ||
chai_1.expect(body).to.have.property("status").to.be.equal("DONE"); | ||
chai_1.expect(body.predictions).to.be.an("array").have.lengthOf(3); | ||
// for (let i = 0; i < 3; i++) { | ||
// expect(body.predictions[i].similarVectors[0].score).to.be.equal(predictions[i].similarVectors[0].score); | ||
// } | ||
chai_1.expect(body.predictions).to.be.an("array").have.lengthOf(3).is.eql(predictions); | ||
}).then(done, done); | ||
}); | ||
}); | ||
// algorithm - Optional. Algorithm to use for calculation, one of [“naive”, “matrix_mult”, “clustering”] | ||
}); | ||
@@ -50,0 +95,0 @@ describe("error coverage", () => { |
{ | ||
"name": "sap-leonardo", | ||
"version": "0.5.2", | ||
"version": "0.5.3", | ||
"description": "NPM module for SAP Leonardo Machine Learning Foundation - Functional Services https://api.sap.com/package/SAPLeonardoMLFunctionalServices", | ||
@@ -8,3 +8,3 @@ "main": "dist/index.js", | ||
"build": "./node_modules/.bin/tsc", | ||
"test": "npm run build && ./node_modules/.bin/istanbul cover ./node_modules/.bin/_mocha --report lcovonly -- -s 30000 -t 30000 dist/test/test_*.js && cat ./coverage/lcov.info | ./node_modules/.bin/coveralls", | ||
"test": "npm run build && ./node_modules/.bin/istanbul cover ./node_modules/.bin/_mocha --report lcovonly -- -s 10000 -t 10000 dist/test/test_*.js && cat ./coverage/lcov.info | ./node_modules/.bin/coveralls", | ||
"lint": "./node_modules/.bin/tslint src/**/*.ts && ./node_modules/.bin/eslint examples/*.js" | ||
@@ -23,14 +23,19 @@ }, | ||
"keywords": [ | ||
"sap leonardo", | ||
"sap", | ||
"leonardo", | ||
"machine learning", | ||
"ml", | ||
"image classification", | ||
"image segmentation", | ||
"optical character recognition", | ||
"image", | ||
"text", | ||
"classification", | ||
"segmentation", | ||
"ocr", | ||
"face detection", | ||
"human detection", | ||
"machine translation", | ||
"language detection", | ||
"product text classification" | ||
"optical", | ||
"character", | ||
"recognition", | ||
"face", | ||
"human", | ||
"language", | ||
"detection", | ||
"translation" | ||
], | ||
@@ -37,0 +42,0 @@ "dependencies": { |
@@ -63,3 +63,3 @@ # SAP Leonardo Machine Learning Foundation - Functional Services | ||
- ~~Inference Service for Customizable Similarity Search~~ | ||
- ~~Inference Service for Topic Detection~~ | ||
- [Inference Service for Topic Detection](https://api.sap.com/api/topic_detection_api/resource) | ||
@@ -119,2 +119,3 @@ - [Inference Service for Human Detection](https://api.sap.com/api/human_detection_api/resource) | ||
- [converse-2069209_640.jpg](https://pixabay.com/en/converse-shoes-grass-outdoors-2069209/) | ||
- [keyboard-70506_640.jpg](https://pixabay.com/en/keyboard-computer-hardware-keys-70506/) | ||
@@ -121,0 +122,0 @@ |
222854
70
5223
130
52