Skip to content

Instantly share code, notes, and snippets.

View vadim-berman's full-sized avatar
🎯
Focusing

vadim-berman

🎯
Focusing
View GitHub Profile
@vadim-berman
vadim-berman / tisane_pubnub_module_before.js
Created March 17, 2021 07:16
Detecting abuse in an inbound PubNub message from within a module
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 November 29, 2018 01:16
Tisane API Company Information

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 December 24, 2018 02:32
Tisane API: Introduction for PubNub Developers

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 November 26, 2018 04:50
Detecting sentiment and topics in the inbound message
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 November 26, 2018 04:48
Detecting abuse in an inbound PubNub message
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({