This repo analyze the replies and quote tweets of a tweet based on the provided tweet ID and perform topic modeling using Latent Dirichlet Allocation (LDA)
The replies and quote tweets are retrived from twitter using Twitter API so twitter developer access are required to run the code.
-
Git clone the repo
git clone https://github.com/haizadtarik/tweets-topic-modeling.git
-
Install Dependencies
pip install -r requirements.txt
-
Create
.env
file and specify BEARER_TOKENBEARER_TOKEN = <BEARER_TOKEN_FROM_TWITTER_DEVELOPER_DASHBOARD>
-
Run the anlyze script
python analyze.py --id <TWEET_ID> --params <PARAM_1> <PARAM_2> ... <PARAM_N>
-
Result can be viewed by opening the generated html file in web browser