KevSun commited on
Commit
7651a8f
·
verified ·
1 Parent(s): b2d22df

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -3
app.py CHANGED
@@ -3,6 +3,7 @@ from sentence_transformers import SentenceTransformer, util
3
  from sklearn.decomposition import LatentDirichletAllocation
4
  from sklearn.feature_extraction.text import CountVectorizer
5
  from langdetect import detect, DetectorFactory
 
6
 
7
  st.set_page_config(page_title="Multilingual Text Analysis System", layout="wide")
8
 
@@ -70,8 +71,9 @@ if st.button("Analyze"):
70
  embeddings = embedding_agent.get_embeddings(words)
71
  st.success("Word Embeddings Generated.")
72
 
73
- st.write("Words in the input:")
74
- st.write(", ".join(words))
 
75
 
76
  if len(words) > 1:
77
  with st.spinner("Extracting topics..."):
@@ -93,4 +95,4 @@ if st.button("Analyze"):
93
  st.warning("Please enter some text to analyze.")
94
 
95
  st.sidebar.title("About")
96
- st.sidebar.info("This app performs multilingual text analysis using various NLP techniques.")
 
3
  from sklearn.decomposition import LatentDirichletAllocation
4
  from sklearn.feature_extraction.text import CountVectorizer
5
  from langdetect import detect, DetectorFactory
6
+ import numpy as np
7
 
8
  st.set_page_config(page_title="Multilingual Text Analysis System", layout="wide")
9
 
 
71
  embeddings = embedding_agent.get_embeddings(words)
72
  st.success("Word Embeddings Generated.")
73
 
74
+ st.write("Words and their embeddings:")
75
+ for word, embedding in zip(words, embeddings):
76
+ st.write(f"{word}: {embedding}")
77
 
78
  if len(words) > 1:
79
  with st.spinner("Extracting topics..."):
 
95
  st.warning("Please enter some text to analyze.")
96
 
97
  st.sidebar.title("About")
98
+ st.sidebar.info("This app performs multilingual text analysis using various NLP techniques.")