Code Monkey home page Code Monkey logo

languagecrunch's Introduction

LanguageCrunch NLP Service docker image

Docker image: https://hub.docker.com/r/artpar/languagecrunch/

Quickstart

Pull and run the Docker image, listening on port 8080:

$ docker run -it -p 8080:8080 artpar/languagecrunch

Example API call:

$ curl http://localhost:8080/nlp/parse?`echo -n "The new twitter is so weird. Seriously. Why is there a new twitter? What was wrong with the old one? Fix it now." | python -c "import urllib, sys; print(urllib.urlencode({'sentence': sys.stdin.read()}))"`

Endpoints

Sentence parse [Spacy]

GET http://localhost:8080/nlp/parse?sentence=<URL-encoded sentences>

Word lookup [Wordnet]

GET http://localhost:8080/nlp/word?word=ask&pos=v

Coreference resolution [neuralcoref]

GET http://localhost:8080/nlp/coref?sentence=<URL-encoded sentences>

Model Details

Sentiment

sentence: The new twitter is so weird. Seriously. Why is there a new twitter? What was wrong with the old one? Fix it now.

{
  "relations": [],
  "sentences": [
    {
      "sentence": "The new twitter is so weird. ",
      "sentence_type": "assertive",
      "sentiment": {
        "polarity": -0.18181818181818182,
        "subjectivity": 0.7272727272727273
      },
      "root": {
        "text": "is ",
        "orth": 2
      },
      "pos": [
        {
          "text": "The new twitter",
          "lemma": "the",
          "pos": "DET",
          "tag": "DT",
          "dep": "nsubj",
          .
          .
          .

Entity extraction

  • PERSON
  • NORP
  • FACILITY
  • ORG
  • GPE
  • LOC
  • PRODUCT
  • EVENT
  • WORK_OF_ART
  • LAW
  • LANGUAGE
  • DATE
  • TIME
  • PERCENT
  • MONEY
  • QUANTITY
  • ORDINAL
  • CARDINAL

Eg: Bill Gates, the founder of Microsoft, hosted a party last night

  "entities": [
    {
      "text": "Bill Gates",
      "label": "PERSON"
    },
    {
      "text": "Microsoft",
      "label": "ORG"
    },
    {
      "text": "last night",
      "label": "TIME"
    }
  ]
}

Sentence type detection

  • assertive
  • interrogative
  • exclamatory
  • negative

Relation extraction

Eg: Bill Gates, the founder of Microsoft, hosted a party last night

  "relations": [
    {
      "subject": "the founder",
      "object": "Microsoft",
      "relation": "ORG"
    }
  ],

Eg: Apple is looking at buying U.K. startup for $1 billion

 {
   subject: "N/A",
   object: "U.K. startup",
   relation: "GPE"
 },
 {
   subject: "buying",
   object: "$1 billion",
   relation: "MONEY"
 }
],

Word look up

  • Category of word

    • Hypernyms - colour is a hypernym of red.
  • Specific words of a category

    • Holonyms - red is a holonym of color
  • Synonyms to match

  • Examples

  • Word frames ( how the word is used )

  • Coreference resolution

  • Pronouns/references to nouns

Eg: startle, verb

  "results": [
    {
      "definition": "to stimulate to action",
      "examples": [
        "..startled him awake",
        "galvanized into action"
      ],
      "lemma_names": [
        "startle",
        "galvanize",
        "galvanise"
      ],
      "hypernyms": [
        {
          "definition": "surprise greatly; knock someone's socks off",
          "examples": [
            "I was floored when I heard that I was promoted"
          ],
          "lemma_names": [
            "shock",
            "floor",
            "ball_over",
            "blow_out_of_the_water",
            "take_aback"
          ]
        }
      ],
      "lemmas": [
        {
          "frame_strings": [
            "Somebody startle somebody",
            "Something startle somebody",
            "Somebody startle somebody into V-ing something"
          ],

Contributors

List of contributors

languagecrunch's People

Contributors

artpar avatar mmautner avatar neolithera avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

languagecrunch's Issues

cloudbuild docker stops on 'ModuleNotFoundError: No module named 'neuralcoref.neuralcoref'

Running it on a synology nas from the docker app:

ModuleNotFoundError: No module named 'neuralcoref.neuralcoref'
Traceback (most recent call last):
File "/app/main.py", line 18, in
from neuralcoref import Coref
File "/app/neuralcoref/init.py", line 14, in
from .neuralcoref import NeuralCoref

This version also gives me the already reported error.

Let me know if you need more

"Killed" when docker run -it -p 5000:5000 artpar/languagecrunch

I'm trying to get the languagecrunch docker image to run, but I'm getting the following error

$ docker run -it -p 5000:5000 artpar/languagecrunch
Package directory: /app/neuralcoref
INFO:root:Loading spacy model
Killed

Any ideas on what I may be doing wrong? I'm on Windows 10, and have gotten the same problem with languagecrunch-cloudbuild

Installation fails due to conflicting cymem version

Hi, users are unable to run languagecrunch due to dependency conflict with cymem package.
As shown in the following full dependency graph of languagecrunch, languagecrunch requires cymem==1.31.2,while thinc requires cymem>=2.0.2,<2.1.0.

According to pip’s “first found wins” installation strategy, cymem==1.31.2 is the actually installed version. However, cymem==1.31.2 does not satisfy cymem>=2.0.2,<2.1.0.

Dependency tree

languagecrunch-master
| +-bottle(version range:*)
| +-certifi(version range:==2017.4.17)
| +-chardet(version range:==3.0.4)
| +-cymem(version range:==1.31.2)
| +-cytoolz(version range:==0.8.2)
| | +-toolz(version range:>=0.8.0)
| +-dill(version range:==0.2.7)
| +-falcon(version range:==1.2.0)
| | +-python-mimeparse(version range:>=1.5.2)
| | +-six(version range:>=1.4.0)
| +-ftfy(version range:==4.4.3)
| | +-html5lib(version range:*)
| | | +-setuptools(version range:>=18.5)
| | | +-six(version range:*)
| | | +-webencodings(version range:*)
| | +-wcwidth(version range:*)
| +-html5lib(version range:==0.999999999)
| | +-setuptools(version range:>=18.5)
| | +-six(version range:*)
| | +-webencodings(version range:*)
| +-idna(version range:==2.5)
| +-keras(version range:==2.0.9)
| | +-numpy(version range:>=1.9.1)
| | +-pyyaml(version range:*)
| | +-scipy(version range:>=0.14)
| | +-six(version range:>=1.9.0)
| +-murmurhash(version range:*)
| +-nltk(version range:*)
| +-numpy(version range:*)
| +-pathlib(version range:==1.0.1)
| +-plac(version range:==0.9.6)
| +-preshed(version range:==1.0.0)
| | +-cymem(version range:>=1.30,<1.32.0)
| +-python-mimeparse(version range:==1.6.0)
| +-regex(version range:==2017.4.5)
| +-requests(version range:==2.20.0)
| | +-certifi(version range:>=2017.4.17)
| | +-chardet(version range:<3.1.0,>=3.0.2)
| | +-idna(version range:>=2.5,<2.8)
| | +-urllib3(version range:>=1.21.1,<1.25)
| +-simplejson(version range:*)
| +-six(version range:==1.10.0)
| +-spacy(version range:*)
| +-sympy(version range:*)
| +-termcolor(version range:==1.1.0)
| +-textblob(version range:*)
| | +-nltk(version range:>=3.1)
| +-thinc(version range:*)
| | +-blis(version range:>=0.2.1,<0.3.0)
| | +-cymem(version range:<2.1.0,>=2.0.2)
| | +-murmurhash(version range:<1.1.0,>=0.28.0)
| | +-numpy(version range:>=1.7.0)
| | +-pathlib(version range:==1.0.1)
| | +-plac(version range:>=0.9.6,<1.0.0)
| | +-preshed(version range:>=1.0.1,<2.1.0)
| | | +-cymem(version range:>=1.30,<1.32.0)
| | +-srsly(version range:>=0.0.6,<1.1.0)
| | | +-pathlib(version range:==1.0.1)
| | +-tqdm(version range:>=4.10.0,<5.0.0)
| | +-wasabi(version range:<1.1.0,>=0.0.9)
| +-toolz(version range:==0.8.2)
| +-tqdm(version range:==4.14.0)
| +-ujson(version range:==1.35)
| +-urllib3(version range:>=1.23)
| +-wcwidth(version range:==0.1.7)
| +-webencodings(version range:==0.5.1)
| +-wrapt(version range:==1.10.10)

Thanks for your help.
Best,
Neolith

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.