Skip to content

benrouba/Emotional-Sentiment-Analysis-of-Social-Media-content-for-Mental-Health-Safety

Repository files navigation

Emotional Sentiment Analysis of Twitter content using IBM API

In this project, we are proposing an approach to filter Twitter content by categorizing it to emotional positive and negative content.

This is an Angular project, so you have to make sure that you have nodejs and angular installed

IBM API Configuration

Prerequisites

  1. Sign up for an IBM Cloud account.
  2. Download the IBM Cloud CLI.
  3. Create an instance of the Natural Language Understanding service and get your credentials:
    • Go to the Natural Language Understanding page in the IBM Cloud Catalog.
    • Log in to your IBM Cloud account.
    • Click Create.
    • Click Show to view the service credentials.
    • Copy the apikey value.
    • Copy the url value.IBM
  4. Download the Natural Language Understanding project for nodejs from github.

Installation

  1. In the application folder, copy the .env.example file and create a file called .env

    cp .env.example .env
    
  2. Open the .env file and add the service credentials that you obtained in the previous step.

    Example .env file that configures the apikey and url for a Natural Language Understanding service instance hosted in the US East region:

    NATURAL_LANGUAGE_UNDERSTANDING_IAM_APIKEY=X4rbi8vwZmKpXfowaS3GAsA7vdy17Qh7km5D6EzKLHL2
    NATURAL_LANGUAGE_UNDERSTANDING_URL=https://gateway-wdc.watsonplatform.net/natural-language-understanding/api
    

Running locally

  1. Install the dependencies

    npm install
    
  2. Run the application

    npm start
    

Hence you are running the Natural Language Understanding API locally

Twitter API configuration

Prerequisites

  1. Get access to the Twitter API: Sign up for a developer account.
  2. Create a Project and an associated developer App.
  3. Save your credentials: API Key and Secret,User Access Tokens,App Access Token
  4. You can find more about Twitter API in the official documenation.

Installation

  1. In the application folder go to environment.ts file,
  2. Replace the credentials by your own values

Running the app

  1. install the dependencies by running
  npm install
  1. Run the application

    ng serve --port 'any_port_rather_than_3000' --host 'your_host' --o
    

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published