aboutsummaryrefslogtreecommitdiff
path: root/src/client/apis/IBM_Recommender.ts
blob: e6265fcb577b919bd070f46a1f74cb3c642e6f70 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
// import { Opt } from "../../fields/Doc";

// const NaturalLanguageUnderstandingV1 = require('ibm-watson/natural-language-understanding/v1');
// const { IamAuthenticator } = require('ibm-watson/auth');

// export namespace IBM_Recommender {

//     // pass to IBM account is Browngfx1

//     const naturalLanguageUnderstanding = new NaturalLanguageUnderstandingV1({
//         version: '2019-07-12',
//         authenticator: new IamAuthenticator({
//             apikey: 'tLiYwbRim3CnBcCO4phubpf-zEiGcub1uh0V-sD9OKhw',
//         }),
//         url: 'https://gateway-wdc.watsonplatform.net/natural-language-understanding/api'
//     });

//     const analyzeParams = {
//         'text': 'this is a test of the keyword extraction feature I am integrating into the program',
//         'features': {
//             'keywords': {
//                 'sentiment': true,
//                 'emotion': true,
//                 'limit': 3
//             },
//         }
//     };

//     export const analyze = async (_parameters: any): Promise<Opt<string>> => {
//         try {
//             const response = await naturalLanguageUnderstanding.analyze(_parameters);
//             return (JSON.stringify(response, null, 2));
//         } catch (err) {
//             return undefined;
//         }
//     };

// }