Python in browser with NLTK or alternative?

606 Views Asked by At

Is there a Python front-end that supports nltk?

I am building a custom application that needs to do stemming and stopping, and related processing, on a simple words query from inside the browser. I am familiar with nltk's stem/stop functionality, but a quick google of Python front-end alternatives listed in this thread does not turn up support for nltk. I tried pypy.js from its website, entered "import nltk," and it failed.

(I plan to use CherryPy as the back-end, if it matters, to serve up the application to the browser on first contact, and process the outputs.)

Is there a front-end that works with nltk? Alternatively:

  • Can I add nltk support to any of these environments, and how?
  • Is there another library that does stemming/stopping that works with these front-ends?

Thank you!

2

There are 2 best solutions below

1
On

you can use flask to show your python in web browser. Flask is a web framework. This means flask provides you with tools, libraries and technologies that allow you to build a web application. In your case you can use flask to get data from browser and analyse your data and then show the result in browser. you can see a word cloud example with flask here.

1
On

You're probably best off using a JavaScript NLP library of which there are several, like NLPJS, although I can't judge its quality.

If you use Transcrypt in your browser you can use objects and call functions from that library without conversion. So you can program in Python, while your library is in JS.