Andy Lau commited on
Commit
ace0635
·
1 Parent(s): 4994bfb

clean up the code

Browse files
Files changed (2) hide show
  1. FunctionsModelSA_V1.py +0 -9
  2. app.py +0 -9
FunctionsModelSA_V1.py CHANGED
@@ -1,4 +1,3 @@
1
- # import s3fs
2
  import pandas as pd
3
  import numpy as np
4
  from numpy import arange
@@ -18,17 +17,11 @@ from scipy import spatial
18
  import re
19
  import pytorch_lightning as pl
20
  from bs4 import BeautifulSoup
21
- # import ipywidgets as widgets
22
- # from ipywidgets import FileUpload
23
- # from urlextract import URLExtract
24
  from transformers import BertTokenizerFast as BertTokenizer, BertModel, BertConfig
25
  import torch.nn as nn
26
  import torch
27
- # from ipywidgets import interact, Dropdown
28
  import boto3
29
- # from sagemaker import get_execution_role
30
  from scipy import spatial
31
- # from ipyfilechooser import FileChooser
32
  import streamlit as st
33
  import utils
34
 
@@ -57,8 +50,6 @@ PARAMS={
57
  'campaign_type_Usage_and_Consumption', 'campaign_type_Webinar']
58
  }
59
 
60
- # # CI_rates=pd.read_csv('CI_RATES.csv')
61
- # s3://emailcampaignmodeldata/ModelSADataSets/CI_RATES.csv
62
  CI_rates = utils.get_files_from_aws('emailcampaignmodeldata','ModelSADataSets/CI_RATES.csv')
63
 
64
  ### create file uploading widget
 
 
1
  import pandas as pd
2
  import numpy as np
3
  from numpy import arange
 
17
  import re
18
  import pytorch_lightning as pl
19
  from bs4 import BeautifulSoup
 
 
 
20
  from transformers import BertTokenizerFast as BertTokenizer, BertModel, BertConfig
21
  import torch.nn as nn
22
  import torch
 
23
  import boto3
 
24
  from scipy import spatial
 
25
  import streamlit as st
26
  import utils
27
 
 
50
  'campaign_type_Usage_and_Consumption', 'campaign_type_Webinar']
51
  }
52
 
 
 
53
  CI_rates = utils.get_files_from_aws('emailcampaignmodeldata','ModelSADataSets/CI_RATES.csv')
54
 
55
  ### create file uploading widget
app.py CHANGED
@@ -3,9 +3,6 @@ import FunctionsModelSA_V1
3
  import streamlit as st
4
  import pandas as pd
5
  import PIL
6
- # import re
7
- # from io import StringIO
8
- # import boto3
9
  import time
10
 
11
  import main_app
@@ -62,11 +59,6 @@ def add_bg_from_url():
62
 
63
  st.markdown("# Sentiment Analysis: Email Industry")
64
 
65
- # col1, col2, col3 = st.columns([1,1,1])
66
-
67
- # with col2:
68
- # img = PIL.Image.open("figures/ModelCC_solid.png")
69
- # st.image(img)
70
 
71
  stats_col1, stats_col2, stats_col3, stats_col4 = st.columns([1,1,1,1])
72
 
@@ -171,4 +163,3 @@ if st.button('Generate Predictions'):
171
  FunctionsModelSA_V1.corrections(best_target_tones,test_predictions,streamlit=True)
172
 
173
  placeholder.empty()
174
- # print(time.time() - start_time)
 
3
  import streamlit as st
4
  import pandas as pd
5
  import PIL
 
 
 
6
  import time
7
 
8
  import main_app
 
59
 
60
  st.markdown("# Sentiment Analysis: Email Industry")
61
 
 
 
 
 
 
62
 
63
  stats_col1, stats_col2, stats_col3, stats_col4 = st.columns([1,1,1,1])
64
 
 
163
  FunctionsModelSA_V1.corrections(best_target_tones,test_predictions,streamlit=True)
164
 
165
  placeholder.empty()