symblを設定する.AIはWebSocketコールでアクションアイテムを聞く


symblAIは、会話のインテリジェンスプラットフォームの会話のデータの周りに新しい経験を作成するには、開発者は、コンテキストの洞察に単なる自動音声認識を超えて拡張する権限を与える.文脈的洞察はsymblの結果である.話者意図を認識するAIの自然言語処理アルゴリズムスピーチの中で最も一般的な意図スピーカーのいくつかの中で、フォローアップ、質問やアクションアイテムです.
要するに,sプラットフォームによって認識される会話の実体としてのアクションアイテムは,いつでも会話中の話者の行動の反映である.

ファーストステップ
コンテキストの洞察としてアクションアイテムにアクセスする最初のステップは、サインアップすることです.アカウントの登録を行う.両方ともつかむappId あなたのappSecret . あなたの両方を受け取るx-api-key .
あなたがあなたのJSONウェブトークンにサインしたいならばappId 一緒にappSecret インcURL 端末で実行されるコマンドは、コードスニペットです.
curl -k -X POST "https://api.symbl.ai/oauth2/token:generate" \
     -H "accept: application/json" \
     -H "Content-Type: application/json" \
     -d "{ \"type\": \"application\", \"appId\": \"<appId>\", \"appSecret\": \"<appSecret>\"}"
あなたがJWTSに署名するために開発者プラットホームに認証したいならば、更なる利点はSymblです.AIのパブリックワークスペースは、ほとんどの実験開発者APIのための“Labs”と呼ばれるセクションを含むAPIのほとんどすべてを含んでいます.

セカンドステップ
番目のステップは、その上でsを理解することです.確認するには、次の各項目のループを参照してください.これらの概念を確認したくない場合は、次のコピーしたコードをコンソールに直接ペーストします.
/**
 * The JWT token you get after authenticating with our API.
 * Check the Authentication section of the documentation for more details.
 */
const accessToken = ""
const uniqueMeetingId = btoa("[email protected]")
const symblEndpoint = `wss://api.symbl.ai/v1/realtime/insights/${uniqueMeetingId}?access_token=${accessToken}`;

const ws = new WebSocket(symblEndpoint);

// Fired when a message is received from the WebSocket server
ws.onmessage = (event) => {
  // You can find the conversationId in event.message.data.conversationId;
  const data = JSON.parse(event.data);
  if (data.type === 'message' && data.message.hasOwnProperty('data')) {
    console.log('conversationId', data.message.data.conversationId);
  }
  if (data.type === 'message_response') {
    for (let message of data.messages) {
      console.log('Transcript (more accurate): ', message.payload.content);
    }
  }
  if (data.type === 'message' && data.message.hasOwnProperty('punctuated')) {
    console.log('Live transcript (less accurate): ', data.message.punctuated.transcript)
  }
  console.log(`Response type: ${data.type}. Object: `, data);
};

// Fired when the WebSocket closes unexpectedly due to an error or lost connetion
ws.onerror  = (err) => {
  console.error(err);
};

// Fired when the WebSocket connection has been closed
ws.onclose = (event) => {
  console.info('Connection to websocket closed');
};

// Fired when the connection succeeds.
ws.onopen = (event) => {
  ws.send(JSON.stringify({
    type: 'start_request',
    meetingTitle: 'Websockets How-to', // Conversation name
    insightTypes: ['question', 'action_item'], // Will enable insight generation
    config: {
      confidenceThreshold: 0.5,
      languageCode: 'en-US',
      speechRecognition: {
        encoding: 'LINEAR16',
        sampleRateHertz: 44100,
      }
    },
    speaker: {
      userId: '[email protected]',
      name: 'Example Sample',
    }
  }));
};

const stream = await navigator.mediaDevices.getUserMedia({ audio: true, video: false });

/**
 * The callback function which fires after a user gives the browser permission to use
 * the computer's microphone. Starts a recording session which sends the audio stream to
 * the WebSocket endpoint for processing.
 */
const handleSuccess = (stream) => {
  const AudioContext = window.AudioContext;
  const context = new AudioContext();
  const source = context.createMediaStreamSource(stream);
  const processor = context.createScriptProcessor(1024, 1, 1);
  const gainNode = context.createGain();
  source.connect(gainNode);
  gainNode.connect(processor);
  processor.connect(context.destination);
  processor.onaudioprocess = (e) => {
    // convert to 16-bit payload
    const inputData = e.inputBuffer.getChannelData(0) || new Float32Array(this.bufferSize);
    const targetBuffer = new Int16Array(inputData.length);
    for (let index = inputData.length; index > 0; index--) {
        targetBuffer[index] = 32767 * Math.min(1, inputData[index]);
    }
    // Send audio stream to websocket.
    if (ws.readyState === WebSocket.OPEN) {
      ws.send(targetBuffer.buffer);
    }
  };
};


handleSuccess(stream);

第三段階
番目のステップは、あなたのブラウザのウェブソケットです.Chromeのインスタンスを開きます.コンソールを開きます.コピーしたコードをコンソールに直接ペーストします.Enterを押すと、あなたのWebSocketのメッセージが積み上げ始める.

フォースステップ
ブラウザで実行した後、リアルタイムで自動音声認識から' sの転写を受け取る.しかし、開発者としては、文脈上の洞察に単に自動音声認識を超えて拡張することができます.ブラウザで実行するコードでは、リアルタイムでコンテキストの洞察をキャプチャするには、WebSocketのイベントリスナーを構成します.
イベントリスナーに移動するws.onmessage . イベントリスナーの中でws.onmessage メソッドを使用すると、送信されたり、WebSocketによって受信されたイベントなどのイベントを追跡する機能を提供します.イベントリスナーでは、WebSocketプロトコルの次の生データのストリームがあります.
 if (data.type === 'topic_response') {
    for (let topic of data.topics) {
      console.log('Topic detected: ', topic.phrases)
    }
  }
  if (data.type === 'insight_response') {
    for (let insight of data.insights) {
      console.log('Insight detected: ', insight.payload.content);
       if (insight.type === "action_item" ) {
          console.log("Insight detected is an Action Item!!!")
      }
    }
  }
新しいログをWebSocketのws.onmessage メソッドは以下の通りです.
/**
 * The JWT token you get after authenticating with our API.
 * Check the Authentication section of the documentation for more details.
 */
const accessToken = ""
const uniqueMeetingId = btoa("[email protected]")
const symblEndpoint = `wss://api.symbl.ai/v1/realtime/insights/${uniqueMeetingId}?access_token=${accessToken}`;

const ws = new WebSocket(symblEndpoint);

// Fired when a message is received from the WebSocket server
ws.onmessage = (event) => {
  // You can find the conversationId in event.message.data.conversationId;
  const data = JSON.parse(event.data);
  if (data.type === 'message' && data.message.hasOwnProperty('data')) {
    console.log('conversationId', data.message.data.conversationId);
  }
  if (data.type === 'message_response') {
    for (let message of data.messages) {
      console.log('Transcript (more accurate): ', message.payload.content);
    }
  }
if (data.type === 'topic_response') {
    for (let topic of data.topics) {
      console.log('Topic detected: ', topic.phrases)
    }
  }
  if (data.type === 'insight_response') {
    for (let insight of data.insights) {
      console.log('Insight detected: ', insight.payload.content);
       if (insight.type === "action_item" ) {
          console.log("Insight detected is an Action Item!!!")
      }
    }
  }
  if (data.type === 'message' && data.message.hasOwnProperty('punctuated')) {
    console.log('Live transcript (less accurate): ', data.message.punctuated.transcript)
  }
  console.log(`Response type: ${data.type}. Object: `, data);
};

// Fired when the WebSocket closes unexpectedly due to an error or lost connetion
ws.onerror  = (err) => {
  console.error(err);
};

// Fired when the WebSocket connection has been closed
ws.onclose = (event) => {
  console.info('Connection to websocket closed');
};

// Fired when the connection succeeds.
ws.onopen = (event) => {
  ws.send(JSON.stringify({
    type: 'start_request',
    meetingTitle: 'Websockets How-to', // Conversation name
    insightTypes: ['question', 'action_item'], // Will enable insight generation
    config: {
      confidenceThreshold: 0.5,
      languageCode: 'en-US',
      speechRecognition: {
        encoding: 'LINEAR16',
        sampleRateHertz: 44100,
      }
    },
    speaker: {
      userId: '[email protected]',
      name: 'Example Sample',
    }
  }));
};

const stream = await navigator.mediaDevices.getUserMedia({ audio: true, video: false });

/**
 * The callback function which fires after a user gives the browser permission to use
 * the computer's microphone. Starts a recording session which sends the audio stream to
 * the WebSocket endpoint for processing.
 */
const handleSuccess = (stream) => {
  const AudioContext = window.AudioContext;
  const context = new AudioContext();
  const source = context.createMediaStreamSource(stream);
  const processor = context.createScriptProcessor(1024, 1, 1);
  const gainNode = context.createGain();
  source.connect(gainNode);
  gainNode.connect(processor);
  processor.connect(context.destination);
  processor.onaudioprocess = (e) => {
    // convert to 16-bit payload
    const inputData = e.inputBuffer.getChannelData(0) || new Float32Array(this.bufferSize);
    const targetBuffer = new Int16Array(inputData.length);
    for (let index = inputData.length; index > 0; index--) {
        targetBuffer[index] = 32767 * Math.min(1, inputData[index]);
    }
    // Send audio stream to websocket.
    if (ws.readyState === WebSocket.OPEN) {
      ws.send(targetBuffer.buffer);
    }
  };
};


handleSuccess(stream);

次は何ですか.
あなたの構成にリアルタイム感情分析のためのリスナーを追加する場合は、能力をリアルタイムでメッセージから感情に極性スコアを聞くに提供します.Aは第一歩です.その後、次の手順を作成する方法です.あなたがこれらのブログをスキップしたいならば、あなたが指示でレポを見つけることができるところから、コードをダウンロードするために自由に感じてください.
センチメント解析は、Symblからの会話データを処理する唯一の方法です.AIの有効音声.symblを扱うもう一つの方法.AIの有効な音声はAPIを接続することです.特にaction_item sは、それらの検出された洞察がリアルタイムで外部のサードパーティのsaasダッシュボードに現れるように、開発者がリアルタイムで検出された洞察から自動化されたワークフローをつくるのを可能にします.
例えば、IRAを通してリアルタイムでJIRAチケットを作成してくださいPOST Aの洞察力の後に要求するaction_item 生の会話で発見される.を返します.Ai、あなたは開発者として、接続、変換、またはまだ実現されていないか、現実に実装されていない方法で会話を可視化するために供給されます.AIのコア製品は、単に自動音声認識を超えて拡張します.

参加コミュニティ
私たちに電子メールを介して到達する開発者を招待 [email protected] , 我々のチャンネルに加わって、我々のフォークに参加してくださいgit clone 我々のreposで.