One Paragraph of project description goes here
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.
input_features: | |
- | |
name: Questions | |
type: text | |
level: word | |
encoder: parallel_cnn | |
output_features: | |
- | |
name: Category0 |
input_features: | |
- | |
name: text | |
type: text | |
level: word | |
encoder: parallel_cnn | |
output_features: | |
- | |
name: category |
def draw_graph3(networkx_graph,notebook=True,output_filename='graph.html',show_buttons=True,only_physics_buttons=False): | |
""" | |
This function accepts a networkx graph object, | |
converts it to a pyvis network object preserving its node and edge attributes, | |
and both returns and saves a dynamic network visualization. | |
Valid node attributes include: | |
"size", "value", "title", "x", "y", "label", "color". | |
(For more info: https://pyvis.readthedocs.io/en/latest/documentation.html#pyvis.network.Network.add_node) |
# install chromium, its driver, and selenium | |
!apt update | |
!apt install libu2f-udev libvulkan1 | |
!wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb | |
!dpkg -i google-chrome-stable_current_amd64.deb | |
!wget https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/118.0.5993.70/linux64/chromedriver-linux64.zip | |
!unzip -j chromedriver-linux64.zip chromedriver-linux64/chromedriver -d /usr/local/bin/ | |
!pip install selenium chromedriver_autoinstaller | |
# set options to be headless, .. |
import re | |
import pandas as pd | |
from google.cloud import bigquery | |
from google.colab import auth | |
PROJECT_ID = 'sql-hunt' # change to your own project | |
class BqTable: | |
def __init__(self, table, dataset='samples', active_project='bigquery-public-data', client=None): |
from xml.dom import minidom | |
from cStringIO import StringIO | |
class Graph(): | |
""" | |
Create a Graph object and get its gexf representation. | |
Add nodes and edges using add_node() and add_edge() methods. | |
Use gexf() to get the file-like object containing the graph. | |
""" |
import multiprocessing | |
import pandas as pd | |
import numpy as np | |
def _apply_df(args): | |
df, func, kwargs = args | |
return df.apply(func, **kwargs) | |
def apply_by_multiprocessing(df, func, **kwargs): | |
workers = kwargs.pop('workers') |