Spaces:
Sleeping
Sleeping
dafiqrahman
commited on
Commit
·
2e34479
1
Parent(s):
88277c0
fix error
Browse files- app.py +4 -0
- script/functions.py +0 -1
app.py
CHANGED
@@ -5,6 +5,7 @@ import plotly.express as px
|
|
5 |
import matplotlib.pyplot as plt
|
6 |
# import text_proc in script folder
|
7 |
import script.text_proc as tp
|
|
|
8 |
|
9 |
# Load data
|
10 |
# add tiwtter logo inside title
|
@@ -79,6 +80,9 @@ if submit:
|
|
79 |
st.pyplot(fig)
|
80 |
st.write("<h3>✨ Sentiment Clustering</h3>",unsafe_allow_html=True)
|
81 |
@st.experimental_singleton
|
|
|
|
|
|
|
82 |
embedding_model = fn.load_sentence_model()
|
83 |
tab4,tab5,tab6 = st.tabs(["Negatif","Netral","Positif"])
|
84 |
with tab4:
|
|
|
5 |
import matplotlib.pyplot as plt
|
6 |
# import text_proc in script folder
|
7 |
import script.text_proc as tp
|
8 |
+
from sentence_transformers import SentenceTransformer
|
9 |
|
10 |
# Load data
|
11 |
# add tiwtter logo inside title
|
|
|
80 |
st.pyplot(fig)
|
81 |
st.write("<h3>✨ Sentiment Clustering</h3>",unsafe_allow_html=True)
|
82 |
@st.experimental_singleton
|
83 |
+
def load_sentence_model():
|
84 |
+
embedding_model = SentenceTransformer('sentence_bert')
|
85 |
+
return embedding_model
|
86 |
embedding_model = fn.load_sentence_model()
|
87 |
tab4,tab5,tab6 = st.tabs(["Negatif","Netral","Positif"])
|
88 |
with tab4:
|
script/functions.py
CHANGED
@@ -4,7 +4,6 @@ import re
|
|
4 |
import snscrape.modules.twitter as sntwitter
|
5 |
from transformers import pipeline
|
6 |
import plotly.express as px
|
7 |
-
from sentence_transformers import SentenceTransformer
|
8 |
|
9 |
def load_sentence_model():
|
10 |
embedding_model = SentenceTransformer('sentence_bert')
|
|
|
4 |
import snscrape.modules.twitter as sntwitter
|
5 |
from transformers import pipeline
|
6 |
import plotly.express as px
|
|
|
7 |
|
8 |
def load_sentence_model():
|
9 |
embedding_model = SentenceTransformer('sentence_bert')
|