Giter VIP home page Giter VIP logo

stanford-nlp-sentiment-api's Introduction

A server wrapper around the Stanford CoreNLP sentiment engine.

Config

Port can be set in application.properties, by default it is set to 80, this may cause problems on some machines.

Deployment

Deployed using maven can be run with the command:

mvn spring-boot:run

Features

Server features one endpoint: /sentiment. This endpoint will respond to multiple GET parameters of lines. For example:

GET /sentiment?lines=The+movie+was+really+great.&lines=The+movie+was+really+
terrible&lines=The+movie+was+really+great.+The+movie+was+really+terrible HTTP/1.1

Responds:

{
    0: {
        sentiment: 0.8018029430617934,
        line: "The movie was really great."
    },
    1: {
        sentiment: 0.22636708981379178,
        line: "The movie was really terrible"
    },
    2: {
        sentiment: 0.5140850164377926,
        line: "The movie was really great. The movie was really terrible"
    }
}

Note the averaging of the third sentiment, this should be avoided but is available if required.

stanford-nlp-sentiment-api's People

Contributors

conorbrady avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

stanford-nlp-sentiment-api's Issues

great idea you had

Hi Conor,

Thanks for the excellent work you did building your API wrapper to the Stanford sentiment analysis code. I did try and build the code today, but got the following error in Maven (3.3.3) and jdk1.8.0_66 when executing mvn spring-boot:run.

Apologies if I am doing something wrong, but just wondered if the information below might help explain what might be going wrong.

Thanks again for the really interesting idea you had,

Paul

------------------------------------------- part of error report -------------------------------------------------

   at org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:1120)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:996)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:942)
    at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:533)
    ... 72 more

Caused by: java.lang.IllegalStateException: Cannot find template location: classpath:/templates/ (please add some templates or check your Thymeleaf configuration)
at org.springframework.util.Assert.state(Assert.java:385)
at org.springframework.boot.autoconfigure.thymeleaf.ThymeleafAutoConfiguration$DefaultTemplateResolverConfiguration.checkTemplateLocationExists(ThymeleafAutoConfiguration.java:82)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleElement.invoke(InitDestroyAnnotationBeanPostProcessor.java:349)
at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleMetadata.invokeInitMethods(InitDestroyAnnotationBeanPostProcessor.java:300)
at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.postProcessBeforeInitialization(InitDestroyAnnotationBeanPostProcessor.java:133)
... 93 more

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.