GithubHelp home page GithubHelp logo

serverless-simple-nlp-demo's Introduction

serverless-simple-nlp-demo

This is a project intended to demostrate that Natural Language Parsing is not an impossible task to be left only to Google, Facebook, Amazon and the link. Given a small enough subject area/domain, it is possible to achieve decent parse results.

This demo uses the context of house hunting as an example for some simple Natural Language Processing, running on Amazon's Lambda service.

Accompanying series of blog posts for this code can be found at link coming soon!

Sample query : "show me apartments for sale in Sydney next Saturday"

Sample output :

{
   processedInputString: "show me apartments for sale in sydney next saturday",
   entities: [
      {
         intent: [
            {
               indexBegin: -1,
               indexEnd: -1,
               entityType: 3,
               parsedValue: "buy",
               probability: 0.01269635627530364
            },
            {
               indexBegin: -1,
               indexEnd: -1,
               entityType: 3,
               parsedValue: "rent",
               probability: 0.0006334841628959268
            }
         ]
      },
      {
         suburb: [
            {
               indexBegin: 31,
               indexEnd: 37,
               entityType: 2,
               parsedValue: "sydney",
               probability: 1
            }
         ]
      },
      {
         date: [
            {
               indexBegin: 38,
               indexEnd: 51,
               entityType: 1,
               parsedValue: "2016-11-19T12:00:00.000Z",
               probability: 1
            }
         ]
      },
      {
         propertyType: [
            {
               indexBegin: -1,
               indexEnd: -1,
               entityType: 4,
               parsedValue: "apartment",
               probability: 0.05749486652977411
            },
            {
               indexBegin: -1,
               indexEnd: -1,
               entityType: 4,
               parsedValue: "house",
               probability: 0.0020533880903490765
            },
            {
               indexBegin: -1,
               indexEnd: -1,
               entityType: 4,
               parsedValue: "land",
               probability: 0.002053388090349075
            }
         ]
      },
      {
         sentiment: [
            {
               indexBegin: -1,
               indexEnd: -1,
               entityType: 5,
               parsedValue: 0,
               probability: 0
            }
         ]
      }
   ]
}

Live demos

Sample Page with Text Input

This page is a simple page that takes input from a text field and calls the GET endpoint of this sample code and returns the Natural Language Parsed results

Link

Sample Page with Speech to Text as input

This page is a simple page that takes input from speech, converts it to text, then calls the GET endpoint of this sample code and returns the Natural Language Parsed results

Link

Deploying the demo on your own AWS account

This project is meant to be run and deployed on AWS Lambda, using the Serverless framework. Tested on serverless v0.5.6 and node v.5.12.0 Once checked out, run the following commands

npm install -g [email protected]
npm install
npm test
serverless project init
serverless dash deploy

serverless-simple-nlp-demo's People

Contributors

kennychua avatar

Stargazers

Jon Paul Uritis avatar R. avatar Vitaly Blinovskov avatar Leo Kyrpychenko avatar Rami avatar Divij Mehra avatar  avatar Gary Lo avatar Sourabh avatar

Watchers

James Cloos avatar  avatar

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.