This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from google.colab import drive | |
drive.mount('/content/gdrive') | |
import gensim | |
from gensim.models import KeyedVectors | |
import numpy as np | |
import pandas as pd | |
import nltk | |
from nltk import word_tokenize |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def make_autopct(values): | |
def my_autopct(pct): | |
total = sum(values) | |
val = int(round(pct*total/100.0)) | |
return '{p:.1f}% ({v:d})'.format(p=pct,v=val) | |
return my_autopct | |
def plotPieChart(column): | |
freq_count = Counter(df[column]) | |
fig, ax = plt.subplots(figsize=(15, 7), subplot_kw=dict(aspect="equal")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pandas as pd | |
import matplotlib.pylab as plt | |
import numpy as np | |
from collections import Counter | |
from wordcloud import WordCloud, STOPWORDS | |
from gensim.summarization.summarizer import summarize | |
from gensim.summarization import keywords | |
from IPython.display import display, Markdown |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from sklearn.metrics import confusion_matrix | |
import matplotlib.pylab as plt | |
# Train/Test split was done earlier hence I just need to use Xtest and Ytest | |
result = [] | |
for feature in Xtest: | |
p = get_prediction(feature, model_name) | |
result.append(p.payload[0].display_name) | |
labels = ['Optional', 'Trivial', 'Minor', 'Major', 'Critical', 'Blocker'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# write training data function | |
def write_training_data_to_zipfile(path, Xdata, Ydata): | |
os.chdir(path) | |
count = {} | |
num_rows = Xdata.shape[0] | |
for i in range(1,num_rows): | |
label = Ydata.iloc[i] | |
feature = Xdata.iloc[i] | |
folder = path + "/" + label | |
if not os.path.exists(folder): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# [START gae_python38_app] | |
from flask import Flask, request | |
import sys | |
import os | |
from google.api_core.client_options import ClientOptions | |
from google.cloud import automl_v1 | |
from google.cloud.automl_v1.proto import service_pb2 | |
# If `entrypoint` is not defined in app.yaml, App Engine will look for an app | |
# called `app` in `main.py`. |