naufalnashif commited on
Commit
e6b9234
1 Parent(s): e596d85

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -0
app.py CHANGED
@@ -12,6 +12,9 @@ import matplotlib.pyplot as plt
12
  import seaborn as sns
13
  from wordcloud import WordCloud
14
 
 
 
 
15
  # Fungsi untuk membersihkan teks dengan ekspresi reguler
16
  @st.cache_data
17
  def clean_text(text):
@@ -181,6 +184,11 @@ if st.button("Analysis") and input_option == "Teks Manual" and user_input:
181
  cleaned_text = clean_text(text)
182
  norm_slang_text = normalize_slang(cleaned_text, lookp_dict)
183
  results.append((text, cleaned_text, norm_slang_text, sentiment_label, emoticon))
 
 
 
 
 
184
  analisis = True
185
 
186
  elif input_option == "Unggah Berkas XLSX" and uploaded_file is not None:
 
12
  import seaborn as sns
13
  from wordcloud import WordCloud
14
 
15
+ from transformers import pipeline
16
+
17
+
18
  # Fungsi untuk membersihkan teks dengan ekspresi reguler
19
  @st.cache_data
20
  def clean_text(text):
 
184
  cleaned_text = clean_text(text)
185
  norm_slang_text = normalize_slang(cleaned_text, lookp_dict)
186
  results.append((text, cleaned_text, norm_slang_text, sentiment_label, emoticon))
187
+ pipe = pipeline('sentiment-analysis')
188
+ st.write ("Model Transformers :")
189
+ if text :
190
+ out = pipe(text)
191
+ st.json(out)
192
  analisis = True
193
 
194
  elif input_option == "Unggah Berkas XLSX" and uploaded_file is not None: