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
- Sign up for an IBM Cloud account.
- Download the IBM Cloud CLI.
- 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
- Download the Natural Language Understanding project for nodejs from github.
-
In the application folder, copy the .env.example file and create a file called .env
cp .env.example .env
-
Open the .env file and add the service credentials that you obtained in the previous step.
Example .env file that configures the
apikey
andurl
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
-
Install the dependencies
npm install
-
Run the application
npm start
Hence you are running the Natural Language Understanding API locally
- Get access to the Twitter API: Sign up for a developer account.
- Create a Project and an associated developer App.
- Save your credentials: API Key and Secret,User Access Tokens,App Access Token
- You can find more about Twitter API in the official documenation.
- In the application folder go to environment.ts file,
- Replace the credentials by your own values
- install the dependencies by running
npm install
-
Run the application
ng serve --port 'any_port_rather_than_3000' --host 'your_host' --o