aboutsummaryrefslogtreecommitdiff
path: root/src/client/cognitive_services/CognitiveServices.ts
diff options
context:
space:
mode:
authorab <abdullah_ahmed@brown.edu>2019-09-28 17:18:08 -0400
committerab <abdullah_ahmed@brown.edu>2019-09-28 17:18:08 -0400
commit77be33c927b52f93e862b868321f79c59bfc050d (patch)
treeb6ad2659b73a4258d955f5af304176fedb106449 /src/client/cognitive_services/CognitiveServices.ts
parent7a01cf9c12f850c0c1d9c278452df88dd55845aa (diff)
tensorflow model, server posting fix needed
Diffstat (limited to 'src/client/cognitive_services/CognitiveServices.ts')
-rw-r--r--src/client/cognitive_services/CognitiveServices.ts5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/client/cognitive_services/CognitiveServices.ts b/src/client/cognitive_services/CognitiveServices.ts
index baafb63a1..b23441552 100644
--- a/src/client/cognitive_services/CognitiveServices.ts
+++ b/src/client/cognitive_services/CognitiveServices.ts
@@ -269,7 +269,7 @@ export namespace CognitiveServices {
//keyterms = ["father", "king"];
let args = { method: 'POST', uri: Utils.prepend("/recommender"), body: { keyphrases: keyterms }, json: true };
await requestPromise.post(args).then(async (wordvecs) => {
- if (wordvecs.length > 0) {
+ if (wordvecs.shape[0] > 0) {
console.log("successful vectorization!");
var vectorValues = new Set<number[]>();
wordvecs.forEach((wordvec: any) => {
@@ -282,7 +282,8 @@ export namespace CognitiveServices {
console.log("unsuccessful :( word(s) not in vocabulary");
}
//console.log(vectorValues.size);
- });
+ }
+ );
}
export const analyzer = async (dataDoc: Doc, target: Doc, keys: string[], data: string, converter: TextConverter, mainDoc: boolean = false, internal: boolean = true) => {