Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

vadim-berman

🎯
Focusing
View GitHub Profile
@vadim-berman
vadim-berman / tisane_pubnub_module_before.js
Created Mar 17, 2021
Detecting abuse in an inbound PubNub message from within a module
View tisane_pubnub_module_before.js
const xhr = require('xhr');
const vault = require('vault');
// Use the PubNub Functions Vault Module to store these keys securely.
// Click the MY SECRETS button on the left.
export default (request) => {
console.log('1. original', request.message.text);
const getAPIKey = new Promise((resolve) => {
@vadim-berman
vadim-berman / TisaneGeneralInfo.md
Last active Nov 29, 2018
Tisane API Company Information
View TisaneGeneralInfo.md

General Info

Tisane Labs logo

Other logo formats:

Tisane Labs logo Tisane Labs logo Tisane Labs logo Tisane Labs logo

@vadim-berman
vadim-berman / TisaneAPIinBrief.md
Last active Dec 24, 2018
Tisane API: Introduction for PubNub Developers
View TisaneAPIinBrief.md

Tisane API for PubNub Developers

Use natural language processing to detect abusive content, get sentiment analysis 2.0, topic modelling, and more, in 27 languages

About Tisane API

Tisane API provides:

  • Granular sentiment analysis (aspect-based sentiment analysis). Rather than a single figure, the result is a vector of values for specific targets
  • Detection of abuse: hate speech / personal attacks / sexual advances / profanities
@vadim-berman
vadim-berman / tisane_pubnub_after_publish.js
Created Nov 26, 2018
Detecting sentiment and topics in the inbound message
View tisane_pubnub_after_publish.js
const vault = require('vault');
const xhr = require('xhr');
const basicAuth = require('codec/auth');
// Use the PubNub Functions Vault Module to store these keys securely.
// username : '__YOUR_CLICKSEND_USER_NAME__'
// authKey : '__YOUR_CLICKSEND_AUTH_KEY__'
const url = 'https://rest.clicksend.com/v3/sms/send';
export default (request) => {
const getAPIKeys = new Promise((resolve, reject) => {
vault.get('username').then((username) => {
@vadim-berman
vadim-berman / tisane_pubnub_before_publish.js
Created Nov 26, 2018
Detecting abuse in an inbound PubNub message
View tisane_pubnub_before_publish.js
export default (request) => {
const xhr = require('xhr');
console.log('1. original', request.message);
{
return xhr.fetch('https://api.tisane.ai/parse', {
'method' : 'POST',
'headers' : {
'Ocp-Apim-Subscription-Key': '{your subscription key}'
},
'body': JSON.stringify({