Spaces:
Running
Running
Update test.py
Browse files
test.py
CHANGED
@@ -18,8 +18,7 @@ url = "https://www.kaggle.com/datasets/rahulgoel1106/xenophobia-on-twitter-durin
|
|
18 |
url2 = "https://huggingface.co/cardiffnlp/twitter-roberta-base-sentiment-latest"
|
19 |
url3 = "https://vega.github.io/vega/docs/transforms/wordcloud/"
|
20 |
url4 = "https://huggingface.co/spaces/jwu249/is445_final"
|
21 |
-
|
22 |
-
st.write("Trained Sentiment Analyzer -> [Huggicardiffnlp / twitter-roberta-base-sentiment-latest](%s)" % url2)
|
23 |
|
24 |
multi = '''This visualization aims to help the public understand the xenophobia on Twitter during Covid-19,
|
25 |
the data used is from the Kaggle dataset linked above. The data in this visualization has been ran through a trained data model set on Twitter for sentiment.
|
@@ -42,7 +41,10 @@ For the next part and the visual you're seeing now, it is called a word cloud wh
|
|
42 |
the bigger the word becomes in the visual. To help you understand the word cloud better, I added different colors for each sentiments when you select them. Also I add small texts for the interactions to help you understand what they mean. Additionally, included are different sources for inspiration for this visual. So feel free to
|
43 |
check them out if you want to learn more about word clouds. '''
|
44 |
st.markdown(multi)
|
|
|
|
|
45 |
st.write("Step 2 Expert Visualization: %s" % url4)
|
|
|
46 |
# Load sentiment scores and cleaned text data
|
47 |
data = pd.read_csv('sentiment_scores.csv')
|
48 |
df = pd.read_csv('Xenophobia.csv', encoding='latin1', nrows=5000)
|
|
|
18 |
url2 = "https://huggingface.co/cardiffnlp/twitter-roberta-base-sentiment-latest"
|
19 |
url3 = "https://vega.github.io/vega/docs/transforms/wordcloud/"
|
20 |
url4 = "https://huggingface.co/spaces/jwu249/is445_final"
|
21 |
+
|
|
|
22 |
|
23 |
multi = '''This visualization aims to help the public understand the xenophobia on Twitter during Covid-19,
|
24 |
the data used is from the Kaggle dataset linked above. The data in this visualization has been ran through a trained data model set on Twitter for sentiment.
|
|
|
41 |
the bigger the word becomes in the visual. To help you understand the word cloud better, I added different colors for each sentiments when you select them. Also I add small texts for the interactions to help you understand what they mean. Additionally, included are different sources for inspiration for this visual. So feel free to
|
42 |
check them out if you want to learn more about word clouds. '''
|
43 |
st.markdown(multi)
|
44 |
+
st.write("Dataset Link to Download -> [Kaggle Covid-19 Xenophobic Datatset](%s)" % url)
|
45 |
+
st.write("Trained Sentiment Analyzer -> [Huggicardiffnlp / twitter-roberta-base-sentiment-latest](%s)" % url2)
|
46 |
st.write("Step 2 Expert Visualization: %s" % url4)
|
47 |
+
st.header('''Sentiment Word Cloud''')
|
48 |
# Load sentiment scores and cleaned text data
|
49 |
data = pd.read_csv('sentiment_scores.csv')
|
50 |
df = pd.read_csv('Xenophobia.csv', encoding='latin1', nrows=5000)
|