Giter Club home page Giter Club logo

nlptest's Introduction

NlpTest

Test Stanford CoreNLP on AWS Lambda.

Purpose

Using Stanford CoreNLP system [1], please develop a simple AWS Lambda [2] function that accepts a paragraph of text in English and returns: 1) overall “sentiment” of the paragraph 2) named entities [3] recognised by the standard model. Please provide a complete repository of code with instructions for deploying the function.

[1] https://stanfordnlp.github.io/CoreNLP [2] https://aws.amazon.com/lambda/ [3] https://en.wikipedia.org/wiki/Named-entity_recognition

Deployment 1 - Build Lambda Deployment Package on EC2

I have prepared a Lambda Deployment Package for your convenience. The Lambda package (jar) is available at: http://second.world.stockvirtual.info/lambda-java-example-1.0-SNAPSHOT.jar This package is ready to be deployed to Lambda.

Follow the following steps to start from the scratch:

  1. create an ubuntu EC2 instance and make sure jdk and maven installed correctly.

  2. create a project folder, check out this repository.

  • the original CoreNLP model jar is 360 MB which is too big for Lambda. I removed some unnecessary models and installed the customized jar file to the local maven repository. The customized jar file can be found in the Lambda deployment package.
  1. use the command "mvn package" to buildthe the jar file which should be located under the 'target' folder.

Deployment 2 - setup Lambda function

  1. upload the package (jar file) to a S3 bucket. Because of the package size is larger than 50MB, so it needs to be uploaded to S3 before imported to Lambda.

  2. create a Lambda function, set runtime to Java 8 and handling function to 'NlpTest::handleRequest'.

  3. import the jar file from S3.

  4. create an environment variable 'INPUT' with a paragraph of text.

  5. Click on 'Save' and then click on 'Test'. The Lambda function reads in the content of the INPUT environment variable and performs ner and sentiment. The result should look like this: "Detected entity: She(PERSON) Tom(PERSON) UK(COUNTRY) George(PERSON) King(TITLE) The sentiment of the sentences are: Negative, Very positive, Negative, Neutral, Positive, Neutral, Negative, , and the overall sentiment rating is 1".

nlptest's People

Contributors

minway avatar

Stargazers

Yuriy Ridkous avatar

Watchers

 avatar

nlptest's Issues

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.