A Streamlit App for annotating randomized Tweets.
- Deployed on Streamlit Community Cloud (allows for one free private App)
- Assigned randomized groups of Tweets to users.
Cover Page -> Demographics -> Instruction -> Annotation -> End Cover
gcsManager.py
: Manage Google Cloud Storage Connection
LoginVerification.py
: Login fuction on the Cover Page
SurveyData.py
: Handle data randomization
Demographics.py
: Handle Demographic Page (record new user's demographic + register the user)
SurveyForm.py
: Handle data annotation
SurveyText.py
: All text component
SurveyState.py
: Initialize session_state
- Set up your Google Cloud Storage Bucket for your datasets and directory needed.
your_gcs_bucket
│ all-tweet.csv # Upload your data
│ users_all.csv # Register users
| group_annotation_progress.csv # track annotated groups
│
└───User_Annotation # User's annotation for each Tweet
│ │ User{user1}_annotation.csv
│ │ User{user2}_annotation.csv
│ │ ...
│
└───User_Progress # User's progress (ID of annotated/remaining Tweets, Exceptions)
│ User{user1}_progress.csv
│ User{user2}_progress.csv
│ ...
- all-tweet.csv: View Example
- users_all.csv: [user_id, randomized_tweet_group_start_id, age, education, politic_ideology]
- User{user1}_annotation.csv: [username, tweetURL, Q1, Q2, Q3, Q4]
- User{user1}_progress.csv: [username, group_id, completed_tweet, , emergency_round] -group_annotation_progress.csv: View Example
- Clone the repository, upload the codes to your Github.
- Go to Stremlit Cloud and create a New App.
- Select your repository and deploy.
- Copy your Google Cloud Storage Credentials (JSON) as follows, and paste in the App's Settings > Secrets.
[gcp_service_account]
key="""{"type": "service_account”, … ,"universe_domain": "googleapis.com"}"""
- Modify the following as needed:
- Filepath to your datasets
- Number of Tweets to annotate per user (Default: 2*10Tweets)
- Annotation Questions
- To develop locally, you might need to set up related certificates.
- If you are developing & deploying real-timely on Streamlit Community Cloud and encountered some strange bugs, try Reboot the App (this will cause reinitialization of session_state).
Feel free to contact Gloria via Slack / bguoac@uw.edu if you encountered any issues. :>
- Streamlit Components: https://docs.streamlit.io/
- Deploy the App: https://docs.streamlit.io/streamlit-community-cloud/get-started/deploy-an-app
- Connect to Google Cloud Storage: https://docs.streamlit.io/develop/tutorials/databases/gcs