Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Browser support #43

Closed
calebeaires opened this issue Sep 15, 2018 · 14 comments
Closed

Browser support #43

calebeaires opened this issue Sep 15, 2018 · 14 comments
Labels
question Further information is requested

Comments

@calebeaires
Copy link

Is browser support on the roadmap? I have tried to use this module an Angular 6 application?

@jesus-seijas-sp
Copy link
Contributor

Hello!
The answer is yes, is one of the ideas for the 3.0. In fact, the debate about using lerna and split in a monorepo, is with the objective of having small pieces that can be imported independently, and this will allow to target browser without having a huge impact in the size (all the dictionaries for sentiment analysis, and so on).

@jesus-seijas-sp jesus-seijas-sp added the question Further information is requested label Sep 16, 2018
@calebeaires
Copy link
Author

Thats great.

To some cases when dev with SPA apps made with with angular/react/vue, size is not such a problem!

@revolunet
Copy link

revolunet commented Oct 2, 2018

tried to compile with browserify or webpack but there is still an issue with natural + memory-fs.

the bundle size is around 3.5Mb

NaturalNode/natural#25

@jesus-seijas-sp
Copy link
Contributor

Hi @revolunet and welcome! I'm working on having Natural out of the equation, implementing the tokenizers and stemmers. As soon as I finish, we can try again, and I expect that it will be possible to generate a frontend ready version.

@revolunet
Copy link

have you heard of https://github.com/Yomguithereal/talisman maybe ?

@jesus-seijas-sp
Copy link
Contributor

Hi @revolunet, yes, but is not needed in this case, we have already the tokenizers/stemmers.
I've it working in the browser in the branch https://github.com/axa-group/nlp.js/tree/feature/without_natural
The bundle is 3.8MB.
The CON: No chinese due to tokenize using novel-segment, and novel-segment is not browser compatible at all. this branch is WIP, I will look for a way of doing novel-segment browser compatible, and also organize the code.
But right now... it's working!!!!
At the root you'll find bundle.js and an example index.html

@revolunet
Copy link

Hi,
Looks like the experimental branch is gone; is there a way to check it out to understand how far we are from browser support ?

@jseijas
Copy link
Contributor

jseijas commented Nov 12, 2018

Hi, that's because is merged!
https://github.com/axa-group/nlp.js/tree/master/dist
There you have the dist (I detected that is not fully minimified... I have to know wht) and an index.html with an example.
And is published also so you can import it from node modules.

@revolunet
Copy link

Ho 😻, that's pretty awesome, thanks a lot !
How did you build this file ?

@jesus-seijas-sp
Copy link
Contributor

Well, I installed browserify and uglify-es globally: https://www.npmjs.com/package/uglify-es
then
browserify ./lib | uglifyjs > ./dist/bundle.js

@revolunet
Copy link

Would it be possible to "compute" the model on the server then just "consume" it on the client ?

@jseijas
Copy link
Contributor

jseijas commented Nov 20, 2018

Yes of course

@linonetwo
Copy link

The CON: No chinese due to tokenize using novel-segment, and novel-segment is not browser compatible at all. this branch is WIP, I will look for a way of doing novel-segment browser compatible, and also organize the code.

We are discussing how to make it browser compatible:
bluelovers/node-segment-dict#1

@jesus-seijas-sp
Copy link
Contributor

Closing as it was solved

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

5 participants