Skip to content

nishnash54/SentimentAnalysis

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sentiment Analysis Tutorial

This tutorial enables you to add Sentiment Analysis to Agora's 1-to-1 Video call on Web using the sample app to give you an in-depth view on how to develop with the Agora API

  • HTML5 Canvas
  • Tensorflow
  • Web sockets
  • Face detection
  • Emotion classification

Prerequisites

  • Agora.io Developer Account
  • Python and web sockets

Project layout

	|
	|-Scripts
		|-AgoraRTCSDK-2.4.0.js
		|-script.js
		|-socket.io.js
		|--
	|-Server
		|-models
			|-face_box.xml
			|-model.hdf5
			|--
		|-utils
			|-data_augmentation.py
			|-datasets.py
			|-grad_cam.py
			|-inference.py
			|-preprocessing.py
			|-visualizer.py
			|--
		|-emotions.py
		|-README.md
		|-requirements.txt
		|-server.py
		|--
	|-styles
		|-style.css
		|--
	|-index.html
	|-LICENSE.md
	|-README.md
	|--

Quick Start

This section shows you how to prepare, build, and run the sample application.

  1. Create a developer account at agora.io. Once you finish the signup process, you will be redirected to the Dashboard.
  2. Navigate in the Dashboard tree on the left to Projects > Project List.
  3. Copy the App ID that you obtained from the Dashboard into a text file. You will need this to use the Agora platform.

Run the Sample Sentiment Analysis model

  1. Open the Server directory and install the Python requirements through the terminal command.
    pip install -r requirements.txt
  1. After install the requirements, run the server using
    python server.py
  1. Keep the server running.

Update and Run the Sample Application

  1. Open the script.js file under the scripts directory in a code editor.

  2. Under Client Setup replace the APP_ID with the App Id obtained from the dashboard.

    Before

    client.init("APP_ID",() => console.log("...") ,handleFail);

    After

    client.init("76db51...e40d15a3",() => console.log("...") ,handleFail);
  3. Open the index.html file in a web browser and allow access to Camera and Microphone for Audio and Video transmission.

  4. For a demo, open the same file in an new tab, this creates the remote stream that is displayed on the Canvas and run through the sentiment analysis model.

Resources

  • Complete API documentation is available at the Document Center.
  • You can file bugs about this sample here.

License

This software is under the MIT License (MIT). View the license.

Contributors

Nishant Rodrigues

Samyak Jain

Vineeth S