Spaces:
Runtime error
Runtime error
Andy Lau
commited on
Commit
·
c4ceb88
1
Parent(s):
4e78a59
wip
Browse files
utils.py
CHANGED
@@ -1,31 +1,7 @@
|
|
1 |
# import s3fs
|
2 |
|
3 |
import pandas as pd
|
4 |
-
import numpy as np
|
5 |
-
from numpy import arange
|
6 |
-
from colour import Color
|
7 |
-
import plotly.graph_objects as go
|
8 |
-
from nltk import tokenize
|
9 |
-
from IPython.display import Markdown
|
10 |
-
from PIL import ImageColor
|
11 |
-
from vaderSentiment.vaderSentiment import SentimentIntensityAnalyzer
|
12 |
-
import nltk
|
13 |
-
nltk.download('punkt')
|
14 |
-
from io import StringIO
|
15 |
-
from scipy import spatial
|
16 |
-
import re
|
17 |
-
import pytorch_lightning as pl
|
18 |
-
from bs4 import BeautifulSoup
|
19 |
-
import ipywidgets as widgets
|
20 |
-
from ipywidgets import FileUpload
|
21 |
-
from urlextract import URLExtract
|
22 |
-
from transformers import BertTokenizerFast as BertTokenizer, BertModel, BertConfig
|
23 |
-
import torch.nn as nn
|
24 |
-
import torch
|
25 |
-
from ipywidgets import interact, Dropdown
|
26 |
import boto3
|
27 |
-
# from sagemaker import get_execution_role
|
28 |
-
from scipy import spatial
|
29 |
from bokeh.models.widgets import Div
|
30 |
import streamlit as st
|
31 |
|
@@ -56,29 +32,3 @@ def url_button(button_name,url):
|
|
56 |
div = Div(text=html)
|
57 |
st.bokeh_chart(div)
|
58 |
|
59 |
-
|
60 |
-
|
61 |
-
PARAMS={
|
62 |
-
'BATCH_SIZE': 8,
|
63 |
-
'MAX_TOKEN_COUNT':100,
|
64 |
-
'BERT_MODEL_NAME':'google/bert_uncased_L-2_H-128_A-2' ,
|
65 |
-
'N_EPOCHS': 10,
|
66 |
-
'n_classes':8,
|
67 |
-
'LABEL_COLUMNS': ['label_analytical', 'label_casual', 'label_confident', 'label_friendly',
|
68 |
-
'label_joyful', 'label_opstimistic', 'label_respectful',
|
69 |
-
'label_urgent'],
|
70 |
-
'TEXTCOL': 'text',
|
71 |
-
'rf_labels':['label_analytical', 'label_casual', 'label_confident',
|
72 |
-
'label_friendly', 'label_joyful', 'label_opstimistic',
|
73 |
-
'label_respectful', 'label_urgent',
|
74 |
-
'industry_Academic and Education', 'industry_Energy',
|
75 |
-
'industry_Entertainment', 'industry_Finance and Banking',
|
76 |
-
'industry_Healthcare', 'industry_Hospitality', 'industry_Real Estate',
|
77 |
-
'industry_Retail', 'industry_Software and Technology',
|
78 |
-
'campaign_type_Abandoned_Cart', 'campaign_type_Engagement',
|
79 |
-
'campaign_type_Newsletter', 'campaign_type_Product_Announcement',
|
80 |
-
'campaign_type_Promotional', 'campaign_type_Review_Request',
|
81 |
-
'campaign_type_Survey', 'campaign_type_Transactional',
|
82 |
-
'campaign_type_Usage_and_Consumption', 'campaign_type_Webinar']
|
83 |
-
}
|
84 |
-
|
|
|
1 |
# import s3fs
|
2 |
|
3 |
import pandas as pd
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4 |
import boto3
|
|
|
|
|
5 |
from bokeh.models.widgets import Div
|
6 |
import streamlit as st
|
7 |
|
|
|
32 |
div = Div(text=html)
|
33 |
st.bokeh_chart(div)
|
34 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|