Git Product home page Git Product logo

spacy-nlp's Introduction

spacy-nlp npm version CircleCI Code Climate Test Coverage

Expose Spacy nlp text parsing to Nodejs (and other languages) via socketIO

Installation

# install spacy in python3
python3 -m pip install -U socketIO-client-nexus
python3 -m pip install -U spacy==2.1.3
python3 -m spacy download en_core_web_md

# install this npm package
npm i --save spacy-nlp

Usage

const spacyNLP = require("spacy-nlp");
// default port 6466
// start the server with the python client that exposes spacyIO (or use an existing socketIO server at IOPORT)
var serverPromise = spacyNLP.server({ port: process.env.IOPORT });
// Loading spacy may take up to 15s

Note that python3 is preferred. If you use python2, at each run set the env var USE_PY2=true.

You'll see log like:

[Sun Oct 09 2016 16:53:33 GMT-0400 (EDT)] INFO Starting poly-socketio server on port: 6466, expecting 1 IO clients
[Sun Oct 09 2016 16:53:33 GMT-0400 (EDT)] INFO Starting socketIO client for python3 at 6466
[Sun Oct 09 2016 16:53:44 GMT-0400 (EDT)] DEBUG cgkb-py mXjDqupv852zUeMPAAAA joined, 0 remains
[Sun Oct 09 2016 16:53:44 GMT-0400 (EDT)] INFO All 1 IO clients have joined

Since it uses poly-socketio, there'll be one IO server, and one global.client(internal to this module) in the same process, no matter how many times poly-socketio is called. This resolves conflicts for cross-project usage.

E.g. AIVA uses poly-socketio to start a server for its internal cross-language communication, and uses spacy-nlp too. spacy-nlp will automatically use the IO server and the global.client from AIVA.

Methods

Syntax Parsing

Once it is ready, i.e. you can use the nodejs client nlp to parse texts:

const spacyNLP = require("spacy-nlp");
const nlp = spacyNLP.nlp;

// Note you can pass multiple sentences concat in one string.
nlp.parse("Bob Brought the pizza to Alice.").then(output => {
  console.log(output);
  console.log(JSON.stringify(output[0].parse_tree, null, 2));
});

// Store output into variable
const result = await nlp.parse("Bob Brought the pizza to Alice.");

And the output is the syntax parse tree with POS tagging. For the parse_tree, NE means Named Entity for NER; arc of an object is incident on it. An arc points from head word to modifier word. See the explanation on Tensorflow/syntaxnet.

[ { text: 'Bob Brought the pizza to Alice.',
    len: 7,
    tokens: [ 'Bob', 'Brought', 'the', 'pizza', 'to', 'Alice', '.' ],
    noun_phrases: [ 'Bob', 'the pizza', 'Alice' ],
    parse_tree:
     [ { word: 'Brought',
         lemma: 'bring',
         NE: '',
         POS_fine: 'VBD',
         POS_coarse: 'VERB',
         arc: 'ROOT',
         modifiers:
          [ { word: 'Bob',
              lemma: 'Bob',
              NE: 'PERSON',
              POS_fine: 'NNP',
              POS_coarse: 'PROPN',
              arc: 'nsubj',
              modifiers: [] },
            { word: 'pizza',
              lemma: 'pizza',
              NE: '',
              POS_fine: 'NN',
              POS_coarse: 'NOUN',
              arc: 'dobj',
              modifiers:
               [ { word: 'the',
                   lemma: 'the',
                   NE: '',
                   POS_fine: 'DT',
                   POS_coarse: 'DET',
                   arc: 'det',
                   modifiers: [] } ] },
            { word: 'to',
              lemma: 'to',
              NE: '',
              POS_fine: 'IN',
              POS_coarse: 'ADP',
              arc: 'prep',
              modifiers:
               [ { word: 'Alice',
                   lemma: 'Alice',
                   NE: 'PERSON',
                   POS_fine: 'NNP',
                   POS_coarse: 'PROPN',
                   arc: 'pobj',
                   modifiers: [] } ] },
            { word: '.',
              lemma: '.',
              NE: '',
              POS_fine: '.',
              POS_coarse: 'PUNCT',
              arc: 'punct',
              modifiers: [] } ] } ],
    parse_list:
     [ { word: 'Bob',
         lemma: 'Bob',
         NE: 'PERSON',
         POS_fine: 'NNP',
         POS_coarse: 'PROPN' },
       { word: 'Brought',
         lemma: 'bring',
         NE: '',
         POS_fine: 'VBD',
         POS_coarse: 'VERB' },
       { word: 'the',
         lemma: 'the',
         NE: '',
         POS_fine: 'DT',
         POS_coarse: 'DET' },
       { word: 'pizza',
         lemma: 'pizza',
         NE: '',
         POS_fine: 'NN',
         POS_coarse: 'NOUN' },
       { word: 'to',
         lemma: 'to',
         NE: '',
         POS_fine: 'IN',
         POS_coarse: 'ADP' },
       { word: 'Alice',
         lemma: 'Alice',
         NE: 'PERSON',
         POS_fine: 'NNP',
         POS_coarse: 'PROPN' },
       { word: '.',
         lemma: '.',
         NE: '',
         POS_fine: '.',
         POS_coarse: 'PUNCT' } ] } ]

Noun Parsing

// Available options are count (returns the total count) and words (returns the parsed strings) You can specify one or both.
const options = ["count"];

// Note you can pass multiple sentences concat in one string.
nlp
  .parse_nouns(
    "On 22 June 1941, the European Axis powers launched an invasion of the Soviet Union, opening the largest land theatre of war in history, which trapped the Axis, most crucially the German Wehrmacht, into a war of attrition. World War II (often abbreviated to WWII or WW2), also known as the Second World War, was a global war that lasted from 1939 to 1945.",
    options
  )
  .then(output => {
    console.log(output);
  });

// Store output into variable
const result = await nlp.parse_nouns(
  "On 22 June 1941, the European Axis powers launched an invasion of the Soviet Union, opening the largest land theatre of war in history, which trapped the Axis, most crucially the German Wehrmacht, into a war of attrition. World War II (often abbreviated to WWII or WW2), also known as the Second World War, was a global war that lasted from 1939 to 1945.",
  options
);

// 19

Verb Parsing

// Available options are count (returns the total count) and words (returns the parsed strings) You can specify one or both.
const options = ["count"];

// Note you can pass multiple sentences concat in one string.
nlp
  .parse_verbs(
    "On 22 June 1941, the European Axis powers launched an invasion of the Soviet Union, opening the largest land theatre of war in history, which trapped the Axis, most crucially the German Wehrmacht, into a war of attrition. World War II (often abbreviated to WWII or WW2), also known as the Second World War, was a global war that lasted from 1939 to 1945.",
    options
  )
  .then(output => {
    console.log(output);
  });

// Store output into variable
const result = await nlp.parse_verbs(
  "On 22 June 1941, the European Axis powers launched an invasion of the Soviet Union, opening the largest land theatre of war in history, which trapped the Axis, most crucially the German Wehrmacht, into a war of attrition. World War II (often abbreviated to WWII or WW2), also known as the Second World War, was a global war that lasted from 1939 to 1945.",
  options
);

// 7

Adjective Parsing

// Available options are count (returns the total count) and words (returns the parsed strings) You can specify one or both.
const options = ["count"];

// Note you can pass multiple sentences concat in one string.
nlp
  .parse_adj(
    "On 22 June 1941, the European Axis powers launched an invasion of the Soviet Union, opening the largest land theatre of war in history, which trapped the Axis, most crucially the German Wehrmacht, into a war of attrition. World War II (often abbreviated to WWII or WW2), also known as the Second World War, was a global war that lasted from 1939 to 1945.",
    options
  )
  .then(output => {
    console.log(output);
  });

// Store output into variable
const result = await nlp.parse_adj(
  "On 22 June 1941, the European Axis powers launched an invasion of the Soviet Union, opening the largest land theatre of war in history, which trapped the Axis, most crucially the German Wehrmacht, into a war of attrition. World War II (often abbreviated to WWII or WW2), also known as the Second World War, was a global war that lasted from 1939 to 1945.",
  options
);

// 8

Named Entity Parsing

// Available options are count (returns the total count) and words (returns the parsed strings) You can specify one or both.
const options = ["count"];

// Note you can pass multiple sentences concat in one string.
nlp
  .parse_named_entities(
    "On 22 June 1941, the European Axis powers launched an invasion of the Soviet Union, opening the largest land theatre of war in history, which trapped the Axis, most crucially the German Wehrmacht, into a war of attrition. World War II (often abbreviated to WWII or WW2), also known as the Second World War, was a global war that lasted from 1939 to 1945.",
    options
  )
  .then(output => {
    console.log(output);
  });

// Store output into variable
const result = await nlp.parse_named_entities(
  "On 22 June 1941, the European Axis powers launched an invasion of the Soviet Union, opening the largest land theatre of war in history, which trapped the Axis, most crucially the German Wehrmacht, into a war of attrition. World War II (often abbreviated to WWII or WW2), also known as the Second World War, was a global war that lasted from 1939 to 1945.",
  options
);

// 8

Date Parsing

// Available options are count (returns the total count) and words (returns the parsed strings) You can specify one or both.
const options = ["words"];

// Note you can pass multiple sentences concat in one string.
nlp
  .parse_date(
    "On 22 June 1941, the European Axis powers launched an invasion of the Soviet Union, opening the largest land theatre of war in history, which trapped the Axis, most crucially the German Wehrmacht, into a war of attrition. World War II (often abbreviated to WWII or WW2), also known as the Second World War, was a global war that lasted from 1939 to 1945.",
    options
  )
  .then(output => {
    console.log(output);
  });

// Store output into variable
const result = await nlp.parse_date(
  "On 22 June 1941, the European Axis powers launched an invasion of the Soviet Union, opening the largest land theatre of war in history, which trapped the Axis, most crucially the German Wehrmacht, into a war of attrition. World War II (often abbreviated to WWII or WW2), also known as the Second World War, was a global war that lasted from 1939 to 1945.",
  options
);

// ['22 June 1941', 'from 1939 to 1945']

Time Parsing

// Available options are count (returns the total count) and words (returns the parsed strings) You can specify one or both.
const options = ["count"];

// Note you can pass multiple sentences concat in one string.
nlp
  .parse_time(
    "On 22 June 1941, the European Axis powers launched an invasion of the Soviet Union, opening the largest land theatre of war in history, which trapped the Axis, most crucially the German Wehrmacht, into a war of attrition. World War II (often abbreviated to WWII or WW2), also known as the Second World War, was a global war that lasted from 1939 to 1945.",
    options
  )
  .then(output => {
    console.log(output);
  });

// Store output into variable
const result = await nlp.parse_time(
  "On 22 June 1941, the European Axis powers launched an invasion of the Soviet Union, opening the largest land theatre of war in history, which trapped the Axis, most crucially the German Wehrmacht, into a war of attrition. World War II (often abbreviated to WWII or WW2), also known as the Second World War, was a global war that lasted from 1939 to 1945.",
  options
);

// 0

Helpers

The following helper functions are not asynchronous and will not return a promise.

Splitting Large Text

If you have very large text to process, it's best to split the text as Spacy has a max_length limit of 1,000,000 characters.

const text =
  "On 22 June 1941, the European Axis powers launched an invasion of the Soviet Union, opening the largest land theatre of war in history, which trapped the Axis, most crucially the German Wehrmacht, into a war of attrition. World War II (often abbreviated to WWII or WW2), also known as the Second World War, was a global war that lasted from 1939 to 1945.";

const textArray = nlp.split_text(text);

// ["On 22 June 1941, the European Axis powers launched an invasion of the Soviet Union, opening the largest land theatre of", "war in history, which trapped the Axis, most crucially the German Wehrmacht, into a war of attrition. World War II (often", "abbreviated to WWII or WW2), also known as the Second World War, was a global war that lasted from 1939 to 1945."]

Duplicate Removal

If you want to return an array of words, the result will include duplicate strings. To remove duplicates you can use nlp.remove_duplicates.

const text =
  "On 22 June 1941, the European Axis powers launched an invasion of the Soviet Union, opening the largest land theatre of war in history, which trapped the Axis, most crucially the German Wehrmacht, into a war of attrition. World War II (often abbreviated to WWII or WW2), also known as the Second World War, was a global war that lasted from 1939 to 1945.";

const verbArray = await nlp.parse_verbs(text);
// ["war", "war", "war", "war", "war", "world", "world", "world", "axis", "axis", "ww2", "wwii", "land", "wehrmacht", "union", "powers", "attrition"]

const result = nlp.remove_duplicates(verbArray);

// ["war", "world", "axis", "ww2", "wwii", "land", "wehrmacht", "union", "powers", "attrition"]

Top n Words in a String

const text =
  "On 22 June 1941, the European Axis powers launched an invasion of the Soviet Union, opening the largest land theatre of war in history, which trapped the Axis, most crucially the German Wehrmacht, into a war of attrition. World War II (often abbreviated to WWII or WW2), also known as the Second World War, was a global war that lasted from 1939 to 1945.";

// Arguments are text and cutoff (Top n Words). Returns an array of objects.
const result = nlp.top_words(text, 5);

[
  { word: "the", count: 6 },
  { word: "of", count: 3 },
  { word: "war", count: 3 },
  { word: "Axis", count: 2 },
  { word: "a", count: 2 }
];

spacy-nlp's People

Contributors

eswidler avatar kengz avatar klemensz avatar seearms avatar thetechie 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  avatar

spacy-nlp's Issues

Support for SIGTERM handling not possible if spacy-nlp package is included in project

Background:
SIGTERM handling is required for graceful shutdown of node based micro service while running on Kubernetes. An example for SIGTERM graceful handling by node project would the following code (can be tested by sending "kill -15 pid" to the node process id).
process.on('SIGTERM', () => {
console.log('Just Received SIGTERM.');
});

Issue:
When a node project is dependant upon spacy-nlp packge then even if the above code is included in the node project, sending "kill -15 pid" to node process id results in error "INFO Exit: killed ioClient.js children" and node process exits without graceful shutdown.

Error logging in caller appears to be affected

Hi there,

It's really great to be able to use the Spacy.io parser with Node.js thanks to these modules. But it seems adversely to affect the error handling of my own code.

I have a server script that communicates, via socket.io, with a client written in React.js. The server script, server.js, passes text to a parser dependent on spacy-nlp, which I've implemented like so:

nlp_server.js:
const spacyNLP = require('spacy-nlp')

var serverPromise = spacyNLP.server({ port: process.env.IOPORT })
.catch(err => console.error(err));

parser.js:
const spacyNLP = require('spacy-nlp');

const nlp = spacyNLP.nlp;

And in server.js, I make calls to parser.js, e.g.:
const parser = require('./parser.js'); parser.parse(text).then(result => console.log(result)).catch(error => console.error(error));

The server.js script uses a socket.io connection to the client on a completely different port, and I think I've got error handlers everywhere I should that pipe errors to the console. But when using spacy-nlp, various errors in my code fail to bubble up with the full stack trace:

screenshot

When I replace the nlp dependency in server.js with a dummy object, error logging to the console is verbose as usual.

It may be that I'm overlooking something obvious, so please pardon my ignorance if that's the case.

Thanks!

no module named "socketIO_client_nexus"

I'm getting the following error upon installation and startup:

File "/Users/colinarmstrong/src/memoryvue2/node_modules/spacy-nlp/src/client.py", line 13, in <module
    from socketIO_client_nexus import SocketIO, WebsocketTransport
ModuleNotFoundError: No module named 'socketIO_client_nexus'

Changing socketIO_client_nexus to socketIO_client fixes this.

Errors out on windows 10

Trying to use this module on windows 10 but have not had any luck. I am using python v 3.6 and spaCy v 1.8.1.

When I try to create the server connection I get the following error.
[Mon Nov 13 2017 17:39:17 GMT+0000 (GMT Standard Time)] ERROR
[Mon Nov 13 2017 17:39:17 GMT+0000 (GMT Standard Time)] ERROR

Does this module support windows 10?

ImportError: No module named six

Greetings,

I am having a great deal of trouble getting started with spacy-nlp.

I keep getting the following message:

"node_modules/spacy-nlp/src/client.py", line 10, in
[Fri Jun 22 2018 22:20:42 GMT-0700 (PDT)] ERROR import six
ImportError: No module named six"

I have installed, uninstalled and reinstalled six using pip, but still no dice.

I wonder if the error could be connected to the fact that my computer (mac os x) came with Python on it, so when I installed Python 3.6 I have had to specify it specifically since there are two versions on the same computer.

For instance "Python3.6 -m pip install six"

I notice it says...

INFO Starting socketIO client for python at 6466

When I run "node spacyserver.js". Do I need to specify to use version 3 somewhere? How would I do that?

Thanks so much! I'm at my wit's end trying to get an NLP to function on my computer.

Unhandled rejection TypeError: Cannot read property 'output' of undefined

Hello kengz,

Great work with the modules.

I am facing an error while following the steps in tutorial.

image

package json :

{ "name": "nlp-app", "version": "1.0.0", "description": "Sample app", "main": "app.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1" }, "author": "Test", "license": "ISC", "dependencies": { "poly-socketio": "1.1.4", "spacy-nlp": "^1.0.7" } }

npm install gives error: Cannot read property '0' of undefined

Hi,

Trying to install on my macbook pro (mac osx 10.13.4). After installing socketIO-client and updating spacy to version 2.0.11, npm install gives error Cannot read property '0' of undefined.

The last few lines in the log show:
3812 verbose stack TypeError: Cannot read property '0' of undefined
3812 verbose stack at rmStuff (/usr/local/lib/node_modules/npm/lib/unbuild.js:61:24)
3812 verbose stack at tryCatcher (/usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/util.js:16:23)
3812 verbose stack at ret (eval at makeNodePromisifiedEval (/usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/promisify.js:184:12), :13:39)
3812 verbose stack at lifecycle.then.then (/usr/local/lib/node_modules/npm/lib/install/action/unbuild.js:12:12)
3812 verbose stack at tryCatcher (/usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/util.js:16:23)
3812 verbose stack at Promise._settlePromiseFromHandler (/usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:512:31)
3812 verbose stack at Promise._settlePromise (/usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:569:18)
3812 verbose stack at Promise._settlePromise0 (/usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:614:10)
3812 verbose stack at Promise._settlePromises (/usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:693:18)
3812 verbose stack at Promise._fulfill (/usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:638:18)
3812 verbose stack at /usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/nodeback.js:42:21
3812 verbose stack at

$ python -V
Python 3.6.4 :: Anaconda custom (64-bit)

$ npm --version
5.8.0

I hope to see a fix - this would be a useful piece of my application.

Colin Goldberg
spacy-nlp-debug.log

How do I listen for serverPromise to let me know spacy is loaded?

Hi @kengz , thank you for creating this NodeJS module for Spacy!

Can you please let me know how I can use the serverPromise object to know when Spacy has been loaded?

Currently I just timeout for 15s and then use the spacy-nlp.nlp object.

const spacyNLP = require('spacy-nlp')
var serverPromise = spacyNLP.server({ port: process.env.IOPORT })

serverPromise.then(function(){
    // This runs before the INFO All 1 IO clients have joined msg	
    const nlp = spacyNLP.nlp
})

Thanks in advance!

Error with Socketio-client

I was getting the error on Ubuntu 17.10:

ERROR Traceback (most recent call last):
File "/home/xxx/.local/lib/python3.6/site-packages/socketIO_client/init.py", line 76, in _get_engineIO_session
transport.recv_packet())
(STDERR) StopIteration

To fix this, I had to remove the socketIO-client and import socketIO-client-nexus for it to work. It seems this was the cause:

socketIO-client
https://travis-ci.org/invisibleroads/socketIO-client
The library doesn't support socket.io protocol version 2.0

Hopefully this helps another that comes across this issue.

Load other language model

How do I tell spacy-nlp to load the german model without forking spacy-nlp and changing the imports?

Unexpected token in const { spawn } = require('child_process')

I am using trying to use [email protected] on node v4.2.6 on Ubuntu (16.04).

In the node shell, > const spacyNLP = require("spacy-nlp"); generates the following error:

/home/dd/node_modules/spacy-nlp/src/start-io.js:3
const { spawn } = require('child_process')
      ^
SyntaxError: Unexpected token {
    at exports.runInThisContext (vm.js:53:16)
    at Module._compile (module.js:374:25)
    at Object.Module._extensions..js (module.js:417:10)
    at Module.load (module.js:344:32)
    at Function.Module._load (module.js:301:12)
    at Module.require (module.js:354:17)
    at require (internal/module.js:12:17)
    at Object.<anonymous> (/home/adarsh/node_modules/spacy-nlp/index.js:2:16)
    at Module._compile (module.js:410:26)
    at Object.Module._extensions..js (module.js:417:10)

Looking for new maintainer

Due to another side project I am no longer able to manage the Github issues and feature requests here. Hence, spacy-nlp is looking for a new maintainer.

Currently there are 3 crucial issues with help needed:

  • update to the latest spaCy version. this package still uses v1
  • interface between node and python: #5
  • python websocket library issue: #1 and #14

Anyone who fixes some of these issues may be considered as a new maintainer for spacy-nlp, if they wish so. Thank you in advance.

Polysocket.io throwing error in console without any information

After installing below dependencies, when i start the server with node. Error is displayed on console. unable to start the spacy server.
python3 -m pip install -U socketIO-client-nexus
python3 -m pip install -U spacy==2.1.3
python3 -m spacy download en_core_web_md

install this npm package

npm i --save spacy-nlp

Contents in JS file -
const spacyNLP = require("spacy-nlp")
// default port 6466
// start the server with the python client that exposes spacyIO (or use an existing socketIO server at IOPORT)
var serverPromise = spacyNLP.server({ port: process.env.IOPORT });
// Loading spacy may take up to 15s

Environment - Cent os 7, Amazon Ec2 instance.

image

Kindly help.

Spacy readiness

// Loading spacy may take up to 15s

Can I determine whether spacy has finished loading?

Error : py handle fails. <class 'ValueError'>

try {
nlp.parse('Bob Brought the pizza to Alice.').then(function(output) {
console.log(output);
// console.log(JSON.stringify(output[0].parse_tree, null, 2));
// res.send(JSON.stringify(output[0].parse_tree, null, 2));

    });
}catch (e) {
    console.log("error");
    console.log(e);
}

output is null.
Please let me know. I followed the tutorial and was able to start the server just fine.

ModuleNotFoundError: No module named 'websocket'

Followed your instructions and when I node index.js launch the index.js file with

const spacyNLP = require("spacy-nlp");
// default port 6466
// start the server with the python client that exposes spacyIO (or use an existing socketIO server at IOPORT)
var serverPromise = spacyNLP.server({ port: process.env.IOPORT });
// Loading spacy may take up to 15s

I get the following error:

[Fri Jun 05 2020 13:50:21 GMT+0200 (Central European Summer Time)] ERROR Traceback (most recent call last):
  File "/Users/deemeetree/Documents/Root/spacyorig/node_modules/spacy-nlp/src/client.py", line 12, in <module>
    import websocket
ModuleNotFoundError: No module named 'websocket'

Even though websocket was installed on my system.

Why is that?

error: incompatible websocket

Hello! I've tried a few different ways (python3, python2, uninstalling/reinstalling everything), but always get the following error when I run a quick test.

Test code:

var spacyNLP = require('spacy-nlp');
var serverPromise = spacyNLP.server({ port: process.env.IOPORT })

Error:
screen shot 2016-12-04 at 9 55 25 pm

Any ideas? Thank you!

[Sun Dec 04 2016 21:52:11 GMT-0500 (EST)] INFO Starting poly-socketio server on port: 6466, expecting 1 IO clients
[Sun Dec 04 2016 21:52:11 GMT-0500 (EST)] INFO Starting socketIO client for python at 6466
[Sun Dec 04 2016 21:52:11 GMT-0500 (EST)] ERROR An incompatible websocket library is conflicting with the one we need.
You can remove the incompatible library and install the correct one
by running the following commands:

yes | pip uninstall websocket websocket-client
pip install -U websocket-client

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.