GithubHelp home page GithubHelp logo

ibmsentr's Introduction

IBMsentR

Simple R functions for analysing sentiment with IBM Watson

Overview

Like other packages we've created, we're choosing simplicity over wide functionality. There are two functions at present:

  1. ibm_sent Simply returns sentiment back from a text string. Creds needed are simple username and password held in the local R environment.

  2. ibm_tone Detects tones within the submitted string / sentence. The number of tones can vary depending upon the sentence / string submitted.

Pre-requisites

You'll need an IBM Watson account with a username and password for both sentiment and tone - they will be different.

Usage

You use the function to send text to IBM Watson. A simple one-row tibble (data frame) will be returned with the results for both. Depending on the length of the sentence, more than one text keyword value may be returned for sentiment. Each pair of values (text keyword & relevance score) is assigned into new numbered columns. Thus the number of columns may be irregular when binding rows from each result.

This is also the case for tone - many tones may be detected - the returned data frame will contain all as numbered columns.

Both functions are in the format ibm_function(username, password, text_to_be_tested).


ibmsentr's People

Contributors

paulnewnes avatar

Stargazers

Martin Lukac avatar Cogitarian avatar Jason Kowal avatar  avatar

Watchers

James Cloos avatar  avatar Jason Kowal avatar

Forkers

mblukac rerabelo

ibmsentr's Issues

Unclear error with imb_tone function

Hello All,

I am trying to use a simple code snippet to test the imb_tone function. Here is the code:

library(IBMsentR)

username ="my account"
password = "my password"

text_to_be_tested = "Today was a good day"
ibm_tone(username, password, text_to_be_tested)

When I execute the code I get the following error:

-> GET /tone-analyzer/api/v3/tone?version=2019-10-12&text=Today%20was%20a%20good%20day&sentences=true&tones=emotion%2Clanguage%2Csocial HTTP/1.1
-> Host: watson-api-explorer.mybluemix.net
-> Authorization: Basic cndhXXXXXXXXXXXXXXXXXXXXXXXZXN0c2lkZSM0NA==
-> User-Agent: libcurl/7.56.1 r-curl/3.1 httr/1.3.1
-> Accept-Encoding: gzip, deflate
-> Accept: application/json
-> 
<- HTTP/1.1 404 Not Found
<- X-Backside-Transport: FAIL FAIL
<- Connection: Keep-Alive
<- Transfer-Encoding: chunked
<- Content-Type: text/html; charset=utf-8
<- Date: Sat, 12 Oct 2019 21:55:09 GMT
<- Server: nginx
<- X-Global-Transaction-ID: 0d2XXXXXXXXXXXXXXa5d
<- 
Error: `tones` = 1 must be a symbol or a string, not a double vector

Did something change or am I doing something wrong? Any input would be greatly appreciated.

Regards,

Ryan

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.