[PYTHON] I tried launching jupyter nteract on heroku server

Trigger

Using flask and heroku, I made various text mining / visualization web applications. One day, I get to know nteract.

nteract https://github.com/nteract/nteract https://blog.nteract.io/designing-the-nteract-data-explorer-f4476d53f897 I don't think it's a jupyter notebook with an automatic interactive visualization function.

"Oh, you can visualize this much with the same effort as displaying a pandas DataFrame. You have to try this. ... Don't fall if you use heavy data ... There may be some weaknesses, but if it is a web application, it can be visualized quickly when you want to do it from anywhere regardless of hardware. In a sense, it's more convenient than the more restrictive Google Colaboratory. "

So, I tried running nteract on heroku.

reference

For studying machine learning using Python, set up a Jupyter Notebook on Heroku's free frame so that you can run it from your smartphone and share it. https://qiita.com/G-awa/items/8530a10cb847e4080df3

Deploy a Jupyter Notebook Online with Voila and Heroku https://pythonforundergradengineers.com/deploy-jupyter-notebook-voila-heroku.html

Constitution

heroku: As an application server nteract: Start on heroku github private: As a file server

code

--Create and deploy the following files. It works if you open heroku open or the specified address. --Caution: Security-related processing such as passwords is excluded. It is highly recommended to add. --Note: github's privatete is used as a file server, but I will omit the explanation.

Folder structure


xxxxxx (Any)
 ┣  Procfile
 ┣  requirements.txt
 ┣  start_jupyter
┗ (Any ipynb file, etc.)

requirements.txt Please increase or decrease the important points


gunicorn==19.9.0
click==7.1.1
Flask==1.1.2
itsdangerous==1.1.0
Jinja2==2.11.2
MarkupSafe==1.1.1
numpy==1.18.3
pandas==1.0.3
plotly==4.6.0
python-dateutil==2.8.1
pytz==2019.3
retrying==1.3.3
six==1.14.0
Werkzeug==1.0.1
xlrd==1.2.0

nteract_on_jupyter
matplotlib
PyGithub

Procfile


web: chmod +x start_jupyter ; start_jupyter

start_jupyter


#!/usr/bin/env bash
jupyter nteract --no-browser --ip=* --port=$PORT
$ cd xxxxxx
$ git init
$ heroku create xxxxxx 
$ git add .
$ git commit -m "first"
$ git push heroku master

Operation example

image.png

reference

In short, you may put mecab etc.

The record I was addicted to when putting MeCab on Heroku  https://qiita.com/kzuzuo/items/1b3e9c9af57bd4464690

Next, let's change to nteract base ...

Similar visualization method between relatively long sentences such as patents: tfidf / cluster vis: tfidf-word2vec-clustering visualization  https://qiita.com/kzuzuo/items/8a80d8974bf3a7db7e54

Recommended Posts

I tried launching jupyter nteract on heroku server
[Pythonocc] I tried using CAD on jupyter notebook
I tried using Jupyter
I tried python on heroku for the first time
I tried using PySpark from Jupyter 4.x on EMR
I tried to touch jupyter
I tried MLflow on Databricks
I tried AdaNet on table data
I tried Cython on Ubuntu on VirtualBox
Somehow I tried using jupyter notebook
I tried VS Code's Jupyter notebook
I tried to create a server environment that runs on Windows 10
I tried to visualize BigQuery data using Jupyter Lab on GCP
I tried the asynchronous server of Django 3.0
I tried linebot with flask (anaconda) + heroku
Build jupyter notebook on remote server (CentOS)
I tried simple image recognition with Jupyter
Run Jupyter notebook on a remote server
I tried using Remote API on GAE / J
I tried running YOLO v3 on Google Colab
Enable Jupyter Notebook with conda on remote server
I tried using firebase for Django's cache server
I tried to start Jupyter with Amazon lightsail
I tried LINE Message API (line-bot-sdk-python) on GAE
Remotely open Jupyter notebook launched on the server
I tried playing with the calculator on tkinter
Redis on Heroku
I tried scraping
I tried PyQ
shimehari on heroku
Golang on jupyter
I tried AutoKeras
I tried studying on the WEB server side at an in-house Python study session
Jupyter on AWS
I tried papermill
I tried django-slack
I tried Django
I tried to make it easy to change the setting of authenticated Proxy on Jupyter
I tried spleeter
I tried cgo
I tried to implement Minesweeper on terminal with python
I tried a visual regression test on GitHub Pages
I sent regular emails from sendgrid on heroku, on python
[Python] I tried running a local server using flask
I tried input interpolation on UE4 Python VS Code
I tried Kaokore, a Japanese classic dataset, on EfficientNet.
I tried installing the Linux kernel on virtualbox + vagrant
I tried to notify the honeypot report on LINE
I tried to install scrapy on Anaconda and couldn't